Skip to content
Permalink
Browse files

Subclass Staff

Create new Doctor, Handyman, Nurse, and Receptionist classes
Remove self warnings from luacheck
  • Loading branch information...
TheCycoONE committed Mar 24, 2019
1 parent 05a355f commit fd99e753cefc6cd121ca2acadfa1bf3838ad7a71
@@ -18,6 +18,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE. --]]

self = false

globals = { -- Globals
"_A", "_S",
"corsixth",
@@ -39,7 +41,7 @@ globals = { -- Globals
"Patient", "Plant", "Queue", "ResearchDepartment", "Room",
"SaveGame", "SaveGameFile", "Staff", "StaffProfile", "StaffRoom",
"Strings", "SwingDoor", "TheApp", "TreeControl", "Vip", "Window",
"World", "Date",
"World", "Date", "Doctor", "Handyman", "Nurse", "Receptionist",

-- UI
"UI", "UIAdviser", "UIAnnualReport", "UIAudio", "UIBankManager",
@@ -129,8 +131,8 @@ add_ignore("CorsixTH/Lua/dialogs/resizables/options.lua", "width_textbox_reset")
add_ignore("CorsixTH/Lua/dialogs/resizables/options.lua", "height_textbox_reset")
add_ignore("CorsixTH/Lua/entities/machine.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/entities/machine.lua", "repair_loop_callback")
add_ignore("CorsixTH/Lua/entities/patient.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/entities/staff.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/entities/humanoids/patient.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/entities/humanoids/staff.lua", "callbackNewRoom")
add_ignore("CorsixTH/Lua/humanoid_actions/vip_go_to_next_room.lua", "action_vip_go_to_next_room_end")
add_ignore("CorsixTH/Lua/rooms/operating_theatre.lua", "after_use")
add_ignore("CorsixTH/Lua/rooms/operating_theatre.lua", "wait_for_ready")
@@ -179,15 +181,15 @@ add_ignore("CorsixTH/Lua/dialogs/resizables/options.lua", "212")
add_ignore("CorsixTH/Lua/dialogs/staff_rise.lua", "212")
add_ignore("CorsixTH/Lua/dialogs/staff_rise.lua", "542")
add_ignore("CorsixTH/Lua/dialogs/tree_ctrl.lua", "212")
add_ignore("CorsixTH/Lua/entities/grim_reaper.lua", "212")
add_ignore("CorsixTH/Lua/entities/humanoid.lua", "212")
add_ignore("CorsixTH/Lua/entities/inspector.lua", "212")
add_ignore("CorsixTH/Lua/entities/machine.lua", "212")
add_ignore("CorsixTH/Lua/entities/object.lua", "212")
add_ignore("CorsixTH/Lua/entities/patient.lua", "212")
add_ignore("CorsixTH/Lua/entities/patient.lua", "542")
add_ignore("CorsixTH/Lua/entities/staff.lua", "212")
add_ignore("CorsixTH/Lua/entities/vip.lua", "212")
add_ignore("CorsixTH/Lua/entities/humanoids/grim_reaper.lua", "212")
add_ignore("CorsixTH/Lua/entities/humanoids/inspector.lua", "212")
add_ignore("CorsixTH/Lua/entities/humanoids/patient.lua", "212")
add_ignore("CorsixTH/Lua/entities/humanoids/patient.lua", "542")
add_ignore("CorsixTH/Lua/entities/humanoids/staff.lua", "212")
add_ignore("CorsixTH/Lua/entities/humanoids/vip.lua", "212")
add_ignore("CorsixTH/Lua/entity.lua", "212")
add_ignore("CorsixTH/Lua/epidemic.lua", "212")
add_ignore("CorsixTH/Lua/filesystem.lua", "212")
@@ -28,7 +28,7 @@ local runDebugger = corsixth.require("run_debugger")
-- Increment each time a savegame break would occur
-- and add compatibility code in afterLoad functions

local SAVEGAME_VERSION = 132
local SAVEGAME_VERSION = 133

class "App"

@@ -117,7 +117,7 @@ function UIPlaceStaff:onMouseUp(button, x, y)
if self.staff then
self.staff:setTile(self.tile_x, self.tile_y)
else
local entity = self.world:newEntity("Staff", 2)
local entity = self.world:newEntity(self.profile.humanoid_class, 2)
entity:setProfile(self.profile)
self.profile = nil
entity:setTile(self.tile_x, self.tile_y)
@@ -304,24 +304,24 @@ end

-- Save game compatibility
function Humanoid:afterLoad(old, new)
if old < 38 then
if old < 38 and new >= 38 then
-- should existing patients be updated and be getting really ill?
-- adds the new variables for health icons
self.attributes["health"] = math.random(60, 100) /100
end
-- make sure female slack patients have the correct animation
if old < 42 then
if old < 42 and new >= 42 then
if self.humanoid_class == "Slack Female Patient" then
self.die_anims = die_animations["Slack Female Patient"]
end
end
if old < 77 then
if old < 77 and new >= 77 then
self.has_vomitted = 0
end
if old < 49 then
if old < 49 and new >= 49 then
self.has_fallen = 1
end
if old < 61 then
if old < 61 and new >= 61 then
-- callbacks changed
self.build_callbacks = {}
self.remove_callbacks = {}
@@ -334,7 +334,7 @@ function Humanoid:afterLoad(old, new)
self.toilet_callback = nil
end
end
if old < 83 and self.humanoid_class == "Chewbacca Patient" then
if old < 83 and new >= 83 and self.humanoid_class == "Chewbacca Patient" then
self.die_anims.extra_east = 1682
end

Oops, something went wrong.

0 comments on commit fd99e75

Please sign in to comment.
You can’t perform that action at this time.