Esempio n. 1
0
    void OnEquipmentChanged(Equipment newItem, Equipment oldItem)
    {
        if (newItem != null)
        {
            HP.AddModifier(newItem.HP_modifier);
            MP.AddModifier(newItem.MP_modifier);
            PhysicalAttack.AddModifier(newItem.PhysicalAttack_modifier);
            PhysicalDefense.AddModifier(newItem.PhysicalDefense_modifier);
            MagicalAttack.AddModifier(newItem.MagicalAttack_modifier);
            MagicalDefense.AddModifier(newItem.MagicalDefense_modifier);
            CriticalRate.AddModifier(newItem.CriticalRate_modifier);
            UpdateStats();
        }

        if (oldItem != null)
        {
            HP.AddModifier(oldItem.HP_modifier);
            MP.AddModifier(oldItem.MP_modifier);
            PhysicalAttack.AddModifier(oldItem.PhysicalAttack_modifier);
            PhysicalDefense.AddModifier(oldItem.PhysicalDefense_modifier);
            MagicalAttack.AddModifier(oldItem.MagicalAttack_modifier);
            MagicalDefense.AddModifier(oldItem.MagicalDefense_modifier);
            CriticalRate.AddModifier(oldItem.CriticalRate_modifier);
            UpdateStats();
        }
    }