Examples of clearEvents()


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

    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(2, pl.events().size());
    int idx = 0;
    assertEquals("Trying to cast a spell...", pl.events().get(idx++).get("text"));
    assertEquals("You do not have enough available mana to use this spell.", pl.events().get(idx++).get("text"));
    pl.clearEvents();
    assertEquals(35, pl.getHP());

    // increase Mana value to enable the player casting the raise stats spell
    pl.setMana(20);
    action = new RPAction();
View Full Code Here

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

    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(2, pl.events().size());
    idx = 0;
    assertEquals("Trying to cast a spell...", pl.events().get(idx++).get("text"));
    assertEquals("You have been healed.", pl.events().get(idx++).get("text"));
    pl.clearEvents();
    assertEquals(100, pl.getHP()); // check health
    assertEquals(5, pl.getMana());
  }

  /**
 
View Full Code Here

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

    final StendhalRPZone zone = new StendhalRPZone("zone");
    zone.add(player);
    MockStendhalRPRuleProcessor.get().addPlayer(player);
    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("You are in zone at (0,0)"));
    player.clearEvents();
   
    // test that you can still /where yourself as a ghost
    player.setGhost(true);
    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("You are in zone at (0,0)"));
View Full Code Here

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

   
    // test that you can still /where yourself as a ghost
    player.setGhost(true);
    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("You are in zone at (0,0)"));
    player.clearEvents();
   
    // test the player before he becomes ghostmode
    final Player ghosted = PlayerTestHelper.createPlayer("ghosted");
    zone.add(ghosted);
    MockStendhalRPRuleProcessor.get().addPlayer(ghosted);
View Full Code Here

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

    stendhalRPZone.add(testPet);
    player.setPet(testPet);
   
    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("Your cat is at (0,0)"));
    player.clearEvents();

    player.setSheep(testSheep);

    action.put(Actions.TARGET, "sheep");
View Full Code Here

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

    final Player player = PlayerTestHelper.createPlayer("bob");

    fs.onUsed(player);
    assertEquals("You need a fishing rod for fishing.",
        player.events().get(0).get("text"));
    player.clearEvents();
    final StackableItem fishingRod = new StackableItem("fishing rod", "", "",
        null);
    fishingRod.setQuantity(1);
    fishingRod.setID(new ID(2, "testzone"));
    player.getSlot("bag").add(fishingRod);
View Full Code Here

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

    fishingRod.setID(new ID(2, "testzone"));
    player.getSlot("bag").add(fishingRod);
    assertTrue(player.isEquipped("fishing rod"));
    fs.onUsed(player);
    assertEquals("You have started fishing.", player.events().get(0).get("text"));
    player.clearEvents();
    fs.onUsed(player);
    assertFalse(player.has("private_text"));
    final Player player2 = PlayerTestHelper.createPlayer("bob");

    player2.getSlot("bag").add(fishingRod);
View Full Code Here

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

      jekyll.setLevel(level);
      StendhalRPAction.startAttack(hyde, jekyll);
      assertNull("Attacking player at protected area", hyde.getAttackTarget());
      assertEquals("message at attacking at protected area",
          "The powerful protective aura in this place prevents you from attacking jekyll.", getPrivateReply(hyde));
      hyde.clearEvents();
    }
  }
 
  @Test
  public void startAttackingStrongerPlayer() {
View Full Code Here

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

      jekyll.setLevel(level);
      StendhalRPAction.startAttack(hyde, jekyll);
      assertNull("Attacking player at protected area", hyde.getAttackTarget());
      assertEquals("message at attacking at protected area",
          "The powerful protective aura in this place prevents you from attacking jekyll.", getPrivateReply(hyde));
      hyde.clearEvents();
    }
  }
 
  @Test
  public void startAttackingWeakPlayer() {
View Full Code Here

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

          assertNull("Attacking a too weak player. Level " + hyde.getLevel() + " vs Level " + jekyll.getLevel(),
              hyde.getAttackTarget());
         
          assertEquals("message at attacking at protected area",
              "Your conscience would trouble you if you carried out this attack.", getPrivateReply(hyde));
          hyde.clearEvents();
         
          // check that self defence works
          StendhalRPAction.startAttack(jekyll, hyde);
          StendhalRPAction.startAttack(hyde, jekyll);
          assertSame("Self defence against a weak enemy", hyde.getAttackTarget(), jekyll);
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.