|
@@ -30,6 +30,7 @@ namespace GameLogic.Hero
|
|
|
|
|
|
|
|
// public List<int> ImmortalBond = new List<int>();
|
|
// public List<int> ImmortalBond = new List<int>();
|
|
|
|
|
|
|
|
|
|
+ private Map<HeroAttributeType, float> attributeValue = new Map<HeroAttributeType, float>();
|
|
|
|
|
|
|
|
public HeroInfo()
|
|
public HeroInfo()
|
|
|
{
|
|
{
|
|
@@ -150,6 +151,7 @@ namespace GameLogic.Hero
|
|
|
|
|
|
|
|
public void ComputeHeroInfo()
|
|
public void ComputeHeroInfo()
|
|
|
{
|
|
{
|
|
|
|
|
+ attributeValue.Clear();
|
|
|
attributeBlValue.Clear();
|
|
attributeBlValue.Clear();
|
|
|
Metal = 100;
|
|
Metal = 100;
|
|
|
Wood = 100;
|
|
Wood = 100;
|
|
@@ -205,43 +207,48 @@ namespace GameLogic.Hero
|
|
|
daolvSkill daolvSkill = ConfigComponent.Instance.Get<daolvSkill>(keyValuePair.Key);
|
|
daolvSkill daolvSkill = ConfigComponent.Instance.Get<daolvSkill>(keyValuePair.Key);
|
|
|
ComputeHeroAttributeType(daolvSkill.AttrID, keyValuePair.Value);
|
|
ComputeHeroAttributeType(daolvSkill.AttrID, keyValuePair.Value);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
//心境带来的加成
|
|
//心境带来的加成
|
|
|
AddSentimentData();
|
|
AddSentimentData();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
if (CombatController.currActiveCombat != null && CombatController.currActiveCombat.playerHeroEntity != null)
|
|
if (CombatController.currActiveCombat != null && CombatController.currActiveCombat.playerHeroEntity != null)
|
|
|
{
|
|
{
|
|
|
CombatController.currActiveCombat.playerHeroEntity.CurrCombatHeroInfo = this.Copy();
|
|
CombatController.currActiveCombat.playerHeroEntity.CurrCombatHeroInfo = this.Copy();
|
|
|
CombatController.currActiveCombat.playerHeroEntity.MaxCombatHeroInfo = this.Copy();
|
|
CombatController.currActiveCombat.playerHeroEntity.MaxCombatHeroInfo = this.Copy();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ AddAttributeValue();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void AddSentimentData()
|
|
private void AddSentimentData()
|
|
|
{
|
|
{
|
|
|
- SentimentEffectConfig[] allSentimentEffectConfigs = ConfigComponent.Instance.GetAll<SentimentEffectConfig>();
|
|
|
|
|
- List<AccountFileInfo.SentimentData> SentimentDatas = AccountFileInfo.Instance.playerData.SentimentDatas;
|
|
|
|
|
|
|
+ SentimentEffectConfig[] allSentimentEffectConfigs =
|
|
|
|
|
+ ConfigComponent.Instance.GetAll<SentimentEffectConfig>();
|
|
|
|
|
+ List<AccountFileInfo.SentimentData> SentimentDatas = AccountFileInfo.Instance.playerData.SentimentDatas;
|
|
|
for (int i = 0; i < SentimentDatas.Count; i++)
|
|
for (int i = 0; i < SentimentDatas.Count; i++)
|
|
|
{
|
|
{
|
|
|
- AccountFileInfo.SentimentData sentimentData= SentimentDatas[i];
|
|
|
|
|
|
|
+ AccountFileInfo.SentimentData sentimentData = SentimentDatas[i];
|
|
|
for (int j = 0; j < sentimentData.sentimentProperties.Count; j++)
|
|
for (int j = 0; j < sentimentData.sentimentProperties.Count; j++)
|
|
|
{
|
|
{
|
|
|
- AddSentimentProperty( sentimentData.sentimentProperties[i],allSentimentEffectConfigs);
|
|
|
|
|
|
|
+ AddSentimentProperty(sentimentData.sentimentProperties[i], allSentimentEffectConfigs);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void AddSentimentProperty(AccountFileInfo.SentimentProperty sentimentProperty,SentimentEffectConfig[] allSentimentEffectConfigs)
|
|
|
|
|
|
|
+ private void AddSentimentProperty(AccountFileInfo.SentimentProperty sentimentProperty,
|
|
|
|
|
+ SentimentEffectConfig[] allSentimentEffectConfigs)
|
|
|
{
|
|
{
|
|
|
SentimentEffectConfig currSentimentEffectConfig = default;
|
|
SentimentEffectConfig currSentimentEffectConfig = default;
|
|
|
for (int i = 0; i < allSentimentEffectConfigs.Length; i++)
|
|
for (int i = 0; i < allSentimentEffectConfigs.Length; i++)
|
|
|
{
|
|
{
|
|
|
- SentimentEffectConfig sentimentEffectConfig= allSentimentEffectConfigs[i];
|
|
|
|
|
- if(sentimentEffectConfig.groupId==sentimentProperty.groupId&& sentimentEffectConfig.level==sentimentProperty.level)
|
|
|
|
|
|
|
+ SentimentEffectConfig sentimentEffectConfig = allSentimentEffectConfigs[i];
|
|
|
|
|
+ if (sentimentEffectConfig.groupId == sentimentProperty.groupId &&
|
|
|
|
|
+ sentimentEffectConfig.level == sentimentProperty.level)
|
|
|
{
|
|
{
|
|
|
- currSentimentEffectConfig= sentimentEffectConfig;
|
|
|
|
|
|
|
+ currSentimentEffectConfig = sentimentEffectConfig;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
switch (currSentimentEffectConfig.effectType)
|
|
switch (currSentimentEffectConfig.effectType)
|
|
|
{
|
|
{
|
|
|
case 1:
|
|
case 1:
|
|
@@ -276,92 +283,113 @@ namespace GameLogic.Hero
|
|
|
Earth += currSentimentEffectConfig.effectVale[1];
|
|
Earth += currSentimentEffectConfig.effectVale[1];
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
break;
|
|
break;
|
|
|
- case 6:
|
|
|
|
|
- finallyHarmReduce= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ case 6:
|
|
|
|
|
+ finallyHarmReduce = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 7:
|
|
case 7:
|
|
|
- abnormalHarmAdd= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ abnormalHarmAdd = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 8:
|
|
case 8:
|
|
|
- Fire_Proficient= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ Fire_Proficient = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 9:
|
|
case 9:
|
|
|
- Wood_Proficient= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ Wood_Proficient = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 10:
|
|
case 10:
|
|
|
- Metal_Proficient= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ Metal_Proficient = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 11:
|
|
case 11:
|
|
|
- Water_Proficient= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ Water_Proficient = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 12:
|
|
case 12:
|
|
|
- Earth_Proficient= currSentimentEffectConfig.effectVale[0];
|
|
|
|
|
|
|
+ Earth_Proficient = currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
case 99:
|
|
case 99:
|
|
|
// Fire_HarmAdd= currSentimentEffectConfig.effectVale[0];
|
|
// Fire_HarmAdd= currSentimentEffectConfig.effectVale[0];
|
|
|
break;
|
|
break;
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private void ComputeHeroAttributeType(int shuxingID, float value)
|
|
|
|
|
|
|
+ private void AddAttributeValue()
|
|
|
{
|
|
{
|
|
|
- switch ((HeroAttributeType)shuxingID)
|
|
|
|
|
|
|
+ for (attributeValue.Begin(); attributeValue.Next();)
|
|
|
{
|
|
{
|
|
|
- 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);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ 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();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ 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,);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|