Commits

larry committed b39cefc

More tomfoolery before the big statistics rewrite.

Comments (0)

Files changed (1)

 		self.sort_order = sort_order
 
 		self._str = self.__class__.__name__
-		self.shorthand = self._str[0:9]
+		self.abbreviation = self._str[0:9]
 
 	def __str__(self):
 		return self._str
 class Mileage(Card):
 	def __init__(self):
 		super().__init__()
-		self.shorthand = self._str = str(self.distance)
+		self.abbreviation = self._str = str(self.distance)
 		global mileages
 		mileages.add(self)
 
 		super().played(player, playee)
 
 class RightOfWay(Safety):
-	abbreviation = "ROfWay"
+	abbreviation_6 = "ROfWay"
 class PunctureProof(Safety):
-	abbreviation = "PProof"
+	abbreviation_6 = "PProof"
 class ExtraTank(Safety):
-	abbreviation = "ExTank"
+	abbreviation_6 = "ExTank"
 class DrivingAce(Safety):
-	abbreviation = "DriAce"
+	abbreviation_6 = "DriAce"
 
 
 class Hazard(Card):
 			setattr(self, attr, unpickle_pile(state[attr]))
 
 	def draw(self, card=None):
-		assert len(self.cards) < 7
+		assert len(self.cards) <= 7
 		if not self.hand.deck:
 			return None
 
 		limit = 1000 if self.hand.extended else 700
 		mileage_so_far = self.mileage()
 		maxed_out_200s = self.two_hundreds() == 2
-		debug("cards", self.cards)
+		debug("cards", " ".join([card.abbreviation for card in self.cards]))
 		debug("limit", limit, "mileage", mileage, "maxed_out_200s", maxed_out_200s)
 		for card in self.cards:
 			if card in self.discardables:
 			debug("[:] we need", needed, "but they're all gone.")
 			coup_fouree_impossible_for(needed.safety)
 
-
-
-
 		super().turn()
 
 
 def safeties_repr(player, highlights=()):
 	array = []
 	for card in sorted(player.safeties, reverse=True):
-		s = card.abbreviation
+		s = card.abbreviation_6
 		if card in player.coup_fourres:
 			s = s.upper()
 		if card in highlights:
 		for card in line:
 			count = game.hand.cards_seen[card]
 			total = game.hand.cards_total[card]
-			s = card.shorthand.rjust(width) + " " + str(count).rjust(2)
+			s = card.abbreviation.rjust(width) + " " + str(count).rjust(2)
 			if not isinstance(card, Safety):
 				s += "/" + str(total).ljust(2)
 			result.append(s)
 				highlight_line.append(" " * 9)
 
 			field1 = ("[" + str(i) + "]").rjust(9)
-			field2 = (card.shorthand).rjust(9)
+			field2 = (card.abbreviation).rjust(9)
 
 			line1.append(before)
 			line1.append(field1)