Examples of RPAction


Examples of marauroa.common.game.RPAction

    final StendhalRPZone zone = new StendhalRPZone("dropzone");
    final Item dropitem = ItemTestHelper.createItem();
    zone.add(dropitem);
    zone.add(bob);
    assertNotNull(dropitem.getID().getObjectID());
    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());
    MockStendlRPWorld.get().addRPZone(zone);
    assertNotNull(bob.getZone());

    final SourceObject so = SourceObject.createSourceObject(action, bob);
    assertTrue(so.isValid());
View Full Code Here

Examples of marauroa.common.game.RPAction

    final Item dropitem = SingletonRepository.getEntityManager().getItem("money");
    assertNotNull(dropitem);
    zone.add(bob);
    assertTrue(bob.equipToInventoryOnly(dropitem));
    assertNotNull(dropitem.getID().getObjectID());
    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());

    action.put(EquipActionConsts.BASE_OBJECT , bob.getID().getObjectID());

    MockStendlRPWorld.get().addRPZone(zone);
    assertNotNull(bob.getZone());

    final SourceObject so = SourceObject.createSourceObject(action, bob);
View Full Code Here

Examples of marauroa.common.game.RPAction

    final Item dropitem = SingletonRepository.getEntityManager().getItem("money");
    assertNotNull(dropitem);
    zone.add(bob);
    assertTrue(bob.equipToInventoryOnly(dropitem));
    assertNotNull(dropitem.getID().getObjectID());
    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());

    action.put(EquipActionConsts.BASE_OBJECT , bob.getID().getObjectID());
    action.put(EquipActionConsts.BASE_SLOT, "bag");
    MockStendlRPWorld.get().addRPZone(zone);
    assertNotNull(bob.getZone());

    final SourceObject so = SourceObject.createSourceObject(action, bob);
    assertTrue("Unreachable slot", so.isValid());
View Full Code Here

Examples of marauroa.common.game.RPAction

    assertNotNull(dropitem);
    zone.add(bob);
    dropitem.setID(new RPObject.ID(999, "blabla"));
    //assertTrue(bob.equip(dropitem));
    assertNotNull(dropitem.getID().getObjectID());
    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());

    action.put(EquipActionConsts.BASE_OBJECT , bob.getID().getObjectID());
    action.put(EquipActionConsts.BASE_SLOT, "bag");
    MockStendlRPWorld.get().addRPZone(zone);
    assertNotNull(bob.getZone());

    final SourceObject so = SourceObject.createSourceObject(action, bob);
    assertFalse("Itemnot in bag", so.isValid());
View Full Code Here

Examples of marauroa.common.game.RPAction

    final StendhalRPZone zone = new StendhalRPZone("dropzone");
    final Item dropitem = ItemTestHelper.createItem("drops", 5);
    zone.add(dropitem);
    zone.add(bob);
    assertNotNull(dropitem.getID().getObjectID());
    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());
    MockStendlRPWorld.get().addRPZone(zone);
    assertNotNull(bob.getZone());

    final SourceObject so = SourceObject.createSourceObject(action, bob);
    assertTrue(so.isValid());
View Full Code Here

Examples of marauroa.common.game.RPAction

    final Item dropitem = ItemTestHelper.createItem("drops", 5);
    zone.add(dropitem);
    zone.add(bob);
    MockStendlRPWorld.get().addRPZone(zone);

    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());
    final int amounttodrop = 3;
    action.put(EquipActionConsts.QUANTITY, amounttodrop);
    final SourceObject so = SourceObject.createSourceObject(action, bob);
    assertTrue(so.isValid());
    assertEquals("return the amount to be dropped", amounttodrop, so.getQuantity());
  }
View Full Code Here

Examples of marauroa.common.game.RPAction

    final Item dropitem = ItemTestHelper.createItem("drops", 5);
    zone.add(dropitem);
    zone.add(bob);
    MockStendlRPWorld.get().addRPZone(zone);

    final RPAction action = new RPAction();
    action.put(EquipActionConsts.BASE_ITEM, dropitem.getID().getObjectID());
    action.put(EquipActionConsts.QUANTITY, dropitem.getQuantity() + 3);
    final SourceObject so = SourceObject.createSourceObject(action, bob);
    assertTrue(so.isValid());
    assertEquals("too many are reduced to all", dropitem.getQuantity(), so.getQuantity());
  }
View Full Code Here

Examples of marauroa.common.game.RPAction

   * Tests for onAction.
   */
  @Test
  public void testOnAction() {
    final WhoAction pq = new WhoAction();
    final RPAction action = new RPAction();
    action.put(Actions.TYPE, "who");
    final Player player = PlayerTestHelper.createPlayer("player");
    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("0 Players online: "));
    player.clearEvents();
    MockStendhalRPRuleProcessor.get().addPlayer(player);
View Full Code Here

Examples of marauroa.common.game.RPAction

  @Test
  public final void testTellAllAction() {
    final Player pl = PlayerTestHelper.createPlayer("dummy");
    MockStendhalRPRuleProcessor.get().addPlayer(pl);

    CommandCenter.execute(pl, new RPAction());
    assertEquals("Unknown command null. Please type /help to get a list.", pl.events().get(0).get("text"));

    pl.clearEvents();
    pl.setAdminLevel(5000);
    final RPAction action = new RPAction();
    action.put("type", "tellall");
    action.put("text", "huhu");
    CommandCenter.execute(pl, action);
    assertEquals("Administrator SHOUTS: huhu", pl.events().get(0).get("text"));
 
  }
View Full Code Here

Examples of marauroa.common.game.RPAction

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    MockStendhalRPRuleProcessor.get().addPlayer(bob);
    MockStendhalRPRuleProcessor.get().addPlayer(anptherAdmin);

    pl.setAdminLevel(5000);
    final RPAction action = new RPAction();
    action.put("type", "supportanswer");
    action.put("text", "huhu");
    action.put("target", "bob");
    CommandCenter.execute(pl, action);
    assertEquals("Support (player) tells you: huhu \nIf you wish to reply, use /support.", bob.events().get(0).get("text"));
    assertEquals("player answers bob's support question: huhu", anptherAdmin.events().get(0).get("text"));

    bob.clearEvents();
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.