public AdvanceSkill ( int SkillNo, int SkillPoints ) : void | ||
SkillNo | int | |
SkillPoints | int | |
Результат | void |
private void SubmitMantra(string Mantra) { Debug.Log("Testing mantra"); int SkillPointsToAdd = 2; Skills playerSkills = playerUW.PlayerSkills; if (inputctrl == null) { inputctrl = playerUW.playerHud.InputControl; //ml.gameObject.GetComponent<UIInput>(); } string answer = ""; switch (Mantra.ToUpper()) { case Mantra_FAL: //Acrobat playerSkills.AdvanceSkill(Skills.SkillAcrobat, SkillPointsToAdd); answer = "Acrobat"; break; case Mantra_HUNN: //Appraise playerSkills.AdvanceSkill(Skills.SkillAppraise, SkillPointsToAdd); answer = "Appraise"; break; case Mantra_RA: //Attack playerSkills.AdvanceSkill(Skills.SkillAttack, SkillPointsToAdd); answer = "Attack"; break; case Mantra_SUMM_RA: //Attack skills for (int i = 0; i < SkillPointsToAdd; i++) { int SkillAwarded = AttackSkills[Random.Range(0, AttackSkills.GetUpperBound(0) + 1)]; playerSkills.AdvanceSkill(SkillAwarded, 1); if (answer.Length > 0) { answer += " and "; } answer += playerSkills.GetSkillName(SkillAwarded); } break; case Mantra_GAR: //Axe playerSkills.AdvanceSkill(Skills.SkillAxe, SkillPointsToAdd); answer = "AXe"; break; case Mantra_SOL: //Casting playerSkills.AdvanceSkill(Skills.SkillCasting, SkillPointsToAdd); answer = "Casting"; break; case Mantra_UN: //Charm playerSkills.AdvanceSkill(Skills.SkillCharm, SkillPointsToAdd); answer = "Charm"; break; case Mantra_ANRA: //Defense playerSkills.AdvanceSkill(Skills.SkillDefense, SkillPointsToAdd); answer = "Anra"; break; case Mantra_LAHN: //Lore playerSkills.AdvanceSkill(Skills.SkillLore, SkillPointsToAdd); answer = "Lore"; break; case Mantra_KOH: //Mace playerSkills.AdvanceSkill(Skills.SkillMace, SkillPointsToAdd); answer = "Mace"; break; case Mantra_IMU: //Mana playerSkills.AdvanceSkill(Skills.SkillMana, SkillPointsToAdd); answer = "Mana"; break; case Mantra_MU_AHM: //Magic skills for (int i = 0; i < SkillPointsToAdd; i++) { int SkillAwarded = MagicSkills[Random.Range(0, MagicSkills.GetUpperBound(0) + 1)]; playerSkills.AdvanceSkill(SkillAwarded, 1); if (answer.Length > 0) { answer += " and "; } answer += playerSkills.GetSkillName(SkillAwarded); } break; case Mantra_OM_CAH: //Other skills for (int i = 0; i < SkillPointsToAdd; i++) { int SkillAwarded = OtherSkills[Random.Range(0, OtherSkills.GetUpperBound(0) + 1)]; playerSkills.AdvanceSkill(SkillAwarded, 1); if (answer.Length > 0) { answer += " and "; } answer += playerSkills.GetSkillName(SkillAwarded); } break; case Mantra_AAM: //Picklock playerSkills.AdvanceSkill(Skills.SkillPicklock, SkillPointsToAdd); answer = "Picklock"; break; case Mantra_FAHM: //Missile playerSkills.AdvanceSkill(Skills.SkillMissile, SkillPointsToAdd); answer = "Missile"; break; case Mantra_LON: //Repair playerSkills.AdvanceSkill(Skills.SkillRepair, SkillPointsToAdd); answer = "Repair"; break; case Mantra_LU: //Search playerSkills.AdvanceSkill(Skills.SkillSearch, SkillPointsToAdd); answer = "Search"; break; case Mantra_MUL: //Sneak playerSkills.AdvanceSkill(Skills.SkillSneak, SkillPointsToAdd); answer = "Sneak"; break; case Mantra_ONO: //Swimming playerSkills.AdvanceSkill(Skills.SkillSwimming, SkillPointsToAdd); answer = "Swimming"; break; case Mantra_AMO: //Sword playerSkills.AdvanceSkill(Skills.SkillAcrobat, SkillPointsToAdd); answer = "Sword"; break; case Mantra_SAHF: //Track playerSkills.AdvanceSkill(Skills.SkillTrack, SkillPointsToAdd); answer = "Track"; break; case Mantra_ROMM: //Traps playerSkills.AdvanceSkill(Skills.SkillTraps, SkillPointsToAdd); answer = "Traps"; break; case Mantra_ORA: //Unarmed playerSkills.AdvanceSkill(Skills.SkillAcrobat, SkillPointsToAdd); answer = "Unarmed"; break; case Mantra_INSAHN: //Cup of Wonder TrackCupOfWonder(); answer = "CupofWonder"; break; case Mantra_FANLO: //Key of Truth GiveKeyOfTruth(); answer = "KeyofTruth"; break; } if (answer != "") { //Debug.Log (answer); ml.Add("You have advanced in " + answer); } else { //Debug.Log ("not a mantra"); ml.Add("That is not a mantra"); } //inputctrl.text=ml.text; }
/// <summary> /// Submits the mantra and checks if it is valid /// </summary> /// <param name="Mantra">Mantra.</param> private void SubmitMantra(string Mantra) { if ((Mantra.ToUpper() == Mantra_FANLO)) { GiveKeyOfTruth(); return; } if ((Mantra.ToUpper() == Mantra_INSAHN)) { TrackCupOfWonder(); return; } int SkillPointsToAdd = Random.Range(1, 4); Skills playerSkills = UWCharacter.Instance.PlayerSkills; if (UWCharacter.Instance.TrainingPoints == 0) { //000~001~024~You are not ready to advance. \n UWHUD.instance.MessageScroll.Add(StringController.instance.GetString(1, StringController.str_you_are_not_ready_to_advance_)); return; } string answer = ""; switch (Mantra.ToUpper()) { case Mantra_FAL: //Acrobat playerSkills.AdvanceSkill(Skills.SkillAcrobat, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillAcrobat)); answer = "Acrobat"; break; case Mantra_HUNN: //Appraise playerSkills.AdvanceSkill(Skills.SkillAppraise, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillAppraise)); answer = "Appraise"; break; case Mantra_RA: //Attack playerSkills.AdvanceSkill(Skills.SkillAttack, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillAttack)); answer = "Attack"; break; case Mantra_SUMM_RA: //Attack skills for (int i = 0; i < SkillPointsToAdd; i++) { int SkillAwarded = AttackSkills[Random.Range(0, AttackSkills.GetUpperBound(0) + 1)]; playerSkills.AdvanceSkill(SkillAwarded, 1 + Skills.getSkillAttributeBonus(SkillAwarded)); if (answer.Length > 0) { answer += " and "; } answer += playerSkills.GetSkillName(SkillAwarded); } break; case Mantra_GAR: //Axe playerSkills.AdvanceSkill(Skills.SkillAxe, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillAxe)); answer = "Axe"; break; case Mantra_SOL: //Casting playerSkills.AdvanceSkill(Skills.SkillCasting, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillCasting)); answer = "Casting"; break; case Mantra_UN: //Charm playerSkills.AdvanceSkill(Skills.SkillCharm, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillCharm)); answer = "Charm"; break; case Mantra_ANRA: //Defense playerSkills.AdvanceSkill(Skills.SkillDefense, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillDefense)); answer = "Anra"; break; case Mantra_LAHN: //Lore playerSkills.AdvanceSkill(Skills.SkillLore, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillLore)); answer = "Lore"; break; case Mantra_KOH: //Mace playerSkills.AdvanceSkill(Skills.SkillMace, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillMace)); answer = "Mace"; break; case Mantra_IMU: //Mana playerSkills.AdvanceSkill(Skills.SkillMana, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillMana)); answer = "Mana"; break; case Mantra_MU_AHM: //Magic skills for (int i = 0; i < SkillPointsToAdd; i++) { int SkillAwarded = MagicSkills[Random.Range(0, MagicSkills.GetUpperBound(0) + 1)]; playerSkills.AdvanceSkill(SkillAwarded, 1 + Skills.getSkillAttributeBonus(SkillAwarded)); if (answer.Length > 0) { answer += " and "; } answer += playerSkills.GetSkillName(SkillAwarded); } break; case Mantra_OM_CAH: //Other skills for (int i = 0; i < SkillPointsToAdd; i++) { int SkillAwarded = OtherSkills[Random.Range(0, OtherSkills.GetUpperBound(0) + 1)]; playerSkills.AdvanceSkill(SkillAwarded, 1 + Skills.getSkillAttributeBonus(SkillAwarded)); if (answer.Length > 0) { answer += " and "; } answer += playerSkills.GetSkillName(SkillAwarded); } break; case Mantra_AAM: //Picklock playerSkills.AdvanceSkill(Skills.SkillPicklock, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillPicklock)); answer = "Picklock"; break; case Mantra_FAHM: //Missile playerSkills.AdvanceSkill(Skills.SkillMissile, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillMissile)); answer = "Missile"; break; case Mantra_LON: //Repair playerSkills.AdvanceSkill(Skills.SkillRepair, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillRepair)); answer = "Repair"; break; case Mantra_LU: //Search playerSkills.AdvanceSkill(Skills.SkillSearch, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillSearch)); answer = "Search"; break; case Mantra_MUL: //Sneak playerSkills.AdvanceSkill(Skills.SkillSneak, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillSneak)); answer = "Sneak"; break; case Mantra_ONO: //Swimming playerSkills.AdvanceSkill(Skills.SkillSwimming, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillSwimming)); answer = "Swimming"; break; case Mantra_AMO: //Sword playerSkills.AdvanceSkill(Skills.SkillAcrobat, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillSword)); answer = "Sword"; break; case Mantra_SAHF: //Track playerSkills.AdvanceSkill(Skills.SkillTrack, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillTrack)); answer = "Track"; break; case Mantra_ROMM: //Traps playerSkills.AdvanceSkill(Skills.SkillTraps, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillTraps)); answer = "Traps"; break; case Mantra_ORA: //Unarmed playerSkills.AdvanceSkill(Skills.SkillAcrobat, SkillPointsToAdd + Skills.getSkillAttributeBonus(Skills.SkillUnarmed)); answer = "Unarmed"; break; case Mantra_INSAHN: //Cup of Wonder TrackCupOfWonder(); return; case Mantra_FANLO: //Key of Truth GiveKeyOfTruth(); return; } if (answer != "") { UWHUD.instance.MessageScroll.Add("You have advanced in " + answer); UWCharacter.Instance.TrainingPoints -= 1; } else { UWHUD.instance.MessageScroll.Add("That is not a mantra"); } }