示例#1
0
  public Statue() {
    super();

    do {
      weapon = (Weapon) Generator.random(Generator.Category.WEAPON);
    } while (!(weapon instanceof MeleeWeapon) || weapon.level < 0);

    weapon.identify();
    weapon.enchant(Enchantment.random());

    HP = HT = 15 + Dungeon.depth * 5;
    defenseSkill = 4 + Dungeon.depth;
  }
  @Override
  protected void onItemSelected(Item item) {

    Weapon weapon = (Weapon) item;

    ScrollOfRemoveCurse.uncurse(Dungeon.hero, weapon);
    weapon.upgrade(true);

    GLog.p(TXT_LOOKS_BETTER, weapon.name());

    Badges.validateItemLevelAquired(weapon);

    curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3);
  }
示例#3
0
  @Override
  public boolean proc(Weapon weapon, Char attacker, Char defender, int damage) {
    // lvl 0 - 25%
    // lvl 1 - 40%
    // lvl 2 - 50%
    int level = Math.max(0, weapon.effectiveLevel());

    if (Random.Int(level + 4) >= 3) {

      points[0] = attacker.pos;
      nPoints = 1;

      affected.clear();
      affected.add(attacker);

      hit(defender, Random.Int(1, damage / 2));

      attacker.sprite.parent.add(new Lightning(points, nPoints, null));

      return true;

    } else {

      return false;
    }
  }
  @Override
  protected void onItemSelected(Item item) {

    ScrollOfRemoveCurse.uncurse(Dungeon.hero, item);

    if (item instanceof Weapon) {

      ((Weapon) item).enchant();

    } else {

      ((Armor) item).inscribe();
    }

    item.fix();

    curUser.sprite.emitter().start(Speck.factory(Speck.LIGHT), 0.1f, 5);
    Enchanting.show(curUser, item);
    GLog.w(TXT_GLOWS, item.name());
  }
示例#5
0
 @Override
 public String description() {
   return String.format(Game.getVar(R.string.Statue_Desc), weapon.name());
 }
示例#6
0
 @Override
 public int attackProc(Char enemy, int damage) {
   weapon.proc(this, enemy, damage);
   return damage;
 }