Package marauroa.common.game

Examples of marauroa.common.game.IRPZone


  @Override
  protected void doRegularBehaviour() {
    if(Rand.throwCoin()==1) {
      final Item item = SingletonRepository.getEntityManager().getItem(itemName);
      final IRPZone zone = speakerNPC.getZone();
      // place under NPC
      item.setPosition(speakerNPC.getX(), speakerNPC.getY());
      zone.add(item);
    }
    super.doRegularBehaviour();
  }
View Full Code Here


   *
   * @param player
   *            Player
   */
  public void start(final Player player) {
    final IRPZone playerZone = player.getZone();

    if (playerZone.equals(zone)) {
      this.player = player;
      removeAllTokens();
      addAllTokens();
      timer = new Timer(player);
      SingletonRepository.getTurnNotifier().notifyInTurns(0, timer);
View Full Code Here

   * @param player
   *            the player to teleport out
   */
  protected void finish(final boolean reset, final Player player) {
    if (player != null) {
      final IRPZone playerZone = player.getZone();

      if (playerZone.equals(zone)) {
        player.teleport(entranceZone, door.getX(), door.getY() + 1,
            Direction.DOWN, player);
      }
    }
    if (reset) {
View Full Code Here

      // in case the player is not playing anymore.
      // Note that "player" always refers to the current player
      // in order not to teleport the next player out too early,
      // we have to compare it to the player who started this timer
      if ((player == timerPlayer) && (player != null)) {
        final IRPZone playerZone = player.getZone();

        if (playerZone.equals(zone)) {
          if (counter > 0) {
            npc.say("You have " + counter + " seconds left.");
            counter = counter - 10;
            SingletonRepository.getTurnNotifier().notifyInTurns(10 * 3, this);
          } else {
View Full Code Here

   */
  public boolean contains(final Entity entity) {
    if (entity == null) {
      return false;
    }
    final IRPZone entityZone = entity.getZone();

    // We have ask the zone whether it knows about the entity because
    // player-objects stay alive some time after logout.
    return zone.equals(entityZone) && zone.has(entity.getID())
        && shape.contains(entity.getX(), entity.getY());
View Full Code Here

   */
  public boolean contains(final CreatureRespawnPoint point) {
    if (point == null) {
      return false;
    }
    final IRPZone entityZone = point.getZone();

    // We have ask the zone whether it knows about the entity because
    // player-objects stay alive some time after logout.
    return zone.equals(entityZone) && shape.contains(point.getX(), point.getY());
  }
View Full Code Here

   *
   * @param currentTurn
   *            Current turn number.
   */
  public void onTurnReached(final int currentTurn) {
    IRPZone zone;
    Rectangle2D area;

    zone = getZone();
    area = getArea();

    /*
     * Perform action on entities still in the area. Remove those that have
     * gone missing.
     */
    final Iterator<RPEntity.ID> iter = targets.iterator();

    while (iter.hasNext()) {
      final RPEntity.ID id = iter.next();

      if (zone.has(id)) {
        final RPEntity entity = (RPEntity) zone.get(id);

        if (area.intersects(entity.getArea())) {
          if (!handleInterval(entity)) {
            handleRemoved(entity);
            iter.remove();
View Full Code Here

                // all vsop koboldish torcibud is persistent (set in the xml for this item) so this value will last
                koboldish_torcibud_vsop.put("amount", player.getBaseHP()*75/100);

                //player.equipOrPutOnGround(koboldish_torcibud_vsop);
                //put the rewarded bottles on the counter
                final IRPZone zone = SingletonRepository.getRPWorld().getZone("int_wofol_bar");
                koboldish_torcibud_vsop.setPosition(3, 3);
                zone.add(koboldish_torcibud_vsop);

                npc.say(
                    "Wrof! Here take "
                    + Integer.toString(torcibud_bottles)
                    + " bottles of my V.S.O.P. Koboldish Torcibud with my best wishes for you!");
View Full Code Here

       * of doing it in the constructor, because not all
       * zones have been loaded by the time this portal is
       * created.
       */
      if (spot == null) {
        IRPZone zone = SingletonRepository.getRPWorld().getRPZone(zoneName);
        // All locations should be valid, but do not crash in case not all maps
        // are not loaded.
        if (zone != null) {
          spot = new Spot((StendhalRPZone) zone, x, y);
        } else {
View Full Code Here

      // safe it back
      characterDAO.storeCharacter(transaction, username, characterName, object);
      TransactionPool.get().commit(transaction);

      // remove from world
      IRPZone zone = StendhalRPWorld.get().getRPZone(object.getID());
      if (zone != null) {
        zone.remove(object.getID());
      }

    } catch (Exception e) {
      logger.error(e, e);
      admin.sendPrivateText(e.toString());
View Full Code Here

TOP

Related Classes of marauroa.common.game.IRPZone

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.