sm64coopdx/mods/faster-swimming.lua
2024-06-25 15:17:35 -04:00

26 lines
559 B
Lua

-- name: Faster Swimming
-- description: Everyone swims faster.
-- pausable: true
function mario_before_phys_step(m)
local hScale = 1.0
local vScale = 1.0
-- faster swimming
if (m.action & ACT_FLAG_SWIMMING) ~= 0 then
hScale = hScale * 2.0
if m.action ~= ACT_WATER_PLUNGE then
vScale = vScale * 2.0
end
end
m.vel.x = m.vel.x * hScale
m.vel.y = m.vel.y * vScale
m.vel.z = m.vel.z * hScale
end
-----------
-- hooks --
-----------
hook_event(HOOK_BEFORE_PHYS_STEP, mario_before_phys_step)