-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate enhancements to ShipInit pattern
- Loading branch information
1 parent
3917e3b
commit 1ad9bc4
Showing
44 changed files
with
850 additions
and
1,023 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#include <libultraship/bridge.h> | ||
#include "2s2h/GameInteractor/GameInteractor.h" | ||
#include "GameInteractor/GameInteractor.h" | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
#define CVAR_NAME "gCheats.ElegyAnywhere" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 0) | ||
|
||
void RegisterElegyAnywhere() { | ||
REGISTER_VB_SHOULD(VB_ELEGY_CHECK_SCENE, { | ||
if (CVarGetInteger("gCheats.ElegyAnywhere", 0)) { | ||
*should = true; | ||
} | ||
}); | ||
COND_VB_SHOULD(VB_ELEGY_CHECK_SCENE, CVAR, { *should = true; }); | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterElegyAnywhere, { CVAR_NAME }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#include <libultraship/bridge.h> | ||
#include "GameInteractor/GameInteractor.h" | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
#define CVAR_NAME "gCheats.HookshotAnywhere" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 0) | ||
|
||
void RegisterHookshotAnywhere() { | ||
REGISTER_VB_SHOULD(VB_BE_HOOKSHOT_SURFACE, { | ||
if (CVarGetInteger("gCheats.HookshotAnywhere", 0)) { | ||
*should = true; | ||
} | ||
}); | ||
COND_VB_SHOULD(VB_BE_HOOKSHOT_SURFACE, CVAR, { *should = true; }); | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterHookshotAnywhere, { CVAR_NAME }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
#include <libultraship/bridge.h> | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
extern "C" { | ||
#include "z64.h"; | ||
#include "variables.h"; | ||
extern f32 D_8085D958[2]; | ||
} | ||
|
||
#define CVAR_NAME "gCheats.LongerFlowerGlide" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 0) | ||
|
||
void RegisterLongerFlowerGlide() { | ||
if (CVarGetInteger("gCheats.LongerFlowerGlide", 0)) { | ||
if (CVAR) { | ||
D_8085D958[0] = 99999.9f; | ||
D_8085D958[1] = 99999.9f; | ||
} else { | ||
D_8085D958[0] = 600.0f; | ||
D_8085D958[1] = 960.0f; | ||
} | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterLongerFlowerGlide, { CVAR_NAME }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,22 @@ | ||
#include <libultraship/bridge.h> | ||
#include "2s2h/GameInteractor/GameInteractor.h" | ||
#include "variables.h" | ||
#include "2s2h/ShipInit.hpp" | ||
|
||
static HOOK_ID moonJumpOnLGameStateUpdateHookId = 0; | ||
void RegisterMoonJumpOnL() { | ||
if (moonJumpOnLGameStateUpdateHookId) { | ||
GameInteractor::Instance->UnregisterGameHook<GameInteractor::OnGameStateUpdate>( | ||
moonJumpOnLGameStateUpdateHookId); | ||
moonJumpOnLGameStateUpdateHookId = 0; | ||
} | ||
extern "C" { | ||
#include "variables.h" | ||
} | ||
|
||
if (CVarGetInteger("gCheats.MoonJumpOnL", 0)) { | ||
moonJumpOnLGameStateUpdateHookId = | ||
GameInteractor::Instance->RegisterGameHook<GameInteractor::OnGameStateUpdate>([]() { | ||
if (gPlayState == nullptr) | ||
return; | ||
#define CVAR_NAME "gCheats.MoonJumpOnL" | ||
#define CVAR CVarGetInteger(CVAR_NAME, 0) | ||
|
||
Player* player = GET_PLAYER(gPlayState); | ||
void RegisterMoonJump() { | ||
COND_ID_HOOK(OnActorUpdate, ACTOR_PLAYER, CVAR, [](Actor* actor) { | ||
Player* player = GET_PLAYER(gPlayState); | ||
|
||
if (player != nullptr && CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) { | ||
player->actor.velocity.y = 6.34375f; | ||
} | ||
}); | ||
} | ||
if (player != nullptr && CHECK_BTN_ANY(gPlayState->state.input[0].cur.button, BTN_L)) { | ||
player->actor.velocity.y = 6.34375f; | ||
} | ||
}); | ||
} | ||
|
||
static RegisterShipInitFunc initFunc(RegisterMoonJump, { CVAR_NAME }); |
Oops, something went wrong.