Mercurial > boomslang
comparison gamelib/scenes/bridge.py @ 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 | b0add10f7556 |
children | 12c4f87ea424 |
comparison
equal
deleted
inserted
replaced
236:f82f017db104 | 237:ae01c10497b3 |
---|---|
1 """Bridge where the final showdown with the AI occurs.""" | 1 """Bridge where the final showdown with the AI occurs.""" |
2 | 2 |
3 from gamelib.cursor import CursorSprite | 3 from gamelib.cursor import CursorSprite |
4 from gamelib.state import Scene, Item, Thing, Result, InteractText, \ | 4 from gamelib.state import Scene, Item, Thing, Result, InteractText, \ |
5 InteractNoImage, InteractRectUnion | 5 InteractNoImage, InteractRectUnion |
6 from gamelib.statehelpers import GenericDescThing | |
6 | 7 |
7 class Bridge(Scene): | 8 class Bridge(Scene): |
8 | 9 |
9 FOLDER = "bridge" | 10 FOLDER = "bridge" |
10 BACKGROUND = 'bridge.png' | 11 BACKGROUND = 'bridge.png' |
18 self.add_item(Superconductor('superconductor')) | 19 self.add_item(Superconductor('superconductor')) |
19 self.add_item(Stethoscope('stethoscope')) | 20 self.add_item(Stethoscope('stethoscope')) |
20 self.add_thing(ToMap()) | 21 self.add_thing(ToMap()) |
21 self.add_thing(MassageChair()) | 22 self.add_thing(MassageChair()) |
22 self.add_thing(StethoscopeThing()) | 23 self.add_thing(StethoscopeThing()) |
24 self.add_thing(BridgeComputer()) | |
23 | 25 |
24 def enter(self): | 26 def enter(self): |
25 return Result("The bridge is in a sorry, shabby state") | 27 return Result("The bridge is in a sorry, shabby state") |
26 | 28 |
27 | 29 |
38 INITIAL = "door" | 40 INITIAL = "door" |
39 | 41 |
40 def interact_without(self): | 42 def interact_without(self): |
41 """Go to map.""" | 43 """Go to map.""" |
42 self.state.set_current_scene("map") | 44 self.state.set_current_scene("map") |
45 | |
46 | |
47 class BridgeComputer(Thing): | |
48 """The bridge computer. Gives status updates""" | |
49 | |
50 NAME = "bridge.comp" | |
51 | |
52 INTERACTS = { | |
53 'screen' : InteractNoImage(338, 296, 123, 74), | |
54 } | |
55 | |
56 INITIAL = 'screen' | |
57 | |
58 def interact_without(self): | |
59 return Result(detail_view='bridge_comp_detail') | |
60 | |
61 def interact_with_titanium_leg(self): | |
62 return Result("You can't break the duraplastic screen.") | |
63 | |
64 def interact_with_machete(self): | |
65 return Result("Scratching the screen won't help you.") | |
66 | |
67 def get_description(self): | |
68 return "The main bridge computer screen." | |
43 | 69 |
44 | 70 |
45 class MassageChair(Thing): | 71 class MassageChair(Thing): |
46 "The captain's massage chair, contains superconductor" | 72 "The captain's massage chair, contains superconductor" |
47 | 73 |
131 | 157 |
132 def __init__(self, state): | 158 def __init__(self, state): |
133 super(ChairDetail, self).__init__(state) | 159 super(ChairDetail, self).__init__(state) |
134 self.add_thing(SuperconductorThing()) | 160 self.add_thing(SuperconductorThing()) |
135 | 161 |
162 class BridgeCompDetail(Scene): | |
163 | |
164 FOLDER = 'bridge' | |
165 BACKGROUND = 'comp_detail_1.png' | |
166 NAME = 'bridge_comp_detail' | |
167 | |
168 SIZE = (300, 300) | |
169 | |
170 def __init__(self, state): | |
171 super(BridgeCompDetail, self).__init__(state) | |
172 | |
136 | 173 |
137 SCENES = [Bridge] | 174 SCENES = [Bridge] |
138 DETAIL_VIEWS = [ChairDetail] | 175 DETAIL_VIEWS = [ChairDetail, BridgeCompDetail] |