Examples of RPEntity


Examples of games.stendhal.server.entity.RPEntity

  }

  @Override
  public void onDead(final Entity killer, final boolean remove) {
    if (killer instanceof RPEntity) {
      final RPEntity killerRPEntity = (RPEntity) killer;

      if (killerRPEntity.drop(oldItemType)) {
        final Item item = SingletonRepository.getEntityManager().getItem(
            itemType);

        killerRPEntity.equipOrPutOnGround(item);
      }
    }
    super.onDead(killer, remove);
  }
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

  /**
   * function will fill information about victim to killer's quest slot.
   * @param circ - information about victim,zone and killer.
   */
  private void updatePlayerQuest(final CircumstancesOfDeath circ) {
    final RPEntity killer = circ.getKiller();
    final String victim = circ.getVictim().getName();
    Logger.getLogger(SpidersCreatures.class).debug(
        "in "+circ.getZone().getName()+
        ": "+circ.getVictim().getName()+
        " killed by "+circ.getKiller().getName());
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

    final List<RPEntity> enemyList = creature.getEnemyList();
    if (enemyList.isEmpty()) {
      return false;
    }

    RPEntity target = null;
   
    if (creature.isAttacking() && isPreferredTarget(creature.getAttackTarget())) {
      target = creature.getAttackTarget();
    }

    int level;
    if (target != null) {
      level = target.getLevel();
    } else {
      // just something above anything
      level = 1000;
    }
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

  /**
   * function will fill information about victim to killer's quest slot.
   * @param circ - information about victim,zone and killer.
   */ 
  private void updatePlayerQuest(final CircumstancesOfDeath circ) {
    final RPEntity killer = circ.getKiller();
    final String victim = circ.getVictim().getName();
    Logger.getLogger(SpidersCreatures.class).debug(
        "in "+circ.getZone().getName()+
        ": "+circ.getVictim().getName()+
        " killed by "+circ.getKiller().getName());
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

      return false;
    }
  }

  public void findNewTarget(final Creature creature) {
    final RPEntity enemy = creature.getNearestEnemy(creature.getPerceptionRange()+2);
    if (enemy != null) {
      creature.setTarget(enemy);
    }
  }
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

  public boolean hasValidTarget(final Creature creature) {
    if (!creature.isAttacking()) {
      return false;
    }

    final RPEntity victim = creature.getAttackTarget();
    if (victim.isInvisibleToCreatures()) {
      return false;
    }
    if (!victim.getZone().equals(creature.getZone())) {
      return false;
    }

    if (!creature.getZone().has(victim.getID())) {
      return false;
    }
    return creature.squaredDistance(victim) < (FOLLOW_RADIUS * FOLLOW_RADIUS);
  }
 
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

      return false;
    }
  }

  public void findNewTarget(final Creature creature) {
    final RPEntity enemy = creature.getNearestEnemy(creature.getPerceptionRange()+2);
    if (enemy != null) {
      creature.setTarget(enemy);
    }
  }
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

  public boolean hasValidTarget(final Creature creature) {
    if (!creature.isAttacking()) {
      return false;
    }

    final RPEntity victim = creature.getAttackTarget();
    if (victim.isInvisibleToCreatures()) {
      return false;
    }
    if (!victim.getZone().equals(creature.getZone())) {
      return false;
    }

    if (!creature.getZone().has(victim.getID())) {
      return false;
    }
    return creature.squaredDistance(victim) < MAX_RANGE_SQUARED;
  }
View Full Code Here

Examples of games.stendhal.server.entity.RPEntity

      action.get(TARGET), player);

    if ((entity == null) || !(entity instanceof RPEntity)) {
      return;
    }
    final RPEntity rpEntity = (RPEntity) entity;

    tryPush(player, rpEntity);
  }
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.