Class EntityHitEvent

java.lang.Object
java.util.EventObject
de.gurkenlabs.litiengine.entities.EntityHitEvent
All Implemented Interfaces:
Serializable

public class EntityHitEvent extends EventObject
Event dispatched whenever an ICombatEntity is hit. Carries the executor of the hit, the hit entity, the optional triggering ability, the dealt damage and the resulting kill flag.
See Also:
  • Method Details

    • getDamage

      public int getDamage()
      Gets the damage dealt by the hit.
      Returns:
      the damage
    • getExecutor

      public ICombatEntity getExecutor()
      Gets the entity that caused the hit (the executor of the triggering ability).
      Returns:
      the executor, or null if no ability triggered the hit
    • getHitEntity

      public ICombatEntity getHitEntity()
      Gets the entity that was hit.
      Returns:
      the hit entity
    • wasKilled

      public boolean wasKilled()
      Returns whether the hit killed the target.
      Returns:
      true if the target was killed
    • getAbility

      public Ability getAbility()
      Gets the ability that triggered the hit, if any.
      Returns:
      the triggering ability, or null
    • getTime

      public long getTime()
      Gets the game-time timestamp at which the event was dispatched.
      Returns:
      the timestamp