Exemple #1
0
    public override void PerformSmash_1_1()
    {
        // The attackTimerCounter measures the time since the combo has been started. If it's zero, then
        // the attack needs to be initialized.
        if (H_attackTimeCounter < Utils.eps)
        {
            // Begin the animation
            H_animator.SetInteger("AnimationState", 11);
            // Measure the elapsed time.
            H_attackTimeCounter += Time.deltaTime;
            // These boolean variables describe the state the character is in.
            H_ObjectState     = ObjectState.Smashing;
            H_canAction       = false;
            H_canDash         = false;
            H_inputNextAttack = false;
            H_inputNextSmash  = false;
            P_currentAttack   = Instantiate(P_attack) as AttackObject;
            BeginAttackState(ref P_currentAttack, 0.2F, 0.2F, 0.5F);
            P_currentAttack.Scale(0.8F, 0.8F);
            P_currentAttack.RotateAroundParent(0F, 15F, 0F, H_objectDirection, 0.5F);
            gameObject.AddComponent <LifeDrain>();
            P_currentAttack.AddStatusEffect(0F, gameObject.GetComponent <LifeDrain>(), 0.5F);
            H_hasAttacked = true;
            // Build Up
        }
        else if (H_attackTimeCounter <= 0.45F)
        {
            H_attackTimeCounter += Time.deltaTime;
            H_canDash            = true;

            // The player cannot move, but he can dash out or continue the combo.
        }
        else if (H_attackTimeCounter <= 0.7F)
        {
            H_attackTimeCounter += Time.deltaTime;
        }
        else
        {
            ResetAttackState();
        }
    }
Exemple #2
0
 //Overrides for generic attacks.
 public override void PerformSmash_3_1()
 {
     if (H_attackTimeCounter < Utils.eps)
     {
         // Begin the animation
         H_animator.SetInteger("AnimationState", 11);
         // Measure the elapsed time.
         H_attackTimeCounter += Time.deltaTime;
         // These boolean variables describe the state the object is in.
         H_canAction = false;
         H_canDash   = false;
         // Do nothing
     }
     else if (H_attackTimeCounter <= 1.05F)
     {
         H_attackTimeCounter += Time.deltaTime;
     }
     else if (H_attackTimeCounter <= 1.75F)
     {
         H_attackTimeCounter += Time.deltaTime;
         // Initialize the attack.
         if (!H_hasAttacked)
         {
             P_currentAttack = Instantiate(P_attack) as AttackObject;
             BeginAttackState(ref P_currentAttack, 0.2F, 0.35F);
             gameObject.AddComponent <Poison>();
             P_currentAttack.AddStatusEffect(5F, gameObject.GetComponent <Poison>(), 0.1F);
             Move(H_objectDirection, 4.0F, 0.2F);
             P_currentAttack.Scale(0.6F, 1.5F);
             H_hasAttacked = true;
         }
         H_canAction = true;
     }
     else
     {
         ResetAttackState();
     }
 }