示例#1
0
 public static string JobIconMedium(JobParam job)
 {
     AssetPath.mSB.Length = 0;
     AssetPath.mSB.Append("JobIconM/");
     AssetPath.mSB.Append(AssetPath.GetJobResourceID(job));
     return(AssetPath.mSB.ToString());
 }
示例#2
0
        public ConditionsResult_JobLv(UnitData unitData, UnitParam unitParam, string condsJobIname, int condsJobLv)
            : base(unitData, unitParam)
        {
            this.mCondsJobLv    = condsJobLv;
            this.mCondsJobIname = condsJobIname;
            this.mTargetValue   = condsJobLv;
            JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(condsJobIname);

            if (jobParam != null)
            {
                this.mJobParam = jobParam;
            }
            if (unitData != null)
            {
                foreach (JobData job in unitData.Jobs)
                {
                    if (job.Param.iname == this.mCondsJobIname)
                    {
                        this.mJobData      = job;
                        this.mIsClear      = job.Rank >= this.mCondsJobLv;
                        this.mCurrentValue = job.Rank;
                        break;
                    }
                }
            }
            else
            {
                this.mIsClear = false;
            }
        }
示例#3
0
        public void SetIcon(Transform body, JobParam job)
        {
            Transform child1 = body.FindChild("ui_uniticon");

            if (Object.op_Equality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = child1.FindChild("unit");

            if (Object.op_Equality((Object)child2, (Object)null))
            {
                return;
            }
            Transform child3 = child2.FindChild(nameof(job));

            if (Object.op_Equality((Object)child3, (Object)null))
            {
                return;
            }
            RawImage_Transparent component = (RawImage_Transparent)((Component)child3).GetComponent <RawImage_Transparent>();

            if (Object.op_Equality((Object)component, (Object)null))
            {
                return;
            }
            MonoSingleton <GameManager> .Instance.ApplyTextureAsync((RawImage)component, job == null?(string)null : AssetPath.JobIconSmall(job));
        }
示例#4
0
        internal void DummyBind()
        {
            UnitData unitData = this.CreateUnitData(MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(this.UnitName));
            long     num      = 0;

            if (num != 0L)
            {
                for (int jobNo = 0; jobNo < unitData.Jobs.Length; ++jobNo)
                {
                    if (unitData.Jobs[jobNo].UniqueID == num)
                    {
                        unitData.SetJobIndex(jobNo);
                        break;
                    }
                }
            }
            JobData[] jobs = unitData.Jobs;
            for (int index = 0; index < this.mJobRoot.Length; ++index)
            {
                JobParam data = jobs == null || index >= jobs.Length ? (JobParam)null : jobs[index].Param;
                DataSource.Bind <JobParam>(this.mJobRoot[index], data);
                this.mJobRoot[index].SetActive(data != null);
            }
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unitData);
        }
示例#5
0
        public bool CheckEnableUseAbility(UnitData self, int job_index)
        {
            if (this.condition_units != null)
            {
                bool flag = Array.Find <string>(this.condition_units, (Predicate <string>)(p => p == self.UnitParam.iname)) != null;
                if (!(this.units_conditions_type != EUseConditionsType.Match ? !flag : flag))
                {
                    return(false);
                }
            }
            if (this.condition_jobs != null)
            {
                JobData job = self.GetJobData(job_index);
                if (job == null)
                {
                    return(false);
                }
                bool flag = Array.Find <string>(this.condition_jobs, (Predicate <string>)(p => p == job.JobID)) != null;
                if (!flag && !string.IsNullOrEmpty(job.Param.origin))
                {
                    JobParam originJobParam = MonoSingleton <GameManager> .GetInstanceDirect().GetJobParam(job.Param.origin);

                    if (originJobParam != null)
                    {
                        flag = Array.Find <string>(this.condition_jobs, (Predicate <string>)(p => p == originJobParam.iname)) != null;
                    }
                }
                if (!(this.jobs_conditions_type != EUseConditionsType.Match ? !flag : flag))
                {
                    return(false);
                }
            }
            return((string.IsNullOrEmpty(this.condition_birth) || !((string)self.UnitParam.birth != this.condition_birth)) && (this.condition_sex == ESex.Unknown || self.UnitParam.sex == this.condition_sex) && (this.condition_element == EElement.None || self.Element == this.condition_element) && ((int)this.condition_raremax == 0 || (int)this.condition_raremin <= self.Rarity && (int)this.condition_raremax >= self.Rarity && (int)this.condition_raremax >= (int)this.condition_raremin));
        }
        public void Refresh(int rank_num, RankingUnitData data)
        {
            GameManager instance  = MonoSingleton <GameManager> .Instance;
            JobParam    jobParam  = instance.GetJobParam(data.job_iname);
            UnitParam   unitParam = instance.GetUnitParam(data.unit_iname);
            UnitData    data1     = new UnitData();

            data1.Setup(unitParam.iname, 0, 1, 1, jobParam.iname, 1, unitParam.element);
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), data1);
            if (Object.op_Inequality((Object)this.rank, (Object)null))
            {
                this.rank.set_text(LocalizedText.Get("sys.RANKING_RANK", new object[1]
                {
                    (object)rank_num
                }));
            }
            if (Object.op_Inequality((Object)this.unit_name, (Object)null))
            {
                this.unit_name.set_text(LocalizedText.Get("sys.RANKING_UNIT_NAME", (object)data1.UnitParam.name, (object)jobParam.name));
            }
            ((Behaviour)this.RankIconArray).set_enabled(this.RankIconArray.Images.Length >= rank_num);
            ((Behaviour)this.rank).set_enabled(!((Behaviour)this.RankIconArray).get_enabled());
            if (Object.op_Inequality((Object)this.JobIcon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync((RawImage)this.JobIcon, jobParam == null?(string)null : AssetPath.JobIconSmall(jobParam));
            }
            if (!((Behaviour)this.RankIconArray).get_enabled())
            {
                return;
            }
            this.RankIconArray.ImageIndex = rank_num - 1;
        }
示例#7
0
        public List <JobParam> FindConditionJobParams(MasterParam masterParam = null)
        {
            List <JobParam> jobParamList = new List <JobParam>();

            if (this.condition_jobs != null)
            {
                for (int index = 0; index < this.condition_jobs.Length; ++index)
                {
                    if (!string.IsNullOrEmpty(this.condition_jobs[index]))
                    {
                        JobParam jobParam     = (JobParam)null;
                        string   conditionJob = this.condition_jobs[index];
                        if (masterParam == null)
                        {
                            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

                            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instanceDirect, (UnityEngine.Object)null))
                            {
                                jobParam = instanceDirect.GetJobParam(conditionJob);
                            }
                        }
                        else
                        {
                            jobParam = masterParam.GetJobParam(conditionJob);
                        }
                        if (jobParam != null)
                        {
                            jobParamList.Add(jobParam);
                        }
                    }
                }
            }
            return(jobParamList);
        }
示例#8
0
        private void Start()
        {
            JobParam data1 = (JobParam)null;
            JobParam data2 = (JobParam)null;

            if (string.IsNullOrEmpty(this.PrevJobID) && string.IsNullOrEmpty(this.NextJobID))
            {
                UnitData unitDataByUniqueId = MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID((long)GlobalVars.SelectedUnitUniqueID);

                if (unitDataByUniqueId == null)
                {
                    return;
                }
                JobData jobData = (JobData)null;
                for (int index = 0; index < unitDataByUniqueId.Jobs.Length; ++index)
                {
                    if (unitDataByUniqueId.Jobs[index] != null && unitDataByUniqueId.Jobs[index].UniqueID == (long)GlobalVars.SelectedJobUniqueID)
                    {
                        jobData = unitDataByUniqueId.Jobs[index];
                    }
                }
                if (jobData == null)
                {
                    return;
                }
                JobData baseJob = unitDataByUniqueId.GetBaseJob(jobData.JobID);
                if (baseJob != null)
                {
                    data1 = baseJob.Param;
                }
                data2 = jobData.Param;
            }
            if (!string.IsNullOrEmpty(this.PrevJobID))
            {
                data1 = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.PrevJobID);
            }
            if (!string.IsNullOrEmpty(this.NextJobID))
            {
                data2 = MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(this.NextJobID);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NextJob, (UnityEngine.Object)null))
            {
                DataSource.Bind <JobParam>(this.NextJob, data2);
                GameParameter.UpdateAll(this.NextJob);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PrevJob, (UnityEngine.Object)null))
            {
                DataSource.Bind <JobParam>(this.PrevJob, data1);
                GameParameter.UpdateAll(this.PrevJob);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NewRank, (UnityEngine.Object)null))
            {
                this.NewRank.set_text(this.NextJobRank.ToString());
            }
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.OldRank, (UnityEngine.Object)null))
            {
                return;
            }
            this.OldRank.set_text(this.CurrentJobRank.ToString());
        }
示例#9
0
 public static string JobEquipment(JobParam job)
 {
     AssetPath.mSB.Length = 0;
     AssetPath.mSB.Append("Equipments/");
     AssetPath.mSB.Append(job.wepmdl);
     return(AssetPath.mSB.ToString());
 }
示例#10
0
 private static string GetJobResourceID(JobParam job)
 {
     if (job == null)
     {
         return(AssetPath.JobResourceID_None);
     }
     return(job.model);
 }
示例#11
0
        public static string UnitImage2(UnitParam unit, string jobName)
        {
            AssetPath.mSB.Length = 0;
            AssetPath.mSB.Append("UnitImages2/");
            JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(jobName);

            string str = jobParam == null?unit.GetJobImage(jobName) : jobParam.unit_image;

            AssetPath.mSB.Append(string.IsNullOrEmpty(str) ? unit.image : str);
            return(AssetPath.mSB.ToString());
        }
示例#12
0
 private static string GetJobResourceID(JobParam job)
 {
     if (job == null)
     {
         return(AssetPath.JobResourceID_None);
     }
     if (!string.IsNullOrEmpty(job.ac2d))
     {
         return(job.ac2d);
     }
     return(job.model);
 }
示例#13
0
        private void RefreshJobWindow()
        {
            if (this.mJobID == null || this.mJobID.Count < this.mCurrentAwakeJobIndex)
            {
                return;
            }
            JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(this.mJobID[this.mCurrentAwakeJobIndex]);

            this.JobName.set_text(jobParam.name);
            this.JobComment.set_text(LocalizedText.Get("sys.GACHA_TEXT_SHARD_AWAKE", new object[1]
            {
                (object)jobParam.name
            }));
        }
示例#14
0
        public static string UnitIconMedium(UnitParam unit, string jobName)
        {
            AssetPath.mSB.Length = 0;
            AssetPath.mSB.Append("PortraitsM/");
            JobParam jobParam = (JobParam)null;

            if (!string.IsNullOrEmpty(jobName))
            {
                jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(jobName);
            }
            string str = jobParam == null?unit.GetJobImage(jobName) : jobParam.unit_image;

            AssetPath.mSB.Append(string.IsNullOrEmpty(str) ? unit.model : str);
            return(AssetPath.mSB.ToString());
        }
示例#15
0
        private void SetParam(GameObject item, int rank, MultiRanking param)
        {
            Transform child1 = item.get_transform().FindChild("body");

            if (!Object.op_Inequality((Object)child1, (Object)null))
            {
                return;
            }
            Transform child2 = child1.FindChild(nameof(rank));

            if (Object.op_Inequality((Object)child2, (Object)null))
            {
                Transform child3 = child2.FindChild("rank_txt");
                if (Object.op_Inequality((Object)child3, (Object)null))
                {
                    LText component = (LText)((Component)child3).GetComponent <LText>();
                    if (Object.op_Inequality((Object)component, (Object)null))
                    {
                        string str = string.Format(LocalizedText.Get("sys.MULTI_CLEAR_RANK"), (object)(rank + 1).ToString());
                        component.set_text(str);
                    }
                }
            }
            UnitParam unitParam = MonoSingleton <GameManager> .Instance.GetUnitParam(param.unit);

            JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(param.job);

            Transform child4 = child1.FindChild("name");

            if (!Object.op_Inequality((Object)child4, (Object)null))
            {
                return;
            }
            LText component1 = (LText)((Component)child4).GetComponent <LText>();

            if (!Object.op_Inequality((Object)component1, (Object)null))
            {
                return;
            }
            string str1 = string.Format(LocalizedText.Get("sys.MULTI_CLEAR_UNIT_NAME"), (object)unitParam.name, (object)jobParam.name);

            component1.set_text(str1);
        }
示例#16
0
 public static void AddHaveJob(string skill_iname, JobParam job_param)
 {
     if (MapEffectParam.mHaveJobDict == null)
     {
         MapEffectParam.MakeHaveJobLists();
     }
     if (!MapEffectParam.mHaveJobDict.ContainsKey(skill_iname))
     {
         MapEffectParam.mHaveJobDict.Add(skill_iname, new List <JobParam>((IEnumerable <JobParam>) new JobParam[1]
         {
             job_param
         }));
     }
     else
     {
         if (MapEffectParam.mHaveJobDict[skill_iname].Contains(job_param))
         {
             return;
         }
         MapEffectParam.mHaveJobDict[skill_iname].Add(job_param);
     }
 }
        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);
        }
        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));
        }
示例#19
0
 public int GetJobRankCap(UnitData self)
 {
     return(JobParam.GetJobRankCap(self.Rarity));
 }
示例#20
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;
        }
示例#21
0
        public void Setup()
        {
            QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (!Object.op_Implicit((Object)instanceDirect))
            {
                return;
            }
            if (Object.op_Implicit((Object)this.GoMapEffectParent) && Object.op_Implicit((Object)this.GoMapEffectBaseItem))
            {
                this.GoMapEffectBaseItem.SetActive(false);
                BattleUnitDetail.DestroyChildGameObjects(this.GoMapEffectParent, new List <GameObject>((IEnumerable <GameObject>) new GameObject[1]
                {
                    this.GoMapEffectBaseItem
                }));
            }
            MapEffectParam mapEffectParam = instanceDirect.GetMapEffectParam(dataOfClass.MapEffectId);

            if (mapEffectParam == null)
            {
                return;
            }
            DataSource component = (DataSource)((Component)this).get_gameObject().GetComponent <DataSource>();

            if (Object.op_Implicit((Object)component))
            {
                component.Clear();
            }
            DataSource.Bind <MapEffectParam>(((Component)this).get_gameObject(), mapEffectParam);
            if (!Object.op_Implicit((Object)this.GoMapEffectParent) || !Object.op_Implicit((Object)this.GoMapEffectBaseItem))
            {
                return;
            }
            for (int index = 0; index < mapEffectParam.ValidSkillLists.Count; ++index)
            {
                SkillParam skillParam = instanceDirect.GetSkillParam(mapEffectParam.ValidSkillLists[index]);
                if (skillParam != null)
                {
                    using (List <JobParam> .Enumerator enumerator = MapEffectParam.GetHaveJobLists(skillParam.iname).GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            JobParam   current    = enumerator.Current;
                            GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.GoMapEffectBaseItem);
                            if (Object.op_Implicit((Object)gameObject))
                            {
                                gameObject.get_transform().SetParent(this.GoMapEffectParent.get_transform());
                                gameObject.get_transform().set_localScale(Vector3.get_one());
                                DataSource.Bind <JobParam>(gameObject, current);
                                DataSource.Bind <SkillParam>(gameObject, skillParam);
                                gameObject.SetActive(true);
                            }
                        }
                    }
                }
            }
        }
示例#22
0
        public void Refresh(UnitData unit = null, JobParam jobUnlock = null)
        {
            if (unit == null)
            {
                return;
            }
            this.mCurrentUnit    = unit;
            this.mUnlockJobParam = jobUnlock;
            this.mUsedElemPieces.Clear();
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), unit);
            int  awakeLv = unit.AwakeLv;
            bool flag1   = unit.GetAwakeLevelCap() > awakeLv;

            if (Object.op_Inequality((Object)this.CautionObject, (Object)null))
            {
                this.CautionObject.SetActive(!flag1);
            }
            if (Object.op_Inequality((Object)this.DecideButton, (Object)null))
            {
                ((Selectable)this.DecideButton).set_interactable(flag1 && unit.CheckUnitAwaking());
            }
            if (flag1)
            {
                PlayerData player          = MonoSingleton <GameManager> .Instance.Player;
                int        awakeNeedPieces = unit.GetAwakeNeedPieces();
                bool       flag2           = false;
                if (Object.op_Inequality((Object)this.Kakera_Unit, (Object)null))
                {
                    ItemData itemDataByItemId = player.FindItemDataByItemID((string)unit.UnitParam.piece);
                    if (itemDataByItemId != null && itemDataByItemId.Num > 0 && awakeNeedPieces > 0)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Unit, itemDataByItemId);
                        int num = Math.Min(awakeNeedPieces, itemDataByItemId.Num);
                        if (Object.op_Inequality((Object)this.Kakera_Consume_Unit, (Object)null))
                        {
                            this.Kakera_Consume_Unit.set_text(string.Format(LocalizedText.Get("sys.KAKUSEI_KAKERA_CONSUME"), (object)itemDataByItemId.Param.name, (object)num));
                        }
                        if (Object.op_Inequality((Object)this.Kakera_Amount_Unit, (Object)null))
                        {
                            this.Kakera_Amount_Unit.set_text(string.Format(LocalizedText.Get("sys.KAKUSEI_KAKERA_AMOUNT"), (object)itemDataByItemId.Num));
                        }
                        this.Kakera_Unit.SetActive(true);
                        flag2            = true;
                        awakeNeedPieces -= num;
                    }
                    else
                    {
                        this.Kakera_Unit.SetActive(false);
                    }
                }
                if (Object.op_Inequality((Object)this.Kakera_Elem, (Object)null))
                {
                    ItemData elementPieceData = unit.GetElementPieceData();
                    if (elementPieceData != null && elementPieceData.Num > 0 && awakeNeedPieces > 0)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Elem, elementPieceData);
                        int num = Math.Min(awakeNeedPieces, elementPieceData.Num);
                        if (Object.op_Inequality((Object)this.Kakera_Consume_Elem, (Object)null))
                        {
                            this.Kakera_Consume_Elem.set_text(string.Format(LocalizedText.Get("sys.KAKUSEI_KAKERA_CONSUME"), (object)elementPieceData.Param.name, (object)num));
                        }
                        if (Object.op_Inequality((Object)this.Kakera_Amount_Elem, (Object)null))
                        {
                            this.Kakera_Amount_Elem.set_text(string.Format(LocalizedText.Get("sys.KAKUSEI_KAKERA_AMOUNT"), (object)elementPieceData.Num));
                        }
                        this.Kakera_Elem.SetActive(true);
                        flag2            = true;
                        awakeNeedPieces -= num;
                        this.mUsedElemPieces.Add(elementPieceData);
                    }
                    else
                    {
                        this.Kakera_Elem.SetActive(false);
                    }
                }
                if (Object.op_Inequality((Object)this.Kakera_Common, (Object)null))
                {
                    ItemData commonPieceData = unit.GetCommonPieceData();
                    if (commonPieceData != null && commonPieceData.Num > 0 && awakeNeedPieces > 0)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Common, commonPieceData);
                        int num = Math.Min(awakeNeedPieces, commonPieceData.Num);
                        if (Object.op_Inequality((Object)this.Kakera_Consume_Common, (Object)null))
                        {
                            this.Kakera_Consume_Common.set_text(string.Format(LocalizedText.Get("sys.KAKUSEI_KAKERA_CONSUME"), (object)commonPieceData.Param.name, (object)num));
                        }
                        if (Object.op_Inequality((Object)this.Kakera_Amount_Common, (Object)null))
                        {
                            this.Kakera_Amount_Common.set_text(string.Format(LocalizedText.Get("sys.KAKUSEI_KAKERA_AMOUNT"), (object)commonPieceData.Num));
                        }
                        this.Kakera_Common.SetActive(true);
                        flag2            = true;
                        awakeNeedPieces -= num;
                        this.mUsedElemPieces.Add(commonPieceData);
                    }
                    else
                    {
                        this.Kakera_Common.SetActive(false);
                    }
                }
                if (Object.op_Inequality((Object)this.JobUnlock, (Object)null))
                {
                    bool flag3 = false;
                    if (jobUnlock != null)
                    {
                        DataSource.Bind <JobParam>(this.JobUnlock, jobUnlock);
                        flag3 = true;
                    }
                    this.JobUnlock.SetActive(flag3);
                }
                if (flag2)
                {
                    if (Object.op_Inequality((Object)this.Kakera_Consume_Message, (Object)null))
                    {
                        this.Kakera_Consume_Message.set_text(LocalizedText.Get(awakeNeedPieces != 0 ? "sys.CONFIRM_KAKUSEI4" : "sys.CONFIRM_KAKUSEI2"));
                    }
                }
                else
                {
                    if (Object.op_Inequality((Object)this.Kakera_Caution_Message, (Object)null))
                    {
                        this.Kakera_Caution_Message.set_text(LocalizedText.Get("sys.CONFIRM_KAKUSEI3"));
                    }
                    if (Object.op_Inequality((Object)this.CautionObject, (Object)null))
                    {
                        this.CautionObject.SetActive(true);
                    }
                }
            }
            else if (Object.op_Inequality((Object)this.Kakera_Caution_Message, (Object)null))
            {
                this.Kakera_Caution_Message.set_text(LocalizedText.Get("sys.KAKUSEI_CAPPED"));
            }
            this.RefreshGainedQuests(unit);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
示例#23
0
        public static UnitListFilterWindow.SelectType GetFilterMask(UnitListWindow.Data data)
        {
            if (data.param == null)
            {
                return(UnitListFilterWindow.SelectType.RARITY_1 | UnitListFilterWindow.SelectType.RARITY_2 | UnitListFilterWindow.SelectType.RARITY_3 | UnitListFilterWindow.SelectType.RARITY_4 | UnitListFilterWindow.SelectType.RARITY_5 | UnitListFilterWindow.SelectType.WEAPON_SLASH | UnitListFilterWindow.SelectType.WEAPON_STAB | UnitListFilterWindow.SelectType.WEAPON_BLOW | UnitListFilterWindow.SelectType.WEAPON_SHOT | UnitListFilterWindow.SelectType.WEAPON_MAG | UnitListFilterWindow.SelectType.WEAPON_NONE | UnitListFilterWindow.SelectType.BIRTH_ENV | UnitListFilterWindow.SelectType.BIRTH_WRATH | UnitListFilterWindow.SelectType.BIRTH_SAGA | UnitListFilterWindow.SelectType.BIRTH_SLOTH | UnitListFilterWindow.SelectType.BIRTH_LUST | UnitListFilterWindow.SelectType.BIRTH_WADATSUMI | UnitListFilterWindow.SelectType.BIRTH_DESERT | UnitListFilterWindow.SelectType.BIRTH_GREED | UnitListFilterWindow.SelectType.BIRTH_GLUTTONY | UnitListFilterWindow.SelectType.BIRTH_OTHER | UnitListFilterWindow.SelectType.BIRTH_NOZ);
            }
            MasterParam masterParam = MonoSingleton <GameManager> .Instance.MasterParam;
            UnitParam   unitParam   = data.param;

            UnitListFilterWindow.SelectType selectType = UnitListFilterWindow.SelectType.NONE;
            AttackDetailTypes attackDetailTypes        = AttackDetailTypes.None;

            if (data.unit != null)
            {
                UnitData unit = data.unit;
                if (unit.CurrentJob.GetAttackSkill() != null)
                {
                    attackDetailTypes = unit.CurrentJob.GetAttackSkill().AttackDetailType;
                }
                if (unit.Rarity == 0)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_1;
                }
                else if (unit.Rarity == 1)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_2;
                }
                else if (unit.Rarity == 2)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_3;
                }
                else if (unit.Rarity == 3)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_4;
                }
                else if (unit.Rarity == 4)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_5;
                }
                else if (unit.Rarity == 5)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_6;
                }
            }
            else
            {
                if (unitParam.jobsets != null && unitParam.jobsets.Length > 0)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam(unitParam.jobsets[0]);

                    if (jobSetParam != null)
                    {
                        JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(jobSetParam.job);

                        if (jobParam != null && jobParam.atkskill != null && jobParam.atkskill.Length > 0)
                        {
                            string key = jobParam.atkskill[0];
                            if (!string.IsNullOrEmpty(key))
                            {
                                SkillParam skillParam = masterParam.GetSkillParam(key);
                                if (skillParam != null)
                                {
                                    attackDetailTypes = skillParam.attack_detail;
                                }
                            }
                        }
                    }
                }
                if (unitParam.rare == (byte)0)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_1;
                }
                else if (unitParam.rare == (byte)1)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_2;
                }
                else if (unitParam.rare == (byte)2)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_3;
                }
                else if (unitParam.rare == (byte)3)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_4;
                }
                else if (unitParam.rare == (byte)4)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_5;
                }
                else if (unitParam.rare == (byte)5)
                {
                    selectType |= UnitListFilterWindow.SelectType.RARITY_6;
                }
            }
            switch (attackDetailTypes)
            {
            case AttackDetailTypes.None:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_NONE;
                break;

            case AttackDetailTypes.Slash:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_SLASH;
                break;

            case AttackDetailTypes.Stab:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_STAB;
                break;

            case AttackDetailTypes.Blow:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_BLOW;
                break;

            case AttackDetailTypes.Shot:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_SHOT;
                break;

            case AttackDetailTypes.Magic:
                selectType |= UnitListFilterWindow.SelectType.WEAPON_MAG;
                break;
            }
            if (!string.IsNullOrEmpty((string)unitParam.birth))
            {
                string birth = (string)unitParam.birth;
                if (birth == "エンヴィリア")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_ENV;
                }
                else if (birth == "ラーストリス")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_WRATH;
                }
                else if (birth == "サガ地方")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_SAGA;
                }
                else if (birth == "スロウスシュタイン")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_SLOTH;
                }
                else if (birth == "ルストブルグ")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_LUST;
                }
                else if (birth == "ワダツミ")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_WADATSUMI;
                }
                else if (birth == "砂漠地帯")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_DESERT;
                }
                else if (birth == "グリードダイク")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_GREED;
                }
                else if (birth == "グラトニー=フォス")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_GLUTTONY;
                }
                else if (birth == "その他")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_OTHER;
                }
                else if (birth == "ノーザンブライド")
                {
                    selectType |= UnitListFilterWindow.SelectType.BIRTH_NOZ;
                }
            }
            return(selectType);
        }
示例#24
0
        public bool CheckEnableEquip(UnitData self, int jobIndex = -1)
        {
            if (this.condition_units != null && Array.IndexOf <string>(this.condition_units, self.UnitParam.iname) < 0)
            {
                return(false);
            }
            if (this.condition_jobs != null)
            {
                if (self.CurrentJob == null)
                {
                    return(false);
                }
                if (jobIndex < 0)
                {
                    JobParam jobParam1 = self.CurrentJob.Param;
                    if (Array.IndexOf <string>(this.condition_jobs, jobParam1.iname) < 0)
                    {
                        if (string.IsNullOrEmpty(jobParam1.origin))
                        {
                            return(false);
                        }
                        JobParam jobParam2 = MonoSingleton <GameManager> .GetInstanceDirect().GetJobParam(jobParam1.origin);

                        if (jobParam2 == null || Array.IndexOf <string>(this.condition_jobs, jobParam2.iname) < 0)
                        {
                            return(false);
                        }
                    }
                }
                else
                {
                    if (jobIndex >= self.Jobs.Length)
                    {
                        return(false);
                    }
                    JobParam jobParam1 = self.Jobs[jobIndex].Param;
                    if (Array.IndexOf <string>(this.condition_jobs, jobParam1.iname) < 0)
                    {
                        if (string.IsNullOrEmpty(jobParam1.origin))
                        {
                            return(false);
                        }
                        JobParam jobParam2 = MonoSingleton <GameManager> .GetInstanceDirect().GetJobParam(jobParam1.origin);

                        if (jobParam2 == null || Array.IndexOf <string>(this.condition_jobs, jobParam2.iname) < 0)
                        {
                            return(false);
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(this.condition_birth) && (string)self.UnitParam.birth != this.condition_birth || this.condition_sex != ESex.Unknown && self.UnitParam.sex != this.condition_sex || this.condition_element != EElement.None && self.Element != this.condition_element || (int)this.condition_raremax != 0 && ((int)this.condition_raremin > self.Rarity || (int)this.condition_raremax < self.Rarity || (int)this.condition_raremax < (int)this.condition_raremin))
            {
                return(false);
            }
            if (this.type == ArtifactTypes.Arms && self.Jobs != null)
            {
                JobParam jobParam = jobIndex >= 0 ? (jobIndex >= self.Jobs.Length ? (JobParam)null : self.Jobs[jobIndex].Param) : self.CurrentJob.Param;
                if (!string.IsNullOrEmpty(jobParam.artifact) && this.tag != MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetArtifactParam(jobParam.artifact).tag)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#25
0
        public override void UpdateValue()
        {
            GameSettings instance     = GameSettings.Instance;
            UnitData     instanceData = this.GetInstanceData();

            if (Object.op_Inequality((Object)this.Icon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, instanceData == null?(string)null : AssetPath.UnitSkinIconSmall(instanceData.UnitParam, instanceData.GetSelectedSkin(-1), instanceData.CurrentJobId));
            }
            if (Object.op_Inequality((Object)this.Level, (Object)null))
            {
                if (instanceData != null)
                {
                    this.Level.set_text(instanceData.Lv.ToString());
                    ((Component)this.Level).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.Level).get_gameObject().SetActive(false);
                }
            }
            if (Object.op_Inequality((Object)this.Rarity, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Rarity.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.Rarity, 0, instance.UnitIcon_Rarity.Length - 1);
                    }
                    this.Rarity.set_sprite(instance.UnitIcon_Rarity[index]);
                }
                else
                {
                    this.Rarity.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Frame, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Frames.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.CurrentJob.Rank, 0, instance.UnitIcon_Frames.Length - 1);
                    }
                    this.Frame.set_sprite(instance.UnitIcon_Frames[index]);
                }
                else
                {
                    this.Frame.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Element, (Object)null) && Object.op_Inequality((Object)instance, (Object)null))
            {
                if (instanceData != null && EElement.None <= instanceData.Element && instanceData.Element < (EElement)instance.Elements_IconSmall.Length)
                {
                    this.Element.set_sprite(instance.Elements_IconSmall[(int)instanceData.Element]);
                }
                else
                {
                    this.Element.set_sprite((Sprite)null);
                }
            }
            if (!Object.op_Inequality((Object)this.Job, (Object)null))
            {
                return;
            }
            JobParam job = (JobParam)null;

            if (instanceData != null && instanceData.CurrentJob != null)
            {
                job = instanceData.CurrentJob.Param;
            }
            MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Job, job == null?(string)null : AssetPath.JobIconSmall(job));
        }
示例#26
0
        public override void UpdateValue()
        {
            GameSettings instance     = GameSettings.Instance;
            UnitData     instanceData = this.GetInstanceData();

            if (Object.op_Inequality((Object)this.Icon, (Object)null))
            {
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Icon, instanceData == null?(string)null : AssetPath.UnitSkinIconSmall(instanceData.UnitParam, instanceData.GetSelectedSkin(-1), instanceData.CurrentJobId));
            }
            if (Object.op_Inequality((Object)this.LvParent, (Object)null))
            {
                this.LvParent.SetActive(this.mIsLvActive);
            }
            if (Object.op_Inequality((Object)this.Level, (Object)null))
            {
                if (instanceData != null)
                {
                    this.Level.set_text(instanceData.Lv.ToString());
                    ((Component)this.Level).get_gameObject().SetActive(true);
                }
                else
                {
                    ((Component)this.Level).get_gameObject().SetActive(false);
                }
            }
            if (Object.op_Inequality((Object)this.Rarity, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Rarity.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.Rarity, 0, instance.UnitIcon_Rarity.Length - 1);
                    }
                    this.Rarity.set_sprite(instance.UnitIcon_Rarity[index]);
                }
                else
                {
                    this.Rarity.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Frame, (Object)null) && Object.op_Inequality((Object)instance, (Object)null) && instance.UnitIcon_Frames.Length > 0)
            {
                if (instanceData != null)
                {
                    int index = 0;
                    if (instanceData.CurrentJob != null)
                    {
                        index = Mathf.Clamp(instanceData.CurrentJob.Rank, 0, instance.UnitIcon_Frames.Length - 1);
                    }
                    this.Frame.set_sprite(instance.UnitIcon_Frames[index]);
                }
                else
                {
                    this.Frame.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Element, (Object)null) && Object.op_Inequality((Object)instance, (Object)null))
            {
                if (instanceData != null && EElement.None <= instanceData.Element && instanceData.Element < (EElement)instance.Elements_IconSmall.Length)
                {
                    this.Element.set_sprite(instance.Elements_IconSmall[(int)instanceData.Element]);
                }
                else
                {
                    this.Element.set_sprite((Sprite)null);
                }
            }
            if (Object.op_Inequality((Object)this.Job, (Object)null))
            {
                JobParam job = (JobParam)null;
                if (instanceData != null && instanceData.CurrentJob != null)
                {
                    job = instanceData.CurrentJob.Param;
                }
                MonoSingleton <GameManager> .Instance.ApplyTextureAsync(this.Job, job == null?(string)null : AssetPath.JobIconSmall(job));
            }
            if (!MonoSingleton <GameManager> .Instance.IsTutorial() || instanceData == null || (!(MonoSingleton <GameManager> .Instance.GetNextTutorialStep() == "ShowUnitList") || !(instanceData.UnitID == "UN_V2_LOGI")))
            {
                return;
            }
            SGHighlightObject.Instance().highlightedObject = ((Component)this).get_gameObject();
            SGHighlightObject.Instance().Highlight(string.Empty, "sg_tut_1.017", (SGHighlightObject.OnActivateCallback)null, EventDialogBubble.Anchors.BottomLeft, true, false, false);
        }
示例#27
0
        public void Refresh(UnitData unit = null, JobParam jobUnlock = null)
        {
            if (unit == null)
            {
                return;
            }
            this.mCurrentUnit    = unit;
            this.mUnlockJobParam = jobUnlock;
            this.mUsedElemPieces.Clear();
            this.mCacheCCJobs.Clear();
            this.mTempUnit = new UnitData();
            this.mTempUnit.Setup(unit);
            for (int index = 0; index < this.mUnlockJobList.Count; ++index)
            {
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mUnlockJobList[index], (UnityEngine.Object)null))
                {
                    DataSource.Bind <JobParam>(this.mUnlockJobList[index], (JobParam)null);
                    this.mUnlockJobList[index].SetActive(false);
                }
            }
            int length = unit.Jobs.Length;

            if (this.mUnlockJobList.Count < length)
            {
                int num = length - this.mUnlockJobList.Count;
                for (int index = 0; index < num; ++index)
                {
                    GameObject gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.JobUnlock);
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object)gameObject, (UnityEngine.Object)null))
                    {
                        gameObject.get_transform().SetParent((Transform)this.JobUnlockParent, false);
                        this.mUnlockJobList.Add(gameObject);
                    }
                }
            }
            JobSetParam[] changeJobSetParam = MonoSingleton <GameManager> .Instance.MasterParam.GetClassChangeJobSetParam(unit.UnitParam.iname);

            if (changeJobSetParam != null)
            {
                this.mCacheCCJobs.AddRange((IEnumerable <JobSetParam>)changeJobSetParam);
            }
            for (int jobNo = 0; jobNo < length; ++jobNo)
            {
                if (!unit.CheckJobUnlockable(jobNo) && UnityEngine.Object.op_Inequality((UnityEngine.Object) this.mUnlockJobList[jobNo], (UnityEngine.Object)null))
                {
                    DataSource.Bind <JobParam>(this.mUnlockJobList[jobNo], unit.Jobs[jobNo].Param);
                }
            }
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), (UnitData)null);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
            DataSource.Bind <UnitData>(((Component)this).get_gameObject(), this.mTempUnit);
            int  awakeLv = unit.AwakeLv;
            bool flag1   = unit.GetAwakeLevelCap() > awakeLv;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CautionObject, (UnityEngine.Object)null))
            {
                this.CautionObject.SetActive(!flag1);
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.DecideButton, (UnityEngine.Object)null))
            {
                ((Selectable)this.DecideButton).set_interactable(flag1 && unit.CheckUnitAwaking());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null))
            {
                ((Selectable)this.SelectAwakeSlider).set_interactable(flag1 && unit.CheckUnitAwaking());
            }
            if (flag1)
            {
                PlayerData player          = MonoSingleton <GameManager> .Instance.Player;
                int        awakeNeedPieces = unit.GetAwakeNeedPieces();
                bool       flag2           = false;
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Unit, (UnityEngine.Object)null))
                {
                    ItemData data = player.FindItemDataByItemID(unit.UnitParam.piece);
                    if (data == null)
                    {
                        ItemParam itemParam = MonoSingleton <GameManager> .Instance.MasterParam.GetItemParam(unit.UnitParam.piece);

                        if (itemParam == null)
                        {
                            DebugUtility.LogError("Not Unit Piece Settings => [" + unit.UnitParam.iname + "]");
                            return;
                        }
                        data = new ItemData();
                        data.Setup(0L, itemParam, 0);
                    }
                    if (data != null)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Unit, data);
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Unit, (UnityEngine.Object)null))
                    {
                        this.Kakera_Amount_Unit.set_text(data.Num.ToString());
                    }
                    int num = Math.Min(awakeNeedPieces, data.Num);
                    if (awakeNeedPieces > 0)
                    {
                        num              = Math.Min(awakeNeedPieces, data.Num);
                        flag2            = true;
                        awakeNeedPieces -= num;
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Unit, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Unit.set_text("@" + num.ToString());
                    }
                    this.Kakera_Unit.SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Elem, (UnityEngine.Object)null))
                {
                    ItemData data = unit.GetElementPieceData();
                    if (data == null)
                    {
                        ItemParam elementPieceParam = unit.GetElementPieceParam();
                        if (elementPieceParam == null)
                        {
                            DebugUtility.LogError("[Unit Setting Error?]Not Element Piece!");
                            return;
                        }
                        data = new ItemData();
                        data.Setup(0L, elementPieceParam, 0);
                    }
                    if (data != null)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Elem, data);
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Elem, (UnityEngine.Object)null))
                    {
                        this.Kakera_Amount_Elem.set_text(data.Num.ToString());
                    }
                    int num = Math.Min(awakeNeedPieces, data.Num);
                    if (data.Num > 0 && awakeNeedPieces > 0)
                    {
                        num              = Math.Min(awakeNeedPieces, data.Num);
                        flag2            = true;
                        awakeNeedPieces -= num;
                        if (!this.mUsedElemPieces.Contains(data))
                        {
                            this.mUsedElemPieces.Add(data);
                        }
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Elem, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Elem.set_text("@" + num.ToString());
                    }
                    this.Kakera_Elem.SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Common, (UnityEngine.Object)null))
                {
                    ItemData data = unit.GetCommonPieceData();
                    if (data == null)
                    {
                        ItemParam commonPieceParam = unit.GetCommonPieceParam();
                        if (commonPieceParam == null)
                        {
                            DebugUtility.LogError("[FixParam Setting Error?]Not Common Piece Settings!");
                            return;
                        }
                        data = new ItemData();
                        data.Setup(0L, commonPieceParam, 0);
                    }
                    if (data != null)
                    {
                        DataSource.Bind <ItemData>(this.Kakera_Common, data);
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Amount_Common, (UnityEngine.Object)null))
                    {
                        this.Kakera_Amount_Common.set_text(data.Num.ToString());
                    }
                    int num = 0;
                    if (data.Num > 0 && awakeNeedPieces > 0)
                    {
                        num              = Math.Min(awakeNeedPieces, data.Num);
                        flag2            = true;
                        awakeNeedPieces -= num;
                        if (!this.mUsedElemPieces.Contains(data))
                        {
                            this.mUsedElemPieces.Add(data);
                        }
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Common, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Common.set_text("@" + num.ToString());
                    }
                    this.Kakera_Common.SetActive(true);
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null))
                {
                    ItemData itemDataByItemId     = player.FindItemDataByItemID(unit.UnitParam.piece);
                    int      piece_amount         = itemDataByItemId == null ? 0 : itemDataByItemId.Num;
                    ItemData elementPieceData     = unit.GetElementPieceData();
                    int      element_piece_amount = elementPieceData == null ? 0 : elementPieceData.Num;
                    ItemData commonPieceData      = unit.GetCommonPieceData();
                    int      common_piece_amount  = commonPieceData == null ? 0 : commonPieceData.Num;
                    int      num = this.CalcCanAwakeMaxLv(unit.AwakeLv, unit.GetAwakeLevelCap(), piece_amount, element_piece_amount, common_piece_amount);
                    ((UnityEventBase)this.SelectAwakeSlider.get_onValueChanged()).RemoveAllListeners();
                    this.SelectAwakeSlider.set_minValue(num - unit.AwakeLv <= 0 ? 0.0f : 1f);
                    this.SelectAwakeSlider.set_maxValue((float)(num - unit.AwakeLv));
                    this.SelectAwakeSlider.set_value(this.SelectAwakeSlider.get_minValue());
                    // ISSUE: method pointer
                    ((UnityEvent <float>) this.SelectAwakeSlider.get_onValueChanged()).AddListener(new UnityAction <float>((object)this, __methodptr(OnAwakeLvSelect)));
                }
                if (this.mUnlockJobList != null)
                {
                    for (int index = 0; index < this.mUnlockJobList.Count && index <= length; ++index)
                    {
                        if (this.mCacheCCJobs != null && this.mCacheCCJobs.Count > 0)
                        {
                            JobSetParam js = unit.GetJobSetParam(index);
                            if (js == null || this.mCacheCCJobs.Find((Predicate <JobSetParam>)(v => v.iname == js.iname)) != null)
                            {
                                continue;
                            }
                        }
                        this.mUnlockJobList[index].SetActive(this.CheckUnlockJob(index, awakeLv + (int)this.SelectAwakeSlider.get_value()));
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultLv, (UnityEngine.Object)null))
                {
                    this.AwakeResultLv.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_LV", new object[1]
                    {
                        (object)(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) ? 1 : (int)this.SelectAwakeSlider.get_value())
                    }));
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.AwakeResultComb, (UnityEngine.Object)null))
                {
                    this.AwakeResultComb.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_COMB", new object[1]
                    {
                        (object)(!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) ? 1 : (int)this.SelectAwakeSlider.get_value())
                    }));
                }
                int    num1 = 0;
                OInt[] artifactSlotUnlock = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.FixParam.EquipArtifactSlotUnlock;

                for (int index = 0; index < artifactSlotUnlock.Length; ++index)
                {
                    if ((int)artifactSlotUnlock[index] != 0 && (int)artifactSlotUnlock[index] > unit.AwakeLv && (int)artifactSlotUnlock[index] <= unit.AwakeLv + (int)this.SelectAwakeSlider.get_value())
                    {
                        ++num1;
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.UnlockArtifactSlot, (UnityEngine.Object)null))
                {
                    this.UnlockArtifactSlot.SetActive(num1 > 0);
                    if (num1 > 0)
                    {
                        this.AwakeResultArtifactSlots.set_text(LocalizedText.Get("sys.TEXT_UNITAWAKE_RESULT_SLOT", new object[1]
                        {
                            (object)num1
                        }));
                    }
                }
                if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.NotPieceDataMask, (UnityEngine.Object)null))
                {
                    this.NotPieceDataMask.SetActive(awakeNeedPieces > 0);
                }
                if (flag2)
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Consume_Message, (UnityEngine.Object)null))
                    {
                        this.Kakera_Consume_Message.set_text(LocalizedText.Get(awakeNeedPieces != 0 ? "sys.CONFIRM_KAKUSEI4" : "sys.CONFIRM_KAKUSEI2"));
                    }
                }
                else
                {
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Caution_Message, (UnityEngine.Object)null))
                    {
                        this.Kakera_Caution_Message.set_text(LocalizedText.Get("sys.CONFIRM_KAKUSEI3"));
                    }
                    if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.CautionObject, (UnityEngine.Object)null))
                    {
                        this.CautionObject.SetActive(true);
                    }
                }
            }
            else if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.Kakera_Caution_Message, (UnityEngine.Object)null))
            {
                this.Kakera_Caution_Message.set_text(LocalizedText.Get("sys.KAKUSEI_CAPPED"));
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.PlusBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.PlusBtn).set_interactable(UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) && (double)this.SelectAwakeSlider.get_value() < (double)this.SelectAwakeSlider.get_maxValue());
            }
            if (UnityEngine.Object.op_Inequality((UnityEngine.Object) this.MinusBtn, (UnityEngine.Object)null))
            {
                ((Selectable)this.MinusBtn).set_interactable(UnityEngine.Object.op_Inequality((UnityEngine.Object) this.SelectAwakeSlider, (UnityEngine.Object)null) && (double)this.SelectAwakeSlider.get_value() > (double)this.SelectAwakeSlider.get_minValue());
            }
            this.RefreshGainedQuests(unit);
            GameParameter.UpdateAll(((Component)this).get_gameObject());
        }
示例#28
0
        public void Setup()
        {
            JobParam dataOfClass = DataSource.FindDataOfClass <JobParam>(((Component)this).get_gameObject(), (JobParam)null);

            if (dataOfClass == null)
            {
                return;
            }
            GameManager instanceDirect = MonoSingleton <GameManager> .GetInstanceDirect();

            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object)instanceDirect))
            {
                return;
            }
            if (UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoMapEffectParent) && UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoMapEffectBaseItem))
            {
                this.GoMapEffectBaseItem.SetActive(false);
                BattleUnitDetail.DestroyChildGameObjects(this.GoMapEffectParent, new List <GameObject>((IEnumerable <GameObject>) new GameObject[1]
                {
                    this.GoMapEffectBaseItem
                }));
            }
            DataSource component = (DataSource)((Component)this).get_gameObject().GetComponent <DataSource>();

            if (UnityEngine.Object.op_Implicit((UnityEngine.Object)component))
            {
                component.Clear();
            }
            DataSource.Bind <JobParam>(((Component)this).get_gameObject(), dataOfClass);
            if (!UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoMapEffectParent) || !UnityEngine.Object.op_Implicit((UnityEngine.Object) this.GoMapEffectBaseItem))
            {
                return;
            }
            List <MapEffectJob.MeSkill> l = new List <MapEffectJob.MeSkill>();

            if (!string.IsNullOrEmpty(dataOfClass.MapEffectAbility))
            {
                AbilityParam abilityParam = instanceDirect.GetAbilityParam(dataOfClass.MapEffectAbility);
                if (abilityParam != null)
                {
                    foreach (LearningSkill skill in abilityParam.skills)
                    {
                        SkillParam skillParam = instanceDirect.GetSkillParam(skill.iname);
                        if (skillParam != null)
                        {
                            using (List <MapEffectParam> .Enumerator enumerator1 = MapEffectParam.GetHaveMapEffectLists(skill.iname).GetEnumerator())
                            {
                                while (enumerator1.MoveNext())
                                {
                                    MapEffectParam current = enumerator1.Current;
                                    bool           flag    = false;
                                    using (List <MapEffectJob.MeSkill> .Enumerator enumerator2 = l.GetEnumerator())
                                    {
                                        while (enumerator2.MoveNext())
                                        {
                                            if (enumerator2.Current.Equals(current, skillParam))
                                            {
                                                flag = true;
                                                break;
                                            }
                                        }
                                    }
                                    if (!flag)
                                    {
                                        l.Add(new MapEffectJob.MeSkill(current, skillParam));
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (l.Count == 0)
            {
                return;
            }
            MySort <MapEffectJob.MeSkill> .Sort(l, (Comparison <MapEffectJob.MeSkill>)((src, dsc) =>
            {
                if (src == dsc)
                {
                    return(0);
                }
                return(dsc.mMapEffectParam.Index - src.mMapEffectParam.Index);
            }));

            using (List <MapEffectJob.MeSkill> .Enumerator enumerator = l.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    MapEffectJob.MeSkill current    = enumerator.Current;
                    GameObject           gameObject = (GameObject)UnityEngine.Object.Instantiate <GameObject>((M0)this.GoMapEffectBaseItem);
                    if (UnityEngine.Object.op_Implicit((UnityEngine.Object)gameObject))
                    {
                        gameObject.get_transform().SetParent(this.GoMapEffectParent.get_transform());
                        gameObject.get_transform().set_localScale(Vector3.get_one());
                        DataSource.Bind <MapEffectParam>(gameObject, current.mMapEffectParam);
                        DataSource.Bind <SkillParam>(gameObject, current.mSkillParam);
                        gameObject.SetActive(true);
                    }
                }
            }
        }
示例#29
0
        public void Refresh(UnitParam param, string shard_name = "", int awake_lv = 0, int get_shard = 0, int current_index = 0)
        {
            if (param == null)
            {
                return;
            }
            GameManager instance1 = MonoSingleton <GameManager> .Instance;

            this.InitRebirthStar();
            this.rebirthstar_template.SetActive(false);
            this.mNotUnlockUnit = true;
            this.mget_shard     = get_shard;
            this.msub_shard     = this.GetPastShard(current_index, (string)param.piece);
            this.muse_shard     = 0;
            this.mstart_gauge   = 0;
            this.mremain_shard  = this.mget_shard;
            UnitData unitDataByUnitId = instance1.Player.FindUnitDataByUnitID(param.iname);

            this.mCurrentUnitIname = param.iname;
            string path1 = AssetPath.UnitImage(param, param.GetJobId(0));

            instance1.ApplyTextureAsync(this.unit_img, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur01, path1);
            instance1.ApplyTextureAsync(this.unit_img_blur02, path1);
            string path2 = AssetPath.UnitIconSmall(param, param.GetJobId(0));

            instance1.ApplyTextureAsync((RawImage)this.unit_icon, path2);
            GameSettings instance2 = GameSettings.Instance;

            if (unitDataByUnitId != null && EElement.None <= unitDataByUnitId.Element && unitDataByUnitId.Element < (EElement)instance2.Elements_IconSmall.Length)
            {
                this.element_icon.set_sprite(instance2.Elements_IconSmall[(int)unitDataByUnitId.Element]);
            }
            else
            {
                this.element_icon.set_sprite((Sprite)null);
            }
            this.ShardName.set_text(shard_name);
            this.StartAwakeLv = this.NowAwakeLv = awake_lv;
            if (unitDataByUnitId != null)
            {
                this.mNotUnlockUnit = false;
                this.AwakeLvCap     = unitDataByUnitId.GetAwakeLevelCap();
                int num1 = (int)instance1.MasterParam.GetRarityParam(unitDataByUnitId.Rarity).UnitAwakeLvCap / 5;
                for (int index = 0; index < num1; ++index)
                {
                    GameObject gameObject = (GameObject)Object.Instantiate <GameObject>((M0)this.rebirthstar_template);
                    gameObject.get_transform().SetParent(this.rebirthstar_root.get_transform(), false);
                    gameObject.SetActive(true);
                    this.mRebirthStars.Add(gameObject);
                }
                int index1 = this.StartAwakeLv / 5;
                for (int index2 = 0; index2 < index1 && this.mRebirthStars.Count >= index2; ++index2)
                {
                    Transform child = this.mRebirthStars[index2].get_transform().FindChild("Rebirth_star_anim");
                    ((Component)child.FindChild("Rebirthstar_01")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_02")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_03")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_04")).get_gameObject().SetActive(true);
                    ((Component)child.FindChild("Rebirthstar_05")).get_gameObject().SetActive(true);
                }
                int num2 = this.StartAwakeLv % 5;
                if (num2 > 0)
                {
                    Transform child = this.mRebirthStars[index1].get_transform().FindChild("Rebirth_star_anim");
                    for (int index2 = 0; index2 < num2; ++index2)
                    {
                        string str = "Rebirthstar_0" + (object)(index2 + 1);
                        ((Component)child.FindChild(str)).get_gameObject().SetActive(true);
                    }
                }
                if (this.msub_shard > 0)
                {
                    int startAwakeLv    = this.StartAwakeLv;
                    int msubShard       = this.msub_shard;
                    int awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                    int num3            = this.AwakeLvCap / 5;
                    while (msubShard >= awakeNeedPieces)
                    {
                        int       num4  = startAwakeLv / 5;
                        int       num5  = Math.Min(5, startAwakeLv % 5) + 1;
                        Transform child = this.mRebirthStars[num4 + 1 < num3 ? num4 : num3 - 1].get_transform().FindChild("Rebirth_star_anim").FindChild("Rebirthstar_0" + num5.ToString());
                        if (Object.op_Inequality((Object)child, (Object)null))
                        {
                            ((Component)child).get_gameObject().SetActive(true);
                        }
                        ++startAwakeLv;
                        if (startAwakeLv < this.AwakeLvCap)
                        {
                            msubShard      -= awakeNeedPieces;
                            awakeNeedPieces = instance1.MasterParam.GetAwakeNeedPieces(startAwakeLv);
                            if (msubShard < awakeNeedPieces)
                            {
                                break;
                            }
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (Object.op_Inequality((Object)this.ShardNext, (Object)null))
                    {
                        this.ShardNext.set_text(awakeNeedPieces.ToString());
                    }
                    if (Object.op_Inequality((Object)this.ShardCurrent, (Object)null))
                    {
                        this.ShardCurrent.set_text(msubShard.ToString());
                    }
                    this.mstart_gauge = msubShard;
                    this.ShardGauge.AnimateValue((float)msubShard / (float)awakeNeedPieces, 0.0f);
                    this.StartAwakeLv = startAwakeLv;
                    this.NowAwakeLv   = this.StartAwakeLv;
                    this.NextAwakeLv  = this.StartAwakeLv + 1 <= this.AwakeLvCap ? this.StartAwakeLv + 1 : this.AwakeLvCap;
                }
            }
            int num = unitDataByUnitId == null?param.GetUnlockNeedPieces() : instance1.MasterParam.GetAwakeNeedPieces(this.StartAwakeLv);

            this.mnext_shard = num;
            this.muse_shard  = this.mget_shard >= num ? num : this.mget_shard;
            if (this.mstart_gauge > 0 && this.mstart_gauge + this.muse_shard > this.mnext_shard)
            {
                this.muse_shard -= this.mstart_gauge;
            }
            this.mremain_shard -= this.muse_shard;
            if (unitDataByUnitId == null && this.muse_shard >= this.mnext_shard)
            {
                this.mUnlockUnit = true;
            }
            if (this.muse_shard >= this.mnext_shard && this.msub_shard <= 0)
            {
                this.NextAwakeLv = this.NowAwakeLv + 1 <= this.AwakeLvCap ? this.NowAwakeLv + 1 : this.AwakeLvCap;
            }
            if (param.jobsets != null && param.jobsets.Length > 0)
            {
                this.mJobID      = new List <string>();
                this.mJobAwakeLv = new List <int>();
                for (int index = 0; index < param.jobsets.Length; ++index)
                {
                    JobSetParam jobSetParam = MonoSingleton <GameManager> .Instance.GetJobSetParam((string)param.jobsets[index]);

                    if (jobSetParam != null && jobSetParam.lock_awakelv > 0 && (unitDataByUnitId == null || !unitDataByUnitId.Jobs[index].IsActivated) && this.StartAwakeLv < jobSetParam.lock_awakelv)
                    {
                        this.mJobID.Add(jobSetParam.job);
                        this.mJobAwakeLv.Add(jobSetParam.lock_awakelv);
                    }
                }
                if (this.mJobID != null && this.mJobID.Count > 1)
                {
                    JobParam jobParam = MonoSingleton <GameManager> .Instance.GetJobParam(this.mJobID[0]);

                    this.JobName.set_text(jobParam.name);
                    this.JobComment.set_text(LocalizedText.Get("sys.GACHA_TEXT_SHARD_AWAKE", new object[1]
                    {
                        (object)jobParam.name
                    }));
                }
            }
            this.isRunningAnimator = true;
        }
示例#30
0
        public Json_Unit GetJson_Unit()
        {
            GameManager instance = MonoSingleton <GameManager> .Instance;

            if (Object.op_Equality((Object)instance, (Object)null))
            {
                return((Json_Unit)null);
            }
            if (instance.GetUnitParam(this.mUnitIName) == null)
            {
                return((Json_Unit)null);
            }
            Json_Unit jsonUnit = new Json_Unit();

            jsonUnit.iid    = this.mDraftUnitId;
            jsonUnit.iname  = this.mUnitIName;
            jsonUnit.rare   = this.mRare;
            jsonUnit.plus   = this.mAwake;
            jsonUnit.exp    = instance.MasterParam.GetUnitLevelExp(this.mLevel);
            jsonUnit.lv     = this.mLevel;
            jsonUnit.fav    = 0;
            jsonUnit.elem   = 0;
            jsonUnit.select = new Json_UnitSelectable();
            jsonUnit.jobs   = new Json_Job[this.mVersusDraftUnitJobs.Count];
            for (int index1 = 0; index1 < this.mVersusDraftUnitJobs.Count; ++index1)
            {
                JobParam jobParam = instance.GetJobParam(this.mVersusDraftUnitJobs[index1].mIName);
                if (jobParam != null && jobParam.ranks.Length > this.mVersusDraftUnitJobs[index1].mRank)
                {
                    JobRankParam rank    = jobParam.ranks[this.mVersusDraftUnitJobs[index1].mRank];
                    Json_Job     jsonJob = new Json_Job();
                    jsonJob.iid    = this.mDummyIID * 10L + (long)index1;
                    jsonJob.iname  = this.mVersusDraftUnitJobs[index1].mIName;
                    jsonJob.rank   = this.mVersusDraftUnitJobs[index1].mRank;
                    jsonJob.equips = new Json_Equip[JobRankParam.MAX_RANKUP_EQUIPS];
                    if (this.mVersusDraftUnitJobs[index1].mEquip)
                    {
                        for (int index2 = 0; index2 < JobRankParam.MAX_RANKUP_EQUIPS; ++index2)
                        {
                            jsonJob.equips[index2] = new Json_Equip()
                            {
                                iid   = jsonJob.iid * 10L + (long)index2,
                                iname = rank.equips[index2]
                            }
                        }
                        ;
                    }
                    jsonJob.select           = new Json_JobSelectable();
                    jsonJob.select.abils     = new long[5];
                    jsonJob.select.artifacts = new long[3];
                    List <Json_Ability> jsonAbilityList = new List <Json_Ability>();
                    List <string>       stringList      = new List <string>();
                    stringList.Add(jobParam.fixed_ability);
                    for (int index2 = 1; index2 <= jsonJob.rank; ++index2)
                    {
                        if (jobParam.ranks.Length >= index2 && jobParam.ranks[index2] != null && jobParam.ranks[index2].learnings != null)
                        {
                            for (int index3 = 0; index3 < jobParam.ranks[index2].learnings.Length; ++index3)
                            {
                                stringList.Add((string)jobParam.ranks[index2].learnings[index3]);
                            }
                        }
                    }
                    for (int index2 = 0; index2 < stringList.Count; ++index2)
                    {
                        Json_Ability jsonAbility = new Json_Ability();
                        jsonAbility.iid   = jsonJob.iid * 10L + (long)index2;
                        jsonAbility.iname = stringList[index2];
                        jsonAbility.exp   = 0;
                        jsonAbilityList.Add(jsonAbility);
                        if (this.mAbilities.ContainsKey(jsonAbility.iname))
                        {
                            jsonAbility.exp = this.mAbilities[jsonAbility.iname].mLevel - 1;
                            jsonAbility.iid = this.mAbilities[jsonAbility.iname].mIID;
                        }
                    }
                    jsonJob.abils = jsonAbilityList.ToArray();
                    if (index1 == this.mSelectJobIndex)
                    {
                        jsonUnit.select.job = jsonJob.iid;
                        jsonJob.artis       = new Json_Artifact[3];
                        for (int index2 = 0; index2 < this.mVersusDraftUnitArtifacts.Count; ++index2)
                        {
                            Json_Artifact jsonArtifact = new Json_Artifact();
                            jsonArtifact.iid                 = jsonJob.iid * 100L + (long)index2;
                            jsonArtifact.iname               = this.mVersusDraftUnitArtifacts[index2].mIName;
                            jsonArtifact.rare                = this.mVersusDraftUnitArtifacts[index2].mRare;
                            jsonArtifact.exp                 = ArtifactData.StaticCalcExpFromLevel(this.mVersusDraftUnitArtifacts[index2].mLevel);
                            jsonJob.artis[index2]            = jsonArtifact;
                            jsonJob.select.artifacts[index2] = jsonArtifact.iid;
                        }
                        int index3 = 0;
                        using (Dictionary <string, VersusDraftUnitAbility> .ValueCollection.Enumerator enumerator = this.mAbilities.Values.GetEnumerator())
                        {
                            while (enumerator.MoveNext())
                            {
                                VersusDraftUnitAbility current = enumerator.Current;
                                jsonJob.select.abils[index3] = current.mIID;
                                ++index3;
                            }
                        }
                        jsonJob.cur_skin = this.mSkinIName;
                    }
                    jsonUnit.jobs[index1] = jsonJob;
                }
            }
            if (!string.IsNullOrEmpty(this.mMasterAbilityIName))
            {
                jsonUnit.abil       = new Json_MasterAbility();
                jsonUnit.abil.iid   = this.mDummyIID;
                jsonUnit.abil.iname = this.mMasterAbilityIName;
                jsonUnit.abil.exp   = 0;
            }
            ConceptCardParam conceptCardParam = instance.MasterParam.GetConceptCardParam(this.mConceptCardIName);

            if (conceptCardParam != null)
            {
                RarityParam rarityParam = instance.GetRarityParam(conceptCardParam.rare);
                jsonUnit.concept_card             = new JSON_ConceptCard();
                jsonUnit.concept_card.iname       = this.mConceptCardIName;
                jsonUnit.concept_card.iid         = this.mDummyIID;
                jsonUnit.concept_card.plus        = (int)rarityParam.ConceptCardAwakeCountMax;
                jsonUnit.concept_card.exp         = instance.MasterParam.GetConceptCardLevelExp(conceptCardParam.rare, this.mConceptCardLevel);
                jsonUnit.concept_card.trust       = 0;
                jsonUnit.concept_card.trust_bonus = 0;
                jsonUnit.concept_card.fav         = 0;
            }
            jsonUnit.doors = new Json_Tobira[this.mVersusDraftUnitDoors.Count];
            List <Json_Ability> jsonAbilityList1 = new List <Json_Ability>();

            for (int index1 = 0; index1 < this.mVersusDraftUnitDoors.Count; ++index1)
            {
                Json_Tobira jsonTobira = new Json_Tobira();
                jsonTobira.category    = (int)this.mVersusDraftUnitDoors[index1].mCategory;
                jsonTobira.lv          = this.mVersusDraftUnitDoors[index1].mLevel;
                jsonUnit.doors[index1] = jsonTobira;
                TobiraParam tobiraParam = instance.MasterParam.GetTobiraParam(this.mUnitIName, this.mVersusDraftUnitDoors[index1].mCategory);
                if (tobiraParam != null)
                {
                    for (int index2 = 0; index2 < tobiraParam.LeanAbilityParam.Length; ++index2)
                    {
                        TobiraLearnAbilityParam learnAbilityParam = tobiraParam.LeanAbilityParam[index2];
                        if (learnAbilityParam.Level <= jsonTobira.lv)
                        {
                            switch (learnAbilityParam.AbilityAddType)
                            {
                            case TobiraLearnAbilityParam.AddType.JobOverwrite:
                                for (int index3 = 0; index3 < jsonUnit.jobs.Length; ++index3)
                                {
                                    for (int index4 = 0; index4 < jsonUnit.jobs[index3].abils.Length; ++index4)
                                    {
                                        if (jsonUnit.jobs[index3].abils[index4].iname == learnAbilityParam.AbilityOverwrite)
                                        {
                                            jsonUnit.jobs[index3].abils[index4].iname = learnAbilityParam.AbilityIname;
                                            if (this.mAbilities.ContainsKey(learnAbilityParam.AbilityIname))
                                            {
                                                jsonUnit.jobs[index3].abils[index4].iid = this.mAbilities[learnAbilityParam.AbilityIname].mIID;
                                                jsonUnit.jobs[index3].abils[index4].exp = this.mAbilities[learnAbilityParam.AbilityIname].mLevel - 1;
                                            }
                                        }
                                    }
                                }
                                continue;

                            case TobiraLearnAbilityParam.AddType.MasterAdd:
                                jsonAbilityList1.Add(new Json_Ability()
                                {
                                    iid   = this.mDummyIID * 100L + (long)(index1 * 10) + (long)index2,
                                    iname = learnAbilityParam.AbilityIname,
                                    exp   = 0
                                });
                                continue;

                            default:
                                continue;
                            }
                        }
                    }
                }
            }
            jsonUnit.door_abils = jsonAbilityList1.ToArray();
            return(jsonUnit);
        }
    }