Debian Codegraph @

CorsixTH/Lua/objects/machines/cardio.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 = "cardio"
23 object.thob = 13
24 object.research_fallback = 38
25 object.research_category = "diagnosis"
26 object.name = _S.object.cardio
27 object.tooltip = _S.tooltip.objects.cardio
28 object.ticks = false
29 object.build_preview_animation = 918
30 object.default_strength = 12
31 object.crashed_animation = 3308
32 object.show_in_town_map = true
33 object.smoke_animation = 3432
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 = 648,
40 }
41 object.usage_animations = copy_north_to_south {
42 north = {
43 in_use = {
44 ["Handyman"] = 890
45 },
46 finish_use = {
47 ["Handyman"] = 894
48 },
49 },
50 }
51
52 local kfp1, kfp2, kfp3, kfp4, kfp5, kfp6, kfp7
53 kfp1, kfp2, kfp3, kfp4 = {-10, -7, "px"}, {-13, -11, "px"}, {-17, -11, "px"}, {-21, -13, "px"}
54 kfp5, kfp6, kfp7 = {-27, -14, "px"}, {-31, -16, "px"}, {-37, -17, "px"}
55 TheApp.animation_manager:setStaffMarker(object.usage_animations.north.in_use.Handyman,
56 0, kfp1, 1, kfp2, 2, kfp3, 3, kfp4, 4, kfp5, 5, kfp6, 6, kfp7
57 )
58
59 kfp1, kfp2, kfp3, kfp4 = {-37, -17, "px"}, {-29, -15, "px"}, {-25, -15, "px"}, {-20, -13, "px"}
60 kfp5, kfp6, kfp7 = {-19, -13, "px"}, {-18, -13, "px"}, {-12, -10, "px"}
61 TheApp.animation_manager:setStaffMarker(object.usage_animations.north.finish_use.Handyman,
62 0, kfp1, 5, kfp1, 6, kfp2, 7, kfp3, 8, kfp4, 9, kfp5, 10, kfp6, 11, kfp7
63 )
64
65 object.multi_usage_animations = {
66 ["Stripped Male Patient - Doctor"] = copy_north_to_south {
67 north = {
68 begin_use = 1018,
69 in_use = 652,
70 finish_use = 3282,
71 secondary = {
72 begin_use = 1030,
73 in_use = 656,
74 finish_use = 1030,
75 },
76 },
77 },
78 ["Stripped Female Patient - Doctor"] = copy_north_to_south {
79 north = {
80 begin_use = 3008,
81 in_use = 2840,
82 finish_use = 4556,
83 secondary = {
84 begin_use = 1030,
85 in_use = 656,
86 finish_use = 1030,
87 },
88 },
89 },
90 ["Stripped Male Patient 2 - Doctor"] = copy_north_to_south {
91 north = {
92 begin_use = 1018,
93 in_use = 652,
94 finish_use = 3282,
95 secondary = {
96 begin_use = 1030,
97 in_use = 656,
98 finish_use = 1030,
99 },
100 },
101 },
102 ["Stripped Female Patient 2 - Doctor"] = copy_north_to_south {
103 north = {
104 begin_use = 3008,
105 in_use = 2840,
106 finish_use = 4556,
107 secondary = {
108 begin_use = 1030,
109 in_use = 656,
110 finish_use = 1030,
111 },
112 },
113 },
114 ["Stripped Male Patient 3 - Doctor"] = copy_north_to_south {
115 north = {
116 begin_use = 1018,
117 in_use = 652,
118 finish_use = 3282,
119 secondary = {
120 begin_use = 1030,
121 in_use = 656,
122 finish_use = 1030,
123 },
124 },
125 },
126 ["Stripped Female Patient 3 - Doctor"] = copy_north_to_south {
127 north = {
128 begin_use = 3008,
129 in_use = 2840,
130 finish_use = 4556,
131 secondary = {
132 begin_use = 1030,
133 in_use = 656,
134 finish_use = 1030,
135 },
136 },
137 },
138 }
139 object.orientations = {
140 north = {
141 footprint = { {-1, -1, complete_cell = true}, {-1, 0, complete_cell = true}, {1, -1, only_passable = true},
142 {0, -1, need_north_side = true}, {0, 0, only_passable = true} },
143 render_attach_position = {-1, 0},
144 use_position = {1, -1},
145 use_position_secondary = {0, 0},
146 added_handyman_animate_offset_while_in_use = {1, -1},
147 smoke_position = {0, 0},
148 },
149 east = {
150 footprint = { {-1, -1, complete_cell = true}, {-1, 0}, {0, -1, complete_cell = true},
151 {0, 0, only_passable = true}, {-1, 1, only_passable = true} },
152 render_attach_position = {0, -1},
153 use_position = {-1, 1},
154 use_position_secondary = {0, 0},
155 added_handyman_animate_offset_while_in_use = {-1, 1},
156 smoke_position = {0, 0},
157 },
158 }
159 local anim_mgr = TheApp.animation_manager
160 anim_mgr:setPatientMarker(object.idle_animations.north, {-0.9, -0.9})
161
162 return object