Debian Codegraph @

CorsixTH/Lua/objects/machines/scanner.lua

raw
1 --[[ Copyright (c) 2009 Manuel König
2
3 Permission is hereby granted, free of charge, to any person obtaining a copy of
4 this software and associated documentation files (the "Software"), to deal in
5 the Software without restriction, including without limitation the rights to
6 use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
7 of the Software, and to permit persons to whom the Software is furnished to do
8 so, subject to the following conditions:
9
10 The above copyright notice and this permission notice shall be included in all
11 copies or substantial portions of the Software.
12
13 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 SOFTWARE. --]]
20
21 local object = {}
22 object.id = "scanner"
23 object.thob = 14
24 object.research_category = "diagnosis"
25 object.research_fallback = 36
26 object.name = _S.object.scanner
27 object.tooltip = _S.tooltip.objects.scanner
28 object.ticks = false
29 object.build_preview_animation = 920
30 object.default_strength = 12
31 object.crashed_animation = 3316
32 object.show_in_town_map = true
33 object.smoke_animation = 3428
34 local function copy_north_to_south(t)
35 t.south = t.north
36 return t
37 end
38
39 object.idle_animations = copy_north_to_south {
40 north = 1398,
41 }
42 --[[This is incomplete as the scanner and console should be in sync with each other
43 i.e. Dr sits down and pushes some buttons and the scanner scans, the he pushes the lever and it
44 will tip back etc.]]
45 object.usage_animations = copy_north_to_south {
46 north = {
47 begin_use = { -- goes down
48 ["Transparent Male Patient"] = 874,
49 ["Chewbacca Patient"] = 1176,
50 ["Stripped Male Patient"] = 1402,
51 ["Stripped Female Patient"] = 1442,
52 ["Stripped Male Patient 2"] = 1406,
53 ["Stripped Female Patient 2"] = 1446,
54 ["Stripped Male Patient 3"] = 1402,
55 ["Stripped Female Patient 3"] = 1442,
56 ["Elvis Patient"] = 4914,
57 ["Transparent Female Patient"] = 4926,
58 ["Invisible Patient"] = 4942,
59 ["Alternate Male Patient"] = 4958,
60 ["Slack Male Patient"] = 4974,
61 ["Slack Female Patient"] = 5158,
62 },
63 begin_use_2 = { -- stays down
64 ["Transparent Male Patient"] = 874,
65 ["Chewbacca Patient"] = 1176,
66 ["Stripped Male Patient"] = 1402,
67 ["Stripped Female Patient"] = 1442,
68 ["Stripped Male Patient 2"] = 1410,
69 ["Stripped Female Patient 2"] = 1450,
70 ["Stripped Male Patient 3"] = 1402,
71 ["Stripped Female Patient 3"] = 1442,
72 ["Elvis Patient"] = 4914,
73 ["Transparent Female Patient"] = 4926,
74 ["Invisible Patient"] = 4942,
75 ["Alternate Male Patient"] = 4958,
76 ["Slack Male Patient"] = 4974,
77 ["Slack Female Patient"] = 5158,
78 ["Handyman"] = 564,
79 },
80 begin_use_3 = { -- goes up
81 ["Transparent Male Patient"] = 878,
82 ["Chewbacca Patient"] = 1180,
83 ["Stripped Male Patient"] = 1406,
84 ["Stripped Female Patient"] = 1446,
85 ["Stripped Male Patient 2"] = 1414,
86 ["Stripped Female Patient 2"] = 1454,
87 ["Stripped Male Patient 3"] = 1418,
88 ["Stripped Female Patient 3"] = 1458,
89 ["Elvis Patient"] = 4916,
90 ["Transparent Female Patient"] = 4930,
91 ["Invisible Patient"] = 4946,
92 ["Alternate Male Patient"] = 4962,
93 ["Slack Male Patient"] = 4978,
94 ["Slack Female Patient"] = 5162,
95 },
96 begin_use_4 = { -- stays up
97 ["Transparent Male Patient"] = 886,
98 ["Chewbacca Patient"] = 1188,
99 ["Stripped Male Patient"] = 1410,
100 ["Stripped Female Patient"] = 1450,
101 ["Stripped Male Patient 2"] = 1402,
102 ["Stripped Female Patient 2"] = 1442,
103 ["Stripped Male Patient 3"] = 1422,
104 ["Stripped Female Patient 3"] = 1462,
105 ["Elvis Patient"] = 4922,
106 ["Transparent Female Patient"] = 4938,
107 ["Invisible Patient"] = 4954,
108 ["Alternate Male Patient"] = 4970,
109 ["Slack Male Patient"] = 4986,
110 ["Slack Female Patient"] = 5166,
111 },
112 begin_use_5 = { -- goes down/go back
113 ["Transparent Male Patient"] = 882,
114 ["Chewbacca Patient"] = 1184,
115 ["Stripped Male Patient"] = 1414,
116 ["Stripped Female Patient"] = 1454,
117 ["Stripped Male Patient 2"] = 1418,
118 ["Stripped Female Patient 2"] = 1458,
119 ["Stripped Male Patient 3"] = 1426,
120 ["Stripped Female Patient 3"] = 1466,
121 ["Elvis Patient"] = 4918,
122 ["Transparent Female Patient"] = 4934,
123 ["Invisible Patient"] = 4950,
124 ["Alternate Male Patient"] = 4966,
125 ["Slack Male Patient"] = 4982,
126 ["Slack Female Patient"] = 5170,
127 },
128 finish_use = { -- stays down/stay back
129 ["Transparent Male Patient"] = 874,
130 ["Chewbacca Patient"] = 1176,
131 ["Stripped Male Patient"] = 1402,
132 ["Stripped Female Patient"] = 1442,
133 ["Stripped Male Patient 2"] = 1422,
134 ["Stripped Female Patient 2"] = 1462,
135 ["Stripped Male Patient 3"] = 1430,
136 ["Stripped Female Patient 3"] = 1470,
137 ["Elvis Patient"] = 4914,
138 ["Transparent Female Patient"] = 4926,
139 ["Invisible Patient"] = 4942,
140 ["Alternate Male Patient"] = 4958,
141 ["Slack Male Patient"] = 4974,
142 ["Slack Female Patient"] = 5158,
143 },
144 finish_use_2 = { -- goes up/forwards scan
145 ["Transparent Male Patient"] = 878,
146 ["Chewbacca Patient"] = 1180,
147 ["Stripped Male Patient"] = 1406,
148 ["Stripped Female Patient"] = 1446,
149 ["Stripped Male Patient 2"] = 1426,
150 ["Stripped Female Patient 2"] = 1466,
151 ["Stripped Male Patient 3"] = 1434,
152 ["Stripped Female Patient 3"] = 1474,
153 ["Elvis Patient"] = 4916,
154 ["Transparent Female Patient"] = 4930,
155 ["Invisible Patient"] = 4946,
156 ["Alternate Male Patient"] = 4962,
157 ["Slack Male Patient"] = 4978,
158 ["Slack Female Patient"] = 5162,
159 },
160 finish_use_3 = { -- goes down/stay forwards
161 ["Transparent Male Patient"] = 886,
162 ["Chewbacca Patient"] = 1188,
163 ["Stripped Male Patient"] = 1410,
164 ["Stripped Female Patient"] = 1450,
165 ["Stripped Male Patient 2"] = 1430,
166 ["Stripped Female Patient 2"] = 1470,
167 ["Stripped Male Patient 3"] = 1422,
168 ["Stripped Female Patient 3"] = 1462,
169 ["Elvis Patient"] = 4922,
170 ["Transparent Female Patient"] = 4938,
171 ["Invisible Patient"] = 4954,
172 ["Alternate Male Patient"] = 4970,
173 ["Slack Male Patient"] = 4986,
174 ["Slack Female Patient"] = 5166,
175 },
176 finish_use_4 = { -- stays down/reverse scan
177 ["Transparent Male Patient"] = 882,
178 ["Chewbacca Patient"] = 1184,
179 ["Stripped Male Patient"] = 1414,
180 ["Stripped Female Patient"] = 1454,
181 ["Stripped Male Patient 2"] = 1434,
182 ["Stripped Female Patient 2"] = 1474,
183 ["Stripped Male Patient 3"] = 1422,
184 ["Stripped Female Patient 3"] = 1462,
185 ["Elvis Patient"] = 4918,
186 ["Transparent Female Patient"] = 4934,
187 ["Invisible Patient"] = 4950,
188 ["Alternate Male Patient"] = 4966,
189 ["Slack Male Patient"] = 4982,
190 ["Slack Female Patient"] = 5170,
191 },
192 finish_use_5 = { -- goes up/tips forward
193 ["Transparent Male Patient"] = 874,
194 ["Chewbacca Patient"] = 1176,
195 ["Stripped Male Patient"] = 1402,
196 ["Stripped Female Patient"] = 1442,
197 ["Stripped Male Patient 2"] = 1438,
198 ["Stripped Female Patient 2"] = 1478,
199 ["Stripped Male Patient 3"] = 1438,
200 ["Stripped Female Patient 3"] = 1478,
201 ["Elvis Patient"] = 4914,
202 ["Transparent Female Patient"] = 4926,
203 ["Invisible Patient"] = 4942,
204 ["Alternate Male Patient"] = 4958,
205 ["Slack Male Patient"] = 4974,
206 ["Slack Female Patient"] = 5158,
207 },
208 },
209 }
210 object.orientations = {
211 north = {
212 use_position = {0, 0},
213 footprint = { {-2, -1}, {-1, -1}, {0, -1}, {-2, 0}, {-1, 0, need_south_side = true}, {0, 0, complete_cell = true, only_passable = true} },
214 render_attach_position = {0, -1},
215 smoke_position = {0, 0},
216 },
217 east = {
218 use_position = {0, 0},
219 footprint = { {-1, -2} , {0, -2}, {-1, -1}, {0, -1, need_east_side = true}, {-1, 0}, {0, 0, complete_cell = true, only_passable = true} },
220 render_attach_position = {-1, 0},
221 smoke_position = {0, 0},
222 },
223 }
224 local anim_mgr = TheApp.animation_manager
225 anim_mgr:setPatientMarker(object.idle_animations.north, {-1.1, -1.1})
226
227 anim_mgr:setStaffMarker(object.usage_animations.north.begin_use_2["Handyman"], {-3, -3, "px"})
228
229 return object