Ejemplo 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();
        }
    }
Ejemplo n.º 2
0
    void OnEquipmentChanged(Equipment newItem, Equipment oldItem)
    {
        if (newItem != null)
        {
            HP.AddModifier(newItem.HP);
            SP.AddModifier(newItem.SP);

            MIN_ATT.AddModifier(newItem.MIN_ATT);
            MAX_ATT.AddModifier(newItem.MAX_ATT);

            CRI_RATE.AddModifier(newItem.CRI_RATE);
            DEF.AddModifier(newItem.DEF);
            ATT_SPD.AddModifier(newItem.ATT_SPD);
            MOV_SPD.AddModifier(newItem.MOV_SPD);

            STR.AddModifier(newItem.STR);
            ACC.AddModifier(newItem.ACC);
            SPR.AddModifier(newItem.SPR);
            CON.AddModifier(newItem.CON);
            AGI.AddModifier(newItem.CON);

            CalculateMaxHP();
            CalculateMaxSP();
            CalculateCurrentDMG();
            CalculateCurrentCRI_RATE();
            CalculateCurrentDEF();
            CalculateCurrentATT_SPD();
            CalculateCurrentMOV_SPD();
        }

        if (oldItem != null)
        {
            HP.RemoveModifier(oldItem.HP);
            SP.RemoveModifier(oldItem.SP);

            MIN_ATT.RemoveModifier(oldItem.MIN_ATT);
            MAX_ATT.RemoveModifier(oldItem.MAX_ATT);

            CRI_RATE.RemoveModifier(oldItem.CRI_RATE);
            DEF.RemoveModifier(oldItem.DEF);
            ATT_SPD.RemoveModifier(oldItem.ATT_SPD);
            MOV_SPD.RemoveModifier(oldItem.MOV_SPD);

            STR.RemoveModifier(oldItem.STR);
            ACC.RemoveModifier(oldItem.ACC);
            SPR.RemoveModifier(oldItem.SPR);
            CON.RemoveModifier(oldItem.CON);
            AGI.RemoveModifier(oldItem.CON);

            CalculateMaxHP();
            CalculateMaxSP();
            CalculateCurrentDMG();
            CalculateCurrentCRI_RATE();
            CalculateCurrentDEF();
            CalculateCurrentATT_SPD();
            CalculateCurrentMOV_SPD();
        }
    }