diff --git a/media/README.md b/media/README.md index 4e56677..ddbacf5 100644 --- a/media/README.md +++ b/media/README.md @@ -18,20 +18,27 @@ This is the beta of my first mod, it means that the main features are there, but -[h1]The Only Cure but better[\h1] +[h1]The Only Cure but better[/h1] A working version for SP and MP. I'm not gonna bother "adding" stuff, for now. If Mr Bounty returns, I'm probably not gonna continue this. +[b][u]DO NOT LOAD THIS WITH THE ONLY CURE BETA!!! CHOOSE ONE![/u][/b] + + [h1]FIXED[/h1] -- The Only Cure UI not showing in MP -- Operating with oven completely broken -- Invisible prosthesis on female models (still WIP, forearms especially) - +[list] +[*]The Only Cure UI in the Medical Check menu not working when checking other players +[*]The Only Cure context menu on right click +[*]Operating with oven completely broken +[*]Invisible prosthesis on female models (still WIP, forearms especially) +[*]More stuff +[/list] [h1]ADDED[/h1] -- Debug cheats (MP Compatible) to reset amputations -- More stuff +[list] +[*]Debug cheats (MP Compatible) to reset amputations +[/list] Workshop ID: 2915572347 Mod ID: Amputation2 diff --git a/media/lua/client/TOC_ContextMenus.lua b/media/lua/client/TOC_ContextMenus.lua index d5c34b7..dbd87aa 100644 --- a/media/lua/client/TOC_ContextMenus.lua +++ b/media/lua/client/TOC_ContextMenus.lua @@ -2,7 +2,7 @@ -- TODO rewrite this mess local function CutLocal(_, patient, surgeon, part_name) - if IsSawInInventory(surgeon) ~= nil then + if GetSawInInventory(surgeon) ~= nil then ISTimedActionQueue.add(ISCutLimb:new(patient, surgeon, part_name)); else surgeon:Say("I don't have a saw on me") @@ -229,7 +229,7 @@ end TocContextMenus.DoCut = function(_, patient, surgeon, part_name) - if IsSawInInventory(surgeon) then + if GetSawInInventory(surgeon) then ISTimedActionQueue.add(ISCutLimb:new(patient, surgeon, part_name)); else surgeon:Say("I don't have a saw on me") diff --git a/media/lua/client/TOC_GlobalFunctions.lua b/media/lua/client/TOC_GlobalFunctions.lua index 133bbb6..fd98966 100644 --- a/media/lua/client/TOC_GlobalFunctions.lua +++ b/media/lua/client/TOC_GlobalFunctions.lua @@ -7,8 +7,10 @@ function GetKitInInventory(surgeon) end -function IsSawInInventory(surgeon) - local playerInv = surgeon:getInventory() - local item = playerInv:getItemFromType('Saw') or playerInv:getItemFromType('GardenSaw') or playerInv:getItemFromType('Chainsaw') + +function GetSawInInventory(surgeon) + + local player_inv = surgeon:getInventory() + local item = player_inv:getItemFromType("Saw") or player_inv:getItemFromType("GardenSaw") or player_inv:getItemFromType("Chainsaw") return item -end \ No newline at end of file +end diff --git a/media/lua/client/TimedActions/ISCutLimb.lua b/media/lua/client/TimedActions/ISCutLimb.lua index 1d00fd9..824cbd1 100644 --- a/media/lua/client/TimedActions/ISCutLimb.lua +++ b/media/lua/client/TimedActions/ISCutLimb.lua @@ -22,14 +22,23 @@ function ISCutLimb:update() end function ISCutLimb:start() - if self.patient == self.surgeon then - self:setActionAnim("SawLog") -- TODO Change it to a better animation - --self:setAnimVariable("WearClothingLocation", "Jacket") - else - self:setActionAnim("SawLog") - -- TODO Point at patient - --self.patient:SetVariable("LootPosition", "Mid") + + self:setActionAnim("SawLog") + local saw_item = GetSawInInventory(self.surgeon) + + if saw_item then + self:setOverrideHandModels(saw_item:getStaticModel(), nil) + end + + + local body_part_type = TheOnlyCure.GetBodyPartTypeFromBodyPart(self.part_name) + local body_damage = self.patient:getBodyDamage() + local body_damage_part = body_damage:getBodyPart(body_part_type) + + body_damage_part:setBleeding(true) + body_damage_part:setBleedingTime(ZombRand(10,20)) + end @@ -92,9 +101,12 @@ function ISCutLimb:perform() else TheOnlyCure.CutLimb(self.part_name, surgeon_factor, bandage_table, painkiller_table) end + + self.surgeon:getXp():AddXP(Perks.Doctor, 400); ISBaseTimedAction.perform(self); + end @@ -103,7 +115,6 @@ function ISCutLimb:new(patient, surgeon, part_name) setmetatable(o, self) self.__index = self o.part_name = part_name - o.bodyPart = TheOnlyCure.GetBodyPartTypeFromBodyPart(part_name) -- TODO I don't think I need this o.character = surgeon -- For anim o.surgeon = surgeon; -- Surgeon or player that make the operation diff --git a/media/scripts/TOC_items.txt b/media/scripts/TOC_items.txt index 0c01b99..1e4e450 100644 --- a/media/scripts/TOC_items.txt +++ b/media/scripts/TOC_items.txt @@ -119,7 +119,7 @@ imports /************************ Prothese cloth ************************/ -/* TODO make these not clothing so we cant equip them but only install them via the menu or context menu +/* TODO make these not clothing so we cant equip them but only install them via the menu or context menu*/ item WoodenHook_right_noHand { Weight = 1,