private RewardData ReceiveDataToRewardData(FlowNode_ReqPresentList.Api_PresentListExec.JsonItem receiveData)
            {
                FriendPresentItemParam presentItemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParam(receiveData.iname);

                if (presentItemParam == null)
                {
                    return((RewardData)null);
                }
                RewardData rewardData = new RewardData();

                rewardData.Exp        = 0;
                rewardData.Coin       = 0;
                rewardData.Gold       = 0;
                rewardData.Stamina    = 0;
                rewardData.MultiCoin  = 0;
                rewardData.KakeraCoin = 0;
                if (presentItemParam.IsItem())
                {
                    rewardData.AddReward(presentItemParam.item, presentItemParam.num * receiveData.num);
                }
                else
                {
                    rewardData.Gold = presentItemParam.zeny * receiveData.num;
                }
                return(rewardData);
            }
Example #2
0
        private void SetRewordData(MailData[] mail_datas)
        {
            if (mail_datas == null || mail_datas.Length <= 0)
            {
                return;
            }
            RewardData rewardData1 = new RewardData();

            for (int index = 0; index < mail_datas.Length; ++index)
            {
                MailData mailData = mail_datas[index];
                if (mailData != null)
                {
                    RewardData rewardData2 = this.GiftDataToRewardData(mailData.gifts);
                    using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = rewardData2.GiftRecieveItemDataDic.Values.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            GiftRecieveItemData current = enumerator.Current;
                            rewardData1.AddReward(current);
                        }
                    }
                    rewardData1.Exp        += rewardData2.Exp;
                    rewardData1.Stamina    += rewardData2.Stamina;
                    rewardData1.Coin       += rewardData2.Coin;
                    rewardData1.Gold       += rewardData2.Gold;
                    rewardData1.ArenaMedal += rewardData2.ArenaMedal;
                    rewardData1.MultiCoin  += rewardData2.MultiCoin;
                    rewardData1.KakeraCoin += rewardData2.KakeraCoin;
                }
            }
            GlobalVars.LastReward.Set(rewardData1);
        }
Example #3
0
        private bool MakeTrophyPlate(TrophyParam trophy, TrophyState st, bool is_achievement)
        {
            Transform transform = ((Component)this).get_transform();

            if (this.TrophyType == TrophyList.TrophyTypes.Daily)
            {
                if (trophy.Days != 1)
                {
                    return(false);
                }
            }
            else if (this.TrophyType == TrophyList.TrophyTypes.Normal && (trophy.Days != 0 || this.TrophyCategory != trophy.Category))
            {
                return(false);
            }
            if (trophy.IsInvisibleVip() || trophy.IsInvisibleCard() || trophy.IsInvisibleStamina() || (trophy.RequiredTrophies != null && !TrophyParam.CheckRequiredTrophies(MonoSingleton <GameManager> .Instance, trophy, true) || !trophy.IsAvailablePeriod(TimeManager.ServerTime, is_achievement)))
            {
                return(false);
            }
            ListItemEvents listItemEvents1 = !st.IsEnded ? (!Object.op_Inequality((Object)this.Item_FollowTwitter, (Object)null) || !trophy.ContainsCondition(TrophyConditionTypes.followtwitter) ? (!trophy.iname.Contains("DAILY_GLAPVIDEO") ? (!st.IsCompleted ? this.Item_Normal : this.Item_Completed) : this.Item_Normal) : this.Item_FollowTwitter) : this.Item_Ended;

            if (Object.op_Equality((Object)listItemEvents1, (Object)null) || trophy.iname.Substring(0, 7) == "REVIEW_" && Network.Host.Contains("eval.alchemist.gu3.jp"))
            {
                return(false);
            }
            ListItemEvents listItemEvents2 = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)listItemEvents1);

            DataSource.Bind <TrophyParam>(((Component)listItemEvents2).get_gameObject(), trophy);
            ((Component)listItemEvents2).get_transform().SetParent(transform, false);
            listItemEvents2.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnItemDetail);
            listItemEvents2.OnSelect     = new ListItemEvents.ListItemEvent(this.OnItemSelect);
            SRPG_Button componentInChildren = (SRPG_Button)((Component)listItemEvents2).GetComponentInChildren <SRPG_Button>();

            if (Object.op_Inequality((Object)componentInChildren, (Object)null) && !st.IsEnded)
            {
                if (Object.op_Inequality((Object)this.Item_FollowTwitter, (Object)null) && trophy.ContainsCondition(TrophyConditionTypes.followtwitter))
                {
                    this.FollowBtnSetting(componentInChildren);
                }
                else if (trophy.iname.Contains("DAILY_GLAPVIDEO"))
                {
                    this.GlobalVideoAdsBtnSetting(componentInChildren);
                }
                else if (st.IsCompleted)
                {
                    this.AchievementBtnSetting(componentInChildren);
                }
                else
                {
                    this.ChallengeBtnSetting(componentInChildren, trophy);
                }
            }
            RewardData data = new RewardData(trophy);

            DataSource.Bind <RewardData>(((Component)listItemEvents2).get_gameObject(), data);
            this.AddItem(listItemEvents2);
            ((Component)listItemEvents2).get_gameObject().SetActive(true);
            return(true);
        }
Example #4
0
        public override void Refresh()
        {
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ExpRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Exp > 0)
                {
                    this.AddRewardList(this.ExpRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.GoldRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Gold > 0)
                {
                    this.AddRewardList(this.GoldRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.CoinRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Coin > 0)
                {
                    this.AddRewardList(this.CoinRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.StaminaRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Stamina > 0)
                {
                    this.AddRewardList(this.StaminaRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                Transform parent1 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                Transform parent2 = (Transform)null;
                if (Object.op_Inequality((Object)this.EventCoinTemplate, (Object)null))
                {
                    parent2 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.EventCoinTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                }
                for (int index = 0; index < dataOfClass.Items.Count; ++index)
                {
                    ItemData data = dataOfClass.Items[index];
                    DataSource.Bind <ItemData>(data.ItemType != EItemType.EventCoin || Object.op_Equality((Object)parent2, (Object)null) ? this.AddRewardList(this.ItemTemplate, parent1) : this.AddRewardList(this.EventCoinTemplate, parent2), data);
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #5
0
        private RewardData GiftDataToRewardData(GiftData[] giftDatas)
        {
            RewardData rewardData = new RewardData();

            rewardData.Exp        = 0;
            rewardData.Stamina    = 0;
            rewardData.MultiCoin  = 0;
            rewardData.KakeraCoin = 0;
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < giftDatas.Length; ++index)
            {
                GiftData giftData = giftDatas[index];
                rewardData.Coin       += giftData.coin;
                rewardData.Gold       += giftData.gold;
                rewardData.ArenaMedal += giftData.arenacoin;
                rewardData.MultiCoin  += giftData.multicoin;
                rewardData.KakeraCoin += giftData.kakeracoin;
                if (giftData.iname != null)
                {
                    if (giftData.CheckGiftTypeIncluded(GiftTypes.Artifact))
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(giftData.iname);

                        if (artifactParam != null)
                        {
                            if (rewardData.GiftRecieveItemDataDic.ContainsKey(giftData.iname))
                            {
                                rewardData.GiftRecieveItemDataDic[giftData.iname].num += giftData.num;
                            }
                            else
                            {
                                GiftRecieveItemData giftRecieveItemData = new GiftRecieveItemData();
                                giftRecieveItemData.Set(giftData.iname, GiftTypes.Artifact, artifactParam.rareini, giftData.num);
                                rewardData.GiftRecieveItemDataDic.Add(giftData.iname, giftRecieveItemData);
                            }
                        }
                    }
                    else
                    {
                        ItemData itemData = new ItemData();
                        if (itemData.Setup(0L, giftData.iname, giftData.num))
                        {
                            rewardData.Items.Add(itemData);
                            ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                            int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                            rewardData.ItemsBeforeAmount.Add(num);
                        }
                    }
                }
            }
            return(rewardData);
        }
Example #6
0
        private RewardData GiftDataToRewardData(GiftData[] giftDatas)
        {
            RewardData rewardData = new RewardData();

            rewardData.Exp        = 0;
            rewardData.Stamina    = 0;
            rewardData.MultiCoin  = 0;
            rewardData.KakeraCoin = 0;
            for (int index = 0; index < giftDatas.Length; ++index)
            {
                GiftData giftData = giftDatas[index];
                rewardData.Coin       += giftData.coin;
                rewardData.Gold       += giftData.gold;
                rewardData.ArenaMedal += giftData.arenacoin;
                rewardData.MultiCoin  += giftData.multicoin;
                rewardData.KakeraCoin += giftData.kakeracoin;
                if (giftData.CheckGiftTypeIncluded(GiftTypes.ConceptCard))
                {
                    ConceptCardParam conceptCardParam = MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(giftData.ConceptCardIname);

                    rewardData.AddReward(conceptCardParam, giftData.ConceptCardNum);
                    if (giftData.IsGetConceptCardUnit)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(giftData.ConceptCardGetUnitIname);

                        rewardData.AddReward(itemParam, 1);
                    }
                }
                if (giftData.iname != null)
                {
                    if (giftData.CheckGiftTypeIncluded(GiftTypes.Artifact))
                    {
                        ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(giftData.iname);

                        rewardData.AddReward(artifactParam, giftData.num);
                    }
                    else if (giftData.CheckGiftTypeIncluded(GiftTypes.Award))
                    {
                        AwardParam awardParam = MonoSingleton <GameManager> .Instance.GetAwardParam(giftData.iname);

                        rewardData.AddReward(awardParam.ToItemParam(), giftData.num);
                    }
                    else
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(giftData.iname);

                        rewardData.AddReward(itemParam, giftData.num);
                    }
                }
            }
            return(rewardData);
        }
Example #7
0
        private void Deserialize(Json_TrophyConceptCards json)
        {
            if (json == null)
            {
                return;
            }
            if (json.mail != null && json.mail.Length > 0)
            {
                RewardData rewardData = GlobalVars.LastReward.Get();
                if (rewardData != null)
                {
                    rewardData.IsOverLimit = true;
                }
                foreach (Json_TrophyConceptCard trophyConceptCard in json.mail)
                {
                    if (!string.IsNullOrEmpty(trophyConceptCard.unit))
                    {
                        if (rewardData != null)
                        {
                            ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(trophyConceptCard.unit);

                            rewardData.AddReward(itemParam, 1);
                        }
                        FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(trophyConceptCard.iname));
                    }
                }
            }
            if (json.direct == null)
            {
                return;
            }
            RewardData rewardData1 = GlobalVars.LastReward.Get();

            foreach (Json_TrophyConceptCard trophyConceptCard in json.direct)
            {
                GlobalVars.IsDirtyConceptCardData.Set(true);
                if (!string.IsNullOrEmpty(trophyConceptCard.unit))
                {
                    if (rewardData1 != null)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(trophyConceptCard.unit);

                        rewardData1.AddReward(itemParam, 1);
                    }
                    FlowNode_ConceptCardGetUnit.AddConceptCardData(ConceptCardData.CreateConceptCardDataForDisplay(trophyConceptCard.iname));
                }
            }
        }
Example #8
0
        private void OnItemDetail(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DetailWindow, (UnityEngine.Object)null) || dataOfClass == null)
            {
                return;
            }
            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.DetailWindow);

            DataSource.Bind <TrophyParam>(gameObject, dataOfClass);
            RewardData data = new RewardData(dataOfClass);

            DataSource.Bind <RewardData>(gameObject, data);
            gameObject.SetActive(true);
        }
Example #9
0
        private bool CheckRecievable(RewardData reward)
        {
            int num = 0;

            using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = reward.GiftRecieveItemDataDic.Values.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GiftRecieveItemData current = enumerator.Current;
                    if (current.type == GiftTypes.Artifact)
                    {
                        num += this.currentNums[GiftTypes.Artifact] + current.num;
                    }
                }
            }
            return(num < (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.ArtifactBoxCap);
        }
Example #10
0
 private void RefreshArtifacts(RewardData reward, Transform itemParent, GameObject template)
 {
     if (reward.Artifacts == null || reward.Artifacts.Count <= 0)
     {
         return;
     }
     using (List <ArtifactRewardData> .Enumerator enumerator = reward.Artifacts.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             ArtifactRewardData current    = enumerator.Current;
             GameObject         gameObject = (GameObject)Object.Instantiate <GameObject>((M0)template);
             gameObject.get_transform().SetParent(itemParent, false);
             this.mItems.Add(gameObject);
             DataSource.Bind <ArtifactRewardData>(gameObject, current);
             gameObject.SetActive(true);
         }
     }
 }
Example #11
0
 private void RefreshUnits(RewardData reward, Transform itemParent, GameObject template)
 {
     using (Dictionary <string, GiftRecieveItemData> .Enumerator enumerator = reward.GiftRecieveItemDataDic.GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             KeyValuePair <string, GiftRecieveItemData> current = enumerator.Current;
             if (current.Value.type == GiftTypes.Unit)
             {
                 GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)template);
                 gameObject.get_transform().SetParent(itemParent, false);
                 this.mItems.Add(gameObject);
                 GiftRecieveItem componentInChildren = (GiftRecieveItem)gameObject.GetComponentInChildren <GiftRecieveItem>();
                 DataSource.Bind <GiftRecieveItemData>(gameObject, current.Value);
                 gameObject.SetActive(true);
                 componentInChildren.UpdateValue();
             }
         }
     }
 }
Example #12
0
        private void RefreshItems(RewardData reward, Transform itemParent, GameObject template)
        {
            if (reward.Items == null || reward.Items.Count <= 0)
            {
                return;
            }
            Transform transform = (Transform)null;

            if (Object.op_Inequality((Object)this.EventCoinTemplate, (Object)null))
            {
                transform = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.EventCoinTemplate.get_transform().get_parent() : this.ItemList.get_transform();
            }
            List <ItemParam> itemParamList = (List <ItemParam>)null;

            for (int index = 0; index < reward.Items.Count; ++index)
            {
                ItemData   data = reward.Items[index];
                GameObject gameObject;
                if (data.ItemType != EItemType.EventCoin || Object.op_Equality((Object)transform, (Object)null))
                {
                    gameObject = (GameObject)Object.Instantiate <GameObject>((M0)template);
                    gameObject.get_transform().SetParent(itemParent, false);
                }
                else
                {
                    gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.EventCoinTemplate);
                    gameObject.get_transform().SetParent(transform, false);
                }
                this.mItems.Add(gameObject);
                DataSource.Bind <ItemData>(gameObject, data);
                gameObject.SetActive(true);
                if (!this.UseBindDataOnly)
                {
                    if (itemParamList == null)
                    {
                        itemParamList = new List <ItemParam>();
                    }
                    itemParamList.Add(data.Param);
                }
            }
        }
        public override void OnActivate(int pinID)
        {
            if (pinID != 0)
            {
                return;
            }
            RewardData rewardData = GlobalVars.LastReward.Get();

            if (rewardData == null || rewardData.Stamina < 1)
            {
                this.ActivateOutputLinks(1);
            }
            else
            {
                PlayerData player = MonoSingleton <GameManager> .GetInstanceDirect().Player;

                if (rewardData.Stamina > player.StaminaStockCap)
                {
                    this.ActivateOutputLinks(3);
                }
                else if (player.Stamina >= player.StaminaStockCap)
                {
                    if (rewardData.Exp > 0 || rewardData.Gold > 0 || (rewardData.Coin > 0 || rewardData.ArenaMedal > 0) || (rewardData.MultiCoin > 0 || rewardData.KakeraCoin > 0 || rewardData.Items.Count > 0))
                    {
                        this.ActivateOutputLinks(3);
                    }
                    else
                    {
                        this.ActivateOutputLinks(2);
                    }
                }
                else if (player.Stamina + rewardData.Stamina <= player.StaminaStockCap)
                {
                    this.ActivateOutputLinks(1);
                }
                else
                {
                    this.ActivateOutputLinks(3);
                }
            }
        }
Example #14
0
        private void OnSelect(GameObject go)
        {
            MailData dataOfClass = DataSource.FindDataOfClass <MailData>(go, (MailData)null);

            if (dataOfClass != null)
            {
                GlobalVars.SelectedMailUniqueID.Set(dataOfClass.mid);
                GlobalVars.SelectedMailPeriod.Set(dataOfClass.period);
                RewardData            rewardData       = this.GiftDataToRewardData(dataOfClass.gifts);
                FlowNode_OnMailSelect nodeOnMailSelect = (FlowNode_OnMailSelect)((Component)this).GetComponentInParent <FlowNode_OnMailSelect>();
                if (Object.op_Equality((Object)nodeOnMailSelect, (Object)null))
                {
                    nodeOnMailSelect = (FlowNode_OnMailSelect)Object.FindObjectOfType <FlowNode_OnMailSelect>();
                }
                if (Object.op_Inequality((Object)nodeOnMailSelect, (Object)null))
                {
                    nodeOnMailSelect.Selected();
                }
                GlobalVars.LastReward.Set(rewardData);
            }
            this.UpdateItems();
        }
Example #15
0
        public ListItemEvents MakeTrophyPlate(TrophyState st, bool is_achievement)
        {
            ListItemEvents listItemEvents1 = !st.IsEnded ? (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_FollowTwitter, (UnityEngine.Object)null) || !st.Param.ContainsCondition(TrophyConditionTypes.followtwitter) ? (!st.IsCompleted ? this.Item_Normal : this.Item_Completed) : this.Item_FollowTwitter) : this.Item_Ended;

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)listItemEvents1, (UnityEngine.Object)null))
            {
                return((ListItemEvents)null);
            }
            ListItemEvents listItemEvents2 = (ListItemEvents)UnityEngine.Object.Instantiate <ListItemEvents>((M0)listItemEvents1);

            DataSource.Bind <TrophyParam>(((Component)listItemEvents2).get_gameObject(), st.Param);
            ((Component)listItemEvents2).get_transform().SetParent(((Component)this).get_transform(), false);
            listItemEvents2.OnOpenDetail = new ListItemEvents.ListItemEvent(this.OnItemDetail);
            listItemEvents2.OnSelect     = new ListItemEvents.ListItemEvent(this.OnItemSelect);
            SRPG_Button componentInChildren = (SRPG_Button)((Component)listItemEvents2).GetComponentInChildren <SRPG_Button>();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)componentInChildren, (UnityEngine.Object)null) && !st.IsEnded)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_FollowTwitter, (UnityEngine.Object)null) && st.Param.ContainsCondition(TrophyConditionTypes.followtwitter))
                {
                    this.FollowBtnSetting(componentInChildren);
                }
                else if (st.IsCompleted)
                {
                    this.AchievementBtnSetting(componentInChildren);
                }
                else
                {
                    this.ChallengeBtnSetting(componentInChildren, st.Param);
                }
            }
            RewardData data = new RewardData(st.Param);

            DataSource.Bind <RewardData>(((Component)listItemEvents2).get_gameObject(), data);
            ((Component)listItemEvents2).get_gameObject().SetActive(true);
            return(listItemEvents2);
        }
Example #16
0
        private void OnItemSelect(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass);

            if (!trophyCounter.IsEnded && trophyCounter.IsCompleted)
            {
                if (dataOfClass.IsInvisibleStamina() || !dataOfClass.IsAvailablePeriod(TimeManager.ServerTime, true))
                {
                    UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.TROPHY_OUTDATED"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
                    this.Refresh();
                }
                else
                {
                    GlobalVars.SelectedTrophy.Set(dataOfClass.iname);
                    RewardData rewardData = new RewardData(dataOfClass);
                    GlobalVars.LastReward.Set(rewardData);
                    GlobalVars.UnitGetReward = new UnitGetParam(rewardData.Items.ToArray());
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
                }
            }
            else
            {
                QuestParam questParam = new QuestParam();
                switch (dataOfClass.Objectives[0].type)
                {
                case TrophyConditionTypes.winquest:
                case TrophyConditionTypes.playerlv:
                case TrophyConditionTypes.winquestsoldier:
                case TrophyConditionTypes.losequest:
                    QuestTypes quest_type1 = QuestTypes.Story;
                    if (!questParam.TransSectionGotoQuest(dataOfClass.Objectives[0].sval, out quest_type1, new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        this.g_quest_type = quest_type1;
                        break;
                    }
                    QuestTypes questTypes = quest_type1;
                    switch (questTypes)
                    {
                    case QuestTypes.Event:
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                        return;

                    case QuestTypes.Tower:
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1026);
                        return;

                    default:
                        if (questTypes == QuestTypes.Multi)
                        {
                            FlowNode_GameObject.ActivateOutputLinks((Component)this, 1005);
                            return;
                        }
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                        return;
                    }

                case TrophyConditionTypes.winelite:
                case TrophyConditionTypes.loseelite:
                    if (!questParam.TransSectionGotoElite(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        this.g_quest_type = QuestTypes.Story;
                        break;
                    }
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1001);
                    break;

                case TrophyConditionTypes.winevent:
                case TrophyConditionTypes.loseevent:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                    break;

                case TrophyConditionTypes.gacha:
                case TrophyConditionTypes.collectunits:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1000);
                    break;

                case TrophyConditionTypes.multiplay:
                case TrophyConditionTypes.winmulti:
                case TrophyConditionTypes.winmultimore:
                case TrophyConditionTypes.winmultiless:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1005);
                    break;

                case TrophyConditionTypes.ability:
                case TrophyConditionTypes.changeability:
                case TrophyConditionTypes.makeabilitylevel:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.soubi:
                    this.GotoEquip();
                    break;

                case TrophyConditionTypes.buygold:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1004);
                    break;

                case TrophyConditionTypes.arena:
                case TrophyConditionTypes.winarena:
                case TrophyConditionTypes.losearena:
                    this.GotoArena();
                    break;

                case TrophyConditionTypes.review:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1029);
                    break;

                case TrophyConditionTypes.fggid:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1009);
                    break;

                case TrophyConditionTypes.unitlevel:
                case TrophyConditionTypes.evolutionnum:
                case TrophyConditionTypes.joblevel:
                case TrophyConditionTypes.upunitlevel:
                case TrophyConditionTypes.makeunitlevel:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.unitequip:
                case TrophyConditionTypes.upjoblevel:
                case TrophyConditionTypes.makejoblevel:
                case TrophyConditionTypes.totaljoblv11:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.limitbreak:
                case TrophyConditionTypes.evoltiontimes:
                case TrophyConditionTypes.changejob:
                case TrophyConditionTypes.totalunitlvs:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1025);
                    break;

                case TrophyConditionTypes.buyatshop:
                    this.GotoShop(dataOfClass);
                    break;

                case TrophyConditionTypes.artifacttransmute:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.artifactstrength:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.artifactevolution:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1021);
                    break;

                case TrophyConditionTypes.wintower:
                case TrophyConditionTypes.losetower:
                    QuestTypes quest_type2 = QuestTypes.Tower;
                    if (!questParam.TransSectionGotoTower(dataOfClass.Objectives[0].sval, out quest_type2))
                    {
                        break;
                    }
                    if (quest_type2 == QuestTypes.Event)
                    {
                        FlowNode_GameObject.ActivateOutputLinks((Component)this, 1007);
                        break;
                    }
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1026);
                    break;

                case TrophyConditionTypes.vs:
                case TrophyConditionTypes.vswin:
                    this.GotoVersus();
                    break;

                case TrophyConditionTypes.fblogin:
                    FlowNode_GameObject.ActivateOutputLinks((Component)this, 1040);
                    break;
                }
            }
        }
Example #17
0
        private void OnAllReadAccept()
        {
            if (this.mUnreadMails.Count < 1)
            {
                return;
            }
            this.RefreshCurrentNums();
            RewardData rewardData1 = new RewardData();
            List <MailList.ItemListEntity> itemListEntityList = new List <MailList.ItemListEntity>();
            int num1 = 0;

            for (int index1 = 0; index1 < this.mUnreadMails.Count && num1 < this.MaxReadCount; ++index1)
            {
                MailData dataOfClass = DataSource.FindDataOfClass <MailData>(this.mUnreadMails[index1], (MailData)null);
                if (dataOfClass != null)
                {
                    RewardData rewardData2 = this.GiftDataToRewardData(dataOfClass.gifts);
                    if (this.CheckRecievable(rewardData2))
                    {
                        ++num1;
                        using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = rewardData2.GiftRecieveItemDataDic.Values.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                GiftRecieveItemData current = enumerator.Current;
                                if (rewardData1.GiftRecieveItemDataDic.ContainsKey(current.iname))
                                {
                                    rewardData1.GiftRecieveItemDataDic[current.iname].num += current.num;
                                }
                                else
                                {
                                    rewardData1.GiftRecieveItemDataDic.Add(current.iname, current);
                                }
                                this.AddCurrentNum(current);
                            }
                        }
                        rewardData1.Exp        += rewardData2.Exp;
                        rewardData1.Stamina    += rewardData2.Stamina;
                        rewardData1.Coin       += rewardData2.Coin;
                        rewardData1.Gold       += rewardData2.Gold;
                        rewardData1.ArenaMedal += rewardData2.ArenaMedal;
                        rewardData1.MultiCoin  += rewardData2.MultiCoin;
                        rewardData1.KakeraCoin += rewardData2.KakeraCoin;
                        for (int index2 = 0; index2 < rewardData2.Items.Count; ++index2)
                        {
                            ItemData itemData = rewardData2.Items[index2];
                            if (itemListEntityList.Count > 0)
                            {
                                bool flag = false;
                                for (int index3 = 0; index3 < itemListEntityList.Count; ++index3)
                                {
                                    if (itemListEntityList[index3].Item.ItemID == itemData.ItemID)
                                    {
                                        itemListEntityList[index3].Num += itemData.Num;
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    itemListEntityList.Add(new MailList.ItemListEntity(itemData.Num, itemData));
                                }
                            }
                            else
                            {
                                itemListEntityList.Add(new MailList.ItemListEntity(itemData.Num, itemData));
                            }
                        }
                    }
                }
            }
            GameManager instance = MonoSingleton <GameManager> .Instance;

            for (int index = 0; index < itemListEntityList.Count; ++index)
            {
                MailList.ItemListEntity itemListEntity = itemListEntityList[index];
                ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemListEntity.Item.Param.iname);
                int      num2             = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                rewardData1.ItemsBeforeAmount.Add(num2);
                if (itemListEntity.Item.HaveCap < itemListEntity.Num)
                {
                    itemListEntity.Item.Gain(itemListEntity.Item.HaveCap);
                    rewardData1.Items.Add(itemListEntity.Item);
                    int      num3     = itemListEntity.Num - itemListEntity.Item.HaveCap;
                    ItemData itemData = new ItemData();
                    if (itemData.Setup(itemListEntity.Item.UniqueID, itemListEntity.Item.Param, num3))
                    {
                        rewardData1.Items.Add(itemData);
                        rewardData1.ItemsBeforeAmount.Add(itemData.HaveCap);
                    }
                }
                else
                {
                    itemListEntity.Item.Gain(itemListEntity.Num - itemListEntity.Item.Num);
                    rewardData1.Items.Add(itemListEntity.Item);
                }
            }
            GlobalVars.LastReward.Set(rewardData1);
            this.UpdateItems();
        }
Example #18
0
        private void Success()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (player.Lv > this.mLevelOld)
            {
                player.OnPlayerLevelChange(player.Lv - this.mLevelOld);
            }
            GlobalVars.PlayerLevelChanged.Set(player.Lv != this.mLevelOld);
            GlobalVars.PlayerExpNew.Set(player.Exp);
            player.MarkTrophiesEnded(new TrophyParam[1]
            {
                this.mTrophyParam
            });
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardWindow, (UnityEngine.Object)null))
            {
                RewardData data = new RewardData();
                data.Coin = this.mTrophyParam.Coin;
                data.Gold = this.mTrophyParam.Gold;
                data.Exp  = this.mTrophyParam.Exp;
                GameManager instance = MonoSingleton <GameManager> .Instance;
                for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
                {
                    ItemData itemData = new ItemData();
                    if (itemData.Setup(0L, this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num))
                    {
                        data.Items.Add(itemData);
                        ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                        int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                        data.ItemsBeforeAmount.Add(num);
                    }
                }
                DataSource.Bind <RewardData>(this.RewardWindow, data);
            }
            GameCenterManager.SendAchievementProgress(this.mTrophyParam.iname);
            if (this.mTrophyParam != null && this.mTrophyParam.Objectives != null)
            {
                for (int index = 0; index < this.mTrophyParam.Objectives.Length; ++index)
                {
                    if (this.mTrophyParam.Objectives[index].type == TrophyConditionTypes.review)
                    {
                        string reviewUrlGeneric = this.ReviewURL_Generic;
                        if (!string.IsNullOrEmpty(reviewUrlGeneric))
                        {
                            Application.OpenURL(reviewUrlGeneric);
                            break;
                        }
                        break;
                    }
                }
            }
            if (this.mTrophyParam != null && this.mTrophyParam.Objectives != null)
            {
                for (int index = 0; index < this.mTrophyParam.Objectives.Length; ++index)
                {
                    if (this.mTrophyParam.Objectives[index].type == TrophyConditionTypes.followtwitter)
                    {
                        string reviewUrlTwitter = this.ReviewURL_Twitter;
                        if (!string.IsNullOrEmpty(reviewUrlTwitter))
                        {
                            Application.OpenURL(reviewUrlTwitter);
                            break;
                        }
                        break;
                    }
                }
            }
            ((Behaviour)this).set_enabled(false);
            this.ActivateOutputLinks(1);
        }
 public override void Complete(WWWResult www)
 {
     if (Network.IsError)
     {
         this.m_Node.OnFailed();
     }
     else
     {
         DebugMenu.Log("API", this.url + ":" + www.text);
         WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqPresentList.Api_PresentListExec.Json> >(www.text);
         DebugUtility.Assert(jsonObject != null, "res == null");
         bool flag = false;
         if (jsonObject.body != null)
         {
             if (jsonObject.body.player != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.player);
             }
             if (jsonObject.body.items != null)
             {
                 MonoSingleton <GameManager> .Instance.Deserialize(jsonObject.body.items);
             }
             if (jsonObject.body.presents != null)
             {
                 RewardData rewardData = new RewardData();
                 for (int index = 0; index < jsonObject.body.presents.Length; ++index)
                 {
                     FlowNode_ReqPresentList.Api_PresentListExec.JsonItem present = jsonObject.body.presents[index];
                     if (present != null)
                     {
                         RewardData dataToRewardData = this.ReceiveDataToRewardData(present);
                         if (dataToRewardData != null)
                         {
                             rewardData.Exp        += dataToRewardData.Exp;
                             rewardData.Stamina    += dataToRewardData.Stamina;
                             rewardData.Coin       += dataToRewardData.Coin;
                             rewardData.Gold       += dataToRewardData.Gold;
                             rewardData.ArenaMedal += dataToRewardData.ArenaMedal;
                             rewardData.MultiCoin  += dataToRewardData.MultiCoin;
                             rewardData.KakeraCoin += dataToRewardData.KakeraCoin;
                             using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataToRewardData.GiftRecieveItemDataDic.Values.GetEnumerator())
                             {
                                 while (enumerator.MoveNext())
                                 {
                                     GiftRecieveItemData current = enumerator.Current;
                                     rewardData.AddReward(current);
                                 }
                             }
                             flag = true;
                         }
                     }
                 }
                 GlobalVars.LastReward.Set(rewardData);
                 if (rewardData != null)
                 {
                     MonoSingleton <GameManager> .Instance.Player.OnGoldChange(rewardData.Gold);
                 }
                 MonoSingleton <GameManager> .Instance.Player.ValidFriendPresent = false;
             }
         }
         Network.RemoveAPI();
         if (flag)
         {
             this.Success();
         }
         else
         {
             this.Failed();
         }
     }
 }
Example #20
0
        private void OnItemSelect(GameObject go)
        {
            TrophyParam dataOfClass = DataSource.FindDataOfClass <TrophyParam>(go, (TrophyParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            TrophyState trophyCounter = MonoSingleton <GameManager> .Instance.Player.GetTrophyCounter(dataOfClass, true);

            if (!trophyCounter.IsEnded && trophyCounter.IsCompleted)
            {
                if (dataOfClass.IsInvisibleStamina() || !dataOfClass.IsAvailablePeriod(TimeManager.ServerTime, true))
                {
                    UIUtility.NegativeSystemMessage((string)null, LocalizedText.Get("sys.TROPHY_OUTDATED"), (UIUtility.DialogResultEvent)null, (GameObject)null, false, -1);
                    this.Refresh();
                }
                else
                {
                    GlobalVars.SelectedTrophy.Set(dataOfClass.iname);
                    RewardData rewardData = new RewardData(dataOfClass);
                    GlobalVars.LastReward.Set(rewardData);
                    GlobalVars.UnitGetReward = new UnitGetParam(rewardData.Items.ToArray());
                    this.trophy_window.ActivateOutputLinks(2000);
                }
            }
            else
            {
                QuestParam questParam = new QuestParam();
                switch (dataOfClass.Objectives[0].type)
                {
                case TrophyConditionTypes.winquest:
                case TrophyConditionTypes.playerlv:
                case TrophyConditionTypes.winquestsoldier:
                case TrophyConditionTypes.losequest:
                case TrophyConditionTypes.damage_over:
                case TrophyConditionTypes.complete_all_quest_mission:
                case TrophyConditionTypes.has_gold_over:
                case TrophyConditionTypes.complete_all_quest_mission_total:
                case TrophyConditionTypes.complete_all_mission_count:
                case TrophyConditionTypes.complete_story_mission_count:
                    QuestTypes quest_type1 = QuestTypes.Story;
                    if (!questParam.TransSectionGotoQuest(dataOfClass.Objectives[0].sval_base, out quest_type1, new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    switch (quest_type1)
                    {
                    case QuestTypes.Multi:
                    case QuestTypes.MultiGps:
                        this.trophy_window.ActivateOutputLinks(2005);
                        return;

                    case QuestTypes.Event:
                    case QuestTypes.Gps:
                        this.trophy_window.ActivateOutputLinks(2006);
                        return;

                    case QuestTypes.Character:
                        this.trophy_window.ActivateOutputLinks(2032);
                        return;

                    case QuestTypes.Tower:
                        this.trophy_window.ActivateOutputLinks(2026);
                        return;

                    case QuestTypes.Beginner:
                        this.trophy_window.ActivateOutputLinks(2033);
                        return;

                    default:
                        this.trophy_window.ActivateOutputLinks(2002);
                        return;
                    }

                case TrophyConditionTypes.winelite:
                case TrophyConditionTypes.loseelite:
                    if (!questParam.TransSectionGotoElite(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    this.trophy_window.ActivateOutputLinks(2002);
                    break;

                case TrophyConditionTypes.winevent:
                case TrophyConditionTypes.loseevent:
                case TrophyConditionTypes.exclear_fire:
                case TrophyConditionTypes.exclear_water:
                case TrophyConditionTypes.exclear_wind:
                case TrophyConditionTypes.exclear_thunder:
                case TrophyConditionTypes.exclear_light:
                case TrophyConditionTypes.exclear_dark:
                case TrophyConditionTypes.exclear_fire_nocon:
                case TrophyConditionTypes.exclear_water_nocon:
                case TrophyConditionTypes.exclear_wind_nocon:
                case TrophyConditionTypes.exclear_thunder_nocon:
                case TrophyConditionTypes.exclear_light_nocon:
                case TrophyConditionTypes.exclear_dark_nocon:
                case TrophyConditionTypes.complete_event_mission_count:
                    questParam.GotoEventListQuest((string)null, (string)null);
                    this.trophy_window.ActivateOutputLinks(2006);
                    break;

                case TrophyConditionTypes.gacha:
                case TrophyConditionTypes.collectunits:
                    this.trophy_window.ActivateOutputLinks(2001);
                    break;

                case TrophyConditionTypes.multiplay:
                case TrophyConditionTypes.winmulti:
                case TrophyConditionTypes.winmultimore:
                case TrophyConditionTypes.winmultiless:
                    this.trophy_window.ActivateOutputLinks(2005);
                    break;

                case TrophyConditionTypes.ability:
                case TrophyConditionTypes.changeability:
                case TrophyConditionTypes.makeabilitylevel:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.soubi:
                    this.GotoEquip();
                    break;

                case TrophyConditionTypes.buygold:
                    this.trophy_window.ActivateOutputLinks(2003);
                    break;

                case TrophyConditionTypes.arena:
                case TrophyConditionTypes.winarena:
                case TrophyConditionTypes.losearena:
                case TrophyConditionTypes.becomearenarank:
                case TrophyConditionTypes.overarenarank:
                    this.GotoArena();
                    break;

                case TrophyConditionTypes.review:
                    this.trophy_window.ActivateOutputLinks(2029);
                    break;

                case TrophyConditionTypes.fggid:
                    this.trophy_window.ActivateOutputLinks(2008);
                    break;

                case TrophyConditionTypes.unitlevel:
                case TrophyConditionTypes.evolutionnum:
                case TrophyConditionTypes.joblevel:
                case TrophyConditionTypes.upunitlevel:
                case TrophyConditionTypes.makeunitlevel:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.unitequip:
                case TrophyConditionTypes.upjoblevel:
                case TrophyConditionTypes.makejoblevel:
                case TrophyConditionTypes.totaljoblv11:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.limitbreak:
                case TrophyConditionTypes.evoltiontimes:
                case TrophyConditionTypes.changejob:
                case TrophyConditionTypes.totalunitlvs:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.buyatshop:
                    this.GotoShop(dataOfClass);
                    break;

                case TrophyConditionTypes.artifacttransmute:
                case TrophyConditionTypes.artifactstrength:
                case TrophyConditionTypes.artifactevolution:
                case TrophyConditionTypes.upartifactlevel:
                case TrophyConditionTypes.makeartifactlevel:
                    this.trophy_window.ActivateOutputLinks(2021);
                    break;

                case TrophyConditionTypes.wintower:
                case TrophyConditionTypes.losetower:
                case TrophyConditionTypes.tower:
                case TrophyConditionTypes.overtowerscore:
                    QuestTypes quest_type2 = QuestTypes.Tower;
                    if (!questParam.TransSectionGotoTower(dataOfClass.Objectives[0].sval_base, out quest_type2))
                    {
                        break;
                    }
                    QuestTypes questTypes = quest_type2;
                    switch (questTypes)
                    {
                    case QuestTypes.Gps:
                        this.trophy_window.ActivateOutputLinks(2006);
                        return;

                    case QuestTypes.Beginner:
                        this.trophy_window.ActivateOutputLinks(2033);
                        return;

                    default:
                        if (questTypes != QuestTypes.Event)
                        {
                            this.trophy_window.ActivateOutputLinks(2026);
                            return;
                        }
                        goto case QuestTypes.Gps;
                    }

                case TrophyConditionTypes.vs:
                case TrophyConditionTypes.vswin:
                case TrophyConditionTypes.overvsrankfloor:
                    this.GotoVersus();
                    break;

                case TrophyConditionTypes.winstory_extra:
                    if (!questParam.TransSectionGotoStoryExtra(new UIUtility.DialogResultEvent(this.MsgBoxJumpToQuest)))
                    {
                        break;
                    }
                    this.trophy_window.ActivateOutputLinks(2002);
                    break;

                case TrophyConditionTypes.multitower_help:
                case TrophyConditionTypes.multitower:
                    this.GotoMultiTower();
                    break;

                case TrophyConditionTypes.read_tips:
                case TrophyConditionTypes.read_tips_count:
                    this.GotoBeginnerTop();
                    break;

                case TrophyConditionTypes.up_conceptcard_level:
                case TrophyConditionTypes.up_conceptcard_level_target:
                case TrophyConditionTypes.limitbreak_conceptcard:
                case TrophyConditionTypes.limitbreak_conceptcard_target:
                case TrophyConditionTypes.up_conceptcard_trust:
                case TrophyConditionTypes.up_conceptcard_trust_target:
                case TrophyConditionTypes.max_conceptcard_trust:
                    this.trophy_window.ActivateOutputLinks(2035);
                    break;

                case TrophyConditionTypes.unlock_tobira_total:
                case TrophyConditionTypes.unlock_tobira_unit:
                case TrophyConditionTypes.envy_unlock_unit:
                case TrophyConditionTypes.sloth_unlock_unit:
                case TrophyConditionTypes.lust_unlock_unit:
                case TrophyConditionTypes.greed_unlock_unit:
                case TrophyConditionTypes.wrath_unlock_unit:
                case TrophyConditionTypes.gluttonny_unlock_unit:
                case TrophyConditionTypes.pride_unlock_unit:
                    this.trophy_window.ActivateOutputLinks(2025);
                    break;

                case TrophyConditionTypes.send_present:
                    this.trophy_window.ActivateOutputLinks(2039);
                    break;

                case TrophyConditionTypes.complete_ordeal_mission_count:
                case TrophyConditionTypes.clear_ordeal:
                    this.trophy_window.ActivateOutputLinks(2036);
                    break;

                case TrophyConditionTypes.view_news:
                    this.trophy_window.ActivateOutputLinks(2038);
                    break;
                }
            }
        }
        private void Success()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (Network.Mode == Network.EConnectMode.Offline)
            {
                for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
                {
                    player.GainItem(this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num);
                }
            }
            for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
            {
                player.OnItemQuantityChange(this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num);
            }
            player.OnCoinChange(this.mTrophyParam.Coin);
            player.OnGoldChange(this.mTrophyParam.Gold);
            if (player.Lv > this.mLevelOld)
            {
                player.OnPlayerLevelChange(player.Lv - this.mLevelOld);
            }
            GlobalVars.PlayerLevelChanged.Set(player.Lv != this.mLevelOld);
            GlobalVars.PlayerExpNew.Set(player.Exp);
            player.MarkTrophiesEnded(new TrophyParam[1]
            {
                this.mTrophyParam
            });
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.RewardWindow, (UnityEngine.Object)null))
            {
                RewardData data = new RewardData();
                data.Coin = this.mTrophyParam.Coin;
                data.Gold = this.mTrophyParam.Gold;
                data.Exp  = this.mTrophyParam.Exp;
                if (data.Coin > 0)
                {
                    AnalyticsManager.TrackFreePremiumCurrencyObtain((long)data.Coin, "Milestone Reward");
                }
                if (data.Gold > 0)
                {
                    AnalyticsManager.TrackNonPremiumCurrencyObtain(AnalyticsManager.NonPremiumCurrencyType.Zeni, (long)data.Gold, "Milestone Reward", (string)null);
                }
                GameManager instance = MonoSingleton <GameManager> .Instance;
                for (int index = 0; index < this.mTrophyParam.Items.Length; ++index)
                {
                    ItemData itemData = new ItemData();
                    if (itemData.Setup(0L, this.mTrophyParam.Items[index].iname, this.mTrophyParam.Items[index].Num))
                    {
                        data.Items.Add(itemData);
                        ItemData itemDataByItemId = instance.Player.FindItemDataByItemID(itemData.Param.iname);
                        int      num = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                        data.ItemsBeforeAmount.Add(num);
                        AnalyticsManager.TrackNonPremiumCurrencyObtain(itemDataByItemId.Param.type != EItemType.Ticket ? AnalyticsManager.NonPremiumCurrencyType.Item : AnalyticsManager.NonPremiumCurrencyType.SummonTicket, (long)itemDataByItemId.Num, "Milestone Reward", itemDataByItemId.ItemID);
                    }
                }
                DataSource.Bind <RewardData>(this.RewardWindow, data);
            }
            GameCenterManager.SendAchievementProgress(this.mTrophyParam.iname);
            if (this.mTrophyParam != null && this.mTrophyParam.Objectives != null)
            {
                for (int index = 0; index < this.mTrophyParam.Objectives.Length; ++index)
                {
                    if (this.mTrophyParam.Objectives[index].type == TrophyConditionTypes.followtwitter)
                    {
                        string reviewUrlTwitter = this.ReviewURL_Twitter;
                        if (!string.IsNullOrEmpty(reviewUrlTwitter))
                        {
                            Application.OpenURL(reviewUrlTwitter);
                            break;
                        }
                        break;
                    }
                }
            }
            ((Behaviour)this).set_enabled(false);
            this.ActivateOutputLinks(1);
        }
Example #22
0
        public virtual void Refresh()
        {
            if (this.UseGlobalVar)
            {
                DataSource.Bind <RewardData>(((Component)this).get_gameObject(), (RewardData)GlobalVars.LastReward);
            }
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ArenaMedalRow, (Object)null))
            {
                this.ArenaMedalRow.SetActive(dataOfClass.ArenaMedal > 0);
            }
            if (Object.op_Inequality((Object)this.MultiCoinRow, (Object)null))
            {
                this.MultiCoinRow.SetActive(dataOfClass.MultiCoin > 0);
            }
            if (Object.op_Inequality((Object)this.KakeraCoinRow, (Object)null))
            {
                this.KakeraCoinRow.SetActive(dataOfClass.KakeraCoin > 0);
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                this.ExpRow.SetActive(dataOfClass.Exp > 0);
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                this.GoldRow.SetActive(dataOfClass.Gold > 0);
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                this.CoinRow.SetActive(dataOfClass.Coin > 0);
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                this.StaminaRow.SetActive(dataOfClass.Stamina > 0);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (Object.op_Inequality((Object)this.ItemSeparator, (Object)null))
            {
                this.ItemSeparator.SetActive(dataOfClass.Items.Count > 0);
            }
            if (Object.op_Inequality((Object)this.ArtifactTemplate, (Object)null))
            {
                Transform transform = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ArtifactTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataOfClass.GiftRecieveItemDataDic.Values.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GiftRecieveItemData current    = enumerator.Current;
                        GameObject          gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactTemplate);
                        this.mItems.Add(gameObject);
                        DataSource.Bind <GiftRecieveItemData>(gameObject, current);
                        gameObject.get_transform().SetParent(transform, false);
                        gameObject.SetActive(true);
                    }
                }
            }
            if (!Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                return;
            }
            Transform transform1 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
            Transform transform2 = (Transform)null;

            if (Object.op_Inequality((Object)this.EventCoinTemplate, (Object)null))
            {
                transform2 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.EventCoinTemplate.get_transform().get_parent() : this.ItemList.get_transform();
            }
            List <ItemParam> itemParamList = (List <ItemParam>)null;

            for (int index = 0; index < dataOfClass.Items.Count; ++index)
            {
                ItemData   data = dataOfClass.Items[index];
                GameObject gameObject;
                if (data.ItemType != EItemType.EventCoin || Object.op_Equality((Object)transform2, (Object)null))
                {
                    gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate);
                    gameObject.get_transform().SetParent(transform1, false);
                }
                else
                {
                    gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.EventCoinTemplate);
                    gameObject.get_transform().SetParent(transform2, false);
                }
                this.mItems.Add(gameObject);
                DataSource.Bind <ItemData>(gameObject, data);
                gameObject.SetActive(true);
                if (!this.UseBindDataOnly)
                {
                    if (itemParamList == null)
                    {
                        itemParamList = new List <ItemParam>();
                    }
                    itemParamList.Add(data.Param);
                }
            }
        }
Example #23
0
        public virtual void Refresh()
        {
            if (this.UseGlobalVar)
            {
                DataSource.Bind <RewardData>(((Component)this).get_gameObject(), (RewardData)GlobalVars.LastReward);
            }
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ArenaMedalRow, (Object)null))
            {
                this.ArenaMedalRow.SetActive(dataOfClass.ArenaMedal > 0);
            }
            if (Object.op_Inequality((Object)this.MultiCoinRow, (Object)null))
            {
                this.MultiCoinRow.SetActive(dataOfClass.MultiCoin > 0);
            }
            if (Object.op_Inequality((Object)this.KakeraCoinRow, (Object)null))
            {
                this.KakeraCoinRow.SetActive(dataOfClass.KakeraCoin > 0);
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                this.ExpRow.SetActive(dataOfClass.Exp > 0);
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                this.GoldRow.SetActive(dataOfClass.Gold > 0);
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                this.CoinRow.SetActive(dataOfClass.Coin > 0);
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                this.StaminaRow.SetActive(dataOfClass.Stamina > 0);
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            if (Object.op_Inequality((Object)this.ItemSeparator, (Object)null))
            {
                this.ItemSeparator.SetActive(dataOfClass.Items.Count > 0);
            }
            if (Object.op_Inequality((Object)this.ArtifactTemplate, (Object)null))
            {
                Transform transform = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ArtifactTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (Dictionary <string, GiftRecieveItemData> .ValueCollection.Enumerator enumerator = dataOfClass.GiftRecieveItemDataDic.Values.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        GiftRecieveItemData current    = enumerator.Current;
                        GameObject          gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.ArtifactTemplate);
                        this.mItems.Add(gameObject);
                        DataSource.Bind <GiftRecieveItemData>(gameObject, current);
                        gameObject.get_transform().SetParent(transform, false);
                        gameObject.SetActive(true);
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                Transform itemParent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                this.RefreshItems(dataOfClass, itemParent, this.ItemTemplate);
            }
            if (!Object.op_Inequality((Object)this.ArtifactTemplate2, (Object)null))
            {
                return;
            }
            Transform parent = this.ArtifactTemplate2.get_transform().get_parent();

            this.RefreshArtifacts(dataOfClass, parent, this.ArtifactTemplate2);
        }
        public void ReceiveReward(VersusRankMissionParam mission)
        {
            GameManager gm = MonoSingleton <GameManager> .Instance;

            gm.Player.RewardedRankMatchMission(mission.IName);
            RewardData param = new RewardData();

            gm.GetVersusRankClassRewardList(mission.RewardId).ForEach((Action <VersusRankReward>)(reward =>
            {
                switch (reward.Type)
                {
                case RewardType.Item:
                    ItemParam itemParam = gm.GetItemParam(reward.IName);
                    if (itemParam == null)
                    {
                        break;
                    }
                    ItemData itemData = new ItemData();
                    if (!itemData.Setup(0L, itemParam.iname, reward.Num))
                    {
                        break;
                    }
                    param.Items.Add(itemData);
                    break;

                case RewardType.Gold:
                    param.Gold = reward.Num;
                    break;

                case RewardType.Coin:
                    param.Coin = reward.Num;
                    break;

                case RewardType.Artifact:
                    ArtifactParam artifactParam = gm.MasterParam.GetArtifactParam(reward.IName);
                    if (artifactParam == null)
                    {
                        break;
                    }
                    param.Artifacts.Add(new ArtifactRewardData()
                    {
                        ArtifactParam = artifactParam,
                        Num           = 1
                    });
                    break;

                case RewardType.Unit:
                    if (gm.GetUnitParam(reward.IName) == null)
                    {
                        break;
                    }
                    param.GiftRecieveItemDataDic.Add(reward.IName, new GiftRecieveItemData()
                    {
                        iname = reward.IName,
                        num   = 1,
                        type  = GiftTypes.Unit
                    });
                    break;
                }
            }));
            GlobalVars.LastReward.Set(param);
            this.mAPIType = RankMatchMissionWindow.APIType.MISSION_EXEC;
            Network.RequestAPI((WebAPI) new ReqRankMatchMissionExec(mission.IName, new Network.ResponseCallback(this.ResponseCallback)), false);
        }
Example #25
0
        public override void Refresh()
        {
            RewardData dataOfClass = DataSource.FindDataOfClass <RewardData>(((Component)this).get_gameObject(), (RewardData)null);

            GameUtility.DestroyGameObjects(this.mItems);
            this.mItems.Clear();
            if (dataOfClass == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ExpRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ExpRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Exp > 0)
                {
                    this.AddRewardList(this.ExpRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.GoldRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.GoldRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Gold > 0)
                {
                    this.AddRewardList(this.GoldRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.CoinRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.CoinRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Coin > 0)
                {
                    this.AddRewardList(this.CoinRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.StaminaRow, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.StaminaRow.get_transform().get_parent() : this.ItemList.get_transform();
                if (dataOfClass.Stamina > 0)
                {
                    this.AddRewardList(this.StaminaRow, parent);
                }
            }
            if (Object.op_Inequality((Object)this.ItemTemplate, (Object)null))
            {
                Transform parent1 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ItemTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                Transform parent2 = (Transform)null;
                if (Object.op_Inequality((Object)this.EventCoinTemplate, (Object)null))
                {
                    parent2 = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.EventCoinTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                }
                for (int index = 0; index < dataOfClass.Items.Count; ++index)
                {
                    ItemData data = dataOfClass.Items[index];
                    DataSource.Bind <ItemData>(data.ItemType != EItemType.Unit || !Object.op_Inequality((Object)this.UnitTemplate, (Object)null) ? (data.ItemType != EItemType.EventCoin || Object.op_Equality((Object)parent2, (Object)null) ? this.AddRewardList(this.ItemTemplate, parent1) : this.AddRewardList(this.EventCoinTemplate, parent2)) : this.AddRewardList(this.UnitTemplate, parent1), data);
                }
            }
            if (Object.op_Inequality((Object)this.ArtifactTemplate, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ArtifactTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (List <ArtifactRewardData> .Enumerator enumerator = dataOfClass.Artifacts.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        ArtifactRewardData current = enumerator.Current;
                        DataSource.Bind <ArtifactRewardData>(this.AddRewardList(this.ArtifactTemplate, parent), current);
                    }
                }
            }
            if (Object.op_Inequality((Object)this.ConceptCardTemplate, (Object)null))
            {
                Transform parent = !Object.op_Inequality((Object)this.ItemList, (Object)null) ? this.ConceptCardTemplate.get_transform().get_parent() : this.ItemList.get_transform();
                using (Dictionary <string, GiftRecieveItemData> .Enumerator enumerator = dataOfClass.GiftRecieveItemDataDic.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        KeyValuePair <string, GiftRecieveItemData> current = enumerator.Current;
                        if (current.Value.type == GiftTypes.ConceptCard)
                        {
                            GameObject      gameObject          = this.AddRewardList(this.ConceptCardTemplate, parent);
                            GiftRecieveItem componentInChildren = (GiftRecieveItem)gameObject.GetComponentInChildren <GiftRecieveItem>();
                            DataSource.Bind <GiftRecieveItemData>(gameObject, current.Value);
                            gameObject.SetActive(true);
                            componentInChildren.UpdateValue();
                        }
                    }
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }