public SufferStateProperty.DamageRateResult GetCaseDamageRate(AffectEffectProperty affectEffectProperty, CharacterStateControl characterStateControl)
    {
        SufferStateProperty.DamageRateResult damageRateResult = new SufferStateProperty.DamageRateResult();
        bool flag = affectEffectProperty.skillId.ToString() == BattleStateManager.PublicAttackSkillId;

        foreach (List <SufferStateProperty.Data> list in this.dataDictionary.Values)
        {
            foreach (SufferStateProperty.Data data in list)
            {
                if (data.isActive)
                {
                    if (data.recieveSkillType == 0 || (data.recieveSkillType == 1 && flag) || (data.recieveSkillType == 2 && !flag))
                    {
                        bool    flag2 = data.recieveSkillTargetSubType == 1;
                        bool    flag3 = data.recieveSkillTargetSubType == 2;
                        float[] array = new float[]
                        {
                            data.damagePercent,
                            data.damageRateForPhantomStudents,
                            data.damageRateForHeatHaze,
                            data.damageRateForGlacier,
                            data.damageRateForElectromagnetic,
                            data.damageRateForEarth,
                            data.damageRateForShaftOfLight,
                            data.damageRateForAbyss
                        };
                        int num = 0;
                        if (flag2)
                        {
                            num = (int)(affectEffectProperty.attribute + 1);
                        }
                        else if (flag3)
                        {
                            num = ((!(characterStateControl != null)) ? 0 : characterStateControl.characterDatas.tribe.ToInt32());
                        }
                        damageRateResult.damageRate += ((!affectEffectProperty.canUseAttribute) ? 0f : array[num]);
                        if (array[num] != 0f)
                        {
                            damageRateResult.dataList.Add(data);
                        }
                    }
                }
            }
        }
        return(damageRateResult);
    }
    private static SufferStateProperty.DamageRateResult GetReduceDamageRate(AffectEffectProperty affectEffectProperty, CharacterStateControl attackerCharacter, CharacterStateControl targetCharacter)
    {
        HaveSufferState currentSufferState = targetCharacter.currentSufferState;

        SufferStateProperty.DamageRateResult damageRateResult = new SufferStateProperty.DamageRateResult();
        damageRateResult.damageRate = 1f;
        if (affectEffectProperty.powerType == PowerType.Percentage && currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountGuard))
        {
            SufferStateProperty sufferStateProperty             = currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.CountGuard);
            SufferStateProperty.DamageRateResult caseDamageRate = sufferStateProperty.GetCaseDamageRate(affectEffectProperty, attackerCharacter);
            if (BattleStateManager.current.battleStateData.IsChipSkill())
            {
                CharacterStateControl autoCounterCharacter = BattleStateManager.current.battleStateData.GetAutoCounterCharacter();
                if (autoCounterCharacter.chipSkillId == SkillStatus.COUNTER_ATTACK_SKILL_ID)
                {
                    caseDamageRate.damageRate = 0f;
                }
            }
            float damageRate = Mathf.Max(1f - caseDamageRate.damageRate, 0f);
            damageRateResult.damageRate = damageRate;
            damageRateResult.dataList.AddRange(caseDamageRate.dataList);
        }
        return(damageRateResult);
    }
    public static SkillResults GetStageDamageSkillResult(AffectEffectProperty affectEffectProperty, CharacterStateControl attackerCharacter, CharacterStateControl targetCharacter)
    {
        SkillResults skillResults = new SkillResults();

        skillResults.useAffectEffectProperty = affectEffectProperty;
        skillResults.hitIconAffectEffect     = AffectEffect.Damage;
        skillResults.attackCharacter         = null;
        skillResults.targetCharacter         = targetCharacter;
        skillResults.onMissHit = !affectEffectProperty.OnHit(attackerCharacter, targetCharacter);
        skillResults.onWeakHit = targetCharacter.tolerance.GetAttributeStrength(affectEffectProperty.attribute);
        if (skillResults.onMissHit)
        {
            return(skillResults);
        }
        if (affectEffectProperty.powerType == PowerType.Percentage && skillResults.onWeakHit == Strength.Invalid)
        {
            skillResults.hitIconAffectEffect = AffectEffect.Invalid;
        }
        else if (targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.TurnBarrier))
        {
            skillResults.hitIconAffectEffect = AffectEffect.TurnBarrier;
        }
        else if (targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountBarrier))
        {
            skillResults.hitIconAffectEffect = AffectEffect.CountBarrier;
        }
        else if (targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.TurnEvasion))
        {
            skillResults.hitIconAffectEffect = AffectEffect.TurnEvasion;
        }
        else if (targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountEvasion))
        {
            skillResults.hitIconAffectEffect = AffectEffect.CountEvasion;
        }
        else
        {
            int num;
            if (affectEffectProperty.powerType == PowerType.Fixable)
            {
                num = affectEffectProperty.damagePower;
                skillResults.onWeakHit = Strength.None;
            }
            else
            {
                SufferStateProperty.DamageRateResult reduceDamageRate = SkillStatus.GetReduceDamageRate(affectEffectProperty, attackerCharacter, targetCharacter);
                skillResults.damageRateResult = reduceDamageRate;
                float attributeDamegeResult = SkillStatus.GetAttributeDamegeResult(skillResults.onWeakHit);
                num = (int)(affectEffectProperty.damagePercent * (float)targetCharacter.hp * reduceDamageRate.damageRate * attributeDamegeResult);
            }
            if (skillResults.onWeakHit != Strength.Drain)
            {
                targetCharacter.hp -= num;
            }
            else
            {
                targetCharacter.hp += num;
            }
            skillResults.attackPower         = num;
            skillResults.originalAttackPower = num;
        }
        return(skillResults);
    }
    public static SkillResults GetSkillResults(AffectEffectProperty affectEffectProperty, CharacterStateControl attackerCharacter, CharacterStateControl targetCharacter, bool onRandomAttack = true, int attackNum = 0)
    {
        SkillResults      skillResults        = new SkillResults();
        LeaderSkillResult leaderSkillResult   = attackerCharacter.leaderSkillResult;
        HaveSufferState   currentSufferState  = attackerCharacter.currentSufferState;
        HaveSufferState   currentSufferState2 = targetCharacter.currentSufferState;

        float[] array = new float[2];
        skillResults.useAffectEffectProperty = affectEffectProperty;
        skillResults.hitIconAffectEffect     = AffectEffect.Damage;
        skillResults.attackCharacter         = attackerCharacter;
        skillResults.targetCharacter         = targetCharacter;
        if (targetCharacter.isDied)
        {
            return(skillResults);
        }
        skillResults.onWeakHit = ((!affectEffectProperty.canUseAttribute) ? Strength.None : targetCharacter.tolerance.GetAttributeStrength(affectEffectProperty.attribute));
        if (attackerCharacter.hittingTheTargetType == BattleInvariant.Type.Non)
        {
            skillResults.onMissHit = !affectEffectProperty.OnHit(attackerCharacter, targetCharacter);
        }
        else if (attackerCharacter.hittingTheTargetType == BattleInvariant.Type.Up)
        {
            skillResults.onMissHit = false;
        }
        else if (attackerCharacter.hittingTheTargetType == BattleInvariant.Type.Down)
        {
            skillResults.onMissHit = true;
        }
        if (skillResults.onWeakHit == Strength.None || skillResults.onWeakHit == Strength.Weak)
        {
            if (attackerCharacter.criticalTheTargetType == BattleInvariant.Type.Non)
            {
                float num = affectEffectProperty.satisfactionRate;
                SufferStateProperty sufferStateProperty = currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.SatisfactionRateUp);
                if (sufferStateProperty.isActive)
                {
                    num += sufferStateProperty.upPercent;
                }
                SufferStateProperty sufferStateProperty2 = currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.SatisfactionRateDown);
                if (sufferStateProperty2.isActive)
                {
                    num -= sufferStateProperty2.downPercent;
                }
                if (attackerCharacter.isSelectSkill > 0)
                {
                    num += leaderSkillResult.satisfactionRateUpPercent;
                }
                num += attackerCharacter.chipAddCritical;
                skillResults.onCriticalHit = RandomExtension.Switch(num);
            }
            else if (attackerCharacter.criticalTheTargetType == BattleInvariant.Type.Up)
            {
                skillResults.onCriticalHit = true;
            }
            else if (attackerCharacter.criticalTheTargetType == BattleInvariant.Type.Down)
            {
                skillResults.onCriticalHit = false;
            }
        }
        if (!skillResults.onMissHit)
        {
            if (affectEffectProperty.powerType == PowerType.Percentage && skillResults.onWeakHit == Strength.Invalid)
            {
                skillResults.hitIconAffectEffect = AffectEffect.Invalid;
                skillResults.onMissHit           = false;
                skillResults.onWeakHit           = Strength.Invalid;
                skillResults.onCriticalHit       = false;
            }
            else if (skillResults.targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.TurnBarrier))
            {
                skillResults.hitIconAffectEffect = AffectEffect.TurnBarrier;
                skillResults.onMissHit           = false;
                skillResults.onWeakHit           = Strength.None;
                skillResults.onCriticalHit       = false;
            }
            else if (skillResults.targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountBarrier))
            {
                skillResults.hitIconAffectEffect = AffectEffect.CountBarrier;
                skillResults.onMissHit           = false;
                skillResults.onWeakHit           = Strength.None;
                skillResults.onCriticalHit       = false;
            }
            else if (skillResults.targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.TurnEvasion))
            {
                skillResults.hitIconAffectEffect = AffectEffect.TurnEvasion;
                skillResults.onMissHit           = false;
                skillResults.onWeakHit           = Strength.None;
                skillResults.onCriticalHit       = false;
            }
            else if (skillResults.targetCharacter.currentSufferState.FindSufferState(SufferStateProperty.SufferType.CountEvasion))
            {
                skillResults.hitIconAffectEffect = AffectEffect.CountEvasion;
                skillResults.onMissHit           = false;
                skillResults.onWeakHit           = Strength.None;
                skillResults.onCriticalHit       = false;
            }
            else if (affectEffectProperty.type == AffectEffect.ReferenceTargetHpRate)
            {
                SufferStateProperty.DamageRateResult reduceDamageRate = SkillStatus.GetReduceDamageRate(affectEffectProperty, attackerCharacter, targetCharacter);
                skillResults.damageRateResult = reduceDamageRate;
                float attributeDamegeResult = SkillStatus.GetAttributeDamegeResult(skillResults.onWeakHit);
                float num2 = 1f;
                if (skillResults.onCriticalHit)
                {
                    num2 = 1.2f;
                }
                int num3 = (int)(affectEffectProperty.damagePercent * (float)targetCharacter.hp);
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = (float)num3 * attributeDamegeResult * num2 * reduceDamageRate.damageRate;
                }
            }
            else if (affectEffectProperty.type == AffectEffect.RefHpRateNonAttribute)
            {
                SufferStateProperty.DamageRateResult reduceDamageRate2 = SkillStatus.GetReduceDamageRate(affectEffectProperty, attackerCharacter, targetCharacter);
                skillResults.damageRateResult = reduceDamageRate2;
                float num4 = 1f;
                if (skillResults.onCriticalHit)
                {
                    num4 = 1.2f;
                }
                int num5 = (int)(affectEffectProperty.damagePercent * (float)targetCharacter.hp);
                for (int j = 0; j < array.Length; j++)
                {
                    array[j] = (float)num5 * num4 * reduceDamageRate2.damageRate;
                }
            }
            else if (affectEffectProperty.powerType == PowerType.Percentage)
            {
                bool  flag = affectEffectProperty.techniqueType == TechniqueType.Physics;
                float attributeDamegeResult2 = SkillStatus.GetAttributeDamegeResult(skillResults.onWeakHit);
                float num6 = 1f;
                if (skillResults.onCriticalHit)
                {
                    num6 = 1.2f;
                }
                float num7 = 1f;
                if (onRandomAttack)
                {
                    num7 = UnityEngine.Random.Range(0.85f, 1f);
                }
                SufferStateProperty.DamageRateResult reduceDamageRate3 = SkillStatus.GetReduceDamageRate(affectEffectProperty, attackerCharacter, targetCharacter);
                skillResults.damageRateResult = reduceDamageRate3;
                float num8 = 1f;
                if (flag)
                {
                    SufferStateProperty sufferStateProperty3 = targetCharacter.currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.Counter);
                    if (sufferStateProperty3.isActive)
                    {
                        num8 *= sufferStateProperty3.recieveDamageRate;
                    }
                }
                else
                {
                    SufferStateProperty sufferStateProperty4 = targetCharacter.currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.Reflection);
                    if (sufferStateProperty4.isActive)
                    {
                        num8 *= sufferStateProperty4.recieveDamageRate;
                    }
                }
                float num9 = 1f;
                SufferStateProperty sufferStateProperty5 = currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.PowerCharge);
                if (sufferStateProperty5.isActive)
                {
                    if (flag)
                    {
                        num9 *= sufferStateProperty5.physicUpPercent;
                    }
                    else
                    {
                        num9 *= sufferStateProperty5.specialUpPercent;
                    }
                }
                float num10 = 1f;
                float num11 = 0f;
                float num12 = 0f;
                SufferStateProperty sufferStateProperty6 = currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.DamageRateUp);
                if (sufferStateProperty6.isActive)
                {
                    SufferStateProperty.DamageRateResult caseDamageRate = sufferStateProperty6.GetCaseDamageRate(affectEffectProperty, targetCharacter);
                    num11 += caseDamageRate.damageRate;
                }
                SufferStateProperty sufferStateProperty7 = currentSufferState.GetSufferStateProperty(SufferStateProperty.SufferType.DamageRateDown);
                if (sufferStateProperty7.isActive)
                {
                    SufferStateProperty.DamageRateResult caseDamageRate2 = sufferStateProperty7.GetCaseDamageRate(affectEffectProperty, targetCharacter);
                    num12 += caseDamageRate2.damageRate;
                }
                num10 = Mathf.Max(0f, num10 + num11 - num12);
                for (int k = 0; k < array.Length; k++)
                {
                    int   num13 = 0;
                    float num14 = 1f;
                    foreach (int num15 in attackerCharacter.potencyChipIdList.Keys)
                    {
                        GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffectDataToId = ChipDataMng.GetChipEffectDataToId(num15.ToString());
                        if (k != 0 || chipEffectDataToId.effectTrigger.ToInt32() != 11)
                        {
                            GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffects = new GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[]
                            {
                                chipEffectDataToId
                            };
                            num13 += ChipEffectStatus.GetSkillPowerCorrectionValue(chipEffects, affectEffectProperty, attackerCharacter, attackNum);
                            num14 += ChipEffectStatus.GetSkillDamageCorrectionValue(chipEffects, affectEffectProperty, attackerCharacter);
                        }
                    }
                    float num16 = 1f;
                    foreach (int num17 in targetCharacter.potencyChipIdList.Keys)
                    {
                        GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffectDataToId2 = ChipDataMng.GetChipEffectDataToId(num17.ToString());
                        if (k != 0 || chipEffectDataToId2.effectTrigger.ToInt32() != 11)
                        {
                            GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffects2 = new GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[]
                            {
                                chipEffectDataToId2
                            };
                            num16 += ChipEffectStatus.GetSkillDamageCorrectionValue(chipEffects2, affectEffectProperty, targetCharacter);
                        }
                    }
                    float num18 = 0f;
                    float num19 = 0f;
                    SkillStatus.CalculationBasePower(ref num18, ref num19, flag, k == 0, attackerCharacter, targetCharacter);
                    int num20;
                    if (k == 0)
                    {
                        num20 = affectEffectProperty.GetPower(attackerCharacter);
                    }
                    else
                    {
                        List <ExtraEffectStatus> extraEffectStatus = BattleStateManager.current.battleStateData.extraEffectStatus;
                        List <ExtraEffectStatus> invocationList    = ExtraEffectStatus.GetInvocationList(extraEffectStatus, EffectStatusBase.EffectTriggerType.Usually);
                        num20 = ExtraEffectStatus.GetSkillPowerCorrectionValue(invocationList, affectEffectProperty, attackerCharacter);
                    }
                    if (affectEffectProperty.type == AffectEffect.DefenseThroughDamage || affectEffectProperty.type == AffectEffect.SpDefenseThroughDamage)
                    {
                        num19 = (float)affectEffectProperty.DefenseThrough;
                    }
                    if (num18 <= 0f)
                    {
                        array[k] = 0f;
                    }
                    else
                    {
                        num18 = Mathf.Max(num18, 0f);
                        num19 = Mathf.Max(num19, 1f);
                        float num21 = (float)attackerCharacter.level * 0.01f + 1f;
                        float num22 = (float)(num20 + num13) * (1f + leaderSkillResult.damageUpPercent);
                        float num23 = num21 * num22 * num18 * num9 / num19 + 2f;
                        float num24 = num14 * num16 * reduceDamageRate3.damageRate * num8 * num7 * num6 * attributeDamegeResult2 * num10;
                        array[k] = num23 * num24;
                    }
                }
            }
            else if (affectEffectProperty.powerType == PowerType.Fixable)
            {
                for (int l = 0; l < array.Length; l++)
                {
                    array[l] = (float)affectEffectProperty.damagePower;
                }
                skillResults.onWeakHit = Strength.None;
            }
        }
        skillResults.originalAttackPower = Mathf.FloorToInt(array[0]);
        skillResults.attackPower         = Mathf.FloorToInt(array[1]);
        if (skillResults.hitIconAffectEffect == AffectEffect.Damage && skillResults.attackPower <= 0)
        {
            skillResults.onMissHit     = true;
            skillResults.onCriticalHit = false;
        }
        if (skillResults.onWeakHit != Strength.Drain)
        {
            targetCharacter.hp -= skillResults.attackPower;
        }
        else
        {
            targetCharacter.hp += skillResults.attackPower;
        }
        if (skillResults.attackPower < skillResults.originalAttackPower)
        {
            skillResults.extraEffectType = ExtraEffectType.Down;
        }
        else if (skillResults.attackPower > skillResults.originalAttackPower)
        {
            skillResults.extraEffectType = ExtraEffectType.Up;
        }
        else
        {
            skillResults.extraEffectType = ExtraEffectType.Non;
        }
        return(skillResults);
    }