/// <summary> /// Default Constructor. /// </summary> /// <param name="playerToDisplayInformationFor">The player you wish display information for in the user control.</param> public PlayerUserControl(FightClubPlayer playerToDisplayInformationFor = null) { InitializeComponent(); // Set the player to display the information for. PlayerToDisplayInformation = playerToDisplayInformation; }
public FightClubSimulatorGame() { currentPlayerTurn = PlayerTurn.PlayerOneTurn; playerOne = new FightClubPlayer(); playerTwo = new FightClubPlayer(); // Set the player name's to the default Player One and Player Two PlayerOne.Name = "Player One"; PlayerTwo.Name = "Player Two"; }
private void onPlayerTookDamage(object sender, FightClubPlayer.PlayerGotHitEventArgs arg) { // If it's 0 or less than that if (arg.AmountOfDamageTaken <= 0) { // Clear the text playerDamageTaken.Text = ""; } Color newColorOfText; // if we took more than 10 damage, it's red // more than 5 damage, it's orange // else it's blue if (arg.AmountOfDamageTaken >= 10) { newColorOfText = Color.Red; } else if (arg.AmountOfDamageTaken >= 5) { newColorOfText = Color.Orange; } else { newColorOfText = Color.Blue; } playerDamageTaken.ForeColor = newColorOfText; // set the fore colour of the text playerDamageTaken.Text = "-" + arg.AmountOfDamageTaken.ToString(); }
private void onPlayerTriedToHitPlayer(object sender, FightClubPlayer.PlayerHitEventArgs arg) { string outputMessage; string[] hitMessages = { "smacked", "wacked", "kicked", "elbowed" }; string[] missMessages = { "dodged", "flipped away from" }; // This is just to set the text message, // it will be Red if someone got hit and Blue if someone missed // and Orange/Red if someone did a critical hit Color textColour = new Color(); if (arg.DidHitPlayer) { string hitMessage = hitMessages[random.Next(hitMessages.Length)]; outputMessage = ">" + arg.PlayerThatWasHit.Name + " got " + hitMessage + " by " + arg.PlayerThatHitTheOtherPlayer.Name + "\r\n"; // set the text to red textColour = Color.Red; } else { string missMessage = missMessages[random.Next(missMessages.Length)]; // player that was hit xxx player that hit other player outputMessage = ">" + arg.PlayerThatWasHit.Name + " " + missMessage + " " + arg.PlayerThatHitTheOtherPlayer.Name + "\r\n"; // Set the text to blue textColour = Color.Blue; } if (arg.IsCriticalHit) { outputMessage += ">" + arg.PlayerThatHitTheOtherPlayer.Name + " did a critical hit on " + arg.PlayerThatWasHit.Name + "\r\n"; // Set the text to orangey red textColour = Color.OrangeRed; } // Set the fore colour of the text box outputConsoleTextBox.SelectionColor = textColour; // Append the generated message for the textbox outputConsoleTextBox.Text += outputMessage; }
private void onPlayerTookDamage(object sender, FightClubPlayer.PlayerGotHitEventArgs arg) { AppendTextToOutputTextBox(arg.Me.Name + " took " + arg.AmountOfDamageTaken.ToString() + " damage by " + arg.ByWho.Name + "\r\n"); }