Beispiel #1
0
    public void BlockAttack(UnitHealth target)
    {
        int RandomNum = (int)Random.Range(0, blockAttackAnims.Length);

        animator.SetTrigger(blockAttackAnims[RandomNum]);
        target.TakeDamageWDelayed(unitScript.basicAttackDamage, blockAnimHitTimes[RandomNum]);
    }
Beispiel #2
0
    public void randomAttack1(UnitHealth target)
    {
        if (unitScript.blocking == true)
        {
            BlockAttack(target);
            return;
        }

        int RandomNum = (int)Random.Range(0, attack1Anims.Length);

        animator.SetTrigger(attack1Anims[RandomNum]);
        target.TakeDamageWDelayed(unitScript.basicAttackDamage, attack1AnimHitTimes[RandomNum]);
    }
Beispiel #3
0
    public void randomAttack2(UnitHealth target)
    {
        if (unitScript.blocking == true)
        {
            BlockAttack(target);
            return;
        }

        int RandomNum = (int)Random.Range(0, attack2Anims.Length);

        animator.SetTrigger(attack2Anims[RandomNum]);
        target.TakeDamageWDelayed(unitScript.basicAttackDamage, attack2AnimHitTimes[RandomNum]);
        target.TakeDamageWDelayedWKnockback(unitScript.basicAttackDamage, attack2SecondaryHitTimes[RandomNum], transform.position, (unitScript.heavyAttackDamage));
    }