protected override void ExecuteActionTailAttack()
    {
        // Check if the tail hit anything
        tailHasHit = parameters.creature.HitSomething();

        parameters.creature.SetAnimatorTrigger(tailAttackTrigger);
        // Get the targets of the attack
        AttackCollider            attackCollider = parameters.creature.GetHitColliderFromDirection();
        List <KillableGridObject> targets        = attackCollider.GetKillList();

        if (targets.Count > 0)
        {
            // Damage each target
            foreach (KillableGridObject target in targets)
            {
                if (target.faction != parameters.creature.faction)
                {
                    target.TakeDamage(parameters.creature.damage);

                    // Apply status effect to targets
                    StatusEffect.ApplyStatusEffect(parameters.creature, target, parameters.scorpionVenom);
                }
            }
        }
    }
Beispiel #2
0
        public void CheckAndApplyStatuses()
        {
            for (int j = _currentStatusEffects.Count - 1; j >= 0; j--)
            {
                StatusEffect e = _currentStatusEffects[j];
                e.Duration--;

                if (e.Duration < 0)
                {
                    // Done with the status effect, remove it
                    _currentStatusEffects.RemoveAt(j);
                    // Call unapply
                    e.UnapplyStatusEffect(this);
                }
                else
                {
                    // Apply the status again for this turn
                    e.ApplyStatusEffect(this);
                }
            }
        }
Beispiel #3
0
    // =====================================================
    // | States
    // =====================================================

    protected override void ExecuteActionAttack()
    {
        // Get the targets of the attack
        AttackCollider            attackCollider = parameters.creature.GetHitColliderFromDirection();
        List <KillableGridObject> targets        = attackCollider.GetKillList();

        if (targets.Count > 0)
        {
            // Puts attack on cooldown
            canAttack = false;

            // Damage each target
            foreach (KillableGridObject target in targets)
            {
                if (target.faction != parameters.creature.faction)
                {
                    target.TakeDamage(parameters.creature.damage);

                    // Apply status effect to targets
                    StatusEffect.ApplyStatusEffect(parameters.creature, target, parameters.spinStun);
                }
            }
        }
    }