Ejemplo n.º 1
0
    private void OnlineTurnEnd()
    {
        // disable button
        endTurnButton.gameObject.SetActive(false);
        // lock local player
        NetInterface.Get().localPlayer.AddLock(activePlayerLock);
        // reset player for new turn
        NetInterface.Get().localPlayer.StartOfTurn();
        // trigger effects
        E_TurnEnd.Invoke();
        SwitchActivePlayer();

        foreach (Creature c in board.AllCreatures)
        {
            c.ResetForNewTurn();
        }
        foreach (Structure s in board.AllStructures)
        {
            s.ResetForNewTurn();
        }
        ActionBox.instance.gameObject.SetActive(false);
        // send opponent message
        NetInterface.Get().SyncEndTurn();
        return;
    }
Ejemplo n.º 2
0
 private void LocalTurnEnd()
 {
     E_TurnEnd.Invoke();
     SwitchActivePlayer();
     foreach (Creature c in board.AllCreatures)
     {
         c.ResetForNewTurn();
     }
     foreach (Structure s in board.AllStructures)
     {
         s.ResetForNewTurn();
     }
     ActionBox.instance.gameObject.SetActive(false);
     StartNewturn();
 }
Ejemplo n.º 3
0
    // called when recieving end turn message
    public void startTurnForOnline()
    {
        if (gameMode != GameMode.online)
        {
            throw new Exception("Only call this for online play");
        }
        // trigger end turn effects
        E_TurnEnd.Invoke();
        // re enable end turn
        endTurnButton.gameObject.SetActive(true);
        // do income and trigger effects
        SwitchActivePlayer();
        Player localPlayer = NetInterface.Get().localPlayer;

        localPlayer.StartOfTurn();
        localPlayer.DoIncome();
        localPlayer.DrawCard();
        E_TurnStart.Invoke();
        // unlock local player
        NetInterface.Get().localPlayer.RemoveLock(activePlayerLock);
    }