| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395 | 
							- using System.Collections.Generic;
 
- using System.Linq;
 
- using Common.Utility.CombatEvent;
 
- using Core.Utility;
 
- using Excel2Json;
 
- using Fort23.Core;
 
- using Fort23.UTool;
 
- using GameLogic.Combat.CombatTool;
 
- using Utility;
 
- namespace GameLogic.Hero
 
- {
 
-     public class DaoLVBiData
 
-     {
 
-         public int id;
 
-         public float value;
 
-     }
 
-     public class HeroInfo : CombatHeroInfo
 
-     {
 
-         public AccountFileInfo.HeroData heroData;
 
-         private string _iconZhiYe;
 
-         private Map<HeroAttributeType, float> attributeBlValue = new Map<HeroAttributeType, float>();
 
-         public Map<int, float> daolvBlMap = new Map<int, float>();
 
-         public List<DaoLVBiData> daolvBl = new List<DaoLVBiData>();
 
-         // public List<int> ImmortalBond = new List<int>();
 
-         private Map<HeroAttributeType, float> attributeValue = new Map<HeroAttributeType, float>();
 
-         public HeroInfo()
 
-         {
 
-         }
 
-         public HeroInfo CopyHero()
 
-         {
 
-             AccountFileInfo.HeroData heroDataCopy = new AccountFileInfo.HeroData();
 
-             heroDataCopy.heroModelId = heroData.heroModelId;
 
-             heroDataCopy.heroPowerId = heroData.heroPowerId;
 
-             heroDataCopy.exp = heroData.exp;
 
-             heroDataCopy.upTime = heroData.upTime;
 
-             heroDataCopy.isCombat = heroData.isCombat;
 
-             heroDataCopy.TaoismSkillId = heroData.TaoismSkillId;
 
-             heroDataCopy.ImmortalBond = heroData.ImmortalBond.ToList();
 
-             HeroInfo heroInfo = new HeroInfo();
 
-             heroInfo.MagicWeaponID = MagicWeaponID.ToList();
 
-             heroInfo.unLockSkills = unLockSkills.ToList();
 
-             heroInfo.InitHero(heroData);
 
-             return heroInfo;
 
-         }
 
-         public void InitHero(AccountFileInfo.HeroData heroData)
 
-         {
 
-             this.heroData = heroData;
 
-             InitHero(heroData.heroModelId, heroData.heroPowerId);
 
-         }
 
-         public void InitHero(int modelID, int powerID)
 
-         {
 
-             this.modelID = modelID;
 
-             SetDataConfig(modelID,
 
-                 powerID);
 
-             ComputeHeroInfo();
 
-             //CalBasicAttribute();
 
-         }
 
-         public HeroInfo Upgrade()
 
-         {
 
-             int currentMiao = (int)((TimeHelper.ClientNow() - PlayerManager.Instance.myHero.heroData.upTime) / 1000);
 
-             float allexp = currentMiao * PlayerManager.Instance.myHero.powerUpConfig.AutoXiuwei;
 
-             heroData.exp += allexp;
 
-             heroData.exp -= powerUpConfig.levelUpExp;
 
-             heroData.upTime = TimeHelper.ClientNow();
 
-             heroData.isCombat = false;
 
-             heroData.heroPowerId++;
 
-             InitHero(heroData);
 
-             PlayerManager.Instance.SaveHeroData(this);
 
-             EventManager.Instance.Dispatch(CustomEventType.JingJieUpgrade, null);
 
-             RedDotManager.Instance.AllRedDotUpDate();
 
-             return this;
 
-         }
 
-         public void GetDaoLvBl()
 
-         {
 
-             daolvBl.Clear();
 
-             foreach (var i in heroData?.ImmortalBond)
 
-             {
 
-                 DaoyouModelConfig daoyouModelConfig = ConfigComponent.Instance.Get<DaoyouModelConfig>(i);
 
-                 foreach (var i1 in daoyouModelConfig.daolvSkillID)
 
-                 {
 
-                     daolvSkill daolvSkill = ConfigComponent.Instance.Get<daolvSkill>(i1);
 
-                     // //唯一只加一次
 
-                     // if (daolvSkill.type == 1)
 
-                     // {
 
-                     //     if (!daolvBlMap.ContainsKey(i1))
 
-                     //     {
 
-                     //         daolvBlMap.Add(i1, daolvSkill.para[0]);
 
-                     //     }
 
-                     // }
 
-                     // else
 
-                     // {
 
-                     //     if (!daolvBlMap.ContainsKey(i1))
 
-                     //     {
 
-                     //         daolvBlMap.Add(i1, daolvSkill.para[0]);
 
-                     //     }
 
-                     //     else
 
-                     //     {
 
-                     //         daolvBlMap[i1] += daolvSkill.para[0];
 
-                     //     }
 
-                     // }
 
-                     DaoLVBiData daoLvBiData;
 
-                     if (daolvSkill.type == 1)
 
-                     {
 
-                         daoLvBiData = daolvBl.FirstOrDefault(d => d.id == i1);
 
-                         if (daoLvBiData != null)
 
-                         {
 
-                             daoLvBiData = new DaoLVBiData();
 
-                             daoLvBiData.id = i1;
 
-                             daoLvBiData.value = daolvSkill.para[0];
 
-                             daolvBl.Add(daoLvBiData);
 
-                         }
 
-                     }
 
-                     else
 
-                     {
 
-                         daoLvBiData = new DaoLVBiData();
 
-                         daoLvBiData.id = i1;
 
-                         daoLvBiData.value = daolvSkill.para[0];
 
-                         daolvBl.Add(daoLvBiData);
 
-                         // if (!daolvBlMap.ContainsKey(i1))
 
-                         // {
 
-                         //     daolvBlMap.Add(i1, daolvSkill.para[0]);
 
-                         // }
 
-                         // else
 
-                         // {
 
-                         //     daolvBlMap[i1] += daolvSkill.para[0];
 
-                         // }
 
-                     }
 
-                 }
 
-             }
 
-         }
 
-         public void ComputeHeroInfo()
 
-         {
 
-             attributeValue.Clear();
 
-             attributeBlValue.Clear();
 
-             Metal = 100;
 
-             Wood = 100;
 
-             Water = 100;
 
-             Fire = 100;
 
-             Earth = 100;
 
-             CalAttribute();
 
-             GetDaoLvBl();
 
-             if (!PlayerManager.Instance.isTest)
 
-             {
 
-                 List<FaBaoInfo> myAllFaBao = PlayerManager.Instance.FaBaoControl.myAllFaBao;
 
-                 foreach (var faBaoInfo in myAllFaBao)
 
-                 {
 
-                     if (faBaoInfo.SkillConfig.addPropertyType != null)
 
-                     {
 
-                         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)
 
-                 {
 
-                     ComputeHeroAttributeType((int)VARIABLE.Key, VARIABLE.Value);
 
-                 }
 
-             }
 
-             //道侣带来的属性加成
 
-             foreach (var keyValuePair in daolvBlMap)
 
-             {
 
-                 daolvSkill daolvSkill = ConfigComponent.Instance.Get<daolvSkill>(keyValuePair.Key);
 
-                 ComputeHeroAttributeType(daolvSkill.AttrID, keyValuePair.Value);
 
-             }
 
-             //心境带来的加成
 
-             AddSentimentData();
 
-             if (CombatController.currActiveCombat != null && CombatController.currActiveCombat.playerHeroEntity != null)
 
-             {
 
-                 CombatController.currActiveCombat.playerHeroEntity.CurrCombatHeroInfo = this.Copy();
 
-                 CombatController.currActiveCombat.playerHeroEntity.MaxCombatHeroInfo = this.Copy();
 
-             }
 
-             AddAttributeValue();
 
-         }
 
-         private void AddSentimentData()
 
-         {
 
-             SentimentEffectConfig[] allSentimentEffectConfigs =
 
-                 ConfigComponent.Instance.GetAll<SentimentEffectConfig>();
 
-             List<AccountFileInfo.SentimentData> SentimentDatas = AccountFileInfo.Instance.playerData.SentimentDatas;
 
-             for (int i = 0; i < SentimentDatas.Count; i++)
 
-             {
 
-                 AccountFileInfo.SentimentData sentimentData = SentimentDatas[i];
 
-                 for (int j = 0; j < sentimentData.sentimentProperties.Count; j++)
 
-                 {
 
-                     AddSentimentProperty(sentimentData.sentimentProperties[i], allSentimentEffectConfigs);
 
-                 }
 
-             }
 
-         }
 
-         private void AddSentimentProperty(AccountFileInfo.SentimentProperty sentimentProperty,
 
-             SentimentEffectConfig[] allSentimentEffectConfigs)
 
-         {
 
-             SentimentEffectConfig currSentimentEffectConfig = default;
 
-             for (int i = 0; i < allSentimentEffectConfigs.Length; i++)
 
-             {
 
-                 SentimentEffectConfig sentimentEffectConfig = allSentimentEffectConfigs[i];
 
-                 if (sentimentEffectConfig.groupId == sentimentProperty.groupId &&
 
-                     sentimentEffectConfig.level == sentimentProperty.level)
 
-                 {
 
-                     currSentimentEffectConfig = sentimentEffectConfig;
 
-                 }
 
-             }
 
-             switch (currSentimentEffectConfig.effectType)
 
-             {
 
-                 case 1:
 
-                     attack += (EncryptionLong)(attack.Value * currSentimentEffectConfig.effectVale[0] * 0.01f);
 
-                     break;
 
-                 case 2:
 
-                     gongFaStrength += currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 3:
 
-                     hp += (EncryptionLong)(hp.Value * currSentimentEffectConfig.effectVale[0] * 0.01f);
 
-                     break;
 
-                 case 4:
 
-                     defense += (EncryptionLong)(defense.Value * currSentimentEffectConfig.effectVale[0] * 0.01f);
 
-                     break;
 
-                 case 5:
 
-                     int type = currSentimentEffectConfig.effectVale[0];
 
-                     switch ((HeroAttributeType)type)
 
-                     {
 
-                         case HeroAttributeType.Gold:
 
-                             Metal += currSentimentEffectConfig.effectVale[1];
 
-                             break;
 
-                         case HeroAttributeType.Wood:
 
-                             Wood += currSentimentEffectConfig.effectVale[1];
 
-                             break;
 
-                         case HeroAttributeType.Fire:
 
-                             Fire += currSentimentEffectConfig.effectVale[1];
 
-                             break;
 
-                         case HeroAttributeType.Water:
 
-                             Water += currSentimentEffectConfig.effectVale[1];
 
-                             break;
 
-                         case HeroAttributeType.Earth:
 
-                             Earth += currSentimentEffectConfig.effectVale[1];
 
-                             break;
 
-                     }
 
-                     break;
 
-                 case 6:
 
-                     finallyHarmReduce = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 7:
 
-                     abnormalHarmAdd = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 8:
 
-                     Fire_Proficient = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 9:
 
-                     Wood_Proficient = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 10:
 
-                     Metal_Proficient = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 11:
 
-                     Water_Proficient = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 12:
 
-                     Earth_Proficient = currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-                 case 99:
 
-                     // Fire_HarmAdd= currSentimentEffectConfig.effectVale[0];
 
-                     break;
 
-             }
 
-         }
 
-         private 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.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;
 
-                     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;
 
-                     // default:
 
-                     //     if (attributeBlValue.TryGetValue((HeroAttributeType)shuxingID, out var value1)
 
-                     //        )
 
-                     //     {
 
-                     //         attributeBlValue[(HeroAttributeType)shuxingID] = value1 + value;
 
-                     //     }
 
-                     //     else
 
-                     //     {
 
-                     //         attributeBlValue.Add((HeroAttributeType)shuxingID, value);
 
-                     //     }
 
-                     //
 
-                     // break;
 
-                 }
 
-             }
 
-             attributeValue.Clear();
 
-         }
 
-         private 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,);
 
-         }
 
-     }
 
- }
 
 
  |