diff gamelib/gamestate.py @ 224:e4f9513c9dd0

Include mission name in the results
author Neil Muller <drnlmuller@gmail.com>
date Sat, 12 May 2012 22:33:05 +0200
parents bf92c982996e
children
line wrap: on
line diff
--- a/gamelib/gamestate.py	Sat May 12 21:28:43 2012 +0200
+++ b/gamelib/gamestate.py	Sat May 12 22:33:05 2012 +0200
@@ -94,7 +94,8 @@
         # Attempt the missions
         mission_results = []
         for mission, equipment in self.cur_missions:
-            mission_results.append(mission.attempt_mission(equipment, self))
+            mission_results.append((mission.NAME,
+                mission.attempt_mission(equipment, self)))
         if not self.cur_missions and self.reputation > 0:
             # If you're not doing stuff, you're not in the news
             self.reputation -= M_VALS[self.milestone]
@@ -104,9 +105,9 @@
             raise RuntimeError('Spent too many points')
         # Process mission results
         messages = []
-        for result in mission_results:
+        for miss, result in mission_results:
             result.apply(self)
-            messages.append((result.outcome, result.text, result.loot))
+            messages.append((miss, result.outcome, result.text, result.loot))
         # Missions may give us science breakthroughs, so handle this after
         # mission results
         new_stuff = self.lab.spend_points(self.cur_allocation, self.points)
@@ -114,7 +115,7 @@
         self.minions = 0
         for science in new_stuff:
             # FIXME: Update UI better.
-            messages.append((INFO, "SCIENCE breakthrough!", {
+            messages.append((None, INFO, "SCIENCE breakthrough!", {
                         science.SCIENCE_TYPE: science}))
         return messages