Esempio n. 1
0
        public void SetSkillData(ConceptCardEquipEffect effect)
        {
            SkillData cardSkill = effect.CardSkill;

            if (cardSkill == null)
            {
                return;
            }
            this.SetText(this.mAbilityName, cardSkill.Name);
            StringBuilder stringBuilder          = new StringBuilder();
            List <BuffEffect.BuffTarget> targets = cardSkill.mTargetBuffEffect.targets;

            for (int index = 0; index < targets.Count; ++index)
            {
                BuffEffect.BuffTarget target = targets[index];
                stringBuilder.Append(effect.GetBufText(cardSkill.mTargetBuffEffect, target));
            }
            UnitGroupParam unitGroup = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitGroup(cardSkill.mTargetBuffEffect.param.un_group);

            if (unitGroup != null && !string.IsNullOrEmpty(unitGroup.name))
            {
                stringBuilder.Append(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_NEW_LINE"));
                stringBuilder.Append(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_GROUP", (object)unitGroup.name, (object)unitGroup.GetGroupUnitAllNameText()));
            }
            this.SetText(this.mDescriptionText, stringBuilder.ToString());
        }
Esempio n. 2
0
        public string GetBufText(BuffEffect effect, BuffEffect.BuffTarget target)
        {
            MasterParam   masterParam   = MonoSingleton <GameManager> .Instance.MasterParam;
            StringBuilder stringBuilder = new StringBuilder();
            ConceptCardConditionsParam conceptCardConditions = masterParam.GetConceptCardConditions(this.ConditionsIname);

            stringBuilder.Append(conceptCardConditions.GetConditionDescriptionEquip());
            UnitGroupParam unitGroup = masterParam.GetUnitGroup(effect.param.un_group);

            if (unitGroup != null)
            {
                stringBuilder.Append(unitGroup.GetName());
            }
            stringBuilder.Append(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            string str = LocalizedText.Get("sys." + target.paramType.ToString());

            stringBuilder.Append(str);
            bool   flag  = 0 <= (int)target.value;
            int    num   = Mathf.Abs((int)target.value);
            string empty = string.Empty;

            switch (target.calcType)
            {
            case SkillParamCalcTypes.Add:
                if (flag)
                {
                    empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_ADD_PLUS", new object[1]
                    {
                        (object)num.ToString()
                    });
                    break;
                }
                empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_ADD_MINUS", new object[1]
                {
                    (object)num.ToString()
                });
                break;

            case SkillParamCalcTypes.Scale:
                if (flag)
                {
                    empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_UP", new object[1]
                    {
                        (object)num.ToString()
                    });
                    break;
                }
                empty = LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_CALC_DOWN", new object[1]
                {
                    (object)num.ToString()
                });
                break;
            }
            stringBuilder.Append(empty);
            return(stringBuilder.ToString());
        }
Esempio n. 3
0
        public override void Refresh()
        {
            ConceptCardConditionsParam conceptCardConditions = this.Master.GetConceptCardConditions(this.mConceptCardEquipEffect.ConditionsIname);
            ArtifactParam  artifactParam = this.Master.GetArtifactParam(this.mConceptCardEquipEffect.Skin);
            UnitGroupParam unitGroup     = this.Master.GetUnitGroup(conceptCardConditions.unit_group);

            if (unitGroup.units == null || unitGroup.units.Length != 1)
            {
                return;
            }
            UnitParam unitParam = this.Master.GetUnitParam(unitGroup.units[0]);

            this.mCardNextSkinDesc.set_text(LocalizedText.Get("sys.CONCEPT_CARD_SKIN_DESCRIPTION", (object)unitParam.name, (object)artifactParam.name));
            this.LoadImage(AssetPath.UnitSkinIconSmall(unitParam, artifactParam, (string)null), this.mCardSkinIcon);
        }
Esempio n. 4
0
        public bool CheckEnableBuffTarget(Unit target)
        {
            if (this.param == null)
            {
                return(false);
            }
            bool flag = true;

            if (this.param.sex != ESex.Unknown)
            {
                flag &= this.param.sex == target.UnitParam.sex;
            }
            if (this.param.elem != 0)
            {
                int num = 1 << (int)(target.Element - 1 & (EElement)31);
                flag &= (this.param.elem & num) == num;
            }
            if (!string.IsNullOrEmpty(this.param.job) && target.Job != null)
            {
                flag &= this.param.job == target.Job.Param.origin;
            }
            if (!string.IsNullOrEmpty(this.param.buki) && target.Job != null)
            {
                flag &= this.param.job == target.Job.Param.buki;
            }
            if (!string.IsNullOrEmpty(this.param.birth))
            {
                flag &= this.param.birth == (string)target.UnitParam.birth;
            }
            if (!string.IsNullOrEmpty(this.param.un_group))
            {
                UnitGroupParam unitGroup = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetUnitGroup(this.param.un_group);

                if (unitGroup != null)
                {
                    flag &= unitGroup.IsInGroup(target.UnitParam.iname);
                }
            }
            if (this.param.custom_targets != null && this.param.cond == ESkillCondition.CardSkill)
            {
                flag &= this.CheckCustomTarget(target);
            }
            return(flag);
        }
Esempio n. 5
0
        public bool IsMatchUnitGroup(string unit_iname)
        {
            if (string.IsNullOrEmpty(this.unit_group))
            {
                return(true);
            }
            UnitGroupParam unitGroup = MonoSingleton <GameManager> .Instance.MasterParam.GetUnitGroup(this.unit_group);

            if (unitGroup == null)
            {
                return(true);
            }
            bool flag = unitGroup.IsInGroup(unit_iname);

            if (this.units_conditions_type == EUseConditionsType.NotMatch)
            {
                return(!flag);
            }
            return(flag);
        }
Esempio n. 6
0
        public UnitParam[] GetConditionUnit()
        {
            ConceptCardConditionsParam condition = this.GetCondition();

            if (condition == null)
            {
                return((UnitParam[])null);
            }
            UnitGroupParam unitGroupParam = condition.GetUnitGroupParam();

            if (unitGroupParam == null || unitGroupParam.units == null)
            {
                return((UnitParam[])null);
            }
            List <UnitParam> unitParamList = new List <UnitParam>();

            for (int index = 0; index < unitGroupParam.units.Length; ++index)
            {
                unitParamList.Add(MonoSingleton <GameManager> .Instance.MasterParam.GetUnitParam(unitGroupParam.units[index]));
            }
            return(unitParamList.ToArray());
        }
Esempio n. 7
0
        private bool CheckCustomTarget(Unit target)
        {
            foreach (string customTarget1 in this.param.custom_targets)
            {
                if (!string.IsNullOrEmpty(customTarget1))
                {
                    CustomTargetParam customTarget2 = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetCustomTarget(customTarget1);

                    if (customTarget2 != null)
                    {
                        if (customTarget2.units != null)
                        {
                            bool flag = false;
                            foreach (string unit in customTarget2.units)
                            {
                                if (target.UnitParam.iname == unit)
                                {
                                    flag = true;
                                    break;
                                }
                            }
                            if (!flag)
                            {
                                continue;
                            }
                        }
                        if (customTarget2.jobs != null)
                        {
                            if (target.Job != null)
                            {
                                bool flag = false;
                                foreach (string job in customTarget2.jobs)
                                {
                                    if (target.Job.JobID == job)
                                    {
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        if (customTarget2.unit_groups != null)
                        {
                            bool flag = false;
                            foreach (string unitGroup1 in customTarget2.unit_groups)
                            {
                                UnitGroupParam unitGroup2 = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetUnitGroup(unitGroup1);

                                if (unitGroup2 == null)
                                {
                                    Debug.LogWarning((object)"存在しないユニットグループ識別子が設定されている : CustomTarget");
                                }
                                else if (unitGroup2.IsInGroup(target.UnitParam.iname))
                                {
                                    flag = true;
                                    break;
                                }
                            }
                            if (!flag)
                            {
                                continue;
                            }
                        }
                        if (customTarget2.job_groups != null)
                        {
                            if (target.Job != null)
                            {
                                bool flag = false;
                                foreach (string jobGroup1 in customTarget2.job_groups)
                                {
                                    JobGroupParam jobGroup2 = MonoSingleton <GameManager> .GetInstanceDirect().MasterParam.GetJobGroup(jobGroup1);

                                    if (jobGroup2 == null)
                                    {
                                        Debug.LogWarning((object)"存在しないジョブグループ識別子が設定されている : CustomTarget");
                                    }
                                    else if (jobGroup2.IsInGroup(target.Job.JobID))
                                    {
                                        flag = true;
                                        break;
                                    }
                                }
                                if (!flag)
                                {
                                    continue;
                                }
                            }
                            else
                            {
                                continue;
                            }
                        }
                        JobData[] jobs = target.UnitData.Jobs;
                        if ((string.IsNullOrEmpty(customTarget2.first_job) || jobs != null && jobs.Length >= 1 && !(jobs[0].JobID != customTarget2.first_job)) && (string.IsNullOrEmpty(customTarget2.second_job) || jobs != null && jobs.Length >= 2 && !(jobs[1].JobID != customTarget2.second_job)) && ((string.IsNullOrEmpty(customTarget2.third_job) || jobs != null && jobs.Length >= 3 && !(jobs[2].JobID != customTarget2.third_job)) && ((customTarget2.sex == ESex.Unknown || customTarget2.sex == target.UnitParam.sex) && (customTarget2.birth_id == 0 || customTarget2.birth_id == target.UnitParam.birthID))))
                        {
                            if (customTarget2.element != 0)
                            {
                                int num = 1 << (int)(target.Element - 1 & (EElement)31);
                                if ((customTarget2.element & num) != num)
                                {
                                    continue;
                                }
                            }
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Esempio n. 8
0
        public string GetConditionDescription()
        {
            List <string> stringList  = new List <string>();
            MasterParam   masterParam = MonoSingleton <GameManager> .Instance.MasterParam;

            if (this.birth_id != null && this.birth_id.Length > 0)
            {
                stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_BIRTH"));
                bool flag = false;
                for (int index = 0; index < this.birth_id.Length; ++index)
                {
                    if (flag)
                    {
                        stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OR"));
                    }
                    string birthplaceName = UnitParam.GetBirthplaceName(this.birth_id[index]);
                    stringList.Add(birthplaceName);
                    flag = true;
                }
                stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            }
            UnitGroupParam unitGroup = masterParam.GetUnitGroup(this.unit_group);

            if (unitGroup != null)
            {
                stringList.Add(unitGroup.GetName());
                stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            }
            List <EElement> eelementList = new List <EElement>((IEnumerable <EElement>) this.conditions_elements.Keys);

            if (this.element_sum > 0)
            {
                bool flag = false;
                for (int index = 0; index < eelementList.Count; ++index)
                {
                    if (this.conditions_elements[eelementList[index]] == 1)
                    {
                        if (flag)
                        {
                            stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OR"));
                        }
                        EElement eelement = eelementList[index];
                        stringList.Add(LocalizedText.Get("sys.UNIT_ELEMENT_" + (object)eelement));
                        stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_ELEMENT"));
                        flag = true;
                    }
                }
                stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            }
            if (this.sex != ESex.Unknown)
            {
                stringList.Add(LocalizedText.Get("sys.SEX_" + (object)this.sex));
                stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            }
            JobGroupParam jobGroup = masterParam.GetJobGroup(this.job_group);

            if (jobGroup != null)
            {
                bool flag = false;
                for (int index = 0; index < jobGroup.jobs.Length; ++index)
                {
                    if (flag)
                    {
                        stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OR"));
                    }
                    string   job      = jobGroup.jobs[index];
                    JobParam jobParam = masterParam.GetJobParam(job);
                    stringList.Add(jobParam.name);
                    flag = true;
                }
                stringList.Add(LocalizedText.Get("sys.CONCEPT_CARD_SKILL_DESCRIPTION_OF"));
            }
            stringList.RemoveAt(stringList.Count - 1);
            return(string.Join(string.Empty, stringList.ToArray()));
        }