| 1 |
--[[ Copyright (c) 2009 Manuel König |
| 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 = "autopsy" |
| 23 |
object.thob = 55 |
| 24 |
object.research_category = "cure" |
| 25 |
object.name = _S.object.auto_autopsy |
| 26 |
object.tooltip = _S.tooltip.objects.auto_autopsy |
| 27 |
object.ticks = true |
| 28 |
object.build_preview_animation = 5102 |
| 29 |
object.crashed_animation = 3304 |
| 30 |
object.show_in_town_map = true |
| 31 |
|
| 32 |
local function copy_north_to_south(t) |
| 33 |
t.south = t.north |
| 34 |
return t |
| 35 |
end |
| 36 |
|
| 37 |
object.idle_animations = copy_north_to_south { |
| 38 |
north = 2146, |
| 39 |
} |
| 40 |
|
| 41 |
object.usage_animations = copy_north_to_south { |
| 42 |
north = { |
| 43 |
in_use = { |
| 44 |
Handyman = 3566, |
| 45 |
}, |
| 46 |
}, |
| 47 |
} |
| 48 |
|
| 49 |
object.multi_usage_animations = {} |
| 50 |
local function anim_set(patient_type, invite_in, configure, taken_in, closing) |
| 51 |
local anims = { |
| 52 |
-- Machine door opens and bed comes out |
| 53 |
begin_use = 2154, |
| 54 |
secondary = { |
| 55 |
begin_use = Humanoid.getIdleAnimation(patient_type), |
| 56 |
}, |
| 57 |
-- Patient gets onto the bed |
| 58 |
begin_use_2 = invite_in, |
| 59 |
-- Doctor presses some buttons with patient on bed |
| 60 |
begin_use_3 = configure, |
| 61 |
-- Bed withdraws back into machine |
| 62 |
in_use = taken_in, |
| 63 |
-- Machine door closes |
| 64 |
finish_use = closing, |
| 65 |
-- Doctor stands by machine while it flashes |
| 66 |
finish_use_2 = 4010, |
| 67 |
} |
| 68 |
object.multi_usage_animations["Doctor - ".. patient_type] = { |
| 69 |
north = anims, |
| 70 |
south = anims, |
| 71 |
} |
| 72 |
end |
| 73 |
anim_set("Standard Male Patient" , 2166, 3334, 4548, 4552) |
| 74 |
anim_set("Standard Female Patient" , 3196, 3200, 3188, 3192) |
| 75 |
anim_set("Alien Male Patient" , 2166, 3334, 4548, 4552) |
| 76 |
anim_set("Alien Female Patient" , 3196, 3200, 3188, 3192) |
| 77 |
anim_set("Alternate Male Patient" , 4544, 3334, 4548, 4552) -- Incomplete |
| 78 |
anim_set("Chewbacca Patient" , 4118, 4126, 4130, 4134) |
| 79 |
anim_set("Elvis Patient" , 4086, 4090, 4094, 4098) |
| 80 |
anim_set("Slack Male Patient" , 4332, 4336, 4340, 4552) |
| 81 |
anim_set("Slack Female Patient" , 3196, 3200, 3188, 3192) -- Incomplete |
| 82 |
anim_set("Transparent Male Patient" , 4460, 4856, 4456, 4626) |
| 83 |
anim_set("Transparent Female Patient", 4860, 4804, 4796, 4800) |
| 84 |
anim_set("Invisible Patient" , 4212, 4224, 4216, 4220) |
| 85 |
|
| 86 |
object.orientations = { |
| 87 |
north = { |
| 88 |
use_position_secondary = {-2, 1}, |
| 89 |
use_position = {0, 1}, |
| 90 |
handyman_position = {0, 1}, |
| 91 |
footprint = { |
| 92 |
{-2, -1, complete_cell = true}, {-2, 0, complete_cell = true}, {-2, 1, only_passable = true}, |
| 93 |
{-1, -1, complete_cell = true}, {-1, 0, complete_cell = true}, {-1, 1, only_passable = true}, |
| 94 |
{0, -1, complete_cell = true}, {0, 0, complete_cell = true}, {0, 1, only_passable = true}, |
| 95 |
}, |
| 96 |
early_list = true, |
| 97 |
}, |
| 98 |
east = { |
| 99 |
render_attach_position = {-1, 0}, |
| 100 |
use_position_secondary = {1, -2}, |
| 101 |
use_position = {1, 0}, |
| 102 |
handyman_position = {1, 0}, |
| 103 |
footprint = { |
| 104 |
{-1, -2, complete_cell = true}, {-1, -1, complete_cell = true}, {-1, 0, complete_cell = true}, |
| 105 |
{0, -2, complete_cell = true}, {0, -1, complete_cell = true}, {0, 0, complete_cell = true}, |
| 106 |
{1, -2, only_passable = true}, {1, -1, only_passable = true}, |
| 107 |
{1, -0, only_passable = true}, |
| 108 |
}, |
| 109 |
}, |
| 110 |
} |
| 111 |
local anim_mgr = TheApp.animation_manager |
| 112 |
anim_mgr:setPatientMarker(object.idle_animations.north, {0.0 , 0.0}) |
| 113 |
|
| 114 |
-- In (some versions of?) the original animations, 4086 has a builtin repeat, |
| 115 |
-- which looks very wrong, hence trim it to the length of a similar animation. |
| 116 |
anim_mgr:setAnimLength(4086, anim_mgr:getAnimLength(2166)) |
| 117 |
|
| 118 |
return object |