public override bool Play(Player player) { if (player.LearningChips >= 6 && player.CraftChips >= 6 && player.IntegrityChips >= 6) { player.QualityPoints += 10; return(true); } player.LoseCard(this); return(false); }
public override bool Play(Player player) { if (player.LearningChips >= 5) { player.QualityPoints += 5; return(true); } player.QualityPoints -= 3; player.LoseCard(this); return(false); }
private void PlayComputer(Player player) { // Draw card. player.DrawCard(); // Move between 0 and 3 times. var numberOfMoves = new Random().Next(4); for (int i = 0; i < numberOfMoves; i++) { var randomDestinationId = _gameEngine.RoomsAvailable[player.Position] [new Random().Next(_gameEngine.RoomsAvailable[player.Position].Count)]; GoToARoom(_gameEngine.PlayersList.IndexOf(player), randomDestinationId); } var position = player.Position; // Play a random card. var randomCardIndex = new Random().Next(player.Hand.Count); var cardPlayed = player.Hand.ElementAt(randomCardIndex); var success = player.PlayCard(randomCardIndex); // Remove the card from the hand. player.Hand.Remove(cardPlayed); UpdateCurrentPlayPanel(_gameEngine.PlayersList.IndexOf(player), cardPlayed, success); var newPosition = player.Position; if (newPosition != position) { GoToARoom(_gameEngine.PlayersList.IndexOf(player), newPosition); } while (player.Hand.Count > 7) { player.LoseCard(null); } if (_gameEngine.CurrentYear == 1) { _gameEngine.PassToSophomoreYearIfNeeded(); } _gameEngine.ApplyQpStep(player); if (_gameEngine.IsGameOver()) { EndGame(); } }
private void PlayComputer(Player player) { // Draw card. player.DrawCard(); // Move between 0 and 3 times. var numberOfMoves = new Random().Next(4); for (int i = 0; i < numberOfMoves; i++) { var randomDestinationId = _gameEngine.RoomsAvailable[player.Position] [new Random().Next(_gameEngine.RoomsAvailable[player.Position].Count)]; GoToARoom(_gameEngine.PlayersList.IndexOf(player), randomDestinationId); } var position = player.Position; // Play a random card. var randomCardIndex = new Random().Next(player.Hand.Count); var cardPlayed = player.Hand.ElementAt(randomCardIndex); var success = player.PlayCard(randomCardIndex); // Remove the card from the hand. player.Hand.Remove(cardPlayed); UpdateCurrentPlayPanel(_gameEngine.PlayersList.IndexOf(player), cardPlayed, success); var newPosition = player.Position; if (newPosition != position) GoToARoom(_gameEngine.PlayersList.IndexOf(player), newPosition); while (player.Hand.Count > 7) player.LoseCard(null); if (_gameEngine.CurrentYear == 1) _gameEngine.PassToSophomoreYearIfNeeded(); _gameEngine.ApplyQpStep(player); if (_gameEngine.IsGameOver()) EndGame(); }
public override bool Play(Player player) { if (player.LearningChips >= 5) { player.QualityPoints += 5; return true; } player.QualityPoints -= 3; player.LoseCard(this); return false; }
public override bool Play(Player player) { if (player.LearningChips >= 6 && player.CraftChips >= 6 && player.IntegrityChips >= 6) { player.QualityPoints += 10; return true; } player.LoseCard(this); return false; }