Exemple #1
0
	// End a turn (fires when the End Turn button is clicked).
	public void EndTurn() {

		// If the hand has too many cards.
		if(Hand.GetComponent<CardArea>().cards.Count >= 13 ){
			Prompt.PromptManager.statusPrompt("Too many cards, please discard or use.");
			logger.info("There are too many cards in Player " + (_currentPlayer + 1) + "'s hand, they must discard or play.");
			return;
		}

		// Need's to be a story card in play to end a turn.
		if (activeStoryCard) {
			// Use the correct behaviour to handle the ending of a turn.
			if (_storyCard.GetType() == typeof(QuestCard)) {
				discardCard(_questBehaviour.getCurrentTurn());
				_questBehaviour.endTurn();
			} else if (_storyCard.GetType() == typeof(TournamentCard)) {
				discardCard(_tournamentBehaviour.getCurrentTurn());
				_tournamentBehaviour.endTurn();
			} else {
				discardCard(_eventBehaviour.getCurrentTurn());
				_eventBehaviour.endTurn();
			}
		} else {
			logger.info("Player " + (_currentPlayer + 1) + " must draw a card before ending their turn.");
		}
	}