private void UpdateButton(SkillSelectButton p_btn, ESkillID p_skill) { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class); ETier etier = ETier.NONE; for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++) { if (staticData.GrandMasterSkills[i] == (Int32)p_skill) { etier = ETier.GRAND_MASTER; } } for (Int32 j = 0; j < staticData.MasterSkills.Length; j++) { if (staticData.MasterSkills[j] == (Int32)p_skill) { etier = ETier.MASTER; } } for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++) { if (staticData.ExpertSkills[k] == (Int32)p_skill) { etier = ETier.EXPERT; } } SkillStaticData staticData2 = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_skill); p_btn.Init(staticData2, isDefaultSkill(staticData, staticData2), !isStartSkill(staticData, staticData2) && etier != ETier.NONE, selectedDummyCharacter.IsSkillPicked(staticData2.StaticID) || isStartSkill(staticData, staticData2), etier); }
private ETier GetMaxTier(DummyCharacter p_char, SkillStaticData p_skill) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_char.Class); ETier result = ETier.NONE; for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++) { if (staticData.GrandMasterSkills[i] == p_skill.StaticID) { result = ETier.GRAND_MASTER; } } for (Int32 j = 0; j < staticData.MasterSkills.Length; j++) { if (staticData.MasterSkills[j] == p_skill.StaticID) { result = ETier.MASTER; } } for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++) { if (staticData.ExpertSkills[k] == p_skill.StaticID) { result = ETier.EXPERT; } } return(result); }
private void AddClassIfAvailable(List <EClass> p_list, EClass p_class) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_class); if (staticData != null) { p_list.Add(p_class); } }
private Boolean isStartSkill(CharacterClassStaticData sd, SkillStaticData skillData) { foreach (Int32 num in sd.StartSkills) { if (num == skillData.StaticID) { return(true); } } return(false); }
public void Init(DummyCharacter p_char) { m_character = p_char; m_nameLabel.text = m_character.Name; CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)m_character.Class); String text = staticData.NameKey; if (m_character.Gender == EGender.MALE) { text += "_M"; } else { text += "_F"; } m_raceClassLabel.text = LocaManager.GetText(m_character.GetRaceKey()) + " " + LocaManager.GetText(text); m_Portrait.spriteName = m_character.GetPortrait(); m_body.spriteName = m_character.GetBodySprite(); Attributes classAttributes = m_character.GetClassAttributes(); m_healthCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_HEALTH"); m_manaCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_MANA"); m_mightCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_MIGHT"); m_magicCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_MAGIC"); m_perceptionCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_PERCEPTION"); m_destinyCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_DESTINY"); m_vitalityCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_VITALITY"); m_spiritCaption.text = LocaManager.GetText("CHARACTER_ATTRIBUTE_SPIRIT"); m_healthtValue.text = m_character.BaseAttributes.HealthPoints.ToString(); m_manaValue.text = m_character.BaseAttributes.ManaPoints.ToString(); m_mightValue.text = (classAttributes.Might + m_character.BaseAttributes.Might).ToString(); m_magicValue.text = (classAttributes.Magic + m_character.BaseAttributes.Magic).ToString(); m_perceptionValue.text = (classAttributes.Perception + m_character.BaseAttributes.Perception).ToString(); m_destinyValue.text = (classAttributes.Destiny + m_character.BaseAttributes.Destiny).ToString(); m_vitalityValue.text = (classAttributes.Vitality + m_character.BaseAttributes.Vitality).ToString(); m_spiritValue.text = (classAttributes.Spirit + m_character.BaseAttributes.Spirit).ToString(); UpdateLabelPositions(); UpdateSkill(0, staticData.StartSkills[0]); UpdateSkill(1, staticData.StartSkills[1]); for (Int32 i = 0; i < 4; i++) { UpdateSkill(i + 2, m_character.SelectedSkills[i]); } if (m_character.Race == ERace.HUMAN) { m_skillsRoot.transform.localPosition = new Vector3(165f, -220f, 0f); } else { m_skillsRoot.transform.localPosition = new Vector3(270f, -220f, 0f); } }
private void UpdateButton(ClassSelectButton m_btn, EClass p_class) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_class); if (staticData != null) { m_btn.Init(p_class, staticData); } else { m_btn.Init(EClass.NONE, null); } }
public String GetRandomName(DummyCharacter c) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)c.Class); String[] array; if (c.Gender == EGender.MALE) { array = staticData.DefaultMaleNames; } else { array = staticData.DefaultFemaleNames; } return(Localization.Instance.GetText(array[Random.Range(0, array.Length)])); }
public void Init(EClass p_class, CharacterClassStaticData p_staticData) { m_class = p_class; if (p_class != EClass.NONE) { m_className.text = LocaManager.GetText(p_staticData.NameKey + "_M"); m_classIcon.spriteName = p_staticData.Icon; m_isButton = true; } else { m_className.text = LocaManager.GetText("CLASS_LOCKED"); m_classIcon.spriteName = "ICO_award_promotion_unknown"; m_isButton = false; } }
private void UpdateButtons() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Race == ERace.HUMAN) { UpdateButton(m_btnMight, EClass.MERCENARY); UpdateButton(m_btnHybrid, EClass.CRUSADER); UpdateButton(m_btnMagic, EClass.FREEMAGE); } else if (selectedDummyCharacter.Race == ERace.ELF) { UpdateButton(m_btnMight, EClass.BLADEDANCER); UpdateButton(m_btnHybrid, EClass.RANGER); UpdateButton(m_btnMagic, EClass.DRUID); } else if (selectedDummyCharacter.Race == ERace.DWARF) { UpdateButton(m_btnMight, EClass.DEFENDER); UpdateButton(m_btnHybrid, EClass.SCOUT); UpdateButton(m_btnMagic, EClass.RUNEPRIEST); } else { UpdateButton(m_btnMight, EClass.BARBARIAN); UpdateButton(m_btnHybrid, EClass.HUNTER); UpdateButton(m_btnMagic, EClass.SHAMAN); } m_btnMight.SetSelected(selectedDummyCharacter.Class); m_btnHybrid.SetSelected(selectedDummyCharacter.Class); m_btnMagic.SetSelected(selectedDummyCharacter.Class); if (selectedDummyCharacter.Class != EClass.NONE) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class); String str = "CharacterPosings/" + staticData.PosingBase; Texture mainTexture = m_malePosing.mainTexture; mainTexture.UnloadAsset(); Texture mainTexture2 = Helper.ResourcesLoad <Texture2D>(str + "_male_1", false); m_malePosing.mainTexture = mainTexture2; Texture mainTexture3 = m_femalePosing.mainTexture; mainTexture3.UnloadAsset(); Texture mainTexture4 = Helper.ResourcesLoad <Texture2D>(str + "_female_1", false); m_femalePosing.mainTexture = mainTexture4; } }
public void UpdateTexture(ERace p_race, EClass p_class) { String text; if (p_race == ERace.HUMAN) { text = "PIC_head_human"; } else if (p_race == ERace.ELF) { text = "PIC_head_elf"; } else if (p_race == ERace.DWARF) { text = "PIC_head_dwarf"; } else { text = "PIC_head_orc"; } if (m_gender == EGender.MALE) { text += "_male_"; } else { text += "_female_"; } text = text + m_picIndex.ToString() + "_idle"; m_Portrait.spriteName = text; CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_class); String text2 = staticData.BodyBase; if (m_gender == EGender.MALE) { text2 += "_male"; } else { text2 += "_female"; } m_body.spriteName = text2; }
public CharacterClass(EClass p_class) { m_class = p_class; m_data = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_class); m_race = m_data.Race; m_nameKey = m_data.NameKey; m_advancedNameKey = m_data.AdvancedNameKey; m_expertSkills = m_data.ExpertSkills; m_masterSkills = m_data.MasterSkills; m_grandMasterSkills = m_data.GrandMasterSkills; m_startSkills = m_data.StartSkills; m_initialResistance = new ResistanceCollection(); m_initialResistance.Add(m_data.ResAir); m_initialResistance.Add(m_data.ResEarth); m_initialResistance.Add(m_data.ResFire); m_initialResistance.Add(m_data.ResWater); m_initialResistance.Add(m_data.ResDark); m_initialResistance.Add(m_data.ResLight); m_initialResistance.Add(m_data.ResPrimordial); m_initialAttributes = new Attributes(m_data.BaseMight, m_data.BaseMagic, m_data.BasePerception, m_data.BaseDestiny, m_data.BaseVitality, m_data.BaseSpirit, m_data.BaseHP, m_data.BaseMana); }
public void AssignRandomSkills(DummyCharacter p_character) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)p_character.Class); List <Int32> list = new List <Int32>(); List <Int32> list2 = new List <Int32>(staticData.StartSkills); p_character.ResetPickedSkills(); for (Int32 i = 0; i < staticData.GrandMasterSkills.Length; i++) { Int32 num = staticData.GrandMasterSkills[i]; if (!p_character.IsSkillPicked(num) && !list2.Contains(num)) { list.Add(num); } } for (Int32 j = 0; j < staticData.MasterSkills.Length; j++) { Int32 num2 = staticData.MasterSkills[j]; if (!p_character.IsSkillPicked(num2) && !list2.Contains(num2)) { list.Add(num2); } } for (Int32 k = 0; k < staticData.ExpertSkills.Length; k++) { Int32 num3 = staticData.ExpertSkills[k]; if (!p_character.IsSkillPicked(num3) && !list2.Contains(num3)) { list.Add(num3); } } Int32 num4 = (staticData.Race != ERace.HUMAN) ? 2 : 4; for (Int32 l = 0; l < num4; l++) { Int32 index = Random.Range(0, list.Count); p_character.PickSkill(list[index]); list.RemoveAt(index); } }
private void UpdateCharacter() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Class != EClass.NONE) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class); m_nameLabel.text = selectedDummyCharacter.Name; String text = staticData.NameKey; if (selectedDummyCharacter.Gender == EGender.MALE) { text += "_M"; } else { text += "_F"; } m_raceClassLabel.text = LocaManager.GetText(selectedDummyCharacter.GetRaceKey()) + " " + LocaManager.GetText(text); m_portrait.spriteName = selectedDummyCharacter.GetPortrait(); m_body.spriteName = selectedDummyCharacter.GetBodySprite(); } }
private void UpdatePromotion() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Class != EClass.NONE) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class); m_classDesc.text = LocaManager.GetText(staticData.NameKey + "_DESC"); m_promotionClass.text = GetAdvancedClassName(selectedDummyCharacter.Class); m_promotionIcon.spriteName = GetAdvancedClassSprite(selectedDummyCharacter.Class); Int32 num = UpdateAbilities(selectedDummyCharacter.Class); Single num2 = m_classDesc.relativeSize.y * m_classDesc.transform.localScale.y; Vector3 localPosition = m_classDesc.transform.localPosition; m_promotionCaption.transform.localPosition = new Vector3(m_promotionCaption.transform.localPosition.x, localPosition.y - num2 - 35f, m_promotionCaption.transform.localPosition.z); m_promotionClass.transform.localPosition = new Vector3(m_promotionClass.transform.localPosition.x, localPosition.y - m_promotionIcon.cachedTransform.localScale.y / 2f - num2 - 95f, m_promotionClass.transform.localPosition.z); m_promotionIcon.transform.localPosition = new Vector3(m_promotionIcon.transform.localPosition.x, localPosition.y - num2 - 95f, m_promotionIcon.transform.localPosition.z); Single num3 = m_promotionIcon.transform.localPosition.y - m_promotionIcon.transform.localScale.y - 30f; Single y = m_abilityHeader[0].cachedTransform.localScale.y; for (Int32 i = 0; i < num; i++) { m_abilityHeader[i].transform.localPosition = new Vector3(m_abilityHeader[i].transform.localPosition.x, num3 + 10f, m_abilityHeader[i].transform.localPosition.z); m_abilityDesc[i].transform.localPosition = new Vector3(m_abilityDesc[i].transform.localPosition.x, m_abilityHeader[i].transform.localPosition.y - y, m_abilityDesc[i].transform.localPosition.z); m_abilityIcon[i].transform.localPosition = new Vector3(m_abilityIcon[i].transform.localPosition.x, num3, m_abilityIcon[i].transform.localPosition.z); m_abilityBorder[i].transform.localPosition = new Vector3(m_abilityIcon[i].transform.localPosition.x - 8f, num3 + 8f, m_abilityBorder[i].transform.localPosition.z); Single val = m_abilityDesc[i].relativeSize.y * m_abilityDesc[i].transform.localScale.y; Single y2 = m_abilityBorder[i].transform.localScale.y; Single num4 = Math.Max(val, y2) + 30f; num3 -= num4; } Single val2 = m_abilityDesc[num - 1].transform.localScale.y * m_abilityDesc[num - 1].relativeSize.y; Single y3 = m_abilityBorder[num - 1].transform.localScale.y; Single num5 = Math.Max(val2, y3); Single num6 = Math.Abs(m_abilityDesc[num - 1].transform.localPosition.y) + num5 + 30f; m_textBG.transform.localScale = new Vector3(m_textBG.transform.localScale.x, num6, m_textBG.transform.localScale.z); m_textBorder.transform.localScale = new Vector3(m_textBorder.transform.localScale.x, num6, m_textBorder.transform.localScale.z); m_textRoot.transform.localPosition = new Vector3(m_textRoot.transform.localPosition.x, 434f - (760f - num6) / 2f, m_textRoot.transform.localPosition.z); } }
private void UpdateDescription() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); m_nameInput.text = selectedDummyCharacter.Name; if (selectedDummyCharacter.Class != EClass.NONE) { CharacterClassStaticData staticData = StaticDataHandler.GetStaticData <CharacterClassStaticData>(EDataType.CHARACTER_CLASS, (Int32)selectedDummyCharacter.Class); String text = "CharacterPosings/" + staticData.PosingBase; if (selectedDummyCharacter.Gender == EGender.MALE) { text = text + "_male_" + selectedDummyCharacter.PortraitID; } else { text = text + "_female_" + selectedDummyCharacter.PortraitID; } Texture mainTexture = m_charPosing.mainTexture; mainTexture.UnloadAsset(); Texture mainTexture2 = Helper.ResourcesLoad <Texture2D>(text, false); m_charPosing.mainTexture = mainTexture2; } }