public override void TakeDamage(float damage)
 {
     base.TakeDamage(damage);
     if (currentHealth <= MaxHealth.GetValue() / 2 && !secondPhase)
     {
         SecondPhase();
         secondPhase = true;
     }
 }
Example #2
0
 protected override void OnEnable()
 {
     if (isInitialized)
     {
         audioSource.Play();
         ReduceSpawns();
         gameManager.StartCoroutine(gameManager.RUIManager.ShowBossText(BossEnterText, TextColor, TextMaterial));
         gameManager.RUIManager.InitializeBossBar(MaxHealth.GetValue(), BossIcon);
     }
     base.OnEnable();
 }
Example #3
0
 public override void TakeDamage(float damage)
 {
     if (Random.Range(0, 100) >= Agility.GetValue())
     {
         damage              -= Defence.GetValue();
         damage               = Mathf.Clamp(damage, 0, int.MaxValue);
         CurrentHealth       -= damage;
         Healthbar.fillAmount = CurrentHealth / MaxHealth.GetValue();
         Debug.Log("Damage has been taken " + damage);
     }
 }
Example #4
0
 //Set currentvalues to start values
 private void Start()
 {
     currentMana    = Mathf.RoundToInt(maxMana.GetValue());
     currentStamina = Mathf.RoundToInt(MaxStamina.GetValue());
     currentHealth  = Mathf.RoundToInt(MaxHealth.GetValue());
 }