예제 #1
0
        public void UpdateLearningsSkillCollabo(Json_CollaboSkill[] skills)
        {
            if (this.mSkills == null)
            {
                return;
            }
            this.mSkills.Clear();
            if (skills == null || skills.Length == 0)
            {
                return;
            }
            AbilityParam abilityParam = this.Param;

            if (abilityParam == null || abilityParam.skills.Length == 0)
            {
                return;
            }
            List <LearningSkill> learningSkillList = new List <LearningSkill>((IEnumerable <LearningSkill>)abilityParam.skills);

            foreach (Json_CollaboSkill skill in skills)
            {
                Json_CollaboSkill cs = skill;
                if (!string.IsNullOrEmpty(cs.iname) && learningSkillList.Find((Predicate <LearningSkill>)(tls => tls.iname == cs.iname)) != null)
                {
                    SkillData skillData = new SkillData();
                    skillData.Setup(cs.iname, (int)this.mRank, (int)this.mRankCap, (MasterParam)null);
                    skillData.IsCollabo = (OBool)true;
                    this.mSkills.Add(skillData);
                }
            }
        }
예제 #2
0
        public void Setup(AbilityParam ability_param, bool is_derive_ability, bool is_enable, bool is_locked, bool has_derive_ability)
        {
            this.mAbilityParam     = ability_param;
            this.mIsEnable         = is_enable;
            this.mHasDeriveAbility = has_derive_ability;
            if (is_locked)
            {
                this.mLockImage.SetActive(is_locked);
            }
            else
            {
                this.mDisableMask.SetActive(!this.mIsEnable);
            }
            if (Object.op_Inequality((Object)this.mUnitIcon, (Object)null))
            {
                this.mUnitIcon.SetActive(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null) != null);
            }
            if (Object.op_Inequality((Object)this.mJobIcon, (Object)null))
            {
                this.mJobIcon.SetActive(DataSource.FindDataOfClass <JobParam>(((Component)this).get_gameObject(), (JobParam)null) != null);
            }
            if (!Object.op_Inequality((Object)this.mConditionsText, (Object)null))
            {
                return;
            }
            AbilityConditions abilityConditions = new AbilityConditions();

            abilityConditions.Setup(ability_param, MonoSingleton <GameManager> .Instance.MasterParam);
            this.mConditionsText.set_text(abilityConditions.MakeConditionsText());
        }
예제 #3
0
 public void Setup(UnitData owner, long iid, string iname, int exp, int rank_cap = 0)
 {
     if (string.IsNullOrEmpty(iname))
     {
         this.Reset();
     }
     else
     {
         GameManager instance = MonoSingleton <GameManager> .Instance;
         this.mOwner        = owner;
         this.mAbilityParam = instance.GetAbilityParam(iname);
         this.mUniqueID     = (OLong)iid;
         this.mExp          = (OInt)exp;
         this.mRankCap      = (OInt)this.mAbilityParam.GetRankCap();
         if (rank_cap > 0)
         {
             this.mRankCap = (OInt)rank_cap;
         }
         this.mRank   = (OInt)this.CalcRank();
         this.mSkills = (List <SkillData>)null;
         AbilityParam abilityParam = this.Param;
         if (abilityParam.skills == null)
         {
             return;
         }
         this.mSkills = new List <SkillData>(abilityParam.skills.Length);
         this.UpdateLearningsSkill(true, (List <SkillData>)null);
     }
 }
예제 #4
0
 public static string AbilityIcon(AbilityParam ability)
 {
     AssetPath.mSB.Length = 0;
     AssetPath.mSB.Append("AbilityIcon/");
     AssetPath.mSB.Append(ability.icon);
     return(AssetPath.mSB.ToString());
 }
예제 #5
0
 private void Reset()
 {
     this.mUniqueID     = (OLong)0L;
     this.mAbilityParam = (AbilityParam)null;
     this.mExp          = (OInt)0;
     this.mRank         = (OInt)1;
     this.mSkills       = (List <SkillData>)null;
 }
예제 #6
0
        private void RefreshAbilitList()
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.mAbilityTemplate, (UnityEngine.Object)null))
            {
                return;
            }
            GameUtility.DestroyGameObjects(this.mAbilits);
            this.mAbilits.Clear();
            UnitData dataOfClass = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);

            if (dataOfClass == null)
            {
                return;
            }
            Transform          parent           = this.mAbilityTemplate.get_transform().get_parent();
            List <AbilityData> learnedAbilities = dataOfClass.GetAllLearnedAbilities(false);

            for (int index = 0; index < learnedAbilities.Count; ++index)
            {
                AbilityData data = learnedAbilities[index];
                if (dataOfClass.MapEffectAbility != data)
                {
                    GameObject gameObject1 = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.mAbilityTemplate);
                    GameObject gameObject2 = ((Component)gameObject1.get_transform().FindChild("icon")).get_gameObject();
                    ((Component)gameObject1.get_transform().FindChild("locked")).get_gameObject().SetActive(false);
                    ((ImageArray)gameObject2.GetComponent <ImageArray>()).ImageIndex = (int)data.SlotType;
                    gameObject1.get_transform().SetParent(parent, false);
                    DataSource.Bind <AbilityData>(gameObject1, data);
                    gameObject1.SetActive(true);
                    this.mAbilits.Add(gameObject1);
                }
            }
            RarityParam rarityParam = MonoSingleton <GameManager> .Instance.GetRarityParam((int)dataOfClass.UnitParam.raremax);

            for (int lv = dataOfClass.CurrentJob.Rank + 1; lv < JobParam.MAX_JOB_RANK; ++lv)
            {
                OString[] learningAbilitys = dataOfClass.CurrentJob.Param.GetLearningAbilitys(lv);
                if (learningAbilitys != null && (int)rarityParam.UnitJobLvCap >= lv)
                {
                    for (int index = 0; index < learningAbilitys.Length; ++index)
                    {
                        string key = (string)learningAbilitys[index];
                        if (!string.IsNullOrEmpty(key))
                        {
                            AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.GetAbilityParam(key);

                            GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.mAbilityTemplate);
                            ((ImageArray)((Component)gameObject.get_transform().FindChild("icon")).get_gameObject().GetComponent <ImageArray>()).ImageIndex = (int)abilityParam.slot;
                            gameObject.get_transform().SetParent(parent, false);
                            DataSource.Bind <AbilityParam>(gameObject, abilityParam);
                            gameObject.SetActive(true);
                            this.mAbilits.Add(gameObject);
                        }
                    }
                }
            }
            GameParameter.UpdateAll(((Component)parent).get_gameObject());
        }
예제 #7
0
 public void Setup(AbilityParam abil, MasterParam master)
 {
     this.m_AbilityParam = abil;
     this.m_CondsUnits   = this.m_AbilityParam.FindConditionUnitParams(master);
     this.m_CondsJobs    = this.m_AbilityParam.FindConditionJobParams(master);
     this.m_CondsBirth   = this.m_AbilityParam.condition_birth;
     this.m_CondsSex     = this.m_AbilityParam.condition_sex;
     this.m_CondsElem    = this.m_AbilityParam.condition_element;
 }
예제 #8
0
        public static void UpdateCollaboSkill(List <CollaboSkillParam> csp_lists)
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (Object.op_Equality((Object)instanceDirect, (Object)null))
            {
                return;
            }
            using (List <CollaboSkillParam> .Enumerator enumerator1 = csp_lists.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    CollaboSkillParam current1 = enumerator1.Current;
                    for (int index = 0; index < current1.mLearnSkillLists.Count; ++index)
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        CollaboSkillParam.\u003CUpdateCollaboSkill\u003Ec__AnonStorey225 skillCAnonStorey225 = new CollaboSkillParam.\u003CUpdateCollaboSkill\u003Ec__AnonStorey225();
                        // ISSUE: reference to a compiler-generated field
                        skillCAnonStorey225.ls = current1.mLearnSkillLists[index];
                        // ISSUE: reference to a compiler-generated field
                        if (!string.IsNullOrEmpty(skillCAnonStorey225.ls.QuestIname))
                        {
                            AbilityParam abilityParam1 = instanceDirect.MasterParam.GetAbilityParam(current1.AbilityIname);
                            if (abilityParam1 == null)
                            {
                                DebugUtility.LogError(string.Format("CollaboSkillParam/Deserialize AbilityParam not found. ability_iname={0}", (object)current1.mAbilityIname));
                            }
                            else if (index < abilityParam1.skills.Length)
                            {
                                // ISSUE: reference to a compiler-generated field
                                skillCAnonStorey225.ls.SkillIname = abilityParam1.skills[index].iname;
                                using (List <CollaboSkillParam> .Enumerator enumerator2 = csp_lists.GetEnumerator())
                                {
                                    while (enumerator2.MoveNext())
                                    {
                                        CollaboSkillParam current2 = enumerator2.Current;
                                        if (!(current2.mUnitIname == current1.mUnitIname))
                                        {
                                            AbilityParam abilityParam2 = instanceDirect.MasterParam.GetAbilityParam(current2.AbilityIname);
                                            // ISSUE: reference to a compiler-generated method
                                            if (abilityParam2 != null && new List <LearningSkill>((IEnumerable <LearningSkill>)abilityParam2.skills).Find(new Predicate <LearningSkill>(skillCAnonStorey225.\u003C\u003Em__22A)) != null)
                                            {
                                                // ISSUE: reference to a compiler-generated field
                                                skillCAnonStorey225.ls.PartnerUnitIname = current2.UnitIname;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #9
0
        private void RefreshView()
        {
            List <AbilityParam> artifact_all_abilities = new List <AbilityParam>();

            if (this.mCurrentArtifactParam != null && this.mCurrentArtifactParam.abil_inames != null)
            {
                for (int index = 0; index < this.mCurrentArtifactParam.abil_inames.Length; ++index)
                {
                    if (!string.IsNullOrEmpty(this.mCurrentArtifactParam.abil_inames[index]))
                    {
                        AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.mCurrentArtifactParam.abil_inames[index]);

                        if (abilityParam != null)
                        {
                            artifact_all_abilities.Add(abilityParam);
                        }
                    }
                }
            }
            List <AbilityData> weapon_abilities = (List <AbilityData>)null;

            if (this.IsNeedCheck)
            {
                weapon_abilities = this.mCurrentArtifactData.LearningAbilities;
            }
            List <AbilityDeriveParam> derive_params = (List <AbilityDeriveParam>)null;

            if (this.IsNeedCheck)
            {
                SkillAbilityDeriveData abilityDeriveData = this.mCurrentUnit.GetSkillAbilityDeriveData(this.mCurrentJob, this.mCurrentEquipSlot, this.mCurrentArtifactParam);
                if (abilityDeriveData != null)
                {
                    derive_params = abilityDeriveData.GetAvailableAbilityDeriveParams();
                }
            }
            this.mViewAbilities = this.CreateViewData(artifact_all_abilities, weapon_abilities, derive_params);
            this.mAbilityEmptyTextObject.SetActive(this.mViewAbilities.Count <= 0);
            this.CreateInstance(this.mViewAbilities);
            bool flag = false;

            foreach (ArtifactDetailAbilityItem componentsInChild in (ArtifactDetailAbilityItem[])((Component)this).GetComponentsInChildren <ArtifactDetailAbilityItem>(true))
            {
                if (componentsInChild.HasDeriveAbility)
                {
                    flag = true;
                    break;
                }
            }
            ((Selectable)this.mHideDisplayAbilityToggle).set_interactable(flag);
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mSetEffectsButton, (UnityEngine.Object)null) && this.mCurrentArtifactParam != null)
            {
                ((Selectable)this.mSetEffectsButton).set_interactable(MonoSingleton <GameManager> .Instance.MasterParam.ExistSkillAbilityDeriveDataWithArtifact(this.mCurrentArtifactParam.iname));
            }
            this.Reposition();
        }
 public void Setup(UnitData unit, AbilityParam new_ability, AbilityParam old_ability)
 {
     if (unit == null || new_ability == null)
     {
         return;
     }
     this.mTitleText.set_text(old_ability == null ? LocalizedText.Get("sys.TOBIRA_LEARN_NEW_ABILITY_TEXT") : LocalizedText.Get("sys.TOBIRA_LEARN_OVERRIDE_NEW_ABILITY_TEXT"));
     this.mNameText.set_text(new_ability.name);
     this.mDescText.set_text(new_ability.expr);
     DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unit);
     GameParameter.UpdateAll(((Component)this).get_gameObject());
 }
        public string GetAbilityLevelCond()
        {
            if (!string.IsNullOrEmpty(this.aid) && this.alv > 0)
            {
                AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.aid);

                if (abilityParam != null)
                {
                    return(LocalizedText.Get("sys.SKILL_UNLOCKCOND_ABILITYLV", (object)abilityParam.name, (object)this.alv));
                }
            }
            return(string.Empty);
        }
예제 #12
0
        private void _OnAbilityDetail(GameObject go)
        {
            GlobalVars.SelectedAbilityID.Set(string.Empty);
            GlobalVars.SelectedAbilityUniqueID.Set(0L);
            AbilityData dataOfClass1 = DataSource.FindDataOfClass <AbilityData>(go, (AbilityData)null);

            if (dataOfClass1 != null)
            {
                GlobalVars.SelectedAbilityID.Set(dataOfClass1.Param.iname);
                GlobalVars.SelectedAbilityUniqueID.Set(dataOfClass1.UniqueID);
            }
            else
            {
                AbilityParam dataOfClass2 = DataSource.FindDataOfClass <AbilityParam>(go, (AbilityParam)null);
                GlobalVars.SelectedAbilityID.Set(dataOfClass2 == null ? (string)null : dataOfClass2.iname);
            }
            if (string.IsNullOrEmpty((string)GlobalVars.SelectedAbilityID))
            {
                return;
            }
            EventSystem current = EventSystem.get_current();

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)current, (UnityEngine.Object)null))
            {
                ((Behaviour)current).set_enabled(false);
                ((Behaviour)current).set_enabled(true);
            }
            GameSettings instance = GameSettings.Instance;

            if (!string.IsNullOrEmpty(instance.Dialog_AbilityDetail))
            {
                GameObject gameObject = AssetManager.Load <GameObject>(instance.Dialog_AbilityDetail);
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                {
                    UnityEngine.Object.Instantiate <GameObject>((M0)gameObject);
                }
            }
            bool flag = false;

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)go))
            {
                ListItemEvents component = (ListItemEvents)go.GetComponent <ListItemEvents>();
                if (UnityEngine.Object.op_Implicit((UnityEngine.Object)component))
                {
                    flag = component.IsEnableSkillChange;
                }
            }
            AbilityDetailWindow.IsEnableSkillChange = flag;
            AbilityDetailWindow.SetBindObject(this.Unit);
            FlowNode_GameObject.ActivateOutputLinks((Component)this, 100);
        }
예제 #13
0
        public void OpenAbilityDetail(GameObject obj)
        {
            AbilityParam dataOfClass = DataSource.FindDataOfClass <AbilityParam>(obj, (AbilityParam)null);

            if (dataOfClass != null)
            {
                AbilityDetailWindow.SetBindAbility(dataOfClass);
            }
            if (this.OnDetailOpen == null)
            {
                return;
            }
            this.OnDetailOpen.Invoke(obj);
        }
예제 #14
0
        public static void UpdateCollaboSkill(List <CollaboSkillParam> csp_lists)
        {
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (UnityEngine.Object.op_Equality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null))
            {
                return;
            }
            using (List <CollaboSkillParam> .Enumerator enumerator1 = csp_lists.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    CollaboSkillParam current1 = enumerator1.Current;
                    for (int index = 0; index < current1.mLearnSkillLists.Count; ++index)
                    {
                        CollaboSkillParam.LearnSkill ls = current1.mLearnSkillLists[index];
                        if (!string.IsNullOrEmpty(ls.QuestIname))
                        {
                            AbilityParam abilityParam1 = instanceDirect.MasterParam.GetAbilityParam(current1.AbilityIname);
                            if (abilityParam1 == null)
                            {
                                DebugUtility.LogError(string.Format("CollaboSkillParam/Deserialize AbilityParam not found. ability_iname={0}", (object)current1.mAbilityIname));
                            }
                            else if (index < abilityParam1.skills.Length)
                            {
                                ls.SkillIname = abilityParam1.skills[index].iname;
                                using (List <CollaboSkillParam> .Enumerator enumerator2 = csp_lists.GetEnumerator())
                                {
                                    while (enumerator2.MoveNext())
                                    {
                                        CollaboSkillParam current2 = enumerator2.Current;
                                        if (!(current2.mUnitIname == current1.mUnitIname))
                                        {
                                            AbilityParam abilityParam2 = instanceDirect.MasterParam.GetAbilityParam(current2.AbilityIname);
                                            if (abilityParam2 != null && new List <LearningSkill>((IEnumerable <LearningSkill>)abilityParam2.skills).Find((Predicate <LearningSkill>)(flgs => flgs.iname == ls.SkillIname)) != null)
                                            {
                                                ls.PartnerUnitIname = current2.UnitIname;
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        private void CreateAbilityBonus(ConceptCardEffectsParam[] effect_params, int lv, int lv_cap, int awake_count_cap, bool is_enable)
        {
            if (Object.op_Equality((Object)this.mParamTemplate, (Object)null))
            {
                return;
            }
            Transform     parent     = this.mParamTemplate.get_transform().get_parent();
            List <string> stringList = new List <string>();

            for (int index1 = 0; index1 < effect_params.Length; ++index1)
            {
                if (!string.IsNullOrEmpty(effect_params[index1].abil_iname) && !string.IsNullOrEmpty(effect_params[index1].abil_iname_lvmax))
                {
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(effect_params[index1].abil_iname_lvmax);

                    if (!stringList.Contains(abilityParam.iname))
                    {
                        for (int index2 = 0; index2 < abilityParam.skills.Length; ++index2)
                        {
                            SkillParam skillParam = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(abilityParam.skills[index2].iname);

                            if (skillParam != null)
                            {
                                GameObject root = (GameObject)Object.Instantiate <GameObject>((M0)this.mParamTemplate);
                                root.get_transform().SetParent(parent, false);
                                if (Object.op_Inequality((Object)this.mAwakeIconImageArray, (Object)null))
                                {
                                    this.mAwakeIconImageArray.ImageIndex = this.mAwakeIconImageArray.Images.Length - 1;
                                }
                                DataSource.Bind <SkillParam>(root, skillParam);
                                DataSource.Bind <bool>(((Component)this).get_gameObject(), is_enable);
                                GameParameter.UpdateAll(root);
                                ++this.mCreatedCount;
                            }
                        }
                        stringList.Add(abilityParam.iname);
                    }
                }
            }
            if (Object.op_Inequality((Object)this.mAwakeIconBgArray, (Object)null))
            {
                this.mAwakeIconBgArray.ImageIndex = !is_enable ? 1 : 0;
            }
            this.mParamTemplate.SetActive(false);
        }
예제 #16
0
        public void AddAbility(string base_ability_iname, AbilityDeriveParam derive_param, string derive_ability_iname, bool is_enable)
        {
            if (this.derive_abilities == null)
            {
                this.derive_abilities = new List <ViewDeriveAbilityData>();
            }
            this.base_ability = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(base_ability_iname);

            if (is_enable)
            {
                this.is_enable_base_ability = false;
            }
            this.derive_abilities.Add(new ViewDeriveAbilityData()
            {
                ability   = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(derive_ability_iname),
                is_enable = is_enable
            });
            this.ability_derive_param = derive_param;
        }
예제 #17
0
        public void SetAbilitySlot(int slot, AbilityData ability)
        {
            DebugUtility.Assert(slot >= 0 && slot < this.mAbilitySlots.Length, "EquipAbility Out of Length");
            long num = 0;

            if (ability != null)
            {
                AbilityParam abilityParam = ability.Param;
                if (abilityParam.slot != JobData.ABILITY_SLOT_TYPES[slot])
                {
                    DebugUtility.LogError("指定スロットに対応するアビリティではない");
                    return;
                }
                if (slot != 0 && abilityParam.is_fixed)
                {
                    DebugUtility.LogError("指定スロットには固定アビリティは装備不可能");
                    return;
                }
                num = ability.UniqueID;
            }
            this.mAbilitySlots[slot] = num;
        }
        private void BindData(GameObject target, AbilityParam ability_data, AbilityDeriveParam ability_derive_param)
        {
            DataSource.Bind <AbilityParam>(target, ability_data);
            if (ability_data.condition_units != null)
            {
                for (int index = 0; index < ability_data.condition_units.Length; ++index)
                {
                    if (!string.IsNullOrEmpty(ability_data.condition_units[index]))
                    {
                        UnitParam unitParam = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(ability_data.condition_units[index]);

                        if (unitParam != null)
                        {
                            DataSource.Bind <UnitParam>(target, unitParam);
                        }
                    }
                }
            }
            if (ability_data.condition_jobs != null)
            {
                for (int index = 0; index < ability_data.condition_jobs.Length; ++index)
                {
                    if (!string.IsNullOrEmpty(ability_data.condition_jobs[index]))
                    {
                        JobParam jobParam = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(ability_data.condition_jobs[index]);

                        if (jobParam != null)
                        {
                            DataSource.Bind <JobParam>(target, jobParam);
                        }
                    }
                }
            }
            if (ability_derive_param == null)
            {
                return;
            }
            DataSource.Bind <AbilityDeriveParam>(target, ability_derive_param);
        }
예제 #19
0
        public void UpdateLearningsSkillCollabo(Json_CollaboSkill[] skills)
        {
            if (this.mSkills == null)
            {
                return;
            }
            this.mSkills.Clear();
            if (skills == null || skills.Length == 0)
            {
                return;
            }
            AbilityParam abilityParam = this.Param;

            if (abilityParam == null || abilityParam.skills.Length == 0)
            {
                return;
            }
            List <LearningSkill> learningSkillList = new List <LearningSkill>((IEnumerable <LearningSkill>)abilityParam.skills);

            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            AbilityData.\u003CUpdateLearningsSkillCollabo\u003Ec__AnonStorey1E7 collaboCAnonStorey1E7 = new AbilityData.\u003CUpdateLearningsSkillCollabo\u003Ec__AnonStorey1E7();
            foreach (Json_CollaboSkill skill in skills)
            {
                // ISSUE: reference to a compiler-generated field
                collaboCAnonStorey1E7.cs = skill;
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                if (!string.IsNullOrEmpty(collaboCAnonStorey1E7.cs.iname) && learningSkillList.Find(new Predicate <LearningSkill>(collaboCAnonStorey1E7.\u003C\u003Em__1A2)) != null)
                {
                    SkillData skillData = new SkillData();
                    // ISSUE: reference to a compiler-generated field
                    skillData.Setup(collaboCAnonStorey1E7.cs.iname, (int)this.mRank, (int)this.mRankCap, (MasterParam)null);
                    skillData.IsCollabo = (OBool)true;
                    this.mSkills.Add(skillData);
                }
            }
        }
        public string GetRewriteName()
        {
            string str = string.Empty;

            if (!this.add && this.old_id != null)
            {
                switch (this.type + 1)
                {
                case QuestClearUnlockUnitDataParam.EUnlockTypes.Skill:
                    str = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.old_id).name;

                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.Ability:
                case QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility:
                    str = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(this.old_id).name;

                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.LeaderSkill:
                    str = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.old_id).name;

                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.CollaboAbility:
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.old_id);

                    if (abilityParam != null)
                    {
                        str = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(abilityParam.skills[0].iname).name;

                        break;
                    }
                    break;
                }
            }
            return(str);
        }
예제 #21
0
        private void SetMasterBonusText(TobiraParam tobiraParam)
        {
            if (UnityEngine.Object.op_Equality((UnityEngine.Object) this.TobiraMasterEffectText, (UnityEngine.Object)null) || UnityEngine.Object.op_Equality((UnityEngine.Object) this.TobiraMasterEffectDescText, (UnityEngine.Object)null))
            {
                return;
            }
            int tobiraLvCap = (int)MonoSingleton <GameManager> .Instance.MasterParam.FixParam.TobiraLvCap;

            this.TobiraMasterEffectText.set_text(string.Empty);
            this.TobiraMasterEffectDescText.set_text(string.Empty);
            List <AbilityData> newAbilitys = new List <AbilityData>();
            List <AbilityData> oldAbilitys = new List <AbilityData>();

            TobiraUtility.TryCraeteAbilityData(tobiraParam, tobiraLvCap, newAbilitys, oldAbilitys, true);
            if (newAbilitys.Count > 0)
            {
                AbilityParam abilityParam = oldAbilitys[0] == null ? (AbilityParam)null : oldAbilitys[0].Param;
                if (abilityParam != null)
                {
                    this.TobiraMasterEffectText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_MASTER_OVERRIDE_NEW_ABILITY_TEXT"), (object)abilityParam.name, (object)newAbilitys[0].Param.name));
                    this.TobiraMasterEffectDescText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_MASTER_TEXT_DESC"), (object)newAbilitys[0].Param.expr));
                }
                else
                {
                    this.TobiraMasterEffectText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_MASTER_NEW_ABILITY_TEXT"), (object)newAbilitys[0].Param.name));
                    this.TobiraMasterEffectDescText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_MASTER_TEXT_DESC"), (object)newAbilitys[0].Param.expr));
                }
            }
            SkillData skillData = (SkillData)null;

            TobiraUtility.TryCraeteLeaderSkill(tobiraParam, tobiraLvCap, ref skillData, true);
            if (skillData == null)
            {
                return;
            }
            this.TobiraMasterEffectText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_MASTER_NEW_LEADER_SKILL_TEXT"), (object)skillData.SkillParam.name));
            this.TobiraMasterEffectDescText.set_text(string.Format(LocalizedText.Get("sys.TOBIRA_MASTER_TEXT_DESC"), (object)skillData.SkillParam.expr));
        }
예제 #22
0
 public void SetupWithAbilityParam(AbilityParam baseAbility, List <AbilityDeriveParam> abilityDeriveParams)
 {
     if (abilityDeriveParams != null && abilityDeriveParams.Count > 0)
     {
         using (List <AbilityDeriveParam> .Enumerator enumerator = abilityDeriveParams.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 this.CreateDeriveAbilityItem(enumerator.Current);
             }
         }
     }
     else
     {
         this.IsShowBaseAbility = true;
     }
     if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_BaseAbilityRoot, (UnityEngine.Object)null))
     {
         this.RegisterHoldEvent(this.m_BaseAbilityRoot);
         DataSource.Bind <AbilityParam>(this.m_BaseAbilityRoot, baseAbility);
     }
     this.UpdateUIActive();
 }
예제 #23
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);
                        }
                    }
                }
            }
        }
        public string GetCondText(UnitParam unit)
        {
            if (unit == null)
            {
                return(string.Empty);
            }
            string str1 = string.Empty;
            string str2 = string.Empty;
            string str3 = string.Empty;

            if (this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Ability || this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill)
            {
                OString[] jobsets = unit.jobsets;
                if (jobsets != null)
                {
                    MasterParam masterParam   = MonoSingleton <GameManager> .Instance.MasterParam;
                    JobParam[]  jobParamArray = new JobParam[jobsets.Length];
                    for (int index = 0; index < jobsets.Length; ++index)
                    {
                        JobSetParam jobSetParam = masterParam.GetJobSetParam((string)jobsets[index]);
                        if (jobSetParam != null)
                        {
                            jobParamArray[index] = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(jobSetParam.job);
                        }
                    }
                    if (this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Ability)
                    {
                        if (!this.add)
                        {
                            for (int index = 0; index < jobParamArray.Length; ++index)
                            {
                                if (jobParamArray[index].FindRankOfAbility(this.old_id) != -1)
                                {
                                    str1 = jobParamArray[index].name;
                                    break;
                                }
                            }
                        }
                    }
                    else if (this.type == QuestClearUnlockUnitDataParam.EUnlockTypes.Skill)
                    {
                        for (int index1 = 0; index1 < jobParamArray.Length; ++index1)
                        {
                            for (int lv = 0; lv < JobParam.MAX_JOB_RANK; ++lv)
                            {
                                OString[] learningAbilitys = jobParamArray[index1].GetLearningAbilitys(lv);
                                if (learningAbilitys != null && learningAbilitys.Length >= 1)
                                {
                                    for (int index2 = 0; index2 < learningAbilitys.Length; ++index2)
                                    {
                                        if (this.add)
                                        {
                                            if ((string)learningAbilitys[index2] == this.parent_id)
                                            {
                                                str1 = jobParamArray[index1].name;
                                                break;
                                            }
                                        }
                                        else
                                        {
                                            AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam((string)learningAbilitys[index2]);

                                            if (abilityParam != null && Array.FindIndex <LearningSkill>(abilityParam.skills, (Predicate <LearningSkill>)(p => p.iname == (!this.add ? this.old_id : this.parent_id))) != -1)
                                            {
                                                str1 = jobParamArray[index1].name;
                                                break;
                                            }
                                        }
                                    }
                                    if (!string.IsNullOrEmpty(str1))
                                    {
                                        break;
                                    }
                                }
                            }
                            if (!string.IsNullOrEmpty(str1))
                            {
                                break;
                            }
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(str1))
            {
                str1 = LocalizedText.Get("sys.PARTYEDITOR_COND_UNLOCK_TEXTFRAME", new object[1]
                {
                    (object)str1
                });
            }
            switch (this.type + 1)
            {
            case QuestClearUnlockUnitDataParam.EUnlockTypes.Ability:
            case QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility:
                if (this.add)
                {
                    str2 = LocalizedText.Get(!string.IsNullOrEmpty(str1) ? "sys.UNITLIST_REWRITE_ABILITY" : "sys.UNITLIST_REWRITE_MASTERABILITY");
                    AbilityParam abilityParam = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.parent_id);

                    str3 = abilityParam == null ? str3 : abilityParam.name;
                    break;
                }
                str2 = this.type != QuestClearUnlockUnitDataParam.EUnlockTypes.LeaderSkill ? LocalizedText.Get(!string.IsNullOrEmpty(str1) ? "sys.UNITLIST_REWRITE_SKILL" : "sys.UNITLIST_REWRITE_MASTERABILITY") : LocalizedText.Get("sys.UNITLIST_REWRITE_LEADERSKILL");
                SkillParam skillParam1 = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(this.old_id);

                str3 = skillParam1 == null ? str3 : skillParam1.name;
                break;

            case QuestClearUnlockUnitDataParam.EUnlockTypes.LeaderSkill:
                if (this.add)
                {
                    str2 = LocalizedText.Get("sys.UNITLIST_REWRITE_JOB");
                    JobParam jobParam = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.parent_id);

                    str3 = jobParam == null ? str3 : jobParam.name;
                    break;
                }
                str2 = LocalizedText.Get("sys.UNITLIST_REWRITE_ABILITY");
                AbilityParam abilityParam1 = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.old_id);

                str3 = abilityParam1 == null ? str3 : abilityParam1.name;
                break;

            case QuestClearUnlockUnitDataParam.EUnlockTypes.CollaboAbility:
                if (!this.add)
                {
                    str2 = LocalizedText.Get("sys.UNITLIST_REWRITE_MASTERABILITY");
                    AbilityParam abilityParam2 = MonoSingleton <GameManager> .Instance.MasterParam.GetAbilityParam(this.old_id);

                    if (abilityParam2 != null)
                    {
                        SkillParam skillParam2 = MonoSingleton <GameManager> .Instance.MasterParam.GetSkillParam(abilityParam2.skills[0].iname);

                        str3 = skillParam2 == null ? str3 : skillParam2.name;
                        break;
                    }
                    break;
                }
                break;
            }
            if (string.IsNullOrEmpty(str2) || string.IsNullOrEmpty(str3))
            {
                return(string.Empty);
            }
            return(LocalizedText.Get("sys.PARTYEDITOR_COND_UNLOCK_PARENT", (object)str2, (object)str1, (object)str3));
        }
예제 #25
0
        public void UpdateLearningsSkill(bool locked, List <SkillData> sd_lists = null)
        {
            if (this.mSkills == null)
            {
                return;
            }
            AbilityParam abilityParam = this.Param;

            this.mSkills.Clear();
            if (abilityParam == null || abilityParam.skills.Length == 0)
            {
                return;
            }
            QuestClearUnlockUnitDataParam[] unlocks = (QuestClearUnlockUnitDataParam[])null;
            if (this.Owner != null)
            {
                unlocks = this.Owner.UnlockedSkills;
            }
            for (int index1 = 0; index1 < abilityParam.skills.Length; ++index1)
            {
                if (!locked || (int)this.mRank >= abilityParam.skills[index1].locklv)
                {
                    string skillId = abilityParam.skills[index1].iname;
                    if (unlocks != null)
                    {
                        int index2 = Array.FindIndex <QuestClearUnlockUnitDataParam>(unlocks, (Predicate <QuestClearUnlockUnitDataParam>)(p => p.old_id == skillId));
                        if (index2 != -1 && !unlocks[index2].add && unlocks[index2].parent_id == this.AbilityID)
                        {
                            skillId = unlocks[index2].new_id;
                        }
                    }
                    SkillData skillData = (SkillData)null;
                    if (sd_lists != null)
                    {
                        for (int index2 = 0; index2 < sd_lists.Count; ++index2)
                        {
                            SkillData sdList = sd_lists[index2];
                            if (sdList != null && sdList.SkillID == skillId)
                            {
                                skillData = sdList;
                                break;
                            }
                        }
                    }
                    if (skillData == null)
                    {
                        skillData = new SkillData();
                        skillData.Setup(skillId, (int)this.mRank, (int)this.mRankCap, (MasterParam)null);
                    }
                    this.mSkills.Add(skillData);
                }
            }
            if (unlocks != null)
            {
                for (int i = 0; i < unlocks.Length; ++i)
                {
                    if (unlocks[i].add && !(unlocks[i].parent_id != this.AbilityID) && this.mSkills.Find((Predicate <SkillData>)(p => p.SkillID == unlocks[i].new_id)) == null)
                    {
                        string    newId     = unlocks[i].new_id;
                        SkillData skillData = (SkillData)null;
                        if (sd_lists != null)
                        {
                            for (int index = 0; index < sd_lists.Count; ++index)
                            {
                                SkillData sdList = sd_lists[index];
                                if (sdList != null && sdList.SkillID == newId)
                                {
                                    skillData = sdList;
                                    break;
                                }
                            }
                        }
                        if (skillData == null)
                        {
                            skillData = new SkillData();
                            skillData.Setup(newId, (int)this.mRank, (int)this.mRankCap, (MasterParam)null);
                        }
                        this.mSkills.Add(skillData);
                    }
                }
            }
            this.mSkills.ForEach((Action <SkillData>)(skillData => skillData.SetOwnerAbility(this)));
        }
예제 #26
0
        public void UpdateLearningsSkill(bool locked)
        {
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            AbilityData.\u003CUpdateLearningsSkill\u003Ec__AnonStorey1E4 skillCAnonStorey1E4 = new AbilityData.\u003CUpdateLearningsSkill\u003Ec__AnonStorey1E4();
            if (this.mSkills == null)
            {
                return;
            }
            AbilityParam abilityParam = this.Param;

            this.mSkills.Clear();
            if (abilityParam == null || abilityParam.skills.Length == 0)
            {
                return;
            }
            // ISSUE: reference to a compiler-generated field
            skillCAnonStorey1E4.unlocks = (QuestClearUnlockUnitDataParam[])null;
            if (this.Owner != null)
            {
                // ISSUE: reference to a compiler-generated field
                skillCAnonStorey1E4.unlocks = this.Owner.UnlockedSkills;
            }
            for (int index1 = 0; index1 < abilityParam.skills.Length; ++index1)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                AbilityData.\u003CUpdateLearningsSkill\u003Ec__AnonStorey1E3 skillCAnonStorey1E3 = new AbilityData.\u003CUpdateLearningsSkill\u003Ec__AnonStorey1E3();
                if (!locked || (int)this.mRank >= abilityParam.skills[index1].locklv)
                {
                    SkillData skillData = new SkillData();
                    // ISSUE: reference to a compiler-generated field
                    skillCAnonStorey1E3.skillId = abilityParam.skills[index1].iname;
                    // ISSUE: reference to a compiler-generated field
                    if (skillCAnonStorey1E4.unlocks != null)
                    {
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated method
                        int index2 = Array.FindIndex <QuestClearUnlockUnitDataParam>(skillCAnonStorey1E4.unlocks, new Predicate <QuestClearUnlockUnitDataParam>(skillCAnonStorey1E3.\u003C\u003Em__19F));
                        // ISSUE: reference to a compiler-generated field
                        // ISSUE: reference to a compiler-generated field
                        if (index2 != -1 && !skillCAnonStorey1E4.unlocks[index2].add && skillCAnonStorey1E4.unlocks[index2].parent_id == this.AbilityID)
                        {
                            // ISSUE: reference to a compiler-generated field
                            // ISSUE: reference to a compiler-generated field
                            skillCAnonStorey1E3.skillId = skillCAnonStorey1E4.unlocks[index2].new_id;
                        }
                    }
                    // ISSUE: reference to a compiler-generated field
                    skillData.Setup(skillCAnonStorey1E3.skillId, (int)this.mRank, (int)this.mRankCap, (MasterParam)null);
                    this.mSkills.Add(skillData);
                }
            }
            // ISSUE: reference to a compiler-generated field
            if (skillCAnonStorey1E4.unlocks == null)
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            AbilityData.\u003CUpdateLearningsSkill\u003Ec__AnonStorey1E5 skillCAnonStorey1E5 = new AbilityData.\u003CUpdateLearningsSkill\u003Ec__AnonStorey1E5();
            // ISSUE: reference to a compiler-generated field
            skillCAnonStorey1E5.\u003C\u003Ef__ref\u0024484 = skillCAnonStorey1E4;
            // 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 field
            for (skillCAnonStorey1E5.i = 0; skillCAnonStorey1E5.i < skillCAnonStorey1E4.unlocks.Length; ++skillCAnonStorey1E5.i)
            {
                // 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 field
                // ISSUE: reference to a compiler-generated method
                if (skillCAnonStorey1E4.unlocks[skillCAnonStorey1E5.i].add && !(skillCAnonStorey1E4.unlocks[skillCAnonStorey1E5.i].parent_id != this.AbilityID) && this.mSkills.Find(new Predicate <SkillData>(skillCAnonStorey1E5.\u003C\u003Em__1A0)) == null)
                {
                    SkillData skillData = new SkillData();
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: reference to a compiler-generated field
                    skillData.Setup(skillCAnonStorey1E4.unlocks[skillCAnonStorey1E5.i].new_id, (int)this.mRank, (int)this.mRankCap, (MasterParam)null);
                    this.mSkills.Add(skillData);
                }
            }
        }
예제 #27
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());
        }
예제 #28
0
        private void Start()
        {
            this.mUnlocks = DataSource.FindDataOfClass <QuestClearUnlockUnitDataParam[]>(((Component)this).get_gameObject(), (QuestClearUnlockUnitDataParam[])null);
            if (this.mUnlocks == null)
            {
                return;
            }
            this.mUnit = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            if (this.mUnit == null)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.SkillNewItem, (Object)null))
            {
                this.SkillNewItem.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.SkillUpdateItem, (Object)null))
            {
                this.SkillUpdateItem.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.AbilityNewItem, (Object)null))
            {
                this.AbilityNewItem.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.AbilityUpdateItem, (Object)null))
            {
                this.AbilityUpdateItem.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.LeaderSkillNewItem, (Object)null))
            {
                this.LeaderSkillNewItem.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.LeaderSkillUpdateItem, (Object)null))
            {
                this.LeaderSkillUpdateItem.SetActive(false);
            }
            if (Object.op_Inequality((Object)this.MasterAbilityNewItem, (Object)null))
            {
                this.MasterAbilityNewItem.SetActive(false);
            }
            ((Component)this.CloseButton).get_gameObject().SetActive(false);
            MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;

            for (int index = 0; index < this.mUnlocks.Length; ++index)
            {
                GameObject   gameObject = (GameObject)null;
                AbilityParam data1      = (AbilityParam)null;
                SkillParam   data2      = (SkillParam)null;
                switch (this.mUnlocks[index].type + 1)
                {
                case QuestClearUnlockUnitDataParam.EUnlockTypes.Ability:
                    gameObject = !this.mUnlocks[index].add ? this.CreateInstance(this.SkillUpdateItem) : this.CreateInstance(this.SkillNewItem);
                    data1      = masterParam.GetAbilityParam(this.mUnlocks[index].parent_id);
                    data2      = masterParam.GetSkillParam(this.mUnlocks[index].new_id);
                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.LeaderSkill:
                    gameObject = this.CreateInstance(!this.mUnlocks[index].add ? this.AbilityUpdateItem : this.AbilityNewItem);
                    data1      = masterParam.GetAbilityParam(this.mUnlocks[index].new_id);
                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility:
                    gameObject = this.CreateInstance(!this.mUnlocks[index].add ? this.LeaderSkillUpdateItem : this.LeaderSkillNewItem);
                    data2      = masterParam.GetSkillParam(this.mUnlocks[index].new_id);
                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.CollaboAbility:
                    gameObject = this.CreateInstance(!this.mUnlocks[index].add ? this.MasterAbilityUpdateItem : this.MasterAbilityNewItem);
                    data1      = masterParam.GetAbilityParam(this.mUnlocks[index].new_id);
                    if (data1 != null && data1.skills != null)
                    {
                        data2 = masterParam.GetSkillParam(data1.skills[0].iname);
                        break;
                    }
                    break;

                case QuestClearUnlockUnitDataParam.EUnlockTypes.Ability | QuestClearUnlockUnitDataParam.EUnlockTypes.MasterAbility:
                    gameObject = this.CreateInstance(!this.mUnlocks[index].add ? this.MasterAbilityUpdateItem : this.MasterAbilityNewItem);
                    data2      = masterParam.GetSkillParam(this.mUnlocks[index].new_id);
                    break;
                }
                if (Object.op_Inequality((Object)this.ItemWindow, (Object)null) && Object.op_Inequality((Object)gameObject, (Object)null))
                {
                    if (data1 != null)
                    {
                        DataSource.Bind <AbilityParam>(gameObject, data1);
                    }
                    if (data2 != null)
                    {
                        DataSource.Bind <SkillParam>(gameObject, data2);
                    }
                    gameObject.get_transform().SetParent(this.ItemWindow.get_transform(), false);
                    gameObject.SetActive(false);
                    this.mListItems.Add(gameObject);
                }
            }
            if (this.mListItems.Count <= 0)
            {
                return;
            }
            if (Object.op_Inequality((Object)this.ItemWindow, (Object)null))
            {
                this.mWindowAnimator = (Animator)this.ItemWindow.GetComponent <Animator>();
            }
            this.mListItems[0].SetActive(true);
        }
예제 #29
0
        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());
            }
        }
예제 #30
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());
        }