public bool IsMatchJobGroup(string job_iname) { if (string.IsNullOrEmpty(this.job_group)) { return(true); } JobGroupParam jobGroup = MonoSingleton <GameManager> .Instance.MasterParam.GetJobGroup(this.job_group); if (jobGroup == null) { return(true); } bool flag = jobGroup.IsInGroup(job_iname); if (this.jobs_conditions_type == EUseConditionsType.NotMatch) { return(!flag); } return(flag); }
public JobParam[] GetConditionJob() { ConceptCardConditionsParam condition = this.GetCondition(); if (condition == null) { return((JobParam[])null); } JobGroupParam jobGroupParam = condition.GetJobGroupParam(); if (jobGroupParam == null || jobGroupParam.jobs == null) { return((JobParam[])null); } List <JobParam> jobParamList = new List <JobParam>(); for (int index = 0; index < jobGroupParam.jobs.Length; ++index) { jobParamList.Add(MonoSingleton <GameManager> .Instance.MasterParam.GetJobParam(jobGroupParam.jobs[index])); } return(jobParamList.ToArray()); }
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); }
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())); }