public override void Stack(Buff newBuff) { StunDebuff newStun = newBuff as StunDebuff; if (newStun.Duration > Duration - _counter) { _counter = 0; Duration = newStun.Duration; } }
void TakeStunDamage() { if (stunDebuff != null) { stunDebuff.timer -= Time.deltaTime; if (stunDebuff.timer <= 0) { stunDebuff = null; stunned = false; } } }
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); }
public void TakeStunDebuff(StunCube tc) { if (tc.possibility > UnityEngine.Random.value) { StunDebuff newStunDebuff = new StunDebuff { attackType = tc.attackType, duration = tc.stunDuration, timer = tc.stunDuration }; if (stunDebuff == null || newStunDebuff > stunDebuff) { stunDebuff = newStunDebuff; stunned = true; } } }
// **TODO** Implémenter les dégâts supplémentaires au centre. public override void Apply(Unit caster, List <Unit> receivers, CellGrid cellgrid) { Animator anim = caster.GetComponentInChildren <Animator>(); anim.SetBool("Skill", true); anim.SetBool("Idle", false); foreach (var receiver in receivers) { int damage = UnityEngine.Random.Range(MinDamage, MaxDamage + 1); caster.DealDamage2(receiver, damage); StunDebuff stunDebuff = new StunDebuff(); stunDebuff.Apply(receiver); receiver.Buffs.Add(stunDebuff); } caster.ActionPoints--; SetCooldown(); }
private void ApplyStunDebuff(ObjectController target) { StunDebuff SD = StunDebuff.Generate(StunDuration); SD.ApplyDebuff(OC, target); }