changeset 409:72baf5bfebc6

Support for partial fixed state (pending artwork)
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 28 Aug 2010 22:13:19 +0200
parents 308a433c4713
children fd1168a39700
files Resources/images/bridge/comp_alert_life_support_partial.png Resources/images/mess/replaced_tubes.png gamelib/scenes/bridge.py gamelib/scenes/mess.py sources/art/bridge_alert_base.xcf
diffstat 5 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
Binary file Resources/images/bridge/comp_alert_life_support_partial.png has changed
Binary file Resources/images/mess/replaced_tubes.png has changed
--- a/gamelib/scenes/bridge.py	Sat Aug 28 22:05:50 2010 +0200
+++ b/gamelib/scenes/bridge.py	Sat Aug 28 22:13:19 2010 +0200
@@ -503,6 +503,7 @@
             'ai offline' : 'comp_alert_ai_offline.png',
             'engine offline' : 'comp_alert_engine_offline.png',
             'life support' : 'comp_alert_life_support.png',
+            'life support partial' : 'comp_alert_life_support_partial.png',
             }
 
     # Point to start drawing changeable alerts
@@ -580,7 +581,7 @@
     def _get_nav_page(self):
         if not self.state.scenes['engine'].get_data('engine online'):
             return self._nav_messages['engine offline']
-        elif not self.state.scenes['mess'].get_data('life support online'):
+        elif not self.state.scenes['mess'].get_data('life support status') == 'fixed':
             return self._nav_messages['life support']
         else:
             for thing in self._nav_lines:
@@ -599,10 +600,12 @@
         if not self.state.scenes['engine'].get_data('engine online'):
             surface.blit(self._alert_messages['engine offline'], (xpos, ypos))
             ypos += self._alert_messages['engine offline'].get_size()[1] + self.ALERT_SPACING
-        if not self.state.scenes['mess'].get_data('life support online'):
+        if self.state.scenes['mess'].get_data('life support status') == 'broken':
             surface.blit(self._alert_messages['life support'], (xpos, ypos))
             ypos += self._alert_messages['life support'].get_size()[1] + self.ALERT_SPACING
-
+        if self.state.scenes['mess'].get_data('life support status') == 'replaced':
+            surface.blit(self._alert_messages['life support partial'], (xpos, ypos))
+            ypos += self._alert_messages['life support partial'].get_size()[1] + self.ALERT_SPACING
 
     def draw_things(self, surface):
         if self.get_data('tab') == 'alert':
--- a/gamelib/scenes/mess.py	Sat Aug 28 22:05:50 2010 +0200
+++ b/gamelib/scenes/mess.py	Sat Aug 28 22:13:19 2010 +0200
@@ -17,7 +17,7 @@
 
     INITIAL_DATA = {
         'accessible': True,
-        'life support online': False,
+        'life support status': 'broken', # broken, replaced, fixed
         }
 
     def __init__(self, state):
@@ -147,6 +147,7 @@
     INTERACTS = {
         "blocked": InteractImage(250, 130, "blocking_broccoli.png"),
         "broken": InteractImage(250, 183, "broken_tubes.png"),
+        "replaced": InteractImage(250, 183, "fixed_tubes.png"),
         "fixed": InteractImage(252, 183, "fixed_tubes.png"),
         }
 
@@ -189,7 +190,8 @@
         else:
             self.state.remove_inventory_item(item.name)
             self.set_data('status', 'replaced')
-            # TODO: An interact image for fixed but untaped pipes
+            self.set_interact("replaced")
+            self.scene.set_data('life support status', 'replaced')
             return Result(
                 "The pipes slot neatly into place, but don't make an airtight seal."
             )
@@ -203,7 +205,7 @@
             self.set_data("fixed", True)
             self.set_data("status", "fixed")
             self.set_interact("fixed")
-            self.scene.set_data('life support online', True)
+            self.scene.set_data('life support status', 'fixed')
             # TODO: A less anticlimactic climax?
             return Result("It takes quite a lot of tape, but eventually everything is"
                           " airtight and ready to hold pressure. Who'd've thought duct"
Binary file sources/art/bridge_alert_base.xcf has changed