Greg Althaus avatar Greg Althaus committed 08b2c14

(Alexander) Cherry picked a change from gregs changeset 0b42825a6e81.

Comments (0)

Files changed (1)

domination/cards/prosperity.py

     desc = _("When you play this, reveal cards from your deck until you reveal a treasure. Discard it or trash it. Discard the other cards.")
 
     def activate_action(self, game, player):
-        found_treasure = []
+        found_treasure = None
         to_be_discarded = []
         while True:
             ret = player.draw_cards(1)
             for info_player in game.participants:
                 yield InfoRequest(game, info_player, _("%s reveals:", (player.name, )), [card])
             if isinstance(card, TreasureCard):
-                found_treasure.append(card)
+                found_treasure = card
                 break
             else:
                 to_be_discarded.append(card)
         player.discard_pile.extend(to_be_discarded)
-        if (yield YesNoQuestion(game, player,
-            _("Do you want to trash your Treasure?"))): #FIXME show which treasure was found, and ask trash/discard instead of yes/no
-            found_treasure.trash(game, player)
-        else:
-            player.discard_pile.extend(to_be_discarded)
+        if found_treasure is not None:
+            if (yield YesNoQuestion(game, player,
+                _("Do you want to trash your Treasure?"))): #FIXME show which treasure was found, and ask trash/discard instead of yes/no
+                found_treasure.trash(game, player)
+            else:
+                player.discard_pile.append(found_treasure)
 
 class Watchtower(ReactionCard):
     name = _("Watchtower")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.