java.lang.Object
games.stendhal.server.entity.creature.impl.attack.AttackWeakest
All Implemented Interfaces:
AttackStrategy

public class AttackWeakest extends Object
A profile for creature that always tries to kill the weakest enemy first.
  • Constructor Details

    • AttackWeakest

      public AttackWeakest()
  • Method Details

    • findNewTarget

      public void findNewTarget(Creature creature)
    • hasValidTarget

      public boolean hasValidTarget(Creature creature)
    • attack

      public void attack(Creature creature)
      Description copied from interface: AttackStrategy
      attacks the target.
      Specified by:
      attack in interface AttackStrategy
      Parameters:
      creature - creature doing the attack
    • canAttackNow

      public boolean canAttackNow(Creature creature)
      Description copied from interface: AttackStrategy
      Can the specified creature do an attack now?
      Specified by:
      canAttackNow in interface AttackStrategy
      Parameters:
      creature - creature doing the attack
      Returns:
      true, if it can attack, false otherwise
    • canAttackNow

      public boolean canAttackNow(Creature attacker, RPEntity target)
      Description copied from interface: AttackStrategy
      Can the specified creature do an attack against a specified target?
      Specified by:
      canAttackNow in interface AttackStrategy
      Parameters:
      attacker - creature doing the attack
      target - potential target
      Returns:
      true, if it can attack, false otherwise
    • getBetterAttackPosition

      public void getBetterAttackPosition(Creature creature)
    • getRange

      public int getRange()
      Description copied from interface: AttackStrategy
      Get the maximum range of the attacking creature.
      Specified by:
      getRange in interface AttackStrategy
      Returns:
      maximum range