Examples of TurnListener


Examples of games.stendhal.server.core.events.TurnListener

    this.speakerNPC = speakerNPC;
    this.repeatedText = repeatedText;
    listZones();
    SingletonRepository.getTurnNotifier().notifyInTurns(60, this);
    // say something every minute so that can be noticed more easily
    SingletonRepository.getTurnNotifier().notifyInTurns(60, new TurnListener() {

      public void onTurnReached(final int currentTurn) {
        doRegularBehaviour();
        SingletonRepository.getTurnNotifier().notifyInTurns(60 * 3, this);
      }
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

      public void logic() {
       
      }
    };
   
    SingletonRepository.getTurnNotifier().notifyInTurns(1, new TurnListener() {
      public void onTurnReached(int turn) {
        me.damage(amount, attacker);
      }
    });
  }
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

    // we need to do this on the next turn because the
    // client does not get any private messages otherwise
    // sometime the client does not get the map content
    // if it gets a cross zone teleport too early. so we wait
    // 5 seconds.
    SingletonRepository.getTurnNotifier().notifyInSeconds(5, new TurnListener() {
      public void onTurnReached(final int currentTurn) {
        final String name = player.getName();

        final ArrestWarrant arrestWarrant = arrestWarrants.getByName(name);
        if (arrestWarrant == null) {
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

    final String criminalName = criminal.getName();

    // Set a timer so that the inmate is automatically released after
    // serving his sentence. We're using the TurnNotifier; we use
    SingletonRepository.getTurnNotifier().notifyInSeconds(
        (int) (getTimeRemaining(criminal) / 1000), new TurnListener() {
          public void onTurnReached(final int currentTurn) {

            final Player criminal2 = SingletonRepository.getRuleProcessor().getPlayer(
                criminalName);
            if (criminal2 == null) {
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

  private void requestSave() {
    /*
     * Avoid saving the zone three times when a new house is bought
     */
    needsSaving = true;
    SingletonRepository.getTurnNotifier().notifyInTurns(1, new TurnListener() {
      public void onTurnReached(int turn) {
        if (needsSaving) {
          needsSaving = false;
          saveToDatabase();
        }
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

        player.sendPrivateText("You can't remove this type of entity");
        return;
      }

      if (inspected instanceof TurnListener) {
        TurnListener listener = (TurnListener) inspected;
        TurnNotifier.get().dontNotify(listener);
      }

      new GameEvent(player.getName(), "removed",  name + " " + clazz, zone.getName(), Integer.toString(inspected.getX()), Integer.toString(inspected.getY())).raise();
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

    }
    return message;
  }

  private void letBankDrawAfterPause(final String playerName) {
    SingletonRepository.getTurnNotifier().notifyInSeconds(1, new TurnListener() {
      private final String name = playerName;

      public void onTurnReached(final int currentTurn) {
        if (name.equals(ramon.getAttending().getName())) {
          dealCards(ramon.getAttending(), 1);
View Full Code Here

Examples of games.stendhal.server.core.events.TurnListener

    // set a timer to remove the immunity effect after some time
    final TurnNotifier notifier = SingletonRepository.getTurnNotifier();
    // first remove all effects from previously used immunities to
    // restart the timer
   
    final TurnListener tl = new AntidoteEater(player);
    notifier.dontNotify(tl);
    notifier.notifyInTurns(item.getAmount(), tl);
    item.removeOne();
   
    return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.