private void HandleClearedArena(object sender, BilliardPlayEventArgs e) { string message = e.Player.Name + " cleared their field! " + e.Player.Name + " wins!"; MessageWall.AddItem(message, messageLifeInSeconds); gameOverState.GameOverReason = e.Player.Name + " won the good old-fashioned way: by pocketing all of their object balls!"; }
private void HandleDeathBallScratch(object sender, BilliardPlayEventArgs e) { string message = e.Player.Name + " scratched on death ball!\n" + e.Player.Name + " auto-loses!"; MessageWall.AddItem(message, messageLifeInSeconds); gameOverState.GameOverReason = e.Player.Name + " scratched while attempting to sink their death ball, which is an auto-lose."; }
private string GetEarlyDeathBallLongerExplanation(BilliardPlayEventArgs e) { if (e.Player.BallAlliance == e.Ball.BallAlliance || e.Player.BallAlliance == null) { return(e.Player.Name + " pocketed their \"death\" ball before clearing the rest of their balls, which is an auto-lose."); } return(e.Player.Name + " pocketed their opponent's death ball, which is a guaranteed auto-lose under all circumstances."); }
private string GetEarlyDeathBallMessage(BilliardPlayEventArgs e) { if (e.Player.BallAlliance == e.Ball.BallAlliance || e.Player.BallAlliance == null) { return(e.Player.Name + " sinks death ball too early!\n" + e.Player.Name + " auto-loses!"); } return(e.Player.Name + " pocketed opponent's death ball!\n" + e.Player.Name + " auto-loses!"); }
private void HandleBadBreak(object sender, BilliardPlayEventArgs e) { turnEndState.SetStartingStateForNextRound(badBreakState, NextStatePriority.BadBreak); MessageWall.AddItem("Death ball pocketed on break! Bad break!", messageLifeInSeconds); }
private void HandleEarlyDeathBall(object sender, BilliardPlayEventArgs e) { MessageWall.AddItem(GetEarlyDeathBallMessage(e), messageLifeInSeconds); gameOverState.GameOverReason = GetEarlyDeathBallLongerExplanation(e); }
private void HandlePlayerScratched(object sender, BilliardPlayEventArgs e) { messageWall.Result.AddItem(e.Player.Name + " Scratched! ", 8); turnEndState.SetStartingStateForNextRound(playerScratchedState, NextStatePriority.PlayerScratched); }
private void HandleAllianceDecided(object sender, BilliardPlayEventArgs e) { string message = e.Player.Name + " is " + e.Ball.BallAlliance + "!"; messageWall.Result.AddItem(message, MessageLifeInSeconds); }
private void HandlePlayerScoredForOpponent(object sender, BilliardPlayEventArgs e) { string message = e.Player.Name + " pocketed opponent's " + e.Ball.BallNumber + "-ball!"; messageWall.Result.AddItem(message, MessageLifeInSeconds); }