public static float CalculateAppendAttrFightingScore(CharacterInfo obj, int appendAttrId) { AppendAttributeConfig info = AppendAttributeConfigProvider.Instance.GetDataById(appendAttrId); if (null != info) { float aMoveSpeed = obj.GetActualProperty().MoveSpeed; int aHpMax = obj.GetActualProperty().HpMax; int aEnergyMax = obj.GetActualProperty().EnergyMax; float aHpRecover = obj.GetActualProperty().HpRecover; float aEnergyRecover = obj.GetActualProperty().EnergyRecover; int aAttackBase = obj.GetActualProperty().AttackBase; int aADefenceBase = obj.GetActualProperty().ADefenceBase; int aMDefenceBase = obj.GetActualProperty().MDefenceBase; float aCritical = obj.GetActualProperty().Critical; float aCriticalPow = obj.GetActualProperty().CriticalPow; float aCriticalBackHitPow = obj.GetActualProperty().CriticalBackHitPow; float aCriticalCrackPow = obj.GetActualProperty().CriticalCrackPow; float aFireDamage = obj.GetActualProperty().FireDamage; float aFireERD = obj.GetActualProperty().FireERD; float aIceDamage = obj.GetActualProperty().IceDamage; float aIceERD = obj.GetActualProperty().IceERD; float aPoisonDamage = obj.GetActualProperty().PoisonDamage; float aPoisonERD = obj.GetActualProperty().PoisonERD; float aWeight = obj.GetActualProperty().Weight; float aRps = obj.GetActualProperty().Rps; float aAttackRange = obj.GetActualProperty().AttackRange; aMoveSpeed = info.GetAddSpd(aMoveSpeed, obj.GetLevel()); aHpMax = (int)info.GetAddHpMax(aHpMax, obj.GetLevel()); aEnergyMax = (int)info.GetAddEpMax(aEnergyMax, obj.GetLevel()); aHpRecover = info.GetAddHpRecover(aHpRecover, obj.GetLevel()); aEnergyRecover = info.GetAddEpRecover(aEnergyRecover, obj.GetLevel()); aAttackBase = (int)info.GetAddAd(aAttackBase, obj.GetLevel()); aADefenceBase = (int)info.GetAddADp(aADefenceBase, obj.GetLevel()); aMDefenceBase = (int)info.GetAddMDp(aMDefenceBase, obj.GetLevel()); aCritical = info.GetAddCri(aCritical, obj.GetLevel()); aCriticalPow = info.GetAddPow(aCriticalPow, obj.GetLevel()); aCriticalBackHitPow = info.GetAddBackHitPow(aCriticalBackHitPow, obj.GetLevel()); aCriticalCrackPow = info.GetAddCrackPow(aCriticalCrackPow, obj.GetLevel()); aFireDamage = info.GetAddFireDam(aFireDamage, obj.GetLevel()); aFireERD = info.GetAddFireErd(aFireERD, obj.GetLevel()); aIceDamage = info.GetAddIceDam(aIceDamage, obj.GetLevel()); aIceERD = info.GetAddIceErd(aIceERD, obj.GetLevel()); aPoisonDamage = info.GetAddPoisonDam(aPoisonDamage, obj.GetLevel()); aPoisonERD = info.GetAddPoisonErd(aPoisonERD, obj.GetLevel()); aWeight = info.GetAddWeight(aWeight, obj.GetLevel()); aRps = info.GetAddRps(aRps, obj.GetLevel()); aAttackRange = info.GetAddAttackRange(aAttackRange, obj.GetLevel()); return(AttributeScoreConfigProvider.Instance.CalcAttributeScore(aHpMax, aEnergyMax, aAttackBase, aADefenceBase, aMDefenceBase, aCritical, aCriticalPow, aCriticalBackHitPow, aCriticalCrackPow, aFireDamage, aIceDamage, aPoisonDamage, aFireERD, aIceERD, aPoisonERD)); } else { return(0.0f); } }
private float GetItemFightScore(ArkCrossEngine.ItemConfig itemconfig, int propertyid, int itemlevel) { ArkCrossEngine.RoleInfo ri = ArkCrossEngine.LobbyClient.Instance.CurrentRole; CharacterProperty cp = ri.GetPlayerSelfInfo().GetActualProperty(); if (itemconfig != null && ri != null && cp != null) { ArkCrossEngine.AppendAttributeConfig aac = ArkCrossEngine.AppendAttributeConfigProvider.Instance.GetDataById(propertyid); if (aac == null) { return(ArkCrossEngine.AttributeScoreConfigProvider.Instance.CalcAttributeScore( itemconfig.m_AttrData.GetAddHpMax(cp.HpMax, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddEpMax(cp.EnergyMax, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddAd(cp.AttackBase, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddADp(cp.ADefenceBase, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddMDp(cp.MDefenceBase, ri.Level, itemlevel), itemconfig.m_AttrData.GetAddCri(cp.Critical, ri.Level), itemconfig.m_AttrData.GetAddPow(cp.CriticalPow, ri.Level), itemconfig.m_AttrData.GetAddBackHitPow(cp.CriticalBackHitPow, ri.Level), itemconfig.m_AttrData.GetAddCrackPow(cp.CriticalCrackPow, ri.Level), itemconfig.m_AttrData.GetAddFireDam(cp.FireDamage, ri.Level), itemconfig.m_AttrData.GetAddIceDam(cp.IceDamage, ri.Level), itemconfig.m_AttrData.GetAddPoisonDam(cp.PoisonDamage, 1), itemconfig.m_AttrData.GetAddFireErd(cp.FireERD, ri.Level), itemconfig.m_AttrData.GetAddIceErd(cp.IceERD, ri.Level), itemconfig.m_AttrData.GetAddPoisonErd(cp.PoisonERD, ri.Level))); } else { return(ArkCrossEngine.AttributeScoreConfigProvider.Instance.CalcAttributeScore( itemconfig.m_AttrData.GetAddHpMax(cp.HpMax, ri.Level, itemlevel) + aac.GetAddHpMax(cp.HpMax, ri.Level), itemconfig.m_AttrData.GetAddEpMax(cp.EnergyMax, ri.Level, itemlevel) + aac.GetAddEpMax(cp.EnergyMax, ri.Level), itemconfig.m_AttrData.GetAddAd(cp.AttackBase, ri.Level, itemlevel) + aac.GetAddAd(cp.AttackBase, ri.Level), itemconfig.m_AttrData.GetAddADp(cp.ADefenceBase, ri.Level, itemlevel) + aac.GetAddADp(cp.ADefenceBase, itemlevel), itemconfig.m_AttrData.GetAddMDp(cp.MDefenceBase, ri.Level, itemlevel) + aac.GetAddMDp(cp.MDefenceBase, ri.Level), itemconfig.m_AttrData.GetAddCri(cp.Critical, ri.Level) + aac.GetAddCri(cp.Critical, ri.Level), itemconfig.m_AttrData.GetAddPow(cp.CriticalPow, ri.Level) + aac.GetAddPow(cp.CriticalPow, ri.Level), itemconfig.m_AttrData.GetAddBackHitPow(cp.CriticalBackHitPow, ri.Level) + aac.GetAddBackHitPow(cp.CriticalBackHitPow, ri.Level), itemconfig.m_AttrData.GetAddCrackPow(cp.CriticalCrackPow, ri.Level) + aac.GetAddCrackPow(cp.CriticalCrackPow, ri.Level), itemconfig.m_AttrData.GetAddFireDam(cp.FireDamage, ri.Level) + aac.GetAddFireDam(cp.FireDamage, ri.Level), itemconfig.m_AttrData.GetAddIceDam(cp.IceDamage, ri.Level) + aac.GetAddIceDam(cp.IceDamage, ri.Level), itemconfig.m_AttrData.GetAddPoisonDam(cp.PoisonDamage, ri.Level) + aac.GetAddPoisonDam(cp.PoisonDamage, ri.Level), itemconfig.m_AttrData.GetAddFireErd(cp.FireERD, ri.Level) + aac.GetAddFireDam(cp.FireERD, ri.Level), itemconfig.m_AttrData.GetAddIceErd(cp.IceERD, ri.Level) + aac.GetAddIceErd(cp.IceERD, ri.Level), itemconfig.m_AttrData.GetAddPoisonErd(cp.PoisonERD, ri.Level) + aac.GetAddPoisonErd(cp.PoisonERD, ri.Level))); } } return(0f); }
/// <summary> /// calculate attr by partner /// </summary> /// <param name="obj"></param> public static void RefixAttrByPartner(UserInfo obj) { PartnerInfo pi = obj.GetPartnerInfo(); if (null != pi) { AppendAttributeConfig info = AppendAttributeConfigProvider.Instance.GetDataById(pi.GetAppendAttrConfigId()); if (null != info) { float aMoveSpeed = obj.GetActualProperty().MoveSpeed; int aHpMax = obj.GetActualProperty().HpMax; int aEnergyMax = obj.GetActualProperty().EnergyMax; float aHpRecover = obj.GetActualProperty().HpRecover; float aEnergyRecover = obj.GetActualProperty().EnergyRecover; int aAttackBase = obj.GetActualProperty().AttackBase; int aADefenceBase = obj.GetActualProperty().ADefenceBase; int aMDefenceBase = obj.GetActualProperty().MDefenceBase; float aCritical = obj.GetActualProperty().Critical; float aCriticalPow = obj.GetActualProperty().CriticalPow; float aCriticalBackHitPow = obj.GetActualProperty().CriticalBackHitPow; float aCriticalCrackPow = obj.GetActualProperty().CriticalCrackPow; float aFireDamage = obj.GetActualProperty().FireDamage; float aFireERD = obj.GetActualProperty().FireERD; float aIceDamage = obj.GetActualProperty().IceDamage; float aIceERD = obj.GetActualProperty().IceERD; float aPoisonDamage = obj.GetActualProperty().PoisonDamage; float aPoisonERD = obj.GetActualProperty().PoisonERD; float aWeight = obj.GetActualProperty().Weight; float aRps = obj.GetActualProperty().Rps; float aAttackRange = obj.GetActualProperty().AttackRange; obj.GetActualProperty().SetMoveSpeed(Operate_Type.OT_Relative, info.GetAddSpd(aMoveSpeed, obj.GetLevel())); obj.GetActualProperty().SetHpMax(Operate_Type.OT_Relative, (int)info.GetAddHpMax(aHpMax, obj.GetLevel())); obj.GetActualProperty().SetEnergyMax(Operate_Type.OT_Relative, (int)info.GetAddEpMax(aEnergyMax, obj.GetLevel())); obj.GetActualProperty().SetHpRecover(Operate_Type.OT_Relative, info.GetAddHpRecover(aHpRecover, obj.GetLevel())); obj.GetActualProperty().SetEnergyRecover(Operate_Type.OT_Relative, info.GetAddEpRecover(aEnergyRecover, obj.GetLevel())); obj.GetActualProperty().SetAttackBase(Operate_Type.OT_Relative, (int)info.GetAddAd(aAttackBase, obj.GetLevel())); obj.GetActualProperty().SetADefenceBase(Operate_Type.OT_Relative, (int)info.GetAddADp(aADefenceBase, obj.GetLevel())); obj.GetActualProperty().SetMDefenceBase(Operate_Type.OT_Relative, (int)info.GetAddMDp(aMDefenceBase, obj.GetLevel())); obj.GetActualProperty().SetCritical(Operate_Type.OT_Relative, info.GetAddCri(aCritical, obj.GetLevel())); obj.GetActualProperty().SetCriticalPow(Operate_Type.OT_Relative, info.GetAddPow(aCriticalPow, obj.GetLevel())); obj.GetActualProperty().SetCriticalBackHitPow(Operate_Type.OT_Relative, info.GetAddBackHitPow(aCriticalBackHitPow, obj.GetLevel())); obj.GetActualProperty().SetCriticalCrackPow(Operate_Type.OT_Relative, info.GetAddCrackPow(aCriticalCrackPow, obj.GetLevel())); obj.GetActualProperty().SetFireDamage(Operate_Type.OT_Relative, info.GetAddFireDam(aFireDamage, obj.GetLevel())); obj.GetActualProperty().SetFireERD(Operate_Type.OT_Relative, info.GetAddFireErd(aFireERD, obj.GetLevel())); obj.GetActualProperty().SetIceDamage(Operate_Type.OT_Relative, info.GetAddIceDam(aIceDamage, obj.GetLevel())); obj.GetActualProperty().SetIceERD(Operate_Type.OT_Relative, info.GetAddIceErd(aIceERD, obj.GetLevel())); obj.GetActualProperty().SetPoisonDamage(Operate_Type.OT_Relative, info.GetAddPoisonDam(aPoisonDamage, obj.GetLevel())); obj.GetActualProperty().SetPoisonERD(Operate_Type.OT_Relative, info.GetAddPoisonErd(aPoisonERD, obj.GetLevel())); obj.GetActualProperty().SetWeight(Operate_Type.OT_Relative, info.GetAddWeight(aWeight, obj.GetLevel())); obj.GetActualProperty().SetRps(Operate_Type.OT_Relative, info.GetAddRps(aRps, obj.GetLevel())); obj.GetActualProperty().SetAttackRange(Operate_Type.OT_Relative, info.GetAddAttackRange(aAttackRange, obj.GetLevel())); } } }