|
|
public partial class HeroInfo
|
{
|
// 战斗属性的触发几率计算是1对1的,可同时触发多个属性且多次触发,触发几率不会随着目标数量多少而改变,只会根据同一目标的触发次数增多而降低。
|
// 即在一回合内,同一个目标反击、连击、击晕、暴击、闪避可以同时并多次触发,触发几率随机触发次数的增加而降低,每个属性开公式来(参数:触发几率、抵抗几率、已触发次数)
|
// 优先判断是否命中,必中后同时判断此次攻击是否连击、击晕、暴击生效
|
// 反击时必命中目标
|
// 武将属性需时时计算,根据技能、BUFF、装备等属性来源改变而改变
|
|
// 基础属性
|
// 生命
|
public int hp = 0;
|
// 攻击力
|
public int attack = 0;
|
// 防御力
|
public int defense = 0;
|
|
|
|
//战斗属性 击晕、暴击、连击、格挡、反击、吸血
|
//眩晕概率
|
public int stunRate = 0;
|
//暴击概率
|
public int critRate = 0;
|
//连击概率
|
public int comboRate = 0;
|
//格挡概率
|
public int blockRate = 0;
|
//反击概率
|
public int counterAttackRate = 0;
|
//攻击目标时,造成伤害转化成生命的百分比数值提升
|
public int recoverRate = 0;
|
|
//战斗抵抗属性
|
//眩晕抵抗
|
public int stunResist = 0;
|
//暴击抵抗
|
public int critResist = 0;
|
//连击抵抗
|
public int comboResist = 0;
|
//格挡抵抗
|
public int blockResist = 0;
|
//反击抵抗
|
public int counterAttackResist = 0;
|
//减少攻击时吸血转化成生命的百分比数值
|
public int recoverResist = 0;
|
|
// 特殊属性(待补充)
|
// 最终伤害
|
public int finalDamageIncrease = 0;
|
// 最终免伤
|
public int finalDamageReduce;
|
// 爆伤
|
public int critDamageIncrease;
|
// 减少爆伤
|
public int critDamageReduce;
|
// 治疗增益
|
public int healIncrease;
|
// 治疗减益
|
public int healReduce;
|
// 物理增伤
|
public int damageIncrease;
|
// 减少物伤
|
public int damageReduce;
|
// 法术增伤
|
public int magicIncrease;
|
// 减少法伤
|
public int magicReduce;
|
// 普攻增伤
|
public int normalAttackIncrease;
|
// 减少普攻伤害
|
public int normalAttackReduce;
|
// 增加技能伤害
|
public int rageSkillAttackIncrease;
|
// 减少技能伤害
|
public int rageSkillAttackReduce;
|
// 增加持续伤害的百分比
|
public int continousSkillIncrease;
|
// 减少持续伤害的百分比
|
public int continousSkillReduce;
|
// 增加护盾百分比
|
public int shieldSkillIncrease;
|
// 减少护盾百分比
|
public int shieldSkillReduce;
|
|
|
//计算个人/职业/种族养成属性加成
|
public void CalculateProperties()
|
{
|
// 武将单体属性,根据继承比例,从全体属性继承得到
|
// 例如:武将攻击力=
|
// [(装备基础固定值+其它模块的固定值)* (1+初始加成%+武将升级加成%+武将突破加成%+武将吞噬星级加成%+图鉴加成%)]
|
// *
|
// [ 继承比例*(1+羁绊加成%+潜能加成%+天赋加成%+觉醒效果加成%)]
|
hp = GetProperties(HeroAttrType.hp);
|
attack = GetProperties(HeroAttrType.attack);
|
defense = GetProperties(HeroAttrType.defense);
|
stunRate = GetProperties(HeroAttrType.stunRate);
|
critRate = GetProperties(HeroAttrType.critRate);
|
comboRate = GetProperties(HeroAttrType.comboRate);
|
blockRate = GetProperties(HeroAttrType.blockRate);
|
counterAttackRate = GetProperties(HeroAttrType.counterAttackRate);
|
recoverRate = GetProperties(HeroAttrType.recoverRate);
|
stunResist = GetProperties(HeroAttrType.stunResist);
|
critResist = GetProperties(HeroAttrType.critResist);
|
comboResist = GetProperties(HeroAttrType.comboResist);
|
blockResist = GetProperties(HeroAttrType.blockResist);
|
counterAttackResist = GetProperties(HeroAttrType.counterAttackResist);
|
recoverResist = GetProperties(HeroAttrType.recoverResist);
|
}
|
|
protected int GetProperties(HeroAttrType attrType)
|
{
|
return GetStableProperties(attrType)
|
* GetCultivationPercent(attrType)
|
* GetInheritRate(attrType)
|
* GetInfluenceByInheritPercent(attrType);
|
}
|
|
|
// 固定值属性
|
public int GetStableProperties(HeroAttrType attrType)
|
{
|
int stableValue = 0;
|
stableValue += GetEquipStableProperties(attrType);
|
return stableValue;
|
}
|
|
// 培养百分比
|
public int GetCultivationPercent(HeroAttrType attrType)
|
{
|
int cultivationPercent = 100;
|
cultivationPercent += GetQualityCultivationPercent(attrType);//初始加成根据武将品质决定,不同品质武将初始加成不同 HeroInfo.Quality.cs
|
cultivationPercent += GetLevelCultivationPercent(attrType);// 等级给的百分比 HeroInfo.Level.cs
|
cultivationPercent += GetBreakCultivationPercent(attrType);// 突破给的百分比 HeroInfo.Break.cs
|
cultivationPercent += GetStarCultivationPercent(attrType);// 吞噬星级给的百分比 HeroInfo.Star.cs
|
cultivationPercent += GetCollectionCultivationPercent(attrType);// 图鉴给的百分比 HeroInfo.Collection.cs
|
return cultivationPercent;
|
}
|
|
// 被继承比例影响的百分比属性
|
public int GetInfluenceByInheritPercent(HeroAttrType attrType)
|
{
|
// (1+羁绊加成%+潜能加成%+天赋加成%+觉醒效果加成%)
|
|
int IFByInheritPercent = 100;
|
IFByInheritPercent += GetIFByInheritFetterPercent(attrType); //羁绊加成 HeroInfo.Fetter
|
IFByInheritPercent += GetIFByInheritBreakPercent(attrType); //潜能加成 HeroInfo.Break
|
IFByInheritPercent += GetIFByInheritTalentPercent(attrType); //天赋加成 HeroInfo.Talent
|
IFByInheritPercent += GetIFByInheritAwakePercent(attrType); //觉醒加成 HeroInfo.Awake
|
return IFByInheritPercent;
|
}
|
|
public int CalculatePower()
|
{
|
// 暂行
|
return hp +
|
attack +
|
defense +
|
stunRate +
|
critRate +
|
comboRate +
|
blockRate +
|
counterAttackRate +
|
recoverRate +
|
stunResist +
|
critResist +
|
comboResist +
|
blockResist +
|
counterAttackResist +
|
recoverResist;
|
}
|
}
|