Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local WARDEN_LMB_ACTIONS =
- {
- "MINE",
- }
- local WARDEN_ACTION_TAGS = {}
- for i, v in ipairs(WARDEN_LMB_ACTIONS_LMB_ACTIONS) do
- table.insert(WARDEN_ACTION_TAGS, v.."_workable")
- end
- local function GetWardenAction(inst, target)
- for i, v in ipairs(WARDEN_LMB_ACTIONS) do
- if target:HasTag(v.."_workable") then
- return not target:HasTag("sign") and ACTIONS[v] or nil
- end
- end
- end
- local function WardenLeftClickPicker(inst, target)
- if target ~= nil and target ~= inst then
- for i, v in ipairs(WARDEN_LMB_ACTIONS) do
- if target:HasTag(v.."_workable") then
- return not target:HasTag("sign")
- and inst.components.playeractionpicker:SortActionList({ ACTIONS[v] }, target, nil)
- or nil
- end
- end
- end
- end
- local function SetWorker(inst, mode)
- inst:RemoveEventCallback("working", onworked)
- if mode == WEREMODES.NONE then
- if inst.components.worker == nil then
- inst:AddComponent("worker")
- inst.components.worker:SetAction(ACTIONS.MINE, 2)
- inst.components.worker:SetAction(ACTIONS.HAMMER, 1)
- OnWorking(inst)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment