Exemplo n.º 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();
  }
Exemplo n.º 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);
      }
    }
  }
Exemplo n.º 3
0
 @Override
 public ItemSprite.Glowing glowing() {
   return enchantment != null ? enchantment.glowing() : null;
 }
Exemplo n.º 4
0
 @Override
 public String name() {
   return enchantment == null ? super.name() : enchantment.name(super.name());
 }