Example #1
0
 /**
  * Find targets.
  *
  * @param unit the unit
  */
 private void findTargets(Unit unit) {
   targets.clear();
   for (Node n : zone.getNodes()) {
     Unit u = grid.getUnit(n.x, n.y);
     if (u == null
         && grid.getTerrain(n.x, n.y).getMoveCost(net.fe.unit.Class.createClass("Phantom"))
             < unit.getStats().mov) {
       targets.add(n);
     }
   }
 }
Example #2
0
  /**
   * Generate summon.
   *
   * @param summoner the summoner
   * @return the unit
   */
  public static Unit generateSummon(Unit summoner) {
    WeaponFactory.loadWeapons();

    Statistics bases =
        new Statistics(
            /* hp = */ 1,
            /* str = */ 5,
            /* mag = */ 0,
            /* skl = */ 2,
            /* spd = */ 4,
            /* def = */ 0,
            /* res = */ 0,
            /* lck = */ 0,
            /* mov = */ 5,
            /* con = */ 11,
            /* aid = */ 10);
    Statistics growths =
        new Statistics(
            /* hp = */ 0,
            /* str = */ 55,
            /* mag = */ 15,
            /* skl = */ 35,
            /* spd = */ 45,
            /* def = */ 15,
            /* res = */ 15,
            /* lck = */ 50,
            /* mov = */ 0,
            /* con = */ 0,
            /* aid = */ 0);
    summonCount = summonCount + 1;
    final Unit summon =
        new Unit(
            "Phantom " + summonCount,
            net.fe.unit.Class.createClass("Phantom"),
            '-',
            bases,
            growths);
    summon.addToInventory(net.fe.unit.Item.getItem("Iron Axe"));
    summon.initializeEquipment();
    summon.setLevel(summoner.getLevel());
    summon.fillHp();
    summon.setMoved(true);

    summoner.getParty().addUnit(summon);
    summon.stage = summoner.stage;
    return summon;
  }