Package games.stendhal.server.entity.player

Examples of games.stendhal.server.entity.player.Player.equipToInventoryOnly()


    Item item = SingletonRepository.getEntityManager().getItem("empty goblet");
    player.equipToInventoryOnly(item);
    item = SingletonRepository.getEntityManager().getItem("skull ring");
    player.equipToInventoryOnly(item);
    item = SingletonRepository.getEntityManager().getItem("bat entrails");
    player.equipToInventoryOnly(item);
    item = SingletonRepository.getEntityManager().getItem("vampirette entrails");
    player.equipToInventoryOnly(item);
   
    en.step(player, "fill");
    String answer = getReply(npc);
View Full Code Here


    item = SingletonRepository.getEntityManager().getItem("skull ring");
    player.equipToInventoryOnly(item);
    item = SingletonRepository.getEntityManager().getItem("bat entrails");
    player.equipToInventoryOnly(item);
    item = SingletonRepository.getEntityManager().getItem("vampirette entrails");
    player.equipToInventoryOnly(item);
   
    en.step(player, "fill");
    String answer = getReply(npc);
    assertTrue("answer to 'fill'", answer.startsWith("I can only fill a goblet if you bring me "));
    assertEquals("should not have a '" + sickySlotName + "' slot", null, player.getQuest(sickySlotName));
View Full Code Here

    Player bob = PlayerTestHelper.createPlayer("bob");
    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    bob.equipToInventoryOnly(item);
    assertEquals(bob, item.getContainer());
    Offer offer = market.createOffer(bob, item, 10, 1);
   
    assertTrue(market.contains(offer));
    assertFalse(offer.getItem().getContainer().equals(bob));
View Full Code Here

    Item item = SingletonRepository.getEntityManager().getItem("axe");
    StackableItem erniesMoney = (StackableItem) SingletonRepository
        .getEntityManager().getItem("money");
    Integer price = Integer.valueOf(10);
    erniesMoney.setQuantity(price);
    george.equipToInventoryOnly(item);
    Integer number = Integer.valueOf(1);
    Offer offer = market.createOffer(george, item, price, number);
    assertThat(offer.getItem(), is(item));
    assertThat(offer.getPrice(), is(price));
    assertThat(Boolean.valueOf(george.isEquipped(item.getName())),
View Full Code Here

    assertThat(offer.getItem(), is(item));
    assertThat(offer.getPrice(), is(price));
    assertThat(Boolean.valueOf(george.isEquipped(item.getName())),
        is(Boolean.FALSE));
    Player ernie = PlayerTestHelper.createPlayer("ernie");
    ernie.equipToInventoryOnly(erniesMoney);
    assertThat(ernie.isEquipped("money", price), is(Boolean.TRUE));
    market.acceptOffer(offer, ernie);
    assertThat(Boolean.valueOf(ernie.isEquipped("axe")), is(Boolean.TRUE));
    assertThat(ernie.isEquipped("money", price), is(Boolean.FALSE));
    assertThat(Boolean.valueOf(george.isEquipped("money")), is(Boolean.FALSE));
View Full Code Here

   
    final WeddingRing ring = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring.setInfoString("juliet");
   
    final WeddingRing ring2 = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    juliet.equipToInventoryOnly(ring2);
   
    assertFalse(ring.onUsed(romeo));
   
    assertEquals("Sorry, juliet has divorced you and is now engaged to someone else.", romeo.events().get(0).get("text"));
  }
View Full Code Here

    final WeddingRing ring = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring.setInfoString("juliet");
   
    final WeddingRing ring2 = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring2.setInfoString("paris");
    juliet.equipToInventoryOnly(ring2);
   
    assertFalse(ring.onUsed(romeo));
   
    assertEquals("Sorry, juliet has divorced you and is now remarried.", romeo.events().get(0).get("text"));
  }
View Full Code Here

    final WeddingRing ring = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring.setInfoString("juliet");
   
    final WeddingRing ring2 = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring2.setInfoString("romeo");
    juliet.equipToInventoryOnly(ring2);
   
    assertFalse(ring.onUsed(romeo));
    assertEquals(romeo.events().get(0).get("text"), "The strong anti magic aura in this area prevents the wedding ring from working!");
    // no such thing as removing teleport restrictions
    MockStendlRPWorld.get().removeZone(zone);
View Full Code Here

    final WeddingRing ring = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring.setInfoString("juliet");
   
    final WeddingRing ring2 = (WeddingRing) SingletonRepository.getEntityManager().getItem("wedding ring");
    ring2.setInfoString("romeo");
    juliet.equipToInventoryOnly(ring2);
   
    assertFalse(ring.onUsed(romeo));
    assertEquals(romeo.events().get(0).get("text"), "The strong anti magic aura in the destination area prevents the wedding ring from working!");
    // no such thing as removing teleport restrictions
    MockStendlRPWorld.get().removeZone(zone);
View Full Code Here

    StendhalRPZone zone = new StendhalRPZone("shop");
    Market market = Market.createShop();
    zone.add(market);
   
    Item item = SingletonRepository.getEntityManager().getItem("axe");
    george.equipToInventoryOnly(item);
    Offer offer = market.createOffer(george, item, 10, 1);
   
    item = SingletonRepository.getEntityManager().getItem("carrot");
    george.equipToInventoryOnly(item);
    Offer offer2 = market.createOffer(george, item, 11, 1);
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.