void TakeFiringDamage() { if (firingDebuff != null) { TakeDamage(Time.deltaTime * firingDebuff.damagePerSecond); firingDebuff.timer -= Time.deltaTime; if (firingDebuff.timer <= 0) { firingDebuff = null; } } }
public void TakeFiringDebuff(FiringCube fc) { FiringDebuff newFiringDebuf = new FiringDebuff { attackType = fc.attackType, damagePerSecond = fc.damagePerSecond, duration = fc.duration, timer = fc.duration }; if (firingDebuff == null || newFiringDebuf > firingDebuff) { firingDebuff = newFiringDebuf; } }
void Start() { totalHp = hp; currentSpeed = speed; stunned = false; firingDebuff = null; slowDebuff = null; stunDebuff = null; hpSlider = GetComponentInChildren <Slider>(); agent = GetComponent <NavMeshAgent>(); agent.speed = currentSpeed; agent.destination = GameObject.Find("End").GetComponent <Transform>().position; gameManager.SubscribeEnemyKilled(this); gameManager.SubscribeEnemyReach(this); Player.currentPlayer.SubscribeEnemyKilled(this); }