Changed Timed Actions names
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
function TocCutLocal(_, player, part_name)
|
||||
if JCIO_Common.GetSawInInventory(player) ~= nil then
|
||||
ISTimedActionQueue.add(ISCutLimb:new(player, player, part_name))
|
||||
ISTimedActionQueue.add(JCIO_CutLimbAction:new(player, player, part_name))
|
||||
else
|
||||
player:Say("I don't have a saw on me")
|
||||
end
|
||||
@@ -15,11 +15,11 @@ end
|
||||
|
||||
function TocOperateLocal(_, player, part_name, use_oven)
|
||||
if use_oven then
|
||||
ISTimedActionQueue.add(ISOperateLimb:new(player, player, _, part_name, use_oven));
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, _, part_name, use_oven));
|
||||
else
|
||||
local kit = TocGetKitInInventory(player)
|
||||
if kit ~= nil then
|
||||
ISTimedActionQueue.add(ISOperateLimb:new(player, player, kit, part_name, false))
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, kit, part_name, false))
|
||||
else
|
||||
player:Say("I don't have a kit on me")
|
||||
end
|
||||
@@ -32,13 +32,13 @@ function TocEquipProsthesisLocal(_, player, part_name)
|
||||
surgeon_inventory:getItemFromType('TOC.MetalHook') or
|
||||
surgeon_inventory:getItemFromType('TOC.WoodenHook')
|
||||
if prosthesis_to_equip then
|
||||
ISTimedActionQueue.add(ISInstallProsthesis:new(player, player, prosthesis_to_equip, part_name))
|
||||
ISTimedActionQueue.add(JCIO_InstallProsthesisAction:new(player, player, prosthesis_to_equip, part_name))
|
||||
else
|
||||
player:Say("I need a prosthesis")
|
||||
end
|
||||
end
|
||||
|
||||
function TocUnequipProsthesisLocal(_, player, part_name)
|
||||
ISTimedActionQueue.add(ISUninstallProsthesis:new(player, player, part_name))
|
||||
ISTimedActionQueue.add(JCIO_UninstallProsthesisAction:new(player, player, part_name))
|
||||
|
||||
end
|
||||
|
||||
@@ -361,13 +361,13 @@ end
|
||||
local function OnClickTocConfirmUIMP(button, args)
|
||||
local player = getPlayer()
|
||||
if confirmUIMP.actionAct == "Cut" and args.option == "yes" then
|
||||
ISTimedActionQueue.add(ISCutLimb:new(confirmUIMP.patient, player, confirmUIMP.partNameAct))
|
||||
ISTimedActionQueue.add(JCIO_CutLimbAction:new(confirmUIMP.patient, player, confirmUIMP.partNameAct))
|
||||
elseif confirmUIMP.actionAct == "Operate" and args.option == "yes" then
|
||||
local playerInv = player:getInventory()
|
||||
local item = playerInv:getItemFromType('TOC.Real_surgeon_kit') or playerInv:getItemFromType('TOC.Surgeon_kit') or
|
||||
playerInv:getItemFromType('TOC.Improvised_surgeon_kit')
|
||||
if item then
|
||||
ISTimedActionQueue.add(ISOperateLimb:new(confirmUIMP.patient, player, item, confirmUIMP.partNameAct,
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(confirmUIMP.patient, player, item, confirmUIMP.partNameAct,
|
||||
false))
|
||||
else
|
||||
player:Say("I need a kit")
|
||||
@@ -381,7 +381,7 @@ local function OnClickTocConfirmUIMP(button, args)
|
||||
surgeon_inventory:getItemFromType('TOC.WoodenHook')
|
||||
|
||||
if prosthesis_to_equip then
|
||||
ISTimedActionQueue.add(ISInstallProsthesis:new(player, confirmUIMP.patient, prosthesis_to_equip,
|
||||
ISTimedActionQueue.add(JCIO_InstallProsthesisAction:new(player, confirmUIMP.patient, prosthesis_to_equip,
|
||||
confirmUIMP.partNameAct))
|
||||
else
|
||||
player:Say("I don't have a prosthesis right now")
|
||||
@@ -395,7 +395,7 @@ local function OnClickTocConfirmUIMP(button, args)
|
||||
-- TODO Player is surgeon, but we don't have a confirm_ui_mp.surgeon... awful awful awful
|
||||
-- TODO Workaround for now, we'd need to send data from patient before doing it since we can't access his inventory from the surgeon
|
||||
if confirmUIMP.patient == player then
|
||||
ISTimedActionQueue.add(ISUninstallProsthesis:new(player, confirmUIMP.patient, confirmUIMP.partNameAct))
|
||||
ISTimedActionQueue.add(JCIO_UninstallProsthesisAction:new(player, confirmUIMP.patient, confirmUIMP.partNameAct))
|
||||
|
||||
else
|
||||
player:Say("I can't do that, they need to do it themselves")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
require "TimedActions/ISBaseTimedAction"
|
||||
|
||||
ISCutLimb = ISBaseTimedAction:derive("ISCutLimb")
|
||||
JCIO_CutLimbAction = ISBaseTimedAction:derive("JCIO_CutLimbAction")
|
||||
|
||||
|
||||
function ISCutLimb:isValid()
|
||||
function JCIO_CutLimbAction:isValid()
|
||||
return self.patientX == self.patient:getX() and self.patientY == self.patient:getY()
|
||||
end
|
||||
|
||||
function ISCutLimb:waitToStart()
|
||||
function JCIO_CutLimbAction:waitToStart()
|
||||
if self.patient == self.surgeon then
|
||||
return false
|
||||
end
|
||||
@@ -15,13 +15,13 @@ function ISCutLimb:waitToStart()
|
||||
return self.surgeon:shouldBeTurning()
|
||||
end
|
||||
|
||||
function ISCutLimb:update()
|
||||
function JCIO_CutLimbAction:update()
|
||||
if self.patient ~= self.surgeon then
|
||||
self.surgeon:faceThisObject(self.patient)
|
||||
end
|
||||
end
|
||||
|
||||
function ISCutLimb:stop()
|
||||
function JCIO_CutLimbAction:stop()
|
||||
|
||||
print("Stopping ISCutLimb")
|
||||
self.surgeon:getEmitter():stopSoundByName("Amputation_Sound")
|
||||
@@ -36,7 +36,7 @@ end
|
||||
|
||||
|
||||
|
||||
function ISCutLimb:start()
|
||||
function JCIO_CutLimbAction:start()
|
||||
-- TODO Add a check so you can't cut your arm if you don't have hands or if you only have one arm and want to cut that same arm.
|
||||
|
||||
self:setActionAnim("SawLog")
|
||||
@@ -68,7 +68,7 @@ function ISCutLimb:start()
|
||||
|
||||
end
|
||||
|
||||
function ISCutLimb:findArgs()
|
||||
function JCIO_CutLimbAction:findArgs()
|
||||
local surgeon_factor = self.surgeon:getPerkLevel(Perks.Doctor)
|
||||
if self.surgeon:getDescriptor():getProfession() == "surgeon" then surgeon_factor = surgeon_factor + 15 end
|
||||
if self.surgeon:getDescriptor():getProfession() == "doctor" then surgeon_factor = surgeon_factor + 9 end
|
||||
@@ -115,7 +115,7 @@ function ISCutLimb:findArgs()
|
||||
return surgeon_factor, bandage_table, painkiller_table
|
||||
end
|
||||
|
||||
function ISCutLimb:perform()
|
||||
function JCIO_CutLimbAction:perform()
|
||||
local surgeon_factor, bandage_table, painkiller_table = self:findArgs()
|
||||
|
||||
if self.patient ~= self.surgeon and isClient() then
|
||||
@@ -131,7 +131,7 @@ function ISCutLimb:perform()
|
||||
|
||||
end
|
||||
|
||||
function ISCutLimb:new(patient, surgeon, part_name)
|
||||
function JCIO_CutLimbAction:new(patient, surgeon, part_name)
|
||||
|
||||
-- TODO align surgeon, patient not patient, surgeon
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
require "TimedActions/ISBaseTimedAction"
|
||||
|
||||
ISInstallProsthesis = ISBaseTimedAction:derive("ISInstallProsthesis");
|
||||
JCIO_InstallProsthesisAction = ISBaseTimedAction:derive("JCIO_InstallProsthesisAction")
|
||||
|
||||
function ISInstallProsthesis:isValid()
|
||||
function JCIO_InstallProsthesisAction:isValid()
|
||||
|
||||
-- TODO add here conditions if the action can be performed or not, so if thing is in inventory
|
||||
-- TODO 'not sure about multiplayer, maybe an overriding check?
|
||||
return true
|
||||
end
|
||||
|
||||
function ISInstallProsthesis:update()
|
||||
function JCIO_InstallProsthesisAction:update()
|
||||
self.item:setJobDelta(self:getJobDelta())
|
||||
end
|
||||
|
||||
function ISInstallProsthesis:start()
|
||||
function JCIO_InstallProsthesisAction:start()
|
||||
self.item:setJobType("Install prosthesis")
|
||||
self.item:setJobDelta(0.0)
|
||||
|
||||
@@ -27,12 +27,12 @@ function ISInstallProsthesis:start()
|
||||
|
||||
end
|
||||
|
||||
function ISInstallProsthesis:stop()
|
||||
function JCIO_InstallProsthesisAction:stop()
|
||||
ISBaseTimedAction.stop(self)
|
||||
self.item:setJobDelta(0.0)
|
||||
end
|
||||
|
||||
function ISInstallProsthesis:perform()
|
||||
function JCIO_InstallProsthesisAction:perform()
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ function ISInstallProsthesis:perform()
|
||||
ISBaseTimedAction.perform(self)
|
||||
end
|
||||
|
||||
function ISInstallProsthesis:new(surgeon, patient, item, part_name)
|
||||
function JCIO_InstallProsthesisAction:new(surgeon, patient, item, part_name)
|
||||
|
||||
local o = ISBaseTimedAction.new(self, patient)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
require "TimedActions/ISBaseTimedAction"
|
||||
|
||||
ISOperateLimb = ISBaseTimedAction:derive("ISOperateLimb");
|
||||
JCIO_OperateLimbAction = ISBaseTimedAction:derive("JCIO_OperateLimbAction")
|
||||
|
||||
function ISOperateLimb:isValid()
|
||||
return self.patientX == self.patient:getX() and self.patientY == self.patient:getY();
|
||||
function JCIO_OperateLimbAction:isValid()
|
||||
return self.patientX == self.patient:getX() and self.patientY == self.patient:getY()
|
||||
end
|
||||
|
||||
function ISOperateLimb:waitToStart()
|
||||
function JCIO_OperateLimbAction:waitToStart()
|
||||
if self.patient == self.surgeon then
|
||||
return false
|
||||
end
|
||||
@@ -14,13 +14,13 @@ function ISOperateLimb:waitToStart()
|
||||
return self.surgeon:shouldBeTurning()
|
||||
end
|
||||
|
||||
function ISOperateLimb:update()
|
||||
function JCIO_OperateLimbAction:update()
|
||||
if self.patient ~= self.surgeon then
|
||||
self.surgeon:faceThisObject(self.patient)
|
||||
end
|
||||
end
|
||||
|
||||
function ISOperateLimb:start()
|
||||
function JCIO_OperateLimbAction:start()
|
||||
self:setActionAnim("MedicalCheck")
|
||||
if self.use_oven then
|
||||
self.sound = self.patient:getEmitter():playSound("Burn_sound")
|
||||
@@ -28,7 +28,7 @@ function ISOperateLimb:start()
|
||||
end
|
||||
end
|
||||
|
||||
function ISOperateLimb:findArgs()
|
||||
function JCIO_OperateLimbAction:findArgs()
|
||||
local surgeon_factor = self.surgeon:getPerkLevel(Perks.Doctor)
|
||||
|
||||
if self.use_oven then
|
||||
@@ -53,7 +53,7 @@ function ISOperateLimb:findArgs()
|
||||
return surgeon_factor, self.use_oven;
|
||||
end
|
||||
|
||||
function ISOperateLimb:perform()
|
||||
function JCIO_OperateLimbAction:perform()
|
||||
local surgeon_factor, use_oven = self:findArgs()
|
||||
|
||||
if self.patient ~= self.surgeon and isClient() then
|
||||
@@ -70,7 +70,7 @@ function ISOperateLimb:perform()
|
||||
ISBaseTimedAction.perform(self)
|
||||
end
|
||||
|
||||
function ISOperateLimb:new(patient, surgeon, kit, part_name, use_oven)
|
||||
function JCIO_OperateLimbAction:new(patient, surgeon, kit, part_name, use_oven)
|
||||
local o = ISBaseTimedAction.new(self, patient)
|
||||
o.part_name = part_name
|
||||
o.patient = patient
|
||||
@@ -1,8 +1,8 @@
|
||||
require "TimedActions/ISBaseTimedAction"
|
||||
|
||||
ISUninstallProsthesis = ISBaseTimedAction:derive("ISUninstallProsthesis");
|
||||
JCIO_UninstallProsthesisAction = ISBaseTimedAction:derive("JCIO_UninstallProsthesisAction")
|
||||
|
||||
function ISUninstallProsthesis:isValid()
|
||||
function JCIO_UninstallProsthesisAction:isValid()
|
||||
|
||||
if self.item ~= nil and self.is_prosthesis_equipped then
|
||||
return true
|
||||
@@ -15,12 +15,12 @@ function ISUninstallProsthesis:isValid()
|
||||
|
||||
end
|
||||
|
||||
function ISUninstallProsthesis:update()
|
||||
self.item:setJobDelta(self:getJobDelta());
|
||||
function JCIO_UninstallProsthesisAction:update()
|
||||
self.item:setJobDelta(self:getJobDelta())
|
||||
end
|
||||
|
||||
function ISUninstallProsthesis:start()
|
||||
self.item:setJobType("Uninstall prothesis");
|
||||
function JCIO_UninstallProsthesisAction:start()
|
||||
self.item:setJobType("Uninstall prothesis")
|
||||
self.item:setJobDelta(0.0);
|
||||
self:setActionAnim("WearClothing");
|
||||
if self.item:IsClothing() then
|
||||
@@ -33,12 +33,12 @@ function ISUninstallProsthesis:start()
|
||||
self.character:setSecondaryHandItem(self.item)
|
||||
end
|
||||
|
||||
function ISUninstallProsthesis:stop()
|
||||
function JCIO_UninstallProsthesisAction:stop()
|
||||
ISBaseTimedAction.stop(self);
|
||||
self.item:setJobDelta(0.0);
|
||||
end
|
||||
|
||||
function ISUninstallProsthesis:perform()
|
||||
function JCIO_UninstallProsthesisAction:perform()
|
||||
|
||||
self.item:getContainer():setDrawDirty(true)
|
||||
self.item:setJobDelta(0.0)
|
||||
@@ -64,7 +64,7 @@ function ISUninstallProsthesis:perform()
|
||||
ISBaseTimedAction.perform(self)
|
||||
end
|
||||
|
||||
function ISUninstallProsthesis:new(surgeon, patient, part_name)
|
||||
function JCIO_UninstallProsthesisAction:new(surgeon, patient, part_name)
|
||||
local o = ISBaseTimedAction.new(self, surgeon)
|
||||
|
||||
local toc_limbs_data = patient:getModData().TOC.Limbs
|
||||
Reference in New Issue
Block a user