Example #1
0
        private void UpdateLearningAbilities(bool bRarityUp = false)
        {
            if (!this.IsValid() || this.mArtifactParam == null || this.mArtifactParam.abil_inames == null)
            {
                return;
            }
            if (this.mLearningAbilities == null)
            {
                this.mLearningAbilities = new List <AbilityData>(this.mArtifactParam.abil_inames.Length);
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            for (int index = 0; index < this.mArtifactParam.abil_inames.Length; ++index)
            {
                if ((int)this.mLv >= this.mArtifactParam.abil_levels[index] && (int)this.mRarity >= this.mArtifactParam.abil_rareties[index])
                {
                    AbilityParam param = instanceDirect.GetAbilityParam(this.mArtifactParam.abil_inames[index]);
                    if (param != null)
                    {
                        AbilityData abilityData1 = this.mLearningAbilities.Find((Predicate <AbilityData>)(p => p.Param == param));
                        if (abilityData1 == null)
                        {
                            AbilityData abilityData2 = new AbilityData();
                            abilityData2.Setup((UnitData)null, 0L, param.iname, (int)this.mRarity, 0);
                            abilityData2.IsNoneCategory = true;
                            abilityData2.IsHideList     = this.mArtifactParam.abil_shows[index] == 0;
                            this.mLearningAbilities.Add(abilityData2);
                        }
                        else if (bRarityUp)
                        {
                            abilityData1.Setup((UnitData)null, 0L, param.iname, (int)this.mRarity, 0);
                        }
                    }
                }
            }
        }
Example #2
0
        private void Refresh()
        {
            ArtifactParam data1 = GlobalVars.ArtifactListItem.param;
            ArtifactData  data2 = new ArtifactData();

            data2.Deserialize(new Json_Artifact()
            {
                iname = GlobalVars.ArtifactListItem.param.iname,
                rare  = GlobalVars.ArtifactListItem.param.rareini
            });
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), data1);
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), data2);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AbilityListItem, (UnityEngine.Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         abilityListItem   = this.AbilityListItem;
                CanvasGroup        component         = (CanvasGroup)abilityListItem.GetComponent <CanvasGroup>();
                bool               flag              = false;
                ArtifactParam      artifactParam     = data2.ArtifactParam;
                List <AbilityData> learningAbilities = data2.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    AbilityParam data3      = (AbilityParam)null;
                    string       abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            abil_iname = artifactParam.abil_inames[index];
                            data3      = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data3 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data3 == null)
                    {
                        component.set_alpha(this.ability_hidden_alpha);
                        DataSource.Bind <AbilityParam>(this.AbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.AbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.AbilityListItem, data3);
                    DataSource.Bind <AbilityData>(abilityListItem, (AbilityData)null);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && learningAbilities != null && learningAbilities != null)
                    {
                        AbilityData data4 = learningAbilities.Find((Predicate <AbilityData>)(x => x.Param.iname == abil_iname));
                        if (data4 != null)
                        {
                            DataSource.Bind <AbilityData>(abilityListItem, data4);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    component.set_alpha(this.ability_unlock_alpha);
                }
                else
                {
                    component.set_alpha(this.ability_hidden_alpha);
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #3
0
 public void JobRankUp()
 {
     ++this.mRank;
     for (int index = 0; index < this.mEquips.Length; ++index)
     {
         this.mEquips[index].Setup(this.GetRankupItemID(this.Rank, index));
     }
     if ((int)this.mRank == 1 && !string.IsNullOrEmpty(this.mJobParam.fixed_ability) && this.mLearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == this.mJobParam.fixed_ability)) == null)
     {
         AbilityData        ability          = new AbilityData();
         List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities();
         string             fixedAbility     = this.mJobParam.fixed_ability;
         long val1 = 0;
         int  exp  = 0;
         for (int index = 0; index < learnedAbilities.Count; ++index)
         {
             val1 = Math.Max(val1, learnedAbilities[index].UniqueID);
         }
         long iid = val1 + 1L;
         try
         {
             ability.Setup(this.mOwner, iid, fixedAbility, exp);
             this.mLearnAbilitys.Add(ability);
             this.SetAbilitySlot(0, ability);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
         }
     }
     OString[] learningAbilitys = this.GetLearningAbilitys((int)this.mRank);
     if (learningAbilitys == null)
     {
         return;
     }
     for (int index1 = 0; index1 < learningAbilitys.Length; ++index1)
     {
         // ISSUE: object of a compiler-generated type is created
         // ISSUE: variable of a compiler-generated type
         JobData.\u003CJobRankUp\u003Ec__AnonStorey28E upCAnonStorey28E = new JobData.\u003CJobRankUp\u003Ec__AnonStorey28E();
         // ISSUE: reference to a compiler-generated field
         upCAnonStorey28E.abilityID = (string)learningAbilitys[index1];
         // ISSUE: reference to a compiler-generated field
         // ISSUE: reference to a compiler-generated method
         if (!string.IsNullOrEmpty(upCAnonStorey28E.abilityID) && this.mLearnAbilitys.Find(new Predicate <AbilityData>(upCAnonStorey28E.\u003C\u003Em__330)) == null)
         {
             AbilityData abilityData = new AbilityData();
             // ISSUE: reference to a compiler-generated field
             string             abilityId        = upCAnonStorey28E.abilityID;
             List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities();
             long val1 = 0;
             int  exp  = 0;
             for (int index2 = 0; index2 < learnedAbilities.Count; ++index2)
             {
                 val1 = Math.Max(val1, learnedAbilities[index2].UniqueID);
             }
             long iid = val1 + 1L;
             try
             {
                 abilityData.Setup(this.mOwner, iid, abilityId, exp);
                 this.mLearnAbilitys.Add(abilityData);
             }
             catch (Exception ex)
             {
                 DebugUtility.LogException(ex);
             }
         }
     }
 }
Example #4
0
        public static List <ConceptCardSkillDatailData> CreateConceptCardSkillDatailData(AbilityData abilityData)
        {
            List <ConceptCardSkillDatailData> cardSkillDatailDataList = new List <ConceptCardSkillDatailData>();

            if (abilityData == null)
            {
                return(cardSkillDatailDataList);
            }
            ConceptCardEquipEffect fromAbility = ConceptCardEquipEffect.CreateFromAbility(abilityData);

            for (int index = 0; index < abilityData.LearningSkills.Length; ++index)
            {
                LearningSkill learning_skill = abilityData.LearningSkills[index];
                if (learning_skill != null)
                {
                    ConceptCardDetailAbility.ShowType _type = ConceptCardDetailAbility.ShowType.Ability;
                    SkillData data = abilityData.Skills.Find((Predicate <SkillData>)(x => x.SkillParam.iname == learning_skill.iname));
                    if (data == null)
                    {
                        SkillParam skillParam = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(learning_skill.iname);

                        data = new SkillData();
                        data.Setup(skillParam.iname, 1, 1, (MasterParam)null);
                        _type = ConceptCardDetailAbility.ShowType.LockSkill;
                    }
                    if (cardSkillDatailDataList.FindIndex((Predicate <ConceptCardSkillDatailData>)(abi => abi.skill_data.SkillParam.iname == data.SkillParam.iname)) <= -1)
                    {
                        cardSkillDatailDataList.Add(new ConceptCardSkillDatailData(fromAbility, data, _type, learning_skill));
                    }
                }
            }
            return(cardSkillDatailDataList);
        }
Example #5
0
        private void Refresh()
        {
            ArtifactParam data1 = GlobalVars.ArtifactListItem.param;
            ArtifactData  data2 = new ArtifactData();

            data2.Deserialize(new Json_Artifact()
            {
                iname = GlobalVars.ArtifactListItem.param.iname,
                rare  = GlobalVars.ArtifactListItem.param.rareini
            });
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), data1);
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), data2);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AbilityListItem, (UnityEngine.Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         abilityListItem   = this.AbilityListItem;
                CanvasGroup        component         = (CanvasGroup)abilityListItem.GetComponent <CanvasGroup>();
                bool               flag              = false;
                ArtifactParam      artifactParam     = data2.ArtifactParam;
                List <AbilityData> learningAbilities = data2.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    SelectArtifactInfo.\u003CRefresh\u003Ec__AnonStorey37A refreshCAnonStorey37A = new SelectArtifactInfo.\u003CRefresh\u003Ec__AnonStorey37A();
                    AbilityParam data3 = (AbilityParam)null;
                    // ISSUE: reference to a compiler-generated field
                    refreshCAnonStorey37A.abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            // ISSUE: reference to a compiler-generated field
                            refreshCAnonStorey37A.abil_iname = artifactParam.abil_inames[index];
                            data3 = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data3 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data3 == null)
                    {
                        component.set_alpha(this.ability_hidden_alpha);
                        DataSource.Bind <AbilityParam>(this.AbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.AbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.AbilityListItem, data3);
                    DataSource.Bind <AbilityData>(abilityListItem, (AbilityData)null);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && learningAbilities != null && learningAbilities != null)
                    {
                        // ISSUE: reference to a compiler-generated method
                        AbilityData data4 = learningAbilities.Find(new Predicate <AbilityData>(refreshCAnonStorey37A.\u003C\u003Em__40F));
                        if (data4 != null)
                        {
                            DataSource.Bind <AbilityData>(abilityListItem, data4);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    component.set_alpha(this.ability_unlock_alpha);
                }
                else
                {
                    component.set_alpha(this.ability_hidden_alpha);
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #6
0
        public void DisplaySlots()
        {
            this.mLastDisplayMode = UnitAbilityList.RefreshTypes.DisplaySlots;
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                Object.Destroy((Object)((Component)this.mItems[index]).get_gameObject());
            }
            this.mItems.Clear();
            if (this.Unit == null)
            {
                this.Unit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            }
            if (this.Unit == null)
            {
                return;
            }
            AbilityData[] equipAbilitys = this.Unit.CreateEquipAbilitys();
            Transform     transform     = ((Component)this).get_transform();

            for (int index = 0; index < this.Unit.CurrentJob.AbilitySlots.Length; ++index)
            {
                AbilityData data1 = equipAbilitys[index];
                bool        flag  = false;
                UnitAbilityListItemEvents abilityListItemEvents1;
                if (data1 != null && data1.Param != null)
                {
                    flag = data1.Param.is_fixed;
                    UnitAbilityListItemEvents abilityListItemEvents2 = !flag ? this.Item_Normal : this.Item_Fixed;
                    if (Object.op_Equality((Object)abilityListItemEvents2, (Object)null))
                    {
                        abilityListItemEvents2 = this.Item_Normal;
                    }
                    abilityListItemEvents1 = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)abilityListItemEvents2);
                    DataSource.Bind <AbilityData>(((Component)abilityListItemEvents1).get_gameObject(), data1);
                    string key = this.Unit.SearchAbilityReplacementSkill(data1.Param.iname);
                    if (!string.IsNullOrEmpty(key))
                    {
                        DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents1).get_gameObject(), MonoSingleton <GameManager> .Instance.GetAbilityParam(key));
                    }
                    abilityListItemEvents1.IsEnableSkillChange = true;
                    JobData job;
                    int     rank;
                    if (this.GetAbilitySource(data1.AbilityID, out job, out rank))
                    {
                        DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents1).get_gameObject(), new AbilityUnlockInfo()
                        {
                            JobName = job.Name,
                            Rank    = rank
                        });
                    }
                    abilityListItemEvents1.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                    abilityListItemEvents1.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                    abilityListItemEvents1.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                    abilityListItemEvents1.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                }
                else
                {
                    AbilityParam data2 = new AbilityParam();
                    data2.slot             = JobData.ABILITY_SLOT_TYPES[index];
                    abilityListItemEvents1 = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Empty);
                    DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents1).get_gameObject(), data2);
                }
                ((Component)abilityListItemEvents1).get_transform().SetParent(transform, false);
                ((Component)abilityListItemEvents1).get_gameObject().SetActive(true);
                if (!flag)
                {
                    abilityListItemEvents1.OnSelect = new ListItemEvents.ListItemEvent(this._OnSlotSelect);
                }
                this.mItems.Add(abilityListItemEvents1);
            }
        }
Example #7
0
 public void SetOwnerAbility(AbilityData owner)
 {
     this.m_OwnerAbility = owner;
 }
Example #8
0
        public void Deserialize(UnitData owner, Json_Job json)
        {
            if (json == null)
            {
                throw new InvalidJSONException();
            }
            this.mJobParam = MonoSingleton <GameManager> .GetInstanceDirect().GetJobParam(json.iname);

            this.mUniqueID   = json.iid;
            this.mRank       = (OInt)json.rank;
            this.mOwner      = owner;
            this.mSelectSkin = json.cur_skin;
            for (int index = 0; index < this.mEquips.Length; ++index)
            {
                this.mEquips[index].Setup(this.mJobParam.GetRankupItemID((int)this.mRank, index));
            }
            if (json.equips != null)
            {
                for (int index = 0; index < json.equips.Length; ++index)
                {
                    this.mEquips[index].Equip(json.equips[index]);
                }
            }
            if (!string.IsNullOrEmpty(this.Param.atkskill[0]))
            {
                this.mNormalAttackSkill.Setup(this.Param.atkskill[0], 1, 1, (MasterParam)null);
            }
            else
            {
                this.mNormalAttackSkill.Setup(this.Param.atkskill[(int)owner.UnitParam.element], 1, 1, (MasterParam)null);
            }
            if (!string.IsNullOrEmpty(this.Param.master) && MonoSingleton <GameManager> .Instance.MasterParam.FixParam.IsJobMaster)
            {
                if (this.mJobMaster == null)
                {
                    this.mJobMaster = new SkillData();
                }
                this.mJobMaster.Setup(this.Param.master, 1, 1, (MasterParam)null);
            }
            if (json.abils != null)
            {
                Array.Sort <Json_Ability>(json.abils, (Comparison <Json_Ability>)((src, dsc) => (int)(src.iid - dsc.iid)));
                for (int index = 0; index < json.abils.Length; ++index)
                {
                    AbilityData abilityData = new AbilityData();
                    string      iname       = json.abils[index].iname;
                    long        iid         = json.abils[index].iid;
                    int         exp         = json.abils[index].exp;
                    abilityData.Setup(this.mOwner, iid, iname, exp, 0);
                    this.mLearnAbilitys.Add(abilityData);
                }
            }
            Array.Clear((Array)this.mAbilitySlots, 0, this.mAbilitySlots.Length);
            if (json.select != null && json.select.abils != null)
            {
                for (int index = 0; index < json.select.abils.Length && index < this.mAbilitySlots.Length; ++index)
                {
                    this.mAbilitySlots[index] = json.select.abils[index];
                }
            }
            for (int index = 0; index < this.mArtifactDatas.Length; ++index)
            {
                this.mArtifactDatas[index] = (ArtifactData)null;
            }
            Array.Clear((Array)this.mArtifacts, 0, this.mArtifacts.Length);
            if (json.select != null && json.select.artifacts != null)
            {
                for (int index = 0; index < json.select.artifacts.Length && index < this.mArtifacts.Length; ++index)
                {
                    this.mArtifacts[index] = json.select.artifacts[index];
                }
            }
            if (json.artis != null)
            {
                for (int index1 = 0; index1 < json.artis.Length; ++index1)
                {
                    if (json.artis[index1] != null)
                    {
                        int index2 = Array.IndexOf <long>(this.mArtifacts, json.artis[index1].iid);
                        if (index2 >= 0)
                        {
                            ArtifactData artifactData = new ArtifactData();
                            artifactData.Deserialize(json.artis[index1]);
                            this.mArtifactDatas[index2] = artifactData;
                        }
                    }
                }
            }
            if (string.IsNullOrEmpty(json.cur_skin))
            {
                return;
            }
            ArtifactData artifactData1 = new ArtifactData();

            artifactData1.Deserialize(new Json_Artifact()
            {
                iname = json.cur_skin
            });
            this.mSelectSkinData = artifactData1;
        }
Example #9
0
        public void DisplaySlotType(EAbilitySlot slotType, bool hideEquipped = false, bool showDerivedAbility = false)
        {
            this.mLastDisplayMode = UnitAbilityList.RefreshTypes.DisplayAll;
            this.mLastDisplaySlot = slotType;
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object)((Component)this.mItems[index]).get_gameObject());
            }
            this.mItems.Clear();
            if (this.Unit == null)
            {
                this.Unit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            }
            if (this.Unit == null)
            {
                return;
            }
            List <AbilityData> abilityDataList = !showDerivedAbility?this.Unit.GetAllLearnedAbilities(false) : this.Unit.GetAllLearnedAbilities(true);

            Transform transform = ((Component)this).get_transform();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_Normal, (UnityEngine.Object)null))
            {
                for (int index1 = 0; index1 < abilityDataList.Count; ++index1)
                {
                    AbilityData abilityData = abilityDataList[index1];
                    if ((slotType == ~EAbilitySlot.Action || slotType == abilityData.SlotType) && (this.ShowFixedAbilities || !abilityData.Param.is_fixed) && (this.ShowMasterAbilities || !(this.Unit.UnitParam.ability == abilityData.AbilityID) && !this.Unit.IsQuestClearUnlocked(abilityData.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)) && (this.Unit.MapEffectAbility != abilityData && (this.ShowMasterAbilities || !this.Unit.TobiraMasterAbilitys.Contains(abilityData))) && (!abilityData.IsDerivedAbility || (this.ShowFixedAbilities || !abilityData.DeriveBaseAbility.Param.is_fixed) && (this.ShowMasterAbilities || !(this.Unit.UnitParam.ability == abilityData.DeriveBaseAbility.AbilityID) && !this.Unit.IsQuestClearUnlocked(abilityData.DeriveBaseAbility.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)) && (this.Unit.MapEffectAbility != abilityData.DeriveBaseAbility && (this.ShowMasterAbilities || !this.Unit.TobiraMasterAbilitys.Contains(abilityData.DeriveBaseAbility)))))
                    {
                        if (hideEquipped)
                        {
                            bool flag = false;
                            for (int index2 = 0; index2 < this.Unit.CurrentJob.AbilitySlots.Length; ++index2)
                            {
                                if (this.Unit.CurrentJob.AbilitySlots[index2] == abilityData.UniqueID)
                                {
                                    flag = true;
                                    break;
                                }
                            }
                            if (flag)
                            {
                                continue;
                            }
                        }
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Normal);
                        this.mItems.Add(abilityListItemEvents);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        AbilityDeriveList component = (AbilityDeriveList)((Component)abilityListItemEvents).get_gameObject().GetComponent <AbilityDeriveList>();
                        if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null))
                        {
                            DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), abilityData);
                            abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                            abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                            abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                            abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                            abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                            JobData job;
                            int     rank;
                            if (this.GetAbilitySource(abilityData.AbilityID, out job, out rank))
                            {
                                DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                                {
                                    JobName = job.Name,
                                    Rank    = rank
                                });
                            }
                        }
                        else if (abilityData.IsDerivedAbility)
                        {
                            component.SetupWithAbilityData(abilityData.DeriveBaseAbility, new List <AbilityData>()
                            {
                                abilityData
                            });
                            // ISSUE: method pointer
                            component.AddDetailOpenEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityDetail)));
                            // ISSUE: method pointer
                            component.AddSelectEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilitySelect)));
                            // ISSUE: method pointer
                            component.AddRankUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityRankUp)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnPressEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnPress)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnUp)));
                        }
                        else
                        {
                            component.SetupWithAbilityData(abilityData, (List <AbilityData>)null);
                            // ISSUE: method pointer
                            component.AddDetailOpenEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityDetail)));
                            // ISSUE: method pointer
                            component.AddSelectEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilitySelect)));
                            // ISSUE: method pointer
                            component.AddRankUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityRankUp)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnPressEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnPress)));
                            // ISSUE: method pointer
                            component.AddRankUpBtnUpEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnRankUpBtnUp)));
                        }
                    }
                }
            }
            if (slotType != ~EAbilitySlot.Action && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_SlotMismatch, (UnityEngine.Object)null))
            {
                for (int index = 0; index < abilityDataList.Count; ++index)
                {
                    AbilityData data = abilityDataList[index];
                    if (slotType != data.SlotType && (this.ShowFixedAbilities || !data.Param.is_fixed) && (this.ShowMasterAbilities || !(this.Unit.UnitParam.ability == data.AbilityID) && !this.Unit.IsQuestClearUnlocked(data.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)) && (this.Unit.MapEffectAbility != data && (this.ShowMasterAbilities || !this.Unit.TobiraMasterAbilitys.Contains(data))))
                    {
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_SlotMismatch);
                        this.mItems.Add(abilityListItemEvents);
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), data);
                        abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(data.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                    }
                }
            }
            List <string> overwrittenAbilitys = TobiraUtility.GetOverwrittenAbilitys(this.Unit);

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Item_Locked, (UnityEngine.Object)null))
            {
                GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                for (int index1 = 0; index1 < this.Unit.Jobs.Length; ++index1)
                {
                    if (this.ShowLockedJobAbilities || this.Unit.Jobs[index1].Rank > 0)
                    {
                        RarityParam rarityParam = instanceDirect.GetRarityParam((int)this.Unit.UnitParam.raremax);
                        for (int lv = this.Unit.Jobs[index1].Rank + 1; lv <= JobParam.MAX_JOB_RANK; ++lv)
                        {
                            OString[] learningAbilitys = this.Unit.Jobs[index1].Param.GetLearningAbilitys(lv);
                            if (learningAbilitys != null && (int)rarityParam.UnitJobLvCap >= lv)
                            {
                                for (int index2 = 0; index2 < learningAbilitys.Length; ++index2)
                                {
                                    string key = (string)learningAbilitys[index2];
                                    if (!string.IsNullOrEmpty(key))
                                    {
                                        AbilityParam abilityParam = instanceDirect.GetAbilityParam(key);
                                        if ((this.ShowFixedAbilities || !abilityParam.is_fixed) && !overwrittenAbilitys.Contains(abilityParam.iname))
                                        {
                                            UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                                            this.mItems.Add(abilityListItemEvents);
                                            DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                                            abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                                            abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                                            abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                                            abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                                            abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                                            ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                                            ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                                            {
                                                JobName = this.Unit.Jobs[index1].Name,
                                                Rank    = lv
                                            });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (this.ShowMasterAbilities && !string.IsNullOrEmpty(this.Unit.UnitParam.ability) && (this.Unit.LearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == this.Unit.UnitParam.ability)) == null && !overwrittenAbilitys.Exists((Predicate <string>)(abil => abil == this.Unit.UnitParam.ability))))
                {
                    AbilityParam abilityParam = instanceDirect.GetAbilityParam(this.Unit.UnitParam.ability);
                    UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                    this.mItems.Add(abilityListItemEvents);
                    DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                    abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                    abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                    abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                    abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                    abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                    ((Component)abilityListItemEvents).get_transform().SetParent(transform, false);
                    ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                }
            }
            this.ResetScrollPos();
        }
Example #10
0
        private void Refresh()
        {
            ArtifactData artifactData = new ArtifactData();

            artifactData.Deserialize(new Json_Artifact()
            {
                iname = GlobalVars.ArtifactListItem.param.iname,
                rare  = GlobalVars.ArtifactListItem.param.rareini
            });
            this.UnlockArtifact = artifactData;
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), this.UnlockArtifact);
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), this.UnlockArtifact.ArtifactParam);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AbilityListItem, (UnityEngine.Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         abilityListItem   = this.AbilityListItem;
                CanvasGroup        component         = (CanvasGroup)abilityListItem.GetComponent <CanvasGroup>();
                bool               flag              = false;
                ArtifactParam      artifactParam     = artifactData.ArtifactParam;
                List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    // ISSUE: object of a compiler-generated type is created
                    // ISSUE: variable of a compiler-generated type
                    ArtifactGetUnlockWindow.\u003CRefresh\u003Ec__AnonStorey2F6 refreshCAnonStorey2F6 = new ArtifactGetUnlockWindow.\u003CRefresh\u003Ec__AnonStorey2F6();
                    AbilityParam data1 = (AbilityParam)null;
                    // ISSUE: reference to a compiler-generated field
                    refreshCAnonStorey2F6.abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            // ISSUE: reference to a compiler-generated field
                            refreshCAnonStorey2F6.abil_iname = artifactParam.abil_inames[index];
                            data1 = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data1 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data1 == null)
                    {
                        component.set_alpha(this.ability_hidden_alpha);
                        DataSource.Bind <AbilityParam>(this.AbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.AbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.AbilityListItem, data1);
                    DataSource.Bind <AbilityData>(abilityListItem, (AbilityData)null);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && learningAbilities != null && learningAbilities != null)
                    {
                        // ISSUE: reference to a compiler-generated method
                        AbilityData data2 = learningAbilities.Find(new Predicate <AbilityData>(refreshCAnonStorey2F6.\u003C\u003Em__2F7));
                        if (data2 != null)
                        {
                            DataSource.Bind <AbilityData>(abilityListItem, data2);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    component.set_alpha(this.ability_unlock_alpha);
                }
                else
                {
                    component.set_alpha(this.ability_hidden_alpha);
                }
            }
            BaseStatus fixed_status = new BaseStatus();
            BaseStatus scale_status = new BaseStatus();

            this.UnlockArtifact.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
            this.ArtifactStatus.SetValues(fixed_status, scale_status);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #11
0
        public void DisplaySlots()
        {
            this.mLastDisplayMode = UnitAbilityList.RefreshTypes.DisplaySlots;
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                UnityEngine.Object.Destroy((UnityEngine.Object)((Component)this.mItems[index]).get_gameObject());
            }
            this.mItems.Clear();
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (dataOfClass != null)
            {
                this.Unit = dataOfClass;
            }
            if (this.Unit == null)
            {
                return;
            }
            GlobalVars.SelectedUnitUniqueID.Set(this.Unit.UniqueID);
            List <AbilityData> abilityDataList = new List <AbilityData>((IEnumerable <AbilityData>) this.Unit.CreateEquipAbilitys());

            if (this.Unit.MasterAbility != null)
            {
                abilityDataList.Add(this.Unit.MasterAbility);
            }
            Transform transform = ((Component)this).get_transform();

            for (int index = 0; index < abilityDataList.Count; ++index)
            {
                AbilityData derivedAbility = abilityDataList[index];
                bool        flag           = false;
                if (derivedAbility != null && derivedAbility.Param != null && derivedAbility.IsDeriveBaseAbility)
                {
                    derivedAbility = derivedAbility.DerivedAbility;
                }
                UnitAbilityListItemEvents abilityListItemEvents1;
                if (derivedAbility != null && derivedAbility.Param != null)
                {
                    flag = derivedAbility.Param.is_fixed;
                    UnitAbilityListItemEvents abilityListItemEvents2 = this.Unit.MasterAbility == null || this.Unit.MasterAbility != derivedAbility ? (!flag ? this.Item_Normal : this.Item_Fixed) : this.Item_Fixed;
                    if (derivedAbility.IsDerivedAbility && derivedAbility.DeriveBaseAbility == this.Unit.MasterAbility)
                    {
                        abilityListItemEvents2 = this.Item_Fixed;
                    }
                    if (UnityEngine.Object.op_Equality((UnityEngine.Object)abilityListItemEvents2, (UnityEngine.Object)null))
                    {
                        abilityListItemEvents2 = this.Item_Normal;
                    }
                    abilityListItemEvents1 = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)abilityListItemEvents2);
                    AbilityDeriveList component = (AbilityDeriveList)((Component)abilityListItemEvents1).get_gameObject().GetComponent <AbilityDeriveList>();
                    if (UnityEngine.Object.op_Equality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents1).get_gameObject(), derivedAbility);
                        string key = this.Unit.SearchAbilityReplacementSkill(derivedAbility.Param.iname);
                        if (!string.IsNullOrEmpty(key))
                        {
                            DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents1).get_gameObject(), MonoSingleton <GameManager> .Instance.GetAbilityParam(key));
                        }
                        abilityListItemEvents1.IsEnableSkillChange = true;
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(derivedAbility.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents1).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                        abilityListItemEvents1.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents1.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents1.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents1.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                    }
                    else if (derivedAbility.IsDerivedAbility)
                    {
                        component.SetupWithAbilityParam(derivedAbility.Param, new List <AbilityDeriveParam>()
                        {
                            derivedAbility.DeriveParam
                        });
                        // ISSUE: method pointer
                        component.AddDetailOpenEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityDetail)));
                    }
                    else
                    {
                        component.SetupWithAbilityParam(derivedAbility.Param, (List <AbilityDeriveParam>)null);
                        // ISSUE: method pointer
                        component.AddDetailOpenEventListener(new UnityAction <GameObject>((object)this, __methodptr(_OnAbilityDetail)));
                    }
                }
                else
                {
                    AbilityParam data = new AbilityParam();
                    data.slot = JobData.ABILITY_SLOT_TYPES[index];
                    abilityListItemEvents1 = (UnitAbilityListItemEvents)UnityEngine.Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Empty);
                    DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents1).get_gameObject(), data);
                }
                ((Component)abilityListItemEvents1).get_transform().SetParent(transform, false);
                ((Component)abilityListItemEvents1).get_gameObject().SetActive(true);
                GameParameter.UpdateAll(((Component)abilityListItemEvents1).get_gameObject());
                if (!flag)
                {
                    abilityListItemEvents1.OnSelect = new ListItemEvents.ListItemEvent(this._OnSlotSelect);
                }
                this.mItems.Add(abilityListItemEvents1);
            }
        }
Example #12
0
        private static BattleSuspend.Data makeSaveData()
        {
            SceneBattle instance = SceneBattle.Instance;

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instance))
            {
                return((BattleSuspend.Data)null);
            }
            BattleCore battle = instance.Battle;

            if (battle == null)
            {
                return((BattleSuspend.Data)null);
            }
            BattleSuspend.Data        data = new BattleSuspend.Data();
            BattleSuspend.Data.Header hdr  = data.hdr;
            hdr.apv = Application.get_version();
            hdr.arv = AssetManager.AssetRevision;
            hdr.qid = battle.QuestID;
            hdr.bid = battle.BtlID;
            hdr.cat = GameUtility.Config_AutoMode_Treasure.Value;
            hdr.cad = GameUtility.Config_AutoMode_DisableSkill.Value;
            data.uil.Clear();
            using (List <Unit> .Enumerator enumerator1 = battle.AllUnits.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    Unit current1 = enumerator1.Current;
                    if (current1 != null)
                    {
                        BattleSuspend.Data.UnitInfo unitInfo = new BattleSuspend.Data.UnitInfo();
                        unitInfo.nam = current1.UnitName;
                        unitInfo.nhp = (int)current1.CurrentStatus.param.hp;
                        unitInfo.chp = current1.UnitChangedHp;
                        unitInfo.gem = current1.Gems;
                        unitInfo.ugx = current1.x;
                        unitInfo.ugy = current1.y;
                        unitInfo.dir = (int)current1.Direction;
                        unitInfo.ufg = current1.UnitFlag;
                        unitInfo.isb = current1.IsSub;
                        unitInfo.crt = (int)current1.ChargeTime;
                        unitInfo.tgi = BattleSuspend.GetIdxFromAllUnits(battle, current1.Target);
                        unitInfo.rti = BattleSuspend.GetIdxFromAllUnits(battle, current1.RageTarget);
                        unitInfo.cti = -1;
                        if (current1.CastSkill != null)
                        {
                            unitInfo.csi = current1.CastSkill.SkillParam.iname;
                            unitInfo.ctm = (int)current1.CastTime;
                            unitInfo.cid = (int)current1.CastIndex;
                            if (current1.CastSkillGridMap != null)
                            {
                                unitInfo.cgw = current1.CastSkillGridMap.w;
                                unitInfo.cgh = current1.CastSkillGridMap.h;
                                if (current1.CastSkillGridMap.data != null)
                                {
                                    unitInfo.cgm = new int[current1.CastSkillGridMap.data.Length];
                                    for (int index = 0; index < current1.CastSkillGridMap.data.Length; ++index)
                                    {
                                        unitInfo.cgm[index] = !current1.CastSkillGridMap.data[index] ? 0 : 1;
                                    }
                                }
                            }
                            unitInfo.ctx = current1.GridTarget == null ? -1 : current1.GridTarget.x;
                            unitInfo.cty = current1.GridTarget == null ? -1 : current1.GridTarget.y;
                            unitInfo.cti = BattleSuspend.GetIdxFromAllUnits(battle, current1.UnitTarget);
                        }
                        unitInfo.dct = current1.DeathCount;
                        unitInfo.ajw = current1.AutoJewel;
                        unitInfo.wtt = current1.WaitClock;
                        unitInfo.mvt = current1.WaitMoveTurn;
                        unitInfo.acc = current1.ActionCount;
                        unitInfo.tuc = current1.TurnCount;
                        unitInfo.trc = current1.EventTrigger == null ? 0 : current1.EventTrigger.Count;
                        unitInfo.klc = current1.KillCount;
                        if (current1.EntryTriggers != null)
                        {
                            unitInfo.etr = new int[current1.EntryTriggers.Count];
                            for (int index = 0; index < current1.EntryTriggers.Count; ++index)
                            {
                                unitInfo.etr[index] = !current1.EntryTriggers[index].on ? 0 : 1;
                            }
                        }
                        unitInfo.aid = (int)current1.AIActionIndex;
                        unitInfo.atu = (int)current1.AIActionTurnCount;
                        unitInfo.apt = (int)current1.AIPatrolIndex;
                        unitInfo.boi = current1.CreateBreakObjId;
                        unitInfo.boc = current1.CreateBreakObjClock;
                        unitInfo.tid = current1.TeamId;
                        unitInfo.fst = (int)current1.FriendStates;
                        unitInfo.acl.Clear();
                        for (int index1 = 0; index1 < current1.AbilityChangeLists.Count; ++index1)
                        {
                            Unit.AbilityChange abilityChangeList = current1.AbilityChangeLists[index1];
                            if (abilityChangeList != null && abilityChangeList.mDataLists.Count != 0)
                            {
                                BattleSuspend.Data.UnitInfo.AbilChg abilChg = new BattleSuspend.Data.UnitInfo.AbilChg();
                                for (int index2 = 0; index2 < abilityChangeList.mDataLists.Count; ++index2)
                                {
                                    Unit.AbilityChange.Data mDataList = abilityChangeList.mDataLists[index2];
                                    abilChg.acd.Add(new BattleSuspend.Data.UnitInfo.AbilChg.Data()
                                    {
                                        fid = mDataList.mFromAp.iname,
                                        tid = mDataList.mToAp.iname,
                                        tur = mDataList.mTurn,
                                        irs = !mDataList.mIsReset ? 0 : 1,
                                        exp = mDataList.mExp,
                                        iif = !mDataList.mIsInfinite ? 0 : 1
                                    });
                                }
                                unitInfo.acl.Add(abilChg);
                            }
                        }
                        unitInfo.aal.Clear();
                        for (int index = 0; index < current1.AddedAbilitys.Count; ++index)
                        {
                            AbilityData addedAbility = current1.AddedAbilitys[index];
                            if (addedAbility != null)
                            {
                                unitInfo.aal.Add(new BattleSuspend.Data.UnitInfo.AddedAbil()
                                {
                                    aid = addedAbility.AbilityID,
                                    exp = addedAbility.Exp
                                });
                            }
                        }
                        unitInfo.sul.Clear();
                        using (Dictionary <SkillData, OInt> .Enumerator enumerator2 = current1.GetSkillUseCount().GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                KeyValuePair <SkillData, OInt> current2 = enumerator2.Current;
                                unitInfo.sul.Add(new BattleSuspend.Data.UnitInfo.SkillUse()
                                {
                                    sid = current2.Key.SkillParam.iname,
                                    ctr = (int)current2.Value
                                });
                            }
                        }
                        unitInfo.bfl.Clear();
                        using (List <BuffAttachment> .Enumerator enumerator2 = current1.BuffAttachments.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                BuffAttachment current2 = enumerator2.Current;
                                if ((!(bool)current2.IsPassive || current2.Param != null && (bool)current2.Param.mIsUpBuff || current2.skill != null && !current2.skill.IsSubActuate()) && current2.CheckTiming != EffectCheckTimings.Moment)
                                {
                                    BattleSuspend.Data.UnitInfo.Buff buff = new BattleSuspend.Data.UnitInfo.Buff();
                                    buff.sid = current2.skill == null ? (string)null : current2.skill.SkillParam.iname;
                                    buff.stg = (int)current2.skilltarget;
                                    buff.tur = (int)current2.turn;
                                    buff.uni = BattleSuspend.GetIdxFromAllUnits(battle, current2.user);
                                    buff.cui = BattleSuspend.GetIdxFromAllUnits(battle, current2.CheckTarget);
                                    buff.tim = (int)current2.CheckTiming;
                                    buff.ipa = (bool)current2.IsPassive;
                                    buff.ucd = (int)current2.UseCondition;
                                    buff.btp = (int)current2.BuffType;
                                    buff.vtp = !current2.IsNegativeValueIsBuff ? 0 : 1;
                                    buff.ctp = (int)current2.CalcType;
                                    buff.lid = current2.LinkageID;
                                    buff.ubc = (int)current2.UpBuffCount;
                                    buff.atl.Clear();
                                    if (current2.AagTargetLists != null)
                                    {
                                        for (int index = 0; index < current2.AagTargetLists.Count; ++index)
                                        {
                                            int idxFromAllUnits = BattleSuspend.GetIdxFromAllUnits(battle, current2.AagTargetLists[index]);
                                            if (idxFromAllUnits >= 0)
                                            {
                                                buff.atl.Add(idxFromAllUnits);
                                            }
                                        }
                                    }
                                    unitInfo.bfl.Add(buff);
                                }
                            }
                        }
                        unitInfo.cdl.Clear();
                        using (List <CondAttachment> .Enumerator enumerator2 = current1.CondAttachments.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                CondAttachment current2 = enumerator2.Current;
                                if (!(bool)current2.IsPassive || current2.skill != null && !current2.skill.IsSubActuate())
                                {
                                    unitInfo.cdl.Add(new BattleSuspend.Data.UnitInfo.Cond()
                                    {
                                        sid = current2.skill == null ? (string)null : current2.skill.SkillParam.iname,
                                        stg = (int)current2.skilltarget,
                                        cid = current2.CondId,
                                        tur = (int)current2.turn,
                                        uni = BattleSuspend.GetIdxFromAllUnits(battle, current2.user),
                                        cui = BattleSuspend.GetIdxFromAllUnits(battle, current2.CheckTarget),
                                        tim = (int)current2.CheckTiming,
                                        ipa = (bool)current2.IsPassive,
                                        ucd = (int)current2.UseCondition,
                                        cdt = (int)current2.CondType,
                                        cnd = (int)current2.Condition,
                                        icu = current2.IsCurse,
                                        lid = current2.LinkageID
                                    });
                                }
                            }
                        }
                        unitInfo.shl.Clear();
                        using (List <Unit.UnitShield> .Enumerator enumerator2 = current1.Shields.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                Unit.UnitShield current2 = enumerator2.Current;
                                unitInfo.shl.Add(new BattleSuspend.Data.UnitInfo.Shield()
                                {
                                    inm = current2.skill_param.iname,
                                    nhp = (int)current2.hp,
                                    mhp = (int)current2.hpMax,
                                    ntu = (int)current2.turn,
                                    mtu = (int)current2.turnMax,
                                    drt = (int)current2.damage_rate,
                                    dvl = (int)current2.damage_value
                                });
                            }
                        }
                        unitInfo.hpi.Clear();
                        using (List <SkillData> .Enumerator enumerator2 = current1.JudgeHpLists.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                SkillData current2 = enumerator2.Current;
                                unitInfo.hpi.Add(current2.SkillID);
                            }
                        }
                        unitInfo.mhl.Clear();
                        using (List <Unit.UnitMhmDamage> .Enumerator enumerator2 = current1.MhmDamageLists.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                Unit.UnitMhmDamage current2 = enumerator2.Current;
                                unitInfo.mhl.Add(new BattleSuspend.Data.UnitInfo.MhmDmg()
                                {
                                    typ = (int)current2.mType,
                                    dmg = (int)current2.mDamage
                                });
                            }
                        }
                        data.uil.Add(unitInfo);
                    }
                }
            }
            data.itl.Clear();
            using (Dictionary <OString, OInt> .Enumerator enumerator = battle.GetQuestRecord().used_items.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    KeyValuePair <OString, OInt> current = enumerator.Current;
                    data.itl.Add(new BattleSuspend.Data.UsedItem()
                    {
                        iti = (string)current.Key,
                        num = (int)current.Value
                    });
                }
            }
            data.trl.Clear();
            using (List <TrickData> .Enumerator enumerator = TrickData.GetEffectAll().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    TrickData current = enumerator.Current;
                    data.trl.Add(new BattleSuspend.Data.TrickInfo()
                    {
                        tid = current.TrickParam.Iname,
                        val = (bool)current.Valid,
                        cun = BattleSuspend.GetIdxFromAllUnits(battle, current.CreateUnit),
                        rnk = (int)current.Rank,
                        rcp = (int)current.RankCap,
                        grx = (int)current.GridX,
                        gry = (int)current.GridY,
                        rac = (int)current.RestActionCount,
                        ccl = (int)current.CreateClock,
                        tag = current.Tag
                    });
                }
            }
            data.sel.Clear();
            using (Dictionary <string, BattleCore.SkillExecLog> .KeyCollection.Enumerator enumerator = battle.SkillExecLogs.Keys.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    string current = enumerator.Current;
                    data.sel.Add(new BattleSuspend.Data.SkillExecLogInfo()
                    {
                        inm  = current,
                        ucnt = battle.SkillExecLogs[current].use_count,
                        kcnt = battle.SkillExecLogs[current].kill_count
                    });
                }
            }
            BattleSuspend.Data.Variables var = data.var;
            var.wtc = battle.WinTriggerCount;
            var.ltc = battle.LoseTriggerCount;
            var.act = battle.ActionCount;
            var.kls = battle.Killstreak;
            var.mks = battle.MaxKillstreak;
            var.thl = battle.TotalHeal;
            var.tdt = battle.TotalDamagesTaken;
            var.tdm = battle.TotalDamages;
            var.nui = battle.NumUsedItems;
            var.nus = battle.NumUsedSkills;
            var.ctm = battle.ClockTime;
            var.ctt = battle.ClockTimeTotal;
            var.coc = battle.ContinueCount;
            var.fns = battle.FinisherIname;
            var.glc = instance.GoldCount;
            var.trc = instance.TreasureCount;
            var.rsd = battle.Seed;
            uint[] seed = battle.Rand.GetSeed();
            if (seed != null)
            {
                var.ris = new uint[seed.Length];
                seed.CopyTo((Array)var.ris, 0);
            }
            var.gsl.Clear();
            using (List <GimmickEvent> .Enumerator enumerator = battle.GimmickEventList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    GimmickEvent current = enumerator.Current;
                    var.gsl.Add(new BattleSuspend.Data.Variables.GimmickEvent()
                    {
                        ctr = current.count,
                        cmp = !current.IsCompleted ? 0 : 1
                    });
                }
            }
            var.ssl.Clear();
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance.EventScript, (UnityEngine.Object)null) && instance.EventScript.mSequences != null)
            {
                foreach (EventScript.ScriptSequence mSequence in instance.EventScript.mSequences)
                {
                    var.ssl.Add(new BattleSuspend.Data.Variables.ScriptEvent()
                    {
                        trg = mSequence.Triggered
                    });
                }
            }
            var.tkk     = battle.TargetKillstreak.Keys.ToArray <string>();
            var.tkv     = battle.TargetKillstreak.Values.ToArray <int>();
            var.mtk     = battle.MaxTargetKillstreak.Keys.ToArray <string>();
            var.mtv     = battle.MaxTargetKillstreak.Values.ToArray <int>();
            var.pbm     = battle.PlayByManually;
            var.uam     = battle.IsUseAutoPlayMode;
            var.wti.wid = (string)null;
            WeatherData currentWeatherData = WeatherData.CurrentWeatherData;

            if (currentWeatherData != null)
            {
                var.wti.wid = currentWeatherData.WeatherParam.Iname;
                var.wti.mun = BattleSuspend.GetIdxFromAllUnits(battle, currentWeatherData.ModifyUnit);
                var.wti.rnk = (int)currentWeatherData.Rank;
                var.wti.rcp = (int)currentWeatherData.RankCap;
                var.wti.ccl = (int)currentWeatherData.ChangeClock;
            }
            var.ctd  = battle.CurrentTeamId;
            var.mtd  = battle.MaxTeamId;
            var.pbd  = instance.EventPlayBgmID;
            data.ivl = true;
            return(data);
        }
        private void Refresh()
        {
            this.mShopitem = MonoSingleton <GameManager> .Instance.Player.GetEventShopData().items.FirstOrDefault <EventShopItem>((Func <EventShopItem, bool>)(item => item.id == GlobalVars.ShopBuyIndex));

            this.ItemWindow.SetActive(!this.mShopitem.IsArtifact);
            this.ArtifactWindow.SetActive(this.mShopitem.IsArtifact);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountNum, (UnityEngine.Object)null))
            {
                this.AmountNum.set_text(this.mShopitem.remaining_num.ToString());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Sold, (UnityEngine.Object)null))
            {
                this.Sold.SetActive(!this.mShopitem.IsNotLimited);
            }
            if (this.mShopitem.IsArtifact)
            {
                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.iname);

                DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), artifactParam);
                this.mArtifactParam = artifactParam;
                ArtifactData artifactData = new ArtifactData();
                artifactData.Deserialize(new Json_Artifact()
                {
                    iname = artifactParam.iname,
                    rare  = artifactParam.rareini
                });
                BaseStatus fixed_status = new BaseStatus();
                BaseStatus scale_status = new BaseStatus();
                artifactData.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
                this.ArtifactStatus.SetValues(fixed_status, scale_status, false);
                if (artifactParam.abil_inames != null && artifactParam.abil_inames.Length > 0)
                {
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(artifactParam.abil_inames[0]);

                    List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                    bool flag = false;
                    if (learningAbilities != null)
                    {
                        for (int index = 0; index < learningAbilities.Count; ++index)
                        {
                            AbilityData abilityData = learningAbilities[index];
                            if (abilityData != null && abilityParam.iname == abilityData.Param.iname)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    DataSource.Bind <AbilityParam>(this.ArtifactAbility, abilityParam);
                    if (flag)
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Unlocked);
                    }
                    else
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                    }
                }
                else
                {
                    this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && artifactParam != null)
                {
                    ((Selectable)this.m_SetEffectsButton).set_interactable(MonoSingleton <GameManager> .Instance.MasterParam.ExistSkillAbilityDeriveDataWithArtifact(artifactParam.iname));
                    if (((Selectable)this.m_SetEffectsButton).get_interactable())
                    {
                        ArtifactSetList.SetSelectedArtifactParam(artifactParam);
                    }
                }
            }
            else
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(this.mShopitem.iname);

                this.event_shop_item_set_list.Clear();
                if (this.mShopitem.IsSet)
                {
                    for (int index = 0; index < this.mShopitem.children.Length; ++index)
                    {
                        GameObject gameObject = index >= this.event_shop_item_set_list.Count ? (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.ItemTemplate) : ((Component)this.event_shop_item_set_list[index]).get_gameObject();
                        if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                        {
                            gameObject.SetActive(true);
                            Vector3 localScale = gameObject.get_transform().get_localScale();
                            gameObject.get_transform().SetParent(this.ItemParent.get_transform());
                            gameObject.get_transform().set_localScale(localScale);
                            EventShopSetItemListElement component = (EventShopSetItemListElement)gameObject.GetComponent <EventShopSetItemListElement>();
                            StringBuilder stringBuilder           = GameUtility.GetStringBuilder();
                            if (this.mShopitem.children[index].IsArtifact)
                            {
                                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(this.mShopitem.children[index].iname);

                                if (artifactParam != null)
                                {
                                    stringBuilder.Append(artifactParam.name);
                                }
                                component.ArtifactParam = artifactParam;
                            }
                            else if (this.mShopitem.children[index].IsConceptCard)
                            {
                                ConceptCardData cardDataForDisplay = ConceptCardData.CreateConceptCardDataForDisplay(this.mShopitem.children[index].iname);
                                if (cardDataForDisplay != null)
                                {
                                    stringBuilder.Append(cardDataForDisplay.Param.name);
                                }
                                component.SetupConceptCard(cardDataForDisplay);
                            }
                            else
                            {
                                ItemData itemData = new ItemData();
                                itemData.Setup(0L, this.mShopitem.children[index].iname, this.mShopitem.children[index].num);
                                if (itemData != null)
                                {
                                    stringBuilder.Append(itemData.Param.name);
                                }
                                component.itemData = itemData;
                            }
                            stringBuilder.Append("×");
                            stringBuilder.Append(this.mShopitem.children[index].num.ToString());
                            component.itemName.set_text(stringBuilder.ToString());
                            component.SetShopItemDesc(this.mShopitem.children[index]);
                            this.event_shop_item_set_list.Add(component);
                        }
                    }
                }
                DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemId);
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), MonoSingleton <GameManager> .Instance.GetItemParam(this.mShopitem.iname));
            }
            if (this.mShopitem.IsArtifact)
            {
                this.AmountSliderHolder = this.ArtifactAmountSliderHolder;
                this.AmountSlider       = this.ArtifactAmountSlider;
                this.AmountSliderNum    = this.ArtifactAmountSliderNum;
                this.IncrementButton    = this.ArtifactIncrementButton;
                this.DecrementButton    = this.ArtifactDecrementButton;
            }
            else
            {
                this.AmountSliderHolder = this.ItemAmountSliderHolder;
                this.AmountSlider       = this.ItemAmountSlider;
                this.AmountSliderNum    = this.ItemAmountSliderNum;
                this.IncrementButton    = this.ItemIncrementButton;
                this.DecrementButton    = this.ItemDecrementButton;
            }
            this.mEnabledSlider = false;
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderHolder, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSlider, (UnityEngine.Object)null) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AmountSliderNum, (UnityEngine.Object)null))
            {
                if (!this.mShopitem.IsNotLimited && this.mShopitem.remaining_num > 1)
                {
                    this.mEnabledSlider = true;
                    GameParameter component = (GameParameter)((Component)this.LimitedItemPriceText).GetComponent <GameParameter>();
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null))
                    {
                        ((Behaviour)component).set_enabled(false);
                    }
                    this.AmountSliderHolder.SetActive(true);
                    int remainingCurrency = ShopData.GetRemainingCurrency((ShopItem)this.mShopitem);
                    int buyPrice          = ShopData.GetBuyPrice((ShopItem)this.mShopitem);
                    int num1 = 1;
                    if (buyPrice > 0)
                    {
                        while (buyPrice * num1 <= remainingCurrency)
                        {
                            ++num1;
                        }
                    }
                    int num2 = Math.Max(Math.Min(num1 - 1, this.mShopitem.remaining_num), 1);
                    this.AmountSlider.set_minValue(1f);
                    this.AmountSlider.set_maxValue((float)num2);
                    this.SetSliderValue(1f);
                    // ISSUE: method pointer
                    ((UnityEvent <float>) this.AmountSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnSliderValueChanged)));
                }
                else
                {
                    this.mEnabledSlider = false;
                    this.AmountSliderHolder.SetActive(false);
                }
            }
            DataSource.Bind <EventShopItem>(((Component)this).get_gameObject(), this.mShopitem);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #14
0
        public void DisplaySlotType(EAbilitySlot slotType, bool hideEquipped = false)
        {
            this.mLastDisplayMode = UnitAbilityList.RefreshTypes.DisplayAll;
            this.mLastDisplaySlot = slotType;
            for (int index = 0; index < this.mItems.Count; ++index)
            {
                Object.Destroy((Object)((Component)this.mItems[index]).get_gameObject());
            }
            this.mItems.Clear();
            if (this.Unit == null)
            {
                this.Unit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            }
            if (this.Unit == null)
            {
                return;
            }
            List <AbilityData> learnedAbilities = this.Unit.GetAllLearnedAbilities();
            Transform          transform1       = ((Component)this).get_transform();
            bool        flag1    = false;
            GameManager instance = MonoSingleton <GameManager> .Instance;

            if ((instance.Player.TutorialFlags & 1L) == 0L && instance.GetNextTutorialStep() == "ShowAbilityTab")
            {
                instance.CompleteTutorialStep();
                if (instance.GetNextTutorialStep() == "ShowAbilityLvUp")
                {
                    flag1 = true;
                }
            }
            if (Object.op_Inequality((Object)this.Item_Normal, (Object)null))
            {
                for (int index1 = 0; index1 < learnedAbilities.Count; ++index1)
                {
                    AbilityData data = learnedAbilities[index1];
                    if ((slotType == ~EAbilitySlot.Action || slotType == data.SlotType) && (this.ShowFixedAbilities || !data.Param.is_fixed) && (this.ShowMasterAbilities || !((string)this.Unit.UnitParam.ability == data.AbilityID) && !this.Unit.IsQuestClearUnlocked(data.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)))
                    {
                        if (hideEquipped)
                        {
                            bool flag2 = false;
                            for (int index2 = 0; index2 < this.Unit.CurrentJob.AbilitySlots.Length; ++index2)
                            {
                                if (this.Unit.CurrentJob.AbilitySlots[index2] == data.UniqueID)
                                {
                                    flag2 = true;
                                    break;
                                }
                            }
                            if (flag2)
                            {
                                continue;
                            }
                        }
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Normal);
                        this.mItems.Add(abilityListItemEvents);
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), data);
                        abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                        abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(data.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                        if (flag1 && index1 == 0)
                        {
                            SGHighlightObject.Instance().highlightedObject = ((Component)abilityListItemEvents.RankupButton).get_gameObject();
                            SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.023", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.TopLeft, true, false, false);
                        }
                    }
                }
            }
            if (slotType != ~EAbilitySlot.Action && Object.op_Inequality((Object)this.Item_SlotMismatch, (Object)null))
            {
                for (int index = 0; index < learnedAbilities.Count; ++index)
                {
                    AbilityData data = learnedAbilities[index];
                    if (slotType != data.SlotType && (this.ShowFixedAbilities || !data.Param.is_fixed) && (this.ShowMasterAbilities || !((string)this.Unit.UnitParam.ability == data.AbilityID) && !this.Unit.IsQuestClearUnlocked(data.Param.iname, QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility)))
                    {
                        UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_SlotMismatch);
                        this.mItems.Add(abilityListItemEvents);
                        DataSource.Bind <AbilityData>(((Component)abilityListItemEvents).get_gameObject(), data);
                        abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                        abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                        abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                        abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                        ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                        ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                        JobData job;
                        int     rank;
                        if (this.GetAbilitySource(data.AbilityID, out job, out rank))
                        {
                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                            {
                                JobName = job.Name,
                                Rank    = rank
                            });
                        }
                    }
                }
            }
            if (Object.op_Inequality((Object)this.Item_Locked, (Object)null))
            {
                GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                for (int index1 = 0; index1 < this.Unit.Jobs.Length; ++index1)
                {
                    if (this.ShowLockedJobAbilities || this.Unit.Jobs[index1].Rank > 0)
                    {
                        RarityParam rarityParam = instanceDirect.GetRarityParam((int)this.Unit.UnitParam.raremax);
                        for (int lv = this.Unit.Jobs[index1].Rank + 1; lv < JobParam.MAX_JOB_RANK; ++lv)
                        {
                            OString[] learningAbilitys = this.Unit.Jobs[index1].Param.GetLearningAbilitys(lv);
                            if (learningAbilitys != null && (int)rarityParam.UnitJobLvCap >= lv)
                            {
                                for (int index2 = 0; index2 < learningAbilitys.Length; ++index2)
                                {
                                    string key = (string)learningAbilitys[index2];
                                    if (!string.IsNullOrEmpty(key))
                                    {
                                        AbilityParam abilityParam = instanceDirect.GetAbilityParam(key);
                                        if (this.ShowFixedAbilities || !abilityParam.is_fixed)
                                        {
                                            UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                                            this.mItems.Add(abilityListItemEvents);
                                            DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                                            abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                                            abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                                            abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                                            abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                                            abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                                            ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                                            ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                                            DataSource.Bind <AbilityUnlockInfo>(((Component)abilityListItemEvents).get_gameObject(), new AbilityUnlockInfo()
                                            {
                                                JobName = this.Unit.Jobs[index1].Name,
                                                Rank    = lv
                                            });
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                if (this.ShowMasterAbilities && !string.IsNullOrEmpty((string)this.Unit.UnitParam.ability) && this.Unit.LearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == (string)this.Unit.UnitParam.ability)) == null)
                {
                    AbilityParam abilityParam = instanceDirect.GetAbilityParam((string)this.Unit.UnitParam.ability);
                    UnitAbilityListItemEvents abilityListItemEvents = (UnitAbilityListItemEvents)Object.Instantiate <UnitAbilityListItemEvents>((M0)this.Item_Locked);
                    this.mItems.Add(abilityListItemEvents);
                    DataSource.Bind <AbilityParam>(((Component)abilityListItemEvents).get_gameObject(), abilityParam);
                    abilityListItemEvents.OnSelect         = new ListItemEvents.ListItemEvent(this._OnAbilitySelect);
                    abilityListItemEvents.OnRankUp         = new ListItemEvents.ListItemEvent(this._OnAbilityRankUp);
                    abilityListItemEvents.OnOpenDetail     = new ListItemEvents.ListItemEvent(this._OnAbilityDetail);
                    abilityListItemEvents.OnRankUpBtnPress = new ListItemEvents.ListItemEvent(this._OnRankUpBtnPress);
                    abilityListItemEvents.OnRankUpBtnUp    = new ListItemEvents.ListItemEvent(this._OnRankUpBtnUp);
                    ((Component)abilityListItemEvents).get_transform().SetParent(transform1, false);
                    ((Component)abilityListItemEvents).get_gameObject().SetActive(true);
                }
            }
            if (Object.op_Inequality((Object)this.ScrollParent, (Object)null))
            {
                this.mDecelerationRate = this.ScrollParent.get_decelerationRate();
                this.ScrollParent.set_decelerationRate(0.0f);
            }
            RectTransform transform2 = ((Component)this).get_transform() as RectTransform;

            transform2.set_anchoredPosition(new Vector2((float)transform2.get_anchoredPosition().x, 0.0f));
            this.StartCoroutine(this.RefreshScrollRect());
        }
Example #15
0
 public void Refresh()
 {
     this.DestroyItems();
     if (Object.op_Equality((Object)this.ItemTemplate, (Object)null))
     {
         Debug.LogError((object)"ItemTemplate が未設定です。");
     }
     else
     {
         AbilityData dataOfClass = DataSource.FindDataOfClass <AbilityData>(((Component)this).get_gameObject(), (AbilityData)null);
         if (dataOfClass == null)
         {
             Debug.LogWarning((object)"AbilityData を参照できません。");
         }
         else
         {
             this.isCommandTutorial = false;
             GameManager instance = MonoSingleton <GameManager> .Instance;
             if ((instance.Player.TutorialFlags & 1L) == 0L && (instance.GetNextTutorialStep() == "ShowAbilityCommand" || instance.GetNextTutorialStep() == "ShowMACommand"))
             {
                 instance.CompleteTutorialStep();
                 this.isCommandTutorial = true;
             }
             this.ScrollViewRect.set_normalizedPosition(new Vector2(0.5f, 1f));
             GameParameter.UpdateAll(((Component)this).get_gameObject());
             Transform parent = ((Component)this.ItemTemplate).get_transform().get_parent();
             for (int index = 0; index < dataOfClass.Skills.Count; ++index)
             {
                 ListItemEvents listItemEvents = (ListItemEvents)Object.Instantiate <ListItemEvents>((M0)this.ItemTemplate);
                 ((Component)listItemEvents).get_transform().SetParent(parent, false);
                 this.mItems.Add(listItemEvents);
                 SkillData skill = dataOfClass.Skills[index];
                 DataSource.Bind <SkillData>(((Component)listItemEvents).get_gameObject(), skill);
                 DataSource.Bind <Unit>(((Component)listItemEvents).get_gameObject(), this.mUnit);
                 ((Component)listItemEvents).get_gameObject().SetActive(true);
                 listItemEvents.OnSelect = (ListItemEvents.ListItemEvent)(go => this.SelectSkill(DataSource.FindDataOfClass <SkillData>(go, (SkillData)null)));
                 Selectable selectable = (Selectable)((Component)listItemEvents).GetComponentInChildren <Selectable>();
                 if (Object.op_Equality((Object)selectable, (Object)null))
                 {
                     selectable = (Selectable)((Component)listItemEvents).GetComponent <Selectable>();
                 }
                 if (Object.op_Inequality((Object)selectable, (Object)null))
                 {
                     selectable.set_interactable(this.mUnit.CheckEnableUseSkill(skill, false));
                     if (selectable.get_interactable())
                     {
                         selectable.set_interactable(this.mUnit.IsUseSkillCollabo(skill, true));
                     }
                     ((Behaviour)selectable).set_enabled(!((Behaviour)selectable).get_enabled());
                     ((Behaviour)selectable).set_enabled(!((Behaviour)selectable).get_enabled());
                 }
                 UnitAbilitySkillListItem component = (UnitAbilitySkillListItem)((Component)listItemEvents).get_gameObject().GetComponent <UnitAbilitySkillListItem>();
                 if (Object.op_Inequality((Object)component, (Object)null))
                 {
                     bool noLimit = !this.mUnit.CheckEnableSkillUseCount(skill);
                     component.SetSkillCount((int)this.mUnit.GetSkillUseCount(skill), (int)this.mUnit.GetSkillUseCountMax(skill), noLimit);
                     component.SetCastSpeed(skill.CastSpeed);
                 }
                 if (this.isCommandTutorial)
                 {
                     if (skill.SkillID == "SK_SEI_SWORD_CRASH")
                     {
                         SGHighlightObject.Instance().highlightedObject = ((Component)listItemEvents).get_gameObject();
                         SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_0.005", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.TopLeft, false, false, false);
                     }
                     else if (skill.SkillID == "SK_SEI_SHINING_CROSS_TUTORIAL")
                     {
                         SGHighlightObject.Instance().highlightedObject = ((Component)listItemEvents).get_gameObject();
                         SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_0.009", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.BottomLeft, false, false, false);
                     }
                 }
             }
         }
     }
 }
        private void Refresh()
        {
            UnitData data1 = (UnitData)null;

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)UnitEnhanceV3.Instance))
            {
                data1 = UnitEnhanceV3.Instance.CurrentUnit;
            }
            if (data1 == null)
            {
                data1 = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);
            }
            if (data1 == null && AbilityDetailWindow.BindUnit != null)
            {
                data1 = AbilityDetailWindow.BindUnit;
            }
            if (data1 == null && AbilityDetailWindow.BindAbility == null)
            {
                DebugUtility.LogError("Not found bind unit data.");
            }
            else
            {
                if (AbilityDetailWindow.BindAbility != null)
                {
                    DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), AbilityDetailWindow.BindAbility);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null))
                    {
                        List <AbilityDetailWindow.ViewContentParam> viewContentParams = new List <AbilityDetailWindow.ViewContentParam>();
                        if (AbilityDetailWindow.BindAbility.skills != null)
                        {
                            for (int index = 0; index < AbilityDetailWindow.BindAbility.skills.Length; ++index)
                            {
                                SkillParam skillParam = MonoSingleton <GameManager> .Instance.GetSkillParam(AbilityDetailWindow.BindAbility.skills[index].iname);

                                AbilityDetailWindow.AddSkillParam(viewContentParams, skillParam, (SkillDeriveParam)null);
                            }
                        }
                        for (int index = 0; index < viewContentParams.Count; ++index)
                        {
                            GameObject      gameObject          = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate);
                            SkillDeriveList componentInChildren = (SkillDeriveList)gameObject.GetComponentInChildren <SkillDeriveList>();
                            componentInChildren.Setup(viewContentParams[index].m_SkillParam, viewContentParams[index].m_SkillDeriveParams);
                            gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                            gameObject.SetActive(true);
                            this.m_SkillDeriveList.Add(componentInChildren);
                        }
                    }
                }
                else
                {
                    AbilityData  data2        = data1.GetAbilityData((long)GlobalVars.SelectedAbilityUniqueID);
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam((string)GlobalVars.SelectedAbilityID);

                    QuestClearUnlockUnitDataParam[]      unlockedSkills          = data1.UnlockedSkills;
                    List <QuestClearUnlockUnitDataParam> unlockUnitDataParamList = new List <QuestClearUnlockUnitDataParam>();
                    QuestClearUnlockUnitDataParam[]      allUnlockUnitDatas      = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnlockUnitDatas();

                    if (allUnlockUnitDatas != null)
                    {
                        for (int index = 0; index < allUnlockUnitDatas.Length; ++index)
                        {
                            QuestClearUnlockUnitDataParam param = allUnlockUnitDatas[index];
                            if (param.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill && param.uid == data1.UnitID && param.parent_id == abilityParam.iname && (unlockedSkills == null || Array.FindIndex <QuestClearUnlockUnitDataParam>(unlockedSkills, (Predicate <QuestClearUnlockUnitDataParam>)(p => p.iname == param.iname)) == -1))
                            {
                                unlockUnitDataParamList.Add(param);
                            }
                        }
                    }
                    if (data2 != null && data2.Param != null && data2.IsDeriveBaseAbility)
                    {
                        data2 = data2.DerivedAbility;
                    }
                    RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)data1.UnitParam.raremax);

                    int num = Math.Min((int)rarityParam.UnitLvCap + (int)rarityParam.UnitAwakeLvCap, abilityParam.GetRankCap());
                    DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1);
                    DataSource.Bind <AbilityData>(((Component)this).get_gameObject(), data2);
                    AbilityParam data3 = abilityParam;
                    if (AbilityDetailWindow.IsEnableSkillChange)
                    {
                        string key = data1.SearchAbilityReplacementSkill(abilityParam.iname);
                        if (!string.IsNullOrEmpty(key))
                        {
                            data3 = MonoSingleton <GameManager> .Instance.GetAbilityParam(key);
                        }
                    }
                    DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), data3);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null))
                    {
                        List <AbilityDetailWindow.ViewContentParam> viewContentParams = new List <AbilityDetailWindow.ViewContentParam>();
                        if (data2 != null && data2.LearningSkills != null)
                        {
                            for (int index1 = 0; index1 < data2.LearningSkills.Length; ++index1)
                            {
                                if (data2.LearningSkills[index1].locklv <= num)
                                {
                                    string str1 = data2.LearningSkills[index1].iname;
                                    if (unlockedSkills != null)
                                    {
                                        for (int index2 = 0; index2 < unlockedSkills.Length; ++index2)
                                        {
                                            if (unlockedSkills[index2].old_id == str1)
                                            {
                                                str1 = unlockedSkills[index2].new_id;
                                                break;
                                            }
                                        }
                                    }
                                    if (AbilityDetailWindow.IsEnableSkillChange)
                                    {
                                        string str2 = data1.SearchReplacementSkill(str1);
                                        if (!string.IsNullOrEmpty(str2))
                                        {
                                            str1 = str2;
                                        }
                                    }
                                    SkillData[] deriveSkills = data2.FindDeriveSkills(str1);
                                    if (deriveSkills.Length > 0)
                                    {
                                        foreach (SkillData skillData in deriveSkills)
                                        {
                                            AbilityDetailWindow.AddSkillParam(viewContentParams, skillData.SkillParam, skillData.DeriveParam);
                                        }
                                    }
                                    else
                                    {
                                        AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(str1), (SkillDeriveParam)null);
                                    }
                                }
                            }
                            if (unlockedSkills != null)
                            {
                                for (int index = 0; index < unlockedSkills.Length; ++index)
                                {
                                    if (unlockedSkills[index].add && unlockedSkills[index].parent_id == data2.AbilityID)
                                    {
                                        AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockedSkills[index].new_id), (SkillDeriveParam)null);
                                    }
                                }
                            }
                        }
                        else
                        {
                            for (int index = 0; index < abilityParam.skills.Length; ++index)
                            {
                                if (abilityParam.skills[index].locklv <= num)
                                {
                                    AbilityDetailWindow.AddSkillParam(viewContentParams, MonoSingleton <GameManager> .Instance.GetSkillParam(abilityParam.skills[index].iname), (SkillDeriveParam)null);
                                }
                            }
                        }
                        if (data1.MasterAbility != null && data1.CollaboAbility != null)
                        {
                            AbilityData abilityData = data1.MasterAbility;
                            if (data1.MasterAbility.IsDeriveBaseAbility)
                            {
                                abilityData = data1.MasterAbility.DerivedAbility;
                            }
                            if (abilityData == data2)
                            {
                                using (List <SkillData> .Enumerator enumerator = data1.CollaboAbility.Skills.GetEnumerator())
                                {
                                    while (enumerator.MoveNext())
                                    {
                                        SkillData current = enumerator.Current;
                                        AbilityDetailWindow.AddSkillParam(viewContentParams, current.SkillParam, (SkillDeriveParam)null);
                                    }
                                }
                            }
                        }
                        for (int index = 0; index < viewContentParams.Count; ++index)
                        {
                            GameObject      gameObject          = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate);
                            SkillDeriveList componentInChildren = (SkillDeriveList)gameObject.GetComponentInChildren <SkillDeriveList>();
                            componentInChildren.Setup(viewContentParams[index].m_SkillParam, viewContentParams[index].m_SkillDeriveParams);
                            gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                            gameObject.SetActive(true);
                            this.m_SkillDeriveList.Add(componentInChildren);
                        }
                        for (int index = 0; index < unlockUnitDataParamList.Count; ++index)
                        {
                            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillLockedTemplate);
                            DataSource.Bind <SkillParam>(gameObject, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockUnitDataParamList[index].new_id));
                            DataSource.Bind <QuestClearUnlockUnitDataParam>(gameObject, unlockUnitDataParamList[index]);
                            gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                            gameObject.SetActive(true);
                        }
                        for (int index = 0; index < viewContentParams.Count; ++index)
                        {
                            if (viewContentParams[index].m_SkillDeriveParams != null && viewContentParams[index].m_SkillDeriveParams.Count >= 1)
                            {
                                this.m_ShowBaseToggle.set_interactable(true);
                                break;
                            }
                        }
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }
Example #17
0
        private void Refresh()
        {
            ArtifactData artifactData = new ArtifactData();

            artifactData.Deserialize(new Json_Artifact()
            {
                iname = GlobalVars.ArtifactListItem.param.iname,
                rare  = GlobalVars.ArtifactListItem.param.rareini
            });
            this.UnlockArtifact = artifactData;
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), this.UnlockArtifact);
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), this.UnlockArtifact.ArtifactParam);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AbilityListItem, (UnityEngine.Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         abilityListItem   = this.AbilityListItem;
                CanvasGroup        component         = (CanvasGroup)abilityListItem.GetComponent <CanvasGroup>();
                bool               flag              = false;
                ArtifactParam      artifactParam     = artifactData.ArtifactParam;
                List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    AbilityParam data1      = (AbilityParam)null;
                    string       abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            abil_iname = artifactParam.abil_inames[index];
                            data1      = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data1 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data1 == null)
                    {
                        component.set_alpha(this.ability_hidden_alpha);
                        DataSource.Bind <AbilityParam>(this.AbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.AbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.AbilityListItem, data1);
                    DataSource.Bind <AbilityData>(abilityListItem, (AbilityData)null);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)component, (UnityEngine.Object)null) && learningAbilities != null && learningAbilities != null)
                    {
                        AbilityData data2 = learningAbilities.Find((Predicate <AbilityData>)(x => x.Param.iname == abil_iname));
                        if (data2 != null)
                        {
                            DataSource.Bind <AbilityData>(abilityListItem, data2);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    component.set_alpha(this.ability_unlock_alpha);
                }
                else
                {
                    component.set_alpha(this.ability_hidden_alpha);
                }
            }
            BaseStatus fixed_status = new BaseStatus();
            BaseStatus scale_status = new BaseStatus();

            this.UnlockArtifact.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
            this.ArtifactStatus.SetValues(fixed_status, scale_status, false);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_SetEffectsButton, (UnityEngine.Object)null) && this.UnlockArtifact.ArtifactParam != null)
            {
                ((Selectable)this.m_SetEffectsButton).set_interactable(MonoSingleton <GameManager> .Instance.MasterParam.ExistSkillAbilityDeriveDataWithArtifact(this.UnlockArtifact.ArtifactParam.iname));
                if (((Selectable)this.m_SetEffectsButton).get_interactable())
                {
                    ArtifactSetList.SetSelectedArtifactParam(this.UnlockArtifact.ArtifactParam);
                }
            }
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #18
0
        private void Refresh()
        {
            ArtifactData artifactData = DataSource.FindDataOfClass <ArtifactData>(((Component)this).get_gameObject(), (ArtifactData)null);

            if (artifactData == null)
            {
                ArtifactParam dataOfClass = DataSource.FindDataOfClass <ArtifactParam>(((Component)this).get_gameObject(), (ArtifactParam)null);
                artifactData = new ArtifactData();
                artifactData.Deserialize(new Json_Artifact()
                {
                    iname = dataOfClass.iname,
                    rare  = dataOfClass.rareini
                });
            }
            this.UnlockArtifact = artifactData;
            DataSource.Bind <ArtifactData>(((Component)this).get_gameObject(), this.UnlockArtifact);
            DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), this.UnlockArtifact.ArtifactParam);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mAbilityListItem, (UnityEngine.Object)null))
            {
                MasterParam        masterParam       = MonoSingleton <GameManager> .Instance.MasterParam;
                GameObject         mAbilityListItem  = this.mAbilityListItem;
                bool               flag              = false;
                ArtifactParam      artifactParam     = artifactData.ArtifactParam;
                List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                if (artifactParam.abil_inames != null)
                {
                    AbilityParam data1      = (AbilityParam)null;
                    string       abil_iname = (string)null;
                    for (int index = 0; index < artifactParam.abil_inames.Length; ++index)
                    {
                        if (!string.IsNullOrEmpty(artifactParam.abil_inames[index]) && artifactParam.abil_shows[index] != 0)
                        {
                            abil_iname = artifactParam.abil_inames[index];
                            data1      = masterParam.GetAbilityParam(artifactParam.abil_inames[index]);
                            if (data1 != null)
                            {
                                break;
                            }
                        }
                    }
                    if (data1 == null)
                    {
                        this.mAbilityAnimator.SetInteger(this.mAbilityListItemState, 0);
                        DataSource.Bind <AbilityParam>(this.mAbilityListItem, (AbilityParam)null);
                        DataSource.Bind <AbilityData>(this.mAbilityListItem, (AbilityData)null);
                        return;
                    }
                    DataSource.Bind <AbilityParam>(this.mAbilityListItem, data1);
                    DataSource.Bind <AbilityData>(mAbilityListItem, (AbilityData)null);
                    if (learningAbilities != null && learningAbilities != null)
                    {
                        AbilityData data2 = learningAbilities.Find((Predicate <AbilityData>)(x => x.Param.iname == abil_iname));
                        if (data2 != null)
                        {
                            DataSource.Bind <AbilityData>(mAbilityListItem, data2);
                            flag = true;
                        }
                    }
                }
                if (flag)
                {
                    this.mAbilityAnimator.SetInteger(this.mAbilityListItemState, 2);
                }
                else
                {
                    this.mAbilityAnimator.SetInteger(this.mAbilityListItemState, 0);
                }
            }
            BaseStatus fixed_status = new BaseStatus();
            BaseStatus scale_status = new BaseStatus();

            this.UnlockArtifact.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
            this.mArtifactStatus.SetValues(fixed_status, scale_status, false);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
Example #19
0
 public void JobRankUp()
 {
     ++this.mRank;
     for (int index = 0; index < this.mEquips.Length; ++index)
     {
         this.mEquips[index].Setup(this.GetRankupItemID(this.Rank, index));
     }
     if ((int)this.mRank == 1 && !string.IsNullOrEmpty(this.mJobParam.fixed_ability) && this.mLearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == this.mJobParam.fixed_ability)) == null)
     {
         AbilityData        ability          = new AbilityData();
         List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities(false);
         string             fixedAbility     = this.mJobParam.fixed_ability;
         long val1 = 0;
         int  exp  = 0;
         for (int index = 0; index < learnedAbilities.Count; ++index)
         {
             val1 = Math.Max(val1, learnedAbilities[index].UniqueID);
         }
         long iid = val1 + 1L;
         try
         {
             ability.Setup(this.mOwner, iid, fixedAbility, exp, 0);
             this.mLearnAbilitys.Add(ability);
             this.SetAbilitySlot(0, ability);
         }
         catch (Exception ex)
         {
             DebugUtility.LogException(ex);
         }
     }
     OString[] learningAbilitys = this.GetLearningAbilitys((int)this.mRank);
     if (learningAbilitys == null)
     {
         return;
     }
     for (int index1 = 0; index1 < learningAbilitys.Length; ++index1)
     {
         string abilityID = (string)learningAbilitys[index1];
         if (!string.IsNullOrEmpty(abilityID) && this.mLearnAbilitys.Find((Predicate <AbilityData>)(p => p.AbilityID == abilityID)) == null)
         {
             AbilityData        abilityData      = new AbilityData();
             string             iname            = abilityID;
             List <AbilityData> learnedAbilities = this.mOwner.GetAllLearnedAbilities(false);
             long val1 = 0;
             int  exp  = 0;
             for (int index2 = 0; index2 < learnedAbilities.Count; ++index2)
             {
                 val1 = Math.Max(val1, learnedAbilities[index2].UniqueID);
             }
             long iid = val1 + 1L;
             try
             {
                 abilityData.Setup(this.mOwner, iid, iname, exp, 0);
                 this.mLearnAbilitys.Add(abilityData);
             }
             catch (Exception ex)
             {
                 DebugUtility.LogException(ex);
             }
         }
     }
 }
        private void Refresh()
        {
            ShopItem data = MonoSingleton <GameManager> .Instance.Player.GetShopData(GlobalVars.ShopType).items[GlobalVars.ShopBuyIndex];

            this.ItemWindow.SetActive(!data.IsArtifact);
            this.ArtifactWindow.SetActive(data.IsArtifact);
            if (Object.op_Inequality((Object)this.AmountNum, (Object)null))
            {
                this.AmountNum.set_text(data.remaining_num.ToString());
            }
            if (Object.op_Inequality((Object)this.Sold, (Object)null))
            {
                this.Sold.SetActive(!data.IsNotLimited);
            }
            if (data.IsArtifact)
            {
                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data.iname);

                DataSource.Bind <ArtifactParam>(((Component)this).get_gameObject(), artifactParam);
                this.mArtifactParam = artifactParam;
                ArtifactData artifactData = new ArtifactData();
                artifactData.Deserialize(new Json_Artifact()
                {
                    iname = artifactParam.iname,
                    rare  = artifactParam.rareini
                });
                BaseStatus fixed_status = new BaseStatus();
                BaseStatus scale_status = new BaseStatus();
                artifactData.GetHomePassiveBuffStatus(ref fixed_status, ref scale_status, (UnitData)null, 0, true);
                this.ArtifactStatus.SetValues(fixed_status, scale_status);
                if (artifactParam.abil_inames != null && artifactParam.abil_inames.Length > 0)
                {
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(artifactParam.abil_inames[0]);

                    List <AbilityData> learningAbilities = artifactData.LearningAbilities;
                    bool flag = false;
                    if (learningAbilities != null)
                    {
                        for (int index = 0; index < learningAbilities.Count; ++index)
                        {
                            AbilityData abilityData = learningAbilities[index];
                            if (abilityData != null && abilityParam.iname == abilityData.Param.iname)
                            {
                                flag = true;
                                break;
                            }
                        }
                    }
                    DataSource.Bind <AbilityParam>(this.ArtifactAbility, abilityParam);
                    if (flag)
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Unlocked);
                    }
                    else
                    {
                        this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                    }
                }
                else
                {
                    this.ArtifactAbilityAnimation.SetInteger(this.AbilityListItemState, this.AbilityListItem_Hidden);
                }
            }
            else
            {
                ItemData itemDataByItemId = MonoSingleton <GameManager> .Instance.Player.FindItemDataByItemID(data.iname);

                this.shop_item_set_list.Clear();
                if (data.IsSet)
                {
                    for (int index = 0; index < data.children.Length; ++index)
                    {
                        GameObject gameObject = index >= this.shop_item_set_list.Count ? (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate) : ((Component)this.shop_item_set_list[index]).get_gameObject();
                        if (Object.op_Inequality((Object)gameObject, (Object)null))
                        {
                            gameObject.SetActive(true);
                            Vector3 localScale = gameObject.get_transform().get_localScale();
                            gameObject.get_transform().SetParent(this.ItemParent.get_transform());
                            gameObject.get_transform().set_localScale(localScale);
                            ShopSetItemListElement component     = (ShopSetItemListElement)gameObject.GetComponent <ShopSetItemListElement>();
                            StringBuilder          stringBuilder = GameUtility.GetStringBuilder();
                            if (data.children[index].IsArtifact)
                            {
                                ArtifactParam artifactParam = MonoSingleton <GameManager> .Instance.MasterParam.GetArtifactParam(data.children[index].iname);

                                if (artifactParam != null)
                                {
                                    stringBuilder.Append(artifactParam.name);
                                }
                                component.ArtifactParam = artifactParam;
                            }
                            else
                            {
                                ItemData itemData = new ItemData();
                                itemData.Setup(0L, data.children[index].iname, data.children[index].num);
                                if (itemData != null)
                                {
                                    stringBuilder.Append(itemData.Param.name);
                                }
                                component.itemData = itemData;
                            }
                            stringBuilder.Append("×");
                            stringBuilder.Append(data.children[index].num.ToString());
                            component.itemName.set_text(stringBuilder.ToString());
                            component.SetShopItemDesc(data.children[index]);
                            this.shop_item_set_list.Add(component);
                        }
                    }
                }
                DataSource.Bind <ItemData>(((Component)this).get_gameObject(), itemDataByItemId);
                DataSource.Bind <ItemParam>(((Component)this).get_gameObject(), MonoSingleton <GameManager> .Instance.GetItemParam(data.iname));
            }
            DataSource.Bind <ShopItem>(((Component)this).get_gameObject(), data);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
        private void Refresh()
        {
            UnitData data1 = (UnitData)null;

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)UnitEnhanceV3.Instance))
            {
                data1 = UnitEnhanceV3.Instance.CurrentUnit;
            }
            if (data1 == null)
            {
                data1 = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);
            }
            if (data1 == null && AbilityDetailWindow.BindObject != null)
            {
                data1 = AbilityDetailWindow.BindObject;
            }
            if (data1 == null)
            {
                DebugUtility.LogError("Not found bind unit data.");
            }
            else
            {
                AbilityData  abilityData  = data1.GetAbilityData((long)GlobalVars.SelectedAbilityUniqueID);
                AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam((string)GlobalVars.SelectedAbilityID);

                QuestClearUnlockUnitDataParam[]      unlockedSkills          = data1.UnlockedSkills;
                List <QuestClearUnlockUnitDataParam> unlockUnitDataParamList = new List <QuestClearUnlockUnitDataParam>();
                QuestClearUnlockUnitDataParam[]      allUnlockUnitDatas      = MonoSingleton <GameManager> .Instance.MasterParam.GetAllUnlockUnitDatas();

                if (allUnlockUnitDatas != null)
                {
                    for (int index = 0; index < allUnlockUnitDatas.Length; ++index)
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        AbilityDetailWindow.\u003CRefresh\u003Ec__AnonStorey2F5 refreshCAnonStorey2F5 = new AbilityDetailWindow.\u003CRefresh\u003Ec__AnonStorey2F5();
                        // ISSUE: reference to a compiler-generated field
                        refreshCAnonStorey2F5.param = allUnlockUnitDatas[index];
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated method
                        if (refreshCAnonStorey2F5.param.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill && refreshCAnonStorey2F5.param.uid == data1.UnitID && refreshCAnonStorey2F5.param.parent_id == abilityParam.iname && (unlockedSkills == null || Array.FindIndex <QuestClearUnlockUnitDataParam>(unlockedSkills, new Predicate <QuestClearUnlockUnitDataParam>(refreshCAnonStorey2F5.\u003C\u003Em__2F6)) == -1))
                        {
                            // ISSUE: reference to a compiler-generated field
                            unlockUnitDataParamList.Add(refreshCAnonStorey2F5.param);
                        }
                    }
                }
                RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)data1.UnitParam.raremax);

                int num = Math.Min((int)rarityParam.UnitLvCap + (int)rarityParam.UnitAwakeLvCap, abilityParam.GetRankCap());
                DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1);
                DataSource.Bind <AbilityData>(((Component)this).get_gameObject(), abilityData);
                AbilityParam data2 = abilityParam;
                if (AbilityDetailWindow.IsEnableSkillChange)
                {
                    string key = data1.SearchAbilityReplacementSkill(abilityParam.iname);
                    if (!string.IsNullOrEmpty(key))
                    {
                        data2 = MonoSingleton <GameManager> .Instance.GetAbilityParam(key);
                    }
                }
                DataSource.Bind <AbilityParam>(((Component)this).get_gameObject(), data2);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SkillTemplate, (UnityEngine.Object)null))
                {
                    List <SkillParam> skillParamList = new List <SkillParam>();
                    if (abilityData != null && abilityData.LearningSkills != null)
                    {
                        for (int index1 = 0; index1 < abilityData.LearningSkills.Length; ++index1)
                        {
                            if (abilityData.LearningSkills[index1].locklv <= num)
                            {
                                string str1 = abilityData.LearningSkills[index1].iname;
                                if (unlockedSkills != null)
                                {
                                    for (int index2 = 0; index2 < unlockedSkills.Length; ++index2)
                                    {
                                        if (unlockedSkills[index2].old_id == str1)
                                        {
                                            str1 = unlockedSkills[index2].new_id;
                                            break;
                                        }
                                    }
                                }
                                if (AbilityDetailWindow.IsEnableSkillChange)
                                {
                                    string str2 = data1.SearchReplacementSkill(str1);
                                    if (!string.IsNullOrEmpty(str2))
                                    {
                                        str1 = str2;
                                    }
                                }
                                skillParamList.Add(MonoSingleton <GameManager> .Instance.GetSkillParam(str1));
                            }
                        }
                        if (unlockedSkills != null)
                        {
                            for (int index = 0; index < unlockedSkills.Length; ++index)
                            {
                                if (unlockedSkills[index].add && unlockedSkills[index].parent_id == abilityData.AbilityID)
                                {
                                    skillParamList.Add(MonoSingleton <GameManager> .Instance.GetSkillParam(unlockedSkills[index].new_id));
                                }
                            }
                        }
                    }
                    else
                    {
                        for (int index = 0; index < abilityParam.skills.Length; ++index)
                        {
                            if (abilityParam.skills[index].locklv <= num)
                            {
                                skillParamList.Add(MonoSingleton <GameManager> .Instance.GetSkillParam(abilityParam.skills[index].iname));
                            }
                        }
                    }
                    if (abilityData == data1.MasterAbility && data1.CollaboAbility != null)
                    {
                        using (List <SkillData> .Enumerator enumerator = data1.CollaboAbility.Skills.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                SkillData current = enumerator.Current;
                                skillParamList.Add(current.SkillParam);
                            }
                        }
                    }
                    for (int index = 0; index < skillParamList.Count; ++index)
                    {
                        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillTemplate);
                        DataSource.Bind <SkillParam>(gameObject, skillParamList[index]);
                        gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                        gameObject.SetActive(true);
                    }
                    for (int index = 0; index < unlockUnitDataParamList.Count; ++index)
                    {
                        GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.SkillLockedTemplate);
                        DataSource.Bind <SkillParam>(gameObject, MonoSingleton <GameManager> .Instance.GetSkillParam(unlockUnitDataParamList[index].new_id));
                        DataSource.Bind <QuestClearUnlockUnitDataParam>(gameObject, unlockUnitDataParamList[index]);
                        gameObject.get_transform().SetParent(this.SkillLayoutParent, false);
                        gameObject.SetActive(true);
                    }
                }
                GameParameter.UpdateAll(((Component)this).get_gameObject());
            }
        }
Example #22
0
 public void Setup(AbilityData newAbility)
 {
     this.m_LearnSkillName.set_text("アビリティ:" + newAbility.AbilityName);
     this.m_LearnSkillEffect.set_text(newAbility.Param.expr);
 }