Debian Codegraph @

CorsixTH/Lua/objects/machines/blood_machine.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 = "blood_machine"
23 object.thob = 42
24 object.research_fallback = 37
25 object.research_category = "diagnosis"
26 object.name = _S.object.blood_machine
27 object.tooltip = _S.tooltip.objects.blood_machine
28 object.ticks = false
29 object.build_preview_animation = 5094
30 object.default_strength = 12
31 object.crashed_animation = 3372
32 object.show_in_town_map = true
33 object.smoke_animation = 3460
34 local function copy_north_to_south(t)
35 t.south = t.north
36 return t
37 end
38 object.idle_animations = copy_north_to_south {
39 north = 2228,
40 }
41 -- Note that for this particular machine the staff is the primary user, not the patient
42 -- This was done in order to be able to let the patient be visible a while longer.
43 object.multi_usage_animations = {
44 ["Doctor - Standard Male Patient"] = copy_north_to_south {
45 north = {
46 begin_use = 2232, -- empty door opened
47 begin_use_2 = 2236, -- empty chair goes out
48 begin_use_3 = 2554, -- Patient invited onto machine
49 begin_use_4 = 2220, -- The chair goes in
50 begin_use_5 = 2224, -- door closes
51 in_use = 2566, -- The machine does its work TODO: 2562, 2574
52 finish_use = 2252, -- The door is opened
53 finish_use_2 = 2256, -- Patient comes out again
54 finish_use_3 = 2558, -- Stands up
55 finish_use_4 = 2204, -- empty chair in
56 finish_use_5 = 2274, -- empty door closed
57 },
58 },
59 ["Doctor - Standard Female Patient"] = copy_north_to_south {
60 north = {
61 begin_use = 2232, -- empty door opened
62 begin_use_2 = 2236, -- empty chair goes out
63 begin_use_3 = 4614, -- Patient invited onto machine 3224
64 begin_use_4 = 3232, -- The chair goes in
65 begin_use_5 = 3236, -- door closes
66 in_use = 2566, -- The machine does its work TODO: 2562, 2574
67 finish_use = 1172, -- The door is opened
68 finish_use_2 = 4738, -- Patient comes out again, 4734 with shadow
69 finish_use_3 = 4618, -- Stands up 3228
70 finish_use_4 = 2204, -- empty chair in
71 finish_use_5 = 2274, -- empty door closed
72 },
73 },
74 ["Doctor - Slack Male Patient"] = copy_north_to_south { -- Only for baldness
75 north = {
76 begin_use = 2232, -- empty door opened
77 begin_use_2 = 2236, -- empty chair goes out
78 begin_use_3 = 5146, -- Patient invited onto machine
79 begin_use_4 = 5150, -- The chair goes in
80 begin_use_5 = 2224, -- door closes
81 in_use = 2566, -- The machine does its work TODO: 2562, 2574
82 finish_use = 2252, -- The door is opened
83 finish_use_2 = 5154, -- Patient comes out again
84 finish_use_3 = 622, -- Stands up
85 finish_use_4 = 2204, -- empty chair in
86 finish_use_5 = 2274, -- empty door closed
87 },
88 },
89 }
90 object.usage_animations = copy_north_to_south {
91 north = {in_use = {["Handyman"] = {3498, 3484}}}
92 }
93
94 object.orientations = {
95 north = {
96 handyman_position = {0, -1},
97 use_position_secondary = {1, 0},
98 use_position = {0, -1},
99 footprint = { {-1, -1, only_passable = true, need_east_side = true, need_west_side = true},
100 {0, -1, only_passable = true, need_north_side = true},
101 {-2, 0, need_south_side = true, need_north_side = true},
102 {-1, 0}, {0, 0, complete_cell = true}, {1, 0, only_passable = true},
103 {-1, 1, need_east_side = true, need_west_side = true} },
104 smoke_position = {0, 0},
105 },
106 east = {
107 handyman_position = {-1, 0},
108 use_position_secondary = {0, 1},
109 use_position = {-1, 0},
110 footprint = { {0, -2, need_east_side = true, need_west_side = true},
111 {-1, -1, only_passable = true, complete_cell = true}, {0, -1},
112 {1, -1, need_south_side = true, need_north_side = true},
113 {-1, 0, only_passable = true, need_west_side = true},
114 {0, 0, complete_cell = true}, {0, 1, only_passable = true} },
115 smoke_position = {0, 0},
116 },
117 }
118 local anim_mgr = TheApp.animation_manager
119 anim_mgr:setPatientMarker(object.idle_animations.north, {-1.5, -0.8})
120
121 return object