public void Armor(int index) { PlayerArmor += Current[index].DamHeal; PlayerArmorObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerArmor.ToString(); UpdateTile(index, 0); TriggerRandomTile(index); }
public virtual void Monster(int index) { int LastPlayerHp = PlayerHp; PlayerHp -= (Current[index].DamHeal - PlayerArmor); PlayerArmor = 0; if (PlayerHp > LastPlayerHp) { PlayerHp = LastPlayerHp; } PlayerArmorObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerArmor.ToString(); PlayerHpObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerHp.ToString(); UpdateTile(index, 0); TriggerRandomTile(index); }
private void RessetStats() { PlayerPrefs.SetInt("PlayerHp", 3); PlayerPrefs.SetInt("PlayerArmor", 0); PlayerPrefs.SetInt("PlayerStepCounter", 0); PlayerPrefs.SetInt("SpecialCounter", 0); PlayerHp = 3; PlayerArmor = 0; PlayerStepCounter = 0; MageCounter = 0; if (PlayerHpObject == null) { return; } SpecialCounter.GetComponentInChildren <TextMeshProUGUI>().text = MageCounter.ToString(); PlayerHpObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerHp.ToString(); PlayerArmorObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerArmor.ToString(); PlayerStepObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerStepCounter.ToString(); }
public virtual void Resett() { PlayerHp = PlayerPrefs.GetInt("PlayerHp", 10); PlayerArmor = PlayerPrefs.GetInt("PlayerArmor", 0); PlayerIndex = 4; PlayerLevel = PlayerPrefs.GetInt("PlayerLevel", 0); PlayerStepCounter = PlayerPrefs.GetInt("PlayerStepCounter", PlayerStepCounter); if (Generate) { GenerateNext(); AllTiles[0] = PlayerTile; } else { AllTiles = Levels[PlayerLevel].Tiles; } RandomField(); PlayerHpObject = GameObject.FindGameObjectWithTag("PlayerHp"); PlayerArmorObject = GameObject.FindGameObjectWithTag("PlayerArmor"); PlayerStepObject = GameObject.FindGameObjectWithTag("PlayerStep"); PlayerHpObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerHp.ToString(); PlayerArmorObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerArmor.ToString(); PlayerStepObject.GetComponentInChildren <TextMeshProUGUI>().text = PlayerStepCounter.ToString(); }