Beispiel #1
0
 private static ExtraEffectStatus.ExtraTargetType GetExtraTargetType(CharacterStateControl characterStateControl)
 {
     ExtraEffectStatus.ExtraTargetType result = ExtraEffectStatus.ExtraTargetType.Player;
     if (characterStateControl.isEnemy)
     {
         result = ExtraEffectStatus.ExtraTargetType.Enemy;
     }
     if (BattleStateManager.current != null && BattleStateManager.current.battleMode == BattleMode.PvP)
     {
         result = ExtraEffectStatus.ExtraTargetType.All;
     }
     return(result);
 }
Beispiel #2
0
    private static List <ExtraEffectStatus> GetMonsterIntegrationGroupList(List <ExtraEffectStatus> extraEffectStatusList, string[] monsterIntegrationIds, ExtraEffectStatus.ExtraTargetType targetType, EffectStatusBase.ExtraEffectType effectType)
    {
        List <ExtraEffectStatus> list  = new List <ExtraEffectStatus>();
        List <ExtraEffectStatus> list2 = new List <ExtraEffectStatus>();

        foreach (ExtraEffectStatus extraEffectStatus in extraEffectStatusList)
        {
            EffectStatusBase.ExtraTargetSubType targetSubType = (EffectStatusBase.ExtraTargetSubType)extraEffectStatus.TargetSubType;
            if (targetSubType == EffectStatusBase.ExtraTargetSubType.MonsterIntegrationGroup)
            {
                list2.Add(extraEffectStatus);
            }
        }
        while (list2.Count > 0)
        {
            ExtraEffectStatus        extraEffectStatus2 = list2[0];
            List <ExtraEffectStatus> list3 = new List <ExtraEffectStatus>();
            List <ExtraEffectStatus> list4 = new List <ExtraEffectStatus>();
            foreach (ExtraEffectStatus extraEffectStatus3 in list2)
            {
                if (extraEffectStatus3.TargetValue == extraEffectStatus2.TargetValue)
                {
                    list3.Add(extraEffectStatus3);
                }
                else
                {
                    list4.Add(extraEffectStatus3);
                }
            }
            string id   = extraEffectStatus2.TargetValue.ToString();
            bool   flag = monsterIntegrationIds.Where((string item) => item == id).Any <string>();
            if (flag)
            {
                List <ExtraEffectStatus> extraEffectStatusList2 = ExtraEffectStatus.GetExtraEffectStatusList(list3, targetType, EffectStatusBase.ExtraTargetSubType.MonsterIntegrationGroup, extraEffectStatus2.TargetValue, effectType);
                if (extraEffectStatusList2.Count > 0)
                {
                    list.AddRange(extraEffectStatusList2);
                }
            }
            list2 = list4;
        }
        return(list);
    }
Beispiel #3
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);
    }
Beispiel #4
0
    private static List <ExtraEffectStatus> GetExtraEffectStatusList(List <ExtraEffectStatus> extraEffectStatusList, ExtraEffectStatus.ExtraTargetType targetType, EffectStatusBase.ExtraTargetSubType targetSubType, int targetValue, EffectStatusBase.ExtraEffectType effectType)
    {
        List <ExtraEffectStatus> list = new List <ExtraEffectStatus>();

        if (extraEffectStatusList.Count == 0)
        {
            return(list);
        }
        Func <int, bool> searchEffectType = (int x) => x == (int)effectType;

        if (EffectStatusBase.ExtraEffectType.Atk <= effectType && effectType < EffectStatusBase.ExtraEffectType.AllStatus)
        {
            searchEffectType = ((int x) => x == (int)effectType || x == 27);
        }
        IEnumerable <ExtraEffectStatus> enumerable = extraEffectStatusList.Where((ExtraEffectStatus x) => (x.TargetType == (int)targetType || x.TargetType == 0) && x.TargetSubType == (int)targetSubType && x.TargetValue == targetValue && searchEffectType(x.EffectType));

        foreach (ExtraEffectStatus item in enumerable)
        {
            list.Add(item);
        }
        return(list);
    }
Beispiel #5
0
    private static float GetExtraEffectCorrectionValue(List <ExtraEffectStatus> extraEffectStatusList, float baseValue, string[] monsterIntegrationIds, string groupId, Tolerance tolerance, string tribe, GrowStep growStep, AffectEffectProperty skillPropety, HaveSufferState currentSufferState, ExtraEffectStatus.ExtraTargetType targetType, EffectStatusBase.ExtraEffectType effectType)
    {
        List <ExtraEffectStatus> totalExtraEffectStatusList = ExtraEffectStatus.GetTotalExtraEffectStatusList(extraEffectStatusList, monsterIntegrationIds, groupId, tolerance, tribe, growStep, skillPropety, currentSufferState, targetType, effectType);

        if (totalExtraEffectStatusList.Count > 0)
        {
            return(ExtraEffectStatus.GetCorrectionValue(baseValue, totalExtraEffectStatusList));
        }
        return(baseValue);
    }