Yeah I was gonna say, like how Foreman Spike in the Extra Characters Plus mod can? That'd be fire.
Or maybe even just add compatibility for it where if you have it installed he can use his bomb move? Like how some mods allow characters to use the Bowser mod's shell attack if you have it installed?
Not sure how viable any of that is though but it would be really cool if it can be done.
Yeah I was gonna say, like how Foreman Spike in the Extra Characters Plus mod can? That'd be fire.
Or maybe even just add compatibility for it where if you have it installed he can use his bomb move? Like how some mods allow characters to use the Bowser mod's shell attack if you have it installed?
Not sure how viable any of that is though but it would be really cool if it can be done.
local function throw_bomb_update(m)
-- Crucial fix: Only run for the local player to stop 16x duplicate spawning loop errors
if m.playerIndex ~= 0 then return end
-- Cooldown countdown
if bomb_cooldown > 0 then
bomb_cooldown = bomb_cooldown - 1
end
-- Modern Input Check: Holding L Trigger AND pressing A Button
local a_pressed = (m.controller.buttonPressed & A_BUTTON) ~= 0
local l_held = (m.controller.buttonDown & L_TRIG) ~= 0
if a_pressed and l_held then
-- Only throw if not cooling down and not already holding an item
if bomb_cooldown == 0 and m.heldObj == nil then
-- Spawns a synchronized Bob-omb using modern E_MODEL naming to prevent script errors
local bomb = spawn_sync_object(
id_bhvBobomb,
E_MODEL_BLACK_BOBOMB,
m.pos.x, m.pos.y + 60, m.pos.z,
nil
)
if bomb ~= nil then
-- Snap the bomb into Mario's hold state variables safely
m.heldObj = bomb
bomb.oHeldState = HELD_HELD
-- Inject forward speed vectors relative to Mario's current direction
bomb.oForwardVel = 40.0
bomb.oVelY = 15.0
bomb.oMoveAngleYaw = m.faceAngle.y
-- Break attachment immediately to throw it
bomb.oHeldState = HELD_THROWN
m.heldObj = nil
-- Play Mario's visual punching/throwing motion
set_mario_action(m, ACT_PUNCHING, 0)
-- Set a 15-frame cooldown (approx 0.5 seconds)
bomb_cooldown = 15
end
end
end
end
-- Hooking directly into HOOK_MARIO_UPDATE completely fixes the gMarioStates reference error
hook_event(HOOK_MARIO_UPDATE, throw_bomb_update)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.