Hookshot Anywhere (#699)
Some checks failed
generate-builds / generate-2ship-otr (push) Has been cancelled
generate-builds / build-macos (push) Has been cancelled
generate-builds / build-linux (push) Has been cancelled
generate-builds / build-windows (push) Has been cancelled

* 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:
cplaster 2024-11-19 19:51:17 -06:00 committed by GitHub
parent 5a735395da
commit ce4bf1f4cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 22 additions and 2 deletions

View File

@ -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();

View File

@ -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.",

View File

@ -8,5 +8,6 @@ void RegisterTimeStopInTemples();
void RegisterUnbreakableRazorSword();
void RegisterUnrestrictedItems();
void RegisterElegyAnywhere();
void RegisterHookshotAnywhere();
#endif // CHEATS_H

View 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;
}
});
}

View File

@ -14,6 +14,7 @@ void InitEnhancements() {
RegisterUnrestrictedItems();
RegisterTimeStopInTemples();
RegisterElegyAnywhere();
RegisterHookshotAnywhere();
// Clock
RegisterTextBasedClock();

View File

@ -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 {

View File

@ -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) {