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); }
public void OnDefaultClick() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); selectedDummyCharacter.SetStartSkills(); UpdateSkillSelection(); }
private void OnAttributeRaised(Object p_sender, EventArgs p_args) { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); EPotionTarget attribute = (p_sender as AttributeChanger).Attribute; if (attribute == EPotionTarget.MIGHT) { selectedDummyCharacter.IncreaseMight(); } else if (attribute == EPotionTarget.MAGIC) { selectedDummyCharacter.IncreaseMagic(); } else if (attribute == EPotionTarget.PERCEPTION) { selectedDummyCharacter.IncreasePerception(); } else if (attribute == EPotionTarget.DESTINY) { selectedDummyCharacter.IncreaseDestiny(); } else if (attribute == EPotionTarget.VITALITY) { selectedDummyCharacter.IncreaseVitality(); } else if (attribute == EPotionTarget.SPIRIT) { selectedDummyCharacter.IncreaseSpirit(); } UpdateCharacter(); UpdateAttributes(); }
private static void GenerateAudioID(DummyCharacter character, String barkClipname, out String category, out String audioID) { String text = character.Race.ToString().ToLowerInvariant(); text = Char.ToUpperInvariant(text[0]) + text.Remove(0, 1); String text2 = character.Gender.ToString().ToLowerInvariant(); text2 = Char.ToUpperInvariant(text2[0]) + text2.Remove(0, 1); String text3 = character.Voice.ToString().ToLowerInvariant(); text3 = Char.ToUpperInvariant(text3[0]) + text3.Remove(0, 1); category = "Bark" + text + text2 + text3; audioID = String.Concat(new String[] { text, "_", text2, "_", text3, "_", barkClipname }); m_LastRace = character.Race; m_LastGender = character.Gender; m_LastVoiceSetting = character.Voice; m_LastPlayedBark = audioID; }
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 UpdateDescription() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); m_raceHeader.text = LocaManager.GetText(selectedDummyCharacter.GetRaceKey()); m_raceDesc.text = LocaManager.GetText(selectedDummyCharacter.GetRaceKey() + "_DESCRIPTION"); Int32 num = UpdateAbilities(selectedDummyCharacter.Race); Single num2 = m_raceDesc.relativeSize.y * m_raceDesc.transform.localScale.y; Vector3 localPosition = m_raceDesc.transform.localPosition; m_abilitiesCaption.transform.localPosition = new Vector3(m_abilitiesCaption.transform.localPosition.x, localPosition.y - num2 - 50f, m_abilitiesCaption.transform.localPosition.z); num2 = m_abilitiesCaption.relativeSize.y * m_abilitiesCaption.transform.localScale.y; Single num3 = m_abilitiesCaption.transform.localPosition.y - num2 - 30f; Single y = m_abilitiesHeaders[0].cachedTransform.localScale.y; for (Int32 i = 0; i < num; i++) { m_abilitiesHeaders[i].transform.localPosition = new Vector3(m_abilitiesHeaders[i].transform.localPosition.x, num3 + 10f, m_abilitiesHeaders[i].transform.localPosition.z); m_abilities[i].transform.localPosition = new Vector3(m_abilities[i].transform.localPosition.x, m_abilitiesHeaders[i].transform.localPosition.y - y, m_abilities[i].transform.localPosition.z); m_abilityIcons[i].transform.localPosition = new Vector3(m_abilityIcons[i].transform.localPosition.x, num3, m_abilityIcons[i].transform.localPosition.z); m_borders[i].transform.localPosition = new Vector3(m_abilityIcons[i].transform.localPosition.x - 8f, num3 + 8f, m_borders[i].transform.localPosition.z); Single val = m_abilities[i].relativeSize.y * m_abilities[i].transform.localScale.y; Single y2 = m_borders[i].transform.localScale.y; Single num4 = Math.Max(val, y2) + 20f; num3 -= num4; } Single num5 = Math.Abs(m_borders[num - 1].transform.localPosition.y) + m_borders[num - 1].transform.localScale.y + 20f; m_textBG.transform.localScale = new Vector3(m_textBG.transform.localScale.x, num5, m_textBG.transform.localScale.z); m_textBorder.transform.localScale = new Vector3(m_textBorder.transform.localScale.x, num5, m_textBorder.transform.localScale.z); m_textRoot.transform.localPosition = new Vector3(m_textRoot.transform.localPosition.x, 434f - (760f - num5) / 2f, m_textRoot.transform.localPosition.z); }
public void OnResetClick() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); selectedDummyCharacter.ResetPickedSkills(); UpdateSkillSelection(); }
public void OnDefaultClick() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); selectedDummyCharacter.SetDefaultAttributes(); UpdateCharacter(); UpdateAttributes(); }
public void OnResetClick() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); selectedDummyCharacter.ResetAttributes(); UpdateCharacter(); UpdateAttributes(); }
public void Init(EPotionTarget p_attribute, Int32 p_baseValue, Int32 p_currentIncrease, ButtonType p_buttonType, Character p_character, DummyCharacter p_dummy) { m_attribute = p_attribute; m_buttonType = p_buttonType; m_baseValue = p_baseValue; m_currentIncrease = p_currentIncrease; m_character = p_character; m_dummy = p_dummy; }
public void UndoSelection() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); selectedDummyCharacter.Gender = EGender.NOT_SELECTED; selectedDummyCharacter.PortraitID = 0; selectedDummyCharacter.Name = String.Empty; selectedDummyCharacter.CustomName = false; }
private void UpdateButtons() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); m_btnHuman.SetSelected(selectedDummyCharacter.Race); m_btnElves.SetSelected(selectedDummyCharacter.Race); m_btnDwarfs.SetSelected(selectedDummyCharacter.Race); m_btnOrcs.SetSelected(selectedDummyCharacter.Race); }
public void OnAfterActivate() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Class == EClass.NONE && selectedDummyCharacter.Race != ERace.NONE) { selectedDummyCharacter.Class = m_partyCreator.GetUnusedClass(); } UpdatePromotion(); UpdateButtons(); }
public void OnAfterActivate() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Race == ERace.NONE) { selectedDummyCharacter.Race = m_partyCreator.GetUnusedRace(); } UpdateDescription(); UpdateButtons(); }
public void OnVoiceSelected(Object p_sender, EventArgs p_args) { OnSubmitName(m_nameInput.text); EVoice voice = (p_sender as VoiceSelectButton).Voice; DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); selectedDummyCharacter.Voice = voice; SetCharacter(selectedDummyCharacter, false); UpdateButtons(); UpdateDescription(); }
private void OnClassSelected(Object p_sender, EventArgs p_args) { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); EClass selectedClass = (p_sender as ClassSelectButton).SelectedClass; selectedDummyCharacter.Class = selectedClass; UpdatePromotion(); UpdateButtons(); StatusChangedEventArgs p_eventArgs = new StatusChangedEventArgs(StatusChangedEventArgs.EChangeType.CONDITIONS); LegacyLogic.Instance.EventManager.InvokeEvent(selectedDummyCharacter, EEventType.DUMMY_CHARACTER_STATUS_CHANGED, p_eventArgs); }
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); } }
public void Init(String p_name, String p_TT, EPotionTarget p_attribute, Int32 p_baseValue, Int32 p_addValue, DummyCharacter p_dummyChar, Character p_realChar) { m_levelUpButton.Init(p_attribute, p_baseValue, p_addValue, AttributeLevelButton.ButtonType.PLUS, p_realChar, p_dummyChar); m_levelDownButton.Init(p_attribute, p_baseValue, p_addValue, AttributeLevelButton.ButtonType.MINUS, p_realChar, p_dummyChar); m_attribute = p_attribute; m_dummyChar = p_dummyChar; m_realChar = p_realChar; m_baseValue = p_baseValue; m_addValue = p_addValue; m_TT = p_TT; m_nameLabel.text = p_name; UpdateValueLabel(); UpdateButtons(); }
public void OnSkillSelected(Object p_sender, EventArgs p_args) { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); Int32 skillID = ((SkillSelectButton)p_sender).GetSkillID(); if (selectedDummyCharacter.IsSkillPicked(skillID)) { selectedDummyCharacter.UnPickSkill(skillID); } else { selectedDummyCharacter.PickSkill(skillID); } UpdateSkillSelection(); }
/// <summary> /// Adds a character to the player's list of characters. Characters are unique and duplicates are not allowed. /// </summary> /// <param name="characterToAdd">The character to add to the player's list of characters.</param> /// <returns>True if the character was successfully added to the list.</returns> public bool AddCharacter(DummyCharacter characterToAdd) { if (characters == null) { characters = new List <DummyCharacter>(); } if (characters.Contains(characterToAdd)) { return(false); } characters.Add(characterToAdd); return(true); }
private void UpdateButtons() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); m_charM1.UpdateTexture(selectedDummyCharacter.Race, selectedDummyCharacter.Class); m_charM2.UpdateTexture(selectedDummyCharacter.Race, selectedDummyCharacter.Class); m_charF1.UpdateTexture(selectedDummyCharacter.Race, selectedDummyCharacter.Class); m_charF2.UpdateTexture(selectedDummyCharacter.Race, selectedDummyCharacter.Class); m_charM1.SetSelected(selectedDummyCharacter.Gender, selectedDummyCharacter.PortraitID); m_charM2.SetSelected(selectedDummyCharacter.Gender, selectedDummyCharacter.PortraitID); m_charF1.SetSelected(selectedDummyCharacter.Gender, selectedDummyCharacter.PortraitID); m_charF2.SetSelected(selectedDummyCharacter.Gender, selectedDummyCharacter.PortraitID); m_voiceHeroic.SetSelected(selectedDummyCharacter.Voice); m_voiceCynical.SetSelected(selectedDummyCharacter.Voice); }
private void OnRaceSelected(Object p_sender, EventArgs p_args) { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); ERace race = (p_sender as RaceSelectButton).Race; if (race != selectedDummyCharacter.Race) { selectedDummyCharacter.Race = race; selectedDummyCharacter.Class = EClass.NONE; } UpdateButtons(); UpdateDescription(); StatusChangedEventArgs p_eventArgs = new StatusChangedEventArgs(StatusChangedEventArgs.EChangeType.CONDITIONS); LegacyLogic.Instance.EventManager.InvokeEvent(selectedDummyCharacter, EEventType.DUMMY_CHARACTER_STATUS_CHANGED, p_eventArgs); }
private void InitParty(PartyCreator p_partyCreator) { if (m_characters != null) { for (Int32 i = 0; i < m_characters.Length; i++) { DummyCharacter dummyCharacter = p_partyCreator.GetDummyCharacter(i); if (dummyCharacter != null) { m_characters[i].Init(dummyCharacter, i); m_characters[i].OnCharacterClicked += OnCharacterClicked; m_characters[i].SetSelected(dummyCharacter == p_partyCreator.GetSelectedDummyCharacter()); m_characters[i].SetTickState(m_partyCreator.CheckSkillsFinished(i) && m_partyCreator.CheckAttributesFinished(i)); } } } }
public void OnSubmitName(String p_name) { String text = p_name.Replace(" ", String.Empty).Replace("\t", String.Empty); DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (p_name.Length == 0 || text.Length == 0) { m_nameInput.text = selectedDummyCharacter.Name; SetCharacter(selectedDummyCharacter, false); } else { selectedDummyCharacter.CustomName = true; selectedDummyCharacter.Name = p_name; SetCharacter(selectedDummyCharacter, 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 Init(SkillStaticData sd, DummyCharacter p_char) { if (sd != null) { ETier maxTier = GetMaxTier(p_char, sd); m_icon.spriteName = sd.Icon; NGUITools.SetActive(m_icon.gameObject, true); NGUITools.SetActive(m_border.gameObject, true); m_skillForTT = new Skill(sd.StaticID, maxTier); m_skillForTT.Level = 1; } else { NGUITools.SetActive(m_icon.gameObject, false); NGUITools.SetActive(m_border.gameObject, false); m_skillForTT = null; } }
private void OnRaceClassChanged(Object p_sender, EventArgs p_args) { DummyCharacter dummyCharacter = m_partyCreator.GetDummyCharacter(m_partyCreator.m_selectedCharacter); if (m_currentTab == 0) { if (dummyCharacter.Gender != EGender.NOT_SELECTED) { dummyCharacter.Gender = EGender.NOT_SELECTED; } if (dummyCharacter.Class != EClass.NONE) { dummyCharacter.Class = EClass.NONE; } m_characters[m_partyCreator.m_selectedCharacter].ResetPortrait(); } UpdateTabsForCharacter(); }
public void OnAfterActivate() { DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Gender == EGender.NOT_SELECTED) { selectedDummyCharacter.Gender = ((Random.Range(0, 100) < 50) ? EGender.FEMALE : EGender.MALE); } if (selectedDummyCharacter.PortraitID == 0) { selectedDummyCharacter.PortraitID = ((Random.Range(0, 100) < 50) ? 2 : 1); } if (selectedDummyCharacter.Name == String.Empty) { selectedDummyCharacter.Name = m_partyCreator.GetRandomName(selectedDummyCharacter); } UpdateButtons(); UpdateDescription(); }
public void OnCharPicClick(Object p_sender, EventArgs p_args) { OnSubmitName(m_nameInput.text); EGender gender = (p_sender as PortraitSelectButton).Gender; Int32 picIndex = (p_sender as PortraitSelectButton).PicIndex; DummyCharacter selectedDummyCharacter = m_partyCreator.GetSelectedDummyCharacter(); if (selectedDummyCharacter.Gender != gender) { selectedDummyCharacter.Gender = gender; if (!selectedDummyCharacter.CustomName) { selectedDummyCharacter.Name = m_partyCreator.GetRandomName(selectedDummyCharacter); } } selectedDummyCharacter.PortraitID = picIndex; SetCharacter(selectedDummyCharacter, false); UpdateButtons(); UpdateDescription(); }
public void Init(DummyCharacter p_character, Int32 p_index) { m_portraitBackgroundNormalColor = m_portraitBG.color; m_character = p_character; m_index = p_index; m_portrait.spriteName = p_character.GetPortrait(); String bodySprite = m_character.GetBodySprite(); if (bodySprite == String.Empty) { NGUITools.SetActive(m_body.gameObject, false); } else { m_body.spriteName = bodySprite; NGUITools.SetActive(m_body.gameObject, true); } LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.DUMMY_CHARACTER_STATUS_CHANGED, new EventHandler(OnCharacterStatusChanged)); LegacyLogic.Instance.EventManager.RegisterEvent(EEventType.DUMMY_CHARACTER_SELECTED, new EventHandler(OnCharacterSelected)); }
public void AssignCharacter() { character = GameObject.FindGameObjectWithTag("Character").GetComponent<Character>(); howToPlayDummyCharacter = GameObject.FindGameObjectWithTag("Dummy Character").GetComponent<DummyCharacter>(); }