mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-02-05 05:06:13 +00:00
Some checks failed
Build coop / build-linux (push) Has been cancelled
Build coop / build-steamos (push) Has been cancelled
Build coop / build-windows-opengl (push) Has been cancelled
Build coop / build-windows-directx (push) Has been cancelled
Build coop / build-macos-arm (push) Has been cancelled
Build coop / build-macos-intel (push) Has been cancelled
* Replaces Extra Characters * Folder inside another folder fix
59 lines
1.8 KiB
Lua
59 lines
1.8 KiB
Lua
-------------------
|
|
-- Peach Moveset --
|
|
-------------------
|
|
|
|
if not charSelect then return end
|
|
|
|
local floatActs = {
|
|
[ACT_JUMP] = true,
|
|
[ACT_DOUBLE_JUMP] = true,
|
|
[ACT_TRIPLE_JUMP] = true,
|
|
[ACT_LONG_JUMP] = true,
|
|
[ACT_BACKFLIP] = true,
|
|
[ACT_SIDE_FLIP] = true,
|
|
[ACT_WALL_KICK_AIR] = true,
|
|
}
|
|
|
|
_G.ACT_FLOAT = allocate_mario_action(ACT_GROUP_AIRBORNE | ACT_FLAG_ALLOW_VERTICAL_WIND_ACTION | ACT_FLAG_MOVING)
|
|
|
|
--- @param m MarioState
|
|
local function act_float(m)
|
|
-- apply movement when using action
|
|
common_air_action_step(m, ACT_JUMP_LAND, CHAR_ANIM_BEND_KNESS_RIDING_SHELL, AIR_STEP_NONE)
|
|
|
|
-- setup when action starts (horizontal speed and voiceline)
|
|
if m.actionTimer == 0 then
|
|
play_character_sound(m, CHAR_SOUND_HELLO)
|
|
end
|
|
|
|
if m.forwardVel > 20 then
|
|
m.forwardVel = m.forwardVel - 0.5
|
|
end
|
|
|
|
-- Slowly decend
|
|
m.vel.y = -1
|
|
set_mario_particle_flags(m, PARTICLE_SPARKLES, 0)
|
|
|
|
-- avoid issue with flying and then make the hover end after 2 secs or when stopping holding the button
|
|
if m.prevAction ~= ACT_TRIPLE_JUMP and (m.flags & MARIO_WING_CAP) ~= 0 then
|
|
if m.actionTimer >= 50 or (m.controller.buttonDown & A_BUTTON) == 0 then
|
|
set_mario_action(m, ACT_FREEFALL, 0)
|
|
end
|
|
else
|
|
if m.actionTimer >= 50 or (m.controller.buttonDown & A_BUTTON) == 0 then
|
|
set_mario_action(m, ACT_FREEFALL, 0)
|
|
end
|
|
end
|
|
|
|
-- increment the action timer to make the hover stop
|
|
m.actionTimer = m.actionTimer + 1
|
|
end
|
|
|
|
--- @param m MarioState
|
|
function peach_update(m)
|
|
if (m.input & INPUT_A_DOWN) ~= 0 and m.vel.y < -10 and m.prevAction ~= ACT_FLOAT and floatActs[m.action] then
|
|
set_mario_action(m, ACT_FLOAT, 0)
|
|
end
|
|
end
|
|
|
|
hook_mario_action(ACT_FLOAT, act_float)
|