private void Die() { this.currentHealth = this.maxHealth; //Destroy(gameObject); Debug.Log("Player dead. Reset health"); UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
private void Awake() { PlayerLevel = GetComponent <PlayerLevel>(); CurrentHealth = MaxHealth; CharacterStats = new CharacterStats(10, 10, 10); UIEventHandler.HealthChanged(MaxHealth, CurrentHealth); }
private void Die() { print("Player dead. Reset health."); this.currentHealth = this.maxHealth; UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
private void Start() { this.currentHealth = this.maxHealth; characterStats = new CharacterStats(2, 5, 8); UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
void Start() { PlayerLevel = GetComponent <PlayerLevel>(); this.currentHealth = this.maxHealth; characterStats = new CharacterStats(10, 10, 10); UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); //UIEventHandler.PlayerLevelChanged(this.PlayerLevel.CurrentExperience, this.PlayerLevel.RequiredExperience); }
public void TakeDamage(int amount) { currentHealth -= amount; if (currentHealth <= 0) { Die(); } UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
// ============================================================================================================================================ // Health Bar Functionality // Source: https://www.youtube.com/watch?v=9W0xLonwbLo // CURRENTLY NOT USING THIS SCRIPT // ============================================================================================================================================ // public void PlayerHealthBar() // { // UIEventHandler.HealthChanged(currentHealth, maxHealth); // } public void TakeDamage(int amount) { Debug.Log("Player takes: " + amount + " damage"); currentHealth -= amount; if (currentHealth <= 0) { Die(); } UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); // Updates the UI from damage taken }
public void OnTriggerStay(Collider collider) { if (collider.tag == "Player") { if (isDamaging) { player.currentHealth = (int)(player.currentHealth - (damage * Time.deltaTime)); } UIEventHandler.HealthChanged(this.player.currentHealth, this.player.currentHealth); } }
public void AddHealth(int amount) { if (CurrentHealth + amount > Stats.MaxHealth) { CurrentHealth = Stats.MaxHealth; } else { CurrentHealth += amount; } UIEventHandler.HealthChanged(); }
public void TakeDamage(int amount) { currentHealth -= amount; Debug.Log("Player took " + amount + " Damage"); if (currentHealth <= 0) { Die(); } UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
public void TakeDamage(int amount) { CurrentHealth -= amount; if (CurrentHealth < 0) { CurrentHealth = 0; } if (CurrentHealth <= 0) { Die(); } UIEventHandler.HealthChanged(MaxHealth, CurrentHealth); }
public override void TakeDamage(Damage dmg) { if (OnTakeDamage != null) { dmg = OnTakeDamage(dmg); } if (dmg.DamageAmount > 0) { Stats.CurrentHealth -= dmg.DamageAmount; if (Stats.CurrentHealth <= 0) { Die(); } StatusBar.Instance.HealthBarFlash(); UIEventHandler.HealthChanged(); } StartCoroutine(GotHitFlashing()); }
private void Die() { Debug.Log("Player Dead. Reset Health."); this.currentHealth = this.maxHealth; UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
void Start() { UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
public void HealFullHP() { Stats.CurrentHealth = Stats.MaxHealth; UIEventHandler.HealthChanged(); }
public void StatsUpdate() { Stats.UpdateStats(PlayerLevel.Level); UIEventHandler.HealthChanged(); UIEventHandler.ManaChanged(); }
public override void Die() { Debug.Log("Player dead. reset health"); Stats.CurrentHealth = Stats.MaxHealth; UIEventHandler.HealthChanged(); }
private void Die() { Debug.Log("Revived!"); this.currentHealth = this.maxHealth; UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }
private void Die() { CurrentHealth = MaxHealth; UIEventHandler.HealthChanged(MaxHealth, CurrentHealth); }
public void RegainHealth(int amount) { this.currentHealth = this.currentHealth + amount; UIEventHandler.HealthChanged(this.currentHealth, this.maxHealth); }