コード例 #1
0
    private void SetCacheChipIconResources()
    {
        string selectDeckNum = DataMng.Instance().RespDataMN_DeckList.selectDeckNum;

        GameWebAPI.RespDataMN_GetDeckList.DeckList   deckList  = null;
        GameWebAPI.RespDataMN_GetDeckList.DeckList[] deckList2 = DataMng.Instance().RespDataMN_DeckList.deckList;
        for (int i = 0; i < deckList2.Length; i++)
        {
            if (selectDeckNum == deckList2[i].deckNum)
            {
                deckList = deckList2[i];
                break;
            }
        }
        int[] array = null;
        for (int j = 0; j < deckList.monsterList.Length; j++)
        {
            MonsterData userMonster = ClassSingleton <MonsterUserDataMng> .Instance.GetUserMonster(deckList.monsterList[j].userMonsterId);

            MonsterChipEquipData chipEquip = userMonster.GetChipEquip();
            array = chipEquip.GetChipIdList();
        }
        for (int k = 0; k < array.Length; k++)
        {
            GameWebAPI.RespDataMA_ChipM.Chip chipMainData = ChipDataMng.GetChipMainData(array[k]);
            string iconPath = chipMainData.GetIconPath();
            if (!AssetDataMng.Instance().IsAssetBundleData(iconPath))
            {
                UnityEngine.Object resource = AssetDataMng.Instance().LoadObject(iconPath, null, true);
                AssetDataCacheMng.Instance().AddCache(iconPath, AssetDataCacheMng.CACHE_TYPE.CHARA_PARTY, resource);
            }
        }
    }
コード例 #2
0
    public GameWebAPI.RespDataMN_GetDeckList.DeckList GetFavoriteDeckNumDeck()
    {
        global::Debug.Assert(null != DataMng.Instance().RespDataMN_DeckList, "GetFavoriteDeckNumDeck : DataMng.Instance().RespDataMN_DeckList is NULL");
        int favoriteDeckNum = this.GetFavoriteDeckNum();

        GameWebAPI.RespDataMN_GetDeckList.DeckList deckList = DataMng.Instance().RespDataMN_DeckList.deckList[favoriteDeckNum];
        global::Debug.Assert(deckList != null && null != deckList.monsterList, "GetFavoriteDeckNumDeck : favoriteDeck is NULL, favoriteDeck.monsterList is NULL");
        return(deckList);
    }
コード例 #3
0
    private APIRequestTask RequestUserMonsterData()
    {
        int num = int.Parse(DataMng.Instance().RespDataMN_DeckList.selectDeckNum) - 1;

        GameWebAPI.RespDataMN_GetDeckList.DeckList deckList = DataMng.Instance().RespDataMN_DeckList.deckList[num];
        int[] aliveInfo = DataMng.Instance().WD_ReqDngResult.aliveInfo;
        GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
        List <int>         aliveUserMonsterIds = new List <int>();
        List <MonsterData> list = new List <MonsterData>();
        int i = 0;

        while (i < aliveInfo.Length)
        {
            string text = string.Empty;
            if (respData_WorldMultiStartInfo == null)
            {
                goto IL_D6;
            }
            int partyIndex   = DataMng.Instance().GetPartyIndex(i);
            int monsterIndex = DataMng.Instance().GetMonsterIndex(i);
            GameWebAPI.Common_MonsterData common_MonsterData = respData_WorldMultiStartInfo.party[partyIndex].userMonsters[monsterIndex];
            if (int.Parse(common_MonsterData.userId) == DataMng.Instance().RespDataCM_Login.playerInfo.UserId)
            {
                text = common_MonsterData.userMonsterId;
                goto IL_D6;
            }
IL_137:
            i++;
            continue;
IL_D6:
            if (aliveInfo[i] == 1 && deckList.monsterList.Length > i)
            {
                string      text2 = (respData_WorldMultiStartInfo != null) ? text : deckList.monsterList[i].userMonsterId;
                MonsterData monsterDataByUserMonsterID = MonsterDataMng.Instance().GetMonsterDataByUserMonsterID(text2, false);
                list.Add(monsterDataByUserMonsterID);
                aliveUserMonsterIds.Add(int.Parse(text2));
                goto IL_137;
            }
            goto IL_137;
        }
        GameWebAPI.RequestMonsterList requestMonsterList = new GameWebAPI.RequestMonsterList();
        requestMonsterList.SetSendData = delegate(GameWebAPI.ReqDataUS_GetMonsterList param)
        {
            param.userMonsterIds = aliveUserMonsterIds.ToArray();
        };
        requestMonsterList.OnReceived = delegate(GameWebAPI.RespDataUS_GetMonsterList response)
        {
            ClassSingleton <MonsterUserDataMng> .Instance.UpdateUserMonsterData(response.userMonsterList);
        };
        GameWebAPI.RequestMonsterList request = requestMonsterList;
        return(new APIRequestTask(request, true));
    }
コード例 #4
0
    private string[] GetFavoriteDeckDigimon()
    {
        int num = -1;

        if (int.TryParse(DataMng.Instance().RespDataMN_DeckList.favoriteDeckNum, out num))
        {
            num--;
            GameWebAPI.RespDataMN_GetDeckList.DeckList deckList = DataMng.Instance().RespDataMN_DeckList.deckList[num];
            if (deckList != null && deckList.monsterList != null)
            {
                return(deckList.monsterList.Select((GameWebAPI.RespDataMN_GetDeckList.MonsterList x) => x.userMonsterId).ToArray <string>());
            }
        }
        return(new string[3]);
    }
コード例 #5
0
 public APIRequestTask RequestUserMonsterFriendshipTime(bool requestRetry = true)
 {
     GameWebAPI.RequestMN_FriendTimeCheck requestMN_FriendTimeCheck = new GameWebAPI.RequestMN_FriendTimeCheck();
     requestMN_FriendTimeCheck.SetSendData = delegate(GameWebAPI.MN_Req_FriendTimeCheck param)
     {
         GameWebAPI.RespDataMN_GetDeckList.DeckList favoriteDeckNumDeck = this.GetFavoriteDeckNumDeck();
         param.userMonsterIds = favoriteDeckNumDeck.monsterList.Select((GameWebAPI.RespDataMN_GetDeckList.MonsterList x) => x.userMonsterId).ToArray <string>();
     };
     requestMN_FriendTimeCheck.OnReceived = delegate(GameWebAPI.RespDataMN_FriendTimeCheck response)
     {
         FarmDigimonManager.FriendTimeList = response.friendshipTime;
     };
     GameWebAPI.RequestMN_FriendTimeCheck request = requestMN_FriendTimeCheck;
     return(new APIRequestTask(request, requestRetry));
 }
コード例 #6
0
    public static void GetExtraEffectFluctuationValue(out int result, out int change, MonsterData monsterData, GameWebAPI.RespDataMA_GetWorldDungeonExtraEffectM.WorldDungeonExtraEffectM[] effectArray, EffectStatusBase.ExtraEffectType extraEffectType, int skillType = 0, bool isChipValue = true)
    {
        int num  = (int)ExtraEffectUtil.GetStatusValue(extraEffectType, monsterData, skillType);
        int num2 = 0;

        if (isChipValue)
        {
            num2 = ExtraEffectUtil.GetExtraChipValue(monsterData, extraEffectType);
        }
        MonsterData[] party = new MonsterData[]
        {
            monsterData
        };
        if (CMD_PartyEdit.instance != null)
        {
            MonsterData[] array = CMD_PartyEdit.instance.GetSelectedMD().ToArray();
            bool          flag  = array.Where((MonsterData item) => item.userMonster.userMonsterId == monsterData.userMonster.userMonsterId).Any <MonsterData>();
            if (flag)
            {
                party = array;
            }
            else
            {
                GameWebAPI.RespDataMN_GetDeckList.DeckList[] deckList = DataMng.Instance().RespDataMN_DeckList.deckList;
                string deckNoText = DataMng.Instance().RespDataMN_DeckList.selectDeckNum;
                GameWebAPI.RespDataMN_GetDeckList.DeckList deckList2 = deckList.Where((GameWebAPI.RespDataMN_GetDeckList.DeckList item) => item.deckNum == deckNoText.ToString()).SingleOrDefault <GameWebAPI.RespDataMN_GetDeckList.DeckList>();
                bool flag2 = deckList2.monsterList.Where((GameWebAPI.RespDataMN_GetDeckList.MonsterList item) => item.userMonsterId == monsterData.userMonster.userMonsterId).Any <GameWebAPI.RespDataMN_GetDeckList.MonsterList>();
                if (flag2)
                {
                    List <MonsterData> list = new List <MonsterData>();
                    foreach (GameWebAPI.RespDataMN_GetDeckList.MonsterList monsterList2 in deckList2.monsterList)
                    {
                        MonsterData monsterDataByUserMonsterID = MonsterDataMng.Instance().GetMonsterDataByUserMonsterID(monsterList2.userMonsterId, false);
                        list.Add(monsterDataByUserMonsterID);
                    }
                    party = list.ToArray();
                }
            }
        }
        int num3 = 0;
        AffectEffectProperty affectEffectProperty = null;

        if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillPower)
        {
            List <AffectEffectProperty> affectEffectPropertyListForUtil = BattleServerControl.GetAffectEffectPropertyListForUtil(num.ToString());
            if (affectEffectPropertyListForUtil != null && affectEffectPropertyListForUtil.Count <AffectEffectProperty>() > 0)
            {
                affectEffectProperty = affectEffectPropertyListForUtil[0];
                num  = affectEffectProperty.GetPower(null);
                num3 = ExtraEffectUtil.GetExtraStageValue(num, monsterData, party, effectArray, affectEffectProperty, extraEffectType);
            }
            else
            {
                num = num3;
            }
        }
        else if (extraEffectType == EffectStatusBase.ExtraEffectType.SkillHit)
        {
            List <AffectEffectProperty> affectEffectPropertyListForUtil2 = BattleServerControl.GetAffectEffectPropertyListForUtil(num.ToString());
            if (affectEffectPropertyListForUtil2 != null && affectEffectPropertyListForUtil2.Count <AffectEffectProperty>() > 0)
            {
                affectEffectProperty = affectEffectPropertyListForUtil2[0];
                num  = (int)(affectEffectProperty.hitRate * 100f);
                num3 = ExtraEffectUtil.GetExtraStageValue(num, monsterData, party, effectArray, affectEffectProperty, extraEffectType);
            }
            else
            {
                num = num3;
            }
        }
        else
        {
            num3 = ExtraEffectUtil.GetExtraStageValue(num, monsterData, party, effectArray, affectEffectProperty, extraEffectType);
        }
        result = num3 + num2;
        change = 0;
        if (num2 > 0 || num < num3)
        {
            change = 1;
        }
        else if (num2 < 0 || num > num3)
        {
            change = -1;
        }
    }
コード例 #7
0
    public override void Init()
    {
        base.Init();
        this.particleRemover.SetActive(false);
        this.getExp.text     = "0";
        this.getCluster.text = "0";
        this.getFriendPointForLeader.text = "0";
        this.getFriendPoint.text          = "0";
        NGUITools.SetActiveSelf(this.acquisitionGO, false);
        int num = int.Parse(DataMng.Instance().RespDataMN_DeckList.selectDeckNum) - 1;

        this.deckData = DataMng.Instance().RespDataMN_DeckList.deckList[num];
        GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
        this.isMulti = (null != respData_WorldMultiStartInfo);
        if (!this.isMulti)
        {
            GameWebAPI.RespDataWD_DungeonResult respDataWD_DungeonResult = ClassSingleton <QuestData> .Instance.RespDataWD_DungeonResult;
            this.totalExp     = respDataWD_DungeonResult.totalExp;
            this.totalCluster = respDataWD_DungeonResult.totalMoney;
        }
        else
        {
            GameWebAPI.RespData_WorldMultiResultInfoLogic respData_WorldMultiResultInfoLogic = ClassSingleton <QuestData> .Instance.RespData_WorldMultiResultInfoLogic;
            this.totalExp     = respData_WorldMultiResultInfoLogic.totalExp;
            this.totalCluster = respData_WorldMultiResultInfoLogic.totalMoney;
            if (respData_WorldMultiResultInfoLogic.dungeonReward != null)
            {
                if (respData_WorldMultiResultInfoLogic.dungeonReward.luckDrop != null)
                {
                    foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.LuckDrop luckDrop2 in respData_WorldMultiResultInfoLogic.dungeonReward.luckDrop)
                    {
                        if (int.Parse(luckDrop2.assetCategoryId) == 5)
                        {
                            this.totalExp += luckDrop2.assetNum;
                        }
                        if (int.Parse(luckDrop2.assetCategoryId) == 4)
                        {
                            this.totalCluster += luckDrop2.assetNum;
                        }
                    }
                }
                if (respData_WorldMultiResultInfoLogic.dungeonReward.multiReward != null)
                {
                    foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward dropReward in respData_WorldMultiResultInfoLogic.dungeonReward.multiReward)
                    {
                        if (int.Parse(dropReward.assetCategoryId) == 5)
                        {
                            this.totalExp += dropReward.assetNum;
                        }
                        if (int.Parse(dropReward.assetCategoryId) == 4)
                        {
                            this.totalCluster += dropReward.assetNum;
                        }
                    }
                }
                if (respData_WorldMultiResultInfoLogic.dungeonReward.ownerDropReward != null)
                {
                    foreach (GameWebAPI.RespData_WorldMultiResultInfoLogic.DungeonReward.DropReward dropReward2 in respData_WorldMultiResultInfoLogic.dungeonReward.ownerDropReward)
                    {
                        if (int.Parse(dropReward2.assetCategoryId) == 5)
                        {
                            this.totalExp += dropReward2.assetNum;
                        }
                        if (int.Parse(dropReward2.assetCategoryId) == 4)
                        {
                            this.totalCluster += dropReward2.assetNum;
                        }
                    }
                }
            }
        }
        this.getExpText.text     = StringMaster.GetString("BattleUI-03");
        this.getClusterText.text = StringMaster.GetString("BattleUI-40");
        this.getFriendPointForLeaderText.text = StringMaster.GetString("BattleUI-48");
        this.getFriendPointText.text          = StringMaster.GetString("BattleUI-49");
        this.CreateDigimonThumbnail();
    }
コード例 #8
0
 public void SetDeck(GameWebAPI.RespDataMN_GetDeckList.DeckList data)
 {
     this.deckList = data;
 }