Mercurial > pyntnclick
annotate gamelib/scenes/crew_quarters.py @ 764:a8510f4e2ea1 pyntnclick
Conditionally add things based on state.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 26 Jan 2013 15:24:56 +0200 |
parents | 386475464202 |
children | a35f5364437d |
rev | line source |
---|---|
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
1 """Crew quarters.""" |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
2 |
549 | 3 from pyntnclick.cursor import CursorSprite |
4 from pyntnclick.state import Scene, Item, Thing, Result | |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
5 from pyntnclick.scenewidgets import ( |
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
6 InteractNoImage, InteractImage, InteractAnimated, GenericDescThing, |
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
7 TakeableThing) |
359
6b94f549443b
JIM comments on safe opening, if able
Neil Muller <neil@dip.sun.ac.za>
parents:
355
diff
changeset
|
8 |
6b94f549443b
JIM comments on safe opening, if able
Neil Muller <neil@dip.sun.ac.za>
parents:
355
diff
changeset
|
9 from gamelib.scenes.game_constants import PLAYER_ID |
525
821b322e903b
Separate "scene widgets" from "game-specific widgets".
Jeremy Thurgood <firxen@gmail.com>
parents:
491
diff
changeset
|
10 from gamelib.scenes.game_widgets import Door, BaseCamera, make_jim_dialog |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
11 |
541 | 12 |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
13 class CrewQuarters(Scene): |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
14 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
15 FOLDER = "crew_quarters" |
275
d78ce15bccc8
Crew quarters background and toolbar on the rect tool.
Jeremy Thurgood <firxen@gmail.com>
parents:
263
diff
changeset
|
16 BACKGROUND = "crew_quarters.png" |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
17 |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
18 OFFSET = (0, -50) |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
19 |
592
4e9178215e75
Introduce .setup() for GameDeveloperGizmos.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
549
diff
changeset
|
20 def setup(self): |
242 | 21 self.add_thing(ToMap()) |
287
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
22 self.add_thing(Safe()) |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
23 self.add_thing(FishbowlThing()) |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
24 self.add_item(Fishbowl('fishbowl')) |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
25 self.add_item(DuctTape('duct_tape')) |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
26 self.add_item(EscherPoster('escher_poster')) |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
27 self.add_thing(PosterThing()) |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
28 self.add_thing(MonitorCamera()) |
287
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
29 self.add_thing(GenericDescThing('crew.plant', 1, |
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
30 "The plant is doing surprisingly well for centuries of neglect", |
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
31 ((624, 215, 61, 108),))) |
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
32 self.add_thing(GenericDescThing('crew.cat', 2, |
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
33 "A picture of a cat labelled 'Clementine'", |
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
34 ((722, 382, 66, 72),))) |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
35 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
36 |
242 | 37 class ToMap(Door): |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
38 |
355
bfb6c682b4fb
Updated walkthrough test as far as completed environmental puzzle.
Jeremy Thurgood <firxen@gmail.com>
parents:
350
diff
changeset
|
39 SCENE = "crew_quarters" |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
40 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
41 INTERACTS = { |
287
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
42 "door": InteractNoImage(233, 252, 125, 181), |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
43 } |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
44 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
45 INITIAL = "door" |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
46 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
47 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
48 class Safe(Thing): |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
49 "A safe, for keeping things safe." |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
50 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
51 NAME = 'crew.safe' |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
52 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
53 INTERACTS = { |
287
2a11709cb427
Hook up a few things in the crew quarters
Neil Muller <neil@dip.sun.ac.za>
parents:
283
diff
changeset
|
54 'safe': InteractNoImage(447, 238, 72, 73), |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
55 'full_safe': InteractImage(445, 227, 'open_safe_full.png'), |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
56 'empty_safe': InteractImage(445, 227, 'open_safe_empty.png'), |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
57 } |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
58 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
59 INITIAL = 'safe' |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
60 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
61 INITIAL_DATA = { |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
62 'is_cracked': False, |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
63 'has_tape': True, |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
64 } |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
65 |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
66 def select_interact(self): |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
67 if self.get_data('is_cracked'): |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
68 if self.get_data('has_tape'): |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
69 return 'full_safe' |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
70 return 'empty_safe' |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
71 return self.INITIAL |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
72 |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
73 def interact_without(self): |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
74 if self.get_data('is_cracked'): |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
75 if self.get_data('has_tape'): |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
76 self.set_data('has_tape', False) |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
592
diff
changeset
|
77 self.game.add_inventory_item('duct_tape') |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
78 self.set_interact() |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
79 return Result("Duct tape. It'll stick to everything except " |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
80 "ducts, apparently.") |
368 | 81 return Result("The perfectly balanced door swings frictionlessly " |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
82 "to and fro. What craftsmanship!") |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
83 return Result("The safe is locked. This might be an interesting " |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
84 "challenge, if suitable equipment can be found.") |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
85 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
86 def interact_with_stethoscope(self, item): |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
87 if self.get_data('is_cracked'): |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
88 return Result("It's already unlocked. There's no more challenge.") |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
89 # TODO: Add years to the sentence for safecracking. |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
90 # TODO: Wax lyrical some more about safecracking. |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
91 self.set_data('is_cracked', True) |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
92 self.set_interact() |
362
4e939b3c73f8
Allow Nones in list of results
Neil Muller <neil@dip.sun.ac.za>
parents:
360
diff
changeset
|
93 return (Result("Even after centuries of neglect, the tumblers slide" |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
94 " almost silently into place. Turns out the combination" |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
95 " was '1 2 3 4 5'. An idiot must keep his luggage in" |
362
4e939b3c73f8
Allow Nones in list of results
Neil Muller <neil@dip.sun.ac.za>
parents:
360
diff
changeset
|
96 " here."), |
541 | 97 make_jim_dialog("Prisoner %s, you have been observed" |
98 " committing a felony violation. This will go onto" | |
99 " your permanent record, and your sentence may be" | |
100 " extended by up to twenty years." | |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
592
diff
changeset
|
101 % PLAYER_ID, self.game)) |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
102 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
103 def get_description(self): |
541 | 104 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but" \ |
105 " reasonably secure." | |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
106 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
107 |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
108 class FishbowlThing(Thing): |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
109 "A safe, for keeping things safe." |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
110 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
111 NAME = 'crew.fishbowl' |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
112 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
113 INTERACTS = { |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
114 'fishbowl': InteractImage(356, 495, 'fishbowl_on_table.png'), |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
115 'fish_no_bowl': InteractImage(372, 517, 'fish_minus_bowl.png'), |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
116 } |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
117 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
118 INITIAL = 'fishbowl' |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
119 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
120 INITIAL_DATA = { |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
121 'has_bowl': True, |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
122 } |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
123 |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
124 def select_interact(self): |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
125 if not self.get_data('has_bowl'): |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
126 return 'fish_no_bowl' |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
127 return self.INITIAL |
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
128 |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
129 def interact_without(self): |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
130 if not self.get_data('has_bowl'): |
541 | 131 return Result("What's the point of lugging around a very dead" |
132 " fish and a kilogram or so of sand?") | |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
133 self.set_data('has_bowl', False) |
759
386475464202
Inspect game state for Thing.set_interact() instead of setting it manually everywhere.
Jeremy Thurgood <firxen@gmail.com>
parents:
603
diff
changeset
|
134 self.set_interact() |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
592
diff
changeset
|
135 self.game.add_inventory_item('fishbowl') |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
136 return Result("The fishbowl is useful, but its contents aren't.") |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
137 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
138 def get_description(self): |
485
5bd6bd3d42fa
Tweak description when fishbowl is taken
Neil Muller <neil@dip.sun.ac.za>
parents:
466
diff
changeset
|
139 if self.get_data('has_bowl'): |
541 | 140 return "This fishbowl looks exactly like an old science fiction" \ |
141 " space helmet." | |
485
5bd6bd3d42fa
Tweak description when fishbowl is taken
Neil Muller <neil@dip.sun.ac.za>
parents:
466
diff
changeset
|
142 else: |
541 | 143 return "An evicted dead fish and some sand lie forlornly on the" \ |
144 " table" | |
145 | |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
146 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
147 class Fishbowl(Item): |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
148 "A bowl. Sans fish." |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
149 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
150 INVENTORY_IMAGE = 'fishbowl.png' |
302
6d93e04036c9
CursorSprite: Default pointer-position to the centre of the cursor
Stefano Rivera <stefano@rivera.za.net>
parents:
288
diff
changeset
|
151 CURSOR = CursorSprite('fishbowl.png') |
342
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
152 NAME = "fishbowl" |
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
153 |
491
9f488671c02e
No more state in Item interacts.
Jeremy Thurgood <firxen@gmail.com>
parents:
485
diff
changeset
|
154 def interact_with_duct_tape(self, item): |
342
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
155 helmet = FishbowlHelmet('helmet') |
603
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
592
diff
changeset
|
156 self.game.add_item(helmet) |
3ce19d33b51f
Rename state to game to not cause confusion with the other state
Neil Muller <neil@dip.sun.ac.za>
parents:
592
diff
changeset
|
157 self.game.replace_inventory_item(self.name, helmet.name) |
342
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
158 return Result("You duct tape the edges of the helmet. The seal is" |
368 | 159 " crude, but it will serve as a workable helmet if needed.") |
342
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
160 |
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
161 |
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
162 class FishbowlHelmet(Item): |
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
163 "A bowl with duct-tape" |
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
164 |
541 | 165 INVENTORY_IMAGE = "fishbowl_helmet.png" |
342
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
166 CURSOR = CursorSprite('fishbowl_helmet.png') |
e1cae2b61443
Add duct_tape + fishbowl = helmet
Neil Muller <neil@dip.sun.ac.za>
parents:
302
diff
changeset
|
167 NAME = "helmet" |
283
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
168 |
3ac2e025478f
Fishbowl and laser lights that don't make the universe go away.
Jeremy Thurgood <firxen@gmail.com>
parents:
275
diff
changeset
|
169 |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
170 class DuctTape(Item): |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
171 "A bowl. Sans fish." |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
172 |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
173 INVENTORY_IMAGE = 'duct_tape.png' |
302
6d93e04036c9
CursorSprite: Default pointer-position to the centre of the cursor
Stefano Rivera <stefano@rivera.za.net>
parents:
288
diff
changeset
|
174 CURSOR = CursorSprite('duct_tape.png') |
288
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
175 |
13b6fbfb39aa
Plotting in the crew quarters.
Jeremy Thurgood <firxen@gmail.com>
parents:
287
diff
changeset
|
176 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
177 class MonitorCamera(BaseCamera): |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
178 "A Camera pointing to JIM" |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
179 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
180 NAME = 'crew.camera' |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
181 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
182 INTERACTS = { |
541 | 183 'online': InteractImage(85, 97, 'camera_medium.png'), |
464 | 184 'dead': InteractImage(85, 97, 'camera_medium_gray.png'), |
185 'looping': InteractAnimated(85, 97, ('camera_medium.png', | |
186 'camera_medium_gray.png'), | |
187 15), | |
188 } | |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
189 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
190 |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
191 class PosterThing(TakeableThing): |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
192 "A innocent poster on the wall" |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
193 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
194 NAME = 'crew.poster' |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
195 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
196 INTERACTS = { |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
197 'poster': InteractImage(29, 166, 'triangle_poster.png'), |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
198 } |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
199 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
200 INITIAL = 'poster' |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
201 ITEM = 'escher_poster' |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
202 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
203 def interact_without(self): |
764
a8510f4e2ea1
Conditionally add things based on state.
Jeremy Thurgood <firxen@gmail.com>
parents:
759
diff
changeset
|
204 self.take() |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
205 return Result("This poster will go nicely on your bedroom wall.") |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
206 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
207 def get_description(self): |
368 | 208 return "A paradoxical poster hangs below the security camera." |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
209 |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
210 |
350
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
211 class EscherPoster(Item): |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
212 "A confusing poster to disable JIM" |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
213 |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
214 INVENTORY_IMAGE = "triangle_poster.png" |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
215 CURSOR = CursorSprite('triangle_poster.png') |
125cb389ab90
Hook up poster. Add cameras to crew_quarters and bridge
Neil Muller <neil@dip.sun.ac.za>
parents:
342
diff
changeset
|
216 NAME = "escher_poster" |
233
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
217 |
7399b52f196f
Add a partial crew quarters (eighths?) implementation.
Jeremy Thurgood <firxen@gmail.com>
parents:
diff
changeset
|
218 |
241
b1451b0b906f
Link crew quarters to map.
Simon Cross <hodgestar+bzr@gmail.com>
parents:
233
diff
changeset
|
219 SCENES = [CrewQuarters] |