Divergent/mods/Anomaly Addon Dependencies/gamedata/scripts/unjam_motion_mark.script

22 lines
553 B
Plaintext
Raw Normal View History

2024-03-17 20:18:03 -04:00
-- Clear jam mid animation with motion marks
---@param state number
---@param mark string
---@param hud_item game_object
---@param owner game_object
function actor_on_hud_animation_mark(state, mark, hud_item, owner)
if mark == "clear_jam" then
if not hud_item or not owner then return end
local wpn = hud_item:cast_Weapon()
if not wpn then return end
if owner:id() ~= AC_ID then return end
hud_item:SetMisfire(false)
end
end
function on_game_start()
RegisterScriptCallback("actor_on_hud_animation_mark",actor_on_hud_animation_mark)
end