mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-29 23:43:01 +00:00
26 lines
558 B
Lua
26 lines
558 B
Lua
-- name: Faster Swimming
|
|
-- incompatible:
|
|
-- description: Everyone swims faster.
|
|
|
|
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)
|