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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattacks the target.booleancanAttackNow(Creature creature) Can the specified creature do an attack now?booleancanAttackNow(Creature attacker, RPEntity target) Can the specified creature do an attack against a specified target?voidfindNewTarget(Creature creature) voidgetBetterAttackPosition(Creature creature) intgetRange()Get the maximum range of the attacking creature.booleanhasValidTarget(Creature creature)
-
Constructor Details
-
AttackWeakest
public AttackWeakest()
-
-
Method Details
-
findNewTarget
-
hasValidTarget
-
attack
Description copied from interface:AttackStrategyattacks the target.- Specified by:
attackin interfaceAttackStrategy- Parameters:
creature- creature doing the attack
-
canAttackNow
Description copied from interface:AttackStrategyCan the specified creature do an attack now?- Specified by:
canAttackNowin interfaceAttackStrategy- Parameters:
creature- creature doing the attack- Returns:
- true, if it can attack, false otherwise
-
canAttackNow
Description copied from interface:AttackStrategyCan the specified creature do an attack against a specified target?- Specified by:
canAttackNowin 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:AttackStrategyGet the maximum range of the attacking creature.- Specified by:
getRangein interfaceAttackStrategy- Returns:
- maximum range
-