Package marauroa.common.game.RPObject

Examples of marauroa.common.game.RPObject.ID


    assertEquals("i have not brought anything yet it should be all needed items",
        "#one, #two, and #three", getReply(npc));

    StackableItem item = new StackableItem("one", "", "", null);
    item.setQuantity(10);
    item.setID(new ID(2, "testzone"));
    player.getSlot("bag").add(item);
    en.step(player, "yes");
    assertEquals("item brought", quest.askForItemsAfterPlayerSaidHeHasItems(), getReply(npc));

    en.step(player, "one");
    assertEquals("item brought", quest.respondToItemBrought(), getReply(npc));
    en.step(player, "one");
    assertEquals("item brought", quest.respondToOfferOfNotMissingItem(), getReply(npc));
    npc.remove("text");
    assertEquals(ConversationStates.QUESTION_1, en.getCurrentState());
    en.step(player, quest.getTriggerPhraseToEnumerateMissingItems().get(0));
    final List<String> missing = new LinkedList<String>(quest.getNeededItems());
    missing.remove("one");
    assertEquals("two and three are missing", "#two and #three", getReply(npc));
    en.step(player, "two");
    assertEquals("item brought", quest.respondToOfferOfNotExistingItem("two"), getReply(npc));

    item = new StackableItem("two", "", "", null);
    item.setQuantity(10);
    item.setID(new ID(2, "testzone"));
    player.getSlot("bag").add(item);
    item = new StackableItem("three", "", "", null);
    item.setQuantity(10);
    item.setID(new ID(2, "testzone"));
    player.getSlot("bag").add(item);
    en.step(player, "three");
    assertEquals("item brought", quest.respondToItemBrought(), getReply(npc));
    en.step(player, "two");
    assertEquals("last item brought", quest.respondToLastItemBrought(), getReply(npc));
View Full Code Here


    en.step(player, "bye");
    assertFalse(hayunn.isTalking());
    assertEquals("start", player.getQuest("beer_hayunn"));
    final StackableItem beer = new StackableItem("beer", "", "", null);
    beer.setQuantity(1);
    beer.setID(new ID(2, "testzone"));
    player.getSlot("bag").add(beer);
    assertEquals(1, player.getNumberOfEquipped("beer"));
    en.step(player, "hi");
    en.step(player, "yes");
    assertEquals("done", player.getQuest("beer_hayunn"));
View Full Code Here

  /**
   * Tests for hasValidTargetvisibleVictim.
   */
  @Test
  public void testhasValidTargetvisibleVictim() {
    ID id = new RPObject.ID(1, "zone");
    StendhalRPZone zone = createMock(StendhalRPZone.class);
    expect(zone.has(id)).andReturn(false);

    RPEntity victim = createMock(RPEntity.class);
    expect(victim.isInvisibleToCreatures()).andReturn(false);
View Full Code Here

        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);
    assertTrue(player.isEquipped("fishing rod"));
    fs.onUsed(player);
    assertEquals("You have started fishing.", player.events().get(0).get("text"));
    player.clearEvents();
View Full Code Here

    assertTrue(enKatinka.step(player, "bye"));
    assertEquals("Goodbye!", getReply(katinkaNpc));
    // equip player with to less needed stuff
    final StackableItem ham = new StackableItem("ham", "", "", null);
    ham.setQuantity(5);
    ham.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(ham);
    assertEquals(5, player.getNumberOfEquipped("ham"));

    // bother katinka again
    assertTrue(enKatinka.step(player, "hi"));
    assertEquals("Welcome back! Have you brought the 10 pieces of ham?",
        getReply(katinkaNpc));
    assertTrue("lie", enKatinka.step(player, "yes"));
    assertEquals(
        "*sigh* I SPECIFICALLY said that we need 10 pieces of ham!",
        getReply(katinkaNpc));
    assertTrue(enKatinka.step(player, "bye"));
    assertEquals("Goodbye!", getReply(katinkaNpc));
    // equip player with to needed stuff
    final StackableItem ham2 = new StackableItem("ham", "", "", null);
    ham2.setQuantity(5);
    ham2.setID(new ID(3, ZONE_NAME));
    player.getSlot("bag").add(ham2);
    assertEquals(10, player.getNumberOfEquipped("ham"));
    // bring stuff to katinka
    assertTrue(enKatinka.step(player, "hi"));
    assertEquals("Welcome back! Have you brought the 10 pieces of ham?",
View Full Code Here

        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    Player george = PlayerTestHelper.createPlayer("george");
    Offer offer = new Offer(item, price, george);
    offer.setID(new ID(1, "shop"));

    Player ernie = PlayerTestHelper.createPlayer("ernie");
    ernie.equipToInventoryOnly(erniesMoney);
    assertThat(ernie.isEquipped("money", price), is(Boolean.TRUE));
    market.acceptOffer(offer, ernie);
View Full Code Here

    assertEquals(
        "Hallo! Glad to see you in my kitchen where I make #pizza and #sandwiches.",
        getReply(npc));
    final StackableItem cheese = new StackableItem("cheese", "", "", null);
    cheese.setQuantity(2);
    cheese.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(cheese);
    final StackableItem bread = new StackableItem("bread", "", "", null);
    bread.setQuantity(1);
    bread.setID(new ID(1, ZONE_NAME));
    player.getSlot("bag").add(bread);
    final StackableItem ham = new StackableItem("ham", "", "", null);
    ham.setID(new ID(3, ZONE_NAME));
    player.getSlot("bag").add(ham);
    assertEquals(2, player.getNumberOfEquipped("cheese"));
    assertEquals(1, player.getNumberOfEquipped("bread"));
    assertEquals(1, player.getNumberOfEquipped("ham"));
View Full Code Here

    assertEquals(
        "Hallo! Glad to see you in my kitchen where I make #pizza and #sandwiches.",
        getReply(npc));
    final StackableItem cheese = new StackableItem("cheese", "", "", null);
    cheese.setQuantity(4);
    cheese.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(cheese);
    final StackableItem bread = new StackableItem("bread", "", "", null);
    bread.setQuantity(2);
    bread.setID(new ID(1, ZONE_NAME));
    player.getSlot("bag").add(bread);
    final StackableItem ham = new StackableItem("ham", "", "", null);
    ham.setQuantity(2);
    ham.setID(new ID(3, ZONE_NAME));
    player.getSlot("bag").add(ham);
    assertEquals(4, player.getNumberOfEquipped("cheese"));
    assertEquals(2, player.getNumberOfEquipped("bread"));
    assertEquals(2, player.getNumberOfEquipped("ham"));
View Full Code Here

    assertEquals(
        "Hallo! Glad to see you in my kitchen where I make #pizza and #sandwiches.",
        getReply(npc));
    final StackableItem cheese = new StackableItem("cheese", "", "", null);
    cheese.setQuantity(6);
    cheese.setID(new ID(2, ZONE_NAME));
    player.getSlot("bag").add(cheese);
    final StackableItem bread = new StackableItem("bread", "", "", null);
    bread.setQuantity(3);
    bread.setID(new ID(1, ZONE_NAME));
    player.getSlot("bag").add(bread);
    final StackableItem ham = new StackableItem("ham", "", "", null);
    ham.setQuantity(10);
    ham.setID(new ID(3, ZONE_NAME));
    player.getSlot("bag").add(ham);
    assertEquals(6, player.getNumberOfEquipped("cheese"));
    assertEquals(3, player.getNumberOfEquipped("bread"));
    assertEquals(10, player.getNumberOfEquipped("ham"));
View Full Code Here

      // Not a slot we are interested in
      return;
    }
   
    for (RPObject obj : added) {
      ID id = obj.getID();
      IEntity entity = panel.getEntity();
      if (entity != null && id.equals(entity.getRPObject().getID())) {
        // Changed rather than added.
        return;
      }
      // Actually added, fetch the corresponding entity
      entity = GameObjects.getInstance().get(obj);
View Full Code Here

TOP

Related Classes of marauroa.common.game.RPObject.ID

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.