im trying to make a script that replicates the beta cannon behavior "after launching from a cannon you start flying"
but i just cant do the landing part. any help?
local CANNONFLY_STATE = 0
function mario_cannon_action(m)
djui_chat_message_create("cfs: " .. tostring(CANNONFLY_STATE)) -- debug
if m.action == ACT_SHOT_FROM_CANNON then
m.flags = m.flags | MARIO_WING_CAP
---m.action = ACT_FLYING (test)
CANNONFLY_STATE = 1
end
if (CANNONFLY_STATE == 1) and (m.action == ACT_FLYING) then
CANNONFLY_STATE = 2
else
-- stop flying part. it should remove the flying cap as soon as mario lands on ground, performs a ground pound or bonks into a wall
end
end
hook_event(HOOK_MARIO_UPDATE, mario_cannon_action)
but i just cant do the landing part. any help?
local CANNONFLY_STATE = 0
function mario_cannon_action(m)
djui_chat_message_create("cfs: " .. tostring(CANNONFLY_STATE)) -- debug
if m.action == ACT_SHOT_FROM_CANNON then
m.flags = m.flags | MARIO_WING_CAP
---m.action = ACT_FLYING (test)
CANNONFLY_STATE = 1
end
if (CANNONFLY_STATE == 1) and (m.action == ACT_FLYING) then
CANNONFLY_STATE = 2
else
-- stop flying part. it should remove the flying cap as soon as mario lands on ground, performs a ground pound or bonks into a wall
end
end
hook_event(HOOK_MARIO_UPDATE, mario_cannon_action)