mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-10-31 23:55:06 -04:00
Redo frog VB
This commit is contained in:
parent
7f4bd3e98c
commit
20ddc7a536
@ -286,6 +286,9 @@ typedef enum {
|
||||
VB_GANON_HEAL_BEFORE_FIGHT,
|
||||
VB_FREEZE_LINK_FOR_BLOCK_THROW,
|
||||
VB_MOVE_THROWN_ACTOR,
|
||||
// Opt: *EnFr
|
||||
// Vanilla condition: this->reward == GI_NONE
|
||||
VB_FROGS_GO_TO_IDLE,
|
||||
|
||||
/*** Play Cutscenes ***/
|
||||
|
||||
@ -378,8 +381,6 @@ typedef enum {
|
||||
VB_GIVE_ITEM_FROM_MEDIGORON,
|
||||
// Opt: *EnMs
|
||||
VB_GIVE_ITEM_FROM_MAGIC_BEAN_SALESMAN,
|
||||
// Opt: *EnFr
|
||||
VB_GIVE_ITEM_FROM_FROGS,
|
||||
// Opt: *EnSkj
|
||||
VB_GIVE_ITEM_FROM_OCARINA_MEMORY_GAME,
|
||||
// Opt: *EnSkj
|
||||
|
@ -994,19 +994,15 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VB_GIVE_ITEM_FROM_FROGS: {
|
||||
case VB_FROGS_GO_TO_IDLE: {
|
||||
EnFr* enFr = va_arg(args, EnFr*);
|
||||
|
||||
// Skip GiveReward+SetIdle action func if the reward is an ice trap
|
||||
if (enFr->actionFunc == (EnFrActionFunc)EnFr_GiveReward) {
|
||||
RandomizerCheck rc = EnFr_RandomizerCheckFromSongIndex(enFr->songIndex);
|
||||
GetItemEntry gi = Rando::Context::GetInstance()->GetFinalGIEntry(rc, true, (GetItemID)Rando::StaticData::GetLocation(rc)->GetVanillaItem());
|
||||
if (gi.getItemId == RG_ICE_TRAP) {
|
||||
enFr->actionFunc = (EnFrActionFunc)EnFr_Idle;
|
||||
}
|
||||
if (
|
||||
(enFr->songIndex >= FROG_STORMS && enFr->reward == GI_HEART_PIECE) ||
|
||||
(enFr->songIndex < FROG_STORMS && enFr->reward == GI_RUPEE_PURPLE)
|
||||
) {
|
||||
*should = true;
|
||||
}
|
||||
|
||||
*should = false;
|
||||
break;
|
||||
}
|
||||
case VB_TRADE_POCKET_CUCCO: {
|
||||
|
@ -974,9 +974,7 @@ void EnFr_SetReward(EnFr* this, PlayState* play) {
|
||||
if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) {
|
||||
gSaveContext.eventChkInf[13] |= sSongIndex[songIndex];
|
||||
GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]);
|
||||
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_FROGS, true, this)) {
|
||||
this->reward = GI_RUPEE_PURPLE;
|
||||
}
|
||||
this->reward = GI_RUPEE_PURPLE;
|
||||
} else {
|
||||
this->reward = GI_RUPEE_BLUE;
|
||||
}
|
||||
@ -984,9 +982,7 @@ void EnFr_SetReward(EnFr* this, PlayState* play) {
|
||||
if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) {
|
||||
gSaveContext.eventChkInf[13] |= sSongIndex[songIndex];
|
||||
GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]);
|
||||
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_FROGS, true, this)) {
|
||||
this->reward = GI_HEART_PIECE;
|
||||
}
|
||||
this->reward = GI_HEART_PIECE;
|
||||
} else {
|
||||
this->reward = GI_RUPEE_BLUE;
|
||||
}
|
||||
@ -994,9 +990,7 @@ void EnFr_SetReward(EnFr* this, PlayState* play) {
|
||||
if (!(gSaveContext.eventChkInf[13] & sSongIndex[songIndex])) {
|
||||
gSaveContext.eventChkInf[13] |= sSongIndex[songIndex];
|
||||
GameInteractor_ExecuteOnFlagSet(FLAG_EVENT_CHECK_INF, (EVENTCHKINF_SONGS_FOR_FROGS_INDEX << 4) + sSongIndexShift[songIndex]);
|
||||
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_FROGS, true, this)) {
|
||||
this->reward = GI_HEART_PIECE;
|
||||
}
|
||||
this->reward = GI_HEART_PIECE;
|
||||
} else {
|
||||
this->reward = GI_RUPEE_PURPLE;
|
||||
}
|
||||
@ -1042,18 +1036,16 @@ void EnFr_Deactivate(EnFr* this, PlayState* play) {
|
||||
|
||||
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_FROG_CRY_0);
|
||||
if (this->reward == GI_NONE) {
|
||||
if (GameInteractor_Should(VB_FROGS_GO_TO_IDLE, this->reward == GI_NONE, this)) {
|
||||
this->actionFunc = EnFr_Idle;
|
||||
} else {
|
||||
this->actionFunc = EnFr_GiveReward;
|
||||
if (GameInteractor_Should(VB_GIVE_ITEM_FROM_FROGS, true, this)) {
|
||||
Actor_OfferGetItem(&this->actor, play, this->reward, 30.0f, 100.0f);
|
||||
}
|
||||
Actor_OfferGetItem(&this->actor, play, this->reward, 30.0f, 100.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void EnFr_GiveReward(EnFr* this, PlayState* play) {
|
||||
if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(VB_GIVE_ITEM_FROM_FROGS, true, this)) {
|
||||
if (Actor_HasParent(&this->actor, play)) {
|
||||
this->actor.parent = NULL;
|
||||
this->actionFunc = EnFr_SetIdle;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user