Exemple #1
0
  public Item upgrade(boolean enchant) {
    if (enchantment != null) {
      if (!enchant && Random.Int(level) > 0) {
        GLog.w(TXT_INCOMPATIBLE);
        enchant(null);
      }
    } else {
      if (enchant) {
        enchant(Enchantment.random());
      }
    }

    return super.upgrade();
  }
Exemple #2
0
  @Override
  public void proc(Char attacker, Char defender, int damage) {

    if (enchantment != null) {
      enchantment.proc(this, attacker, defender, damage);
    }

    if (!levelKnown) {
      if (--hitsToKnow <= 0) {
        levelKnown = true;
        GLog.i(TXT_IDENTIFY, name(), toString());
        Badges.validateItemLevelAquired(this);
      }
    }
  }
Exemple #3
0
 @Override
 public ItemSprite.Glowing glowing() {
   return enchantment != null ? enchantment.glowing() : null;
 }
Exemple #4
0
 @Override
 public String name() {
   return enchantment == null ? super.name() : enchantment.name(super.name());
 }