private void BurnTarget(Transform enemy) { EnemyBase e = enemy.GetComponent <EnemyBase>(); e.TakeDamage(damage * Time.deltaTime, piercingValue, fire); e.ActivateDebuff(damage, duration, fire); }
private void Start() { FindTargets(); foreach (GameObject target in enemies) { EnemyBase enemy = target.GetComponent <EnemyBase>(); enemy.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffElement); } }
private void OnTriggerExit(Collider col) { EnemyBase enemy = col.GetComponent <EnemyBase>(); if (enemy != null) { enemy.ActivateDebuff(debuffIntensity, debuffDuration, element); } }
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); } }
private void OnTriggerEnter(Collider col) { EnemyBase enemy = col.GetComponent <EnemyBase>(); if (enemy != null) { enemy.ActivateDebuff(debuffIntensity, Mathf.Infinity, element); print("debuff enter"); } }
private void OnTriggerExit(Collider col) { if (col.tag != enemyTag) { return; } EnemyBase e = col.GetComponent <EnemyBase>(); e.ActivateDebuff(debuffIntensity, debuffDuration, element); }
private void OnTriggerEnter(Collider col) { if (col.tag != enemyTag) { return; } EnemyBase e = col.GetComponent <EnemyBase>(); e.ActivateDebuff(debuffIntensity, Mathf.Infinity, element); }
private void OnTriggerExit(Collider col) { if (col.tag != enemyTag || placed == false) { return; } EnemyBase e = col.GetComponent <EnemyBase>(); e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType); }
private void OnTriggerEnter(Collider col) { if (col.tag != enemyTag || !placed || disappear) { return; } EnemyBase e = col.GetComponent <EnemyBase>(); e.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffType); }
private void OnTriggerStay(Collider col) { if (col.tag != "Enemy") { return; } EnemyBase e = col.GetComponent <EnemyBase>(); if (e != null) { e.ActivateDebuff(debuffIntensity, debuffDuration, debuffType); } }
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); }
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; } }
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); } } }
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); } } } } }
private void OnTriggerEnter(Collider col) { EnemyBase enemy = col.GetComponent <EnemyBase>(); enemy.ActivateDebuff(debuffIntensity, Mathf.Infinity, debuffElement); }