| 1 |
--[[ Copyright (c) 2010 Manuel "Roujin" Wolf |
| 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 room = {} |
| 22 |
room.id = "jelly_vat" |
| 23 |
room.vip_must_visit = false |
| 24 |
room.level_config_id = 24 |
| 25 |
room.class = "JellyVatRoom" |
| 26 |
room.name = _S.rooms_short.jelly_vat |
| 27 |
room.long_name = _S.rooms_long.jelly_vat |
| 28 |
room.tooltip = _S.tooltip.rooms.jelly_vat |
| 29 |
room.objects_additional = { "extinguisher", "radiator", "plant", "bin" } |
| 30 |
room.objects_needed = { jelly_moulder = 1 } |
| 31 |
room.build_preview_animation = 928 |
| 32 |
room.categories = { |
| 33 |
clinics = 7, |
| 34 |
} |
| 35 |
room.minimum_size = 4 |
| 36 |
room.wall_type = "blue" |
| 37 |
room.floor_tile = 17 |
| 38 |
room.required_staff = { |
| 39 |
Doctor = 1, |
| 40 |
} |
| 41 |
room.maximum_staff = room.required_staff |
| 42 |
room.call_sound = "reqd020.wav" |
| 43 |
room.handyman_call_sound = "maint009.wav" |
| 44 |
|
| 45 |
class "JellyVatRoom" (Room) |
| 46 |
|
| 47 |
---@type JellyVatRoom |
| 48 |
local JellyVatRoom = _G["JellyVatRoom"] |
| 49 |
|
| 50 |
function JellyVatRoom:JellyVatRoom(...) |
| 51 |
self:Room(...) |
| 52 |
end |
| 53 |
|
| 54 |
function JellyVatRoom:commandEnteringPatient(patient) |
| 55 |
local staff = self.staff_member |
| 56 |
local moulder, stf_x, stf_y = self.world:findObjectNear(patient, "jelly_moulder") |
| 57 |
local pat_x, pat_y = moulder:getSecondaryUsageTile() |
| 58 |
|
| 59 |
staff:setNextAction(WalkAction(stf_x, stf_y)) |
| 60 |
|
| 61 |
local jellyvat_after_use = --[[persistable:jelly_vat_after_use]] function() |
| 62 |
staff:setNextAction(MeanderAction()) |
| 63 |
self:dealtWithPatient(patient) |
| 64 |
end |
| 65 |
|
| 66 |
staff:queueAction(MultiUseObjectAction(moulder, patient):setInvisiblePhaseSpan({-3, 4}) |
| 67 |
:setAfterUse(jellyvat_after_use)) |
| 68 |
|
| 69 |
patient:setNextAction(WalkAction(pat_x, pat_y)) |
| 70 |
patient:queueAction(IdleAction():setDirection(moulder.direction == "north" and "west" or "north")) |
| 71 |
|
| 72 |
return Room.commandEnteringPatient(self, patient) |
| 73 |
end |
| 74 |
|
| 75 |
return room |