Exemple #1
0
 internal override void DealDamage(float damage, Declarations.Effect effect = null)
 {
     base.DealDamage(damage, effect);
     if (Alive)
     {
         anim.SetTrigger("Take Damage");
     }
 }
 private void RemoveEffect(Declarations.Effect curreEffect)
 {
     Effects.Remove(curreEffect);
     if (curreEffect.Type == Declarations.EffectType.Slow && Effects.All(x => x.Type != Declarations.EffectType.Slow))
     {
         slowEffect.Stop();
         slowEffect.Clear();
     }
 }
 internal virtual void DealDamage(float damage, Declarations.Effect effect = null)
 {
     if (Alive)
     {
         currentHealth -= damage;
         if (currentHealth <= 0)
         {
             currentHealth = 0;
             Died();
             return;
         }
         if (effect != null)
         {
             Effects.Add(effect);
             if (effect.Type == Declarations.EffectType.Slow)
             {
                 slowEffect.Play();
             }
         }
         UpdateUI();
     }
 }
 public void AddEffect(Declarations.Effect effect)
 {
     Effects.Add(effect);
 }