Examples of nextTo()


Examples of games.stendhal.server.entity.Entity.nextTo()

    Point targetPoint = new Point(goalNode.getX(), goalNode.getY());
    resistanceMap = new ResistanceMap(zone.getWidth(), zone.getHeight());
    for (final RPObject obj : zone) {
      final Entity otherEntity = (Entity) obj;
      if (!entity.getID().equals(otherEntity.getID())
          && (otherEntity.stopped() || otherEntity.nextTo(
              startNode.getX(), startNode.getY(), 0.25))) {
        final Rectangle2D area = otherEntity.getArea();
        // Hack: Allow players to move onto portals as destination
        if ((entity instanceof Player) && (otherEntity instanceof Portal) && area.contains(targetPoint)) {
          continue;
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity.nextTo()

    for (int i = 9; i < 12; i++) {
      for (int j = 9; j < 13; j++) {
        victim.setPosition(i, j);
        assertTrue(creature.nextTo(victim));
        assertTrue(victim.nextTo(creature));
        assertTrue("can attack now (" + i + "," + j + ")", hth.canAttackNow(creature));
      }
    }

    victim.setPosition(8, 13);
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity.nextTo()

      }
    }

    victim.setPosition(8, 13);
    assertFalse(creature.nextTo(victim));
    assertFalse(victim.nextTo(creature));
    assertFalse("can attack now ", hth.canAttackNow(creature));

  }

  private static boolean mockinvisible;
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature.nextTo()

    creature.setTarget(victim);

    for (int i = 9; i < 12; i++) {
      for (int j = 9; j < 13; j++) {
        victim.setPosition(i, j);
        assertTrue(creature.nextTo(victim));
        assertTrue(victim.nextTo(creature));
        assertTrue("can attack now (" + i + "," + j + ")", hth.canAttackNow(creature));
      }
    }
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature.nextTo()

        assertTrue("can attack now (" + i + "," + j + ")", hth.canAttackNow(creature));
      }
    }

    victim.setPosition(8, 13);
    assertFalse(creature.nextTo(victim));
    assertFalse(victim.nextTo(creature));
    assertFalse("can attack now ", hth.canAttackNow(creature));

  }
View Full Code Here

Examples of games.stendhal.server.entity.mapstuff.spawner.SheepFood.nextTo()

    foodobject.put("amount", 1);
    foodobject.put("x", 3);
    foodobject.put("y", 3);
    final SheepFood food = new SheepFood(foodobject);
    assertTrue(food.getAmount() > 0);
    assertFalse(food.nextTo(meh));

    zone.add(food);
    assertFalse(zone.getSheepFoodList().isEmpty());
    assertTrue(meh.searchForFood());
    assertEquals("found food and thinks of it", "food", meh.getIdea());
View Full Code Here

Examples of games.stendhal.server.entity.mapstuff.spawner.SheepFood.nextTo()

    foodobject.put("amount", 1);
    foodobject.put("x", 2);
    foodobject.put("y", 2);
    final SheepFood food = new SheepFood(foodobject);
    assertTrue(food.getAmount() > 0);
    assertFalse(food.nextTo(meh));

    zone.add(food);

    for (int x = 0; x <= zone.getWidth(); x++) {
      for (int y = 0; y <= zone.getHeight(); y++) {
View Full Code Here

Examples of games.stendhal.server.entity.mapstuff.spawner.SheepFood.nextTo()

    foodobject.put("amount", 1);
    foodobject.put("x", 2);
    foodobject.put("y", 2);
    final SheepFood food = new SheepFood(foodobject);
    assertTrue(food.getAmount() > 0);
    assertFalse(food.nextTo(meh));

    final RPObject foodobject2 = new RPObject();
    foodobject2.put("amount", 1);
    foodobject2.put("x", 0);
    foodobject2.put("y", 3);
View Full Code Here

Examples of games.stendhal.server.entity.mapstuff.spawner.SheepFood.nextTo()

    foodobject2.put("amount", 1);
    foodobject2.put("x", 0);
    foodobject2.put("y", 3);
    final SheepFood food2 = new SheepFood(foodobject2);
    assertTrue(food2.getAmount() > 0);
    assertFalse(food2.nextTo(meh));

    zone.add(food2);

    assertTrue("no path found", meh.searchForFood());
    assertEquals("food", meh.getIdea());
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.nextTo()

  @Override
  public boolean onUsed(final RPEntity user) {
    if (user instanceof Player) {
      final Player player = (Player) user;

      if (player.nextTo(this)) {
        npc.say("Hey " + user.getTitle() + ", that is my chest.");
        return true;
      } else {
        return false;
      }
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.