|
@@ -28,7 +28,7 @@ public class CombatHeroInfo
|
|
|
|
|
|
public HeroModelConfig modelConfig;
|
|
|
|
|
|
- public HeroPowerConfig powerConfig;
|
|
|
+ public HeroPowerUpConfig powerUpConfig;
|
|
|
public HeroPromoteConfig promoteConfig;
|
|
|
public HeroBasicEquipConfig basicEquipConfig;
|
|
|
|
|
@@ -60,6 +60,8 @@ public class CombatHeroInfo
|
|
|
|
|
|
private float rarityFactor;
|
|
|
private float starFactor;
|
|
|
+
|
|
|
+ private float factor;
|
|
|
|
|
|
/// <summary>
|
|
|
/// 计算影响基础属性的参数
|
|
@@ -70,14 +72,17 @@ public class CombatHeroInfo
|
|
|
rarityFactor = PlayerManager.Instance.gameConstantConfig.monsterRarityAttributeFactor[modelConfig.rarity-1]
|
|
|
/ 100f;
|
|
|
starFactor = promoteConfig.star_Power / 100f;
|
|
|
+
|
|
|
+ factor = rarityFactor * starFactor;
|
|
|
}
|
|
|
|
|
|
protected void CalAttribute()
|
|
|
{
|
|
|
- hp = (EncryptionLong)(modelConfig.hp * rarityFactor * starFactor);
|
|
|
- defense = (EncryptionLong)(modelConfig.def * rarityFactor * starFactor);
|
|
|
- attack = (EncryptionLong)(modelConfig.attack * rarityFactor * starFactor);
|
|
|
- shanbi = (EncryptionInt)powerConfig.SHANBI;
|
|
|
+ hp = (EncryptionLong)(modelConfig.hp * powerUpConfig.HPFactor * factor);
|
|
|
+ defense = (EncryptionLong)(modelConfig.def * powerUpConfig.DEFFactor * factor);
|
|
|
+ attack = (EncryptionLong)(modelConfig.attack * powerUpConfig.ATKFactor * factor);
|
|
|
+
|
|
|
+ shanbi = (EncryptionInt)(modelConfig.shanbi * powerUpConfig.SHANBIFactor);
|
|
|
|
|
|
attSpeed = (EncryptionFloat)modelConfig.speed_atk;
|
|
|
crit = (EncryptionFloat)modelConfig.crit;
|
|
@@ -86,39 +91,37 @@ public class CombatHeroInfo
|
|
|
isGpu = modelConfig.isUseGpu;
|
|
|
maxDis = modelConfig.range_atk;
|
|
|
maxDisTo = maxDis * maxDis;
|
|
|
- heroType = modelConfig.heroType;
|
|
|
}
|
|
|
|
|
|
protected void SetDataConfig(int id,int level, int star)
|
|
|
{
|
|
|
modelConfig = ConfigComponent.Instance.Get<HeroModelConfig>(id);
|
|
|
- powerConfig = ConfigComponent.Instance.Get<HeroPowerConfig>(level);
|
|
|
+ powerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
|
|
|
promoteConfig = ConfigComponent.Instance.Get<HeroPromoteConfig>(star);
|
|
|
}
|
|
|
|
|
|
- public void InitMonster(int id,int level, int star)
|
|
|
+ public void InitMonster(int modelID,int level, int star = 1)
|
|
|
{
|
|
|
- SetDataConfig(id, level, star);
|
|
|
+ SetDataConfig(modelID, level, star);
|
|
|
CalFactor();
|
|
|
CalAttribute();
|
|
|
}
|
|
|
|
|
|
- public void InitMonster(int id,int level)
|
|
|
- {
|
|
|
- HeroModelConfig heroModelConfig = ConfigComponent.Instance.Get<HeroModelConfig>(id);
|
|
|
- HeroPowerUpConfig heroPowerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
|
|
|
- hp = (EncryptionLong)(heroModelConfig.hp*heroPowerUpConfig.HPFactor);
|
|
|
- defense=(EncryptionLong)(heroModelConfig.def*heroPowerUpConfig.DEFFactor);
|
|
|
- attack=(EncryptionLong)(heroModelConfig.attack*heroPowerUpConfig.ATKFactor);
|
|
|
- attSpeed=(EncryptionFloat)heroModelConfig.speed_atk;
|
|
|
- crit=(EncryptionFloat)heroModelConfig.crit;
|
|
|
- skillId = heroModelConfig.skillID;
|
|
|
- modelName = heroModelConfig.model;
|
|
|
- isGpu = heroModelConfig.isUseGpu;
|
|
|
- maxDis=heroModelConfig.range_atk;
|
|
|
- maxDisTo = maxDis * maxDis;
|
|
|
- heroType = heroModelConfig.heroType;
|
|
|
- }
|
|
|
+ // public void InitMonster(int id,int level)
|
|
|
+ // {
|
|
|
+ // HeroModelConfig heroModelConfig = ConfigComponent.Instance.Get<HeroModelConfig>(id);
|
|
|
+ // HeroPowerUpConfig heroPowerUpConfig = ConfigComponent.Instance.Get<HeroPowerUpConfig>(level);
|
|
|
+ // hp = (EncryptionLong)(heroModelConfig.hp*heroPowerUpConfig.HPFactor);
|
|
|
+ // defense=(EncryptionLong)(heroModelConfig.def*heroPowerUpConfig.DEFFactor);
|
|
|
+ // attack=(EncryptionLong)(heroModelConfig.attack*heroPowerUpConfig.ATKFactor);
|
|
|
+ // attSpeed=(EncryptionFloat)heroModelConfig.speed_atk;
|
|
|
+ // crit=(EncryptionFloat)heroModelConfig.crit;
|
|
|
+ // skillId = heroModelConfig.skillID;
|
|
|
+ // modelName = heroModelConfig.model;
|
|
|
+ // isGpu = heroModelConfig.isUseGpu;
|
|
|
+ // maxDis=heroModelConfig.range_atk;
|
|
|
+ // maxDisTo = maxDis * maxDis;
|
|
|
+ // }
|
|
|
|
|
|
public CombatHeroInfo Copy()
|
|
|
{
|