예제 #1
0
        public string use(Hero hero)
        {
            _hero = hero;
            _hero.setCurHealth(_hero.getCurHealth() + getEffect().getHealthValue());
            _hero.setCurMana(_hero.getCurMana() + getEffect().getManaValue());
            _hero.setModStrength(_hero.getModStrength() + getEffect().getStrengthValue());
            _hero.setModMagic(_hero.getModMagic() + getEffect().getMagicValue());
            _hero.setModDefense(_hero.getModDefense() + getEffect().getPhysicalDefenseValue());
            _hero.setModResistance(_hero.getModResistance() + getEffect().getResistanceDefenseValue());

            if (_hasStatusEffect)
            {
                _statusEffect.setHero(_hero);
                _hero.Subscribe(_statusEffect);
            }

            else
            {
                return(_hero.getName() + " used " + this.getItemName() + ", " + getEffect().getEffectName() + getEffect().getEffectAmount());
            }

            return("The status effect was applied.");
        }