242
|
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
|