didn't commit everything ops
This commit is contained in:
49
media/lua/client/ActionsMethods/JCIO_LocalActions.lua
Normal file
49
media/lua/client/ActionsMethods/JCIO_LocalActions.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
------------------------------------------
|
||||
------------- JUST CUT IT OFF ------------
|
||||
------------------------------------------
|
||||
------------- LOCAL ACTIONS --------------
|
||||
|
||||
--Used to handle SP scenarios
|
||||
|
||||
|
||||
if JCIO_LocalActions == nil then
|
||||
JCIO_LocalActions = {}
|
||||
end
|
||||
|
||||
|
||||
function JCIO_LocalActions.Cut(_, player, partName)
|
||||
if JCIO_Common.GetSawInInventory(player) ~= nil then
|
||||
ISTimedActionQueue.add(JCIO_CutLimbAction:new(player, player, partName))
|
||||
else
|
||||
player:Say("I don't have a saw on me")
|
||||
end
|
||||
end
|
||||
|
||||
function JCIO_LocalActions.Operate(_, player, partName, useOven)
|
||||
if useOven then
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, _, partName, useOven));
|
||||
else
|
||||
local kit = TocGetKitInInventory(player)
|
||||
if kit ~= nil then
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, kit, partName, false))
|
||||
else
|
||||
player:Say("I don't have a kit on me")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function JCIO_LocalActions.EquipProsthesis(_, player, partName)
|
||||
local surgeonInv = player:getInventory()
|
||||
local prosthesisToEquip = surgeonInv:getItemFromType('TOC.MetalHand') or
|
||||
surgeonInv:getItemFromType('TOC.MetalHook') or
|
||||
surgeonInv:getItemFromType('TOC.WoodenHook')
|
||||
if prosthesisToEquip then
|
||||
ISTimedActionQueue.add(JCIO_InstallProsthesisAction:new(player, player, prosthesisToEquip, partName))
|
||||
else
|
||||
player:Say("I need a prosthesis")
|
||||
end
|
||||
end
|
||||
|
||||
function JCIO_LocalActions.UnequipProsthesis(_, player, partName)
|
||||
ISTimedActionQueue.add(JCIO_UninstallProsthesisAction:new(player, player, partName))
|
||||
end
|
||||
@@ -19,7 +19,7 @@ function JCIO.EquipProsthesis(partName, prosthesisItem, prosthesisBaseName)
|
||||
local equippedProsthesis = GenerateEquippedProsthesis(prosthesisItem, player:getInventory(), "Hand")
|
||||
|
||||
|
||||
--print("TOC: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
|
||||
--print("JCIO: Test durability new item " .. added_prosthesis_mod_data.TOC.durability)
|
||||
|
||||
-- TODO equippedProsthesis must have something like the ProsthesisFactor from before!!!
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
------------------------------------------
|
||||
-------- JUST CUT IT OFF --------
|
||||
------------------------------------------
|
||||
------------- LOCAL ACTIONS --------------
|
||||
|
||||
|
||||
|
||||
function TocCutLocal(_, player, part_name)
|
||||
if JCIO_Common.GetSawInInventory(player) ~= nil then
|
||||
ISTimedActionQueue.add(JCIO_CutLimbAction:new(player, player, part_name))
|
||||
else
|
||||
player:Say("I don't have a saw on me")
|
||||
end
|
||||
end
|
||||
|
||||
function TocOperateLocal(_, player, part_name, use_oven)
|
||||
if use_oven then
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, _, part_name, use_oven));
|
||||
else
|
||||
local kit = TocGetKitInInventory(player)
|
||||
if kit ~= nil then
|
||||
ISTimedActionQueue.add(JCIO_OperateLimbAction:new(player, player, kit, part_name, false))
|
||||
else
|
||||
player:Say("I don't have a kit on me")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function TocEquipProsthesisLocal(_, player, part_name)
|
||||
local surgeon_inventory = player:getInventory()
|
||||
local prosthesis_to_equip = surgeon_inventory:getItemFromType('TOC.MetalHand') or
|
||||
surgeon_inventory:getItemFromType('TOC.MetalHook') or
|
||||
surgeon_inventory:getItemFromType('TOC.WoodenHook')
|
||||
if prosthesis_to_equip then
|
||||
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(JCIO_UninstallProsthesisAction:new(player, player, part_name))
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user