mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
Merge 7133eba4cf
into fbbfc07ff1
This commit is contained in:
commit
84ce5402e3
4 changed files with 41 additions and 1 deletions
26
soh/soh/Enhancements/TimeSavers/FasterShadowShip.cpp
Normal file
26
soh/soh/Enhancements/TimeSavers/FasterShadowShip.cpp
Normal 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") });
|
|
@ -1687,6 +1687,15 @@ typedef enum {
|
|||
// - `*int16_t` - original next entrance index (`play->setupExitList[exitIndex - 1]`)
|
||||
VB_SET_VOIDOUT_FROM_SURFACE,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// true
|
||||
// ```
|
||||
// #### `args`
|
||||
// - BgHakaShip*
|
||||
// - PlayState*
|
||||
VB_SHADOW_SHIP_SET_SPEED,
|
||||
|
||||
// #### `result`
|
||||
// ```c
|
||||
// (!CHECK_OWNED_EQUIP(EQUIP_TYPE_BOOTS, EQUIP_INV_BOOTS_IRON) &&
|
||||
|
|
|
@ -365,6 +365,9 @@ void SohMenu::AddMenuEnhancements() {
|
|||
AddWidget(path, "Faster Heavy Block Lift", WIDGET_CVAR_CHECKBOX)
|
||||
.CVar(CVAR_ENHANCEMENT("FasterHeavyBlockLift"))
|
||||
.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)
|
||||
.CVar(CVAR_ENHANCEMENT("FastChests"))
|
||||
.Options(CheckboxOptions().Tooltip("Makes Link always kick the chest to open it, instead of doing the longer "
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#include "z_bg_haka_ship.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)
|
||||
|
||||
void BgHakaShip_Init(Actor* thisx, PlayState* play);
|
||||
|
@ -133,7 +135,7 @@ void BgHakaShip_Move(BgHakaShip* this, PlayState* play) {
|
|||
this->dyna.actor.speedXZ = 0.0f;
|
||||
Message_StartTextbox(play, 0x5071, NULL);
|
||||
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);
|
||||
}
|
||||
child = this->dyna.actor.child;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue