public static bool IsExtraEffectMonster(MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray)
    {
        if (MonsterGrowStepData.IsGardenDigimonScope(monsterData.monsterMG.growStep))
        {
            return(false);
        }
        int areaId = ExtraEffectUtil.GetAreaId();

        foreach (int num in monsterData.GetChipEquip().GetChipIdList())
        {
            GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num.ToString());
            if (chipEffectData != null)
            {
                GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] invocationList = ChipEffectStatus.GetInvocationList(chipEffectData, EffectStatusBase.EffectTriggerType.Area, monsterData.monsterM.monsterGroupId.ToInt32(), null, areaId);
                if (invocationList.Length > 0)
                {
                    return(true);
                }
            }
        }
        GameWebAPI.RespDataMA_EventPointBonusM.EventPointBonus[] eventPointBonuses = ExtraEffectUtil.GetEventPointBonuses(ExtraEffectUtil.GetDungeonId().ToString());
        foreach (GameWebAPI.RespDataMA_EventPointBonusM.EventPointBonus eventPointBonus in eventPointBonuses)
        {
            bool flag = ExtraEffectUtil.CheckExtraParams(monsterData, eventPointBonus);
            if (flag)
            {
                return(true);
            }
        }
        return(ExtraEffectUtil.CheckExtraStageParams(monsterData, effectArray));
    }
    private static bool CheckStageEffectInvalid(CharacterStateControl chipTarget, ExtraEffectStatus extraEffectStatus)
    {
        BattleStateManager current = BattleStateManager.current;

        CharacterStateControl[] totalCharacters = current.battleStateData.GetTotalCharacters();
        foreach (CharacterStateControl characterStateControl in totalCharacters)
        {
            if (!(characterStateControl == null))
            {
                ChipEffectStatus.TargetType targetType = ChipEffectStatus.GetTargetType(characterStateControl, chipTarget);
                foreach (int num in characterStateControl.chipIds)
                {
                    GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] array2 = ChipDataMng.GetChipEffectData(num.ToString());
                    array2 = ChipEffectStatus.GetStageEffectInvalidList(BattleStateManager.current.hierarchyData.areaId, array2, extraEffectStatus).ToArray();
                    if (array2.Length > 0)
                    {
                        List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> totalChipEffectStatusList = ChipEffectStatus.GetTotalChipEffectStatusList(array2, chipTarget.isEnemy, chipTarget.characterStatus.monsterIntegrationIds, chipTarget.groupId, chipTarget.tolerance, chipTarget.characterDatas.tribe, chipTarget.characterDatas.growStep, null, null, targetType, EffectStatusBase.ExtraEffectType.StageEffextInvalid);
                        if (totalChipEffectStatusList.Count > 0)
                        {
                            return(true);
                        }
                    }
                }
            }
        }
        return(false);
    }
Example #3
0
 private void InitChipEffectCount(string value)
 {
     foreach (int num in this.characterStateControl.chipIds)
     {
         GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num.ToString());
         foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffectData)
         {
             if (chipEffect.effectTurnType == value && this.chipEffectCount.ContainsKey(chipEffect.chipEffectId.ToInt32()))
             {
                 this.chipEffectCount[chipEffect.chipEffectId.ToInt32()] = chipEffect.effectTurn.ToInt32();
             }
         }
     }
 }
Example #4
0
 private void InitializeChipEffectCount()
 {
     foreach (int num in this.characterStateControl.characterStatus.chipIds)
     {
         GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num.ToString());
         if (chipEffectData != null)
         {
             foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffectData)
             {
                 if (chipEffect.effectTurn.ToInt32() > 0)
                 {
                     this.chipEffectCount[chipEffect.chipEffectId.ToInt32()] = chipEffect.effectTurn.ToInt32();
                 }
             }
         }
     }
 }
Example #5
0
 private List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> GetChipTriggerList(EffectStatusBase.EffectTriggerType triggerType)
 {
     if (!this.triggerChips.ContainsKey(triggerType))
     {
         List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> list = new List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect>();
         foreach (int num in this.characterStateControl.characterStatus.chipIds)
         {
             GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num.ToString());
             if (chipEffectData != null)
             {
                 foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffectData)
                 {
                     if (chipEffect.effectTrigger.ToInt32() == (int)triggerType)
                     {
                         list.Add(chipEffect);
                     }
                 }
             }
         }
         this.triggerChips.Add(triggerType, list);
     }
     return(this.triggerChips[triggerType]);
 }
    private static int GetExtraChipValue(MonsterData monsterData, EffectStatusBase.ExtraEffectType effectType)
    {
        float num    = 0f;
        int   areaId = ExtraEffectUtil.GetAreaId();

        GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(monsterData.monsterM.monsterGroupId).Group;
        foreach (int num2 in monsterData.GetChipEquip().GetChipIdList())
        {
            GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(num2.ToString());
            if (chipEffectData != null)
            {
                GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] invocationList = ChipEffectStatus.GetInvocationList(chipEffectData, EffectStatusBase.EffectTriggerType.Area, monsterData.monsterM.monsterGroupId.ToInt32(), null, areaId);
                int num3 = 0;
                EffectStatusBase.ExtraEffectType effectType2 = EffectStatusBase.ExtraEffectType.Non;
                switch (effectType)
                {
                case EffectStatusBase.ExtraEffectType.Atk:
                    num3        = monsterData.userMonster.attack.ToInt32();
                    effectType2 = EffectStatusBase.ExtraEffectType.Atk;
                    break;

                case EffectStatusBase.ExtraEffectType.Def:
                    num3        = monsterData.userMonster.defense.ToInt32();
                    effectType2 = EffectStatusBase.ExtraEffectType.Def;
                    break;

                case EffectStatusBase.ExtraEffectType.Hp:
                    num3        = monsterData.userMonster.hp.ToInt32();
                    effectType2 = EffectStatusBase.ExtraEffectType.Hp;
                    break;

                case EffectStatusBase.ExtraEffectType.Speed:
                    num3        = monsterData.userMonster.speed.ToInt32();
                    effectType2 = EffectStatusBase.ExtraEffectType.Speed;
                    break;

                case EffectStatusBase.ExtraEffectType.Satk:
                    num3        = monsterData.userMonster.spAttack.ToInt32();
                    effectType2 = EffectStatusBase.ExtraEffectType.Satk;
                    break;

                case EffectStatusBase.ExtraEffectType.Sdef:
                    num3        = monsterData.userMonster.spDefense.ToInt32();
                    effectType2 = EffectStatusBase.ExtraEffectType.Sdef;
                    break;

                default:
                    if (effectType == EffectStatusBase.ExtraEffectType.SkillPower || effectType == EffectStatusBase.ExtraEffectType.SkillHit)
                    {
                        num3        = 0;
                        effectType2 = EffectStatusBase.ExtraEffectType.Non;
                    }
                    break;
                }
                GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster responseMonsterIntegrationGroupMaster = MasterDataMng.Instance().ResponseMonsterIntegrationGroupMaster;
                GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup[] source      = responseMonsterIntegrationGroupMaster.monsterIntegrationGroupM.Where((GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup item) => item.monsterId == monsterData.monsterM.monsterId).ToArray <GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup>();
                string[] monsterIntegrationIds = source.Select((GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup item) => item.monsterIntegrationId).ToArray <string>();
                num += ChipEffectStatus.GetChipEffectValueToFloat(invocationList, (float)num3, false, monsterIntegrationIds, monsterData.monsterM.monsterGroupId, ExtraEffectUtil.ResistanceToTolerance(monsterData), group.tribe, MonsterGrowStepData.ToGrowStep(group.growStep), null, null, ChipEffectStatus.TargetType.Actor, effectType2, 0);
            }
        }
        return(Mathf.FloorToInt(num));
    }
Example #7
0
    private static GameWebAPI.RespDataCS_ChipListLogic.UserChipList[] GetRefineSortList(GameWebAPI.RespDataCS_ChipListLogic.UserChipList[] userChipList, CMD_ChipSortModal.Data sortData)
    {
        List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list = new List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>();

        if (userChipList == null)
        {
            return(list.ToArray());
        }
        int num = 0;

        foreach (CMD_ChipSortModal.RefineType refineType in CMD_ChipSortModal.tribeRefineTypes)
        {
            if ((sortData.refineTypeList & (int)refineType) > 0)
            {
                num++;
            }
        }
        bool flag           = CMD_ChipSortModal.tribeRefineTypes.Length == num || num == 0;
        int  refineTypeList = sortData.refineTypeList;

        foreach (GameWebAPI.RespDataCS_ChipListLogic.UserChipList userChipList2 in userChipList)
        {
            GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(userChipList2);
            GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] chipEffectData = ChipDataMng.GetChipEffectData(userChipList2);
            int    num2 = 0;
            string rank = chipMainData.rank;
            switch (rank)
            {
            case "1":
                num2 |= 1;
                break;

            case "2":
                num2 |= 2;
                break;

            case "3":
                num2 |= 4;
                break;

            case "4":
                num2 |= 8;
                break;

            case "5":
                num2 |= 16;
                break;

            case "6":
                num2 |= 32;
                break;

            case "7":
                num2 |= 64;
                break;

            case "8":
                num2 |= 128;
                break;

            case "9":
                num2 |= 256;
                break;

            case "10":
                num2 |= 512;
                break;
            }
            bool flag2 = (refineTypeList & num2) > 0;
            int  num4  = 0;
            foreach (GameWebAPI.RespDataMA_ChipEffectM.ChipEffect chipEffect in chipEffectData)
            {
                if (chipEffect.targetSubType == "2")
                {
                    string targetValue = chipEffect.targetValue;
                    switch (targetValue)
                    {
                    case "1":
                        num4 |= 65536;
                        break;

                    case "2":
                        num4 |= 1024;
                        break;

                    case "3":
                        num4 |= 32768;
                        break;

                    case "4":
                        num4 |= 16384;
                        break;

                    case "5":
                        num4 |= 2048;
                        break;

                    case "6":
                        num4 |= 4096;
                        break;

                    case "7":
                        num4 |= 8192;
                        break;
                    }
                }
            }
            bool flag3 = (refineTypeList & num4) > 0;
            if (num4 == 0 && flag)
            {
                flag3 = true;
            }
            if (flag2 && flag3)
            {
                list.Add(userChipList2);
            }
        }
        if (sortData.sortType == CMD_ChipSortModal.SortType.Time)
        {
            if (sortData.isOrderByAsc)
            {
                List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list2 = list;
                if (CMD_ChipSortModal.< > f__mg$cache0 == null)
                {
                    CMD_ChipSortModal.< > f__mg$cache0 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerTimeOrderByAsc);
                }
                list2.Sort(CMD_ChipSortModal.< > f__mg$cache0);
            }
            else
            {
                List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list3 = list;
                if (CMD_ChipSortModal.< > f__mg$cache1 == null)
                {
                    CMD_ChipSortModal.< > f__mg$cache1 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerTimeOrderByDesc);
                }
                list3.Sort(CMD_ChipSortModal.< > f__mg$cache1);
            }
        }
        else if (sortData.sortType == CMD_ChipSortModal.SortType.Rarity)
        {
            if (sortData.isOrderByAsc)
            {
                List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list4 = list;
                if (CMD_ChipSortModal.< > f__mg$cache2 == null)
                {
                    CMD_ChipSortModal.< > f__mg$cache2 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerRarityOrderByAsc);
                }
                list4.Sort(CMD_ChipSortModal.< > f__mg$cache2);
            }
            else
            {
                List <GameWebAPI.RespDataCS_ChipListLogic.UserChipList> list5 = list;
                if (CMD_ChipSortModal.< > f__mg$cache3 == null)
                {
                    CMD_ChipSortModal.< > f__mg$cache3 = new Comparison <GameWebAPI.RespDataCS_ChipListLogic.UserChipList>(CMD_ChipSortModal.ComparerRarityOrderByDesc);
                }
                list5.Sort(CMD_ChipSortModal.< > f__mg$cache3);
            }
        }
        return(list.ToArray());
    }
    public static List <ExtraEffectStatus> CheckStageEffectInvalid(int areaId, List <ExtraEffectStatus> extraEffectStatusList, MonsterData[] chipPlayers, MonsterData[] chipEnemys, MonsterData chipTarget)
    {
        List <ExtraEffectStatus> list = new List <ExtraEffectStatus>();
        bool flag = chipEnemys.Where((MonsterData item) => item.userMonster.userMonsterId == chipTarget.userMonster.userMonsterId).Any <MonsterData>();

        GameWebAPI.RespDataMA_GetMonsterMG.MonsterM         group = MonsterMaster.GetMonsterMasterByMonsterGroupId(chipTarget.monsterM.monsterGroupId).Group;
        GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster responseMonsterIntegrationGroupMaster = MasterDataMng.Instance().ResponseMonsterIntegrationGroupMaster;
        GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup[] source      = responseMonsterIntegrationGroupMaster.monsterIntegrationGroupM.Where((GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup item) => item.monsterId == chipTarget.monsterM.monsterId).ToArray <GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup>();
        string[] monsterIntegrationIds = source.Select((GameWebAPI.RespDataMA_MonsterIntegrationGroupMaster.MonsterIntegrationGroup item) => item.monsterIntegrationId).ToArray <string>();
        GameWebAPI.RespDataMA_GetMonsterResistanceM.MonsterResistanceM        resistanceMaster     = MonsterResistanceData.GetResistanceMaster(chipTarget.monsterM.resistanceId);
        List <GameWebAPI.RespDataMA_GetMonsterResistanceM.MonsterResistanceM> uniqueResistanceList = MonsterResistanceData.GetUniqueResistanceList(chipTarget.GetResistanceIdList());

        GameWebAPI.RespDataMA_GetMonsterResistanceM.MonsterResistanceM data = MonsterResistanceData.AddResistanceFromMultipleTranceData(resistanceMaster, uniqueResistanceList);
        Tolerance tolerance = ServerToBattleUtility.ResistanceToTolerance(data);
        GrowStep  growStep  = MonsterGrowStepData.ToGrowStep(group.growStep);

        foreach (ExtraEffectStatus extraEffectStatus in extraEffectStatusList)
        {
            bool flag2 = true;
            for (int i = 0; i < chipPlayers.Length; i++)
            {
                MonsterData chipActer = chipPlayers[i];
                if (chipActer != null)
                {
                    ChipEffectStatus.TargetType targetType;
                    if (chipActer.userMonster.userMonsterId == chipTarget.userMonster.userMonsterId)
                    {
                        targetType = ChipEffectStatus.TargetType.Actor;
                    }
                    else if (!chipEnemys.Where((MonsterData item) => item.userMonster.userMonsterId == chipActer.userMonster.userMonsterId).Any <MonsterData>())
                    {
                        if (!flag)
                        {
                            targetType = ChipEffectStatus.TargetType.Player;
                        }
                        else
                        {
                            targetType = ChipEffectStatus.TargetType.Enemy;
                        }
                    }
                    else if (flag)
                    {
                        targetType = ChipEffectStatus.TargetType.Player;
                    }
                    else
                    {
                        targetType = ChipEffectStatus.TargetType.Enemy;
                    }
                    foreach (int num in chipActer.GetChipEquip().GetChipIdList())
                    {
                        GameWebAPI.RespDataMA_ChipEffectM.ChipEffect[] array = ChipDataMng.GetChipEffectData(num.ToString());
                        array = ChipEffectStatus.GetStageEffectInvalidList(areaId, array, extraEffectStatus).ToArray();
                        if (array.Length > 0)
                        {
                            List <GameWebAPI.RespDataMA_ChipEffectM.ChipEffect> totalChipEffectStatusList = ChipEffectStatus.GetTotalChipEffectStatusList(array, flag, monsterIntegrationIds, chipTarget.monsterM.monsterGroupId, tolerance, group.tribe, growStep, null, null, targetType, EffectStatusBase.ExtraEffectType.StageEffextInvalid);
                            if (totalChipEffectStatusList.Count > 0)
                            {
                                flag2 = false;
                                break;
                            }
                        }
                    }
                }
            }
            if (flag2)
            {
                list.Add(extraEffectStatus);
            }
        }
        return(list);
    }