private void triggerGameEnd(Player.PlayerSide winningPlayerSide, bool winByNotEnoughGuilt, int finalScore) { doNotifyGameEnd = true; gameResultArg = new GameResultArgs(); gameResultArg.winningPlayer = winningPlayerSide; gameResultArg.notEnoughGuiltVictory = winByNotEnoughGuilt; gameResultArg.finalScore = finalScore; }
public void InitInfo(Player.PlayerSide winningPlayer, bool notEnoughGuiltVictory, int finalScore) { if (notEnoughGuiltVictory) { text.text = "Defense player has won by not enough guilt"; } else { text.text = winningPlayer + " has won with " + finalScore + " points"; } }
public CardTemplate(string _name, int _actionPts, Player.PlayerSide _side, bool _isAttorney = false) { Name = _name; ActionPts = _actionPts; side = _side; isAttorney = _isAttorney; SelectionEvents = new List <CardEffectPair>(); TrialEvents = new List <CardEffectPair>(); SummationEvents = new List <CardEffectPair>(); }
private void onGameEnd(Player.PlayerSide winningPlayer, bool notEnoughGuiltVictory, int finalScore) { ViewManager.Instance.DisplayView(ViewManager.PopupType.GameResult, false, winningPlayer, notEnoughGuiltVictory, finalScore); }
public bool IsVisibleToPlayer(Player.PlayerSide side) { return(seenStatus[side]); }
public void Peek(Player.PlayerSide side) { seenStatus[side] = true; }
private void logEndOfGame(Player.PlayerSide winningPlayerSide, bool winByNotEnoughGuilt, int finalScore) { string str = winningPlayerSide + " won with " + (winByNotEnoughGuilt ? "not enough guilt" : finalScore + " points"); FileLogger.Instance.Log(str); }
public Player GetOtherPlayer(Player curPlayer) { Player.PlayerSide oppositeSide = (curPlayer.Side == Player.PlayerSide.Defense) ? Player.PlayerSide.Prosecution : Player.PlayerSide.Defense; return(players[oppositeSide]); }
public Player GetPlayerOfSide(Player.PlayerSide side) { return(players[side]); }
private void mainLogic() { if (game.NotifyStartOfTurn != null) { game.NotifyStartOfTurn(); } // Reveal all jury aspects. foreach (Jury jury in game.Board.Juries) { jury.Aspects.ForEach(a => a.Reveal()); } EvidenceTrack guiltTrack = game.Board.GetGuiltTrack(); if (guiltTrack.Value < 2) { if (game.NotifyGameEnd != null) { game.NotifyGameEnd(Player.PlayerSide.Defense, true, 0); } goto GameEnd; } handleGuiltTrackEffect(game); handleInsanityTrackEffect(game); game.Board.Juries.ForEach(j => j.RevealAllTraits()); List <Jury> usedJuries = new List <Jury>(); Dictionary <Player.PlayerSide, bool> playerSidePassed = new Dictionary <Player.PlayerSide, bool>(); while (playerSidePassed.Count < 2) { List <Jury> lockedJuries; if (curPlayer.Side == Player.PlayerSide.Prosecution) { lockedJuries = game.Board.Juries.FindAll(j => j.SwayTrack.IsLocked && j.SwayTrack.Value == j.SwayTrack.MaxValue); } else { lockedJuries = game.Board.Juries.FindAll(j => j.SwayTrack.IsLocked && j.SwayTrack.Value == j.SwayTrack.MinValue); } lockedJuries = lockedJuries.Except(usedJuries).ToList(); if (lockedJuries.Count > 0) { Jury usedJury = performJuryForDeliberation(lockedJuries, curPlayer); usedJuries.Add(usedJury); } else { playerSidePassed[curPlayer.Side] = true; } if (!playerSidePassed.ContainsKey(game.GetOtherPlayer(curPlayer).Side)) { passToNextPlayer(); } } // Calculate winning player. int totalScore = 0; foreach (Jury jury in game.Board.Juries) { int score = jury.CalculateGuiltScore(); totalScore += score; } Player.PlayerSide winningPlayer = totalScore >= GameConstants.PROSECUTION_SCORE_THRESHOLD ? Player.PlayerSide.Prosecution : Player.PlayerSide.Defense; if (game.NotifyGameEnd != null) { game.NotifyGameEnd(winningPlayer, false, totalScore); } GameEnd: { GotoNextState(); } }