Esempio n. 1
0
    static void NextPhase()
    {
        whichText = 0;
        ++phase;
        switch (phase)
        {
        case T_Phases.Deploy:
            UIMaster.DisplayState(GamePhase.Deploy, PlayerMaster.CurrentTurn);
            UIMaster.SetActionPanel(true);
            UIMaster.FadePhanel(0);
            break;

        case T_Phases.Cannon:
            for (int i = 0; i < PlayerMaster.CurrentPlayer.Can.Count; ++i)
            {
                PlayerMaster.CurrentPlayer.Can[i].Moved = false;
            }
            HighlightMaster.HighlightActiveCannons(PlayerMaster.CurrentPlayer);
            break;

        default:
            break;
        }

        turn_button.interactable = false;
        phaselength = TutorialUIMaster.TutorialText[(int)phase].Length;
        TutorialUIMaster.ChangeText((int)phase, whichText);
    }
Esempio n. 2
0
    // changes the phase and "refreshes" variables as apropriate
    static IEnumerator EndofRound()
    {
        switch (gP)
        {
        case (GamePhase.Deploy):
            Debug.Log("Move from D");
            MoveMaster.PrimeMoveVariables(PlayerMaster.OtherPlayer);
            PlayerMaster.RefreshMovement();
            HighlightMaster.HighlightMovable(PlayerMaster.OtherPlayer);
            gP = GamePhase.Move;

            break;

        case (GamePhase.Cannon):
            Debug.Log("Move from C");
            PlayerMaster.RefreshMovement();
            if (PlayerMaster.CurrentTurn == 1)
            {
                MoveMaster.PrimeMoveVariables(PlayerMaster.OtherPlayer);
                HighlightMaster.HighlightMovable(PlayerMaster.OtherPlayer);
            }
            gP = GamePhase.Move;
            break;

        case (GamePhase.Move):
            Debug.Log("Cannon from M");
            HighlightMaster.HighlightActiveCannons(PlayerMaster.OtherPlayer);

            yield return(WinBySize());

            gP = GamePhase.Cannon;
            //CheckSkip();
            break;

        case (GamePhase.Attack):
            Debug.Log("Move from A");
            break;

        default:
            yield return(null);

            break;
        }
    }
Esempio n. 3
0
    //Alters aspects of the game state (such as highlights or unit numbers) based on phase and other information
    private static IEnumerator AlterState()
    {
        switch (gP)
        {
        case (GamePhase.Deploy):

            if (DeployMaster.instance.uoList.Count != 0)
            {
                yield return(DeployMaster.DeployUnitsCoroutine());

                yield return(new WaitForSeconds(1.5f));
            }
            UIMaster.UpdateDeployAmount();
            break;

        case (GamePhase.Cannon):
            // CheckSkip();

            /*      if (PlayerMaster.CurrentTurn == 0)
             *    {
             *        CheckSkip();
             *    } */

            CannonMaster.ExitCannon();
            HighlightMaster.UnhighlightCannons(PlayerMaster.CurrentPlayer);
            DeactivateCannonByCannon(PlayerMaster.OtherPlayer);

            if (PlayerMaster.CurrentTurn == 0)
            {
                //DeactivateCannonByMove(PlayerMaster.OtherPlayer);
                HighlightMaster.HighlightActiveCannons(PlayerMaster.OtherPlayer);
            }
            break;

        case (GamePhase.Move):

            if (MoveMaster.UnitsToMove != 0)
            {
                HighlightMaster.UnhighlightMovable(PlayerMaster.CurrentPlayer);
                MoveMaster.ClearMoveVariables();
            }
            AttackMaster.BuildCombatAreas();

            ActivateCannonByMove(PlayerMaster.CurrentPlayer);
            DeactivateCannonByMove(PlayerMaster.CurrentPlayer);

            if (AttackMaster.CombatCount == 0)
            {
                CannonMaster.CheckCannonCapture();
                yield return(WinByMove());

                if (PlayerMaster.CurrentTurn == 0)
                {
                    MoveMaster.PrimeMoveVariables(PlayerMaster.OtherPlayer);
                    HighlightMaster.HighlightMovable(PlayerMaster.OtherPlayer);
                }
            }

            else if (AttackMaster.CombatCount != 0)
            {
                //  AttackMaster.BuildCombatAreas();
                //gP = GamePhase.Attack;

                UIMaster.SetActionPanel(false);     //Deactivates off action panel
                UIMaster.FadePhanel((int)UIPannels.Action);
                acceptInput = false;

                instance.StartCoroutine(Fight());
                //yield return Fight();
            }
            break;

        case (GamePhase.Attack):
            break;

        default:
            yield return(null);

            break;
        }
    }