Debian Codegraph @

CorsixTH/Lua/objects/pharmacy_cabinet.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 = "pharmacy_cabinet"
23 object.thob = 39
24 object.research_category = "cure"
25 object.research_fallback = 13 -- Sleeping illness
26 object.name = _S.object.pharmacy_cabinet
27 object.tooltip = _S.tooltip.objects.pharmacy_cabinet
28 object.ticks = false
29 object.build_preview_animation = 5088
30 object.show_in_town_map = true
31 local function copy_north_to_south(t)
32 t.south = t.north
33 return t
34 end
35 object.idle_animations = copy_north_to_south {
36 north = 1578,
37 }
38 local function anim_set(begin,finish,idle,in_use,idle2)
39 return {
40 begin_use = 1590, -- Nurse-only
41 begin_use_2 = 1594, -- Nurse-only
42 begin_use_3 = begin,
43 in_use = 1666, -- Nurse-only
44 finish_use = finish,
45 finish_use_2 = 1598, -- Nurse-only
46 secondary = {
47 begin_use = idle,
48 begin_use_2 = idle,
49 in_use = in_use,
50 finish_use_2 = idle2 or idle,
51 },
52 }
53 end
54 object.multi_usage_animations = {
55 ["Nurse - Standard Male Patient"] = copy_north_to_south {
56 north = anim_set(1630, 1638, 26, 1662),
57 },
58 ["Nurse - Standard Female Patient"] = copy_north_to_south {
59 north = anim_set(3104, 3112, 10, 3108),
60 },
61 ["Nurse - Invisible Patient"] = copy_north_to_south {
62 north = anim_set(1704, 1638, 1842, {"morph", 1700, 1662, layers = "cured_layers"}, 26),
63 },
64 ["Nurse - Transparent Male Patient"] = copy_north_to_south {
65 north = anim_set(1686, 1638, 1074, {"morph", 1694, 1662}, 26),
66 },
67 ["Nurse - Transparent Female Patient"] = copy_north_to_south {
68 north = anim_set(3120, 3112, 3022, {"morph", 3124, 3108}, 10),
69 },
70 }
71 object.orientations = {
72 north = {
73 footprint = { {0, 0, complete_cell = true}, {0, 1, only_passable = true}, {0, 2, only_passable = true}, {-1, 1, only_passable = true} },
74 use_position = {0, 1},
75 use_position_secondary = {-1, 1},
76 use_animate_from_use_position = true,
77 },
78 east = {
79 footprint = { {0, 0, complete_cell = true}, {1, 0, only_passable = true}, {2, 0, only_passable = true}, {1, -1, only_passable = true} },
80 use_position = {1, 0},
81 use_position_secondary = {1, -1},
82 use_animate_from_use_position = true,
83 },
84 }
85
86 return object