Examples of onAction()


Examples of games.stendhal.server.actions.admin.AdministrationAction.onAction()

    action.put("value", 120);
    aa.onAction(pl, action);
    assertEquals("may  not change HP over base_hp", 100, pl.getHP());

    action.put("value", 90);
    aa.onAction(pl, action);
    assertEquals("may  change HP to 90 ", 90, pl.getHP());

    action.put("value", 90);
    action.put("mode", "sub");
    assertEquals("may  change HP to 90 ", 90, pl.getHP());
View Full Code Here

Examples of games.stendhal.server.actions.admin.AlterAction.onAction()

    action.put("stat", "hp");
    action.put("mode", "");
    action.put("value", 0);
    assertEquals(100, pl.getHP());

    aa.onAction(pl, action);
    assertEquals("may not change HP to 0 ", 100, pl.getHP());

    action.put("value", 120);
    aa.onAction(pl, action);
    assertEquals("may  not change HP over base_hp", 100, pl.getHP());
View Full Code Here

Examples of games.stendhal.server.actions.admin.AlterAction.onAction()

    aa.onAction(pl, action);
    assertEquals("may not change HP to 0 ", 100, pl.getHP());

    action.put("value", 120);
    aa.onAction(pl, action);
    assertEquals("may  not change HP over base_hp", 100, pl.getHP());

    action.put("value", 90);
    aa.onAction(pl, action);
    assertEquals("may  change HP to 90 ", 90, pl.getHP());
View Full Code Here

Examples of games.stendhal.server.actions.admin.AlterAction.onAction()

    action.put("value", 120);
    aa.onAction(pl, action);
    assertEquals("may  not change HP over base_hp", 100, pl.getHP());

    action.put("value", 90);
    aa.onAction(pl, action);
    assertEquals("may  change HP to 90 ", 90, pl.getHP());

    action.put("value", 90);
    action.put("mode", "sub");
    assertEquals("may  change HP to 90 ", 90, pl.getHP());
View Full Code Here

Examples of games.stendhal.server.actions.attack.StopAction.onAction()

      }

    };
    final RPAction action = new RPAction();
    sa.onAction(player, action);

    assertTrue(notify);
    assertFalse(stopattack);
    action.put("attack", "value");
    notify = false;
View Full Code Here

Examples of games.stendhal.server.actions.attack.StopAction.onAction()

    assertFalse(stopattack);
    action.put("attack", "value");
    notify = false;
    stopattack = false;

    sa.onAction(player, action);

    assertTrue(notify);
    assertTrue(stopattack);

  }
View Full Code Here

Examples of games.stendhal.server.actions.query.InfoAction.onAction()

   */
  @Test
  public void testExecute() throws Exception {
    Player bob = PlayerTestHelper.createPlayer("bob");
    InfoAction info = new InfoAction();
    info.onAction(bob, null);
    assertFalse(bob.events().isEmpty());
    //assertEquals(null,bob.events().get(0));
   
  }
}
View Full Code Here

Examples of games.stendhal.server.actions.query.WhereAction.onAction()

    final RPAction action = new RPAction();
    action.put(Actions.TYPE, "where");
    final Player player = PlayerTestHelper.createPlayer("player");
    MockStendhalRPRuleProcessor.get().addPlayer(player);

    pq.onAction(player, action);
    assertTrue(player.events().isEmpty());
  }

  /**
   * Tests for onActionNotThere.
View Full Code Here

Examples of games.stendhal.server.actions.query.WhereAction.onAction()

    action.put(Actions.TARGET, "NotThere");

    final Player player = PlayerTestHelper.createPlayer("player");
    MockStendhalRPRuleProcessor.get().addPlayer(player);

    pq.onAction(player, action);
    assertThat(player.events().get(0).get("text"), equalTo("No player or pet named \"NotThere\" is currently logged in."));
  }

  /**
   * Tests for onAction.
View Full Code Here

Examples of games.stendhal.server.actions.query.WhereAction.onAction()

    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);
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.