fix: fixed ignored actions that should ignore toc calculations
This commit is contained in:
@@ -31,6 +31,7 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
-- ugly This whole section should be done better
|
||||||
for _, pl in pairs(players) do
|
for _, pl in pairs(players) do
|
||||||
---@cast pl IsoPlayer
|
---@cast pl IsoPlayer
|
||||||
|
|
||||||
@@ -45,7 +46,6 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
|
|||||||
sendClientCommand(CommandsData.modules.TOC_RELAY, CommandsData.server.Relay.RelayExecuteInitialization,
|
sendClientCommand(CommandsData.modules.TOC_RELAY, CommandsData.server.Relay.RelayExecuteInitialization,
|
||||||
{ patientNum = clickedPlayerNum })
|
{ patientNum = clickedPlayerNum })
|
||||||
else
|
else
|
||||||
-- TODO ugly
|
|
||||||
ClientRelayCommands.ReceiveExecuteInitialization()
|
ClientRelayCommands.ReceiveExecuteInitialization()
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -65,7 +65,6 @@ local function AddAdminTocOptions(playerNum, context, worldobjects)
|
|||||||
{ patientNum = clickedPlayerNum, limbName = limbName })
|
{ patientNum = clickedPlayerNum, limbName = limbName })
|
||||||
else
|
else
|
||||||
ClientRelayCommands.ReceiveExecuteAmputationAction({surgeonNum=clickedPlayerNum, limbName=limbName, damagePlayer=false})
|
ClientRelayCommands.ReceiveExecuteAmputationAction({surgeonNum=clickedPlayerNum, limbName=limbName, damagePlayer=false})
|
||||||
-- todo ugly
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
-- TODO This section must be overhauled
|
-- TODO This section must be overhauled
|
||||||
|
|
||||||
-- local DataController = require("TOC/Controllers/DataController")
|
local DataController = require("TOC/Controllers/DataController")
|
||||||
local StaticData = require("TOC/StaticData")
|
local StaticData = require("TOC/StaticData")
|
||||||
|
|
||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
@@ -13,70 +13,63 @@ local StaticData = require("TOC/StaticData")
|
|||||||
---ISEquipWeaponAction
|
---ISEquipWeaponAction
|
||||||
---ISUnequipAction
|
---ISUnequipAction
|
||||||
|
|
||||||
-- --- We're forced to re-run this crap to fix it
|
--- We're forced to re-run this crap to fix it
|
||||||
-- ---@param action ISBaseTimedAction
|
---@param action ISBaseTimedAction
|
||||||
-- local function HandleSpeedSpecificAction(action, time)
|
local function OverrideAction(action, time)
|
||||||
-- action.skipTOC = true
|
-- TODO Add forced debuff instead of just relying on the vanilla values?
|
||||||
-- action.maxTime = time
|
action.skipTOC = true
|
||||||
-- action.animSpeed = 1.0
|
action.maxTime = time
|
||||||
-- end
|
action.animSpeed = 1.0
|
||||||
|
end
|
||||||
|
|
||||||
-- local og_ISAttachItemHotbar_new = ISAttachItemHotbar.new
|
local og_ISAttachItemHotbar_new = ISAttachItemHotbar.new
|
||||||
-- function ISAttachItemHotbar:new(character, item, slot, slotIndex, slotDef)
|
function ISAttachItemHotbar:new(character, item, slot, slotIndex, slotDef)
|
||||||
-- local action = og_ISAttachItemHotbar_new(self, character, item, slot, slotIndex, slotDef)
|
local action = og_ISAttachItemHotbar_new(self, character, item, slot, slotIndex, slotDef)
|
||||||
-- HandleSpeedSpecificAction(action, -1)
|
OverrideAction(action, -1)
|
||||||
-- return action
|
return action
|
||||||
-- end
|
end
|
||||||
|
|
||||||
-- local og_ISDetachItemHotbar_new = ISDetachItemHotbar.new
|
local og_ISDetachItemHotbar_new = ISDetachItemHotbar.new
|
||||||
-- function ISDetachItemHotbar:new(character, item)
|
function ISDetachItemHotbar:new(character, item)
|
||||||
-- local action = og_ISDetachItemHotbar_new(self, character, item)
|
local action = og_ISDetachItemHotbar_new(self, character, item)
|
||||||
-- HandleSpeedSpecificAction(action, -1)
|
action = OverrideAction(action, -1)
|
||||||
-- return action
|
return action
|
||||||
-- end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- local og_ISEquipWeaponAction_new = ISEquipWeaponAction.new
|
local og_ISEquipWeaponAction_new = ISEquipWeaponAction.new
|
||||||
-- function ISEquipWeaponAction:new(character, item, time, primary, twoHands)
|
function ISEquipWeaponAction:new(character, item, time, primary, twoHands)
|
||||||
|
|
||||||
-- local action = og_ISEquipWeaponAction_new(self, character, item, time, primary, twoHands)
|
local action = og_ISEquipWeaponAction_new(self, character, item, time, primary, twoHands)
|
||||||
-- TOC_DEBUG.print("Override ISEquipWeaponAction New")
|
TOC_DEBUG.print("Override ISEquipWeaponAction New")
|
||||||
|
|
||||||
|
|
||||||
-- -- check if right arm is cut off or not. if it is, penality shall apply
|
-- check if right arm is cut off or not. if it is, penality shall apply
|
||||||
-- -- if we got here, the action is valid, so we know that we have a prosthesis.
|
-- if we got here, the action is valid, so we know that we have a prosthesis.
|
||||||
|
|
||||||
|
local dcInst = DataController.GetInstance()
|
||||||
|
|
||||||
-- local dcInst = DataController.GetInstance()
|
-- Brutal Handwork should be considered. Use the twohands thing
|
||||||
|
if not (dcInst:getIsAnyLimbCut() and twoHands) then
|
||||||
|
OverrideAction(action, time)
|
||||||
|
end
|
||||||
|
|
||||||
-- if not dcInst:getIsCut(StaticData.LIMBS_IND_STR.Hand_R) then
|
return action
|
||||||
-- action.skipTOC = true
|
|
||||||
-- action.maxTime = time
|
|
||||||
-- action.animSpeed = 1.0
|
|
||||||
-- TOC_DEBUG.print("Skipping TOC for ISEquipWeaponAction new")
|
|
||||||
-- end
|
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
-- -- if not twoHands then
|
local og_ISUnequipAction_new = ISUnequipAction.new
|
||||||
-- -- TOC_DEBUG.print("Not a two handed action, re-adding skip TOC")
|
function ISUnequipAction:new(character, item, time)
|
||||||
-- -- HandleSpeedSpecificAction(action)
|
local action = og_ISUnequipAction_new(self, character, item, time)
|
||||||
-- -- end
|
---@cast item InventoryItem
|
||||||
-- return action
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- local og_ISUnequipAction_new = ISUnequipAction.new
|
-- For some reason (I have no clue why), if we re-run the method it breaks basically every unequip clothing action. Not for weapons though.
|
||||||
-- function ISUnequipAction:new(character, item, time)
|
if instanceof(item, 'HandWeapon') then
|
||||||
-- local action = og_ISUnequipAction_new(self, character, item, time)
|
OverrideAction(action, time)
|
||||||
-- ---@cast item InventoryItem
|
end
|
||||||
|
|
||||||
-- -- For some reason (I have no clue why), if we re-run the method it breaks basically every unequip clothing action. Not for weapons though.
|
return action
|
||||||
-- if instanceof(item, 'HandWeapon') then
|
end
|
||||||
-- --print("Running handlespeedspecificaction")
|
|
||||||
-- HandleSpeedSpecificAction(action)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- return action
|
|
||||||
-- end
|
|
||||||
|
|
||||||
------------------------------------------------------
|
------------------------------------------------------
|
||||||
--- Normal cases
|
--- Normal cases
|
||||||
|
|||||||
Reference in New Issue
Block a user