@Override
  public void handleEvent(Event event) {
    super.handleEvent(event);

    // allow only handling event Event.DIED in dead stats
    // probably i need to define rules for which events could be handled in which state
    if (event != Event.DIED && owner.getLifeStats().isAlreadyDead()) return;

    EventHandler eventHandler = eventHandlers.get(event);
    if (eventHandler != null) eventHandler.handleEvent(event, this);
  }
Exemple #2
0
 /** @return the npcAi */
 public AI<? extends Creature> getAi() {
   return ai != null ? ai : AI.dummyAi();
 }