public void CheckOffenseBallSpawn()
 {
     if (KeybindingController.GetInputDown(GameControls.AbilityBallOne))
     {
         tM.StepDone();
     }
 }
 private void Update()
 {
     if (KeybindingController.GetInputDown(GameControls.Escape))
     {
         EscapePressed();
     }
 }
 public void CheckStorageBallSpawn()
 {
     if (KeybindingController.GetInputDown(GameControls.AbilityBallThree))
     {
         tM.StepDone();
     }
 }
 public void CheckSupportBallSpawn()
 {
     if (KeybindingController.GetInputDown(GameControls.AbilityBallTwo))
     {
         tM.StepDone();
     }
 }
Beispiel #5
0
    private void UseClub()
    {
        // PrimaryAction
        if (KeybindingController.GetInputDown(GameControls.PrimaryUse) && playerMove.Movement.magnitude == 0)
        {
            gcController.PrimaryUseStart();
        }
        else if (KeybindingController.GetInput(GameControls.PrimaryUse))
        {
            gcController.PrimaryUseHeld();
        }
        else if (KeybindingController.GetInputUp(GameControls.PrimaryUse))
        {
            gcController.PrimaryUseEnd();
            if (gcController.CurrentMode == GolfClubController.Mode.Golfing)
            {
                playerAnimation.SetClubSwing(gcController.GetActiveClubIndex());
                EventController.FireEvent(new SendClubSwingAnimation(gcController.GetActiveClubIndex()));
            }
        }

        // Secondary Action
        if (KeybindingController.GetInputDown(GameControls.SecondaryUse))
        {
            gcController.SecondaryUseStart();
        }
        else if (KeybindingController.GetInput(GameControls.SecondaryUse))
        {
            gcController.SecondaryUseHeld();
        }
        else if (KeybindingController.GetInputUp(GameControls.SecondaryUse))
        {
            gcController.SecondaryUseEnd();
        }
    }
Beispiel #6
0
 private void HandleMiscInput()
 {
     if (KeybindingController.GetInputDown(GameControls.PayRespects))
     {
         if (NetworkManager.instance)
         {
             NetworkManager.instance.SendPayRespects();
         }
     }
 }
Beispiel #7
0
 private void UseAbilityBall()
 {
     if (KeybindingController.GetInputDown(GameControls.AbilityBallOne))
     {
         EventController.FireEvent(new AbilityBallPrepareMessage(this, myAbilities[0], 0));
     }
     else if (KeybindingController.GetInputDown(GameControls.AbilityBallTwo))
     {
         EventController.FireEvent(new AbilityBallPrepareMessage(this, myAbilities[1], 1));
     }
     else if (KeybindingController.GetInputDown(GameControls.AbilityBallThree))
     {
         EventController.FireEvent(new AbilityBallPrepareMessage(this, myAbilities[2], 2));
     }
 }
Beispiel #8
0
 private void HandleClubSwitching()
 {
     if (KeybindingController.GetInputDown(GameControls.NextClub))
     {
         gcController.ScrollClub(1);
     }
     else if (KeybindingController.GetInputDown(GameControls.PreviousClub))
     {
         gcController.ScrollClub(-1);
     }
     else if (KeybindingController.GetInputDown(GameControls.SwitchToClubOne))
     {
         gcController.ChooseClub(0);
     }
     else if (KeybindingController.GetInputDown(GameControls.SwitchToClubTwo))
     {
         gcController.ChooseClub(1);
     }
     else if (KeybindingController.GetInputDown(GameControls.SwitchToClubThree))
     {
         gcController.ChooseClub(2);
     }
 }
Beispiel #9
0
    private void HandlePlayerMovement()
    {
        horizontalMove = 0;
        verticalMove   = 0;
        bool jump = false;

        // If we aren't accepting input / the player gets stunned, we still need to be able to fall from gravity
        // Therefore, we ensure the Move vars stay at 0
        if (acceptInput && !IsDead && !isGameOver)
        {
            if (KeybindingController.GetInput(GameControls.Sprint) && gcController.CurrentMode == GolfClubController.Mode.Running) // Can't sprint while golfing
            {
                playerMove.ShiftSpeed();
            }

            if (!isConfused)
            {
                if (KeybindingController.GetInput(GameControls.MoveForward))
                {
                    verticalMove = 1;
                }
                else if (KeybindingController.GetInput(GameControls.MoveBackward))
                {
                    verticalMove = -1;
                }
                else
                {
                    playerAnimation.SetRun(PlayerAnimation.RunState.stop);
                }

                if (KeybindingController.GetInput(GameControls.StrafeRight))
                {
                    horizontalMove = 1;
                }
                else if (KeybindingController.GetInput(GameControls.StrafeLeft))
                {
                    horizontalMove = -1;
                }
            }
            else
            {
                if (KeybindingController.GetInput(GameControls.MoveForward))
                {
                    horizontalMove = 1;
                }
                else if (KeybindingController.GetInput(GameControls.MoveBackward))
                {
                    horizontalMove = -1;
                }

                if (KeybindingController.GetInput(GameControls.StrafeRight))
                {
                    verticalMove = -1;
                }
                else if (KeybindingController.GetInput(GameControls.StrafeLeft))
                {
                    verticalMove = 1;
                }
            }

            SetRunAnimation(horizontalMove, verticalMove);

            jump = KeybindingController.GetInputDown(GameControls.Jump);

            playerMove.RotatePlayer();
        }

        playerMove.MovePlayer(horizontalMove, verticalMove, jump);
    }