Debian Codegraph @

CorsixTH/Lua/objects/surgeon_screen.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 = "surgeon_screen"
23 object.class = "SurgeonScreen"
24 object.thob = 35
25 object.name = _S.object.surgeon_screen
26 object.tooltip = _S.tooltip.objects.surgeon_screen
27 object.ticks = false
28 object.build_preview_animation = 926
29 object.show_in_town_map = true
30 -- More than one idle animation exists, but we can only set one to the object
31 object.idle_animations = {
32 north = 2772,
33 }
34 object.orientations = {
35 north = {
36 footprint = { {-1, -1, only_passable = true}, {-1, 0}, {0, -1}, {0, 0} },
37 render_attach_position = {-1, 0},
38 use_position = "passable",
39 },
40 }
41
42 -- Animation numbers below correspond to operating theatre uses only.
43 -- See screen.lua for everything else.
44 object.usage_animations = {
45 north = {
46 --[[ unused
47 begin_use = {
48 scrubs_on = 2786,
49 scrubs_off = 2788
50 },
51 ]]--
52 in_use = {
53 Surgeon = {
54 scrubs_on_t1 = 2780,
55 scrubs_on_t2 = 2782,
56 scrubs_on_t3 = 2784,
57 scrubs_off_t1 = 2790,
58 scrubs_off_t2 = 2792,
59 scrubs_off_t3 = 2794,
60 scrubs_off_t4 = 2796,
61 },
62 ["Standard Male Patient"] = {
63 gown_on = 4760,
64 gown_off = 4768,
65 },
66 ["Standard Female Patient"] = {
67 gown_on = 4762,
68 gown_off = 4770,
69 },
70 },
71 },
72 }
73
74 local anim_mgr = TheApp.animation_manager
75 local kf1, kf2, kf3 = {-1.23, -1.14}, {-0.9, -0.8}, {-0.7, -0.6}
76 local anims = { object.idle_animations.north, 2774, 2776 } -- idle anims
77 anim_mgr:setPatientMarker(anims, kf1)
78 anim_mgr:setStaffMarker(anims, kf1)
79
80 anims = object.usage_animations.north.in_use
81 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_on_t1,
82 0, kf1, 2, kf1, 7, kf3, 22, kf3, 25, kf1, 26, kf1)
83 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_on_t2,
84 0, kf1, 3, kf1, 6, kf2, 8, kf2, 9, kf3, 14, kf3, 18, kf1, 22, kf1, 27, kf3, 34, kf3, 37, kf1)
85 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_on_t3,
86 0, kf1, 3, kf1, 6, kf3, 14, kf3, 18, kf1, 23, kf1, 28, kf3, 33, kf3, 36, kf1)
87 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_off_t1, 0, kf1, 4, kf3, 12, kf3, 17,
88 kf1, 24, kf1, 28, kf3, 35, kf3, 39, kf1)
89 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_off_t2, 0, kf1, 4, kf1, 8, kf3, 16,
90 kf3, 21, kf1, 31, kf1, 34, kf3, 42, kf3, 46, kf1)
91 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_off_t3, 0, kf1, 5, kf3, 15, kf3, 21, kf1)
92 anim_mgr:setStaffMarker(anims.Surgeon.scrubs_off_t4, 0, kf1, 4, kf3, 17, kf3, 21, kf1)
93 kf1, kf2 = {-1, -1}, {-0.6, -0.6}
94 anim_mgr:setPatientMarker(anims["Standard Male Patient"].gown_on, 0, kf1, 4, kf2, 16,
95 kf2, 19, kf1)
96 anim_mgr:setPatientMarker(anims["Standard Male Patient"].gown_off, 0, kf1, 2, kf1, 5,
97 kf2, 11, kf2, 15, kf1)
98 anim_mgr:setPatientMarker(anims["Standard Female Patient"].gown_on, 0, kf1, 5, kf2, 16,
99 kf2, 19, kf1)
100 anim_mgr:setPatientMarker(anims["Standard Female Patient"].gown_off, 0, kf1, 3, kf1, 10,
101 kf2, 15, kf1)
102
103 class "SurgeonScreen" (Object)
104
105 ---@type SurgeonScreen
106 local SurgeonScreen = _G["SurgeonScreen"]
107
108 function SurgeonScreen:SurgeonScreen(...)
109 self:Object(...)
110 self.num_green_outfits = 2
111 self.num_white_outfits = 0
112 end
113
114 return object