mirror of
https://github.com/HarbourMasters/2ship2harkinian.git
synced 2024-11-23 05:59:40 +00:00
Hookshot Anywhere (#699)
* initial commit * formatting fix * formatting fix * remove conflict files * Updated per garrettjoecox suggestions * Cleanup comments * initial commit * formatting fix * Updated per garrettjoecox suggestions * Cleanup comments * Merge fixes * cleanup for review feedback --------- Co-authored-by: Archez <archez39@me.com>
This commit is contained in:
parent
5a735395da
commit
ce4bf1f4cc
@ -819,6 +819,9 @@ void DrawCheatsMenu() {
|
||||
UIWidgets::CVarCheckbox("No Clip", "gCheats.NoClip");
|
||||
UIWidgets::CVarCheckbox("Unbreakable Razor Sword", "gCheats.UnbreakableRazorSword");
|
||||
UIWidgets::CVarCheckbox("Unrestricted Items", "gCheats.UnrestrictedItems");
|
||||
UIWidgets::CVarCheckbox("Hookshot Anywhere", "gCheats.HookshotAnywhere",
|
||||
{ .tooltip = "Allows most surfaces to be hookshot-able" });
|
||||
|
||||
if (UIWidgets::CVarCheckbox("Moon Jump on L", "gCheats.MoonJumpOnL",
|
||||
{ .tooltip = "Holding L makes you float into the air" })) {
|
||||
RegisterMoonJumpOnL();
|
||||
|
@ -1019,6 +1019,8 @@ void AddEnhancements() {
|
||||
"Allows to Razor Sword to be used indefinitely without dulling its blade.", WIDGET_CVAR_CHECKBOX },
|
||||
{ "Unrestricted Items", "gCheats.UnrestrictedItems", "Allows all Forms to use all Items.",
|
||||
WIDGET_CVAR_CHECKBOX },
|
||||
{ "Hookshot Anywhere", "gCheats.HookshotAnywhere", "Allows most surfaces to be hookshot-able",
|
||||
WIDGET_CVAR_CHECKBOX },
|
||||
{ "Moon Jump on L",
|
||||
"gCheats.MoonJumpOnL",
|
||||
"Holding L makes you float into the air.",
|
||||
|
@ -8,5 +8,6 @@ void RegisterTimeStopInTemples();
|
||||
void RegisterUnbreakableRazorSword();
|
||||
void RegisterUnrestrictedItems();
|
||||
void RegisterElegyAnywhere();
|
||||
void RegisterHookshotAnywhere();
|
||||
|
||||
#endif // CHEATS_H
|
||||
|
10
mm/2s2h/Enhancements/Cheats/HookshotAnywhere.cpp
Normal file
10
mm/2s2h/Enhancements/Cheats/HookshotAnywhere.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include <libultraship/bridge.h>
|
||||
#include "GameInteractor/GameInteractor.h"
|
||||
|
||||
void RegisterHookshotAnywhere() {
|
||||
REGISTER_VB_SHOULD(VB_BE_HOOKSHOT_SURFACE, {
|
||||
if (CVarGetInteger("gCheats.HookshotAnywhere", 0)) {
|
||||
*should = true;
|
||||
}
|
||||
});
|
||||
}
|
@ -14,6 +14,7 @@ void InitEnhancements() {
|
||||
RegisterUnrestrictedItems();
|
||||
RegisterTimeStopInTemples();
|
||||
RegisterElegyAnywhere();
|
||||
RegisterHookshotAnywhere();
|
||||
|
||||
// Clock
|
||||
RegisterTextBasedClock();
|
||||
|
@ -72,6 +72,7 @@ typedef enum {
|
||||
VB_CHECK_HELD_ITEM_BUTTON_PRESS,
|
||||
VB_MAGIC_SPIN_ATTACK_CHECK_FORM,
|
||||
VB_TRANSFORM_THUNDER_MATRIX,
|
||||
VB_BE_HOOKSHOT_SURFACE,
|
||||
} GIVanillaBehavior;
|
||||
|
||||
typedef enum {
|
||||
|
@ -4,9 +4,10 @@
|
||||
#include "fixed_point.h"
|
||||
#include "vt.h"
|
||||
#include "overlays/kaleido_scope/ovl_kaleido_scope/z_kaleido_scope.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include "2s2h/BenPort.h"
|
||||
#include "2s2h/GameInteractor/GameInteractor.h"
|
||||
|
||||
#define DYNA_RAYCAST_FLOORS 1
|
||||
#define DYNA_RAYCAST_WALLS 2
|
||||
@ -4276,7 +4277,8 @@ u32 SurfaceType_GetEcho(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId)
|
||||
}
|
||||
|
||||
u32 SurfaceType_IsHookshotSurface(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
|
||||
return SurfaceType_GetData(colCtx, poly, bgId, 1) >> 17 & 1;
|
||||
return GameInteractor_Should(VB_BE_HOOKSHOT_SURFACE, SurfaceType_GetData(colCtx, poly, bgId, 1) >> 17 & 1, poly,
|
||||
bgId);
|
||||
}
|
||||
|
||||
s32 SurfaceType_IsIgnoredByEntities(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) {
|
||||
|
Loading…
Reference in New Issue
Block a user