Mercurial > pyntnclick
comparison gamelib/scenes/crew_quarters.py @ 288:13b6fbfb39aa
Plotting in the crew quarters.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 28 Aug 2010 00:03:54 +0200 |
parents | 2a11709cb427 |
children | 6d93e04036c9 |
comparison
equal
deleted
inserted
replaced
287:2a11709cb427 | 288:13b6fbfb39aa |
---|---|
20 def __init__(self, state): | 20 def __init__(self, state): |
21 super(CrewQuarters, self).__init__(state) | 21 super(CrewQuarters, self).__init__(state) |
22 self.add_thing(ToMap()) | 22 self.add_thing(ToMap()) |
23 self.add_thing(Safe()) | 23 self.add_thing(Safe()) |
24 self.add_thing(FishbowlThing()) | 24 self.add_thing(FishbowlThing()) |
25 self.add_thing(Safe()) | |
25 self.add_item(Fishbowl('fishbowl')) | 26 self.add_item(Fishbowl('fishbowl')) |
27 self.add_item(DuctTape('duct_tape')) | |
26 self.add_thing(GenericDescThing('crew.plant', 1, | 28 self.add_thing(GenericDescThing('crew.plant', 1, |
27 "The plant is doing surprisingly well for centuries of neglect", | 29 "The plant is doing surprisingly well for centuries of neglect", |
28 ((624, 215, 61, 108),))) | 30 ((624, 215, 61, 108),))) |
29 self.add_thing(GenericDescThing('crew.cat', 2, | 31 self.add_thing(GenericDescThing('crew.cat', 2, |
30 "A picture of a cat labelled 'Clementine'", | 32 "A picture of a cat labelled 'Clementine'", |
50 | 52 |
51 NAME = 'crew.safe' | 53 NAME = 'crew.safe' |
52 | 54 |
53 INTERACTS = { | 55 INTERACTS = { |
54 'safe': InteractNoImage(447, 238, 72, 73), | 56 'safe': InteractNoImage(447, 238, 72, 73), |
57 'full_safe': InteractImage(445, 227, 'open_safe_full.png'), | |
58 'empty_safe': InteractImage(445, 227, 'open_safe_empty.png'), | |
55 } | 59 } |
56 | 60 |
57 INITIAL = 'safe' | 61 INITIAL = 'safe' |
58 | 62 |
59 INITIAL_DATA = { | 63 INITIAL_DATA = { |
60 'is_cracked': False, | 64 'is_cracked': False, |
65 'has_tape': True, | |
61 } | 66 } |
62 | 67 |
63 def interact_without(self): | 68 def interact_without(self): |
64 if self.get_data('is_cracked'): | 69 if self.get_data('is_cracked'): |
65 return Result(detail_view='safe_detail') | 70 if self.get_data('has_tape'): |
66 return Result("The safe is locked. This might be an interesting" | 71 self.set_data('has_tape', False) |
67 " challenge, if suitable equipment can be found.") | 72 self.state.add_inventory_item('duct_tape') |
73 self.set_interact('empty_safe') | |
74 return Result("Duct tape. It'll stick to everything except " | |
75 "ducts, apparently.") | |
76 return Result("The perfactly balanced door swings frictionlessly " | |
77 "to and fro. What craftsmanship!") | |
78 return Result("The safe is locked. This might be an interesting " | |
79 "challenge, if suitable equipment can be found.") | |
68 | 80 |
69 def interact_with_stethoscope(self, item): | 81 def interact_with_stethoscope(self, item): |
70 if self.get_data('is_cracked'): | 82 if self.get_data('is_cracked'): |
71 return Result("It's already unlocked. There's no more challenge.") | 83 return Result("It's already unlocked. There's no more challenge.") |
72 # TODO: Add years to the sentence for safecracking. | 84 # TODO: Add years to the sentence for safecracking. |
73 # TODO: Wax lyrical some more about safecracking. | 85 # TODO: Wax lyrical some more about safecracking. |
86 self.set_data('is_cracked', True) | |
87 self.set_interact('full_safe') | |
74 return Result("Even after centuries of neglect, the tumblers slide" | 88 return Result("Even after centuries of neglect, the tumblers slide" |
75 " almost silently into place. Turns out the combination" | 89 " almost silently into place. Turns out the combination" |
76 " was '1 2 3 4 5'. An idiot must keep his luggage in" | 90 " was '1 2 3 4 5'. An idiot must keep his luggage in" |
77 " here.") | 91 " here.") |
78 | 92 |
114 | 128 |
115 INVENTORY_IMAGE = 'fishbowl.png' | 129 INVENTORY_IMAGE = 'fishbowl.png' |
116 CURSOR = CursorSprite('fishbowl.png', 29, 27) | 130 CURSOR = CursorSprite('fishbowl.png', 29, 27) |
117 | 131 |
118 | 132 |
133 class DuctTape(Item): | |
134 "A bowl. Sans fish." | |
135 | |
136 INVENTORY_IMAGE = 'duct_tape.png' | |
137 CURSOR = CursorSprite('duct_tape.png', 29, 27) | |
138 | |
139 | |
119 class SafeDetail(Scene): | 140 class SafeDetail(Scene): |
120 | 141 |
121 FOLDER = 'crew_quarters' | 142 FOLDER = 'crew_quarters' |
122 BACKGROUND = None # TODO | 143 BACKGROUND = None # TODO |
123 NAME = 'safe_detail' | 144 NAME = 'safe_detail' |