Update Kills count & Passive heal
This commit is contained in:
@@ -28,8 +28,19 @@ public class Ennemy : MonoBehaviour
|
||||
if (Life <= 0)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
if (gameObject.name.Contains("Mayor"))
|
||||
{
|
||||
_player.GetComponent<PlayerManager>().MayorKills++;
|
||||
}
|
||||
else if (gameObject.name.Contains("Minotaur"))
|
||||
{
|
||||
_player.GetComponent<PlayerManager>().MinautorKills++;
|
||||
}
|
||||
else if(gameObject.name.Contains("Bringer of Death"))
|
||||
{
|
||||
_player.GetComponent<PlayerManager>().BringerOfDeathKills++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user