Rogue: Savage Rats, a retro-themed dungeon crawler
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
rogue-savage-rats/src/mightypork/rogue/world/entity/impl/GrayRatAi.java

59 lines
831 B

package mightypork.rogue.world.entity.impl;
import mightypork.gamecore.util.math.Calc;
import mightypork.rogue.world.entity.Entity;
public class GrayRatAi extends MonsterAi {
public GrayRatAi(Entity entity)
{
super(entity);
setAttackTime(1.2);
setScanTime(1.5);
}
@Override
protected double getScanRadius()
{
return isSleeping() ? Calc.randInt(2, 4) : Calc.randInt(4, 6);
}
@Override
protected double getAttackDistance()
{
return 1.1;
}
@Override
protected int getAttackStrength()
{
return 1 + (Calc.rand.nextInt(5) == 0 ? 1 : 0);
}
@Override
protected int getPreyAbandonDistance()
{
return Calc.randInt(8, 11);
}
@Override
protected boolean shouldSkipScan()
{
return false;
}
@Override
protected boolean shouldRandomlyAbandonPrey()
{
return false;
}
}