Debian Codegraph @

CorsixTH/Lua/objects/machines/inflator.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 = "inflator"
23 object.thob = 9
24 object.research_category = "cure"
25 object.research_fallback = 2
26 object.name = _S.object.inflator
27 object.tooltip = _S.tooltip.objects.inflator
28 object.ticks = false
29 object.build_preview_animation = 908
30 object.default_strength = 10
31 object.crashed_animation = 3362
32 object.show_in_town_map = true
33 object.smoke_animation = 3424
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 = 572,
40 }
41 object.multi_usage_animations = {
42 ["Standard Male Patient - Doctor"] = copy_north_to_south {
43 north = {
44 begin_use = 464, -- Patient invited onto machine
45 begin_use_2 = 478, -- Doctor pops patient's head
46 begin_use_3 = 482, -- Doctor moves to other side of machine
47 in_use = 496, -- Doctor re-inflates head (do not loop)
48 finish_use = 576, -- Patients walks off machine
49 },
50 },
51 }
52 object.usage_animations = copy_north_to_south {
53 north = {in_use = {["Handyman"] = 3480}}
54 }
55
56 object.orientations = {
57 north = {
58 handyman_position = {1, -1},
59 use_position = {0, 1},
60 use_position_secondary = {-1, 1},
61 finish_use_position = {1, 0},
62 finish_use_position_secondary = {1, -1},
63 footprint = { {-1, -1}, {0, -1, need_north_side = true}, {1, -1, only_passable = true},
64 {-1, 0}, {0, 0}, {1, 0, only_passable = true},
65 {-1, 1, only_passable = true}, {0, 1, only_passable = true}, {1, 1, only_passable = true} },
66 smoke_position = {0, 0},
67 },
68 east = {
69 handyman_position = {-1, 1},
70 use_position = {1, 0},
71 use_position_secondary = {1, -1},
72 finish_use_position = {0, 1},
73 finish_use_position_secondary = {-1, 1},
74 footprint = { {-1, -1}, {0, -1}, {1, -1, only_passable = true},
75 {-1, 0, need_west_side = true}, {0, 0}, {1, 0, only_passable = true},
76 {-1, 1, only_passable = true}, {0, 1, only_passable = true}, {1, 1, only_passable = true} },
77 smoke_position = {0, 0},
78 },
79 }
80 local anim_mgr = TheApp.animation_manager
81 local kf1, kf2 = {0, 1}, {0, 0}
82 anim_mgr:setPatientMarker(object.multi_usage_animations["Standard Male Patient - Doctor"].north.begin_use, 0, kf1, 5, kf2)
83 kf1, kf2 = {0, 0}, {1, 0}
84 anim_mgr:setPatientMarker(object.multi_usage_animations["Standard Male Patient - Doctor"].north.finish_use, 1, kf1, 11, kf2)
85 anim_mgr:setPatientMarker(object.idle_animations.north, {-0.9, -1.0})
86
87 anim_mgr:setStaffMarker(object.usage_animations.north.in_use.Handyman, {59, -3, "px"})
88 anim_mgr:setStaffMarker(object.usage_animations.south.in_use.Handyman, {59, -3, "px"})
89
90 return object