Mercurial > pyntnclick
comparison gamelib/scenes/scene_widgets.py @ 242:12c4f87ea424
Unify doors a bit
author | Neil Muller <neil@dip.sun.ac.za> |
---|---|
date | Fri, 27 Aug 2010 11:32:49 +0200 |
parents | |
children | dfc89bc64fdb |
comparison
equal
deleted
inserted
replaced
241:b1451b0b906f | 242:12c4f87ea424 |
---|---|
1 """Generic, game specific widgets""" | |
2 | |
3 import random | |
4 | |
5 from gamelib.state import Thing, Result | |
6 | |
7 | |
8 class Door(Thing): | |
9 """A door somewhere""" | |
10 | |
11 DEST = "map" | |
12 | |
13 def is_interactive(self): | |
14 return True | |
15 | |
16 def interact_without(self): | |
17 """Go to map.""" | |
18 self.state.set_current_scene("map") | |
19 | |
20 def get_description(self): | |
21 return 'An open doorway leads to the rest of the ship.' | |
22 | |
23 def interact_default(self, item): | |
24 return Result(random.choice([ | |
25 "Sadly, this isn't that sort of game.", | |
26 "Your valiant efforts are foiled by the Evil Game Designer.", | |
27 "Waving that in the doorway does nothing. Try something else, perhaps?", | |
28 ])) | |
29 |