vb target in woods (#95)

* do some target in woods VB stuff

* skip deku scrub hopping out animation

* replace a couple IS_RANDOs

* cleanup
This commit is contained in:
briaguya 2024-04-03 21:11:13 -04:00 committed by GitHub
parent 0334c4e354
commit d6c512904b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 29 additions and 25 deletions

View File

@ -290,6 +290,8 @@ typedef enum {
GI_VB_GIVE_ITEM_FROM_MAN_ON_ROOF,
// Opt: *EnSyatekiMan
GI_VB_GIVE_ITEM_FROM_SHOOTING_GALLERY,
// Opt: *EnExItem
GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS,
GI_VB_GIVE_ITEM_FAIRY_OCARINA,
GI_VB_GIVE_ITEM_WEIRD_EGG,

View File

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

View File

@ -296,6 +296,14 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void*
*should = false;
break;
}
case ACTOR_EN_EX_ITEM: {
*should = false;
break;
}
case ACTOR_EN_DNT_NOMAL: {
*should = false;
break;
}
case ACTOR_EN_TA:
case ACTOR_DOOR_SHUTTER:
case ACTOR_BG_ICE_SHUTTER:

View File

@ -12,6 +12,7 @@
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#include "objects/object_hintnuts/object_hintnuts.h"
#include "vt.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED)
@ -252,7 +253,7 @@ void EnDntNomal_TargetWait(EnDntNomal* this, PlayState* play) {
if (!LINK_IS_ADULT && !Flags_GetItemGetInf(ITEMGETINF_1D)) {
this->hitCounter++;
if (this->hitCounter >= 3) {
if(IS_RANDO) {
if (!GameInteractor_Should(GI_VB_PLAY_ONEPOINT_ACTOR_CS, true, &this->actor)) {
this->actionFunc = EnDntNomal_TargetGivePrize;
} else {
OnePointCutscene_Init(play, 4140, -99, &this->actor, MAIN_CAM);

View File

@ -8,6 +8,7 @@
#include "overlays/actors/ovl_En_Bom_Bowl_Pit/z_en_bom_bowl_pit.h"
#include "objects/gameplay_keep/gameplay_keep.h"
#include "vt.h"
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
#define FLAGS (ACTOR_FLAG_UPDATE_WHILE_CULLED | ACTOR_FLAG_DRAW_WHILE_CULLED)
@ -376,7 +377,7 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play) {
Math_SmoothStepToS(&this->actor.shape.rot.y, -0x4000, 5, 0x1000, 0);
}
if (!IS_RANDO && this->timer != 0) {
if (GameInteractor_Should(GI_VB_PLAY_ONEPOINT_ACTOR_CS, true, &this->actor) && this->timer != 0) {
if (this->prizeRotateTimer != 0) {
tmpf1 = play->view.lookAt.x - play->view.eye.x;
tmpf2 = play->view.lookAt.y - 10.0f - play->view.eye.y;
@ -396,50 +397,41 @@ void EnExItem_TargetPrizeApproach(EnExItem* this, PlayState* play) {
this->actor.world.pos.z += (tmpf3 / tmpf4) * 5.0f;
}
} else {
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
s32 getItemId;
this->actor.draw = NULL;
Player_SetCsActionWithHaltedActors(play, NULL, 7);
this->actor.parent = NULL;
if (IS_RANDO) {
if (!GameInteractor_Should(GI_VB_PLAY_ONEPOINT_ACTOR_CS, true, &this->actor)) {
GET_PLAYER(play)->stateFlags1 &= ~(PLAYER_STATE1_GETTING_ITEM | PLAYER_STATE1_ITEM_OVER_HEAD);
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
getItemId = getItemEntry.getItemId;
} else {
if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) {
getItemId = GI_BULLET_BAG_40;
} else {
getItemId = GI_BULLET_BAG_50;
}
}
if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) {
Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f);
if (CUR_UPG_VALUE(UPG_BULLET_BAG) == 1) {
getItemId = GI_BULLET_BAG_40;
} else {
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 2000.0f, 1000.0f);
getItemId = GI_BULLET_BAG_50;
}
if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS, true, &this->actor)) {
Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f);
}
this->actionFunc = EnExItem_TargetPrizeGive;
}
}
void EnExItem_TargetPrizeGive(EnExItem* this, PlayState* play) {
if (Actor_HasParent(&this->actor, play)) {
if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS, true, &this->actor)) {
this->actionFunc = EnExItem_TargetPrizeFinish;
} else {
if (!IS_RANDO) {
s32 getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40;
Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f);
} else {
GetItemEntry getItemEntry = Randomizer_GetItemFromKnownCheck(RC_LW_TARGET_IN_WOODS, GI_BULLET_BAG_50);
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 2000.0f, 1000.0f);
}
s32 getItemId = (CUR_UPG_VALUE(UPG_BULLET_BAG) == 2) ? GI_BULLET_BAG_50 : GI_BULLET_BAG_40;
Actor_OfferGetItem(&this->actor, play, getItemId, 2000.0f, 1000.0f);
}
}
void EnExItem_TargetPrizeFinish(EnExItem* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
if (!GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_TARGET_IN_WOODS, true, &this->actor) || (Message_GetState(&play->msgCtx) == TEXT_STATE_DONE) && Message_ShouldAdvance(play)) {
// "Successful completion"
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ 正常終了 ☆☆☆☆☆ \n" VT_RST);
Flags_SetItemGetInf(ITEMGETINF_1D);