Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void CalcDamage(ref BattleDamage.DamageInfo damageInfo, BattleActor owner, BattleActor target, C9834a30e5f3368ef11b898eb90b12c5b.C03df96e967d7177ede70d5c100f08e3c damageSourceElem, bool isRandMinTest, bool isNoCriticalCalc, bool isCritical, int powerPercent)
- {
- if (damageSourceElem == null)
- {
- return;
- }
- if (Mevius.App.Api.IsPartyMode() && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 0 && damageSourceElem.m2a2088e5423c9ed60aaf8024bb799763() == 0)
- {
- Ceaf68fb2356fb8b84facc86d2fe79f0e.Cca912973d2eb55c3b74a5c95a6475670 cca912973d2eb55c3b74a5c95a = Ceaf68fb2356fb8b84facc86d2fe79f0e.Find(owner.AbilityId);
- if (cca912973d2eb55c3b74a5c95a != null && ((int)cca912973d2eb55c3b74a5c95a.m84e50dafe5698576f43e0b3aeaf1b9f3() == 3 || (int)cca912973d2eb55c3b74a5c95a.m5aa5f8aa3146e23239a6f9658f17b054() == 3))
- {
- return;
- }
- }
- damageInfo = new BattleDamage.DamageInfo();
- bool flag = owner.AbilityId == owner.JobAbilityId;
- int num = 0;
- int num2 = 0;
- int num3 = 0;
- float num4 = 1f;
- bool flag2 = false;
- bool flag3 = false;
- BattleActor battleActor = owner;
- BattleActor battleActor2 = target;
- if (BattleManager._i.IsSubAction())
- {
- if (BattleManager._i.GetPlayerActorSub() == owner)
- {
- battleActor = BattleManager._i.GetPlayerActor();
- }
- if (BattleManager._i.GetPlayerActorSub() == target)
- {
- battleActor2 = BattleManager._i.GetPlayerActor();
- }
- }
- int num5 = damageSourceElem.m2a2088e5423c9ed60aaf8024bb799763();
- if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() != 23)
- {
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 1 && num5 > 0)
- {
- int useCardAbilitySkillNum = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5401);
- if (useCardAbilitySkillNum > 0)
- {
- num5 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill14", 50) * useCardAbilitySkillNum;
- }
- }
- num5 = (int)((float)(num5 * powerPercent) * 0.01f + 0.5f);
- }
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 71 || (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 72)
- {
- if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 29)
- {
- num3 = (int)((float)owner.BpMax / 100f * (float)num5 + 0.5f);
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 30)
- {
- num3 = (int)((float)target.BpMax / 100f * (float)num5 + 0.5f);
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 31)
- {
- num3 = (int)((float)target.Bp / 100f * (float)num5 + 0.5f);
- }
- flag2 = true;
- }
- else if (owner.IsPlayer() && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 50)
- {
- num = BattleUtility.GetPadAttackDamage(owner);
- flag2 = true;
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 3)
- {
- num = num5;
- num3 = (int)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f();
- flag2 = true;
- flag3 = true;
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 7)
- {
- num = target.Hp;
- flag2 = true;
- flag3 = true;
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 28)
- {
- num = target.Hp;
- flag2 = true;
- flag3 = true;
- damageInfo.ignorePerfectDefence = true;
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 23)
- {
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 1)
- {
- num = num5 - target.Hp;
- }
- else
- {
- num = target.Hp - num5;
- }
- if (num < 0)
- {
- num = 0;
- }
- flag2 = true;
- flag3 = true;
- }
- else if (owner.IsPlayer() && (int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 1)
- {
- int num6 = 0;
- if (Mevius.App.Api.IsPartyMode())
- {
- int[] partyParameterType = Mevius.Party.Api.GetPartyParameterType();
- num6 = partyParameterType[owner.PartySlot];
- }
- else if (owner.IsPlayerSub())
- {
- num6 = 1000;
- }
- int abilityAttackUpValue = owner.GetAbilityAttackUpValue();
- float num7 = 1f;
- if (abilityAttackUpValue != 0)
- {
- num7 += (float)abilityAttackUpValue / 100f;
- }
- bool flag4 = false;
- if (!flag && owner.NormalAttackNum == 0 && !owner.AbilityJobMatch)
- {
- flag4 = true;
- }
- int num8;
- if (flag4)
- {
- num8 = 100;
- num8 += BattleUtility.GetFF7IndependenceAbilityValue(IndependenceAbility.PowerUp);
- }
- else
- {
- num8 = Mevius.Db.Api.GetParameter(DbManager.ParameterType.Power + num6);
- }
- int num9;
- if (BattleUtility.GetOptimaAbilityValue(2, out num9))
- {
- num8 += num9;
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5506))
- {
- num8 = (int)((float)(num8 * Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5506_0", 50)) * 0.01f + 0.5f);
- }
- num = (int)((float)num8 * num7 * ((float)num5 / 100f) + 0.5f);
- num2 = Mevius.Db.Api.GetParameter(DbManager.ParameterType.CriticalValue + num6) + (int)damageSourceElem.m31a2bc12a6fb70b72bfab3e85b658b3e();
- int num10;
- if (flag4)
- {
- num10 = 100;
- num10 += BattleUtility.GetFF7IndependenceAbilityValue(IndependenceAbility.PierceUp);
- }
- else
- {
- num10 = Mevius.Db.Api.GetParameter(DbManager.ParameterType.Pierce + num6);
- }
- if (BattleUtility.GetOptimaAbilityValue(3, out num9))
- {
- num10 += num9;
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5506))
- {
- num10 = (int)((float)(num10 * Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5506_0", 50)) * 0.01f + 0.5f);
- }
- int num11;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1461, out num11))
- {
- int residentInteger = Mevius.DataSheet.Api.GetResidentInteger("autoAbility1461_1", 0);
- int num12 = owner.ActionNum + BattleManager._i.GetZoneActionNum();
- if (residentInteger <= num12)
- {
- int residentInteger2 = Mevius.DataSheet.Api.GetResidentInteger("autoAbility1461_2", 15);
- num12 = Math.Min(num12, residentInteger2);
- int num13 = residentInteger - num12;
- int num14 = residentInteger2 - residentInteger;
- int residentInteger3 = Mevius.DataSheet.Api.GetResidentInteger("autoAbility1461_0", 100);
- if (residentInteger3 < num11)
- {
- num11 = residentInteger3;
- }
- num10 += (int)((float)(num10 * num11) / 100f * (float)num13 * (float)num13 / (float)num14 / (float)num14 + 0.5f);
- }
- }
- num3 = (int)((float)num10 * num7 * ((float)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f() / 100f) + 0.5f);
- if (Mevius.App.Api.IsPartyMode() && owner.IsPlayer() && !flag4)
- {
- ElementAttributeType useCardAbilityAttribute = owner.GetUseCardAbilityAttribute();
- if (useCardAbilityAttribute != ElementAttributeType.None)
- {
- int chainCommand = (int)Mevius.Party.Api.GetChainCommand(2, (int)useCardAbilityAttribute);
- float[] chainBonus = Mevius.Party.Api.GetChainBonus();
- num = (int)((float)num * chainBonus[chainCommand - 1] + 0.5f);
- num3 = (int)((float)num3 * chainBonus[chainCommand - 1] + 0.5f);
- }
- }
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 8)
- {
- num = (int)((float)target.HpMax / 100f * (float)num5 + 0.5f);
- num3 = (int)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f();
- flag2 = true;
- flag3 = owner.IsEnemy();
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 9)
- {
- num = (int)((float)target.Hp / 100f * (float)num5 + 0.5f);
- num3 = (int)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f();
- flag2 = true;
- flag3 = owner.IsEnemy();
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 25)
- {
- num = (int)((float)owner.HpMax / 100f * (float)num5 + 0.5f);
- num3 = (int)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f();
- flag2 = true;
- flag3 = owner.IsEnemy();
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 26)
- {
- num = (int)((float)owner.Hp / 100f * (float)num5 + 0.5f);
- num3 = (int)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f();
- flag2 = true;
- flag3 = owner.IsEnemy();
- }
- else
- {
- if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 2)
- {
- num = (int)((float)target.HpMax / 100f * (float)num5 + 0.5f);
- flag3 = owner.IsEnemy();
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 4)
- {
- num = (int)((float)owner.HpMax / 100f * (float)num5 + 0.5f);
- flag3 = owner.IsEnemy();
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 5)
- {
- num = (int)((float)target.Hp / 100f * (float)num5 + 0.5f);
- flag3 = owner.IsEnemy();
- }
- else if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 6)
- {
- num = (int)((float)owner.Hp / 100f * (float)num5 + 0.5f);
- flag3 = owner.IsEnemy();
- }
- else
- {
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 25)
- {
- num5 *= battleActor2.GetManaElementNum();
- }
- else if (26 <= (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() <= 31)
- {
- num5 *= battleActor2.GetManaElementNums()[(int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() - 26];
- }
- if (owner.IsPlayer())
- {
- num = num5;
- num3 = (int)damageSourceElem.med3b109a0c7b9aaffc8f700ad530010f();
- if (owner.AbilityJobMatch)
- {
- int num15 = 0;
- if (Mevius.App.Api.IsPartyMode())
- {
- int[] partyParameterType2 = Mevius.Party.Api.GetPartyParameterType();
- num15 = partyParameterType2[owner.PartySlot];
- }
- else if (owner.IsPlayerSub())
- {
- num15 = 1000;
- }
- num2 += Mevius.Db.Api.GetParameter(DbManager.ParameterType.CriticalValue + num15);
- int num16 = Mevius.Db.Api.GetParameter(DbManager.ParameterType.Link + num15);
- int num17;
- if (BattleUtility.GetOptimaAbilityValue(4, out num17))
- {
- num16 += num17;
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5179))
- {
- float num18 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5179_0", 50) / 100f;
- if (Mevius.App.Api.IsPartyMode() || BattleManager._i.GetPlayerActorSub() == null)
- {
- num16 += (int)((float)num16 * num18 + 0.5f);
- }
- else
- {
- int num19 = 0;
- if (BattleManager._i.GetPlayerActorSub().IsPlayerSub())
- {
- num19 += 1000;
- }
- int parameter = Mevius.Db.Api.GetParameter(DbManager.ParameterType.Link + num19);
- num16 += (int)((float)parameter * num18 + 0.5f);
- }
- }
- num4 = 1f + (float)num16 * 0.01f;
- int abilityAttackUpValue2 = owner.GetAbilityAttackUpValue();
- if (abilityAttackUpValue2 != 0)
- {
- num4 *= 1f + (float)abilityAttackUpValue2 / 100f;
- }
- num4 *= 1f + (float)owner.GetStatusEffectValue(BattleStatusEffect.ProcType.Synchro) * 0.01f;
- if (num4 < 1f)
- {
- num4 = 1f;
- }
- int val = 0;
- owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1258, out val);
- int val2 = 0;
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5166))
- {
- val2 = 100;
- }
- int num20 = Math.Max(val, val2);
- if (num20 != 0)
- {
- float num21 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5166_0", 3);
- float num22 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5166_1", 3);
- float residentFloat = Mevius.DataSheet.Api.GetResidentFloat("abilitySkill5166_2", 1f);
- float num23 = 0f;
- int num24 = Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5166_3", 3);
- if (num24 < 0)
- {
- num24 = 0;
- }
- else if (num24 > 3)
- {
- num24 = 3;
- }
- for (int i = 0; i < num24; i++)
- {
- num23 += (float)owner.RevengeDamages[i];
- }
- if (num23 > num21)
- {
- num23 = num21;
- }
- float num25 = (num22 - num21 * residentFloat) * 0.5f;
- float f = 3.14159274f * ((num23 - num21) / num21);
- float num26 = Mathf.Cos(f) + 1f;
- float num27 = Mathf.Sqrt(num23 / num21);
- float num28 = num23 * residentFloat;
- int num29 = (int)((num25 * num26 * num27 + num28) * ((float)num20 * 0.01f) + 0.5f);
- num4 += (float)num29 * 0.01f;
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5184))
- {
- int num30 = Mevius.Db.Api.GetParameter(DbManager.ParameterType.Power + num15);
- int num31 = owner.GetAbilityAttackUpValue();
- num31 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.BraveDamage);
- num30 = (int)((float)num30 * (1f + (float)num31 / 100f) + 0.5f);
- num4 += (float)((int)((float)(num30 * Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5184_0", 50)) / 100f / 100f + 0.5f));
- }
- }
- if (Mevius.App.Api.IsPartyMode() && owner.IsPlayer())
- {
- ElementAttributeType useCardAbilityAttribute2 = owner.GetUseCardAbilityAttribute();
- if (useCardAbilityAttribute2 != ElementAttributeType.None)
- {
- int chainCommand2 = (int)Mevius.Party.Api.GetChainCommand(2, (int)useCardAbilityAttribute2);
- float[] chainBonus2 = Mevius.Party.Api.GetChainBonus();
- num = (int)((float)num * chainBonus2[chainCommand2 - 1] + 0.5f);
- num3 = (int)((float)num3 * chainBonus2[chainCommand2 - 1] + 0.5f);
- }
- }
- }
- else
- {
- num = (int)((float)owner.Power * ((float)num5 / 100f) + 0.5f);
- }
- }
- num2 += (int)damageSourceElem.m31a2bc12a6fb70b72bfab3e85b658b3e();
- }
- if (target.IsStatusEffectEntry(BattleStatusEffect.ProcType.BreakDisable))
- {
- num3 = 0;
- }
- bool flag5 = false;
- bool flag6 = false;
- bool flag7 = false;
- bool flag8 = false;
- bool isEnhance = false;
- bool isReduce = false;
- int num32;
- if (flag2)
- {
- num32 = num;
- ElementAttributeBitType absorbAttributeBit = (ElementAttributeBitType)target.AbsorbAttributeBit;
- if ((absorbAttributeBit & ElementAttributeBitType.Normal) != ElementAttributeBitType.None)
- {
- flag8 = true;
- num3 = 0;
- }
- isCritical = false;
- }
- else
- {
- float num33 = 1f;
- float num34 = 1f;
- float num35 = 1f;
- float num36 = 1f;
- float num37 = 1f;
- float num38 = 1f;
- int num39 = 0;
- int num40 = 0;
- int num41 = 0;
- int num42 = 0;
- int num43 = 0;
- int num44 = 0;
- int num45 = 0;
- int num46 = 0;
- float num47 = 1f;
- int num48 = 0;
- int num49 = 0;
- int num50 = 0;
- ElementAttributeBitType elementAttributeBit = (ElementAttributeBitType)target.GetElementAttributeBit();
- ElementAttributeBitType absorbAttributeBit2 = (ElementAttributeBitType)target.AbsorbAttributeBit;
- ElementAttributeBitType weakAttributeBit = (ElementAttributeBitType)target.WeakAttributeBit;
- int num51 = 0;
- ElementAttributeBitType elementAttributeBitType = ElementAttributeBitType.None;
- if ((int)damageSourceElem.mcdcc634daaa800ae30b0d9aa90d524cc() != 0)
- {
- elementAttributeBitType |= ElementAttributeBitType.Fire;
- num51++;
- }
- if ((int)damageSourceElem.m6374ec9bd9c83aa1592cd25bdd68315e() != 0)
- {
- if ((elementAttributeBitType & ElementAttributeBitType.Fire) == ElementAttributeBitType.None)
- {
- elementAttributeBitType |= ElementAttributeBitType.Water;
- }
- else
- {
- elementAttributeBitType &= (ElementAttributeBitType)(-2);
- }
- num51++;
- }
- if ((int)damageSourceElem.m1ff35aae1a721dffe2c7ec2dfb4c573e() != 0)
- {
- elementAttributeBitType |= ElementAttributeBitType.Wind;
- num51++;
- }
- if ((int)damageSourceElem.m957592ac75221a66cc4d1fa3831c59b8() != 0)
- {
- if ((elementAttributeBitType & ElementAttributeBitType.Wind) == ElementAttributeBitType.None)
- {
- elementAttributeBitType |= ElementAttributeBitType.Earth;
- }
- else
- {
- elementAttributeBitType &= (ElementAttributeBitType)(-5);
- }
- num51++;
- }
- if ((int)damageSourceElem.m4a78ffda98410f820411120ffcbc8045() != 0)
- {
- elementAttributeBitType |= ElementAttributeBitType.Light;
- num51++;
- }
- if ((int)damageSourceElem.m7b9ab26a81a7c308786cde1f6d7a628e() != 0)
- {
- if ((elementAttributeBitType & ElementAttributeBitType.Light) == ElementAttributeBitType.None)
- {
- elementAttributeBitType |= ElementAttributeBitType.Dark;
- }
- else
- {
- elementAttributeBitType &= (ElementAttributeBitType)(-17);
- }
- num51++;
- }
- if (num51 >= 3)
- {
- elementAttributeBitType = ElementAttributeBitType.None;
- }
- bool flag9 = false;
- if ((elementAttributeBitType == ElementAttributeBitType.None && owner.NormalAttackNum > 0) || (flag && owner.IsAutoAbility(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1455)))
- {
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.EnchantFire))
- {
- elementAttributeBitType++;
- flag9 = true;
- }
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.EnchantWater))
- {
- elementAttributeBitType += 2;
- flag9 = true;
- }
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.EnchantWind))
- {
- elementAttributeBitType += 4;
- flag9 = true;
- }
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.EnchantEarth))
- {
- elementAttributeBitType += 8;
- flag9 = true;
- }
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.EnchantLight))
- {
- elementAttributeBitType += 16;
- flag9 = true;
- }
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.EnchantDark))
- {
- elementAttributeBitType += 32;
- flag9 = true;
- }
- }
- damageInfo.elementAttributeBit = (int)elementAttributeBitType;
- if ((int)damageSourceElem.m056cb6b23e1a1553df9a90eb3f5f804b() != 0)
- {
- int num52 = owner.GetStatusEffectValue(BattleStatusEffect.ProcType.BraveDamage);
- int num53;
- if (flag9 && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1456, out num53))
- {
- num52 += num53;
- }
- num33 *= 1f + (float)num52 * 0.01f;
- if (owner.IsEnemy())
- {
- if (num52 > 0)
- {
- isEnhance = true;
- }
- else if (num52 < 0)
- {
- isReduce = true;
- }
- }
- }
- else if (owner.IsEnemy() && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() != 1)
- {
- int statusEffectValue = owner.GetStatusEffectValue(BattleStatusEffect.ProcType.Synchro);
- num33 *= 1f + (float)statusEffectValue * 0.01f;
- if (statusEffectValue > 0)
- {
- isEnhance = true;
- }
- else if (statusEffectValue < 0)
- {
- isReduce = true;
- }
- }
- if (target.IsBreakDamage() && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() != 50)
- {
- flag5 = true;
- num34 *= Mevius.DataSheet.Api.GetResidentFloat("damageBreakRate", 2f);
- }
- float residentFloat2 = Mevius.DataSheet.Api.GetResidentFloat("damageSameAttributeRate", 0.5f);
- float residentFloat3 = Mevius.DataSheet.Api.GetResidentFloat("damageReverseAttributeRate", 2f);
- float residentFloat4 = Mevius.DataSheet.Api.GetResidentFloat("damageBreakReverseAttributeRate", 2f);
- bool flag10 = owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5176);
- bool flag11 = owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5177);
- if ((elementAttributeBitType & ElementAttributeBitType.Fire) != ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Fire) != ElementAttributeBitType.None)
- {
- flag8 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit++;
- }
- num3 = 0;
- }
- else if ((elementAttributeBit & ElementAttributeBitType.Fire) != ElementAttributeBitType.None && !flag10)
- {
- if (!flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum2 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum2 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum2;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit++;
- }
- }
- }
- else if ((weakAttributeBit & ElementAttributeBitType.Fire) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Water) != ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Water) != ElementAttributeBitType.None)
- {
- flag8 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 2;
- }
- num3 = 0;
- }
- else if ((elementAttributeBit & ElementAttributeBitType.Water) != ElementAttributeBitType.None && !flag10)
- {
- if (!flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum3 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum3 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum3;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 2;
- }
- }
- }
- else if ((weakAttributeBit & ElementAttributeBitType.Water) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Wind) != ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Wind) != ElementAttributeBitType.None)
- {
- flag8 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 4;
- }
- num3 = 0;
- }
- else if ((elementAttributeBit & ElementAttributeBitType.Wind) != ElementAttributeBitType.None && !flag10)
- {
- if (!flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum4 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum4 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum4;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 4;
- }
- }
- }
- else if ((weakAttributeBit & ElementAttributeBitType.Wind) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Earth) != ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Earth) != ElementAttributeBitType.None)
- {
- flag8 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 8;
- }
- num3 = 0;
- }
- else if ((elementAttributeBit & ElementAttributeBitType.Earth) != ElementAttributeBitType.None && !flag10)
- {
- if (!flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum5 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum5 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum5;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 8;
- }
- }
- }
- else if ((weakAttributeBit & ElementAttributeBitType.Earth) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Light) != ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Light) != ElementAttributeBitType.None)
- {
- flag8 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 16;
- }
- num3 = 0;
- }
- else if ((elementAttributeBit & ElementAttributeBitType.Light) != ElementAttributeBitType.None && !flag10)
- {
- if (!flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum6 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum6 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum6;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 16;
- }
- }
- }
- else if ((weakAttributeBit & ElementAttributeBitType.Light) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Dark) != ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Dark) != ElementAttributeBitType.None)
- {
- flag8 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 32;
- }
- num3 = 0;
- }
- else if ((elementAttributeBit & ElementAttributeBitType.Dark) != ElementAttributeBitType.None && !flag10)
- {
- if (!flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum7 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum7 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum7;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- if (flag9)
- {
- damageInfo.removeEnchantAttributeBit += 32;
- }
- }
- }
- else if ((weakAttributeBit & ElementAttributeBitType.Dark) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if (elementAttributeBitType == ElementAttributeBitType.None)
- {
- if ((absorbAttributeBit2 & ElementAttributeBitType.Normal) != ElementAttributeBitType.None)
- {
- flag8 = true;
- num3 = 0;
- }
- if ((elementAttributeBit & ElementAttributeBitType.Normal) != ElementAttributeBitType.None && !flag10 && !flag8)
- {
- num36 *= residentFloat2;
- int useCardAbilitySkillNum8 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5003);
- if (useCardAbilitySkillNum8 > 0)
- {
- num49 -= 100 - Mevius.DataSheet.Api.GetResidentInteger("abilitySkill1", 50) * useCardAbilitySkillNum8;
- }
- else
- {
- num3 = 0;
- }
- flag6 = true;
- }
- if ((weakAttributeBit & ElementAttributeBitType.Normal) != ElementAttributeBitType.None)
- {
- if (flag5)
- {
- num36 *= residentFloat4;
- }
- else
- {
- num36 *= residentFloat3;
- num37 *= residentFloat3;
- }
- flag7 = true;
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Fire) != ElementAttributeBitType.None)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageFire);
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageAll);
- int elementInfluenceType = BattleUtility.GetElementInfluenceType();
- if (elementInfluenceType != 0)
- {
- DbManager.BattleData battleData = Mevius.Db.Api.GetBattleData();
- if ((int)battleData.elementInfluenceAttribute == 0)
- {
- damageInfo.elementInfluenceRate *= battleData.elementInfluenceRate;
- num36 *= battleData.elementInfluenceRate;
- }
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Water) != ElementAttributeBitType.None)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageWater);
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageAll);
- int elementInfluenceType2 = BattleUtility.GetElementInfluenceType();
- if (elementInfluenceType2 != 0)
- {
- DbManager.BattleData battleData2 = Mevius.Db.Api.GetBattleData();
- if ((int)battleData2.elementInfluenceAttribute == 1)
- {
- damageInfo.elementInfluenceRate *= battleData2.elementInfluenceRate;
- num36 *= battleData2.elementInfluenceRate;
- }
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Wind) != ElementAttributeBitType.None)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageWind);
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageAll);
- int elementInfluenceType3 = BattleUtility.GetElementInfluenceType();
- if (elementInfluenceType3 != 0)
- {
- DbManager.BattleData battleData3 = Mevius.Db.Api.GetBattleData();
- if ((int)battleData3.elementInfluenceAttribute == 2)
- {
- damageInfo.elementInfluenceRate *= battleData3.elementInfluenceRate;
- num36 *= battleData3.elementInfluenceRate;
- }
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Earth) != ElementAttributeBitType.None)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageEarth);
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageAll);
- int elementInfluenceType4 = BattleUtility.GetElementInfluenceType();
- if (elementInfluenceType4 != 0)
- {
- DbManager.BattleData battleData4 = Mevius.Db.Api.GetBattleData();
- if ((int)battleData4.elementInfluenceAttribute == 3)
- {
- damageInfo.elementInfluenceRate *= battleData4.elementInfluenceRate;
- num36 *= battleData4.elementInfluenceRate;
- }
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Light) != ElementAttributeBitType.None)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageLight);
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageAll);
- int elementInfluenceType5 = BattleUtility.GetElementInfluenceType();
- if (elementInfluenceType5 != 0)
- {
- DbManager.BattleData battleData5 = Mevius.Db.Api.GetBattleData();
- if ((int)battleData5.elementInfluenceAttribute == 4)
- {
- damageInfo.elementInfluenceRate *= battleData5.elementInfluenceRate;
- num36 *= battleData5.elementInfluenceRate;
- }
- }
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Dark) != ElementAttributeBitType.None)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageDark);
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.EnhanceDamageAll);
- int elementInfluenceType6 = BattleUtility.GetElementInfluenceType();
- if (elementInfluenceType6 != 0)
- {
- DbManager.BattleData battleData6 = Mevius.Db.Api.GetBattleData();
- if ((int)battleData6.elementInfluenceAttribute == 5)
- {
- damageInfo.elementInfluenceRate *= battleData6.elementInfluenceRate;
- num36 *= battleData6.elementInfluenceRate;
- }
- }
- }
- if (owner.IsPlayer())
- {
- int num54;
- if ((elementAttributeBitType & ElementAttributeBitType.Fire) != ElementAttributeBitType.None && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_FIRE_STRENGTHEN, out num54))
- {
- num39 += num54;
- }
- int num55;
- if ((elementAttributeBitType & ElementAttributeBitType.Water) != ElementAttributeBitType.None && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_ICE_STRENGTHEN, out num55))
- {
- num39 += num55;
- }
- int num56;
- if ((elementAttributeBitType & ElementAttributeBitType.Wind) != ElementAttributeBitType.None && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_WIND_STRENGTHEN, out num56))
- {
- num39 += num56;
- }
- int num57;
- if ((elementAttributeBitType & ElementAttributeBitType.Earth) != ElementAttributeBitType.None && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_SOIL_STRENGTHEN, out num57))
- {
- num39 += num57;
- }
- int num58;
- if ((elementAttributeBitType & ElementAttributeBitType.Light) != ElementAttributeBitType.None && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_LIGHT_STRENGTHEN, out num58))
- {
- num39 += num58;
- }
- int num59;
- if ((elementAttributeBitType & ElementAttributeBitType.Dark) != ElementAttributeBitType.None && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_DARK_STRENGTHEN, out num59))
- {
- num39 += num59;
- }
- }
- if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 1)
- {
- int num60 = owner.GetStatusEffectValue(BattleStatusEffect.ProcType.Break);
- int num61;
- if (flag9 && !flag && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1457, out num61))
- {
- num60 += num61;
- }
- num3 = (int)((float)num3 * (1f + (float)num60 / 100f));
- }
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() != 1)
- {
- num39 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.GiveDamage);
- num41 -= target.GetStatusEffectValue(BattleStatusEffect.ProcType.TakeDamage);
- num42 -= target.GetStatusEffectValue(BattleStatusEffect.ProcType.TakeDamageEnemy);
- if (target.IsPlayer())
- {
- int num62;
- if ((elementAttributeBitType & ElementAttributeBitType.Fire) != ElementAttributeBitType.None && target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_FIRE_TOLERANCE, out num62))
- {
- num43 += num62;
- }
- int num63;
- if ((elementAttributeBitType & ElementAttributeBitType.Water) != ElementAttributeBitType.None && target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_ICE_TOLERANCE, out num63))
- {
- num43 += num63;
- }
- int num64;
- if ((elementAttributeBitType & ElementAttributeBitType.Wind) != ElementAttributeBitType.None && target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_WIND_TOLERANCE, out num64))
- {
- num43 += num64;
- }
- int num65;
- if ((elementAttributeBitType & ElementAttributeBitType.Earth) != ElementAttributeBitType.None && target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_SOIL_TOLERANCE, out num65))
- {
- num43 += num65;
- }
- int num66;
- if ((elementAttributeBitType & ElementAttributeBitType.Light) != ElementAttributeBitType.None && target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_LIGHT_TOLERANCE, out num66))
- {
- num43 += num66;
- }
- int num67;
- if ((elementAttributeBitType & ElementAttributeBitType.Dark) != ElementAttributeBitType.None && target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_DARK_TOLERANCE, out num67))
- {
- num43 += num67;
- }
- }
- if (!flag8 && !flag10)
- {
- for (int j = 0; j < 7; j++)
- {
- if ((elementAttributeBitType & (ElementAttributeBitType)(1 << j)) != ElementAttributeBitType.None)
- {
- int num68 = target.GetStatusEffectValue(BattleStatusEffect.ProcType.ReductionDamageFire + j);
- int num69;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1317, out num69))
- {
- num68 += num69;
- }
- if (num68 > 0)
- {
- flag6 = true;
- }
- num38 *= (float)(100 - num68) * 0.01f;
- }
- }
- }
- if (flag7)
- {
- num46 += target.GetStatusEffectValue(BattleStatusEffect.ProcType.SufferDamageWeak);
- num49 += target.GetStatusEffectValue(BattleStatusEffect.ProcType.SufferDamageWeak);
- int useCardAbilitySkillNum9 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5103);
- if (useCardAbilitySkillNum9 > 0)
- {
- num48 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill8", 50) * useCardAbilitySkillNum9;
- }
- int num70;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1310, out num70))
- {
- num46 += num70;
- num49 += num70;
- }
- int useAbilitySkillValue = owner.GetUseAbilitySkillValue(EnemyAbilitySkillType.Id1310);
- num46 += useAbilitySkillValue;
- num49 += useAbilitySkillValue;
- }
- if (owner.IsPlayer())
- {
- int useCardAbilitySkillNum10 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5152);
- if (useCardAbilitySkillNum10 > 0)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill16", 50) * useCardAbilitySkillNum10;
- }
- int num71;
- if (owner.PrevUseCardAbilityAttribute != ElementAttributeType.None && !flag && owner.NormalAttackNum == 0 && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1314, out num71))
- {
- num39 += num71;
- }
- ElementAttributeType prevUseCardAbilityAttribute = owner.PrevUseCardAbilityAttribute;
- if (prevUseCardAbilityAttribute != ElementAttributeType.None)
- {
- ElementAttributeType useCardAbilityAttribute3 = owner.GetUseCardAbilityAttribute();
- if (useCardAbilityAttribute3 != ElementAttributeType.None)
- {
- int num73;
- if (prevUseCardAbilityAttribute == useCardAbilityAttribute3)
- {
- int num72;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1315, out num72))
- {
- num39 += num72;
- }
- num39 += owner.GetUseAbilitySkillValue(EnemyAbilitySkillType.Id1315);
- int useCardAbilitySkillNum11 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5164);
- if (useCardAbilitySkillNum11 > 0)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5164", 10) * useCardAbilitySkillNum11;
- }
- }
- else if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1316, out num73))
- {
- num39 += num73;
- }
- }
- }
- int useCardAbilitySkillNum12 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5154);
- if (useCardAbilitySkillNum12 > 0 && BattleManager._i.GetEnemyNum(false) == 1)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5154", 10) * useCardAbilitySkillNum12;
- }
- int useCardAbilitySkillNum13 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5155);
- if (useCardAbilitySkillNum13 > 0)
- {
- DiffLevel diffLevel = Mevius.Battle.Api.GetDiffLevel(Mevius.Field.Api.GadgetRouteApi.GetTargetGadgetName(), Mevius.Db.Api.GetCurrentCardDeck(), Mevius.App.Api.GetMainJobTypeCurrentDeck());
- if (diffLevel == DiffLevel.VeryTough)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5155_0", 10) * useCardAbilitySkillNum13;
- }
- else if (diffLevel == DiffLevel.IncrediblyTough)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5155_1", 10) * useCardAbilitySkillNum13;
- }
- }
- int useCardAbilitySkillNum14 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5156);
- if (useCardAbilitySkillNum14 > 0 && BattleManager._i.TurnNum == 1)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5156", 10) * useCardAbilitySkillNum14;
- }
- int useCardAbilitySkillNum15 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5157);
- if (useCardAbilitySkillNum15 > 0)
- {
- int statusEffectDebuffNum = target.GetStatusEffectDebuffNum();
- if (statusEffectDebuffNum > 0)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5157", 10) * useCardAbilitySkillNum15 * statusEffectDebuffNum;
- }
- }
- int useCardAbilitySkillNum16 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5159);
- if (useCardAbilitySkillNum16 > 0 && target.Bp == target.BpMax && target.BpArmorDamage == 0)
- {
- num48 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5159", 10) * useCardAbilitySkillNum16;
- }
- int useCardAbilitySkillNum17 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5160);
- if (useCardAbilitySkillNum17 > 0)
- {
- float hpRate = target.GetHpRate();
- if (hpRate <= 0.25f)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5160_1", 10) * useCardAbilitySkillNum17;
- }
- else if (hpRate <= 0.5f)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5160_0", 10) * useCardAbilitySkillNum17;
- }
- }
- if ((owner.ActionFlagBit & BattleActor.ActionFlagBitType.AbilitySkill5162) != (BattleActor.ActionFlagBitType)0)
- {
- int useCardAbilitySkillNum18 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5162);
- if (useCardAbilitySkillNum18 > 0)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5162", 10) * useCardAbilitySkillNum18;
- }
- }
- if ((owner.ActionFlagBit & BattleActor.ActionFlagBitType.AbilitySkill5163) != (BattleActor.ActionFlagBitType)0)
- {
- int useCardAbilitySkillNum19 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5163);
- if (useCardAbilitySkillNum19 > 0)
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5163", 10) * useCardAbilitySkillNum19;
- }
- }
- int useCardAbilitySkillNum20 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5616);
- if (useCardAbilitySkillNum20 > 0 && target.IsStatusEffectEntry(BattleStatusEffect.GroupType.Brave))
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5616", 10) * useCardAbilitySkillNum20;
- }
- int useCardAbilitySkillNum21 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5617);
- if (useCardAbilitySkillNum21 > 0 && target.IsStatusEffectEntry(BattleStatusEffect.GroupType.Syncle))
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5617", 10) * useCardAbilitySkillNum21;
- }
- int useCardAbilitySkillNum22 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5618);
- if (useCardAbilitySkillNum22 > 0 && target.IsStatusEffectEntry(BattleStatusEffect.GroupType.BuffStart))
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5618", 10) * useCardAbilitySkillNum22;
- }
- int useCardAbilitySkillNum23 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5619);
- if (useCardAbilitySkillNum23 > 0 && target.IsStatusEffectEntry(BattleStatusEffect.GroupType.Clit))
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5619", 10) * useCardAbilitySkillNum23;
- }
- int abilitySkillEnemySlayer = BattleUtility.GetAbilitySkillEnemySlayer(owner, target);
- num39 += abilitySkillEnemySlayer;
- num48 += abilitySkillEnemySlayer;
- if (owner.NormalAttackNum > 0)
- {
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.JobAbilityRatioDamageUp))
- {
- float jobAbilityUseManaUseNumRate = owner.GetJobAbilityUseManaUseNumRate();
- float num74 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5502_0", 50) * 0.01f;
- if (num74 <= jobAbilityUseManaUseNumRate)
- {
- float num75 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5502_1", 100) * 0.01f;
- float num76 = 1f - num74;
- float num77 = jobAbilityUseManaUseNumRate - num74;
- num39 += (int)(num75 / (num76 * num76) * num77 * num77 * 100f + 0.5f);
- }
- }
- if (owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.JobAbilityRatioBreakDamageUp))
- {
- float jobAbilityUseManaUseNumRate2 = owner.GetJobAbilityUseManaUseNumRate();
- float num78 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5503_0", 50) * 0.01f;
- if (num78 >= jobAbilityUseManaUseNumRate2)
- {
- float num79 = (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5503_1", 100) * 0.01f;
- float num80 = num78;
- float num81 = jobAbilityUseManaUseNumRate2 - num78;
- num48 += (int)(num79 / (num80 * num80) * num81 * num81 * 100f + 0.5f);
- }
- }
- }
- int useCardAbilitySkillNum24 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5167);
- if (useCardAbilitySkillNum24 > 0)
- {
- int num82 = target.GetStatusEffectDebuffNum();
- if (num82 > 0)
- {
- int residentInteger4 = Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5167_1", 10);
- if (num82 > residentInteger4)
- {
- num82 = residentInteger4;
- }
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5167", 2) * num82 * useCardAbilitySkillNum24;
- }
- }
- int useCardAbilitySkillNum25 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5178);
- if (useCardAbilitySkillNum25 > 0)
- {
- int num83 = owner.GetStatusEffectBuffNum();
- if (num83 > 0)
- {
- int residentInteger5 = Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5178_1", 10);
- if (num83 > residentInteger5)
- {
- num83 = residentInteger5;
- }
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5178_0", 50) * num83 * useCardAbilitySkillNum25;
- }
- }
- int num84;
- if ((flag || owner.NormalAttackNum != 0 || (int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 1) && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1257, out num84) && target.BpArmorDamage != 0)
- {
- num48 += num84;
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5182))
- {
- num39 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5182_0", 25) * owner.GetStatusEffectElementDriveTurnAll();
- }
- }
- num39 += owner.ActionDamageGroupParam;
- if (owner.NormalAttackNum == 3)
- {
- int residentInteger6 = Mevius.DataSheet.Api.GetResidentInteger("damageFinishAddRate", 20);
- num39 += residentInteger6;
- num48 += residentInteger6;
- }
- if (!flag6 && !isRandMinTest && !owner.IsStatusEffectEntry(BattleStatusEffect.ProcType.CriticalZero) && (num != 0 || num3 != 0))
- {
- if (target.IsStatusEffectEntry(BattleStatusEffect.GroupType.CriticalDefenseUp) && !flag11)
- {
- isCritical = false;
- }
- else if ((!flag && owner.NormalAttackNum <= 0) || !isNoCriticalCalc)
- {
- num2 += owner.GetStatusEffectValue(BattleStatusEffect.ProcType.Critical);
- num2 += target.GetStatusEffectValue(BattleStatusEffect.ProcType.TakeCritical);
- if (owner.IsPlayer())
- {
- if (flag5)
- {
- int useCardAbilitySkillNum26 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5052);
- if (useCardAbilitySkillNum26 > 0)
- {
- num2 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill3", 50) * useCardAbilitySkillNum26;
- }
- }
- if (flag7)
- {
- int useCardAbilitySkillNum27 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5104);
- if (useCardAbilitySkillNum27 > 0)
- {
- num2 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill9", 50) * useCardAbilitySkillNum27;
- }
- }
- }
- if (!flag11)
- {
- C4d4f3a800432e94568175cb31ad3c78d.C51747b7e0e19ad065084a2c5a6d8421b battleCharaSpecElem = target.GetBattleCharaSpecElem();
- if (battleCharaSpecElem != null)
- {
- num2 -= (int)battleCharaSpecElem.m55cf0f9e548ca3ba7c5b283f670f1dec();
- }
- }
- if (num2 > 0)
- {
- uint num85 = Mevius.Battle.Api.GetRandomUnsignedInteger() % 100u;
- isCritical = ((ulong)num85 < (ulong)((long)num2));
- }
- else
- {
- isCritical = false;
- }
- damageInfo.isCriticalCalc = true;
- }
- }
- else
- {
- isCritical = false;
- }
- if (isCritical)
- {
- num35 = Mevius.DataSheet.Api.GetResidentFloat("damageCriticalRate", 1.5f);
- if (owner.IsPlayer())
- {
- int useCardAbilitySkillNum28 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5053);
- if (useCardAbilitySkillNum28 > 0)
- {
- num48 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill4", 50) * useCardAbilitySkillNum28;
- }
- int useCardAbilitySkillNum29 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5054);
- if (useCardAbilitySkillNum29 > 0)
- {
- num45 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5", 50) * useCardAbilitySkillNum29;
- }
- int num86;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1311, out num86))
- {
- num45 += num86;
- }
- int useCardAbilitySkillNum30 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5171);
- if (useCardAbilitySkillNum30 > 0)
- {
- num45 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5171_0", 100) * useCardAbilitySkillNum30;
- }
- }
- num45 += owner.GetUseAbilitySkillValue(EnemyAbilitySkillType.Id1311);
- }
- if (flag5 && owner.IsPlayer())
- {
- int useCardAbilitySkillNum31 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5002);
- if (useCardAbilitySkillNum31 > 0)
- {
- num44 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill0", 50) * useCardAbilitySkillNum31;
- }
- if (flag7)
- {
- int useCardAbilitySkillNum32 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5102);
- if (useCardAbilitySkillNum32 > 0)
- {
- num46 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill7", 50) * useCardAbilitySkillNum32;
- }
- }
- int num87;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1309, out num87))
- {
- num44 += num87;
- }
- num44 += owner.GetUseAbilitySkillValue(EnemyAbilitySkillType.Id1309);
- int useCardAbilitySkillNum33 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5168);
- if (useCardAbilitySkillNum33 > 0)
- {
- num44 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5168_0", 100) * useCardAbilitySkillNum33;
- }
- }
- if (target.IsStatusEffectEntry(BattleStatusEffect.ProcType.TakeBreakDamage) && (flag || owner.NormalAttackNum > 0))
- {
- num50 -= target.GetStatusEffectValue(BattleStatusEffect.ProcType.TakeBreakDamage);
- }
- if (target.IsStatusEffectEntry(BattleStatusEffect.ProcType.TakeAbilityBreakDamage) && !flag && owner.NormalAttackNum == 0)
- {
- num50 -= target.GetStatusEffectValue(BattleStatusEffect.ProcType.TakeAbilityBreakDamage);
- }
- if (!target.IsStatusEffectEntry(BattleStatusEffect.ProcType.DefenceZero) && !flag11)
- {
- if (owner.IsPlayer())
- {
- if (!flag5)
- {
- num40 += target.Defense;
- }
- }
- else if (target.IsPlayer())
- {
- int num88 = 0;
- if (Mevius.App.Api.IsPartyMode())
- {
- int[] partyParameterType3 = Mevius.Party.Api.GetPartyParameterType();
- num88 = partyParameterType3[target.PartySlot];
- }
- else if (target.IsPlayerSub())
- {
- num88 = 1000;
- }
- num40 += Mevius.Db.Api.GetParameter(DbManager.ParameterType.GuardValue + num88);
- int num89;
- if (BattleUtility.GetOptimaAbilityValue(61, out num89))
- {
- num40 += num89;
- }
- }
- else
- {
- num40 += target.Defense;
- }
- if (isCritical)
- {
- int useCardAbilitySkillNum34 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5054);
- if (useCardAbilitySkillNum34 > 0)
- {
- num40 -= Mevius.DataSheet.Api.GetResidentInteger("abilitySkill6", 20) * useCardAbilitySkillNum34;
- }
- }
- if (num40 < 0)
- {
- num40 = 0;
- }
- }
- }
- else
- {
- int num90;
- if (num5 > 0 && Mevius.App.Api.IsPartyMode() && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1508, out num90))
- {
- num39 += num90;
- }
- isCritical = false;
- }
- if ((elementAttributeBitType & ElementAttributeBitType.Fire) != ElementAttributeBitType.None && (int)damageSourceElem.m056cb6b23e1a1553df9a90eb3f5f804b() == 0 && target.IsStatusEffectEntry(BattleStatusEffect.ProcType.MagicDamageFire))
- {
- num = (int)((float)(num * target.GetStatusEffectValue(BattleStatusEffect.ProcType.MagicDamageFire)) * 0.01f + 0.5f);
- }
- float num91 = 1f + (float)num39 * 0.01f;
- num34 += (float)num44 * 0.01f;
- num36 += (float)num46 * 0.01f;
- num35 += (float)num45 * 0.01f;
- num47 += (float)num48 * 0.01f;
- num37 += (float)num49 * 0.01f;
- if (num4 < 0f)
- {
- num4 = 0f;
- }
- if (num91 < 0f)
- {
- num91 = 0f;
- }
- if (num34 < 0f)
- {
- num34 = 0f;
- }
- if (num36 < 0f)
- {
- num36 = 0f;
- }
- if (num35 < 0f)
- {
- num35 = 0f;
- }
- if (num47 < 0f)
- {
- num47 = 0f;
- }
- if (num37 < 0f)
- {
- num37 = 0f;
- }
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 1)
- {
- num34 = 1f;
- }
- if (target.BpSpecialCalc && !flag7 && (int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() != 1)
- {
- num47 *= Mevius.DataSheet.Api.GetResidentFloat("breakDamageUnWeaknessAbilityAttackRate", 0.25f);
- }
- float num92 = 1f;
- float num93 = 1f;
- if (BattleManager._i.IsCountTimeBattle())
- {
- if (owner.IsEnemy())
- {
- if (target.IsPlayer())
- {
- num92 = (float)Mevius.DataSheet.Api.GetResidentInteger("ctbEnemyToPlayerDamageRate", 100) / 100f;
- }
- else if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 1)
- {
- num92 = (float)Mevius.DataSheet.Api.GetResidentInteger("ctbEnemyToEnemyRecoverRate", 100) / 100f;
- }
- else
- {
- num92 = (float)Mevius.DataSheet.Api.GetResidentInteger("ctbEnemyToEnemyDamageRate", 100) / 100f;
- }
- }
- else if (target.IsEnemy())
- {
- int enemyLevel = BattleManager._i.EnemyLevel;
- num92 = BattleDamage.GetCTBCalcRate(enemyLevel, (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyDamageRate_Y1", 100), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyDamageRate_X1", 1), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyDamageRate_Y2", 10), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyDamageRate_X2", 100));
- if ((int)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f() == 1)
- {
- num93 = BattleDamage.GetCTBCalcRate(enemyLevel, (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyParamRefBreakDamageRate_Y1", 100), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyParamRefBreakDamageRate_X1", 1), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyParamRefBreakDamageRate_Y2", 10), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyParamRefBreakDamageRate_X2", 100));
- }
- else
- {
- num93 = BattleDamage.GetCTBCalcRate(enemyLevel, (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyAbilityBreakDamageRate_Y1", 100), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyAbilityBreakDamageRate_X1", 1), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyAbilityBreakDamageRate_Y2", 10), (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToEnemyAbilityBreakDamageRate_X2", 100));
- }
- }
- else if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 1)
- {
- num92 = (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToPlayerRecoverRate", 100) / 100f;
- }
- else
- {
- num92 = (float)Mevius.DataSheet.Api.GetResidentInteger("ctbPlayerToPlayerDamageRate", 100) / 100f;
- }
- }
- if (flag8)
- {
- num = (int)(num92 * (float)num * owner.AbilityDamageCoef * num4 * num33 * num91 * num35 + 0.5f);
- }
- else
- {
- num = (int)(num92 * (float)num * owner.AbilityDamageCoef * num4 * num36 * num33 * num91 * num34 * num35 + 0.5f);
- }
- float residentFloat5 = Mevius.DataSheet.Api.GetResidentFloat("bpDamageDefenderRateMin", 0.3f);
- float residentFloat6 = Mevius.DataSheet.Api.GetResidentFloat("bpDamageDefenderRateMax", 3f);
- float num94 = (float)(100 - num50) * 0.01f;
- if (num94 < residentFloat5)
- {
- num94 = residentFloat5;
- }
- else if (num94 > residentFloat6)
- {
- num94 = residentFloat6;
- }
- num3 = (int)(num93 * (float)num3 * owner.AbilityDamageCoef * num4 * num37 * num47 * num94 + 0.5f);
- if (owner.IsPlayer())
- {
- if (num != 0)
- {
- int num96;
- if (target.IsBreak())
- {
- int num95 = 0;
- if (BattleUtility.GetOptimaAbilityValue(23, out num96))
- {
- num95 += num96;
- }
- int num97;
- if (owner.NormalAttackNum > 0 && owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1341, out num97))
- {
- num95 += num97;
- }
- if (num95 > 0)
- {
- num = (int)((float)num * (1f + (float)num95 / 100f) + 0.5f);
- }
- }
- int num98 = 0;
- Ceaf68fb2356fb8b84facc86d2fe79f0e.Cca912973d2eb55c3b74a5c95a6475670 cca912973d2eb55c3b74a5c95a2 = Ceaf68fb2356fb8b84facc86d2fe79f0e.Find(owner.AbilityId);
- if (cca912973d2eb55c3b74a5c95a2 != null && (int)cca912973d2eb55c3b74a5c95a2.m02be48e0485474e5cf059777a462cc3d() != 0)
- {
- if (BattleUtility.GetOptimaAbilityValue(24, out num96))
- {
- num98 += num96;
- }
- int num99;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1342, out num99))
- {
- num98 += num99;
- }
- }
- int useCardAbilitySkillNum35 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5173);
- if (useCardAbilitySkillNum35 > 0)
- {
- int num100 = Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5173_0", 10) * useCardAbilitySkillNum35 * owner.GetUseCardAbilityTurnCount();
- int residentInteger7 = Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5173_1", 50);
- if (num100 > residentInteger7)
- {
- num100 = residentInteger7;
- }
- num98 += num100;
- }
- int useCardAbilitySkillNum36 = owner.GetUseCardAbilitySkillNum(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5175);
- if (useCardAbilitySkillNum36 > 0 && BattleManager._i.GetEnemyNum(false) == 1)
- {
- num98 += Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5175_0", 100) * useCardAbilitySkillNum36;
- }
- if (num98 > 0)
- {
- num = (int)((float)num * (1f + (float)num98 / 100f) + 0.5f);
- }
- if (owner.NormalAttackNum > 0)
- {
- if (BattleUtility.GetOptimaAbilityValue(20, out num96))
- {
- num = (int)((float)num * (1f + (float)num96 / 100f) + 0.5f);
- }
- else if (BattleUtility.GetOptimaAbilityValue(40, out num96))
- {
- num3 = (int)((float)num3 * (1f + (float)num96 / 100f) + 0.5f);
- }
- }
- else if (!flag)
- {
- if (BattleUtility.GetOptimaAbilityValue(21, out num96))
- {
- num = (int)((float)num * (1f + (float)num96 / 100f) + 0.5f);
- }
- else if (BattleUtility.GetOptimaAbilityValue(41, out num96))
- {
- num3 = (int)((float)num3 * (1f + (float)num96 / 100f) + 0.5f);
- }
- }
- else if (BattleUtility.GetOptimaAbilityValue(22, out num96))
- {
- num = (int)((float)num * (1f + (float)num96 / 100f) + 0.5f);
- }
- else if (BattleUtility.GetOptimaAbilityValue(42, out num96))
- {
- num3 = (int)((float)num3 * (1f + (float)num96 / 100f) + 0.5f);
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5170))
- {
- num += (int)((float)num * owner.GetHpRate() * (float)Mevius.DataSheet.Api.GetResidentInteger("abilitySkill5170_0", 10) * 0.01f + 0.5f);
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5180))
- {
- ElementAttributeType useCardAbilityAttribute4 = owner.GetUseCardAbilityAttribute();
- if (useCardAbilityAttribute4 != ElementAttributeType.None)
- {
- ElementAttributeType[] jobUseAttributeArray = BattleUtility.GetJobUseAttributeArray(battleActor.Deck, true);
- for (int k = 0; k < jobUseAttributeArray.Length; k++)
- {
- if (jobUseAttributeArray[k] == useCardAbilityAttribute4)
- {
- int[] values = battleActor.ElementalGauge.GetValues(owner.GetStatusEffectElementalGaugeEntry());
- float residentFloat7 = Mevius.DataSheet.Api.GetResidentFloat("abilitySkill5180_0", 1f);
- num += (int)((float)(num * values[(int)useCardAbilityAttribute4]) * 0.01f * residentFloat7 + 0.5f);
- break;
- }
- }
- }
- }
- if (owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5181))
- {
- ElementAttributeType useCardAbilityAttribute5 = owner.GetUseCardAbilityAttribute();
- if (useCardAbilityAttribute5 != ElementAttributeType.None)
- {
- int num101 = 0;
- ElementAttributeType[] jobUseAttributeArray2 = BattleUtility.GetJobUseAttributeArray(battleActor.Deck, true);
- for (int l = 0; l < jobUseAttributeArray2.Length; l++)
- {
- if (jobUseAttributeArray2[l] == useCardAbilityAttribute5)
- {
- int[] values2 = battleActor.ElementalGauge.GetValues(owner.GetStatusEffectElementalGaugeEntry());
- num101 = values2[(int)useCardAbilityAttribute5];
- break;
- }
- }
- float residentFloat8 = Mevius.DataSheet.Api.GetResidentFloat("abilitySkill5181_0", 1f);
- num += (int)((float)(num * (300 - num101)) * 0.01f * residentFloat8 + 0.5f);
- }
- }
- }
- if (target.Bp == target.BpMax)
- {
- int num102 = 0;
- int num96;
- if (BattleUtility.GetOptimaAbilityValue(43, out num96))
- {
- num102 += num96;
- }
- int num103;
- if (owner.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1343, out num103))
- {
- num102 += num103;
- }
- if (num102 > 0)
- {
- num3 = (int)((float)num3 * (1f + (float)num102 / 100f) + 0.5f);
- }
- }
- }
- if (num > 0)
- {
- float num104 = (float)damageSourceElem.m0a3adefa2ef034c2e9556ec82f7fa3c6() / 100f;
- if (num104 != 0f)
- {
- float num105 = 0f;
- if (!isRandMinTest)
- {
- num105 = BattleDamage.GetRandomSingleFloat(owner.IsPlayer());
- }
- float num106 = num105 * 2f * num104 - num104;
- int num107 = (int)((float)num * num106);
- if (num107 == 0 && (num105 <= 0.3f || 0.7f <= num105))
- {
- if (num105 >= 0.5f)
- {
- num107 = 1;
- }
- else
- {
- num107 = -1;
- }
- }
- num += num107;
- if (num <= 0)
- {
- num = 1;
- }
- }
- }
- num32 = num;
- if (!flag8)
- {
- float num108 = (float)(100 - num40) * 0.01f;
- float num109 = (float)(100 - num41) * 0.01f;
- float num110 = (float)(100 - num42) * 0.01f;
- float num111 = (float)(100 - num43) * 0.01f;
- if (num108 > 1f)
- {
- num108 = 1f;
- }
- else if (target.IsPlayer())
- {
- if (num108 < 0.2f)
- {
- num108 = 0.2f;
- }
- }
- else if (num108 < 0f)
- {
- num108 = 0f;
- }
- float residentFloat9 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderRateMin", 0.3f);
- float residentFloat10 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderRateMax", 3f);
- if (num109 < residentFloat9)
- {
- num109 = residentFloat9;
- }
- else if (num109 > residentFloat10)
- {
- num109 = residentFloat10;
- }
- float residentFloat11 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderEnemyRateMin", 0f);
- float residentFloat12 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderEnemyRateMax", 3f);
- if (num110 < residentFloat11)
- {
- num110 = residentFloat11;
- }
- else if (num110 > residentFloat12)
- {
- num110 = residentFloat12;
- }
- float residentFloat13 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderElementRateMin", 0.3f);
- float residentFloat14 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderElementRateMax", 2f);
- if (num111 < residentFloat13)
- {
- num111 = residentFloat13;
- }
- else if (num111 > residentFloat14)
- {
- num111 = residentFloat14;
- }
- if (num38 < 0.3f)
- {
- num38 = 0.3f;
- }
- else if (num38 > 2f)
- {
- num38 = 2f;
- }
- float num112 = (float)(100 - BattleUtility.GetAutoAbilityEnemyResist(owner, target)) * 0.01f;
- float residentFloat15 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderEnemyTypeRateMin", 0.3f);
- float residentFloat16 = Mevius.DataSheet.Api.GetResidentFloat("damageDefenderEnemyTypeRateMax", 2f);
- if (num38 < residentFloat15)
- {
- num112 = residentFloat15;
- }
- else if (num38 > residentFloat16)
- {
- num112 = residentFloat16;
- }
- float num113 = 1f;
- if (target.IsPlayer())
- {
- int num114 = 0;
- int num115;
- if (BattleUtility.GetOptimaAbilityValue(64, out num115))
- {
- num114 += num115;
- }
- int num116;
- if (target.GetAutoAbilityParam(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1346, out num116))
- {
- num114 += num116;
- }
- if (num114 > 0)
- {
- int num117 = (1 + target.DamageCount) * num114;
- int residentInteger8 = Mevius.DataSheet.Api.GetResidentInteger("ff13RiseGuardMax", 50);
- if (num117 > residentInteger8)
- {
- num117 = residentInteger8;
- }
- num113 -= (float)num117 / 100f;
- }
- }
- num = (int)((float)num * num108 * num112 * num109 * num110 * num111 * num38 * num113 + 0.5f);
- }
- }
- if (num <= 0)
- {
- if (num32 != 0)
- {
- num = 1;
- }
- else
- {
- num = 0;
- }
- }
- if (owner.IsPlayer() && target.IsEnemy())
- {
- if (flag7)
- {
- damageInfo.scoreRate += Mevius.DataSheet.Api.GetResidentFloat("scoreWeaknessRate", 1.3f);
- }
- if (isCritical)
- {
- damageInfo.scoreRate += Mevius.DataSheet.Api.GetResidentFloat("scoreCriticalRate", 1.2f);
- }
- if (flag5)
- {
- damageInfo.scoreRate += Mevius.DataSheet.Api.GetResidentFloat("scoreBreakRate", 1.5f);
- }
- DbManager.JobCardInfo jobCardInfo = Mevius.Db.Api.GetJobCardInfoSlot(owner.Deck);
- if (jobCardInfo != null)
- {
- jobCardInfo = jobCardInfo.getAvatarJobCard(owner.Deck, null);
- uint num118 = jobCardInfo.CompleteSheetCount();
- if (num118 > 8u)
- {
- num118 = 8u;
- }
- damageInfo.scoreRate += num118 * Mevius.DataSheet.Api.GetResidentFloat("scoreSkillCompleteRate", 0.05f);
- }
- }
- if (owner.IsEnemy() && target.IsPlayer())
- {
- float num119 = Mevius.DataSheet.Api.GetResidentFloat("scoreResistRate", 1.2f) * BattleUtility.GetScoreRate();
- damageInfo.resistScore += (long)((float)(num32 - num) * num119 + 0.5f);
- }
- if (!flag2 && num > 9999 && !flag && owner.IsPlayer() && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() != 50 && (int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() != 1 && !owner.IsFlagBit((BattleActor.FlagBitType)10))
- {
- if (owner.NormalAttackNum > 0)
- {
- if (!owner.IsAutoAbility(DbManager.AutoAbilityType.AUTOABILITYTYPE_CS1331))
- {
- num = 9999;
- }
- }
- else if (!owner.IsUseCardAbilitySkill(DbManager.AbilitySkillType.ABILITYSKILL_TYPE_5151))
- {
- num = 9999;
- }
- }
- if (!flag3)
- {
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() != 50)
- {
- if (num > 999999)
- {
- num = 999999;
- }
- }
- else
- {
- int residentInteger9 = Mevius.DataSheet.Api.GetResidentInteger("padDamageLimit", 9999999);
- if (num > residentInteger9)
- {
- num = residentInteger9;
- }
- }
- if (num3 > 999999)
- {
- num3 = 999999;
- }
- }
- if ((int)damageSourceElem.m99d4196c8ddc2c84aa2a035182a3e754() == 1 || flag8)
- {
- num *= -1;
- num32 *= -1;
- }
- damageInfo.owner = owner;
- damageInfo.damage = num;
- damageInfo.breakDamage = num3;
- damageInfo.isCritical = isCritical;
- damageInfo.isWeakness = flag7;
- damageInfo.isResist = flag6;
- damageInfo.isBreak = flag5;
- damageInfo.isEnhance = isEnhance;
- damageInfo.isReduce = isReduce;
- damageInfo.isAbsorb = flag8;
- damageInfo.originalDamage = num32;
- damageInfo.powerType = (DamageSourcePowerType)damageSourceElem.ma32fcd1fe2598c2edcfa5cdbeb0eb64f();
- damageInfo.power = num5;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement