comparison gamelib/scenes/crew_quarters.py @ 359:6b94f549443b

JIM comments on safe opening, if able
author Neil Muller <neil@dip.sun.ac.za>
date Sat, 28 Aug 2010 16:36:38 +0200
parents bfb6c682b4fb
children 452230d78541
comparison
equal deleted inserted replaced
358:760f6a318d2e 359:6b94f549443b
1 """Crew quarters.""" 1 """Crew quarters."""
2 2
3 from gamelib.cursor import CursorSprite 3 from gamelib.cursor import CursorSprite
4 from gamelib.state import Scene, Item, Thing, Result 4 from gamelib.state import Scene, Item, Thing, Result
5
6 from gamelib.scenes.game_constants import PLAYER_ID
5 from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage, 7 from gamelib.scenes.scene_widgets import (Door, InteractText, InteractNoImage,
6 InteractRectUnion, InteractImage, 8 InteractRectUnion, InteractImage,
7 InteractAnimated, GenericDescThing, 9 InteractAnimated, GenericDescThing,
8 BaseCamera) 10 BaseCamera)
9 11
21 def __init__(self, state): 23 def __init__(self, state):
22 super(CrewQuarters, self).__init__(state) 24 super(CrewQuarters, self).__init__(state)
23 self.add_thing(ToMap()) 25 self.add_thing(ToMap())
24 self.add_thing(Safe()) 26 self.add_thing(Safe())
25 self.add_thing(FishbowlThing()) 27 self.add_thing(FishbowlThing())
26 self.add_thing(Safe())
27 self.add_item(Fishbowl('fishbowl')) 28 self.add_item(Fishbowl('fishbowl'))
28 self.add_item(DuctTape('duct_tape')) 29 self.add_item(DuctTape('duct_tape'))
29 self.add_item(EscherPoster('escher_poster')) 30 self.add_item(EscherPoster('escher_poster'))
30 self.add_thing(PosterThing()) 31 self.add_thing(PosterThing())
31 self.add_thing(MonitorCamera()) 32 self.add_thing(MonitorCamera())
84 return Result("It's already unlocked. There's no more challenge.") 85 return Result("It's already unlocked. There's no more challenge.")
85 # TODO: Add years to the sentence for safecracking. 86 # TODO: Add years to the sentence for safecracking.
86 # TODO: Wax lyrical some more about safecracking. 87 # TODO: Wax lyrical some more about safecracking.
87 self.set_data('is_cracked', True) 88 self.set_data('is_cracked', True)
88 self.set_interact('full_safe') 89 self.set_interact('full_safe')
89 return Result("Even after centuries of neglect, the tumblers slide" 90 open_result = Result("Even after centuries of neglect, the tumblers slide"
90 " almost silently into place. Turns out the combination" 91 " almost silently into place. Turns out the combination"
91 " was '1 2 3 4 5'. An idiot must keep his luggage in" 92 " was '1 2 3 4 5'. An idiot must keep his luggage in"
92 " here.") 93 " here.")
94 if self.state.scenes['bridge'].get_data('ai status') == 'online':
95 return open_result, Result("JIM says: 'Prisoner %s, you have been observed commiting a felony violation. "
96 "This will go onto your permenant record, and your sentence may be extended by up to twenty years."
97 % PLAYER_ID, style="JIM")
98 else:
99 return open_result
93 100
94 def get_description(self): 101 def get_description(self):
95 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure." 102 return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but reasonably secure."
96 103
97 104