Debian Codegraph @

CorsixTH/Lua/objects/crash_trolley.lua

raw
1 --[[ Copyright (c) 2009 Peter "Corsix" Cawley
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 = "crash_trolley"
23 object.thob = 20
24 object.research_category = "diagnosis"
25 object.name = _S.object.crash_trolley
26 object.tooltip = _S.tooltip.objects.crash_trolley
27 object.ticks = false
28 object.build_preview_animation = 916
29 object.show_in_town_map = true
30 local function copy_north_to_south(t)
31 t.south = t.north
32 return t
33 end
34 object.idle_animations = copy_north_to_south {
35 north = 3838 --1134, there's also a back view (1132), but animation is missing for that
36 }
37 object.multi_usage_animations = {
38 ["Stripped Male Patient - Doctor"] = copy_north_to_south {
39 north = {
40 begin_use = {3740, 3736, 3818},
41 -- Also possibly 548, 556 and 560 for a more smooth animation?
42 in_use = {540, 544, 552},
43 finish_use = {3802, 3806, 3826},
44 },
45 },
46 ["Stripped Female Patient - Doctor"] = copy_north_to_south {
47 north = {
48 begin_use = {3732, 3728, 3822}, -- 532
49 in_use = {524, 528, 536},
50 finish_use = {3810, 3814, 3830},
51 },
52 },
53 ["Stripped Male Patient 2 - Doctor"] = copy_north_to_south {
54 north = {
55 begin_use = {3740, 3736, 3818},
56 -- Also possibly 548, 556 and 560 for a more smooth animation?
57 in_use = {540, 544, 552},
58 finish_use = {3802, 3806, 3826},
59 },
60 },
61 ["Stripped Female Patient 2 - Doctor"] = copy_north_to_south {
62 north = {
63 begin_use = {3732, 3728, 3822}, -- 532
64 in_use = {524, 528, 536},
65 finish_use = {3810, 3814, 3830},
66 },
67 },
68 ["Stripped Male Patient 3 - Doctor"] = copy_north_to_south {
69 north = {
70 begin_use = {3740, 3736, 3818},
71 -- Also possibly 548, 556 and 560 for a more smooth animation?
72 in_use = {540, 544, 552},
73 finish_use = {3802, 3806, 3826},
74 },
75 },
76 ["Stripped Female Patient 3 - Doctor"] = copy_north_to_south {
77 north = {
78 begin_use = {3732, 3728, 3822}, -- 532
79 in_use = {524, 528, 536},
80 finish_use = {3810, 3814, 3830},
81 },
82 },
83 }
84 object.orientations = {
85 north = {
86 render_attach_position = { {0, 0}, {-1, 1} },
87 footprint = { {-1, 0, complete_cell = true}, {-1, 1, only_passable = true},
88 {0, 0, only_passable = true}, {0, 1, only_passable = true} },
89 use_position = {-1, 1},
90 use_position_secondary = {0, 0},
91 },
92 east = {
93 render_attach_position = { {0, 0}, {1, -1} },
94 footprint = { {0, -1, complete_cell = true}, {0, 0, only_passable = true},
95 {1, -1, only_passable = true}, {1, 0, only_passable = true} },
96 use_position = {1, -1},
97 use_position_secondary = {0, 0},
98 },
99 }
100
101 local anim_mgr = TheApp.animation_manager
102 local kf1 = {-39, 11, "px"}
103 anim_mgr:setStaffMarker(524, kf1)
104
105 kf1 = {-63, -2, "px"}
106 anim_mgr:setPatientMarker(524, kf1)
107
108 local kf2 = {-34, 7, "px"}
109 anim_mgr:setStaffMarker(528, kf2)
110 anim_mgr:setPatientMarker(528, kf1)
111
112 local kf3, kf4, kf5 = {-25, 7, "px"}, {-22, 8, "px"}, {-29, 10, "px"}
113 local kf6, kf7 = {-31, 11, "px"}, {-36, 10, "px"}
114 kf2 = {-35, 11, "px"}
115 anim_mgr:setStaffMarker({536, 552}, 0, kf2, 1, kf3, 2, kf4, 17, kf4, 18, kf5,
116 19, kf6, 20, kf7)
117 anim_mgr:setPatientMarker({536, 552}, kf1)
118 anim_mgr:setStaffMarker(540, kf7)
119 anim_mgr:setPatientMarker(540, kf1)
120
121 local kf8, kf9, kf10 = {-38, 13, "px"}, {-34, 10, "px"}, {-31, 14, "px"}
122 local kf11 = {-33, 11, "px"}
123 anim_mgr:setStaffMarker(544, 0, kf8, 36, kf8, 37, kf9, 38, kf10, 40, kf11)
124 anim_mgr:setPatientMarker(544, kf1)
125
126 kf8, kf9, kf10, kf11 = {0, 0, "px"}, {-1, 0, "px"}, {-9, 2, "px"}, {-10, 4, "px"}
127 kf2, kf3, kf5, kf6 = {-12, 7, "px"}, {-17, 5, "px"}, {-22, 10, "px"}, {-25, 11, "px"}
128 kf7 = {-31, 15, "px"}
129 anim_mgr:setStaffMarker({3728, 3732, 3736, 3740}, 0, kf8, 4, kf8, 5, kf9, 6, kf10,
130 7, kf11, 8, kf2, 9, kf3, 10, kf5, 11, kf6, 12, kf7)
131 anim_mgr:setPatientMarker({3728, 3732, 3736, 3740}, kf1)
132
133 local kf12 = {3, 4, "px"}
134 kf9, kf10, kf2, kf3 = {-30, 17, "px"}, {-22, 12, "px"}, {-17, 11, "px"}, {-13, 9, "px"}
135 kf5, kf6 = {-8, 9, "px"}, {-1, 8, "px"}
136 anim_mgr:setStaffMarker({3802, 3806, 3810, 3814}, 0, kf9, 1, kf10, 2, kf2, 3, kf3,
137 4, kf5, 5, kf6, 6, kf12, 7, kf8)
138 anim_mgr:setPatientMarker({3802, 3806, 3810, 3814}, kf1)
139
140 local kf13, kf14, kf15 = {-10, 7, "px"}, {-12, 6, "px"}, {-17, 8, "px"}
141 local kf16, kf17 = {-25, 10, "px"}, {-31, 17, "px"}
142 kf12 = {-1, 2, "px"}
143 anim_mgr:setStaffMarker({3818, 3822}, 0, kf8, 1, kf8, 2, kf12, 3, kf11, 4, kf13,
144 5, kf14, 6, kf15, 7, kf4, 8, kf16, 9, kf17, 10, kf7)
145 anim_mgr:setPatientMarker({3818, 3822}, kf1)
146
147 anim_mgr:setStaffMarker({3826, 3830}, 0, kf9, 1, kf10, 2, kf2, 3, kf3, 4, kf5, 5, kf6)
148 anim_mgr:setPatientMarker({3826, 3830}, kf1)
149
150 return object