Пример #1
0
    private static List <ExtraEffectStatus> GetTotalExtraEffectStatusList(List <ExtraEffectStatus> extraEffectStatusList, string[] monsterIntegrationIds, string groupId, Tolerance tolerance, string tribe, GrowStep growStep, AffectEffectProperty skillPropety, HaveSufferState currentSufferState, ExtraEffectStatus.ExtraTargetType targetType, EffectStatusBase.ExtraEffectType effectType)
    {
        List <ExtraEffectStatus> list = new List <ExtraEffectStatus>();

        if (skillPropety != null)
        {
            bool flag = skillPropety.skillId.ToString() == BattleStateManager.PublicAttackSkillId;
            List <ExtraEffectStatus> list2 = new List <ExtraEffectStatus>();
            foreach (ExtraEffectStatus extraEffectStatus in extraEffectStatusList)
            {
                if (extraEffectStatus.TargetValue2 == "0")
                {
                    list2.Add(extraEffectStatus);
                }
                else if (extraEffectStatus.TargetValue2 == "1")
                {
                    if (flag)
                    {
                        list2.Add(extraEffectStatus);
                    }
                }
                else if (extraEffectStatus.TargetValue2 == "2" && !flag)
                {
                    list2.Add(extraEffectStatus);
                }
            }
            ConstValue.ResistanceType skillResistanceType = EffectStatusBase.GetSkillResistanceType(skillPropety);
            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, 0, effectType));
            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, (int)skillResistanceType, effectType));
            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillId, 0, effectType));
            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(list2, targetType, EffectStatusBase.ExtraTargetSubType.SkillId, skillPropety.skillId, effectType));
        }
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, 0, effectType));
        List <ConstValue.ResistanceType> attributeStrengthList = tolerance.GetAttributeStrengthList();

        foreach (ConstValue.ResistanceType targetValue in attributeStrengthList)
        {
            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, (int)targetValue, effectType));
        }
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, 0, effectType));
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, tribe.ToInt32(), effectType));
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, 0, effectType));
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, groupId.ToInt32(), effectType));
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, 0, effectType));
        list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, (int)growStep, effectType));
        if (currentSufferState != null)
        {
            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, 0, effectType));
            IEnumerator enumerator3 = Enum.GetValues(typeof(SufferStateProperty.SufferType)).GetEnumerator();
            try
            {
                while (enumerator3.MoveNext())
                {
                    object obj = enumerator3.Current;
                    SufferStateProperty.SufferType sufferType = (SufferStateProperty.SufferType)obj;
                    if (sufferType != SufferStateProperty.SufferType.Null)
                    {
                        if (currentSufferState.FindSufferState(sufferType))
                        {
                            list.AddRange(ExtraEffectStatus.GetExtraEffectStatusList(extraEffectStatusList, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, (int)sufferType, effectType));
                        }
                    }
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator3 as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
        }
        list.AddRange(ExtraEffectStatus.GetMonsterIntegrationGroupList(extraEffectStatusList, monsterIntegrationIds, targetType, effectType));
        return(list);
    }
    private static List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> GetTotalChipEffectStatusList(GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffects, bool isEnemy, string[] monsterIntegrationIds, string groupId, Tolerance tolerance, string tribe, GrowStep growStep, AffectEffectProperty skillPropety, HaveSufferState currentSufferState, ChipEffectStatus.TargetType targetType, EffectStatusBase.ExtraEffectType effectType)
    {
        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();

        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.Non, 0, isEnemy, effectType));
        if (skillPropety != null)
        {
            bool flag = skillPropety.skillId.ToString() == BattleStateManager.PublicAttackSkillId;
            List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list2 = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();
            foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffects)
            {
                if (chipEffect.targetValue2 == "0")
                {
                    list2.Add(chipEffect);
                }
                else if (chipEffect.targetValue2 == "1")
                {
                    if (flag)
                    {
                        list2.Add(chipEffect);
                    }
                }
                else if (chipEffect.targetValue2 == "2" && !flag)
                {
                    list2.Add(chipEffect);
                }
            }
            ConstValue.ResistanceType skillResistanceType = EffectStatusBase.GetSkillResistanceType(skillPropety);
            list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, 0, isEnemy, effectType));
            list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillAttribute, (int)skillResistanceType, isEnemy, effectType));
            list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillId, 0, isEnemy, effectType));
            list.AddRange(ChipEffectStatus.GetChipEffectList(list2.ToArray(), targetType, EffectStatusBase.ExtraTargetSubType.SkillId, skillPropety.skillId, isEnemy, effectType));
        }
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, 0, isEnemy, effectType));
        List <ConstValue.ResistanceType> attributeStrengthList = tolerance.GetAttributeStrengthList();

        foreach (ConstValue.ResistanceType targetValue in attributeStrengthList)
        {
            list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterResistance, (int)targetValue, isEnemy, effectType));
        }
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, 0, isEnemy, effectType));
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterTribe, tribe.ToInt32(), isEnemy, effectType));
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, 0, isEnemy, effectType));
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.MonsterGroup, groupId.ToInt32(), isEnemy, effectType));
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, 0, isEnemy, effectType));
        list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.GrowStep, (int)growStep, isEnemy, effectType));
        if (currentSufferState != null)
        {
            list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, 0, isEnemy, effectType));
            IEnumerator enumerator2 = Enum.GetValues(typeof(SufferStateProperty.SufferType)).GetEnumerator();
            try
            {
                while (enumerator2.MoveNext())
                {
                    object obj = enumerator2.Current;
                    SufferStateProperty.SufferType sufferType = (SufferStateProperty.SufferType)obj;
                    if (sufferType != SufferStateProperty.SufferType.Null)
                    {
                        if (currentSufferState.FindSufferState(sufferType))
                        {
                            list.AddRange(ChipEffectStatus.GetChipEffectList(chipEffects, targetType, EffectStatusBase.ExtraTargetSubType.Suffer, (int)sufferType, isEnemy, effectType));
                        }
                    }
                }
            }
            finally
            {
                IDisposable disposable;
                if ((disposable = (enumerator2 as IDisposable)) != null)
                {
                    disposable.Dispose();
                }
            }
        }
        list.AddRange(ChipEffectStatus.GetMonsterIntegrationGroupList(chipEffects, isEnemy, monsterIntegrationIds, targetType, effectType));
        return(list);
    }