Example #1
0
    public void EventCalculateNextAttack()
    {
        //remove any potential boosts from the temp damage boost value
        m_TempDamageBoost -= m_ChargeSwordDamage;
        //reset the charge sword damage
        m_ChargeSwordDamage = 0;

        m_CurrentAttackStages = SamuraiAttackStates.NULL;
    }
Example #2
0
    protected virtual void DetermineAttack()
    {
        m_HasAttackBegun = true;

        //handle if the player should move to the basic attack first
        if (!CharacterController.GetFire1Held())
        {
            if (m_SwingStage == 4)
            {
                m_SwingStage = 0;
            }

            m_SwingStage++;

            m_AnimatorRef.SetInteger("MeleeAttackStage", m_SwingStage);
            m_IsAttacking         = true;
            m_CurrentAttackStages = SamuraiAttackStates.BasicAttack;
            return;
        }

        //determine if enough frames have passed for the charge attack to be used
        if (m_ChargeAttackBuffer > BufferTime)
        {
            if (m_SwingStage == 4)
            {
                m_SwingStage = 0;
            }

            m_SwingStage++;

            m_CurrentAttackStages = SamuraiAttackStates.ChargeAttack;
            m_IsAttacking         = true;
            m_AnimatorRef.SetInteger("MeleeAttackStage", m_SwingStage);
            m_AnimatorRef.SetBool("IsCharging", true);
            m_ChargeAttackBuffer = 0;
        }
        else
        {
            m_ChargeAttackBuffer++;
        }
    }