Пример #1
0
    public void DoAttack()
    {
        Debug.Log("Attacking");

        anim.SetAnimAttack();

        basicSource.PlayOneShot(clips.clips[0]);

        if (attack.playerInArea)
        {
            Debug.Log("Player hit");
            basicSource.PlayOneShot(clips.clips[1]);
            player.Damage(hitDamage);

            if (player.IWM.absorbing && player.GM.improved)
            {
                player.IWM.absorb.StopAbsorbing();
            }

            if (player.items.healing && !player.GM.improved)
            {
                player.items.CancelHealing();
            }

            if (player.life.health <= 0)
            {
                anim.anim.updateMode = AnimatorUpdateMode.UnscaledTime;
            }
        }

        else if (!attack.playerInArea)
        {
            Debug.Log("Player Out");
            StunnedSet(stunedTimeWhenMiss);
        }
    }