Beispiel #1
0
        private IEnumerator DoEnemyCheck()
        {
            yield return(null);

            yield return(null);

            while (EffectReady)
            {
                RaycastHit[] hits = Physics.SphereCastAll(transform.position, Radius, Vector3.one);
                foreach (RaycastHit hit in hits)
                {
                    if (hit.transform.CompareTag("enemyCollide"))
                    {
                        EnemyProgression ep = hit.transform.GetComponentInParent <EnemyProgression>();
                        if (ep != null)
                        {
                            if (fromEnemy)
                            {
                                ep.HealthScript.Health = (int)Mathf.Clamp(ep.HealthScript.Health + Healing / 2, 0, ep.maxHealth);
                                ep.Slow(6, Boost, 25);
                            }
                            else
                            {
                                ep.HitMagic(Damage);
                                ep.Slow(6, Slow, 10);
                            }
                        }
                    }
                }
                yield return(new WaitForSeconds(0.5f));
            }
        }
Beispiel #2
0
 IEnumerator HitEverySecond()
 {
     while (true)
     {
         foreach (Transform t in CoughtEnemies)
         {
             EnemyProgression ep = t.GetComponentInChildren <EnemyProgression>();
             if (ep != null)
             {
                 ep.HitMagic(Mathf.RoundToInt(damage / 2));
             }
         }
         yield return(new WaitForSeconds(0.5f));
     }
 }
Beispiel #3
0
 private IEnumerator HitEverySecond()
 {
     while (true)
     {
         foreach (Transform t in CoughtEnemies)
         {
             EnemyProgression ep = t.GetComponentInChildren <EnemyProgression>();
             if (ep != null)
             {
                 DamageMath.DamageClamp(damage, out int d, out int a);
                 for (int i = 0; i < a; i++)
                 {
                     ep.HitMagic(Mathf.RoundToInt(d / 2));
                 }
             }
         }
         yield return(new WaitForSeconds(0.5f));
     }
 }