summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaw <Tawling@users.noreply.github.com>2024-02-10 09:06:34 -0800
committerTaw <Tawling@users.noreply.github.com>2024-02-12 08:26:36 -0800
commit4e5b92fdf385e34da94049071233dbe9c872cbca (patch)
treee53e2293f0910b4f5dc39986cc8d9f502edaed04
parent596ea5ebbb3e5a5dfab72fb7bee6d4802d8b13d4 (diff)
Man On Roof
-rw-r--r--soh/soh/Enhancements/game-interactor/GameInteractor.h1
-rw-r--r--soh/soh/Enhancements/randomizer/hook_handlers.cpp1
-rw-r--r--soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c13
3 files changed, 6 insertions, 9 deletions
diff --git a/soh/soh/Enhancements/game-interactor/GameInteractor.h b/soh/soh/Enhancements/game-interactor/GameInteractor.h
index c6fb7c721..e615e5954 100644
--- a/soh/soh/Enhancements/game-interactor/GameInteractor.h
+++ b/soh/soh/Enhancements/game-interactor/GameInteractor.h
@@ -268,6 +268,7 @@ typedef enum {
GI_VB_GIVE_ITEM_FROM_MAGIC_BEAN_SALESMAN,
// Opt: *EnFr
GI_VB_GIVE_ITEM_FROM_FROGS,
+ GI_VB_GIVE_ITEM_FROM_MAN_ON_ROOF,
GI_VB_GIVE_ITEM_FAIRY_OCARINA,
GI_VB_GIVE_ITEM_WEIRD_EGG,
diff --git a/soh/soh/Enhancements/randomizer/hook_handlers.cpp b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
index bf236a3ba..6b29ac567 100644
--- a/soh/soh/Enhancements/randomizer/hook_handlers.cpp
+++ b/soh/soh/Enhancements/randomizer/hook_handlers.cpp
@@ -782,6 +782,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void
case GI_VB_ANJU_SET_OBTAINED_TRADE_ITEM:
case GI_VB_GIVE_ITEM_FROM_ROLLING_GORON_AS_CHILD:
case GI_VB_GIVE_ITEM_FROM_LAB_DIVE:
+ case GI_VB_GIVE_ITEM_FROM_MAN_ON_ROOF:
case GI_VB_GIVE_ITEM_SKULL_TOKEN:
case GI_VB_GIVE_ITEM_FROM_BLUE_WARP:
case GI_VB_GIVE_ITEM_FAIRY_OCARINA:
diff --git a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c
index 15ebd759c..5093d47d2 100644
--- a/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c
+++ b/soh/src/overlays/actors/ovl_En_Ani/z_en_ani.c
@@ -6,6 +6,7 @@
#include "z_en_ani.h"
#include "objects/object_ani/object_ani.h"
+#include "soh/Enhancements/game-interactor/GameInteractor.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY)
@@ -119,7 +120,7 @@ void func_809B0524(EnAni* this, PlayState* play) {
}
void func_809B0558(EnAni* this, PlayState* play) {
- if (Actor_HasParent(&this->actor, play)) {
+ if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true, NULL)) {
this->actor.parent = NULL;
if (!LINK_IS_ADULT) {
EnAni_SetupAction(this, func_809B04F0);
@@ -128,11 +129,8 @@ void func_809B0558(EnAni* this, PlayState* play) {
}
Flags_SetItemGetInf(ITEMGETINF_15);
} else {
- if (!IS_RANDO) {
+ if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true, NULL)) {
func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f);
- } else {
- GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
- GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 200.0f);
}
}
}
@@ -142,11 +140,8 @@ void func_809B05F0(EnAni* this, PlayState* play) {
EnAni_SetupAction(this, func_809B0558);
}
- if (!IS_RANDO) {
+ if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_MAN_ON_ROOF, true, NULL)) {
func_8002F434(&this->actor, play, GI_HEART_PIECE, 10000.0f, 200.0f);
- } else {
- GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_KAK_MAN_ON_ROOF, GI_HEART_PIECE);
- GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 200.0f);
}
}