From a51aad2ddcf0cb2ffc8e77cac145f6f5d70ffc6b Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期四, 04 四月 2019 11:47:52 +0800
Subject: [PATCH] 3335 灵宠坐骑技能整合

---
 System/Pet/SkillButtonPet.cs |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 deletions(-)

diff --git a/System/Pet/SkillButtonPet.cs b/System/Pet/SkillButtonPet.cs
index 19d0e6d..0ff03ea 100644
--- a/System/Pet/SkillButtonPet.cs
+++ b/System/Pet/SkillButtonPet.cs
@@ -21,6 +21,7 @@
         [SerializeField] Text lockLvText;
 
         PetModel petModel { get { return ModelCenter.Instance.GetModel<PetModel>(); } }
+        MountModel mountModel { get { return ModelCenter.Instance.GetModel<MountModel>(); } }
 
         public void SetModel(int skillId, int skillUnlock, bool isUnlock, int petId, SkillType skillType, bool isAll = false)
         {
@@ -69,7 +70,8 @@
                         {
                             List<int> skills;
                             var value = 0;
-                            if (petModel.TryGetPetSkills(skillConfig.Effect1, out skills))
+                            var effect = SkillConfig.GetSkillEffectValue(skillConfig);
+                            if (petModel.TryGetPetSkills(effect, out skills))
                             {
                                 foreach (var id in skills)
                                 {
@@ -86,13 +88,39 @@
                         }
                         break;
                     case SkillType.MountSkill:
-                        HorseConfig horseInfo = HorseConfig.Get(petId);
-                        if (horseInfo != null)
                         {
-                            str[0] = skillConfig.Description;
-                            str[1] = Language.Get("pet_SkillTipLv", horseInfo.Name, skillUnlock);
+                            if (mountModel.GetMountSkillAndItem.ContainsKey(skillId))
+                            {
+                                var horseId = mountModel.GetMountSkillAndItem[skillId].HorseID;
+                                var horseConfig = HorseConfig.Get(horseId);
+                                if (horseConfig != null)
+                                {
+                                    str[0] = skillConfig.Description;
+                                    str[1] = Language.Get("pet_SkillTipLv", horseConfig.Name, mountModel.GetSkillUnlockLevel(skillId));
+                                }
+                                fightPower = skillConfig.FightPower;
+                            }
+                            else
+                            {
+                                var effect = SkillConfig.GetSkillEffectValue(skillConfig);
+                                List<int> skills;
+                                var value = 0;
+                                if (mountModel.TryGetHorseSkills(effect, out skills))
+                                {
+                                    foreach (var id in skills)
+                                    {
+                                        if (mountModel.IsSkillUnlock(id))
+                                        {
+                                            var config = SkillConfig.Get(id);
+                                            value += config.EffectValue11;
+                                            fightPower += config.FightPower;
+                                        }
+                                    }
+                                }
+                                str[0] = string.Format(skillConfig.Description, value);
+                                str[1] = string.Empty;
+                            }
                         }
-                        fightPower = skillConfig.FightPower;
                         break;
                 }
                 SkillDetails.ShowSkillDetails(skillId, SkillDetails.SkillSourceType.PetSkill, fightPower, str);

--
Gitblit v1.8.0