Changed Timed Actions names

This commit is contained in:
Pao
2023-02-26 22:04:28 +01:00
parent a536980d12
commit 56cb6a543b
6 changed files with 43 additions and 43 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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

View File

@@ -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