private void TriggerStatusEffect(AbilitiesAndStatusEffects effect)
 {
     if (effect.GetStatusEffect() == statusEffects.Poisoned)
     {
         GetComponent <Health>().ApplyStatusEffect(effect);
     }
     if (effect.GetStatusEffect() == statusEffects.Stunned)
     {
         GetComponent <Mover>().ApplyStatusEffect(effect);
     }
 }
Beispiel #2
0
        IEnumerator StunTimer(AbilitiesAndStatusEffects effect)
        {
            yield return(new WaitForSeconds(effect.GetStatusEffectLifeTime()));

            isStunned = false;
            GetComponent <DefenceApplicator>().RemoveStatusEffect(effect.GetStatusEffect());
        }
        IEnumerator ProcessPoison(AbilitiesAndStatusEffects effect)
        {
            for (int i = 0; i < effect.GetStatusEffectLifeTime(); i++)
            {
                yield return(new WaitForSeconds(1));

                LoseHealth(effect.GetStatusEffectDamage());
            }
            GetComponent <DefenceApplicator>().RemoveStatusEffect(effect.GetStatusEffect());
        }
Beispiel #4
0
 public void ApplyStatusEffect(AbilitiesAndStatusEffects effect)
 {
     if (Mathf.RoundToInt(Random.Range(0.5f, effect.GetEffectChance() + (0.5f - Mathf.Epsilon))) == 1)
     {
         isStunned = true;
         navMeshAgent.ResetPath();
         StartCoroutine(StunTimer(effect));
     }
     else
     {
         GetComponent <DefenceApplicator>().RemoveStatusEffect(effect.GetStatusEffect());
     }
 }