public void OnReceivedSelectMonster(int[] opponentSelectMonsterIndexList)
 {
     global::Debug.Log("OnReceivedSelectMonster");
     if (this.matchingResult.opponentData == null)
     {
         return;
     }
     if (!this.matchingResult.isOpponentSelectedMonster)
     {
         this.matchingResult.isOpponentSelectedMonster = true;
         GameWebAPI.Common_MonsterData[] array = new GameWebAPI.Common_MonsterData[opponentSelectMonsterIndexList.Length];
         for (int i = 0; i < opponentSelectMonsterIndexList.Length; i++)
         {
             int num = opponentSelectMonsterIndexList[i];
             array[i] = this.matchingResult.opponentData.monsterData[num];
         }
         this.matchingResult.opponentData.monsterData       = array;
         this.matchingResult.opponentSelectMonsterIndexList = opponentSelectMonsterIndexList;
         if (this.matchingResult.myData.isOwner)
         {
             this.matchingResult.randomSeed = ((int)DateTime.Now.Ticks & 65535);
         }
     }
     this.network.SendAckReceivedSelectMonsterIndex(this.matchingResult.OpponentUserId, this.matchingResult.randomSeed);
     if (this.matchingResult.isMySelectedMonster)
     {
         this.network.SaveMatchingFinish(this.matchingResult.mySelectMonsterIndexList, this.matchingResult.opponentSelectMonsterIndexList);
     }
 }
    private int[] GetFiriendShipAddPoints()
    {
        int[] array = new int[this.deckData.monsterList.Length];
        int   i     = 0;

        while (i < this.deckData.monsterList.Length)
        {
            string tgtId = string.Empty;
            int    num   = -1;
            if (!this.isMulti)
            {
                tgtId = this.deckData.monsterList[i].userMonsterId;
                GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList userMonsterList = this.memoryMonsterList.Single((GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList x) => x.userMonsterId == tgtId);
                num = userMonsterList.friendship.ToInt32();
                goto IL_15F;
            }
            GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
            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)
            {
                tgtId = respData_WorldMultiStartInfo.party[partyIndex].userMonsters[monsterIndex].userMonsterId;
                for (int j = 0; j < this.oldMonsterInfoList.Length; j++)
                {
                    if (this.oldMonsterInfoList != null && tgtId == this.oldMonsterInfoList[j].userMonsterId)
                    {
                        num = this.oldMonsterInfoList[j].friendship.ToInt32();
                        break;
                    }
                }
                goto IL_15F;
            }
            array[i] = 0;
IL_1C1:
            i++;
            continue;
IL_15F:
            MonsterData monsterDataByUserMonsterID = MonsterDataMng.Instance().GetMonsterDataByUserMonsterID(tgtId, false);
            if (string.IsNullOrEmpty(monsterDataByUserMonsterID.userMonster.friendship))
            {
                monsterDataByUserMonsterID.userMonster.friendship = "0";
            }
            int num2 = int.Parse(monsterDataByUserMonsterID.userMonster.friendship);
            if (num == -1)
            {
                num = num2;
            }
            int num3 = num2 - num;
            array[i] = num3;
            goto IL_1C1;
        }
        return(array);
    }
        private GameWebAPI.Common_MonsterData[] GetMyMonsterNetworkData()
        {
            global::Debug.Log("GetMyMonsterNetworkData");
            List <MonsterData> colosseumDeckUserMonsterList = ClassSingleton <MonsterUserDataMng> .Instance.GetColosseumDeckUserMonsterList();

            GameWebAPI.Common_MonsterData[] array = new GameWebAPI.Common_MonsterData[colosseumDeckUserMonsterList.Count];
            for (int i = 0; i < colosseumDeckUserMonsterList.Count; i++)
            {
                array[i] = new GameWebAPI.Common_MonsterData(colosseumDeckUserMonsterList[i]);
            }
            return(array);
        }
    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));
    }
    private IEnumerator DigimonInfos()
    {
        yield return(new WaitForSeconds(0.6f));

        this.particleRemover.SetActive(true);
        if (this.digimonInfos != null)
        {
            for (int i = 0; i < this.digimonInfos.Length; i++)
            {
                NGUITools.SetActiveSelf(this.digimonInfos[i].gameObject, true);
                TweenAlpha tweenAlpha = this.digimonInfos[i].gameObject.AddComponent <TweenAlpha>();
                tweenAlpha.from = 0f;
                tweenAlpha.to   = 1f;
                if (!this.isMulti)
                {
                    string tgtId = this.deckData.monsterList[i].userMonsterId;
                    GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList userMonsterList = this.memoryMonsterList.Single((GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList x) => x.userMonsterId == tgtId);
                    MonsterData monsterDataByUserMonsterID = MonsterDataMng.Instance().GetMonsterDataByUserMonsterID(tgtId, false);
                    this.digimonInfos[i].CreateDetails(userMonsterList.ex.ToInt32(), userMonsterList.level.ToInt32(), monsterDataByUserMonsterID.monsterM.maxLevel.ToInt32());
                }
                else
                {
                    GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
                    int partyIndex   = DataMng.Instance().GetPartyIndex(i);
                    int monsterIndex = DataMng.Instance().GetMonsterIndex(i);
                    GameWebAPI.RespData_WorldMultiStartInfo.Party party = respData_WorldMultiStartInfo.party[partyIndex];
                    GameWebAPI.Common_MonsterData common_MonsterData    = party.userMonsters[monsterIndex];
                    MonsterData monsterData = common_MonsterData.ToMonsterData();
                    string      tgtId       = common_MonsterData.userMonsterId;
                    GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList userMonsterList2 = this.memoryMonsterList.SingleOrDefault((GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList x) => x.userMonsterId == tgtId);
                    if (userMonsterList2 != null)
                    {
                        this.digimonInfos[i].CreateDetails(userMonsterList2.ex.ToInt32(), userMonsterList2.level.ToInt32(), monsterData.monsterM.maxLevel.ToInt32());
                    }
                    else
                    {
                        this.digimonInfos[i].CreateDetails(monsterData);
                    }
                }
            }
            BattleResultDigimonInfo[] growDigimonInfos = this.GetGrowDigimonInfos(this.digimonInfos);
            IEnumerator countUpExp = this.CountUpExp(growDigimonInfos);
            while (countUpExp.MoveNext())
            {
                yield return(null);
            }
        }
        yield break;
    }
示例#6
0
 public Talent(GameWebAPI.Common_MonsterData commonMonsterData)
 {
     this.hpAbilityFlg        = commonMonsterData.hpAbilityFlg;
     this.hpAbility           = commonMonsterData.hpAbility;
     this.attackAbilityFlg    = commonMonsterData.attackAbilityFlg;
     this.attackAbility       = commonMonsterData.attackAbility;
     this.defenseAbilityFlg   = commonMonsterData.defenseAbilityFlg;
     this.defenseAbility      = commonMonsterData.defenseAbility;
     this.spAttackAbilityFlg  = commonMonsterData.spAttackAbilityFlg;
     this.spAttackAbility     = commonMonsterData.spAttackAbility;
     this.spDefenseAbilityFlg = commonMonsterData.spDefenseAbilityFlg;
     this.spDefenseAbility    = commonMonsterData.spDefenseAbility;
     this.speedAbilityFlg     = commonMonsterData.speedAbilityFlg;
     this.speedAbility        = commonMonsterData.speedAbility;
 }
 public void OnOpponentLeave()
 {
     global::Debug.Log("OnOpponentLeave");
     this.matchingResult.isOpponentLeaveRoom = true;
     GameWebAPI.Common_MonsterData[] array = new GameWebAPI.Common_MonsterData[3];
     int[] array2 = new int[3];
     for (int i = 0; i < array.Length; i++)
     {
         array[i]  = this.matchingResult.opponentData.monsterData[i];
         array2[i] = i;
     }
     this.matchingResult.opponentData.monsterData       = array;
     this.matchingResult.opponentSelectMonsterIndexList = array2;
     this.network.SaveMatchingFinish(this.matchingResult.mySelectMonsterIndexList, this.matchingResult.opponentSelectMonsterIndexList);
 }
        public void OnSelectedMonster(int[] indexList)
        {
            global::Debug.Log("OnSelectedMonster");
            List <MonsterData> colosseumDeckUserMonsterList = ClassSingleton <MonsterUserDataMng> .Instance.GetColosseumDeckUserMonsterList();

            ColosseumData.LastUseMonsterList = new MonsterData[indexList.Length];
            GameWebAPI.Common_MonsterData[] array = new GameWebAPI.Common_MonsterData[indexList.Length];
            for (int i = 0; i < indexList.Length; i++)
            {
                MonsterData monsterData = colosseumDeckUserMonsterList[indexList[i]];
                ColosseumData.LastUseMonsterList[i] = monsterData;
                array[i] = new GameWebAPI.Common_MonsterData(monsterData);
            }
            this.matchingResult.myData.monsterData       = array;
            this.matchingResult.mySelectMonsterIndexList = indexList;
            RestrictionInput.StartLoad(RestrictionInput.LoadType.LARGE_IMAGE_MASK_OFF);
            this.syncData = this.network.GetSelectMonsterSync(this.matchingResult.OpponentUserId, indexList);
            this.syncData.SynchronizeRoutine = base.StartCoroutine(this.syncData.Synchronize());
        }
示例#9
0
 public static MonsterData MakeAndSetMonster(GameWebAPI.Common_MonsterData monsterData)
 {
     return(new MonsterData(monsterData.ToUserMonsterList()));
 }
 private void SkipDigimonInfos()
 {
     this.particleRemover.SetActive(true);
     if (this.showDigimonInfos != null)
     {
         AppCoroutine.Stop(this.showDigimonInfos, false);
         this.showDigimonInfos = null;
     }
     this.restRewardExp = this.totalExp;
     this.ResetLabelSizeAndColor(this.getExp);
     this.getCluster.text = StringFormat.Cluster(this.totalCluster);
     if (this.digimonInfos != null)
     {
         for (int i = 0; i < this.digimonInfos.Length; i++)
         {
             NGUITools.SetActiveSelf(this.digimonInfos[i].gameObject, true);
             if (!this.isMulti)
             {
                 string tgtId = this.deckData.monsterList[i].userMonsterId;
                 GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList userMonsterList = this.memoryMonsterList.Single((GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList x) => x.userMonsterId == tgtId);
                 MonsterData monsterDataByUserMonsterID = MonsterDataMng.Instance().GetMonsterDataByUserMonsterID(tgtId, false);
                 this.digimonInfos[i].CreateDetails(userMonsterList.ex.ToInt32(), userMonsterList.level.ToInt32(), monsterDataByUserMonsterID.monsterM.maxLevel.ToInt32());
             }
             else
             {
                 GameWebAPI.RespData_WorldMultiStartInfo respData_WorldMultiStartInfo = DataMng.Instance().RespData_WorldMultiStartInfo;
                 int partyIndex   = DataMng.Instance().GetPartyIndex(i);
                 int monsterIndex = DataMng.Instance().GetMonsterIndex(i);
                 GameWebAPI.RespData_WorldMultiStartInfo.Party party = respData_WorldMultiStartInfo.party[partyIndex];
                 GameWebAPI.Common_MonsterData common_MonsterData    = party.userMonsters[monsterIndex];
                 MonsterData monsterData = common_MonsterData.ToMonsterData();
                 string      tgtId       = common_MonsterData.userMonsterId;
                 GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList userMonsterList2 = this.memoryMonsterList.SingleOrDefault((GameWebAPI.RespDataUS_GetMonsterList.UserMonsterList x) => x.userMonsterId == tgtId);
                 if (userMonsterList2 != null)
                 {
                     this.digimonInfos[i].CreateDetails(userMonsterList2.ex.ToInt32(), userMonsterList2.level.ToInt32(), monsterData.monsterM.maxLevel.ToInt32());
                 }
                 else
                 {
                     this.digimonInfos[i].CreateDetails(monsterData);
                 }
             }
             GameObject gameObject = this.digimonInfos[i].gameObject;
             base.ResetTweenAlpha(gameObject);
         }
         BattleResultDigimonInfo[] growDigimonInfos = this.GetGrowDigimonInfos(this.digimonInfos);
         if (growDigimonInfos != null)
         {
             while (!this.UpdateDigimonExp(growDigimonInfos, true))
             {
             }
             for (int j = 0; j < growDigimonInfos.Length; j++)
             {
                 growDigimonInfos[j].FixExp(this.restRewardExp);
             }
         }
     }
     this.getExp.text = this.restRewardExp.ToString();
     this.StopCountUpSound();
     this.ShowTapNext();
 }