Example #1
0
        private RecentPartyPanel CreatePartyPanel(UnitData[] party, SupportData support, RecentPartyList.JSON_List record, SRPG_Button.ButtonClickEvent buttonClickCallback)
        {
            RecentPartyPanel component = (RecentPartyPanel)((GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)((Component)this.PartyPanelTemplate).get_gameObject())).GetComponent <RecentPartyPanel>();

            component.SetPartyInfo(party, support, this.mCurrentQuest);
            component.SetUnitIconPressedCallback(buttonClickCallback);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component.UserName, (UnityEngine.Object)null))
            {
                component.UserName.set_text(record.detail.my.name);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component.Level, (UnityEngine.Object)null))
            {
                component.Level.set_text(record.detail.my.lv.ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component.ClearDate, (UnityEngine.Object)null))
            {
                component.ClearDate.set_text(this.GetClearedTime(record.created_at));
            }
            if (component.ConditionStars != null)
            {
                for (int index = 0; index < record.achieved.Length && index < component.ConditionStars.Length; ++index)
                {
                    component.ConditionStars[index].SetActive(record.achieved[index] != 0);
                }
            }
            if (component.ConditionItems != null && this.mCurrentQuest.type == QuestTypes.Tower && component.ConditionItems.Length >= 3)
            {
                component.ConditionItems[2].SetActive(false);
            }
            ((Component)component).get_gameObject().SetActive(true);
            return(component);
        }
Example #2
0
        private void LoadAllParties(RecentPartyList.JSON_List[] winRecords)
        {
            int num = 0;

            foreach (RecentPartyList.JSON_List winRecord in winRecords)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: reference to a compiler-generated method
                SRPG_Button.ButtonClickEvent buttonClickEvent = new SRPG_Button.ButtonClickEvent(new RecentPartyList.\u003CLoadAllParties\u003Ec__AnonStorey375()
                {
                    \u003C\u003Ef__this = this, index = num
                }.\u003C\u003Em__3FF);
                if (winRecord.id > this.mUnitId)
                {
                    this.mUnitId = winRecord.id;
                }
                UnitData[]  party         = this.LoadParty((IEnumerable <Json_Unit>)winRecord.detail.my.units);
                SupportData support       = this.LoadHelpUnit(winRecord.detail.help);
                ItemData[]  itemDataArray = this.LoadUsedItems(winRecord.detail.items);
                this.allParties.Add(party);
                this.allHelpUnits.Add(support);
                this.allAchieves.Add(winRecord.achieved);
                this.allUsedItems.Add(itemDataArray);
                RecentPartyPanel partyPanel = this.CreatePartyPanel(party, support, winRecord, buttonClickEvent);
                this.allTeamPanel.Add(partyPanel);
                ((Component)partyPanel).get_transform().SetParent(this.PartyPanelHolder.get_gameObject().get_transform(), false);
                SRPG_Button component = (SRPG_Button)((Component)partyPanel).GetComponent <SRPG_Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    component.AddListener(buttonClickEvent);
                }
                ++num;
            }
        }
Example #3
0
        private void LoadAllParties(RecentPartyList.JSON_List[] winRecords)
        {
            int num = 0;

            foreach (RecentPartyList.JSON_List winRecord in winRecords)
            {
                int index = num;
                SRPG_Button.ButtonClickEvent buttonClickEvent = (SRPG_Button.ButtonClickEvent)(b => this.OnButtonClick(index));
                if (winRecord.id > this.mUnitId)
                {
                    this.mUnitId = winRecord.id;
                }
                UnitData[]  party         = this.LoadParty((IEnumerable <Json_Unit>)winRecord.detail.my.units);
                SupportData support       = this.LoadHelpUnit(winRecord.detail.help);
                ItemData[]  itemDataArray = this.LoadUsedItems(winRecord.detail.items);
                this.allParties.Add(((IEnumerable <UnitData>)party).ToArray <UnitData>());
                this.allHelpUnits.Add(support);
                this.allAchieves.Add(winRecord.achieved);
                this.allUsedItems.Add(itemDataArray);
                RecentPartyPanel partyPanel = this.CreatePartyPanel(party, support, winRecord, buttonClickEvent);
                this.allTeamPanel.Add(partyPanel);
                ((Component)partyPanel).get_transform().SetParent(this.PartyPanelHolder.get_gameObject().get_transform(), false);
                SRPG_Button component = (SRPG_Button)((Component)partyPanel).GetComponent <SRPG_Button>();
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                {
                    component.AddListener(buttonClickEvent);
                }
                ++num;
            }
        }
        private void Start()
        {
            this.mIsUserOwnUnits = GlobalVars.UserSelectionPartyDataInfo == null;
            if (this.mIsUserOwnUnits)
            {
                this.mCurrentSupport = MonoSingleton <GameManager> .Instance.Player.Supports.Find((Predicate <SupportData>)(f => f.FUID == GlobalVars.SelectedFriendID));

                if (this.mCurrentSupport == null)
                {
                    this.mCurrentSupport = GlobalVars.SelectedSupport.Get();
                }
            }
            else
            {
                this.mUserSelectionParty       = GlobalVars.UserSelectionPartyDataInfo.unitData;
                this.mCurrentSupport           = GlobalVars.UserSelectionPartyDataInfo.supportData;
                this.mUserSelectionAchievement = GlobalVars.UserSelectionPartyDataInfo.achievements;
                this.mUsedItems = GlobalVars.UserSelectionPartyDataInfo.usedItems;
            }
            foreach (GameObject enableUploadObject in this.EnableUploadObjects)
            {
                enableUploadObject.SetActive(this.mIsUserOwnUnits);
            }
            GameUtility.SetGameObjectActive((Component)this.UnitSlotTemplate, false);
            GameUtility.SetGameObjectActive((Component)this.NpcSlotTemplate, false);
            this.LoadParty();
            this.CreateSlots();
            this.UpdateLeaderSkills();
            this.CalcTotalAttack();
            this.LoadInventory();
            this.LoadConditions();
        }
Example #5
0
        public void SetPartyInfo(UnitData[] party, SupportData supportData, QuestParam questParam)
        {
            this.mCurrentQuest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

            this.mCurrentParty   = party;
            this.mCurrentSupport = supportData;
            this.CreateSlots();
        }
Example #6
0
        protected override UnitData GetInstanceData()
        {
            SupportData supportData = this.GetSupportData();

            if (supportData == null || supportData.Unit == null)
            {
                return((UnitData)null);
            }
            return(supportData.Unit);
        }
Example #7
0
        private SupportData LoadHelpUnit(Json_Support json)
        {
            if (json == null)
            {
                return((SupportData)null);
            }
            SupportData supportData = new SupportData();

            supportData.Deserialize(json);
            return(supportData);
        }
Example #8
0
 public Api_SupportList(FlowNode_ReqSupportList node, SerializeValueList valueList, bool isForce)
     : base(node)
 {
     this.m_Element = valueList.GetEnum <EElement>("element");
     this.m_IsForce = isForce;
     if (!UnityEngine.Object.op_Inequality((UnityEngine.Object)node.m_Window, (UnityEngine.Object)null))
     {
         return;
     }
     this.m_Select = node.m_Window.GetData <SupportData>("data_support");
 }
        private void UpdateLeaderSkills()
        {
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LeaderSkill, (UnityEngine.Object)null))
            {
                SkillParam data = (SkillParam)null;
                if (this.mIsHeloOnly)
                {
                    if (this.mGuestUnits != null && this.mGuestUnits.Count > 0 && this.mGuestUnits[0].LeaderSkill != null)
                    {
                        data = this.mGuestUnits[0].LeaderSkill.SkillParam;
                    }
                }
                else if (this.mCurrentParty[0] != null)
                {
                    if (this.mCurrentParty[0].LeaderSkill != null)
                    {
                        data = this.mCurrentParty[0].LeaderSkill.SkillParam;
                    }
                }
                else if (this.mSlotData[0].Type == PartySlotType.Npc || this.mSlotData[0].Type == PartySlotType.NpcHero)
                {
                    UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(this.mSlotData[0].UnitName);

                    if (unitParam != null && unitParam.leader_skills != null && unitParam.leader_skills.Length >= 4)
                    {
                        string leaderSkill = unitParam.leader_skills[4];
                        if (!string.IsNullOrEmpty(leaderSkill))
                        {
                            data = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(leaderSkill);
                        }
                    }
                }
                else if (this.mGuestUnits != null && this.mGuestUnits.Count > 0 && this.mGuestUnits[0].LeaderSkill != null)
                {
                    data = this.mGuestUnits[0].LeaderSkill.SkillParam;
                }
                this.LeaderSkill.SetSlotData <SkillParam>(data);
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SupportSkill, (UnityEngine.Object)null))
            {
                return;
            }
            SupportData supportData = !this.mIsUserOwnUnits ? this.mCurrentSupport : MonoSingleton <GameManager> .Instance.Player.Supports.Find((Predicate <SupportData>)(f => f.FUID == GlobalVars.SelectedFriendID)) ?? GlobalVars.SelectedSupport.Get();

            SkillParam data1 = (SkillParam)null;

            if (supportData != null && supportData.Unit.LeaderSkill != null && supportData.IsFriend())
            {
                data1 = supportData.Unit.LeaderSkill.SkillParam;
            }
            this.SupportSkill.SetSlotData <SkillParam>(data1);
        }
        private void ReflectionUnitSlot()
        {
            int index1 = 0;

            for (int index2 = 0; index2 < this.UnitSlots.Length && index2 < this.mCurrentParty.Length && index2 < this.mSlotData.Count; ++index2)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnitSlots[index2], (UnityEngine.Object)null))
                {
                    this.UnitSlots[index2].SetSlotData <QuestParam>(this.mCurrentQuest);
                    PartySlotData partySlotData = this.mSlotData[index2];
                    if (partySlotData.Type == PartySlotType.ForcedHero)
                    {
                        if (this.mGuestUnits != null && index1 < this.mGuestUnits.Count)
                        {
                            this.UnitSlots[index2].SetSlotData <UnitData>(this.mGuestUnits[index1]);
                        }
                        ++index1;
                    }
                    else if (partySlotData.Type == PartySlotType.Npc || partySlotData.Type == PartySlotType.NpcHero)
                    {
                        UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(partySlotData.UnitName);

                        this.UnitSlots[index2].SetSlotData <UnitParam>(unitParam);
                    }
                    else
                    {
                        this.UnitSlots[index2].SetSlotData <UnitData>(this.mCurrentParty[index2]);
                    }
                }
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FriendSlot, (UnityEngine.Object)null))
            {
                return;
            }
            this.FriendSlot.SetSlotData <QuestParam>(this.mCurrentQuest);
            this.FriendSlot.SetSlotData <SupportData>(this.mCurrentSupport);
            if (this.mIsUserOwnUnits)
            {
                this.mCurrentSupport = MonoSingleton <GameManager> .Instance.Player.Supports.Find((Predicate <SupportData>)(f => f.FUID == GlobalVars.SelectedFriendID)) ?? GlobalVars.SelectedSupport.Get();

                this.FriendSlot.SetSlotData <UnitData>(this.mCurrentSupport != null ? this.mCurrentSupport.Unit : (UnitData)null);
            }
            else
            {
                if (this.mCurrentSupport == null)
                {
                    return;
                }
                this.FriendSlot.SetSlotData <UnitData>(this.mCurrentSupport.Unit);
            }
        }
Example #11
0
 public void Deserialize(Json_Support[] json)
 {
     this.m_SupportData = new SupportData[json.Length];
     for (int index = 0; index < json.Length; ++index)
     {
         SupportData supportData = new SupportData();
         try
         {
             supportData.Deserialize(json[index]);
             this.m_SupportData[index] = supportData;
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
         }
     }
 }
Example #12
0
        protected override void ShowTooltip(Vector2 screen)
        {
            if (!this.Tooltip)
            {
                return;
            }
            SupportData supportData = this.GetSupportData();

            if (supportData == null || supportData.Unit == null)
            {
                return;
            }
            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)AssetManager.Load <GameObject>("UI/SupportTooltip"));

            DataSource.Bind <UnitData>(gameObject, supportData.Unit);
            DataSource.Bind <SupportData>(gameObject, supportData);
        }
Example #13
0
        private void LoadTeam()
        {
            GameUtility.DestroyGameObjects(this.mTeamPanels);
            this.mTeamPanels.Clear();
            GlobalVars.OrdealParties = this.LoadTeamFromPlayerPrefs();
            List <PartyEditData> ordealParties  = GlobalVars.OrdealParties;
            List <SupportData>   ordealSupports = GlobalVars.OrdealSupports;

            for (int index = 0; index < ordealParties.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                OrdealQuestList.\u003CLoadTeam\u003Ec__AnonStorey368 teamCAnonStorey368 = new OrdealQuestList.\u003CLoadTeam\u003Ec__AnonStorey368();
                // ISSUE: reference to a compiler-generated field
                teamCAnonStorey368.\u003C\u003Ef__this = this;
                OrdealTeamPanel component = (OrdealTeamPanel)((GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)((Component)this.TeamPanelTemplate).get_gameObject())).GetComponent <OrdealTeamPanel>();
                ((Component)component).get_gameObject().SetActive(true);
                foreach (UnitData unit in ordealParties[index].Units)
                {
                    if (unit != null)
                    {
                        component.Add(unit);
                    }
                }
                // ISSUE: reference to a compiler-generated field
                teamCAnonStorey368.index = index;
                // ISSUE: method pointer
                ((UnityEvent)component.Button.get_onClick()).AddListener(new UnityAction((object)teamCAnonStorey368, __methodptr(\u003C\u003Em__37A)));
                component.TeamName.set_text(ordealParties[index].Name);
                SupportData supportData = (SupportData)null;
                if (ordealSupports != null && index < ordealSupports.Count)
                {
                    supportData = ordealSupports[index];
                    component.SetSupport(supportData);
                }
                int num = PartyUtility.CalcTotalAttack(ordealParties[index], MonoSingleton <GameManager> .Instance.Player.Units, supportData, (List <UnitData>)null);
                component.TotalAtack.set_text(num.ToString());
                this.mTeamPanels.Add(((Component)component).get_gameObject());
                ((Component)component).get_transform().SetParent(this.TeamPanelContainer.get_transform(), false);
            }
            this.CheckPlayableTeams(this.mCurrentQuest, ordealParties, ordealSupports);
        }
Example #14
0
        private RecentPartyPanel CreatePartyPanel(UnitData[] party, SupportData support, RecentPartyList.JSON_List record, SRPG_Button.ButtonClickEvent buttonClickCallback)
        {
            RecentPartyPanel component = (RecentPartyPanel)((GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)((Component)this.PartyPanelTemplate).get_gameObject())).GetComponent <RecentPartyPanel>();

            component.SetPartyInfo(party, support, this.mCurrentQuest);
            component.SetUnitIconPressedCallback(buttonClickCallback);
            component.SetUserName(record.detail.my.name);
            component.SetUserRank(record.detail.my.lv.ToString());
            component.SetClearDate(this.GetClearedTime(record.created_at));
            for (int index = 0; index < record.achieved.Length; ++index)
            {
                component.SetConditionStarActive(index, record.achieved[index] != 0);
            }
            if (this.mCurrentQuest.type == QuestTypes.Tower)
            {
                component.SetConditionItemActive(2, false);
            }
            ((Component)component).get_gameObject().SetActive(true);
            return(component);
        }
Example #15
0
 private void Start()
 {
     this.mIsUserOwnUnits = GlobalVars.UserSelectionPartyDataInfo == null;
     if (!this.mIsUserOwnUnits)
     {
         this.mUserSelectionParty       = GlobalVars.UserSelectionPartyDataInfo.unitData;
         this.mSupportData              = GlobalVars.UserSelectionPartyDataInfo.supportData;
         this.mUserSelectionAchievement = GlobalVars.UserSelectionPartyDataInfo.achievements;
         this.mUsedItems = GlobalVars.UserSelectionPartyDataInfo.usedItems;
     }
     foreach (GameObject enableUploadObject in this.EnableUploadObjects)
     {
         enableUploadObject.SetActive(this.mIsUserOwnUnits);
     }
     this.LoadParty();
     this.UpdateLeaderSkills();
     this.CalcTotalAttack();
     this.LoadInventory();
     this.LoadConditions();
 }
Example #16
0
        public ReqBtlOrdealReq(string iname, List <SupportData> supports, Network.ResponseCallback response)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = "btl/ordeal/req";
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            stringBuilder.Append("\"req_at\":");
            stringBuilder.Append(Network.GetServerTime());
            stringBuilder.Append(",");
            stringBuilder.Append("\"btlparam\":{\"helps\":[");
            for (int index = 0; index < supports.Count; ++index)
            {
                if (supports != null)
                {
                    if (index > 0)
                    {
                        stringBuilder.Append(",");
                    }
                    SupportData support = supports[index];
                    if (support == null)
                    {
                        stringBuilder.Append("{}");
                    }
                    else
                    {
                        stringBuilder.Append("{");
                        stringBuilder.Append("\"fuid\":");
                        stringBuilder.Append("\"" + support.FUID + "\"");
                        stringBuilder.Append(",\"elem\":" + (object)support.Unit.SupportElement);
                        stringBuilder.Append(",\"iname\":\"" + support.Unit.UnitID + "\"");
                        stringBuilder.Append("}");
                    }
                }
            }
            stringBuilder.Append("]");
            stringBuilder.Append("}");
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
Example #17
0
        private void UpdateLeaderSkills()
        {
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.LeaderSkill, (UnityEngine.Object)null))
            {
                SkillParam data = (SkillParam)null;
                if (this.mIsHeloOnly)
                {
                    if (this.mGuestUnit != null && this.mGuestUnit.LeaderSkill != null)
                    {
                        data = this.mGuestUnit.LeaderSkill.SkillParam;
                    }
                }
                else if (this.mCurrentParty[0] != null)
                {
                    if (this.mCurrentParty[0].LeaderSkill != null)
                    {
                        data = this.mCurrentParty[0].LeaderSkill.SkillParam;
                    }
                }
                else if (this.mGuestUnit != null && this.mGuestUnit.LeaderSkill != null)
                {
                    data = this.mGuestUnit.LeaderSkill.SkillParam;
                }
                this.LeaderSkill.SetSlotData <SkillParam>(data);
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SupportSkill, (UnityEngine.Object)null))
            {
                return;
            }
            SupportData supportData = !this.mIsUserOwnUnits ? this.mSupportData : MonoSingleton <GameManager> .Instance.Player.Supports.Find((Predicate <SupportData>)(f => f.FUID == GlobalVars.SelectedFriendID));

            SkillParam data1 = (SkillParam)null;

            if (supportData != null && supportData.Unit.LeaderSkill != null)
            {
                data1 = supportData.Unit.LeaderSkill.SkillParam;
            }
            this.SupportSkill.SetSlotData <SkillParam>(data1);
        }
        public SupportData CreateSupportData()
        {
            if (this.units == null || this.units.Length <= 0)
            {
                return((SupportData)null);
            }
            if (this.units[0] == null || this.units[0].unit == null)
            {
                return((SupportData)null);
            }
            SupportData supportData = new SupportData();

            supportData.FUID             = this.FUID;
            supportData.Unit             = this.units[0].unit;
            supportData.PlayerName       = this.playerName;
            supportData.PlayerLevel      = this.playerLevel;
            supportData.UnitID           = supportData.Unit.UnitID;
            supportData.UnitLevel        = supportData.Unit.Lv;
            supportData.UnitRarity       = supportData.Unit.Rarity;
            supportData.JobID            = supportData.Unit.CurrentJob.JobID;
            supportData.LeaderSkillLevel = UnitParam.GetLeaderSkillLevel(supportData.UnitRarity, supportData.Unit.AwakeLv);
            return(supportData);
        }
Example #19
0
        private void LoadParty()
        {
            this.mCurrentQuest = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

            this.mIsHeloOnly = PartyUtility.IsSoloStoryParty(this.mCurrentQuest);
            if (this.StoryNormalObjects != null)
            {
                for (int index = 0; index < this.StoryNormalObjects.Length; ++index)
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.StoryNormalObjects[index], (UnityEngine.Object)null))
                    {
                        this.StoryNormalObjects[index].SetActive(!this.mIsHeloOnly);
                    }
                }
            }
            if (this.HeloOnlyObjects != null)
            {
                for (int index = 0; index < this.HeloOnlyObjects.Length; ++index)
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.HeloOnlyObjects[index], (UnityEngine.Object)null))
                    {
                        this.HeloOnlyObjects[index].SetActive(this.mIsHeloOnly);
                    }
                }
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.GuestUnitSlot, (UnityEngine.Object)null))
            {
                if (this.mIsHeloOnly)
                {
                    ((Component)this.GuestUnitSlot).get_transform().SetSiblingIndex(0);
                }
                else
                {
                    ((Component)this.GuestUnitSlot).get_transform().SetSiblingIndex(4);
                }
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            PartyWindow2.EditPartyTypes type = PartyUtility.GetEditPartyTypes(this.mCurrentQuest);
            if (type == PartyWindow2.EditPartyTypes.Auto)
            {
                type = PartyWindow2.EditPartyTypes.Normal;
            }
            PartyData partyOfType = MonoSingleton <GameManager> .Instance.Player.FindPartyOfType(type.ToPlayerPartyType());

            this.mCurrentParty = new UnitData[partyOfType.MAX_UNIT];
            UnitData data  = (UnitData)null;
            string   iname = this.mCurrentQuest.units.Get(0);

            if (this.mIsUserOwnUnits)
            {
                data = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(iname);

                for (int index = 0; index < partyOfType.MAX_UNIT; ++index)
                {
                    long unitUniqueId = partyOfType.GetUnitUniqueID(index);
                    if (unitUniqueId > 0L)
                    {
                        this.mCurrentParty[index] = player.FindUnitDataByUniqueID(unitUniqueId);
                    }
                }
            }
            else
            {
                for (int index = 0; index < partyOfType.MAX_UNIT && index < this.mUserSelectionParty.Length; ++index)
                {
                    if (this.mUserSelectionParty[index] == null)
                    {
                        this.mCurrentParty[index] = (UnitData)null;
                    }
                    if (this.mUserSelectionParty[index] != null && this.mUserSelectionParty[index].UnitParam.iname == iname)
                    {
                        data = this.mUserSelectionParty[index];
                    }
                    else
                    {
                        this.mCurrentParty[index] = this.mUserSelectionParty[index];
                    }
                }
            }
            int count = this.mCurrentParty.Length - 2;

            UnitData[] array1 = ((IEnumerable <UnitData>) this.mCurrentParty).Skip <UnitData>(count).Take <UnitData>(2).ToArray <UnitData>();
            UnitData[] array2 = ((IEnumerable <UnitData>) this.mCurrentParty).Take <UnitData>(count).ToArray <UnitData>();
            for (int index = 0; index < this.SubUnitSlots.Length && index < array1.Length; ++index)
            {
                this.SubUnitSlots[index].SetSlotData <QuestParam>(this.mCurrentQuest);
                this.SubUnitSlots[index].SetSlotData <UnitData>(array1[index]);
            }
            for (int index = 0; index < this.UnitSlots.Length && index < array2.Length; ++index)
            {
                this.UnitSlots[index].SetSlotData <QuestParam>(this.mCurrentQuest);
                this.UnitSlots[index].SetSlotData <UnitData>(array2[index]);
            }
            if (data != null)
            {
                this.mGuestUnit = data;
                this.GuestUnitSlot.SetSlotData <QuestParam>(this.mCurrentQuest);
                this.GuestUnitSlot.SetSlotData <UnitData>(data);
                ((Component)this.GuestUnitSlot).get_gameObject().SetActive(true);
            }
            else
            {
                ((Component)this.GuestUnitSlot).get_gameObject().SetActive(false);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.FriendSlot, (UnityEngine.Object)null))
            {
                if (this.mCurrentQuest.type == QuestTypes.Tower)
                {
                    ((Component)this.FriendSlot).get_gameObject().SetActive(false);
                }
                else
                {
                    ((Component)this.FriendSlot).get_gameObject().SetActive(true);
                    if (this.mIsUserOwnUnits)
                    {
                        this.mCurrentSupport = (SupportData)GlobalVars.SelectedSupport;
                        this.FriendSlot.SetSlotData <UnitData>(this.mCurrentSupport != null ? this.mCurrentSupport.Unit : (UnitData)null);
                    }
                    else if (this.mSupportData != null)
                    {
                        this.FriendSlot.SetSlotData <UnitData>(this.mSupportData.Unit);
                    }
                }
            }
            int num;

            switch (type)
            {
            case PartyWindow2.EditPartyTypes.Normal:
            case PartyWindow2.EditPartyTypes.Arena:
            case PartyWindow2.EditPartyTypes.ArenaDef:
            case PartyWindow2.EditPartyTypes.Character:
                num = 3;
                break;

            case PartyWindow2.EditPartyTypes.Tower:
                num = 5;
                break;

            default:
                if ((this.mCurrentQuest == null ? 0 : (this.mCurrentQuest.UseFixEditor ? 1 : 0)) == 0)
                {
                    num = 4;
                    break;
                }
                goto case PartyWindow2.EditPartyTypes.Normal;
            }
            for (int index = 0; index < this.UnitSlots.Length; ++index)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnitSlots[index], (UnityEngine.Object)null))
                {
                    ((Component)this.UnitSlots[index]).get_gameObject().SetActive(index < num);
                }
            }
        }
Example #20
0
        public override void OnSuccess(WWWResult www)
        {
            if (Network.IsError)
            {
                switch (Network.ErrCode)
                {
                case Network.EErrCode.RankingQuestMaintenance:
                case Network.EErrCode.RankingQuest_OutOfPeriod:
                    Network.RemoveAPI();
                    ((Behaviour)this).set_enabled(false);
                    this.ActivateOutputLinks(102);
                    break;

                case Network.EErrCode.RankingQuest_NotNewScore:
                case Network.EErrCode.RankingQuest_AlreadyEntry:
                    this.OnFailed();
                    break;

                default:
                    this.OnRetry();
                    break;
                }
            }
            else
            {
                WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> >(www.text);
                DebugUtility.Assert(jsonObject != null, "res == null");
                if (jsonObject.body == null)
                {
                    this.OnRetry();
                }
                else
                {
                    Network.RemoveAPI();
                    GlobalVars.UserSelectionPartyData  selectionPartyData = new GlobalVars.UserSelectionPartyData();
                    FlowNode_ReqQuestRankingParty.Json body = jsonObject.body;
                    if (body.party != null)
                    {
                        UnitData[] unitDataArray = new UnitData[((IEnumerable <Json_Unit>)body.party).Count <Json_Unit>((Func <Json_Unit, bool>)(j => j != null))];
                        for (int index = 0; index < unitDataArray.Length; ++index)
                        {
                            if (body.party[index] == null || string.IsNullOrEmpty(body.party[index].iname))
                            {
                                unitDataArray[index] = (UnitData)null;
                            }
                            else
                            {
                                unitDataArray[index] = new UnitData();
                                unitDataArray[index].Deserialize(body.party[index]);
                            }
                        }
                        selectionPartyData.unitData = unitDataArray;
                    }
                    if (body.items != null)
                    {
                        ItemData[] itemDataArray = new ItemData[body.items.Length];
                        for (int index = 0; index < itemDataArray.Length; ++index)
                        {
                            itemDataArray[index] = new ItemData();
                            itemDataArray[index].Setup(0L, body.items[index].iname, body.items[index].num);
                        }
                        selectionPartyData.usedItems = itemDataArray;
                    }
                    if (body.help != null)
                    {
                        SupportData supportData = new SupportData();
                        supportData.Deserialize(body.help);
                        selectionPartyData.supportData = supportData;
                    }
                    selectionPartyData.achievements       = new int[0];
                    GlobalVars.UserSelectionPartyDataInfo = selectionPartyData;
                    this.Success();
                }
            }
        }
Example #21
0
        public ReqBtlComReq(string iname, string fuid, SupportData support, Network.ResponseCallback response, bool multi, int partyIndex, bool isHost = false, int plid = 0, int seat = 0, [Optional] Vector2 location, RankingQuestParam rankingQuestParam = null)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name = !multi ? "btl/com/req" : "btl/multi/req";
            stringBuilder.Append("\"iname\":\"");
            stringBuilder.Append(iname);
            stringBuilder.Append("\",");
            if (partyIndex >= 0)
            {
                stringBuilder.Append("\"partyid\":");
                stringBuilder.Append(partyIndex);
                stringBuilder.Append(",");
            }
            if (multi)
            {
                stringBuilder.Append("\"token\":\"");
                stringBuilder.Append(JsonEscape.Escape(GlobalVars.SelectedMultiPlayRoomName));
                stringBuilder.Append("\",");
                stringBuilder.Append("\"host\":\"");
                stringBuilder.Append(!isHost ? "0" : "1");
                stringBuilder.Append("\",");
                stringBuilder.Append("\"plid\":\"");
                stringBuilder.Append(plid);
                stringBuilder.Append("\",");
                stringBuilder.Append("\"seat\":\"");
                stringBuilder.Append(seat);
                stringBuilder.Append("\",");
            }
            else
            {
                stringBuilder.Append("\"req_at\":");
                stringBuilder.Append(Network.GetServerTime());
                stringBuilder.Append(",");
            }
            stringBuilder.Append("\"btlparam\":{\"help\":{\"fuid\":");
            stringBuilder.Append("\"" + fuid + "\"");
            if (support != null && support.Unit != null)
            {
                stringBuilder.Append(",\"elem\":" + (object)support.Unit.SupportElement);
                stringBuilder.Append(",\"iname\":\"" + support.Unit.UnitID + "\"");
            }
            stringBuilder.Append("}");
            if (!multi && rankingQuestParam != null)
            {
                stringBuilder.Append(",\"quest_ranking\":{");
                stringBuilder.Append("\"schedule_id\":");
                stringBuilder.Append(rankingQuestParam.schedule_id);
                stringBuilder.Append(",");
                stringBuilder.Append("\"type\":");
                stringBuilder.Append((int)rankingQuestParam.type);
                stringBuilder.Append("}");
            }
            stringBuilder.Append("},");
            stringBuilder.Append("\"location\":{");
            stringBuilder.Append("\"lat\":" + (object)(float)location.x + ",");
            stringBuilder.Append("\"lng\":" + (object)(float)location.y);
            stringBuilder.Append("}");
            DebugMenu.Log("APIReq", stringBuilder.ToString());
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
Example #22
0
        public ReqTowerBtlComEnd(long btlid, Unit[] Player, Unit[] Enemy, int actCount, int round, byte floor, BtlResultTypes result, RandDeckResult[] deck, Network.ResponseCallback response, string trophyprog = null, string bingoprog = null, int[] missions = null, int[] missions_value = null)
        {
            StringBuilder stringBuilder = WebAPI.GetStringBuilder();

            this.name            = "tower/btl/end";
            stringBuilder.Length = 0;
            this.SetValue(ref stringBuilder, "\"btlid\":", btlid);
            stringBuilder.Append("\"btlendparam\":{");
            if (Player != null)
            {
                stringBuilder.Append("\"pdeck\":[");
                for (int index = 0; index < Player.Length; ++index)
                {
                    Unit unit = Player[index];
                    if (unit.Side == EUnitSide.Player && unit.UnitData.UniqueID != 0L)
                    {
                        stringBuilder.Append("{");
                        this.SetValue(ref stringBuilder, "\"iid\":", unit.UnitData.UniqueID);
                        this.SetValue(ref stringBuilder, "\"iname\":\"", unit.UnitData.UnitParam.iname, "\",");
                        int num = Mathf.Max(unit.CalcTowerDamege() - MonoSingleton <GameManager> .Instance.FindTowerFloor(SceneBattle.Instance.Battle.QuestID).CalcHelaNum((int)unit.MaximumStatus.param.hp), 0);
                        this.SetValue(ref stringBuilder, "\"damage\":", (long)num);
                        this.SetValue(ref stringBuilder, "\"is_died\":", !unit.IsDeadCondition() ? 0L : (!unit.IsUnitFlag(EUnitFlag.UnitChanged) ? 1L : 0L), string.Empty);
                        stringBuilder.Append("},");
                    }
                }
                --stringBuilder.Length;
                stringBuilder.Append("],");
            }
            stringBuilder.Append("\"status\":\"");
            switch (result)
            {
            case BtlResultTypes.Win:
                stringBuilder.Append("win");
                break;

            case BtlResultTypes.Lose:
                stringBuilder.Append("lose");
                break;

            case BtlResultTypes.Retire:
                stringBuilder.Append("retire");
                break;

            case BtlResultTypes.Cancel:
                stringBuilder.Append("cancel");
                break;
            }
            stringBuilder.Append("\"");
            stringBuilder.Append(",\"turn\":");
            stringBuilder.Append(actCount);
            stringBuilder.Append(",\"round\":");
            stringBuilder.Append(round);
            stringBuilder.Append(",\"floor\":");
            stringBuilder.Append(floor);
            if (result == BtlResultTypes.Lose)
            {
                stringBuilder.Append(",\"edeck\":[");
                List <Unit> unitList = new List <Unit>((IEnumerable <Unit>)Enemy);
                unitList.RemoveAll((Predicate <Unit>)(x =>
                {
                    if (x.IsBreakObj)
                    {
                        return(!string.IsNullOrEmpty(x.CreateBreakObjId));
                    }
                    return(false);
                }));
                if (MonoSingleton <GameManager> .Instance.TowerResuponse.edeck != null)
                {
                    List <TowerResuponse.EnemyUnit> edeck = MonoSingleton <GameManager> .Instance.TowerResuponse.edeck;
                    int index1 = 0;
                    for (int index2 = 0; index2 < edeck.Count; ++index2)
                    {
                        if (edeck[index2].hp == 0)
                        {
                            stringBuilder.Append("{");
                            this.SetValue(ref stringBuilder, "\"eid\":\"", (long)index2, "\",");
                            this.SetValue(ref stringBuilder, "\"iname\":\"", edeck[index2].iname, "\",");
                            this.SetValue(ref stringBuilder, "\"hp\":", 0L);
                            this.SetValue(ref stringBuilder, "\"jewel\":", 0L, string.Empty);
                            stringBuilder.Append("},");
                        }
                        else
                        {
                            Unit unit = unitList[index1];
                            ++index1;
                            stringBuilder.Append("{");
                            this.SetValue(ref stringBuilder, "\"eid\":\"", (long)index2, "\",");
                            this.SetValue(ref stringBuilder, "\"iname\":\"", unit.UnitParam.iname, "\",");
                            if (unit.IsGimmick && !unit.IsDisableGimmick())
                            {
                                if (unit.IsBreakObj)
                                {
                                    this.SetValue(ref stringBuilder, "\"hp\":", (long)(int)unit.CurrentStatus.param.hp);
                                }
                                else
                                {
                                    this.SetValue(ref stringBuilder, "\"hp\":", 1L);
                                }
                            }
                            else
                            {
                                this.SetValue(ref stringBuilder, "\"hp\":", !unit.IsDead ? (long)(int)unit.CurrentStatus.param.hp : 0L);
                            }
                            this.SetValue(ref stringBuilder, "\"jewel\":", (long)(int)unit.CurrentStatus.param.mp, string.Empty);
                            stringBuilder.Append("},");
                        }
                    }
                }
                else
                {
                    for (int index = 0; index < unitList.Count; ++index)
                    {
                        Unit unit = unitList[index];
                        stringBuilder.Append("{");
                        this.SetValue(ref stringBuilder, "\"eid\":\"", (long)index, "\",");
                        this.SetValue(ref stringBuilder, "\"iname\":\"", unit.UnitParam.iname, "\",");
                        if (unit.IsGimmick && !unit.IsDisableGimmick())
                        {
                            if (unit.IsBreakObj)
                            {
                                this.SetValue(ref stringBuilder, "\"hp\":", (long)(int)unit.CurrentStatus.param.hp);
                            }
                            else
                            {
                                this.SetValue(ref stringBuilder, "\"hp\":", 1L);
                            }
                        }
                        else
                        {
                            this.SetValue(ref stringBuilder, "\"hp\":", !unit.IsDead ? (long)(int)unit.CurrentStatus.param.hp : 0L);
                        }
                        this.SetValue(ref stringBuilder, "\"jewel\":", (long)(int)unit.CurrentStatus.param.mp, string.Empty);
                        stringBuilder.Append("},");
                    }
                }
                --stringBuilder.Length;
                stringBuilder.Append("]");
            }
            SupportData supportData = GlobalVars.SelectedSupport.Get();

            if (GlobalVars.SelectedFriendID != null && supportData != null)
            {
                stringBuilder.Append(",\"help\":{\"fuid\":\"");
                stringBuilder.Append(GlobalVars.SelectedFriendID);
                stringBuilder.Append("\",\"cost\":");
                stringBuilder.Append(supportData.Cost);
                stringBuilder.Append("}");
            }
            if (missions != null && missions_value != null)
            {
                stringBuilder.Append(",");
                stringBuilder.Append("\"missions\":[");
                for (int index = 0; index < missions.Length; ++index)
                {
                    if (index > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(missions[index].ToString());
                }
                stringBuilder.Append("]");
                stringBuilder.Append(",");
                stringBuilder.Append("\"missions_val\":[");
                for (int index = 0; index < missions_value.Length; ++index)
                {
                    if (index > 0)
                    {
                        stringBuilder.Append(',');
                    }
                    stringBuilder.Append(missions_value[index].ToString());
                }
                stringBuilder.Append("]");
            }
            else
            {
                stringBuilder.Append(",");
                stringBuilder.Append("\"missions\":[]");
                stringBuilder.Append(",");
                stringBuilder.Append("\"missions_val\":[]");
            }
            stringBuilder.Append("}");
            if (!string.IsNullOrEmpty(trophyprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(trophyprog);
            }
            if (!string.IsNullOrEmpty(bingoprog))
            {
                stringBuilder.Append(",");
                stringBuilder.Append(bingoprog);
            }
            this.body     = WebAPI.GetRequestString(stringBuilder.ToString());
            this.callback = response;
        }
Example #23
0
 public Data(SupportData _support)
     : this(_support.Unit)
 {
     this.support = _support;
 }
Example #24
0
 public void SetSupport(SupportData supportData)
 {
     DataSource.Bind <SupportData>(this.SupportSlot.Unit.get_gameObject(), supportData);
     this.SupportSlot.Unit.SetActive(true);
 }
Example #25
0
        private bool Test()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            switch (this.Condition)
            {
            case FlowNode_Condition.Conditions.QUEST_HASENOUGHSTAMINA:
                QuestParam quest1 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (quest1 != null)
                {
                    return(MonoSingleton <GameManager> .Instance.Player.Stamina >= quest1.RequiredApWithPlayerLv(player.Lv, true));
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_ISFRIEND:
                SupportData supportData1;
                if ((supportData1 = this.GetSupportData()) != null)
                {
                    return(supportData1.IsFriend());
                }
                return(false);

            case FlowNode_Condition.Conditions.PARTY_LEADERSKILLAVAIL:
                PartyData dataOfClass1;
                if ((dataOfClass1 = DataSource.FindDataOfClass <PartyData>(((Component)this).get_gameObject(), (PartyData)null)) != null)
                {
                    return(this.GetLeaderSkill(dataOfClass1) != null);
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_LEADERSKILLAVAIL:
                SupportData supportData2;
                if ((supportData2 = this.GetSupportData()) != null)
                {
                    return(supportData2.LeaderSkill != null);
                }
                break;

            case FlowNode_Condition.Conditions.PARTY_LEADEREXIST:
                for (int index = 0; index < player.Partys.Count; ++index)
                {
                    if (player.Partys[index].GetUnitUniqueID(player.Partys[index].LeaderIndex) == 0L)
                    {
                        return(false);
                    }
                }
                return(true);

            case FlowNode_Condition.Conditions.TARGET_COMMANDVALID:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.UIParam_TargetValid);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_DROPSKAKERA:
                QuestParam dataOfClass2;
                if ((dataOfClass2 = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null)) != null && dataOfClass2.pieces != null)
                {
                    return(!string.IsNullOrEmpty(dataOfClass2.pieces[0]));
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_FIRSTTURN:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.UnitStartCount <= 1);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_NEEDFRIENDREQUEST:
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                FlowNode_Condition.\u003CTest\u003Ec__AnonStorey20C testCAnonStorey20C = new FlowNode_Condition.\u003CTest\u003Ec__AnonStorey20C();
                // ISSUE: reference to a compiler-generated field
                testCAnonStorey20C.support = (SupportData)GlobalVars.SelectedSupport;
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (testCAnonStorey20C.support == null || testCAnonStorey20C.support.IsFriend())
                {
                    return(false);
                }
                // ISSUE: reference to a compiler-generated method
                FriendData friendData = player.Friends.Find(new Predicate <FriendData>(testCAnonStorey20C.\u003C\u003Em__1EE));
                if (friendData == null)
                {
                    return(true);
                }
                return(friendData.State == FriendStates.Friend || friendData.State != FriendStates.Follow ? false : false);

            case FlowNode_Condition.Conditions.PLAYER_LEVELCHANGED:
                return((bool)GlobalVars.PlayerLevelChanged);

            case FlowNode_Condition.Conditions.NEWGAME:
                return(GameUtility.Config_NewGame.Value);

            case FlowNode_Condition.Conditions.BTLIDSET:
                return((long)GlobalVars.BtlID != 0L);

            case FlowNode_Condition.Conditions.QUEST_ISMULTIPLAY:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingMultiQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_ISARENA:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingArenaQuest);
                }
                break;

            case FlowNode_Condition.Conditions.ARENA_RANKUP:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.IsArenaRankupInfo());
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_HASREWARD:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(!SceneBattle.Instance.Battle.GetQuestRecord().IsZero);
                }
                break;

            case FlowNode_Condition.Conditions.TERMSOFUSE_AGREED:
                return(MonoSingleton <GameManager> .Instance.IsAgreeTermsOfUse());

            case FlowNode_Condition.Conditions.FRIEND_VALID:
                return(this.GetSupportData() != null);

            case FlowNode_Condition.Conditions.QUEST_ENDSILENT:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.CurrentQuest.Silent);
                }
                break;

            case FlowNode_Condition.Conditions.IS_NOT_ENOUGH_SUPPORT_COST:
                SupportData supportData3 = this.GetSupportData();
                if (supportData3 != null)
                {
                    int gold = player.Gold;
                    if (supportData3.GetCost() > gold)
                    {
                        return(true);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.MULTI_PLAY_IS_UNLOCKED:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiPlay));

            case FlowNode_Condition.Conditions.QUEST_IS_ENABLE_AUTOBATTLE:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    QuestParam quest2 = SceneBattle.Instance.Battle.GetQuest();
                    if (quest2 != null)
                    {
                        return(quest2.CheckAllowedAutoBattle());
                    }
                    return(false);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_AUTOBATTLE:
                if (Object.op_Inequality((Object)SceneBattle.Instance, (Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsAutoBattle);
                }
                break;

            case FlowNode_Condition.Conditions.DEBUGBUILD:
                return(GameUtility.IsDebugBuild);

            case FlowNode_Condition.Conditions.IS_BEGINNER:
                return(MonoSingleton <GameManager> .Instance.Player.IsBeginner());

            case FlowNode_Condition.Conditions.IS_END_TUTORIAL:
                return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L);

            case FlowNode_Condition.Conditions.IS_GET_UNIT:
                return(MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null).iname) != null);

            case FlowNode_Condition.Conditions.VERSUS_UNLOCK:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiVS));

            case FlowNode_Condition.Conditions.SG_LANGUAGE:
                return(GameUtility.Config_Language == "None");

            case FlowNode_Condition.Conditions.SG_CHECK_ACCOUNT_LINK:
                return(PlayerPrefs.GetInt("AccountLinked", 0) != 1 && (MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L && PlayerPrefs.HasKey("LastLoginTime") && (DateTime.Now - DateTime.ParseExact(PlayerPrefs.GetString("LastLoginTime"), "O", (IFormatProvider)CultureInfo.InvariantCulture)).TotalHours > 24.0);

            case FlowNode_Condition.Conditions.SG_CHECK_ANDROID_PERMISSION:
                return(!AndroidPermissionsManager.IsPermissionGranted("android.permission.WRITE_EXTERNAL_STORAGE"));

            case FlowNode_Condition.Conditions.SG_DISK_SPACE_AVAILABLE:
                return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L || DiskUtils.CheckAvailableSpace(true) >= 500);
            }
            return(false);
        }
Example #26
0
        private bool Test()
        {
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            switch (this.Condition)
            {
            case FlowNode_Condition.Conditions.QUEST_HASENOUGHSTAMINA:
                QuestParam quest1 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (quest1 != null)
                {
                    return(MonoSingleton <GameManager> .Instance.Player.Stamina >= quest1.RequiredApWithPlayerLv(player.Lv, true));
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_ISFRIEND:
                SupportData supportData1;
                if ((supportData1 = this.GetSupportData()) != null)
                {
                    return(supportData1.IsFriend());
                }
                return(false);

            case FlowNode_Condition.Conditions.PARTY_LEADERSKILLAVAIL:
                PartyData dataOfClass1;
                if ((dataOfClass1 = DataSource.FindDataOfClass <PartyData>(((Component)this).get_gameObject(), (PartyData)null)) != null)
                {
                    return(this.GetLeaderSkill(dataOfClass1) != null);
                }
                break;

            case FlowNode_Condition.Conditions.FRIEND_LEADERSKILLAVAIL:
                SupportData supportData2;
                if ((supportData2 = this.GetSupportData()) != null)
                {
                    return(supportData2.LeaderSkill != null);
                }
                break;

            case FlowNode_Condition.Conditions.PARTY_LEADEREXIST:
                for (int index = 0; index < player.Partys.Count; ++index)
                {
                    if (player.Partys[index].GetUnitUniqueID(player.Partys[index].LeaderIndex) == 0L)
                    {
                        return(false);
                    }
                }
                return(true);

            case FlowNode_Condition.Conditions.TARGET_COMMANDVALID:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.UIParam_TargetValid);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_DROPSKAKERA:
                QuestParam dataOfClass2;
                if ((dataOfClass2 = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null)) != null && !UnityEngine.Object.op_Equality((UnityEngine.Object)QuestDropParam.Instance, (UnityEngine.Object)null))
                {
                    return(QuestDropParam.Instance.GetHardDropPiece(dataOfClass2.iname, GlobalVars.GetDropTableGeneratedDateTime()) != null);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_FIRSTTURN:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.UnitStartCount <= 1);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_NEEDFRIENDREQUEST:
                SupportData support = (SupportData)GlobalVars.SelectedSupport;
                if (support == null || support.IsFriend())
                {
                    return(false);
                }
                FriendData friendData = player.Friends.Find((Predicate <FriendData>)(f => f.FUID == support.FUID));
                if (friendData == null)
                {
                    return(true);
                }
                return(friendData.State == FriendStates.Friend || friendData.State != FriendStates.Follow ? false : false);

            case FlowNode_Condition.Conditions.PLAYER_LEVELCHANGED:
                return((bool)GlobalVars.PlayerLevelChanged);

            case FlowNode_Condition.Conditions.NEWGAME:
                return(GameUtility.Config_NewGame.Value);

            case FlowNode_Condition.Conditions.BTLIDSET:
                return((long)GlobalVars.BtlID != 0L);

            case FlowNode_Condition.Conditions.QUEST_ISMULTIPLAY:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingMultiQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_ISARENA:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayingArenaQuest);
                }
                break;

            case FlowNode_Condition.Conditions.ARENA_RANKUP:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsArenaRankupInfo());
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_HASREWARD:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(!SceneBattle.Instance.Battle.GetQuestRecord().IsZero);
                }
                break;

            case FlowNode_Condition.Conditions.TERMSOFUSE_AGREED:
                return(MonoSingleton <GameManager> .Instance.IsAgreeTermsOfUse());

            case FlowNode_Condition.Conditions.FRIEND_VALID:
                return(this.GetSupportData() != null);

            case FlowNode_Condition.Conditions.QUEST_ENDSILENT:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.CurrentQuest.Silent);
                }
                break;

            case FlowNode_Condition.Conditions.IS_NOT_ENOUGH_SUPPORT_COST:
                SupportData supportData3 = this.GetSupportData();
                if (supportData3 != null)
                {
                    int gold = player.Gold;
                    if (supportData3.GetCost() > gold)
                    {
                        return(true);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.MULTI_PLAY_IS_UNLOCKED:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiPlay));

            case FlowNode_Condition.Conditions.QUEST_IS_ENABLE_AUTOBATTLE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    QuestParam quest2 = SceneBattle.Instance.Battle.GetQuest();
                    if (quest2 != null)
                    {
                        return(quest2.CheckAllowedAutoBattle());
                    }
                    return(false);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_AUTOBATTLE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsAutoBattle);
                }
                break;

            case FlowNode_Condition.Conditions.DEBUGBUILD:
                return(GameUtility.IsDebugBuild);

            case FlowNode_Condition.Conditions.IS_BEGINNER:
                return(MonoSingleton <GameManager> .Instance.Player.IsBeginner());

            case FlowNode_Condition.Conditions.IS_END_TUTORIAL:
                return((MonoSingleton <GameManager> .Instance.Player.TutorialFlags & 1L) != 0L);

            case FlowNode_Condition.Conditions.IS_GET_UNIT:
                return(MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUnitID(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null).iname) != null);

            case FlowNode_Condition.Conditions.VERSUS_UNLOCK:
                return(MonoSingleton <GameManager> .Instance.Player.CheckUnlock(UnlockTargets.MultiVS));

            case FlowNode_Condition.Conditions.QUEST_IS_SHOW_REVIEW:
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest2 != null)
                    {
                        return(quest2.ShowReviewPopup);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_FIRST_CLEAR:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsFirstWin);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPS:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null) && SceneBattle.Instance.CurrentQuest != null && SceneBattle.Instance.CurrentQuest.type == QuestTypes.Gps)
                {
                    return(true);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_HEAD:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null && area.IsGpsQuest())
                    {
                        return(area.children.Count > 0);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null)
                    {
                        return(area.IsGpsQuest());
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GPSCHAPTER_QUEST_VALID:
                if (!string.IsNullOrEmpty((string)GlobalVars.SelectedChapter))
                {
                    ChapterParam area = MonoSingleton <GameManager> .Instance.FindArea((string)GlobalVars.SelectedChapter);

                    if (area != null)
                    {
                        return(area.HasGpsQuest());
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.VALID_GPSGIFT:
                return(MonoSingleton <GameManager> .Instance.Player.ValidGpsGift);

            case FlowNode_Condition.Conditions.SCENE_CHANGING:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)HomeWindow.Current, (UnityEngine.Object)null))
                {
                    return(HomeWindow.Current.IsSceneChanging);
                }
                return(false);

            case FlowNode_Condition.Conditions.QUEST_IS_PLAY_LAST_DEMO:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsPlayLastDemo);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.Battle.IsRankingQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_NEWSCORE:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsRankingQuestNewScore);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_JOIN_REWARD:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsRankingQuestJoinReward);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_RANKINGQUEST_RESULT_VALIDRANK:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.ValidateRankingQuestRank);
                }
                break;

            case FlowNode_Condition.Conditions.DIFFERENT_VERSION:
                string version = MyApplicationPlugin.get_version();
                string strB    = PlayerPrefsUtility.GetString(PlayerPrefsUtility.AWAKE_VERSION, string.Empty);
                PlayerPrefsUtility.SetString(PlayerPrefsUtility.AWAKE_VERSION, version, true);
                return(string.Compare(version, strB) != 0);

            case FlowNode_Condition.Conditions.SELECTQUEST_IS_MULTIGPS:
                if (!string.IsNullOrEmpty(GlobalVars.SelectedQuestID))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                    if (quest2 != null)
                    {
                        return(quest2.IsMultiAreaQuest);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.LINEQUEST_IS_MULTIGPS:
                if (!string.IsNullOrEmpty(FlowNode_OnUrlSchemeLaunch.LINEParam_Pending.iname))
                {
                    QuestParam quest2 = MonoSingleton <GameManager> .Instance.FindQuest(FlowNode_OnUrlSchemeLaunch.LINEParam_Pending.iname);

                    if (quest2 != null)
                    {
                        return(quest2.IsMultiAreaQuest);
                    }
                    break;
                }
                break;

            case FlowNode_Condition.Conditions.GPSQUEST_IS_VALID:
                return(MonoSingleton <GameManager> .Instance.IsValidAreaQuest());

            case FlowNode_Condition.Conditions.MULTI_GPSQUEST_IS_VALID:
                return(MonoSingleton <GameManager> .Instance.IsValidMultiAreaQuest());

            case FlowNode_Condition.Conditions.QUEST_IS_ORDEAL:
                if (UnityEngine.Object.op_Implicit((UnityEngine.Object)SceneBattle.Instance))
                {
                    return(SceneBattle.Instance.IsOrdealQuest);
                }
                break;

            case FlowNode_Condition.Conditions.QUEST_IS_GET_UNIT:
                if (UnityEngine.Object.op_Implicit((UnityEngine.Object)SceneBattle.Instance))
                {
                    return(SceneBattle.Instance.IsGetFirstClearItem);
                }
                break;

            case FlowNode_Condition.Conditions.VALID_FIRST_CHARGE_CAMPAIGN:
                if ((byte)MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus != (byte)1)
                {
                    return((byte)MonoSingleton <GameManager> .Instance.Player.FirstChargeStatus == (byte)2);
                }
                return(true);

            case FlowNode_Condition.Conditions.GUERRILLASHOP_IS_STARTED:
                return(MonoSingleton <GameManager> .Instance.Player.IsGuerrillaShopStarted);

            case FlowNode_Condition.Conditions.QUEST_END_CARD_IS_SENDMAIL:
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)SceneBattle.Instance, (UnityEngine.Object)null))
                {
                    return(SceneBattle.Instance.IsCardSendMail);
                }
                break;

            case FlowNode_Condition.Conditions.TOWER_QUEST_HAVE_MISSION:
                QuestParam quest3 = MonoSingleton <GameManager> .Instance.FindQuest(GlobalVars.SelectedQuestID);

                if (quest3 != null && quest3.HasMission())
                {
                    return(true);
                }
                break;

            case FlowNode_Condition.Conditions.SHOW_BEGINNER_TOP_NOTIFY:
                if (player.IsBeginner() && PlayerPrefsUtility.GetInt(PlayerPrefsUtility.BEGINNER_TOP_HAS_VISITED, 0) == 0)
                {
                    return(true);
                }
                break;
            }
            return(false);
        }