comparison gamelib/scenes/machine.py @ 151:d00aa26941c4

Add machine and engine rooms to map. Fix typo in name of mess hall doorway thing.
author Simon Cross <hodgestar+bzr@gmail.com>
date Tue, 24 Aug 2010 23:38:04 +0200
parents 2e2f6ff54780
children 30f2308c1efc
comparison
equal deleted inserted replaced
150:5e5d71e40e54 151:d00aa26941c4
1 """Machine room where tools and machines are found.""" 1 """Machine room where tools and machines are found."""
2 2
3 from gamelib.state import Scene, Item, Thing 3 from gamelib.state import Scene, Item, Thing, InteractText, Result
4 4
5 5
6 class Machine(Scene): 6 class Machine(Scene):
7 7
8 FOLDER = "machine" 8 FOLDER = "machine"
9 BACKGROUND = None # TODO 9 BACKGROUND = None # TODO
10 10
11 INITIAL_DATA = { 11 INITIAL_DATA = {
12 'accessible': False, 12 'accessible': True,
13 } 13 }
14
15 def __init__(self, state):
16 super(Machine, self).__init__(state)
17 self.add_thing(ToMap())
18
19 def enter(self):
20 return Result("The machine room is dark and forbidding.")
21
22
23 class ToMap(Thing):
24 "Way to map."
25
26 NAME = "machine.tomap"
27 DEST = "map"
28
29 INTERACTS = {
30 "door": InteractText(100, 200, "To Map"),
31 }
32
33 INITIAL = "door"
34
35 def interact_without(self):
36 """Go to map."""
37 self.state.set_current_scene("map")
14 38
15 39
16 SCENES = [Machine] 40 SCENES = [Machine]