// Update is called once per frame void Update() { Attacks att = (Attacks)attack.GetComponent("Attacks"); reqlevel.text = att.reqlevel.ToString(); typereqlevel.text = att.typereqlevel.ToString(); LevelingSkills lvlsk = (LevelingSkills)player.GetComponent("LevelingSkills"); if (lvlsk.level >= att.reqlevel) { if (att.type == "Blades" && lvlsk.blades >= att.typereqlevel) { unlocked = true; } if (att.type == "Archery" && lvlsk.archery >= att.typereqlevel) { unlocked = true; } if (att.type == "Elemental Magic" && lvlsk.elementalm >= att.typereqlevel) { unlocked = true; } } if (unlocked == false) { redx.SetActive(true); } if (unlocked == true) { redx.SetActive(false); } }
// Update is called once per frame void Update() { LevelingSkills lvl = (LevelingSkills)player.GetComponent("LevelingSkills"); Level.text = lvl.level.ToString(); lightarmortext.text = lvl.lightarmor.ToString(); heavyarmortext.text = lvl.heavyarmorshield.ToString(); bladestext.text = lvl.blades.ToString(); archerytext.text = lvl.archery.ToString(); sneaktext.text = lvl.sneak.ToString(); alchemytext.text = lvl.alchemy.ToString(); smithingtext.text = lvl.smithingenchanting.ToString(); elementaltext.text = lvl.elementalm.ToString(); supporttext.text = lvl.supportm.ToString(); summontext.text = lvl.summonm.ToString(); availablestatpts.text = lvl.statpointsavailable.ToString(); }
public void BattleChance() { randnum = Random.Range(minnum, maxnum); if (randnum <= 7) { move = false; DontDestroyVars ddv = (DontDestroyVars)dontdestroyvar.GetComponent("DontDestroyVars"); LevelingSkills lvl = (LevelingSkills)player.GetComponent("LevelingSkills"); lvl.Save(); ddv.playerlocation = player.transform.position; int randnum1 = Random.Range(0, 10); int randnum2 = Random.Range(0, 10); int randnum3 = Random.Range(0, 10); if (randnum1 <= 2) { enemy1 = 1; } if (randnum1 == 3 || randnum1 == 4) { enemy1 = 2; } if (randnum1 == 5) { enemy1 = 3; } if (randnum1 >= 6) { enemy1 = 4; } if (randnum2 <= 2) { enemy2 = 1; } if (randnum2 == 3 || randnum2 == 4) { enemy2 = 2; } if (randnum2 == 5) { enemy2 = 3; } if (randnum2 >= 6) { enemy2 = 4; } if (randnum3 <= 2) { enemy3 = 1; } if (randnum3 == 3 || randnum3 == 4) { enemy3 = 2; } if (randnum3 == 5) { enemy3 = 3; } if (randnum3 >= 6) { enemy3 = 4; } if (enemy1 == 4 && enemy2 == 4 && enemy3 == 4) { enemy1 = 1; } SwitchScene change = (SwitchScene)switchobject.GetComponent("SwitchScene"); anim.SetTrigger(jumphash); change.Animationgo(enemy1, enemy2, enemy3); } }
public void Subtract(string stat) { LevelingSkills lvl = (LevelingSkills)player.GetComponent("LevelingSkills"); if (stat == "lightarmor") { if (lvl.lightarmor > 0) { lvl.lightarmor--; lvl.statpointsavailable++; } } if (stat == "heavyarmor") { if (lvl.heavyarmorshield > 0) { lvl.heavyarmorshield--; lvl.statpointsavailable++; } } if (stat == "blades") { if (lvl.blades > 0) { lvl.blades--; lvl.statpointsavailable++; } } if (stat == "archery") { if (lvl.archery > 0) { lvl.archery--; lvl.statpointsavailable++; } } if (stat == "sneak") { if (lvl.sneak > 0) { lvl.sneak--; lvl.statpointsavailable++; } } if (stat == "alchemy") { if (lvl.alchemy > 0) { lvl.alchemy--; lvl.statpointsavailable++; } } if (stat == "smithing") { if (lvl.smithingenchanting > 0) { lvl.smithingenchanting--; lvl.statpointsavailable++; } } if (stat == "elemental") { if (lvl.elementalm > 0) { lvl.elementalm--; lvl.statpointsavailable++; } } if (stat == "support") { if (lvl.supportm > 0) { lvl.supportm--; lvl.statpointsavailable++; } } if (stat == "summon") { if (lvl.summonm > 0) { lvl.summonm--; lvl.statpointsavailable++; } } }
public void Add(string stat) { LevelingSkills lvl = (LevelingSkills)player.GetComponent("LevelingSkills"); if (stat == "lightarmor") { if (lvl.statpointsavailable > 0) { lvl.lightarmor++; lvl.statpointsavailable--; } } if (stat == "heavyarmor") { if (lvl.statpointsavailable > 0) { lvl.heavyarmorshield++; lvl.statpointsavailable--; } } if (stat == "blades") { if (lvl.statpointsavailable > 0) { lvl.blades++; lvl.statpointsavailable--; } } if (stat == "archery") { if (lvl.statpointsavailable > 0) { lvl.archery++; lvl.statpointsavailable--; } } if (stat == "sneak") { if (lvl.statpointsavailable > 0) { lvl.sneak++; lvl.statpointsavailable--; } } if (stat == "alchemy") { if (lvl.statpointsavailable > 0) { lvl.alchemy++; lvl.statpointsavailable--; } } if (stat == "smithing") { if (lvl.statpointsavailable > 0) { lvl.smithingenchanting++; lvl.statpointsavailable--; } } if (stat == "elemental") { if (lvl.statpointsavailable > 0) { lvl.elementalm++; lvl.statpointsavailable--; } } if (stat == "support") { if (lvl.statpointsavailable > 0) { lvl.supportm++; lvl.statpointsavailable--; } } if (stat == "summon") { if (lvl.statpointsavailable > 0) { lvl.summonm++; lvl.statpointsavailable--; } } }