changeset 237:ae01c10497b3

Start work on bridge comp detail
author Neil Muller <neil@dip.sun.ac.za>
date Fri, 27 Aug 2010 09:06:20 +0200
parents f82f017db104
children 2510e0b0e901
files Resources/images/bridge/comp_detail_1.png gamelib/scenes/bridge.py
diffstat 2 files changed, 38 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
Binary file Resources/images/bridge/comp_detail_1.png has changed
--- a/gamelib/scenes/bridge.py	Fri Aug 27 09:06:06 2010 +0200
+++ b/gamelib/scenes/bridge.py	Fri Aug 27 09:06:20 2010 +0200
@@ -3,6 +3,7 @@
 from gamelib.cursor import CursorSprite
 from gamelib.state import Scene, Item, Thing, Result, InteractText, \
                           InteractNoImage, InteractRectUnion
+from gamelib.statehelpers import GenericDescThing
 
 class Bridge(Scene):
 
@@ -20,6 +21,7 @@
         self.add_thing(ToMap())
         self.add_thing(MassageChair())
         self.add_thing(StethoscopeThing())
+        self.add_thing(BridgeComputer())
 
     def enter(self):
         return Result("The bridge is in a sorry, shabby state")
@@ -42,6 +44,30 @@
         self.state.set_current_scene("map")
 
 
+class BridgeComputer(Thing):
+    """The bridge computer. Gives status updates"""
+
+    NAME = "bridge.comp"
+
+    INTERACTS = {
+        'screen' : InteractNoImage(338, 296, 123, 74),
+    }
+
+    INITIAL = 'screen'
+
+    def interact_without(self):
+        return Result(detail_view='bridge_comp_detail')
+
+    def interact_with_titanium_leg(self):
+        return Result("You can't break the duraplastic screen.")
+
+    def interact_with_machete(self):
+        return Result("Scratching the screen won't help you.")
+
+    def get_description(self):
+        return "The main bridge computer screen."
+
+
 class MassageChair(Thing):
     "The captain's massage chair, contains superconductor"
 
@@ -133,6 +159,17 @@
         super(ChairDetail, self).__init__(state)
         self.add_thing(SuperconductorThing())
 
+class BridgeCompDetail(Scene):
+
+    FOLDER = 'bridge'
+    BACKGROUND = 'comp_detail_1.png'
+    NAME = 'bridge_comp_detail'
+
+    SIZE = (300, 300)
+
+    def __init__(self, state):
+        super(BridgeCompDetail, self).__init__(state)
+
 
 SCENES = [Bridge]
-DETAIL_VIEWS = [ChairDetail]
+DETAIL_VIEWS = [ChairDetail, BridgeCompDetail]