Examples of stopAttack()


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

    if (entity instanceof RPEntity) {
      final RPEntity rpentity = (RPEntity) entity;

      rpentity.stop();
      rpentity.stopAttack();
      rpentity.clearPath();
    }

    Sheep sheep = null;
    Pet pet = null;
View Full Code Here

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

    final int sz=rats.size();
    int i=0;
    while(rats.size()!=0) {
      try {
      final Creature rat = rats.get(0);
      rat.stopAttack();
      rat.clearDropItemList();
      rat.getZone().remove(rat);
      rats.remove(0);
      i++;
      } catch (IndexOutOfBoundsException ioobe) {
View Full Code Here

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

    // add attributes and slots
    UpdateConverter.updatePlayerRPObject(object);

    final Player player = new Player(object);
    player.stop();
    player.stopAttack();

    loadItemsIntoSlots(player);
    loadSpellsIntoSlots(player);
    player.cancelTradeInternally(null);
View Full Code Here

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

    zone.add(victim);
   
    // both at level 0
    StendhalRPAction.startAttack(player, victim);
    assertSame(player.getAttackTarget(), victim);
    player.stopAttack();
    assertNull(player.getAttackTarget());
   
    // protecting the mouse should not matter
    protectMap();
    StendhalRPAction.startAttack(player, victim);
View Full Code Here

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

   
    // protecting the mouse should not matter
    protectMap();
    StendhalRPAction.startAttack(player, victim);
    assertSame(player.getAttackTarget(), victim);
    player.stopAttack();
   
    // strong player, weak monster
    player.setLevel(100);
    StendhalRPAction.startAttack(player, victim);
    assertSame(player.getAttackTarget(), victim);
View Full Code Here

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

      hyde.setLevel(level);
      jekyll.setLevel(level);
      StendhalRPAction.startAttack(hyde, jekyll);
      // equal level. should always succeed
      assertSame("Attacking player at unprotected area", hyde.getAttackTarget(), jekyll);
      hyde.stopAttack();
    }
   
    // protect jekyll; the attack should fail
    protectMap();
    for (int level = 0; level < 200; level++) {
View Full Code Here

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

    for (int level = 0; level < 200; level++) {
      jekyll.setLevel(level);
      StendhalRPAction.startAttack(hyde, jekyll);
      // jekyll is stronger than hyde, so attacking should succeed
      assertSame("Attacking player at unprotected area", hyde.getAttackTarget(), jekyll);
      hyde.stopAttack();
    }
   
    // protect jekyll; the attack should fail
    protectMap();
    for (int level = 0; level < 200; level++) {
View Full Code Here

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

          jekyll.stopAttack();
        } else {
          // the victim is not too weak
          assertSame("Attacking only a bit weaker victim", hyde.getAttackTarget(), jekyll);
        }
        hyde.stopAttack();
      }
    }
  }
 
  @Test
View Full Code Here

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

    zone.add(hyde);
    zone.add(sheep);
    // attacking wild sheep should be ok
    StendhalRPAction.startAttack(hyde, sheep);
    assertSame("Attacking a sheep in unprotected area", hyde.getAttackTarget(), sheep);
    hyde.stopAttack();
    // also if you are the owner
    sheep.setOwner(hyde);
    StendhalRPAction.startAttack(hyde, sheep);
    assertSame("Attacking a sheep in unprotected area", hyde.getAttackTarget(), sheep);
    hyde.stopAttack();
View Full Code Here

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

    hyde.stopAttack();
    // also if you are the owner
    sheep.setOwner(hyde);
    StendhalRPAction.startAttack(hyde, sheep);
    assertSame("Attacking a sheep in unprotected area", hyde.getAttackTarget(), sheep);
    hyde.stopAttack();
    // but attacking someone elses pet is a no-no
    sheep.setOwner(jekyll);
    StendhalRPAction.startAttack(hyde, sheep);
    assertNull("Attacking someone else's sheep", hyde.getAttackTarget());
    assertEquals("message at attacking someone else's sheep",
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.