Examples of damage()


Examples of games.stendhal.server.entity.item.RingOfLife.damage()

    assertEquals("I am an expert on #'wedding rings' and #'emerald rings', sometimes called the ring of #life.", getReply(npc));
    assertTrue(en.step(player, "emerald"));
    assertEquals("I see you already have an emerald ring. If it gets broken, you can come to me to fix it.", getReply(npc));

    // break the ring don't give them money and make them lie that they have it
    ring.damage();
    assertTrue(en.step(player, "emerald"));
    assertEquals("What a pity, your emerald ring is broken. I can fix it, for a #price.", getReply(npc));
    assertTrue(en.step(player, "price"));
    assertEquals("The charge for my service is 80000 money, and I need 2 gold bars and 1 emerald to fix the ring. Do you want to pay now?", getReply(npc));
    assertTrue(en.step(player, "yes"));
View Full Code Here

Examples of games.stendhal.server.entity.item.RingOfLife.damage()

    // -----------------------------------------------
    // this time say no they don't want to pay yet
    npc = SingletonRepository.getNPCList().get("Ognir");
    en = npc.getEngine();
    final RingOfLife ring = (RingOfLife) SingletonRepository.getEntityManager().getItem("emerald ring");
    ring.damage();
    player.getSlot("bag").add(ring);
    assertTrue(en.step(player, "hi"));
    assertEquals("Hi! Can I #help you?", getReply(npc));
    assertTrue(en.step(player, "help"));
    assertEquals("I am an expert on #'wedding rings' and #'emerald rings', sometimes called the ring of #life.", getReply(npc));
View Full Code Here

Examples of games.stendhal.server.entity.item.RingOfLife.damage()

   */
  @Test
  public void testOrderEmeraldRing() {
   
    final RingOfLife ring = (RingOfLife) SingletonRepository.getEntityManager().getItem("emerald ring");
    ring.damage();
    player.equipToInventoryOnly(ring);
   
    PlayerTestHelper.equipWithMoney(player, 80000);
    PlayerTestHelper.equipWithStackableItem(player, "gold bar", 2);
    PlayerTestHelper.equipWithStackableItem(player, "emerald", 1);
View Full Code Here

Examples of games.stendhal.server.entity.item.RingOfLife.damage()

   * Tests for giveBoundRingGetBoundRing.
   */
  @Test
  public void testgiveBoundRingGetBoundRing() {
    final RingOfLife ring = (RingOfLife) SingletonRepository.getEntityManager().getItem("emerald ring");
    ring.damage();
    player.equipToInventoryOnly(ring);
    ring.setBoundTo(player.getName());
    orderfixandfetchordered(player);
    final Item ringafter = player.getFirstEquipped("emerald ring");
    assertTrue(ringafter.isBound());
View Full Code Here

Examples of games.stendhal.server.entity.item.RingOfLife.damage()

   * Tests for giveUnboundRingGetUnboundRing.
   */
  @Test
  public void testgiveUnboundRingGetUnboundRing() {
    final RingOfLife ring = (RingOfLife) SingletonRepository.getEntityManager().getItem("emerald ring");
    ring.damage();
    player.equipToInventoryOnly(ring);
   
    assertFalse(ring.isBound());
    orderfixandfetchordered(player);
    final Item ringafter = player.getFirstEquipped("emerald ring");
View Full Code Here

Examples of mage.game.permanent.Permanent.damage()

        else {
          blocker.damage(damage, attacker.getId(), game, true, true);
        }
      }
      if (canDamage(blocker, first)) {
        attacker.damage(blocker.getPower().getValue(), blocker.getId(), game, true, true);
      }
    }
  }

  private void multiBlockerDamage(boolean first, Game game) {
View Full Code Here

Examples of mage.game.permanent.Permanent.damage()

    if (attacker != null && canDamage(attacker, first)) {
      for (UUID blockerId: blockerOrder) {
        Permanent blocker = game.getPermanent(blockerId);
        int lethalDamage = blocker.getToughness().getValue() - blocker.getDamage();
        if (lethalDamage >= damage) {
          blocker.damage(damage, attacker.getId(), game, true, true);
          damage = 0;
          break;
        }
        int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + blocker.getName(), game);
        blocker.damage(damageAssigned, attacker.getId(), game, true, true);
View Full Code Here

Examples of mage.game.permanent.Permanent.damage()

          blocker.damage(damage, attacker.getId(), game, true, true);
          damage = 0;
          break;
        }
        int damageAssigned = player.getAmount(lethalDamage, damage, "Assign damage to " + blocker.getName(), game);
        blocker.damage(damageAssigned, attacker.getId(), game, true, true);
        damage -= damageAssigned;
      }
      if (damage > 0 && hasTrample(attacker)) {
        defenderDamage(attacker, damage, game);
      }
View Full Code Here

Examples of mage.game.permanent.Permanent.damage()

  private void defenderDamage(Permanent attacker, int amount, Game game) {
    if (this.defenderIsPlaneswalker) {
      Permanent defender = game.getPermanent(defenderId);
      if (defender != null) {
        defender.damage(amount, attacker.getId(), game, true, true);
      }
    }
    else {
      Player defender = game.getPlayer(defenderId);
      defender.damage(amount, attacker.getId(), game, true, true);
View Full Code Here

Examples of mage.game.permanent.Permanent.damage()

        defender.damage(amount, attacker.getId(), game, true, true);
      }
    }
    else {
      Player defender = game.getPlayer(defenderId);
      defender.damage(amount, attacker.getId(), game, true, true);
    }
  }

  public boolean canBlock(Permanent blocker, Game game) {
    for (UUID attackerId: attackers) {
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.