Examples of attack()


Examples of games.stendhal.server.entity.creature.Creature.attack()

  public void testAttack() throws Exception {
    MockStendhalRPRuleProcessor.get();
    final HandToHand hth = new HandToHand();
    final Creature creature = createMock(Creature.class);
    expect(creature.isAttackTurn(0)).andReturn(true);
    expect(creature.attack()).andReturn(true);
    creature.tryToPoison();
    replay(creature);
    hth.attack(creature);
    verify(creature);
  }
View Full Code Here

Examples of games.stendhal.server.entity.creature.impl.attack.Gandhi.attack()

   */
  @Test
  public void testAttack() {
    final Gandhi g = new Gandhi();
    final Creature c = new Creature();
    g.attack(null);
    g.attack(c);
    assertFalse(c.isAttacking());
  }

  /**
 
View Full Code Here

Examples of games.stendhal.server.entity.creature.impl.attack.Gandhi.attack()

  @Test
  public void testAttack() {
    final Gandhi g = new Gandhi();
    final Creature c = new Creature();
    g.attack(null);
    g.attack(c);
    assertFalse(c.isAttacking());
  }

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

Examples of games.stendhal.server.entity.creature.impl.attack.HandToHand.attack()

    final Creature creature = createMock(Creature.class);
    expect(creature.isAttackTurn(0)).andReturn(true);
    expect(creature.attack()).andReturn(true);
    creature.tryToPoison();
    replay(creature);
    hth.attack(creature);
    verify(creature);
  }

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

Examples of games.stendhal.server.entity.creature.impl.attack.HandToHand.attack()

    MockStendhalRPRuleProcessor.get();
    final HandToHand hth = new HandToHand();
    final Creature creature = createMock(Creature.class);
    expect(creature.isAttackTurn(0)).andReturn(false);
    replay(creature);
    hth.attack(creature);
    verify(creature);
  }

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

Examples of games.stendhal.server.entity.creature.impl.poison.Poisoner.attack()

    final String poisontype = "greater poison";
    final ConsumableItem poison = (ConsumableItem) SingletonRepository.getEntityManager().getItem(poisontype);

    final Poisoner poisoner = new Poisoner(100, poison);
    final Player victim = PlayerTestHelper.createPlayer("bob");
    poisoner.attack(victim);
    assertTrue(victim.isPoisoned());
  }

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

Examples of games.stendhal.server.entity.creature.impl.poison.Poisoner.attack()

    final String poisontype = "greater poison";
    final ConsumableItem poison = (ConsumableItem) SingletonRepository.getEntityManager().getItem(poisontype);

    final Poisoner poisoner = new Poisoner(0, poison);
    final Player victim = PlayerTestHelper.createPlayer("bob");
    poisoner.attack(victim);
    assertFalse(victim.isPoisoned());
  }
}
View Full Code Here

Examples of model.Character.attack()

    c4.setTarget(c3);
    c3.setTarget(c4);
    System.out.println(c4.statusToString());
    assertTrue(c4.getCurrentHealth() == 21);
    c4.addItem(new Elixir());
    c3.attack();
    System.out.println(c4.statusToString());
    assertTrue(c4.getCurrentHealth() == 15);
    c4.useItem(0);
    System.out.println(c4.statusToString());
    assertTrue(c4.getCurrentHealth() == 21);
View Full Code Here

Examples of model.FlyingKnight.attack()

    Character c2 = new FlyingKnight("flyingknight");
    Character c3 = new Warrior("warrior");
    c2.setTarget(c3);
    c3.setTarget(c2);
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    c2.attack();
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    assertTrue(c3.ifAlive() == true);
    c2.attack();
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    c2.attack();
View Full Code Here

Examples of model.FlyingKnight.attack()

    c3.setTarget(c2);
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    c2.attack();
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    assertTrue(c3.ifAlive() == true);
    c2.attack();
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    c2.attack();
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
    c2.attack();
    System.out.println(c2.getCurrentHealth() + " " + c3.getCurrentHealth());
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.