Examples of Creature


Examples of games.stendhal.server.entity.creature.Creature

   */
  @Test
  public void testgetBaseSpeed() {

    assertEquals(0.2, (new SpeakerNPC("bob")).getBaseSpeed(), 0.001);
    assertEquals(0.0, (new Creature()).getBaseSpeed(), 0.001);
    assertEquals(1.0, (PlayerTestHelper.createPlayer("player")).getBaseSpeed(),
        0.001);
    assertEquals(0.9, (new Cat()).getBaseSpeed(), 0.001);
    assertEquals(0.25, (new Sheep()).getBaseSpeed(), 0.001);

View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

  // Trying to attack creatures should always succeed
  @Test
  public void startAttackingCreature() {
    final Player player = PlayerTestHelper.createPlayer("hyde");
   
    Creature victim = SingletonRepository.getEntityManager().getCreature("mouse");
    zone.add(victim);
   
    // both at level 0
    StendhalRPAction.startAttack(player, victim);
    assertSame(player.getAttackTarget(), victim);
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

   * Tests for 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.Creature

    final int x = player.getInt("x");
    final int y = player.getInt("y");

    final EntityManager manager = SingletonRepository.getEntityManager();

    Creature pickedCreature = null;

    final String type = getInfoString();

    if (type != null) {
      // scroll for special monster
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

    buildTwilightArea(zone, attributes);
  }

  private void buildTwilightArea(final StendhalRPZone zone, final Map<String, String> attributes) {
    final EntityManager manager = SingletonRepository.getEntityManager();
    final Creature creature = new ItemGuardCreature(manager.getCreature("twilight slime"), "twilight elixir", "mithril_cloak", "twilight_zone");
    final CreatureRespawnPoint point = new CreatureRespawnPoint(zone, 5, 5, creature, 1);
    zone.add(point);
  }
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

  }

  private void buildSixthFloor(final StendhalRPZone zone, final Map<String, String> attributes) {
    final EntityManager manager = SingletonRepository.getEntityManager();

    final Creature creature = manager.getCreature("littlefairy");
    final Creature creature1 = manager.getCreature("pegasus");
    final Creature creature2 = manager.getCreature("unicorn");
    final Creature creature3 = manager.getCreature("archangel");

    creature.setAIProfiles(new HashMap<String, String>());
    creature1.setAIProfiles(new HashMap<String, String>());
    creature2.setAIProfiles(new HashMap<String, String>());
    creature3.setAIProfiles(new HashMap<String, String>());

    creature.clearDropItemList();
    creature1.clearDropItemList();
    creature2.clearDropItemList();
    creature3.clearDropItemList();

    creature.setXP(0);
    creature1.setXP(0);
    creature2.setXP(0);
    creature3.setXP(0);
   
    creature.setPosition(15,28);
    creature1.setPosition(29,15);
    creature2.setPosition(1,15);
    creature3.setPosition(14,2);

    creature.setDirection(Direction.UP);
    creature1.setDirection(Direction.LEFT);
    creature2.setDirection(Direction.RIGHT);
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

  }

  private void buildFirstFloor(final StendhalRPZone zone, final Map<String, String> attributes) {
    final EntityManager manager = SingletonRepository.getEntityManager();

    final Creature creature = manager.getCreature("fire elemental");
    final Creature creature1 = manager.getCreature("demon");
    final Creature creature2 = manager.getCreature("imp");
    final Creature creature3 = manager.getCreature("red dragon");

    creature1.setName("fire demon");

    creature1.setDescription("You see a fire demon. His body is paled in flames, which will burn your skin.");
 
    creature.setAIProfiles(new HashMap<String, String>());
    creature1.setAIProfiles(new HashMap<String, String>());
    creature2.setAIProfiles(new HashMap<String, String>());
    creature3.setAIProfiles(new HashMap<String, String>());   
   
    creature.clearDropItemList();
    creature1.clearDropItemList();
    creature2.clearDropItemList();
    creature3.clearDropItemList();

    creature.setXP(0);
    creature1.setXP(0);
    creature2.setXP(0);
    creature3.setXP(0);
   
    creature.setPosition(15,28);
    creature1.setPosition(29,15);
    creature2.setPosition(1,15);
    creature3.setPosition(14,2);

    creature.setDirection(Direction.UP);
    creature1.setDirection(Direction.LEFT);
    creature2.setDirection(Direction.RIGHT);
   
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

      }
     
      refreshCreaturesList(previousCreature);
     
      // Creature selection magic happens here
      final Creature pickedCreature = pickIdealCreature(player.getLevel(),
          false, sortedcreatures);

      // shouldn't happen
      if (pickedCreature == null) {
        raiser.say("Thanks for asking, but there's nothing you can do for me now.");
        return;
      }

      String creatureName = pickedCreature.getName();
     
     
      raiser.say("Semos is in need of help. Go kill " + Grammar.a_noun(creatureName)
          + " and say #complete, once you're done.");
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

        return null;
      }

      // pick a random creature from the acceptable range.
      final int result = start + new Random().nextInt(current - start + 1);
      final Creature cResult = creatureList.get(result);

      if (testMode) {
        logger.debug("OK: <" + level + "> start=" + start
            + ", current=" + current + ", result=" + result
            + ", cResult=" + cResult.getName() + ". OPTIONS: ");
        for (int i = start; i <= current; i++) {
          final Creature cTemp = creatureList.get(i);
          logger.debug(cTemp.getName() + ":" + cTemp.getLevel()  + "; ");
        }
      }
      return cResult;
    }
View Full Code Here

Examples of games.stendhal.server.entity.creature.Creature

  }

  private void buildQuicksandArea(final StendhalRPZone zone, final Map<String, String> attributes) {
    final EntityManager manager = SingletonRepository.getEntityManager();

    final Creature creature = new ItemGuardCreature(manager.getCreature("minotaur"), "minotaur key");

    final CreatureRespawnPoint point = new CreatureRespawnPoint(zone, 121, 121, creature, 1);

    zone.add(point);
  }
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.