comparison gamelib/scenes/machine.py @ 281:eb3cfcaff469

Too long since last commit. Felt like showing off some machine room progress.
author Simon Cross <hodgestar+bzr@gmail.com>
date Fri, 27 Aug 2010 23:01:17 +0200
parents 3b4a78422201
children 3ac2e025478f
comparison
equal deleted inserted replaced
280:d9b19449436f 281:eb3cfcaff469
18 18
19 def __init__(self, state): 19 def __init__(self, state):
20 super(Machine, self).__init__(state) 20 super(Machine, self).__init__(state)
21 self.add_thing(ToMap()) 21 self.add_thing(ToMap())
22 self.add_thing(LaserWelder()) 22 self.add_thing(LaserWelder())
23 self.add_thing(LaserWelderPowerLights())
23 self.add_thing(Grinder()) 24 self.add_thing(Grinder())
24 self.add_item(TitaniumMachete('machete')) 25 self.add_item(TitaniumMachete('machete'))
25 self.add_item(TinPipe('tin_pipe')) 26 self.add_item(TinPipe('tin_pipe'))
26 27
27 def enter(self): 28 def enter(self):
36 "door": InteractNoImage(695, 350, 97, 212), 37 "door": InteractNoImage(695, 350, 97, 212),
37 } 38 }
38 39
39 INITIAL = "door" 40 INITIAL = "door"
40 41
42 # welder.slot: 249, 324, 167, 51
43 # welder.button: 406, 389, 28, 31
44 # welder.power lights: 201, 278, 16, 170
45 # manual: 434, 496, 66, 34
46
47 # broken power socket: 160, 28, 68, 51
48 # working power socket: 587, 23, 82, 50
49 # poster: 706, 157, 76, 158
50
51 # drill press block: 461, 446, 38, 27
52 # drill press:
53 #Rect 0 :
54 # (519, 338, 36, 63),
55 # (545, 348, 93, 46),
56 # (599, 309, 41, 150),
57 # (588, 445, 66, 42),
58 # (616, 479, 41, 14),
59 # (527, 393, 15, 17),
60 # (510, 360, 13, 11),
61 # (532, 331, 14, 11),
62 # (605, 304, 26, 8),
41 63
42 class LaserWelder(Thing): 64 class LaserWelder(Thing):
43 65
44 NAME = "machine.laser_welder" 66 NAME = "machine.laser_welder"
45 67
91 elif self.get_data('cans_in_place') == 3: 113 elif self.get_data('cans_in_place') == 3:
92 msg += " It currently contains three empty cans." 114 msg += " It currently contains three empty cans."
93 return msg 115 return msg
94 116
95 117
118 class LaserWelderPowerLights(Thing):
119
120 NAME = "machine.welder.lights"
121
122 INTERACTS = {
123 "lights": InteractAnimated(199, 273, ["power_lights_%d.png" % i for i in range(8) + range(6,0,-1)], 10)
124 }
125
126 INITIAL = 'lights'
127
128 def get_description(self):
129 return random.choice([
130 "The power lights pulse expectantly.",
131 ])
132
133
96 class TinPipe(Item): 134 class TinPipe(Item):
97 "A pipe made out of welded-together tins." 135 "A pipe made out of welded-together tins."
98 136
99 INVENTORY_IMAGE = "tube_fragments.png" 137 INVENTORY_IMAGE = "tube_fragments.png"
100 CURSOR = CursorSprite('tube_fragments_cursor.png', 36, 3) 138 CURSOR = CursorSprite('tube_fragments_cursor.png', 36, 3)
104 class Grinder(Thing): 142 class Grinder(Thing):
105 143
106 NAME = "machine.grinder" 144 NAME = "machine.grinder"
107 145
108 INTERACTS = { 146 INTERACTS = {
109 "grind": InteractText(200, 300, "Grinder"), 147 "grind": InteractNoImage(86, 402, 94, 63),
110 } 148 }
111 149
112 INITIAL = "grind" 150 INITIAL = "grind"
113 151
114 def interact_without(self): 152 def interact_without(self):