Package games.stendhal.server.events

Examples of games.stendhal.server.events.SoundEvent


   * @param achievement
   */
  private void notifyPlayerAboutReachedAchievement(Player player, Achievement achievement) {
    if (achievement.isActive()) {
      player.addEvent(new ReachedAchievementEvent(achievement));
      player.addEvent(new SoundEvent("yay-1", SoundLayer.USER_INTERFACE));
    }
  }
View Full Code Here


   * randomly picks a sound, sends a SoundEvent to the client
   * and sets the notifier up for the next sound.
   */
  public void onTurnReached(int currentTurn) {
    String sound = sounds[(int) (Math.random() * sounds.length)];
    RPEvent event = new SoundEvent(sound, radius, volume, SoundLayer.AMBIENT_SOUND);
    this.addEvent(event);
    this.notifyWorldAboutChanges();
    setupNotifier();
  }
View Full Code Here

    /**
     * Create a sound event for one hit of the bell.
     */
    private void playSound() {
      times--;
      SoundEvent event = new SoundEvent(SOUND_FILE, RADIUS, VOLUME, SoundLayer.AMBIENT_SOUND);
      BellSoundSource.this.addEvent(event);
      BellSoundSource.this.notifyWorldAboutChanges();
    }
View Full Code Here

    if (!nextTo(user)) {
      user.sendPrivateText("You cannot reach that from here.");
      return false;
    }
    String sound = sounds[(int) (Math.random() * sounds.length)];
    SoundEvent event = new SoundEvent(sound, radius, volume, SoundLayer.AMBIENT_SOUND);
    this.addEvent(event);
    this.notifyWorldAboutChanges();
    return true;
  }
View Full Code Here

            final String itemName = currentBehavRes.getChosenItemName();
            logger.debug("Selling a " + itemName + " to player " + player.getName());

            boolean success = sellerBehaviour.transactAgreedDeal(currentBehavRes, raiser, player);
            if (success) {
              raiser.addEvent(new SoundEvent("coins-1", SoundLayer.CREATURE_NOISE));
            }

            currentBehavRes = null;
          }
        });
View Full Code Here

    super.setLevel(level);

    // reward players on level up
    if (super.getLevel() < level) {
      AchievementNotifier.get().onLevelChange(this);
      addEvent(new SoundEvent("tadaa-1", SoundLayer.USER_INTERFACE));
    }
  }
View Full Code Here

          public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
            logger.debug("Buying something from player " + player.getName());

            boolean success = buyerBehaviour.transactAgreedDeal(currentBehavRes, raiser, player);
            if (success) {
              raiser.addEvent(new SoundEvent("coins-1", SoundLayer.CREATURE_NOISE));
            }

            currentBehavRes = null;
          }
        });
View Full Code Here

    this.delay = delay;
  }

  public void fire(final Player player, final Sentence sentence, final EventRaiser raiser) {
    if (!delay) {
      raiser.addEvent(new SoundEvent(sound, SoundLayer.CREATURE_NOISE));
    } else {
      TurnNotifier.get().notifyInTurns(0, new SoundTurnListener(player));
    }
  }
View Full Code Here

    /**
     * plays the sound
     */
    public void onTurnReached(int currentTurn) {
      player.addEvent(new SoundEvent(sound, SoundLayer.CREATURE_NOISE));
    }
View Full Code Here

TOP

Related Classes of games.stendhal.server.events.SoundEvent

Copyright © 2018 www.massapicom. 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.