Merge branch 'develop' of github.com:HarbourMasters/Shipwright into aManchipelago

This commit is contained in:
Garrett
2025-11-16 08:12:13 -06:00
110 changed files with 4961 additions and 1115 deletions
+26 -8
View File
@@ -1256,10 +1256,16 @@ void Actor_Init(Actor* actor, PlayState* play) {
ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f);
if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
Actor_SetObjectDependency(play, actor);
actor->init(actor, play);
actor->init = NULL;
GameInteractor_ExecuteOnActorInit(actor);
if (GameInteractor_ShouldActorInit(actor)) {
actor->init(actor, play);
actor->init = NULL;
GameInteractor_ExecuteOnActorInit(actor);
} else {
actor->init = NULL;
Actor_Kill(actor);
}
}
}
@@ -2244,6 +2250,10 @@ void Player_PlaySfx(Actor* actor, u16 sfxId) {
Audio_PlaySoundGeneral(sfxId, &actor->projectedPos, 4, &freqMultiplier, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultReverb);
}
if (actor->id == ACTOR_PLAYER) {
GameInteractor_ExecuteOnPlayerSfx(sfxId);
}
}
void Audio_PlayActorSound2(Actor* actor, u16 sfxId) {
@@ -2624,10 +2634,16 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
if (actor->init != NULL) {
if (Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
Actor_SetObjectDependency(play, actor);
actor->init(actor, play);
actor->init = NULL;
GameInteractor_ExecuteOnActorInit(actor);
if (GameInteractor_ShouldActorInit(actor)) {
actor->init(actor, play);
actor->init = NULL;
GameInteractor_ExecuteOnActorInit(actor);
} else {
actor->init = NULL;
Actor_Kill(actor);
}
}
actor = actor->next;
} else if (!Object_IsLoaded(&play->objectCtx, actor->objBankIndex)) {
@@ -2670,8 +2686,10 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
if (actor->colorFilterTimer != 0) {
actor->colorFilterTimer--;
}
actor->update(actor, play);
GameInteractor_ExecuteOnActorUpdate(actor);
if (GameInteractor_ShouldActorUpdate(actor)) {
actor->update(actor, play);
GameInteractor_ExecuteOnActorUpdate(actor);
}
func_8003F8EC(play, &play->colCtx.dyna, actor);
}
+3 -12
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#include "textures/icon_item_static/icon_item_static.h"
#include "textures/icon_item_24_static/icon_item_24_static.h"
#include "textures/parameter_static/parameter_static.h"
@@ -204,20 +205,10 @@ u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment) {
if (equipment == EQUIP_TYPE_TUNIC) {
gSaveContext.equips.equipment |= EQUIP_VALUE_TUNIC_KOKIRI << (EQUIP_TYPE_TUNIC * 4);
// non-vanilla: remove goron and zora tunics from item buttons if assignable tunics is on
if (CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) &&
equipValue != EQUIP_VALUE_TUNIC_KOKIRI) {
ItemID item = (equipValue == EQUIP_VALUE_TUNIC_GORON ? ITEM_TUNIC_GORON : ITEM_TUNIC_ZORA);
for (int i = 1; i < ARRAY_COUNT(gSaveContext.equips.buttonItems); i++) {
if (gSaveContext.equips.buttonItems[i] == item) {
gSaveContext.equips.buttonItems[i] = ITEM_NONE;
gSaveContext.equips.cButtonSlots[i - 1] = SLOT_NONE;
}
}
}
// end non-vanilla
}
GameInteractor_ExecuteOnEquipmentDelete(equipment, equipValue);
if (equipment == EQUIP_TYPE_SWORD) {
gSaveContext.equips.buttonItems[0] = ITEM_NONE;
gSaveContext.infTable[29] = 1;
@@ -6,6 +6,7 @@
#include "z_bg_hidan_dalm.h"
#include "objects/object_hidan_objects/object_hidan_objects.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0
@@ -126,8 +127,10 @@ void BgHidanDalm_Destroy(Actor* thisx, PlayState* play) {
void BgHidanDalm_Wait(BgHidanDalm* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if ((this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(play) &&
(player->meleeWeaponAnimation == 22 || player->meleeWeaponAnimation == 23)) {
if (GameInteractor_Should(VB_HAMMER_TOTEM_BREAK,
(this->collider.base.acFlags & AC_HIT) && !Player_InCsMode(play) &&
(player->meleeWeaponAnimation == 22 || player->meleeWeaponAnimation == 23),
this)) {
this->collider.base.acFlags &= ~AC_HIT;
if ((this->collider.elements[0].info.bumperFlags & BUMP_HIT) ||
(this->collider.elements[1].info.bumperFlags & BUMP_HIT)) {
@@ -8,6 +8,7 @@
#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h"
#include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h"
#include "objects/object_hidan_objects/object_hidan_objects.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0
@@ -303,7 +304,8 @@ void BgHidanKowarerukabe_Update(Actor* thisx, PlayState* play) {
BgHidanKowarerukabe* this = (BgHidanKowarerukabe*)thisx;
s32 pad;
if (Actor_GetCollidedExplosive(play, &this->collider.base) != NULL) {
if (GameInteractor_Should(VB_FIRE_TEMPLE_BOMBABLE_WALL_BREAK,
Actor_GetCollidedExplosive(play, &this->collider.base) != NULL, this)) {
BgHidanKowarerukabe_Break(this, play);
Flags_SetSwitch(play, (this->dyna.actor.params >> 8) & 0x3F);
@@ -6,6 +6,7 @@
#include "z_door_gerudo.h"
#include "objects/object_door_gerudo/object_door_gerudo.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS 0
@@ -103,6 +104,7 @@ void func_8099485C(DoorGerudo* this, PlayState* play) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] -= 1;
Flags_SetSwitch(play, this->dyna.actor.params & 0x3F);
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex);
} else {
s32 direction = func_80994750(this, play);
@@ -391,6 +391,7 @@ void func_80996B0C(DoorShutter* this, PlayState* play) {
if (this->doorType != SHUTTER_BOSS) {
gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]--;
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex);
} else {
Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_CHAIN_KEY_UNLOCK_B);
}
@@ -209,6 +209,7 @@ void EnDoor_Idle(EnDoor* this, PlayState* play) {
Flags_SetSwitch(play, this->actor.params & 0x3F);
}
Audio_PlayActorSound2(&this->actor, NA_SE_EV_CHAIN_KEY_UNLOCK);
GameInteractor_ExecuteOnDungeonKeyUsedHooks(gSaveContext.mapIndex);
}
} else if (!Player_InCsMode(play)) {
if (fabsf(playerPosRelToDoor.y) < 20.0f && fabsf(playerPosRelToDoor.x) < 20.0f &&
+1 -1
View File
@@ -6,7 +6,7 @@
struct EnSw;
typedef void (*EnSwActionFunc)(struct EnSw* this, PlayState* play);
typedef void (*EnSwActionFunc)(struct EnSw* thisx, PlayState* play);
typedef struct EnSw {
/* 0x0000 */ Actor actor;
@@ -642,8 +642,8 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
pauseCtx->unk_1E4 = 7;
sEquipTimer = 10;
} else if (CVarGetInteger(CVAR_ENHANCEMENT("AssignableTunicsAndBoots"), 0) != 0) {
// Only allow assigning tunic and boots to c-buttons
if (pauseCtx->cursorY[PAUSE_EQUIP] > 1) {
// Only allow assigning shield, tunic and boots to c-buttons
if (pauseCtx->cursorY[PAUSE_EQUIP] > 0) {
if (CHECK_OWNED_EQUIP(pauseCtx->cursorY[PAUSE_EQUIP], pauseCtx->cursorX[PAUSE_EQUIP] - 1)) {
u16 slot = 0;
switch (cursorItem) {
@@ -665,6 +665,15 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
case ITEM_BOOTS_HOVER:
slot = SLOT_BOOTS_HOVER;
break;
case ITEM_SHIELD_DEKU:
slot = SLOT_SHIELD_DEKU;
break;
case ITEM_SHIELD_HYLIAN:
slot = SLOT_SHIELD_HYLIAN;
break;
case ITEM_SHIELD_MIRROR:
slot = SLOT_SHIELD_MIRROR;
break;
default:
break;
}