Larry Hastings  committed 9af1d59

Made Rosey sliiightly smarter: she doesn't play a hazard if you're stopped
(or a speed limit if you're slowed).

  • Participants
  • Parent commits 83cd919
  • Branches default

Comments (0)

Files changed (1)

 	On every turn she shuffles her cards.
 	Shen then tries each in order.
-	If she finds a card that is legally playable, she plays it.
+	If she finds a card that is legally playable, she plays it--
+		unless it's redundant (plays hazards only when stopped, plays
+		speed limit only if you don't already have one)
 	If she finds no legally playable cards, she discards a card at random.
 	(She will never discard a safety, because safeties are always legally playable.)
 	She extends if half the cards remain in the draw pile.
 		for card in cards:
-				playee = self.other() if isinstance(card, Hazard) else self
+				if not isinstance(card, Hazard):
+					playee = self
+				else:
+					playee = self.other()
+					if card is speed_limit:
+						if not playee.hand.autobahn():
+							continue
+					else:
+						if not playee.hand.rolling():
+							continue, playee)
 				print("    du-uh, played", card, "on", "herself" if playee == self else "you")
 				if self.hand.won() and self.hand.mileage() == 700: