Examples of Creature


Examples of aitgame.tilegame.sprites.Creature

    this.renderer = renderer;

    Iterator<Sprite> iCollisionAndUpdate = collisionAndUpdate.iterator();
   
    while (iCollisionAndUpdate.hasNext()) {
      Creature person = (Creature) iCollisionAndUpdate.next();
     
      if(!checkPeopleCollision(person, elapsedTime, collisionAndUpdate.iterator(),
          iOnlyCollision.iterator())){
        checkTileCollision(person, elapsedTime);
      }

      person.update(elapsedTime);
     
      //Looks for people and objects that can be contacted.
      person.removeContacts();
      checkContactCollision(person, elapsedTime, collisionAndUpdate.iterator(),
          iOnlyCollision.iterator(), itemSprites.iterator());
    }
  } 
View Full Code Here

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

    action.put("creature", "rat");
    action.put("x", 0);
    action.put("y", 0);
    CommandCenter.execute(pl, action);
    assertEquals(1, pl.getID().getObjectID());
    final Creature rat = (Creature) zone.getEntityAt(0, 0);
    assertEquals("rat", rat.get("subclass"));

    action = new RPAction();
    action.put("type", "altercreature");
    action.put("target", "#2");
    // must be of type "name;atk;def;hp;xp",
    action.put("text", "newname;5;6;7;8");

    CommandCenter.execute(pl, action);

    assertEquals("name", "newname", rat.getName());
    assertEquals("atk", 5, rat.getAtk());
    assertEquals("def", 6, rat.getDef());
    assertEquals("hp", 7, rat.getHP());
    assertEquals("xp", 8, rat.getXP());
   
    action.put("text", "-;-;-;100;100");
   
    CommandCenter.execute(pl, action);
   
    assertEquals("name", "newname", rat.getName());
    assertEquals("atk", 5, rat.getAtk());
    assertEquals("def", 6, rat.getDef());
    assertEquals("hp", 100, rat.getHP());
    assertEquals("xp", 100, rat.getXP());
  }
View Full Code Here

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

   */
  @Test
  public final void testOnDestroyRat() {
    CreatureTestHelper.generateRPClasses();
    final Player pl = PlayerTestHelper.createPlayer("hugo");
    final Creature rat = new RaidCreature(SingletonRepository.getEntityManager().getCreature("rat"));
    final StendhalRPZone testzone = new StendhalRPZone("Testzone");
    testzone.add(rat);
    testzone.add(pl);

    assertEquals(1, rat.getID().getObjectID());
    pl.setAdminLevel(5000);
    pl.clearEvents();

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    final RPAction action = new RPAction();
View Full Code Here

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

   */
  @Test
  public final void testOnDestroyRatWithTargetID() {

    final Player pl = PlayerTestHelper.createPlayer("hugo");
    final Creature rat = new RaidCreature(SingletonRepository.getEntityManager().getCreature("rat"));
    final StendhalRPZone testzone = new StendhalRPZone("Testzone");
    testzone.add(rat);
    testzone.add(pl);

    assertEquals(1, rat.getID().getObjectID());
    pl.setAdminLevel(5000);
    pl.clearEvents();

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    final RPAction action = new RPAction();
View Full Code Here

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

   * Tests for onInspectRatWithTargetID.
   */
  @Test
  public final void testOnInspectRatWithTargetID() {
    final Player pl = PlayerTestHelper.createPlayer("hugo");
    final Creature rat = new RaidCreature(SingletonRepository.getEntityManager().getCreature("rat"));
    final StendhalRPZone testzone = new StendhalRPZone("Testzone");
    testzone.add(rat);
    testzone.add(pl);

    assertEquals(1, rat.getID().getObjectID());
    pl.setAdminLevel(5000);
    pl.clearEvents();

    MockStendhalRPRuleProcessor.get().addPlayer(pl);
    final RPAction action = new RPAction();
View Full Code Here

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

    action.put("creature", "rat");
    action.put("x", 0);
    action.put("y", 0);
    CommandCenter.execute(pl, action);
    assertEquals(1, pl.getID().getObjectID());
    final Creature rat = (Creature) zone.getEntityAt(0, 0);
    assertEquals("rat", rat.get("subclass"));
    assertTrue("RaidCreature", rat instanceof RaidCreature);
  }
View Full Code Here

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

   */
  @Test
  public void testInArea() {
    SingletonRepository.getRPWorld();
    final Area area = createArea();
    final Creature entity = new Creature();
    zone.add(entity);
    entity.setPosition(3, 4);
    Assert.assertTrue(area.contains(entity));
  }
View Full Code Here

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

  public void testNotInArea() {
    SingletonRepository.getRPWorld();
    final Area area = createArea();

    // other zone
    Creature entity = new Creature();
    otherZone.add(entity);
    entity.setPosition(3, 4);
    Assert.assertFalse(area.contains(entity));

    // right zone but wrong position
    entity = new Creature();
    zone.add(entity);
    entity.setPosition(1, 1);
    Assert.assertFalse(area.contains(entity));
}
View Full Code Here

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

      count.put(c.getCreatureName(), 0);
    }

    for (final IRPZone zone : SingletonRepository.getRPWorld()) {
      for (final CreatureRespawnPoint p : ((StendhalRPZone) zone).getRespawnPointList()) {
        final Creature c = p.getPrototypeCreature();
        int creatureCount = 1;
        if (count.containsKey(c.getName())) {
          creatureCount = count.get(c.getName()) + 1;
        }

        count.put(c.getName(), creatureCount);
      }
    }

    Integer total = Integer.valueOf(0);
    for (final Map.Entry<String, Integer> e : count.entrySet()) {
View Full Code Here

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

    return SingletonRepository.getEntityManager().getItem(
        name);
  }

  public Creature add(final Creature template, final int x, final int y) {
    Creature creature = template.getNewInstance();
    if (zone != null) {
      if (StendhalRPAction.placeat(zone, creature, x, y)) {
        loadedNPCs.put(creature, null);
        logger.info(filename + " added creature: " + creature);
      } else {
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.