| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563 | 
							- using System.Collections;
 
- using System.Collections.Generic;
 
- using Core.Language;
 
- using Core.Utility;
 
- using Excel2Json;
 
- using Fort23.UTool;
 
- using GameLogic.Combat.CombatTool;
 
- using GameLogic.Hero;
 
- using GameLogic.Player;
 
- using UnityEngine;
 
- using UnityEngine.Serialization;
 
- using Utility;
 
- [System.Serializable]
 
- public class CombatHeroInfo
 
- {
 
-     public enum AttributeType
 
-     {
 
-         Hp,
 
-         Att,
 
-         Def,
 
-     }
 
-     public int modelID;
 
-     public EncryptionLong hp = new EncryptionLong();
 
-     public EncryptionLong defense = new EncryptionLong();
 
-     public EncryptionLong attack = new EncryptionLong();
 
-     protected Map<HeroAttributeType, float> attributeValue = new Map<HeroAttributeType, float>();
 
-     // public long 
 
-     public EncryptionFloat attSpeed
 
-     {
 
-         get { return _attSpeed; }
 
-     }
 
-     public EncryptionInt level;
 
-     public EncryptionInt exp = new EncryptionInt();
 
-     public HeroModelConfig modelConfig;
 
-     public HeroPowerUpConfig powerUpConfig;
 
-     public MonsterPowerUpConfig MonsterPowerUpConfig;
 
-     public EncryptionFloat _attSpeed;
 
-     /// <summary>
 
-     /// 功法强度的加成 %
 
-     /// </summary>
 
-     public float gongFaStrength;
 
-     /// <summary>
 
-     /// 护盾
 
-     /// </summary>
 
-     public EncryptionLong Shield;
 
-     /// <summary>
 
-     /// 神识
 
-     /// </summary>
 
-     public EncryptionLong shenshi;
 
-     /// <summary>
 
-     /// 添加的攻击速度比例%
 
-     /// </summary>
 
-     public float addAttSpeed_bl;
 
-     /// <summary>
 
-     /// 金
 
-     /// </summary>
 
-     public float Metal = 100;
 
-     /// <summary>
 
-     /// 木
 
-     /// </summary>
 
-     public float Wood = 100;
 
-     /// <summary>
 
-     /// 水
 
-     /// </summary>
 
-     public float Water = 100;
 
-     /// <summary>
 
-     /// 火
 
-     /// </summary>
 
-     public float Fire = 100;
 
-     /// <summary>
 
-     /// 土
 
-     /// </summary>
 
-     public float Earth = 100;
 
-     /// <summary>
 
-     /// 金
 
-     /// </summary>
 
-     public float Metal_Injury;
 
-     /// <summary>
 
-     /// 木
 
-     /// </summary>
 
-     public float Wood_Injury;
 
-     /// <summary>
 
-     /// 水
 
-     /// </summary>
 
-     public float Water_Injury;
 
-     /// <summary>
 
-     /// 火
 
-     /// </summary>
 
-     public float Fire_Injury;
 
-     /// <summary>
 
-     /// 土
 
-     /// </summary>
 
-     public float Earth_Injury;
 
-     /// <summary>
 
-     /// 火精通
 
-     /// </summary>
 
-     public float Fire_Proficient;
 
-     /// <summary>
 
-     /// 土精通
 
-     /// </summary>
 
-     public float Earth_Proficient;
 
-     /// <summary>
 
-     /// 水精通
 
-     /// </summary>
 
-     public float Water_Proficient;
 
-     /// <summary>
 
-     /// 毒精通
 
-     /// </summary>
 
-     public float Wood_Proficient;
 
-     /// <summary>
 
-     /// 流行精通
 
-     /// </summary>
 
-     public float Metal_Proficient;
 
-     /// <summary>
 
-     /// 异常伤害增加
 
-     /// </summary>
 
-     public float abnormalHarmAdd;
 
-     /// <summary>
 
-     /// 金伤害增加
 
-     /// </summary>
 
-     public float Metal_HarmAdd;
 
-     /// <summary>
 
-     /// 火伤害增加
 
-     /// </summary>
 
-     public float Fire_HarmAdd;
 
-     /// <summary>
 
-     /// 土伤害增加
 
-     /// </summary>
 
-     public float Earth_HarmAdd;
 
-     /// <summary>
 
-     /// 水伤害增加
 
-     /// </summary>
 
-     public float Water_HarmAdd;
 
-     /// <summary>
 
-     /// 木伤害增加
 
-     /// </summary>
 
-     public float Wood_HarmAdd;
 
-     /// <summary>
 
-     /// 最后伤害减少
 
-     /// </summary>
 
-     public float finallyHarmReduce;
 
-     /// <summary>
 
-     /// 最终伤害增加 buff伤害除外
 
-     /// </summary>
 
-     public float finallyHarmAdd;
 
-     /// <summary>
 
-     /// 1=英雄 2=小怪 3=精英怪 4=boss
 
-     /// </summary>
 
-     public int heroType;
 
-     public string modelName;
 
-     public bool isMonster;
 
-     public int k;
 
-     // public int[] skillId;
 
-     // public List<SkillConfig> skillConfigs;
 
-     /// <summary>
 
-     /// 所有已解锁技能的ID
 
-     /// </summary>
 
-     public List<SkillInfo> unLockSkills = new List<SkillInfo>();
 
-     public bool isGpu;
 
-     public string heroName;
 
-     public List<FaBaoInfo> MagicWeaponID = new List<FaBaoInfo>();
 
-     /// <summary>
 
-     /// 大道修炼ID
 
-     /// </summary>
 
-     public int TaoismSkillId;
 
-     public float GetAttSpeed
 
-     {
 
-         get
 
-         {
 
-             float speed = CombatCalculateTool.Instance.GetVlaueRatioForFloat(attSpeed.Value,
 
-                 addAttSpeed_bl + 100);
 
-             if (speed < 0)
 
-             {
 
-                 speed = 0.01f;
 
-             }
 
-             return speed;
 
-         }
 
-     }
 
-     public float GetAnimationSpeed
 
-     {
 
-         get { return GetAttSpeed / _attSpeed.Value; }
 
-     }
 
-     public CombatHeroInfo()
 
-     {
 
-     }
 
-     protected Map<AttributeType, float> _AttributeCacheValue = new Map<AttributeType, float>();
 
-     /// <summary>
 
-     /// 获取五行灵根属性
 
-     /// </summary>
 
-     /// <param name="wuXingType"></param>
 
-     /// <returns></returns>
 
-     public float GetWuXingShuXing(WuXingType wuXingType)
 
-     {
 
-         switch (wuXingType)
 
-         {
 
-             case WuXingType.Gold:
 
-                 float Metal_v = Metal - Metal_Injury;
 
-                 if (Metal_v < 0)
 
-                 {
 
-                     Metal_v = 0;
 
-                 }
 
-                 return Metal_v;
 
-                 break;
 
-             case WuXingType.Wood:
 
-                 float Wood_v = Wood - Wood_Injury;
 
-                 if (Wood_v < 0)
 
-                 {
 
-                     Wood_v = 0;
 
-                 }
 
-                 return Wood_v;
 
-                 break;
 
-             case WuXingType.Water:
 
-                 float Water_v = Water - Water_Injury;
 
-                 if (Water_v < 0)
 
-                 {
 
-                     Water_v = 0;
 
-                 }
 
-                 return Water_v;
 
-                 break;
 
-             case WuXingType.Fire:
 
-                 float Fire_v = Fire - Fire_Injury;
 
-                 if (Fire_v < 0)
 
-                 {
 
-                     Fire_v = 0;
 
-                 }
 
-                 return Fire_v;
 
-                 break;
 
-             case WuXingType.Earth:
 
-                 float Earth_v = Earth - Earth_Injury;
 
-                 if (Earth_v < 0)
 
-                 {
 
-                     Earth_v = 0;
 
-                 }
 
-                 return Earth_v;
 
-                 break;
 
-             default:
 
-                 return 100;
 
-                 return 0;
 
-         }
 
-     }
 
-     protected void CalBasicAttribute()
 
-     {
 
-         _AttributeCacheValue.Clear();
 
-         modelID = modelConfig.ID;
 
-         if (isMonster)
 
-         {
 
-             unLockSkills.Clear();
 
-             hp = (EncryptionLong)(modelConfig.hp * MonsterPowerUpConfig.HPFactor);
 
-             defense = (EncryptionLong)(modelConfig.def * MonsterPowerUpConfig.DEFFactor);
 
-             attack = (EncryptionLong)(modelConfig.attack * MonsterPowerUpConfig.ATKFactor);
 
-             k = MonsterPowerUpConfig.defK;
 
-             Metal = modelConfig.Linggen[0] * MonsterPowerUpConfig.LinggenUp / 100;
 
-             Water = modelConfig.Linggen[1] * MonsterPowerUpConfig.LinggenUp / 100;
 
-             Wood = modelConfig.Linggen[2] * MonsterPowerUpConfig.LinggenUp / 100;
 
-             Fire = modelConfig.Linggen[3] * MonsterPowerUpConfig.LinggenUp / 100;
 
-             Earth = modelConfig.Linggen[4] * MonsterPowerUpConfig.LinggenUp / 100;
 
-             Shield = (EncryptionLong)(modelConfig.shield * MonsterPowerUpConfig.HudunFactor);
 
-             SetSkillAttSpeed(modelConfig.speed_atk);
 
-             if (modelConfig.skillID != null)
 
-             {
 
-                 for (int i = 0; i < modelConfig.skillID.Length; i++)
 
-                 {
 
-                     int id = modelConfig.skillID[i];
 
-                     if (id <= 0)
 
-                     {
 
-                         continue;
 
-                     }
 
-                     int startLevel = modelConfig.skillActiveLv[i];
 
-                     if (startLevel > 0 && level < startLevel)
 
-                     {
 
-                         continue;
 
-                     }
 
-                     SkillInfo skillInfo =
 
-                         new SkillInfo(id, MonsterPowerUpConfig.GongfaLv, MonsterPowerUpConfig.GongfaStar);
 
-                     skillInfo.index = i;
 
-                     unLockSkills.Add(skillInfo);
 
-                 }
 
-             }
 
-             if (modelConfig.fa_bao_id != null)
 
-             {
 
-                 for (int i = 0; i < modelConfig.fa_bao_id.Length; i++)
 
-                 {
 
-                     int faBaoId = modelConfig.fa_bao_id[i];
 
-                     int startLevel = modelConfig.fabaoActiveLv[i];
 
-                     if (startLevel > 0 && level < startLevel)
 
-                     {
 
-                         continue;
 
-                     }
 
-                     if (faBaoId > 0)
 
-                     {
 
-                         FaBaoInfo faBaoInfo = new FaBaoInfo(faBaoId, MonsterPowerUpConfig.FabaoLv,
 
-                             MonsterPowerUpConfig.FabaoStar);
 
-                         MagicWeaponID.Add(faBaoInfo);
 
-                     }
 
-                 }
 
-             }
 
-         }
 
-         else
 
-         {
 
-             hp = (EncryptionLong)(modelConfig.hp * powerUpConfig.HPFactor);
 
-             defense = (EncryptionLong)(modelConfig.def * powerUpConfig.DEFFactor);
 
-             attack = (EncryptionLong)(modelConfig.attack * powerUpConfig.ATKFactor);
 
-             Shield = (EncryptionLong)(modelConfig.shield * powerUpConfig.HudunFactor);
 
-             // shenshi = (EncryptionLong)(modelConfig.shenshi * powerUpConfig.ShenshiFactor);
 
-             k = powerUpConfig.defK;
 
-         }
 
-         for (_AttributeCacheValue.Begin(); _AttributeCacheValue.Next();)
 
-         {
 
-             switch (_AttributeCacheValue.Key)
 
-             {
 
-                 case AttributeType.Hp:
 
-                     hp += CombatCalculateTool.Instance.GetVlaueRatioForLong(hp.Value, _AttributeCacheValue.Value);
 
-                     break;
 
-                 case AttributeType.Att:
 
-                     attack += CombatCalculateTool.Instance.GetVlaueRatioForLong(attack.Value,
 
-                         _AttributeCacheValue.Value);
 
-                     break;
 
-                 case AttributeType.Def:
 
-                     defense += CombatCalculateTool.Instance.GetVlaueRatioForLong(defense.Value,
 
-                         _AttributeCacheValue.Value);
 
-                     break;
 
-             }
 
-         }
 
-         if (!isMonster)
 
-         {
 
-             for (int i = 0; i < MagicWeaponID.Count; i++)
 
-             {
 
-                 FaBaoInfo faBaoInfo = MagicWeaponID[i];
 
-                 foreach (var VARIABLE in faBaoInfo.attriButedIC)
 
-                 {
 
-                     switch (VARIABLE.Key)
 
-                     {
 
-                         case 1:
 
-                             ComputeHeroAttributeType((int)HeroAttributeType.HP, VARIABLE.Value);
 
-                             // hp += VARIABLE.Value;
 
-                             break;
 
-                         case 2:
 
-                             ComputeHeroAttributeType((int)HeroAttributeType.DEF, VARIABLE.Value);
 
-                             // defense += VARIABLE.Value;
 
-                             break;
 
-                         case 3:
 
-                             ComputeHeroAttributeType((int)HeroAttributeType.ATT, VARIABLE.Value);
 
-                             // attack += VARIABLE.Value;
 
-                             break;
 
-                     }
 
-                 }
 
-             }
 
-             if (isMonster)
 
-             {
 
-                 AddAttributeValue();
 
-             }
 
-         }
 
-     }
 
-     public SkillConfig GetGroupSkillConfig(int idGroup)
 
-     {
 
-         if (unLockSkills == null)
 
-         {
 
-             return default;
 
-         }
 
-         for (int i = 0; i < unLockSkills.Count; i++)
 
-         {
 
-             // SkillConfig skillConfig = ConfigComponent.Instance.Get<SkillConfig>(unLockSkills[i]);
 
-             if (unLockSkills[i].skillConfig.IDGroup == idGroup)
 
-             {
 
-                 return unLockSkills[i].skillConfig;
 
-             }
 
-         }
 
-         return default;
 
-     }
 
-     protected void CalAttribute()
 
-     {
 
-         CalBasicAttribute();
 
-         // skillId = modelConfig.skillID;
 
-         modelName = modelConfig.model;
 
-         isGpu = modelConfig.isUseGpu;
 
-         heroType = modelConfig.heroType;
 
-     }
 
-     public void SetSkillAttSpeed(float attSpeed)
 
-     {
 
-         _attSpeed = (EncryptionFloat)(1.0f / attSpeed);
 
-     }
 
-     protected void SetDataConfig(int modelID, int level)
 
-     {
 
-         modelConfig = ConfigComponent.Instance.Get<HeroModelConfig>(modelID);
 
-         if (isMonster)
 
-         {
 
-             MonsterPowerUpConfig = ConfigComponent.Instance.Get<MonsterPowerUpConfig>(level);
 
-         }
 
-         else
 
-         {
 
-             powerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
 
-         }
 
-         this.level = (EncryptionInt)level;
 
-         heroName = LanguageManager.Instance.Text(modelConfig.name);
 
-     }
 
-     public void InitMonster(int modelID, int level)
 
-     {
 
-         isMonster = true;
 
-         SetDataConfig(modelID, level);
 
-         CalAttribute();
 
-     }
 
-     public CombatHeroInfo Copy()
 
-     {
 
-         CombatHeroInfo combatHeroInfo = (CombatHeroInfo)MemberwiseClone();
 
-         return combatHeroInfo;
 
-     }
 
-     protected void ComputeHeroAttributeType(int shuxingID, float value)
 
-     {
 
-         HeroAttributeType heroAttributeType = (HeroAttributeType)shuxingID;
 
-         if (attributeValue.TryGetValue(heroAttributeType, out float oldValue))
 
-         {
 
-             attributeValue[heroAttributeType] = oldValue + value;
 
-         }
 
-         else
 
-         {
 
-             attributeValue.Add(heroAttributeType, value);
 
-         }
 
-         // attributeValue.Add((HeroAttributeType)shuxingID,);
 
-     }
 
-     protected void AddAttributeValue()
 
-     {
 
-       
 
-         for (attributeValue.Begin(); attributeValue.Next();)
 
-         {
 
-             HeroAttributeType heroAttributeType = attributeValue.Key;
 
-             float value = attributeValue.Value;
 
-             switch (heroAttributeType)
 
-             {
 
-                 case HeroAttributeType.HP:
 
-                     hp.Value += (int)value;
 
-                     break;
 
-                 case HeroAttributeType.ATT:
 
-                     attack.Value += (int)value;
 
-                     break;
 
-                 case HeroAttributeType.DEF:
 
-                     defense.Value += (int)value;
 
-                     break;
 
-                 case HeroAttributeType.Gold:
 
-                     Metal += value;
 
-                     break;
 
-                 case HeroAttributeType.Wood:
 
-                     Wood += value;
 
-                     break;
 
-                 case HeroAttributeType.Fire:
 
-                     Fire += value;
 
-                     break;
 
-                 case HeroAttributeType.Water:
 
-                     Water += value;
 
-                     break;
 
-                 case HeroAttributeType.Earth:
 
-                     Earth += value;
 
-                     break;
 
-                 case HeroAttributeType.Shields:
 
-                     Shield.Value += (int)value;
 
-                     break;
 
-             }
 
-         }
 
-         for (attributeValue.Begin(); attributeValue.Next();)
 
-         {
 
-             HeroAttributeType heroAttributeType = attributeValue.Key;
 
-             float value = attributeValue.Value;
 
-             switch (heroAttributeType)
 
-             {
 
-                 case HeroAttributeType.HP_BL:
 
-                     hp.Value += (long)(hp.Value * (value / 100f));
 
-                     break;
 
-                 case HeroAttributeType.ATT_BL:
 
-                     attack.Value += (long)(attack.Value * (value / 100f));
 
-                     break;
 
-                 case HeroAttributeType.DEF_BL:
 
-                     defense.Value += (long)(defense.Value * (value / 100f));
 
-                     break;
 
-                 case HeroAttributeType.ShengShi_BL:
 
-                     shenshi.Value += (long)(shenshi.Value * (value / 100f));
 
-                     break;
 
-             }
 
-         }
 
-         attributeValue.Clear();
 
-     }
 
- }
 
 
  |