示例#1
0
            public string GetAdjustedBaseCooldown(AbilityXmlInfo abilityDataEntry)
            {
                if (string.IsNullOrEmpty(abilityDataEntry.BaseCooldown))
                {
                    return(string.Empty);
                }
                if (string.IsNullOrEmpty(abilityDataEntry.CooldownChangeSkills))
                {
                    return(abilityDataEntry.BaseCooldown);
                }
                GameObject player = XRLCore.Core?.Game?.Player?.Body;

                if (player == null)
                {
                    return(abilityDataEntry.BaseCooldown);
                }
                int baseCooldown = int.Parse(abilityDataEntry.BaseCooldown);

                foreach (string entry in abilityDataEntry.CooldownChangeSkills.Split(','))
                {
                    string skill        = entry.Split(':')[0];
                    int    adjustAmount = int.Parse(entry.Split(':')[1]);
                    if (player.HasSkill(skill))
                    {
                        baseCooldown += adjustAmount;
                    }
                }
                return(baseCooldown.ToString());
            }