diff --git a/Assets/Enemies/Ennemy.cs b/Assets/Enemies/Ennemy.cs index 52af895..44d2041 100644 --- a/Assets/Enemies/Ennemy.cs +++ b/Assets/Enemies/Ennemy.cs @@ -28,7 +28,18 @@ public class Ennemy : MonoBehaviour if (Life <= 0) { Destroy(gameObject); - _player.GetComponent().MayorKills++; + if (gameObject.name.Contains("Mayor")) + { + _player.GetComponent().MayorKills++; + } + else if (gameObject.name.Contains("Minotaur")) + { + _player.GetComponent().MinautorKills++; + } + else if(gameObject.name.Contains("Bringer of Death")) + { + _player.GetComponent().BringerOfDeathKills++; + } } } diff --git a/Assets/Player/Scripts/PlayerManager.cs b/Assets/Player/Scripts/PlayerManager.cs index 0eac5ce..b47a624 100644 --- a/Assets/Player/Scripts/PlayerManager.cs +++ b/Assets/Player/Scripts/PlayerManager.cs @@ -2,14 +2,23 @@ using UnityEngine; public class PlayerManager : MonoBehaviour { + // Character stats public int Health = 100; public int MaxHealth = 100; + public int HealValue = 1; public float Speed = 2f; public int Exp = 0; public int Level = 1; + // Weapons stats + public int BeamDamages = 50; + public int SwordsDamages = 25; + public int ArrowDamages = 15; + // Kills stats public int MayorKills = 0; + public int MinautorKills = 0; + public int BringerOfDeathKills = 0; [SerializeField] private GameObject pauseMenu; @@ -17,6 +26,11 @@ public class PlayerManager : MonoBehaviour [SerializeField] private GameObject deathScreen; + private void Start() + { + InvokeRepeating(nameof(Heal), 1f, 1f); + } + private void Update() { if (Input.GetKeyDown(KeyCode.Escape)) @@ -37,6 +51,7 @@ public class PlayerManager : MonoBehaviour } } + // --- CHARACTER STATS --------------------------------------------------------------------- public void TakeDamage(int value) { Health -= value; @@ -53,9 +68,9 @@ public class PlayerManager : MonoBehaviour } } - public void Heal(int value) + public void Heal() { - Health += value; + Health += HealValue; if (Health > MaxHealth) { Health = MaxHealth;