vb diving game (#100)

This commit is contained in:
briaguya 2024-04-04 11:30:45 -04:00 committed by GitHub
parent 249490909f
commit 1e9cba1d61
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 10 deletions

View File

@ -292,6 +292,8 @@ typedef enum {
GI_VB_GIVE_ITEM_FROM_SHOOTING_GALLERY, GI_VB_GIVE_ITEM_FROM_SHOOTING_GALLERY,
// Opt: *EnExItem // Opt: *EnExItem
GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS, GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS,
// Opt: *EnDivingGame
GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME,
GI_VB_GIVE_ITEM_FAIRY_OCARINA, GI_VB_GIVE_ITEM_FAIRY_OCARINA,
GI_VB_GIVE_ITEM_WEIRD_EGG, GI_VB_GIVE_ITEM_WEIRD_EGG,

View File

@ -768,6 +768,7 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void
case GI_VB_TRADE_TIMER_FROG: case GI_VB_TRADE_TIMER_FROG:
case GI_VB_ANJU_SET_OBTAINED_TRADE_ITEM: case GI_VB_ANJU_SET_OBTAINED_TRADE_ITEM:
case GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS: case GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS:
case GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME:
case GI_VB_GIVE_ITEM_FROM_GORON: case GI_VB_GIVE_ITEM_FROM_GORON:
case GI_VB_GIVE_ITEM_FROM_LAB_DIVE: case GI_VB_GIVE_ITEM_FROM_LAB_DIVE:
case GI_VB_GIVE_ITEM_FROM_SKULL_KID_SARIAS_SONG: case GI_VB_GIVE_ITEM_FROM_SKULL_KID_SARIAS_SONG:

View File

@ -8,6 +8,7 @@
#include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h" #include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h"
#include "objects/object_zo/object_zo.h" #include "objects/object_zo/object_zo.h"
#include "vt.h" #include "vt.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED) #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_UPDATE_WHILE_CULLED)
@ -455,11 +456,8 @@ void func_809EEA00(EnDivingGame* this, PlayState* play) {
if ((this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play))) { if ((this->unk_292 == Message_GetState(&play->msgCtx) && Message_ShouldAdvance(play))) {
Message_CloseTextbox(play); Message_CloseTextbox(play);
this->actor.parent = NULL; this->actor.parent = NULL;
if (!IS_RANDO) { if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME, true, &this->actor)) {
Actor_OfferGetItem(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); Actor_OfferGetItem(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f);
} else {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER);
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 90.0f, 10.0f);
} }
this->actionFunc = func_809EEA90; this->actionFunc = func_809EEA90;
} }
@ -467,14 +465,11 @@ void func_809EEA00(EnDivingGame* this, PlayState* play) {
void func_809EEA90(EnDivingGame* this, PlayState* play) { void func_809EEA90(EnDivingGame* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (Actor_HasParent(&this->actor, play)) { if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME, true, &this->actor)) {
this->actionFunc = func_809EEAF8; this->actionFunc = func_809EEAF8;
} else { } else {
if (!IS_RANDO) { if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME, true, &this->actor)) {
Actor_OfferGetItem(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f); Actor_OfferGetItem(&this->actor, play, GI_SCALE_SILVER, 90.0f, 10.0f);
} else {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_ZD_DIVING_MINIGAME, GI_SCALE_SILVER);
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 90.0f, 10.0f);
} }
} }
} }
@ -482,7 +477,8 @@ void func_809EEA90(EnDivingGame* this, PlayState* play) {
// Award the scale? // Award the scale?
void func_809EEAF8(EnDivingGame* this, PlayState* play) { void func_809EEAF8(EnDivingGame* this, PlayState* play) {
SkelAnime_Update(&this->skelAnime); SkelAnime_Update(&this->skelAnime);
if (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) { if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE && Message_ShouldAdvance(play)) ||
!GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME, true, &this->actor)) {
// "Successful completion" // "Successful completion"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST); osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST);
this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0; this->allRupeesThrown = this->state = this->phase = this->unk_2A2 = this->grabbedRupeesCounter = 0;