Class AttackWeakest
java.lang.Object
games.stendhal.server.entity.creature.impl.attack.AttackWeakest
- All Implemented Interfaces:
AttackStrategy
A profile for creature that always tries to kill the weakest enemy first.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attacks the target.boolean
canAttackNow(Creature creature)
Can the specified creature do an attack now?boolean
canAttackNow(Creature attacker, RPEntity target)
Can the specified creature do an attack against a specified target?void
findNewTarget(Creature creature)
void
getBetterAttackPosition(Creature creature)
int
getRange()
Get the maximum range of the attacking creature.boolean
hasValidTarget(Creature creature)
-
Constructor Details
-
AttackWeakest
public AttackWeakest()
-
-
Method Details
-
findNewTarget
-
hasValidTarget
-
attack
Description copied from interface:AttackStrategy
attacks the target.- Specified by:
attack
in interfaceAttackStrategy
- Parameters:
creature
- creature doing the attack
-
canAttackNow
Description copied from interface:AttackStrategy
Can the specified creature do an attack now?- Specified by:
canAttackNow
in interfaceAttackStrategy
- Parameters:
creature
- creature doing the attack- Returns:
- true, if it can attack, false otherwise
-
canAttackNow
Description copied from interface:AttackStrategy
Can the specified creature do an attack against a specified target?- Specified by:
canAttackNow
in interfaceAttackStrategy
- Parameters:
attacker
- creature doing the attacktarget
- potential target- Returns:
- true, if it can attack, false otherwise
-
getBetterAttackPosition
-
getRange
public int getRange()Description copied from interface:AttackStrategy
Get the maximum range of the attacking creature.- Specified by:
getRange
in interfaceAttackStrategy
- Returns:
- maximum range
-