Mercurial > pyntnclick
comparison 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 |
comparison
equal
deleted
inserted
replaced
763:afe7b1cb16c0 | 764:a8510f4e2ea1 |
---|---|
1 """Crew quarters.""" | 1 """Crew quarters.""" |
2 | 2 |
3 from pyntnclick.cursor import CursorSprite | 3 from pyntnclick.cursor import CursorSprite |
4 from pyntnclick.state import Scene, Item, Thing, Result | 4 from pyntnclick.state import Scene, Item, Thing, Result |
5 from pyntnclick.scenewidgets import (InteractNoImage, InteractImage, | 5 from pyntnclick.scenewidgets import ( |
6 InteractAnimated, GenericDescThing) | 6 InteractNoImage, InteractImage, InteractAnimated, GenericDescThing, |
7 TakeableThing) | |
7 | 8 |
8 from gamelib.scenes.game_constants import PLAYER_ID | 9 from gamelib.scenes.game_constants import PLAYER_ID |
9 from gamelib.scenes.game_widgets import Door, BaseCamera, make_jim_dialog | 10 from gamelib.scenes.game_widgets import Door, BaseCamera, make_jim_dialog |
10 | 11 |
11 | 12 |
185 'camera_medium_gray.png'), | 186 'camera_medium_gray.png'), |
186 15), | 187 15), |
187 } | 188 } |
188 | 189 |
189 | 190 |
190 class PosterThing(Thing): | 191 class PosterThing(TakeableThing): |
191 "A innocent poster on the wall" | 192 "A innocent poster on the wall" |
192 | 193 |
193 NAME = 'crew.poster' | 194 NAME = 'crew.poster' |
194 | 195 |
195 INTERACTS = { | 196 INTERACTS = { |
196 'poster': InteractImage(29, 166, 'triangle_poster.png'), | 197 'poster': InteractImage(29, 166, 'triangle_poster.png'), |
197 } | 198 } |
198 | 199 |
199 INITIAL = 'poster' | 200 INITIAL = 'poster' |
201 ITEM = 'escher_poster' | |
200 | 202 |
201 def interact_without(self): | 203 def interact_without(self): |
202 self.game.add_inventory_item('escher_poster') | 204 self.take() |
203 self.scene.remove_thing(self) | |
204 return Result("This poster will go nicely on your bedroom wall.") | 205 return Result("This poster will go nicely on your bedroom wall.") |
205 | 206 |
206 def get_description(self): | 207 def get_description(self): |
207 return "A paradoxical poster hangs below the security camera." | 208 return "A paradoxical poster hangs below the security camera." |
208 | 209 |