Beispiel #1
0
 void Attack()
 {
     m_Animator.SetTrigger("Attack");
     m_Controller.isAttacking = true;
     m_Controller.AttackBoost(0.025f, 0.25f);
     m_Controller.SetInputVec(0, 0);
     AudioSource.PlayClipAtPoint(m_AttackAnticipateSound, transform.position);
     m_Controller.kinematicOnGround = true;
 }
Beispiel #2
0
    private void ComboTracker_OnComboFinished(string name)
    {
        TextManager.AddWorldText(name, transform.position + Vector3.up * 1.75f);

        if (name == "L H L" || name == "L L H")
        {
            m_Controller.AttackBoost(0.025f, 0.25f);

            AudioSource.PlayClipAtPoint(m_AttackH1Sound, transform.position);
            m_AttackType = AttackType.HeavyA;

            Attack(m_AttackDamage.lightComboFinish, 0.3f);
        }
        else if (name == "Launcher")
        {
            //m_AttackType = AttackType.Launcher;

            m_Controller.AttackBoost(0.025f, 0.25f);

            AudioSource.PlayClipAtPoint(m_AttackH1Sound, transform.position);
            m_AttackType = AttackType.Launcher;

            AttackLaunch(m_AttackDamage.launcher, 0.3f, Vector3.up * m_Controller.jumpForce);
        }
        else if (name == "Slammer")
        {
            //m_AttackType = AttackType.Launcher;

            m_Controller.AttackBoost(0.025f, 0.25f);

            AudioSource.PlayClipAtPoint(m_AttackH1Sound, transform.position);
            m_AttackType = AttackType.HeavyA;

            AttackLaunch(m_AttackDamage.slammer, 0.3f, Vector3.down * 12);
        }
        else if (name == "Booster R" || name == "Booster L")
        {
            m_Controller.AttackBoost(0.75f, 0.2f);

            AudioSource.PlayClipAtPoint(m_AttackH1Sound, transform.position);
            m_AttackType = AttackType.Pusher;

            // Boost counts as air jump
            if (!m_Controller.IsGrounded())
            {
                m_Controller.hasDoubleJumped = true;
            }

            Attack(m_AttackDamage.booster, 0.3f);
        }
        else if (name == "Booster D")
        {
            // m_Controller.AttackBoost(0.75f, 0.2f); // TODO: Extend AttackBoost to accept a directional vector

            AudioSource.PlayClipAtPoint(m_AttackH1Sound, transform.position);
            m_AttackType = AttackType.HeavyA;

            Attack(m_AttackDamage.booster, 0.3f);
        }
        else if (name == "Pusher R" || name == "Pusher L")
        {
            m_Controller.AttackBoost(0.025f, 0.25f);

            AudioSource.PlayClipAtPoint(m_AttackH1Sound, transform.position);
            m_AttackType = AttackType.Pusher;

            if (name == "Pusher R")
            {
                AttackLaunch(m_AttackDamage.pusher, 0.3f, new Vector3(10, 5, 0));
            }
            else
            {
                AttackLaunch(m_AttackDamage.pusher, 0.3f, new Vector3(-10, 5, 0));
            }
        }
        else
        {
            Debug.LogError("Combo finished but was not handled: " + name);
        }
    }