/// <summary> /// When card is played, this method should be called with the player being the player who used the card /// </summary> /// <param name="twoServer">For access to various class variables</param> /// <param name="player">Player who out down the card</param> /// <param name="cardArgs">Arguments for the card</param> /// <returns>If card plays successfully should be true</returns> public virtual Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs) { twoServer.DownDeck.Push(this); twoServer.PlayerList.RemovePlayerCard(player, this); twoServer.SendPlayerCards(player); int t = (int) ((SortValue*100)%10); if( twoServer.DrinkLevel == 2) { switch(t) { case 1: twoServer.SendDrinkForm(player,3, "One for me!"); twoServer.SendAnnounce(String.Format("{0}: One for me", player.Name)); break; case 2: foreach (Player p in twoServer.PlayerList.PlayerArray) { if( p != player) twoServer.SendPlayerDrinks(p, 2); } twoServer.SendAnnounce(String.Format("{0}: Two for you!", player.Name)); break; case 3: foreach (Player p in twoServer.PlayerList.PlayerArray) { if (p.PlayerNumber%2 == 1) twoServer.SendDrinkForm(p, 3, "Odds Drink!"); } twoServer.SendAnnounce(String.Format("{0}: Three is odd", player.Name)); break; case 4: foreach (Player p in twoServer.PlayerList.PlayerArray) { if (p.PlayerNumber % 2 == 0) twoServer.SendDrinkForm(p, 3, "Evens Drink!"); } twoServer.SendAnnounce(String.Format("{0}: Four is even", player.Name)); break; case 5: Player victim = twoServer.PlayerList.GetRandomPlayer(); twoServer.SendAnnounce("Random drinks for " + victim.Name); twoServer.SendToAllPlayers("TIMEDFORM 6 " + victim.PlayerNumber + " Randomly punished by " + player.Name); break; } } twoServer.PlayerList.NextPlayer(1); twoServer.SendToAllPlayers("TOPCARD " + SortValue); return true; }
public override Boolean Execute(TwoServerWindow twoServer, Player player, string[] cardArgs) { twoServer.DownDeck.Push(this); twoServer.PlayerList.RemovePlayerCard(player, this); twoServer.SendPlayerCards(player); twoServer.PlayerList.NextPlayer(1); twoServer.SendToAllPlayers("TOPCARD " + SortValue); twoServer.PlayerList.LightMaster = player.PlayerNumber; twoServer.SendAnnounce(player.Name + " just became the lightmaster!"); twoServer.PlayerList.LastLight = 0; return true; }
public override void TargetedAction(TwoServerWindow twoServer, string[] args) { twoServer.SendAnnounce(twoServer.PlayerList.PlayerArray[int.Parse(args[1])].Name + " just became Princess FuFu!"); twoServer.PlayerList.SetFufu(int.Parse(args[1])); twoServer.PlayerList.NextPlayer(1); twoServer.GameState = 1; return; }
public void SendAnnounceTest() { TwoServerWindow target = new TwoServerWindow(); // TODO: Initialize to an appropriate value string toSend = string.Empty; // TODO: Initialize to an appropriate value target.SendAnnounce(toSend); Assert.Inconclusive("A method that does not return a value cannot be verified."); }