Esempio n. 1
0
    // Update is called once per frame
    protected override void ComputeVelocity()
    {
        if (!isDodging && !isCharging && !isSpinning && !consumeScript.consuming && !attackScript.attacking)
        { // Make sure the player is not using other skills.
            if (chargeIcon.isActiveAndEnabled)
            {
                if (Input.GetKeyUp(GameInputManager.GIM.charge) && chargeIcon.isSkillUsable())
                {
                    anim.Play("Player_Charge0");
                    if (bGrounded == false)
                    {
                        chargeDelay = 0.0f;
                    }
                    else
                    {
                        chargeDelay = 0.2f;
                    }
                    isCharging = true;
                    sfx.PlayTCharge();
                    chargeIcon.setCoolDown(chargeCoolDown);
                }
            }

            if (dodgeIcon.isActiveAndEnabled)
            {
                if (Input.GetKeyUp(GameInputManager.GIM.dodge) && dodgeIcon.isSkillUsable())
                {
                    isDodging = true;
                    sfx.PlayRoll();
                    dodgeIcon.setCoolDown(dodgeCoolDown);
                }
            }

            if (tornadoIcon.isActiveAndEnabled)
            {
                if (Input.GetKeyUp(GameInputManager.GIM.tornado) && tornadoIcon.isSkillUsable())
                {
                    isSpinning = true;
                    animEnded  = false;
                    tornadoIcon.setCoolDown(tornadoCoolDown);
                }
            }
        }

        useCharge();
        useDodge();
        useTornado();
    }
Esempio n. 2
0
 // 6/4/2018 - Removed Checking and UpdateUI function. Sorry!
 // No need to check whether a skill is casting, because consumeScript will be disabled when a skill is used, and enabled after the skill ends.
 void Consume()
 {
     if (GetComponent <PlayerAttack> ().attacking == false && GetComponent <PlayerController> ().jumping == false)
     {
         if (consumeLength <= 0)
         {
             consuming     = true;
             consumeLength = consumeDuration;
             anim.Play("Player_Consume");
             ActivateRightConsumeBox();
             consumeIcon.setCoolDown(cooldown);
             //canConsume = false;
             //nextUse = consumeCooldown;
         }
     }
 }