Debian Codegraph @

CorsixTH/Lua/objects/sofa.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 = "sofa"
23 object.thob = 19
24 object.name = _S.object.sofa
25 object.tooltip = _S.tooltip.objects.sofa
26 object.ticks = false
27 object.build_preview_animation = 5066
28 object.show_in_town_map = true
29 object.idle_animations = {
30 north = 2122,
31 east = 2124,
32 }
33 object.usage_animations = {
34 north = {
35 begin_use = {
36 Doctor = 2178,
37 Nurse = 3878,
38 Handyman = 3570,
39 },
40 begin_use_2 = {
41 Doctor = 2186,
42 Nurse = 3886,
43 Handyman = 3578,
44 },
45 in_use = {
46 Doctor = 2208,
47 Nurse = 4780, -- also 4786, duplicate?
48 Handyman = 4772,
49 },
50 finish_use = {
51 Doctor = 2194,
52 Nurse = 3894,
53 Handyman = 3586,
54 },
55 },
56 east = {
57 begin_use = {
58 Doctor = 2180,
59 Nurse = 3880,
60 Handyman = 3572,
61 },
62 begin_use_2 = {
63 Doctor = 2188,
64 Nurse = 3888,
65 Handyman = 3580,
66 },
67 in_use = {
68 Doctor = 2210,
69 Nurse = 4782, -- also 4784, duplicate?
70 Handyman = 4774, -- also 4776, duplicate?
71 },
72 finish_use = {
73 Doctor = 2196,
74 Nurse = 3896,
75 Handyman = 3588,
76 },
77 },
78 }
79 local anim_mgr = TheApp.animation_manager
80 local kf1, kf2 = {-1, -1}, {-1, -0.6}
81 anim_mgr:setStaffMarker(object.usage_animations.north.begin_use, 0, kf1, 2, kf2)
82 kf1 = {-0.6, 0.3}
83 anim_mgr:setStaffMarker(object.usage_animations.north.begin_use_2, 0, kf2, 2, kf1)
84 anim_mgr:setStaffMarker(object.usage_animations.north.in_use, kf1)
85 kf2 = {-1, -0.6}
86 local kf3 = {-1, -1}
87 anim_mgr:setStaffMarker(object.usage_animations.north.finish_use, 0, kf1, 2, kf2, 5, kf3)
88 kf1, kf2 = {1, -1}, {0.6, -1}
89 anim_mgr:setStaffMarker(object.usage_animations.east.begin_use, 0, kf1, 2, kf2)
90 kf1 = {0.3, -0.6}
91 anim_mgr:setStaffMarker(object.usage_animations.east.begin_use_2, 0, kf2, 3, kf1)
92 anim_mgr:setStaffMarker(object.usage_animations.east.in_use, kf1)
93 kf2 = {0.6, -1}
94 kf3 = {1, -1}
95 anim_mgr:setStaffMarker(object.usage_animations.east.finish_use, 0, kf1, 1, kf1, 3, kf2, 5, kf3)
96
97 object.orientations = {
98 north = {
99 footprint = { {-1, 0, complete_cell = true}, {0, 0, complete_cell = true}, {-1, -1, only_passable = true} },
100 render_attach_position = {-1, 0},
101 use_position = "passable",
102 },
103 east = {
104 footprint = { {0, -1, complete_cell = true}, {0, 0, complete_cell = true}, {1, -1, only_passable = true} },
105 use_position = "passable",
106 },
107 south = {
108 render_attach_position = { {0, 0}, {-1, 1} },
109 footprint = { {-1, 0, complete_cell = true}, {0, 0, complete_cell = true}, {-1, 1, only_passable = true} },
110 use_position = "passable",
111 },
112 west = {
113 footprint = { {0, -1, complete_cell = true}, {0, 0, complete_cell = true}, {-1, -1, only_passable = true} },
114 use_position = "passable",
115 },
116 }
117
118 return object