mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-08 20:38:27 -05:00
vb horseback archery (#102)
* vb horseback archery * Update soh/soh/Enhancements/randomizer/hook_handlers.cpp --------- Co-authored-by: Garrett Cox <garrettjcox@gmail.com>
This commit is contained in:
parent
6d77bbd4a9
commit
9c9fc49d32
@ -296,6 +296,8 @@ typedef enum {
|
|||||||
GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS,
|
GI_VB_GIVE_ITEM_FROM_TALONS_CHICKENS,
|
||||||
// Opt: *EnDivingGame
|
// Opt: *EnDivingGame
|
||||||
GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME,
|
GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME,
|
||||||
|
// Opt: *EnGe1
|
||||||
|
GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY,
|
||||||
// Opt: *EnSth
|
// Opt: *EnSth
|
||||||
GI_VB_GIVE_ITEM_FROM_SKULLTULA_REWARD,
|
GI_VB_GIVE_ITEM_FROM_SKULLTULA_REWARD,
|
||||||
|
|
||||||
|
@ -764,6 +764,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void
|
|||||||
*should = eligible;
|
*should = eligible;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY: {
|
||||||
|
// give both rewards at the same time
|
||||||
|
if (gSaveContext.minigameScore >= 1500) {
|
||||||
|
Flags_SetItemGetInf(ITEMGETINF_0F);
|
||||||
|
}
|
||||||
|
*should = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case GI_VB_GIVE_ITEM_FROM_SKULLTULA_REWARD: {
|
case GI_VB_GIVE_ITEM_FROM_SKULLTULA_REWARD: {
|
||||||
// In z_en_sth.c the rewards are stored in sGetItemIds, the first entry
|
// In z_en_sth.c the rewards are stored in sGetItemIds, the first entry
|
||||||
// in that array is GI_RUPEE_GOLD, and the reward is picked in EnSth_GivePlayerItem
|
// in that array is GI_RUPEE_GOLD, and the reward is picked in EnSth_GivePlayerItem
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "vt.h"
|
#include "vt.h"
|
||||||
#include "objects/object_ge1/object_ge1.h"
|
#include "objects/object_ge1/object_ge1.h"
|
||||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||||
|
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||||
|
|
||||||
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY)
|
#define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY)
|
||||||
|
|
||||||
@ -531,16 +532,8 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) {
|
|||||||
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
GetItemEntry getItemEntry = (GetItemEntry)GET_ITEM_NONE;
|
||||||
s32 getItemId;
|
s32 getItemId;
|
||||||
|
|
||||||
if (Actor_HasParent(&this->actor, play)) {
|
if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)) {
|
||||||
if (IS_RANDO && gSaveContext.minigameScore >= 1500 && !Flags_GetInfTable(INFTABLE_190)) {
|
|
||||||
Flags_SetItemGetInf(ITEMGETINF_0F);
|
|
||||||
Flags_SetInfTable(INFTABLE_190);
|
|
||||||
this->stateFlags |= GE1_STATE_GIVE_QUIVER;
|
|
||||||
this->actor.parent = NULL;
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
this->actionFunc = EnGe1_SetupWait_Archery;
|
this->actionFunc = EnGe1_SetupWait_Archery;
|
||||||
}
|
|
||||||
|
|
||||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||||
Flags_SetItemGetInf(ITEMGETINF_0F);
|
Flags_SetItemGetInf(ITEMGETINF_0F);
|
||||||
@ -549,7 +542,6 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||||
if (!IS_RANDO) {
|
|
||||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||||
//! @bug Asschest. See next function for details
|
//! @bug Asschest. See next function for details
|
||||||
case 1:
|
case 1:
|
||||||
@ -560,22 +552,11 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
|
||||||
getItemId = getItemEntry.getItemId;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!IS_RANDO) {
|
|
||||||
getItemId = GI_HEART_PIECE;
|
getItemId = GI_HEART_PIECE;
|
||||||
} else {
|
|
||||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
|
||||||
getItemId = getItemEntry.getItemId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) {
|
if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)) {
|
||||||
Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f);
|
Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f);
|
||||||
} else {
|
|
||||||
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -590,7 +571,6 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||||
if (!IS_RANDO) {
|
|
||||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||||
//! @bug Asschest. See next function for details
|
//! @bug Asschest. See next function for details
|
||||||
case 1:
|
case 1:
|
||||||
@ -601,22 +581,11 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
|
||||||
getItemId = getItemEntry.getItemId;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!IS_RANDO) {
|
|
||||||
getItemId = GI_HEART_PIECE;
|
getItemId = GI_HEART_PIECE;
|
||||||
} else {
|
|
||||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
|
||||||
getItemId = getItemEntry.getItemId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IS_RANDO || getItemEntry.getItemId == GI_NONE) {
|
if (GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)) {
|
||||||
Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f);
|
Actor_OfferGetItem(&this->actor, play, getItemId, 10000.0f, 50.0f);
|
||||||
} else {
|
|
||||||
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user