2024-04-20 16:20:27 -04:00
|
|
|
#include <libultraship/bridge.h>
|
2024-10-05 10:33:10 -05:00
|
|
|
#include "2s2h/GameInteractor/GameInteractor.h"
|
2024-04-20 16:20:27 -04:00
|
|
|
#include "variables.h"
|
|
|
|
|
|
2024-05-28 19:14:39 +01:00
|
|
|
static HOOK_ID moonJumpOnLGameStateUpdateHookId = 0;
|
2024-04-20 16:20:27 -04:00
|
|
|
void RegisterMoonJumpOnL() {
|
|
|
|
|
if (moonJumpOnLGameStateUpdateHookId) {
|
2024-05-22 09:52:56 -04:00
|
|
|
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnGameStateUpdate>(
|
|
|
|
|
moonJumpOnLGameStateUpdateHookId);
|
2024-04-20 16:20:27 -04:00
|
|
|
moonJumpOnLGameStateUpdateHookId = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (CVarGetInteger("gCheats.MoonJumpOnL", 0)) {
|
2024-05-22 09:52:56 -04:00
|
|
|
moonJumpOnLGameStateUpdateHookId =
|
|
|
|
|
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameStateUpdate>([]() {
|
|
|
|
|
if (gPlayState == nullptr)
|
|
|
|
|
return;
|
2024-04-20 16:20:27 -04:00
|
|
|
|
2024-05-22 09:52:56 -04:00
|
|
|
Player* player = GET_PLAYER(gPlayState);
|
2024-04-20 16:20:27 -04:00
|
|
|
|
2024-06-15 15:02:30 -04:00
|
|
|
if (player != nullptr && CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) {
|
2024-05-22 09:52:56 -04:00
|
|
|
player->actor.velocity.y = 6.34375f;
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-04-20 16:20:27 -04:00
|
|
|
}
|
|
|
|
|
}
|