Examples of EventRaiser


Examples of games.stendhal.server.entity.npc.EventRaiser

  public boolean onUsed(RPEntity user) {
    boolean res = super.onUsed(user);

    if (res && (action != null)) {
      if (user instanceof Player) {
        action.fire((Player) user, ConversationParser.parse(user.get("text")), new EventRaiser(this));
      } else {
        logger.error("user is no instance of Player but: " + user, new Throwable());
      }
    }
View Full Code Here

Examples of games.stendhal.server.entity.npc.EventRaiser

          speakerNPC.setIdea("attending");
        } else if (currentState != ConversationStates.IDLE) {
          speakerNPC.setIdea("awaiting");
        }
    if (trans.getAction() != null) {
      trans.getAction().fire(player, sentence, new EventRaiser(speakerNPC));
    }
   
    speakerNPC.notifyWorldAboutChanges();
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.EventRaiser

   */
  @Ignore
  public void testFire() throws Throwable {
    final SpeakerNPC npc = SpeakerNPCTestHelper.createSpeakerNPC();
    npc.setName("TestNPC");
    EventRaiser raiser = new EventRaiser(npc);
    new NPCEmoteAction("hugs").fire(PlayerTestHelper.createPlayer("player"),
        ConversationParser.parse("!me hugs TestNPC"),
        raiser);
    new NPCEmoteAction("hugs").fire(PlayerTestHelper.createPlayer("player"),
        ConversationParser.parse("!me killing TestNPC"),
View Full Code Here

Examples of games.stendhal.server.entity.npc.EventRaiser

    sb = new SeedSellerBehaviour(pricelist);
    ItemParserResult res = new ItemParserResult(true, "lilia seed",1, null);
    final Player bob = PlayerTestHelper.createPlayer("bob");
    PlayerTestHelper.equipWithMoney(bob, 100);
    sb.transactAgreedDeal(res, new EventRaiser(speakerNPC), bob);
    final Item seed = bob.getFirstEquipped("seed");
    assertNotNull(seed);
    assertEquals("lilia", seed.getInfoString());
    assertEquals(90, ((Stackable<?>) bob.getFirstEquipped("money")).getQuantity());
  }
View Full Code Here

Examples of games.stendhal.server.entity.npc.EventRaiser

    chest = new StoredChest();
    ados.add(chest);
    HouseUtilities.clearCache();
   
    SpeakerNPC engine = new SpeakerNPC("bob");
    EventRaiser raiser = new EventRaiser(engine);
    Player player = PlayerTestHelper.createPlayer("george");
    Sentence sentence = ConversationParser.parse("51");
    action.fire(player , sentence , raiser);
    assertThat(getReply(engine), is("You do not have enough money to buy a house!"));
    housePortal.setOwner("jim");
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.