Examples of canAttackNow()


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

   * Tests for canAttackNow.
   */
  @Test
  public void testCanAttackNow() {
    final Gandhi g = new Gandhi();
    assertFalse(g.canAttackNow(null));
  }

 
 
  /**
 
View Full Code Here

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

   */
  @Test
  public void testCanAttackNow() {
    final HandToHand hth = new HandToHand();
    final Creature creature = new Creature();
    assertFalse("no target yet", hth.canAttackNow(creature));
    final RPEntity victim = new RPEntity() {

      @Override
      protected void dropItemsOn(final Corpse corpse) {

View Full Code Here

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

      }
    };
    victim.put("id", 1);
    creature.setTarget(victim);
    assertTrue("new ones stand on same positon", hth.canAttackNow(creature));
    victim.setPosition(10, 10);
    assertFalse("too far away", hth.canAttackNow(creature));

  }
View Full Code Here

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

    };
    victim.put("id", 1);
    creature.setTarget(victim);
    assertTrue("new ones stand on same positon", hth.canAttackNow(creature));
    victim.setPosition(10, 10);
    assertFalse("too far away", hth.canAttackNow(creature));

  }

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

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

    final Creature creature = SingletonRepository.getEntityManager().getCreature("balrog");
    assertNotNull(creature);
    assertThat(creature.getWidth(), is(6.0));
    assertThat(creature.getHeight(), is(6.0));
    creature.setPosition(10, 10);
    assertFalse("no target yet", hth.canAttackNow(creature));
    final RPEntity victim = PlayerTestHelper.createPlayer("bob");
    victim.setHP(1);
    zone.add(creature);
    zone.add(victim);
    creature.setTarget(victim);
View Full Code Here

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

    for (int i = 9; i < 12; i++) {
      for (int j = 9; j < 13; j++) {
        victim.setPosition(i, j);
        assertTrue(creature.nextTo(victim));
        assertTrue(victim.nextTo(creature));
        assertTrue("can attack now (" + i + "," + j + ")", hth.canAttackNow(creature));
      }
    }

    victim.setPosition(8, 13);
    assertFalse(creature.nextTo(victim));
View Full Code Here

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

    }

    victim.setPosition(8, 13);
    assertFalse(creature.nextTo(victim));
    assertFalse(victim.nextTo(creature));
    assertFalse("can attack now ", hth.canAttackNow(creature));

  }

  private static boolean mockinvisible;
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.