Package games.stendhal.server.entity.player

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


    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

   
    // 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

      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

    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

          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

    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

    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

    StendhalRPAction.startAttack(hyde, sheep);
    assertNull("Attacking someone else's sheep", hyde.getAttackTarget());
    assertEquals("message at attacking someone else's sheep",
        "You pity jekyll's sheep too much to kill it.",
        hyde.events().get(0).get("text"));
    hyde.stopAttack();
    hyde.clearEvents();
    sheep.setOwner(null);
   
    // Protected. should fail
    protectMap();
View Full Code Here

    StendhalRPAction.startAttack(hyde, sheep);
    assertNull("Attacking a sheep in protected area ", hyde.getAttackTarget());
    assertEquals("message at attacking a sheep in protected area",
        "The powerful protective aura in this place prevents you from attacking that sheep.",
        getPrivateReply(hyde));
    hyde.stopAttack();
    hyde.clearEvents();
   
    // the same with an owned sheep
    sheep.setOwner(hyde);
    StendhalRPAction.startAttack(hyde, 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.