public void FindingCards() { CharacterResourceManager.Cards cardToShow = CharacterResourceManager.Cards.Antifreeze; TurnState targetState = TurnState.PreTurn; int showedCardSource = -1; // sure turnManager.PushStack(); int cT = turnManager.CurrentTurn; bool control = true; // yes, this is how lazy i am, no need to bother writing a real algorithm while (control) { turnManager.NextTurn(); if (turnManager.CurrentTurn == cT) { targetState = TurnState.AccusationOption; control = false; } else { // Yes, this is going to be how it works, deal with it (in real clue there is a choice of what card to show) if (ClueData.Instance.HasPlayerCard(guess.Character, turnManager.CurrentTurn - 1)) { control = false; targetState = TurnState.ShowingCards; cardToShow = guess.Character; showedCardSource = turnManager.CurrentTurn; } else if (ClueData.Instance.HasPlayerCard(guess.Weapon, turnManager.CurrentTurn - 1)) { control = false; targetState = TurnState.ShowingCards; cardToShow = guess.Weapon; showedCardSource = turnManager.CurrentTurn; } else if (ClueData.Instance.HasPlayerCard(guess.Room, turnManager.CurrentTurn - 1)) { control = false; targetState = TurnState.ShowingCards; cardToShow = guess.Room; showedCardSource = turnManager.CurrentTurn; } } } turnManager.PopStack(); if (targetState.Equals(TurnState.ShowingCards)) { ClueData.Instance.ShowPlayerCard(cardToShow, turnManager.CurrentTurn - 1); if (IsCurrentTurnHuman() || showedCardSource == 1) { cardShow.Set(CharacterResourceManager.CardImageTexture(cardToShow), showedCardSource); } else { cardShow.Set(cardBack, showedCardSource); } guessDisplay.gameObject.SetActive(false); humanCardsDisplay.ShowAll(); cardShow.gameObject.SetActive(true); turnState = TurnState.ShowingCards; } else if (targetState.Equals(TurnState.AccusationOption)) { guessDisplay.gameObject.SetActive(false); humanCardsDisplay.ShowAll(); isSelected = false; aiTimer = 0; makeAccusation = false; accusationOption.Set(guess); accusationOption.gameObject.SetActive(true); turnState = TurnState.AccusationOption; } }