浏览代码

修改拖尾

DESKTOP-BGJIU14\ck 5 天之前
父节点
当前提交
04955cff95

+ 12 - 0
.run/Attach to Unity Editor.run.xml

@@ -0,0 +1,12 @@
+<component name="ProjectRunConfigurationManager">
+  <configuration default="false" name="Attach to Unity Editor" type="UNITY_DEBUG_RUN_CONFIGURATION" factoryName="Unity Debug" show_console_on_std_err="false" show_console_on_std_out="false" port="50000" address="localhost" ignored-value-for-modified-check="74044">
+    <option name="allowRunningInParallel" value="false" />
+    <option name="listenPortForConnections" value="false" />
+    <option name="pid" value="74044" />
+    <option name="projectPathOnTarget" />
+    <option name="selectedOptions">
+      <list />
+    </option>
+    <method v="2" />
+  </configuration>
+</component>

+ 1 - 34
Assets/Scripts/GameLogic/Combat/Hero/CombatHeroInfo.cs

@@ -169,15 +169,7 @@ public class CombatHeroInfo
     protected Map<AttributeType, float> _AttributeCacheValue = new Map<AttributeType, float>();
 
 
-    public void AddAttributeValueToCache(AttributeType attributeType, float value)
-    {
-        if (_AttributeCacheValue.TryGetValue(attributeType, out float v))
-        {
-            value += v;
-        }
 
-        _AttributeCacheValue[attributeType] = value;
-    }
 
     /// <summary>
     /// 获取五行灵根属性
@@ -390,32 +382,7 @@ public class CombatHeroInfo
     }
 
 
-    protected void AddSkillAttribute(SkillConfig skillConfig)
-    {
-        if (skillConfig.addPropertyType == null)
-        {
-            return;
-        }
-
-        for (int i = 0; i < skillConfig.addPropertyType.Length; i++)
-        {
-            int propertyType = skillConfig.addPropertyType[i];
-            float value = skillConfig.addPropertyValue[i];
-            switch (propertyType)
-            {
-                case 101:
-                    AddAttributeValueToCache(AttributeType.Hp, value);
-                    break;
-                case 102:
-                    AddAttributeValueToCache(AttributeType.Att, value);
-                    break;
-                case 103:
-                    AddAttributeValueToCache(AttributeType.Def, value);
-                    break;
-            }
-        }
-    }
-
+   
     protected void SetDataConfig(int modelID, int level)
     {
         modelConfig = ConfigComponent.Instance.Get<HeroModelConfig>(modelID);

+ 35 - 18
Assets/Scripts/GameLogic/Hero/HeroInfo.cs

@@ -3,6 +3,7 @@ using Common.Utility.CombatEvent;
 using Excel2Json;
 using Fort23.Core;
 using Fort23.UTool;
+using GameLogic.Combat.CombatTool;
 using Utility;
 
 namespace GameLogic.Hero
@@ -13,7 +14,7 @@ namespace GameLogic.Hero
 
         private string _iconZhiYe;
 
-        private Map<HeroAttributeType, int> attributeBlValue = new Map<HeroAttributeType, int>();
+        private Map<HeroAttributeType, float> attributeBlValue = new Map<HeroAttributeType, float>();
 
 
         public HeroInfo()
@@ -39,7 +40,7 @@ namespace GameLogic.Hero
 
         public HeroInfo Upgrade()
         {
-            int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime)/1000);
+            int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) / 1000);
 
             int allexp = currentMiao * PlayerManager.Instance.myHero.powerUpConfig.AutoXiuwei;
             heroData.exp += allexp;
@@ -60,23 +61,33 @@ namespace GameLogic.Hero
             List<FaBaoInfo> myAllFaBao = PlayerManager.Instance.FaBaoControl.myAllFaBao;
             foreach (var faBaoInfo in myAllFaBao)
             {
-                int star = faBaoInfo.star;
-
-                for (int i = 0; i < star; i++)
+                if (faBaoInfo.SkillConfig.addPropertyType != null)
                 {
-                    // if (faBaoInfo.FabaoConfig.StarupShuxingIDs.Length <= i)
-                    // {
-                    //     break;
-                    // }
-                    //
-                    // int shuxingID = faBaoInfo.FabaoConfig.StarupShuxingIDs[i];
-                    // int shuxingValue = faBaoInfo.FabaoConfig.StarupShuxingValues[i];
-                    // ComputeHeroAttributeType(shuxingID, shuxingValue);
+                    for (int i = 0; i < faBaoInfo.SkillConfig.addPropertyType.Length; i++)
+                    {
+                        int shuxingID = faBaoInfo.SkillConfig.addPropertyType[i];
+                        float shuxingValue = faBaoInfo.SkillConfig.addPropertyValue[i];
+                        ComputeHeroAttributeType(shuxingID, shuxingValue);
+                    }
                 }
             }
 
             ///功法加被动属性
             List<SkillInfo> allSkill = PlayerManager.Instance.GongFaControl.allSkill;
+            for (int j = 0; j < allSkill.Count; j++)
+            {
+                SkillInfo skillInfo = allSkill[j];
+                if (skillInfo.skillConfig.addPropertyType != null)
+                {
+                    for (int i = 0; i < skillInfo.skillConfig.addPropertyType.Length; i++)
+                    {
+                        int shuxingID = skillInfo.skillConfig.addPropertyType[i];
+                        float shuxingValue = skillInfo.skillConfig.addPropertyValue[i];
+                        ComputeHeroAttributeType(shuxingID, shuxingValue);
+                    }
+                }
+            }
+
             foreach (var VARIABLE in attributeBlValue)
             {
                 switch (VARIABLE.Key)
@@ -95,21 +106,27 @@ namespace GameLogic.Hero
                         break;
                 }
             }
+
+            if (CombatController.currActiveCombat != null && CombatController.currActiveCombat.playerHeroEntity != null)
+            {
+                CombatController.currActiveCombat.playerHeroEntity.CurrCombatHeroInfo = this.Copy();
+                CombatController.currActiveCombat.playerHeroEntity.MaxCombatHeroInfo = this.Copy();
+            }
         }
 
 
-        private void ComputeHeroAttributeType(int shuxingID, int value)
+        private void ComputeHeroAttributeType(int shuxingID, float value)
         {
             switch ((HeroAttributeType)shuxingID)
             {
                 case HeroAttributeType.HP:
-                    hp.Value += value;
+                    hp.Value += (int)value;
                     break;
                 case HeroAttributeType.ATT:
-                    attack.Value += value;
+                    attack.Value += (int)value;
                     break;
                 case HeroAttributeType.DEF:
-                    defense.Value += value;
+                    defense.Value += (int)value;
                     break;
                 case HeroAttributeType.Gold:
                     Metal += value;
@@ -127,7 +144,7 @@ namespace GameLogic.Hero
                     Earth += value;
                     break;
                 case HeroAttributeType.Shields:
-                    Shield.Value += value;
+                    Shield.Value += (int)value;
                     break;
                 default:
                     if (attributeBlValue.TryGetValue((HeroAttributeType)shuxingID, out var value1)