Exemple #1
0
 /// <summary>
 /// Called when a new turn for this player starts.
 /// </summary>
 /// <param name="msg">Start turn message.</param>
 public override void OnStartTurn(StartTurnMessage msg)
 {
     base.OnStartTurn(msg);
     if (msg.isRecipientTheActivePlayer)
     {
         StartCoroutine(RunLogic());
     }
 }
Exemple #2
0
 public override void OnStartTurn(StartTurnMessage msg)
 {
     base.OnStartTurn(msg);
     if (msg.isRecipientTheActivePlayer)
     {
         /*var handZone = Array.Find(msg.StaticGameZones, x => x.Name == "Hand");
          * hand = new List<int>(handZone.Cards);*/
     }
 }
Exemple #3
0
    private void OnStartTurnMessage(MessageBase _msg, NetworkConnection _connection)
    {
        StartTurnMessage _startTurnMessage = _msg as StartTurnMessage;

        foreach (Player p in client.localPlayers)
        {
            if (p.guid == _startTurnMessage.recepientGUID)
            {
                p.OnStartTurnMessage(_startTurnMessage);
            }
        }
    }
    public override void OnStartTurn(StartTurnMessage msg)
    {
        base.OnStartTurn(msg);

        gameUI.SetPlayerActive(msg.isRecipientTheActivePlayer);
        gameUI.SetOpponentActive(!msg.isRecipientTheActivePlayer);
        gameUI.SetEndTurnButtonEnabled(msg.isRecipientTheActivePlayer);

        foreach (var card in opponentHandCards)
        {
            Destroy(card);
        }
        opponentHandCards.Clear();
        for (var i = 0; i < opponentHandZone.numCards; i++)
        {
            AddCardToOpponentHand();
        }
        RearrangeOpponentHand();

        if (msg.isRecipientTheActivePlayer)
        {
            UpdateHandCardsHighlight();

            foreach (var card in playerBoardCards)
            {
                card.OnStartTurn();
            }

            var scene = GameObject.Find("GameScene").GetComponent <GameScene>();
            scene.OpenPopup <PopupTurnStart>("PopupTurnStart", null, false);

            gameUI.StartTurnCountdown(turnDuration);
        }
        else
        {
            foreach (var card in opponentBoardCards)
            {
                card.OnStartTurn();
            }

            foreach (var card in playerHandCards)
            {
                card.SetHighlightingEnabled(false);
            }
            foreach (var card in playerBoardCards)
            {
                card.SetHighlightingEnabled(false);
            }

            gameUI.HideTurnCountdown();
        }
    }
Exemple #5
0
 internal virtual void OnStartTurnMessage(StartTurnMessage _startTurnMessage)
 {
     LoadPlayerState(ref playerData, _startTurnMessage.playerData);
     LoadPlayerState(ref opponentData, _startTurnMessage.opponentData);
     activePlayer = true;
 }