// Specify how many card the player should disacrd and the labels of them public void Discard(int num, String[] label, AfterDiscarding callback) { this.SetPromptText("Please discard " + num + (num == 1 ? " card" : " cards")); this.discardMode = true; this.discardLabels = label; this.discardNum = num; this.discardCallback = callback; // Debug.LogFormat("PlayerController.Discard(), Num: {0}", num); }
public void EndTurnSecond() { this.numberOfAttack = 0; this.DefrozePlayer(); string color = GameManager.GetLocal().player.IsMasterClient ? "red" : "green"; // if the number of cards you have is more than you maxHP if (this.numOfcards > this.maxHP) { GameManager.instance.photonView.RPC("LogText", RpcTarget.All, GameManager.instance.currentPlayer.player.NickName + " is discarding cards.", color); AfterDiscarding callback = delegate() { GameManager.instance.photonView.RPC("LogText", RpcTarget.All, GameManager.instance.currentPlayer.player.NickName + "'s turn ends!", color); // this.SetPromptText("Your opponent is playing..."); GameManager.instance.photonView.RPC("SetNextTurn", RpcTarget.All); }; this.Discard(this.numOfcards - this.maxHP, null, callback); } else { GameManager.instance.photonView.RPC("LogText", RpcTarget.All, GameManager.instance.currentPlayer.player.NickName + "'s turn ends!", color); // this.SetPromptText("Your opponent is playing..."); GameManager.instance.photonView.RPC("SetNextTurn", RpcTarget.All); } }