Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Start of basic attack functions
- public ObscuredInt GetDamage(NewBattleBase Attacker, NewBattleBase Defender, int att_count, float SkillValue, ref int cri_cursor, ref int evade_cursor, bool IsCriticalableforSkill)
- {
- ObscuredBool bool1;
- ObscuredBool bool2;
- P3Character character1;
- ObscuredFloat float1;
- ObscuredFloat float2;
- ObscuredFloat float3;
- ObscuredFloat float4;
- ObscuredFloat float5;
- ObscuredFloat float6;
- ObscuredFloat float7;
- ObscuredInt int1;
- ObscuredInt int2;
- ObscuredInt int3;
- ObscuredInt int4;
- ObscuredInt int5;
- ObscuredInt int6;
- ObscuredInt int7;
- ObscuredInt int8;
- P3Monster monster1;
- int num1;
- int num2;
- int num3;
- int num4;
- int num5;
- long num6;
- DateTime time1;
- DateTime time2;
- DateTime time3;
- int1 = 0;
- bool1 = false;
- bool2 = false;
- int2 = Util.GetRandom(0, ((int)this.damage_random));
- (0F ? Attacker.Stat_Critical : ((ObscuredInt)ObscuredInt.op_Implicit(Attacker.Stat_Critical)))
- if (IsCriticalableforSkill)
- {
- num1 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.critical);
- num2 = P3GlobalDatas.cServerRandomMgr.GetData(eCursorType.critical, 1, 100);
- new object[4][0] = "P3GlobalDatas.cServerRandomMgr.GetData(Critical) : Skill ";
- new object[4][1] = SkillValue;
- new object[4][2] = " = ";
- new object[4][3] = num2;
- Debug.Log(string.Concat(new object[4]));
- bool1 = (num2 ? true : false);
- cri_cursor = num1;
- }
- goto Label_0110;
- num3 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.critical);
- num4 = P3GlobalDatas.cServerRandomMgr.GetData(eCursorType.critical, 1, 100);
- Debug.Log(("P3GlobalDatas.cServerRandomMgr.GetData(Critical) : " + num4));
- bool1 = (num4 ? true : false);
- cri_cursor = num3;
- Label_0110:
- if (bool1)
- {
- Attacker.IsDamagedCri = true;
- Defender.IsDamagedCri = true;
- goto Label_013C;
- }
- else
- {
- Attacker.IsDamagedCri = false;
- Defender.IsDamagedCri = false;
- Label_013C:
- }
- int3 = 0;
- int4 = 0;
- int5 = 0;
- if (Attacker.IsTypeCharacter())
- {
- character1 = ((P3Character)Attacker._P3Base);
- int3 = character1.iLevel;
- int4 = character1.tiCharacter.stat_index;
- int5 = this.GetGradeCorrection(((int)int4));
- goto Label_01C5;
- }
- else
- {
- monster1 = ((P3Monster)Attacker._P3Base);
- int3 = monster1.iLv;
- int4 = monster1.grade;
- int5 = this.GetGradeCorrection(((int)int4));
- Label_01C5:
- }
- if ((SkillValue > 0F))
- {
- bool2 = false;
- evade_cursor = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.evade);
- goto Label_02A1;
- }
- else
- {
- if (Defender.IshaveBuff(eSkillEffectType.FREEZE))
- {
- bool2 = false;
- evade_cursor = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.evade);
- goto Label_02A1;
- }
- else
- {
- int6 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.evade);
- int7 = P3GlobalDatas.cServerRandomMgr.GetData(eCursorType.evade, 1, 100);
- evade_cursor = int6;
- int8 = ((Defender.Stat_Evade - Attacker.Stat_Critical) + 10);
- if ((int8 <= int7))
- {
- bool2 = false;
- goto Label_028A;
- }
- else
- {
- bool2 = true;
- Label_028A:
- }
- if (!NewSkillManager.Instance.IsEvadeAvailable(Defender))
- {
- bool2 = false;
- Label_02A1:
- }
- }
- }
- if ((att_count < 2))
- {
- Attacker.IsMissedTarget = bool2;
- goto Label_02C5;
- }
- else
- {
- Attacker.IsMissedTarget2 = bool2;
- Label_02C5:
- }
- if (!bool2)
- {
- float1 = 0F;
- time1 = DateTime.Now;
- this.CheckSkillComboTimeOut(time1);
- num5 = this.SkillComboCount;
- if ((att_count < 2))
- {
- Attacker.LastNormalAttackTimeStamp = time1;
- goto Label_030F;
- }
- else
- {
- Attacker.LastNormalAttackTimeStamp2 = time1;
- Label_030F:
- }
- new string[5][0] = "Damage calc start time : ";
- time2 = Util.GetDateTimeNowByServer(time1);
- new string[5][1] = time2.ToString();
- new string[5][2] = "(";
- time3 = Util.GetDateTimeNowByServer(time1);
- num6 = time3.Ticks;
- new string[5][3] = num6.ToString();
- new string[5][4] = ")";
- Debug.Log(string.Concat(new string[5]));
- if ((SkillValue > 0F))
- {
- float1 = SkillValue;
- goto Label_0393;
- }
- else
- {
- float1 = ((float)Attacker.Stat_Attack);
- Label_0393:
- }
- float2 = ((float)Defender.Stat_Defense);
- float3 = (float1 / float2);
- float4 = 1F;
- float5 = 1F;
- if (Attacker.IsPlayer())
- {
- if ((P3GlobalDatas.BattleSceneType == cSceneType.ePVP))
- {
- float4 = (NewBattleManager.Instance.Element_rate(((int)Attacker.ElementType), ((int)Defender.ElementType)) + (Mathf.Max((num5 - 1F), 0F) * 0.02F));
- goto Label_045C;
- }
- else
- {
- float4 = (Attacker.ElementStatRate + (Mathf.Max((num5 - 1F), 0F) * 0.02F));
- Label_045C:
- }
- goto Label_0488;
- }
- else
- {
- float4 = NewBattleManager.Instance.Element_rate(((int)Attacker.ElementType), ((int)Defender.ElementType));
- Label_0488:
- }
- if (!P3GlobalDatas.UseFormation2)
- {
- float4 += Attacker.FormationStatRateForATT;
- goto Label_04C2;
- }
- else
- {
- float4 = 1F;
- Label_04C2:
- }
- if (Defender.IsPlayer())
- {
- if ((P3GlobalDatas.BattleSceneType == cSceneType.ePVP))
- {
- float5 = (NewBattleManager.Instance.Element_rate(((int)Defender.ElementType), ((int)Attacker.ElementType)) + (Mathf.Max((num5 - 1F), 0F) * 0.02F));
- goto Label_054A;
- }
- else
- {
- float5 = (Defender.ElementStatRate + (Mathf.Max((num5 - 1F), 0F) * 0.02F));
- Label_054A:
- }
- goto Label_0576;
- }
- else
- {
- float5 = NewBattleManager.Instance.Element_rate(((int)Defender.ElementType), ((int)Attacker.ElementType));
- Label_0576:
- }
- if (!P3GlobalDatas.UseFormation2)
- {
- float5 += Defender.FormationStatRateForDEF;
- goto Label_05B0;
- }
- else
- {
- float5 = 1F;
- Label_05B0:
- }
- Debug.Log((("Defender.ElementStatRate[" + Defender.ElementStatRate) + "]"));
- this.damage_basic = Attacker.GetDamageGrade();
- float6 = ((float3 * ((ObscuredFloat)this.damage_basic)) + int2);
- float6 *= (1F + ((int3 + int5) / this.damage_level_rate));
- if (bool1)
- {
- float6 *= ((ObscuredFloat)1.5F);
- }
- Debug.Log((("skillComboCount[" + num5) + "]"));
- Defender.IsElementDamaged = false;
- Defender.elementDamaged = 0;
- float6 = ((float6 * float4) - (((float6 * float4) * float5) - (float6 * float4)));
- new object[4][0] = (float6 * float4);
- new object[4][1] = (float6 * float4);
- new object[4][2] = float5;
- new object[4][3] = (float6 * float4);
- Debug.Log(string.Format("pre_damage = ({0})-(({1})*{2}-({3}))", new object[4]));
- if (Object.op_Implicit(Attacker))
- {
- if (Object.op_Implicit(Defender))
- {
- Debug.Log(((("Attacker name = " + Attacker.get_name()) + " Defender name") + Defender.get_name()));
- }
- }
- Debug.Log(("pre_damage = " + float6));
- if ((SkillValue <= 0F))
- {
- if (this._Attacker.IsPlayer())
- {
- float6 = NewBattleManager.Instance.m_UserSkill.GetUserSkillforDamageUP(((float)float6));
- }
- if ((P3GlobalDatas.BattleSceneType == cSceneType.ePVP))
- {
- if (this._Attacker.IsEnemy())
- {
- float6 = NewBattleManager.Instance.m_EnemyUserSkill.GetUserSkillforDamageUP(((float)float6));
- }
- if (Defender.IsEnemy())
- {
- float6 = NewBattleManager.Instance.m_EnemyUserSkill.GetUserSkillforDamageDown(((float)float6));
- }
- }
- if (Defender.IsPlayer())
- {
- float6 = NewBattleManager.Instance.m_UserSkill.GetUserSkillforDamageDown(((float)float6));
- }
- }
- if (P3GlobalDatas.bDamageBoosting)
- {
- float7 = (1F + (this.DamageBoosting * ((ObscuredInt)0.01F)));
- float6 *= float7;
- }
- int1 = Convert.ToInt32(Math.Truncate(((double)float6)));
- this.debug_damage_stat = float3;
- this.debug_damage_basic = ((float)this.damage_basic);
- this.debug_random = ((float)int2);
- this.debug_level_offset = (int3 + int5);
- this.debug_level_rate = ((float)this.damage_level_rate);
- this.debug_element_rate = float4;
- this.debug_result_damage = ((float)int1);
- goto Label_091B;
- }
- else
- {
- int1 = 0;
- this.debug_result_damage = ((float)int1);
- Label_091B:
- }
- return int1;
- }
- public float GetUserSkillforDamageUP(float fDamage)
- {
- float num1;
- float num2;
- num1 = 0F;
- num2 = 0F;
- num2 = this.GetValueForVariableType(eUserSkillForBattle.NORMAL_DAMAGE_UP, eSkillVariablesType.Rate);
- num1 = ((float)Convert.ToInt32(Math.Truncate((fDamage * (1F + (num2 / 100F))))));
- return num1;
- }
- public float GetUserSkillforDamageDown(float fDamage)
- {
- float num1;
- float num2;
- num1 = 0F;
- num2 = 0F;
- num2 = this.GetValueForVariableType(eUserSkillForBattle.NORMAL_DAMAGE_DOWN, eSkillVariablesType.Rate);
- num1 = ((float)Convert.ToInt32(Math.Truncate((fDamage * (1F - (num2 / 100F))))));
- return num1;
- }
- public float Element_rate(int element_type, int target_element)
- {
- bool bool1;
- bool1 = this.element_result.Get(element_type, target_element);
- if (bool1)
- {
- if ((P3GlobalDatas.BattleSceneType == cSceneType.eDungeon))
- {
- Debug.Log((("P3GlobalBattleDatas._puzzlelogic.tiDungeon.element_rate[" + P3GlobalBattleDatas._puzzlelogic.tiDungeon.element_rate) + "]"));
- return ((P3GlobalBattleDatas._puzzlelogic.tiDungeon.element_rate / 100F) + 1F);
- }
- if ((P3GlobalDatas.BattleSceneType == cSceneType.eSuperBoss))
- {
- return ((this.superboss_element_rate / ((ObscuredFloat)100F)) + 1F);
- }
- if ((P3GlobalDatas.BattleSceneType == cSceneType.ePVP))
- {
- return ((this.pvp_element_rate / ((ObscuredFloat)100F)) + 1F);
- }
- if ((P3GlobalDatas.BattleSceneType == cSceneType.eGiantBoss))
- {
- return ((this.pvp_element_rate / ((ObscuredFloat)100F)) + 1F);
- }
- if ((P3GlobalDatas.BattleSceneType == cSceneType.eWave))
- {
- return ((this.pvp_element_rate / ((ObscuredFloat)100F)) + 1F);
- }
- }
- return 1F;
- }
- ///endof basic attack functions
- ///start of skill attack functions
- public float GetUserSkillForSkillDamageRate(float fStat_Attack, float fRateA, eSkillScopeType SkillScope)
- {
- float num1;
- float num2;
- float num3;
- Debug.Log("GetUserSkillForSkillDamageRate");
- num1 = 0F;
- num2 = this.GetUserSkillForSkillDamageDownRate(SkillScope);
- num3 = (fRateA - num2);
- Debug.Log(("DownRate fUserSkillRate " + num2));
- Debug.Log(("fResultRate " + num3));
- Debug.Log(("fStat_Attack " + fStat_Attack));
- num1 = ((float)Convert.ToInt32(Math.Truncate((fStat_Attack * (num3 / 100F)))));
- Debug.Log(("fTotalDamage " + num1));
- return num1;
- }
- public float GetUserSkillForSkillDamage(bool IsPlayer, float fStat_Attack, float fRateA, eSkillScopeType SkillScope)
- {
- if (IsPlayer)
- {
- return this.m_UserSkill.GetUserSkillForSkillDamageRate(fStat_Attack, fRateA, SkillScope);
- }
- return this.m_EnemyUserSkill.GetUserSkillForSkillDamageRate(fStat_Attack, fRateA, SkillScope);
- }
- public override void execute()
- {
- NewBattleBase base1;
- NewBattleBase base2;
- bool bool1;
- bool bool2;
- sDamage damage1;
- sDamage damage2;
- sDamage damage3;
- sDamage damage4;
- ActionDamageInfo info1;
- ActionDamageInfo info2;
- float num1;
- int num10;
- int num11;
- int num2;
- int num3;
- int num4;
- int num5;
- int num6;
- int num7;
- int num8;
- int num9;
- num1 = 0F;
- num2 = 0;
- this._SkillData.ResultSkillVar_a = ((float)ObscuredInt.op_Implicit(this._goUser.Stat_Attack));
- this._goUser.preCalcDamage = this._SkillData.ResultSkillVar_a;
- bool1 = NewBattleManager.Instance.bIsSkillCritical;
- if ((this._SkillData.skillScopeType == eSkillScopeType.All))
- {
- base1 = null;
- num3 = 0;
- while ((num3 < this._Targets.get_Count()))
- {
- base1 = this._Targets.get_Item(num3);
- num4 = 0;
- num5 = 0;
- num6 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.double_attack);
- num7 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.added_skill);
- if (base1.IsPlayer())
- {
- num1 = NewBattleManager.Instance.GetUserSkillForSkillDamage(base1.IsPlayer(), ((float)this._goUser.Stat_Attack), this._SkillData.iSkillVariables_a, this._SkillData.skillScopeType);
- num2 = NewBattleManager.Instance.GetSkillDamage(this._goUser, base1, num1, ref &num4, ref &num5, bool1);
- goto Label_0197;
- }
- else
- {
- if ((P3GlobalDatas.BattleSceneType == cSceneType.ePVP))
- {
- if (base1.IsEnemy())
- {
- num1 = NewBattleManager.Instance.GetUserSkillForSkillDamage(base1.IsPlayer(), ((float)this._goUser.Stat_Attack), this._SkillData.iSkillVariables_a, this._SkillData.skillScopeType);
- num2 = NewBattleManager.Instance.GetSkillDamage(this._goUser, base1, num1, ref &num4, ref &num5, bool1);
- }
- goto Label_0197;
- }
- else
- {
- num2 = NewBattleManager.Instance.GetSkillDamage(this._goUser, base1, this._SkillData.ResultSkillVar_a, ref &num4, ref &num5, bool1);
- Label_0197:
- }
- }
- this._goUser.preCalcDamage = ((float)num2);
- base1.preCalcDamage = ((float)num2);
- damage1 = base.CreateDamage(((float)num2), this._SkillData, false, true, eHitActiontype._None);
- damage1.SetCursorInfo(num4, num5, num6, num7);
- info1 = new ActionDamageInfo(base1, this._goUser, damage1);
- if (!NewSkillManager.Instance.IsOnlyIgnoreDamage(base1))
- {
- if (NewSkillManager.Instance.IsSkillMissState(this._goUser))
- {
- }
- this._goUser.preCalcDamage = 0F;
- base1.preCalcDamage = 0F;
- damage2 = base.CreateDamage(0F, this._SkillData, true, true, eHitActiontype._None);
- damage2.SetCursorInfo(num4, num5, num6, num7);
- if (NewSkillManager.Instance.IsOnlyIgnoreDamage(base1))
- {
- damage2.fShieldDamage = ((float)num2);
- base1._PreCalShieldHP += ((ObscuredFloat)num2);
- }
- info1 = new ActionDamageInfo(base1, this._goUser, damage2);
- base1.AddSkillAction(eBattleActionType.MISSED, info1, ((bool)this._goUser.IsSkillChanceItem));
- goto Label_032D;
- }
- else
- {
- if ((base1.PreCalcHp <= ((float)Mathf.Abs(num2))))
- {
- base1.PreCalcHp = (base1.PreCalcHp + ((float)num2));
- base1.IsDeadReady = true;
- base1.AddSkillAction(eBattleActionType.DEATH, info1, ((bool)this._goUser.IsSkillChanceItem));
- goto Label_032D;
- }
- else
- {
- base1.PreCalcHp = (base1.PreCalcHp + ((float)num2));
- base1.AddSkillAction(eBattleActionType.DAMAGED, info1, ((bool)this._goUser.IsSkillChanceItem));
- Label_032D:
- }
- }
- if (!NewSkillManager.Instance.IsSkillMissState(this._goUser))
- {
- if (!NewSkillManager.Instance.IsOnlyIgnoreDamage(base1))
- {
- if ((Mathf.Abs(num2) > 0))
- {
- NewBattleManager.Instance.VampireSkillProcess(this._goUser, base1);
- }
- }
- }
- num3 += 1;
- Label_0375:
- }
- if (!NewSkillManager.Instance.IsSkillMissState(this._goUser))
- {
- base.DamageReflectProcess();
- }
- goto Label_070C;
- }
- else
- {
- base2 = this._goUser.GetSkillTarget();
- if (base2.IsDeadState())
- {
- return;
- }
- num8 = 0;
- num9 = 0;
- num10 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.double_attack);
- num11 = P3GlobalDatas.cServerRandomMgr.GetCurSor(eCursorType.added_skill);
- if (base2.IsPlayer())
- {
- num1 = NewBattleManager.Instance.GetUserSkillForSkillDamage(base2.IsPlayer(), ((float)this._goUser.Stat_Attack), this._SkillData.iSkillVariables_a, this._SkillData.skillScopeType);
- num2 = NewBattleManager.Instance.GetSkillDamage(this._goUser, base2, num1, ref &num8, ref &num9, bool1);
- goto Label_04EB;
- }
- else
- {
- if ((P3GlobalDatas.BattleSceneType == cSceneType.ePVP))
- {
- if (base2.IsEnemy())
- {
- num1 = NewBattleManager.Instance.GetUserSkillForSkillDamage(base2.IsPlayer(), ((float)this._goUser.Stat_Attack), this._SkillData.iSkillVariables_a, this._SkillData.skillScopeType);
- num2 = NewBattleManager.Instance.GetSkillDamage(this._goUser, base2, num1, ref &num8, ref &num9, bool1);
- }
- goto Label_04EB;
- }
- else
- {
- num2 = NewBattleManager.Instance.GetSkillDamage(this._goUser, base2, this._SkillData.ResultSkillVar_a, ref &num8, ref &num9, bool1);
- Label_04EB:
- }
- }
- this._goUser.preCalcDamage = ((float)num2);
- this._goUser.cursor_cri = num8;
- this._goUser.cursor_evd = num9;
- damage3 = base.CreateDamage(((float)num2), this._SkillData, false, true, this._goUser.HitActionType);
- damage3.SetCursorInfo(num8, num9, num10, num11);
- this._goUser.HitActionType = eHitActiontype._None;
- info2 = new ActionDamageInfo(base2, this._goUser, damage3, this._goUser.WeaponType);
- bool2 = false;
- if (!NewSkillManager.Instance.IsOnlyIgnoreDamage(base2))
- {
- if (NewSkillManager.Instance.IsSkillMissState(this._goUser))
- {
- }
- damage4 = base.CreateDamage(0F, this._SkillData, true, true, eHitActiontype._None);
- damage4.SetCursorInfo(num8, num9, num10, num11);
- if (NewSkillManager.Instance.IsOnlyIgnoreDamage(base2))
- {
- damage4.fShieldDamage = ((float)num2);
- base2._PreCalShieldHP += ((ObscuredFloat)num2);
- }
- info2 = new ActionDamageInfo(base2, this._goUser, damage4);
- base2.AddSkillAction(eBattleActionType.MISSED, info2, ((bool)this._goUser.IsSkillChanceItem));
- bool2 = true;
- goto Label_069C;
- }
- else
- {
- if ((base2.PreCalcHp <= ((float)Mathf.Abs(num2))))
- {
- base2.PreCalcHp = (base2.PreCalcHp + ((float)num2));
- base2.IsDeadReady = true;
- base2.AddSkillAction(eBattleActionType.DEATH, info2, ((bool)this._goUser.IsSkillChanceItem));
- goto Label_069C;
- }
- else
- {
- base2.PreCalcHp = (base2.PreCalcHp + ((float)num2));
- base2.AddSkillAction(eBattleActionType.DAMAGED, info2, ((bool)this._goUser.IsSkillChanceItem));
- Label_069C:
- }
- }
- if (!NewSkillManager.Instance.IsSkillMissState(this._goUser))
- {
- if (!NewSkillManager.Instance.IsOnlyIgnoreDamage(base2))
- {
- if ((Mathf.Abs(num2) > 0))
- {
- NewBattleManager.Instance.VampireSkillProcess(this._goUser, base2);
- if (!bool2)
- {
- NewBattleManager.Instance.ReflectSkillProcess(this._goUser, base2);
- }
- NewBattleManager.Instance.ShieldSkillProcess(this._goUser, base2, true);
- Label_070C:
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement