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