Ejemplo n.º 1
0
    private void BurnTarget(Transform enemy)
    {
        EnemyBase e = enemy.GetComponent <EnemyBase>();

        e.TakeDamage(damage * Time.deltaTime, piercingValue, fire);
        e.ActivateDebuff(damage, duration, fire);
    }
Ejemplo n.º 2
0
 private void Start()
 {
     FindTargets();
     foreach (GameObject target in enemies)
     {
         EnemyBase enemy = target.GetComponent <EnemyBase>();
         enemy.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffElement);
     }
 }
Ejemplo n.º 3
0
    private void OnTriggerExit(Collider col)
    {
        EnemyBase enemy = col.GetComponent <EnemyBase>();

        if (enemy != null)
        {
            enemy.ActivateDebuff(debuffIntensity, debuffDuration, element);
        }
    }
Ejemplo n.º 4
0
    private void Damage(Transform enemy)
    {
        EnemyBase e = enemy.GetComponent <EnemyBase>();

        e.TakeDamage(damage, penetration, debuffElement);
        if (debuffElement != Enums.Element.none)
        {
            e.ActivateDebuff(debuffIntensity, debuffDuration, debuffElement);
        }
    }
Ejemplo n.º 5
0
    private void OnTriggerEnter(Collider col)
    {
        EnemyBase enemy = col.GetComponent <EnemyBase>();

        if (enemy != null)
        {
            enemy.ActivateDebuff(debuffIntensity, Mathf.Infinity, element);
            print("debuff enter");
        }
    }
Ejemplo n.º 6
0
    private void OnTriggerExit(Collider col)
    {
        if (col.tag != enemyTag)
        {
            return;
        }

        EnemyBase e = col.GetComponent <EnemyBase>();

        e.ActivateDebuff(debuffIntensity, debuffDuration, element);
    }
Ejemplo n.º 7
0
    private void OnTriggerEnter(Collider col)
    {
        if (col.tag != enemyTag)
        {
            return;
        }

        EnemyBase e = col.GetComponent <EnemyBase>();

        e.ActivateDebuff(debuffIntensity, Mathf.Infinity, element);
    }
Ejemplo n.º 8
0
    private void OnTriggerExit(Collider col)
    {
        if (col.tag != enemyTag || placed == false)
        {
            return;
        }

        EnemyBase e = col.GetComponent <EnemyBase>();

        e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType);
    }
Ejemplo n.º 9
0
    private void OnTriggerEnter(Collider col)
    {
        if (col.tag != enemyTag || !placed || disappear)
        {
            return;
        }

        EnemyBase e = col.GetComponent <EnemyBase>();

        e.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffType);
    }
Ejemplo n.º 10
0
    private void OnTriggerStay(Collider col)
    {
        if (col.tag != "Enemy")
        {
            return;
        }
        EnemyBase e = col.GetComponent <EnemyBase>();

        if (e != null)
        {
            e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType);
        }
    }
Ejemplo n.º 11
0
 private void Disappear()
 {
     disappear = true;
     Collider[] colliders = Physics.OverlapSphere(transform.position, 2.5f);
     foreach (Collider col in colliders)
     {
         if (col.tag == enemyTag)
         {
             EnemyBase e = col.GetComponent <EnemyBase>();
             e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType);
         }
     }
     Destroy(gameObject);
 }
Ejemplo n.º 12
0
    private void FreezeTarget(Transform enemy)
    {
        EnemyBase e = enemy.GetComponent <EnemyBase>();

        e.TakeDamage(freezeDamage * Time.deltaTime, piercing, ice);
        e.ActivateDebuff(100 * e.freezeStatus, duration, ice);
        if (e.freezeStatus > 1)
        {
            e.freezeStatus = 1;
        }
        else
        {
            e.freezeStatus += .01f;
        }
    }
Ejemplo n.º 13
0
    protected void Damage(Transform enemy)
    {
        EnemyBase e = enemy.GetComponent <EnemyBase>();

        //e could be null since now Hit() passes only the transform of where it hit
        if (e != null)
        {
            e.TakeDamage(damage, penetration, debuffElement);

            if (debuffElement != Enums.Element.none)
            {
                e.ActivateDebuff(debuffIntensity, debuffDuration, debuffElement);
            }
        }
    }
Ejemplo n.º 14
0
 void Debuff()
 {
     foreach (GameObject e in WaveSpawner.EnemiesAlive)
     {
         EnemyBase enemy = e.GetComponent <EnemyBase>();
         if (seesInvisible || (!seesInvisible && !enemy.GetInvisibleState()))
         {
             if (enemy.element != element)
             {
                 float distToEnemy = Vector3.Distance(transform.position, e.transform.position);
                 if (distToEnemy <= range)
                 {
                     enemy.ActivateDebuff(debuffIntensity, debuffDuration, element);
                 }
             }
         }
     }
 }
Ejemplo n.º 15
0
    private void OnTriggerEnter(Collider col)
    {
        EnemyBase enemy = col.GetComponent <EnemyBase>();

        enemy.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffElement);
    }