Example #1
0
    public override void Stack(Buff newBuff)
    {
        StunDebuff newStun = newBuff as StunDebuff;

        if (newStun.Duration > Duration - _counter)
        {
            _counter = 0;
            Duration = newStun.Duration;
        }
    }
Example #2
0
 void TakeStunDamage()
 {
     if (stunDebuff != null)
     {
         stunDebuff.timer -= Time.deltaTime;
         if (stunDebuff.timer <= 0)
         {
             stunDebuff = null;
             stunned    = false;
         }
     }
 }
Example #3
0
    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);
    }
Example #4
0
 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;
         }
     }
 }
Example #5
0
    // **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();
    }
Example #6
0
    private void ApplyStunDebuff(ObjectController target)
    {
        StunDebuff SD = StunDebuff.Generate(StunDuration);

        SD.ApplyDebuff(OC, target);
    }