示例#1
0
 public static Dictionary <DamageElement, MinMaxFloat> GetAdditionalDamageAmounts(this Skill skill, short level)
 {
     if (!skill.IsAttack())
     {
         return(new Dictionary <DamageElement, MinMaxFloat>());
     }
     level = skill.GetAdjustedLevel(level);
     return(GameDataHelpers.MakeDamageAmountsDictionary(skill.additionalDamageAmounts, new Dictionary <DamageElement, MinMaxFloat>(), level, 1f));
 }
示例#2
0
        public static Dictionary <DamageElement, MinMaxFloat> GetIncreaseDamages(this Item equipmentItem, short level, float rate)
        {
            var result = new Dictionary <DamageElement, MinMaxFloat>();

            if (equipmentItem != null &&
                equipmentItem.IsEquipment())
            {
                result = GameDataHelpers.MakeDamageAmountsDictionary(equipmentItem.increaseDamages, result, level, rate);
            }
            return(result);
        }
示例#3
0
        protected override void UpdateData()
        {
            if (uiTextDuration != null)
            {
                var duration = Buff.GetDuration(Level);
                uiTextDuration.gameObject.SetActive(duration != 0);
                uiTextDuration.text = string.Format(durationFormat, duration.ToString("N0"));
            }

            if (uiTextRecoveryHp != null)
            {
                var recoveryHp = Buff.GetRecoveryHp(Level);
                uiTextRecoveryHp.gameObject.SetActive(recoveryHp != 0);
                uiTextRecoveryHp.text = string.Format(recoveryHpFormat, recoveryHp.ToString("N0"));
            }

            if (uiTextRecoveryMp != null)
            {
                var recoveryMp = Buff.GetRecoveryMp(Level);
                uiTextRecoveryMp.gameObject.SetActive(recoveryMp != 0);
                uiTextRecoveryMp.text = string.Format(recoveryMpFormat, recoveryMp.ToString("N0"));
            }

            if (uiTextRecoveryStamina != null)
            {
                var recoveryStamina = Buff.GetRecoveryStamina(Level);
                uiTextRecoveryStamina.gameObject.SetActive(recoveryStamina != 0);
                uiTextRecoveryStamina.text = string.Format(recoveryStaminaFormat, recoveryStamina.ToString("N0"));
            }

            if (uiTextRecoveryFood != null)
            {
                var recoveryFood = Buff.GetRecoveryFood(Level);
                uiTextRecoveryFood.gameObject.SetActive(recoveryFood != 0);
                uiTextRecoveryFood.text = string.Format(recoveryFoodFormat, recoveryFood.ToString("N0"));
            }

            if (uiTextRecoveryWater != null)
            {
                var recoveryWater = Buff.GetRecoveryWater(Level);
                uiTextRecoveryWater.gameObject.SetActive(recoveryWater != 0);
                uiTextRecoveryWater.text = string.Format(recoveryWaterFormat, recoveryWater.ToString("N0"));
            }

            if (uiBuffStats != null)
            {
                uiBuffStats.Data = Buff.GetIncreaseStats(Level);
            }

            if (uiBuffAttributes != null)
            {
                uiBuffAttributes.Data = GameDataHelpers.MakeAttributeAmountsDictionary(Buff.increaseAttributes, new Dictionary <Attribute, short>(), Level, 1f);
            }

            if (uiBuffResistances != null)
            {
                uiBuffResistances.Data = GameDataHelpers.MakeResistanceAmountsDictionary(Buff.increaseResistances, new Dictionary <DamageElement, float>(), Level, 1f);
            }

            if (uiBuffDamages != null)
            {
                uiBuffDamages.Data = GameDataHelpers.MakeDamageAmountsDictionary(Buff.increaseDamages, new Dictionary <DamageElement, MinMaxFloat>(), Level, 1f);
            }
        }
示例#4
0
 public static Dictionary <DamageElement, MinMaxFloat> GetIncreaseDamages(this Buff buff, short level)
 {
     return(GameDataHelpers.MakeDamageAmountsDictionary(buff.increaseDamages, new Dictionary <DamageElement, MinMaxFloat>(), level, 1f));
 }