Package games.stendhal.server.core.engine

Examples of games.stendhal.server.core.engine.StendhalRPZone


   */
  @Test
  public final void testValidAttributeValidNumber() {
    Player player = PlayerTestHelper.createPlayer("bob");
    player.put("base_hp", 100);
    StendhalRPZone zone = new StendhalRPZone("testzone");
    zone.add(player);
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "#" + player.getID().getObjectID());
    rpAction.put("mode", "");
    rpAction.put("stat", "hp");
View Full Code Here


   */
  @Test
  public final void testValidAttributeValidName() {
    Player player = PlayerTestHelper.createPlayer("bob");
    player.put("base_hp", 10);
    StendhalRPZone zone = new StendhalRPZone("testzone");
   
    MockStendlRPWorld.get().addRPZone(zone);
    MockStendhalRPRuleProcessor.get().addPlayer(player);
    zone.add(player);
    assertNotNull(SingletonRepository.getRuleProcessor().getPlayer("bob"));
    AlterAction action = new AlterAction();
    RPAction rpAction = new RPAction();
    rpAction.put("target", "bob");
    rpAction.put("mode", "");
View Full Code Here

   */
  @Test
  public final void testValidAttributeValidNameDifferentZone() {
    Player player = PlayerTestHelper.createPlayer("bob");
    player.put("base_hp", 10);
    StendhalRPZone zone = new StendhalRPZone("testzone");
    StendhalRPZone zoneaway = new StendhalRPZone("testzonefaraway");
    zone.add(player);
    Player playerAway = PlayerTestHelper.createPlayer("bobaway");
    playerAway.put("base_hp", 10);
    zoneaway.add(playerAway);
   
   
    MockStendlRPWorld.get().addRPZone(zone);
    MockStendhalRPRuleProcessor.get().addPlayer(player);
    MockStendlRPWorld.get().addRPZone(zoneaway);
View Full Code Here

    AdministrationAction.registerActions();
    MockStendlRPWorld.get();
    MockStendhalRPRuleProcessor.get().clearPlayers();

    // create zones needed for correct jail functionality:
    StendhalRPZone jailzone = new StendhalRPZone("knast", 100, 100);
    MockStendlRPWorld.get().addRPZone(jailzone);
    Jail jail = new Jail();
    jail.configureZone(jailzone, null);
    MockStendlRPWorld.get().addRPZone(new StendhalRPZone("-3_semos_jail", 100, 100));
  }
View Full Code Here

    final RPAction action = new RPAction();
    action.put(Actions.TYPE, "where");
    action.put(Actions.TARGET, "bob");

    final Player player = PlayerTestHelper.createPlayer("bob");
    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)"));
    player.clearEvents();
   
    // test the player before he becomes ghostmode
    final Player ghosted = PlayerTestHelper.createPlayer("ghosted");
    zone.add(ghosted);
    MockStendhalRPRuleProcessor.get().addPlayer(ghosted);
    action.put(Actions.TARGET, ghosted.getName());
    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("ghosted is in zone at (0,0)"));
    player.clearEvents();
View Full Code Here

   
    final Sheep testSheep = new Sheep();

    player = PlayerTestHelper.createPlayer("player");
   
    StendhalRPZone stendhalRPZone = new StendhalRPZone("zone");
    MockStendlRPWorld.get().addRPZone(stendhalRPZone);
    stendhalRPZone.add(player);
   
    stendhalRPZone.add(testSheep);
    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();
View Full Code Here

  @BeforeClass
  public static void setUpBeforeClass() throws Exception {
    QuestHelper.setUpBeforeClass();
   
    StendhalRPZone zone = new StendhalRPZone("admin_test");
    new ExperiencedWarriorNPC().configureZone(zone, null);

    setupZone(ZONE_NAME);
  }
View Full Code Here

  /**
   * Test for dice in gambling zone.
   */
  @Test
  public void testDropDice() {
    final StendhalRPZone localzone = new StendhalRPZone(ZONE_NAME, 20, 20); // zone with disabled collision detection
    final Player player = PlayerTestHelper.createPlayer("bob");
    localzone.add(player);

    Item item = SingletonRepository.getEntityManager().getItem("dice");
    player.equip(item, 1);

    assertEquals(0, localzone.getItemsOnGround().size());

    item = player.getFirstEquipped("dice");
    RPObject parent = item.getContainer();
    final RPAction action = new RPAction();
    action.put("type", "drop");
    action.put("baseitem", item.getID().getObjectID());
    action.put(EquipActionConsts.BASE_OBJECT, parent.getID().getObjectID());
    action.put(EquipActionConsts.BASE_SLOT, item.getContainerSlot().getName());
    action.put("x", player.getX());
    action.put("y", player.getY() + 1);

    new DropAction().onAction(player, action);
    assertEquals(0, player.events().size());
    Item[] items = localzone.getItemsOnGround().toArray(new Item[0]);
    assertEquals(1, items.length);
    assertEquals(0, items[0].getX());
    assertEquals(1, items[0].getY());
  }
View Full Code Here

  public void testConfigureZone() {
   
    SingletonRepository.getRPWorld();
    final BarMaidNPC barmaidConfigurator = new BarMaidNPC();

    final StendhalRPZone zone = new StendhalRPZone("testzone");
    barmaidConfigurator.configureZone(zone, null);
    assertFalse(zone.getNPCList().isEmpty());
    final NPC barMaid = zone.getNPCList().get(0);
    assertThat(barMaid.getName(), is("Siandra"));
    assertThat(barMaid.getDescription(), is("You see a pretty young bar maid."));
  }
View Full Code Here

  /**
   * Tests for onTurnReached.
   */
  @Test
  public final void testOnTurnReached() {
    final StendhalRPZone zone = new StendhalRPZone("testzone");
    final Blood bl = new Blood();
    zone.add(bl);
    assertNotNull(zone.getBlood(0, 0));
    bl.onTurnReached(1);
    assertNull(zone.getBlood(0, 0));
  }
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.engine.StendhalRPZone

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.