Debian Codegraph @

CorsixTH/Lua/objects/machines/hair_restorer.lua

raw
1 --[[ Copyright (c) 2010 Miika-Petteri Matikainen
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 = "hair_restorer"
23 object.thob = 25
24 object.research_category = "cure"
25 object.research_fallback = 10
26 object.name = _S.object.hair_restorer
27 object.tooltip = _S.tooltip.objects.hair_restorer
28 object.ticks = false
29 object.build_preview_animation = 5074
30 object.default_strength = 8
31 object.crashed_animation = 5116
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 = 2070,
40 }
41
42 object.usage_animations = copy_north_to_south {
43 north = {
44 begin_use = { -- Patient sits down
45 ["Slack Male Patient"] = 2074
46 },
47 begin_use_2 = { -- Hair cap goes down
48 ["Slack Male Patient"] = 2078
49 },
50 in_use = { -- Use animation
51 ["Slack Male Patient"] = 2082,
52 ["Handyman"] = 568
53 },
54 finish_use = { -- Hair cap goes up and patient stands up
55 ["Slack Male Patient"] = 2086
56 },
57 },
58 }
59
60 object.orientations = {
61 north = {
62 use_position = {0, 1},
63 handyman_position = {0, -1},
64 added_handyman_animate_offset_while_in_use = {0, 2},
65 finish_use_position = {0, 1},
66 footprint = { {0, -1, only_passable = true}, {0, 0, complete_cell = true}, {0, 1, only_passable = true} },
67 use_animate_from_use_position = true,
68 smoke_position = {0, 0},
69 },
70 east = {
71 use_position = {1, 0},
72 handyman_position = {-1, 0},
73 added_handyman_animate_offset_while_in_use = {2, 0},
74 finish_use_position = {1, 0},
75 footprint = { {-1, 0, only_passable = true}, {0, 0, complete_cell = true}, {1, 0, only_passable = true} },
76 use_animate_from_use_position = true,
77 smoke_position = {0, 0},
78 },
79 }
80 local anim_mgr = TheApp.animation_manager
81 anim_mgr:setPatientMarker(object.idle_animations.north, {-1.0, -1.1})
82
83 anim_mgr:setStaffMarker(object.usage_animations.north.in_use["Handyman"], {61, -36, "px"})
84
85
86 return object