This commit is contained in:
Philip Dubé 2025-04-27 00:54:56 +02:00 committed by GitHub
commit 84ce5402e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 41 additions and 1 deletions

View file

@ -0,0 +1,26 @@
#include "soh/Enhancements/game-interactor/GameInteractor.h"
#include "soh/ShipInit.hpp"
extern "C" {
#include "functions.h"
#include "src/overlays/actors/ovl_Bg_Haka_Ship/z_bg_haka_ship.h"
}
void RegisterFasterShadowShip() {
COND_VB_SHOULD(VB_SHADOW_SHIP_SET_SPEED, CVarGetInteger(CVAR_ENHANCEMENT("FasterShadowShip"), 0), {
BgHakaShip* ship = va_arg(args, BgHakaShip*);
PlayState* play = va_arg(args, PlayState*);
if (!Play_InCsMode(play)) {
if (Actor_FindNearby(play, &ship->dyna.actor, ACTOR_EN_TEST, ACTORCAT_ENEMY, 800.0) == NULL &&
Actor_FindNearby(play, &ship->dyna.actor, ACTOR_PLAYER, ACTORCAT_PLAYER, 450.0) != NULL) {
*should = false;
ship->dyna.actor.speedXZ = 25.0f;
} else if (ship->dyna.actor.speedXZ > 4.0f) {
*should = false;
ship->dyna.actor.speedXZ = 4.0f;
}
}
});
}
static RegisterShipInitFunc initFunc(RegisterFasterShadowShip, { CVAR_ENHANCEMENT("FasterShadowShip") });

View file

@ -1687,6 +1687,15 @@ typedef enum {
// - `*int16_t` - original next entrance index (`play->setupExitList[exitIndex - 1]`) // - `*int16_t` - original next entrance index (`play->setupExitList[exitIndex - 1]`)
VB_SET_VOIDOUT_FROM_SURFACE, VB_SET_VOIDOUT_FROM_SURFACE,
// #### `result`
// ```c
// true
// ```
// #### `args`
// - BgHakaShip*
// - PlayState*
VB_SHADOW_SHIP_SET_SPEED,
// #### `result` // #### `result`
// ```c // ```c
// (!CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) && // (!CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) &&

View file

@ -365,6 +365,9 @@ void SohMenu::AddMenuEnhancements() {
AddWidget(path, "Faster Heavy Block Lift", WIDGET_CVAR_CHECKBOX) AddWidget(path, "Faster Heavy Block Lift", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FasterHeavyBlockLift")) .CVar(CVAR_ENHANCEMENT("FasterHeavyBlockLift"))
.Options(CheckboxOptions().Tooltip("Speeds up lifting Silver Rocks and Obelisks.")); .Options(CheckboxOptions().Tooltip("Speeds up lifting Silver Rocks and Obelisks."));
AddWidget(path, "Faster Shadow Ship", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FasterShadowShip"))
.Options(CheckboxOptions().Tooltip("Speeds up ship in Shadow Temple."));
AddWidget(path, "Fast Chests", WIDGET_CVAR_CHECKBOX) AddWidget(path, "Fast Chests", WIDGET_CVAR_CHECKBOX)
.CVar(CVAR_ENHANCEMENT("FastChests")) .CVar(CVAR_ENHANCEMENT("FastChests"))
.Options(CheckboxOptions().Tooltip("Makes Link always kick the chest to open it, instead of doing the longer " .Options(CheckboxOptions().Tooltip("Makes Link always kick the chest to open it, instead of doing the longer "

View file

@ -7,6 +7,8 @@
#include "z_bg_haka_ship.h" #include "z_bg_haka_ship.h"
#include "objects/object_haka_objects/object_haka_objects.h" #include "objects/object_haka_objects/object_haka_objects.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED) #define FLAGS (ACTOR_FLAG_UPDATE_CULLING_DISABLED | ACTOR_FLAG_DRAW_CULLING_DISABLED)
void BgHakaShip_Init(Actor* thisx, PlayState* play); void BgHakaShip_Init(Actor* thisx, PlayState* play);
@ -133,7 +135,7 @@ void BgHakaShip_Move(BgHakaShip* this, PlayState* play) {
this->dyna.actor.speedXZ = 0.0f; this->dyna.actor.speedXZ = 0.0f;
Message_StartTextbox(play, 0x5071, NULL); Message_StartTextbox(play, 0x5071, NULL);
this->actionFunc = BgHakaShip_SetupCrash; this->actionFunc = BgHakaShip_SetupCrash;
} else { } else if (GameInteractor_Should(VB_SHADOW_SHIP_SET_SPEED, true, this, play)) {
Math_StepToF(&this->dyna.actor.speedXZ, 4.0f, 0.2f); Math_StepToF(&this->dyna.actor.speedXZ, 4.0f, 0.2f);
} }
child = this->dyna.actor.child; child = this->dyna.actor.child;