Skip to content

Commit

Permalink
Merge pull request #1507 from TheCycoONE/people
Browse files Browse the repository at this point in the history
[RDY] Subclass Staff
  • Loading branch information
mugmuggy committed Mar 29, 2019
2 parents 22020fd + f3d204e commit c1fc8a7
Show file tree
Hide file tree
Showing 17 changed files with 747 additions and 451 deletions.
20 changes: 11 additions & 9 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion CorsixTH/Lua/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion CorsixTH/Lua/dialogs/place_staff.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions CorsixTH/Lua/entities/humanoid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit c1fc8a7

Please sign in to comment.