mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-22 08:08:53 -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,
|
||||
// Opt: *EnDivingGame
|
||||
GI_VB_GIVE_ITEM_FROM_DIVING_MINIGAME,
|
||||
// Opt: *EnGe1
|
||||
GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY,
|
||||
// Opt: *EnSth
|
||||
GI_VB_GIVE_ITEM_FROM_SKULLTULA_REWARD,
|
||||
|
||||
|
@ -764,6 +764,14 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, void
|
||||
*should = eligible;
|
||||
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: {
|
||||
// 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
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "vt.h"
|
||||
#include "objects/object_ge1/object_ge1.h"
|
||||
#include "soh/Enhancements/randomizer/randomizer_entrance.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#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;
|
||||
s32 getItemId;
|
||||
|
||||
if (Actor_HasParent(&this->actor, play)) {
|
||||
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;
|
||||
}
|
||||
if (Actor_HasParent(&this->actor, play) || !GameInteractor_Should(GI_VB_GIVE_ITEM_FROM_HORSEBACK_ARCHERY, true, this)) {
|
||||
this->actionFunc = EnGe1_SetupWait_Archery;
|
||||
|
||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||
Flags_SetItemGetInf(ITEMGETINF_0F);
|
||||
@ -549,33 +542,21 @@ void EnGe1_WaitTillItemGiven_Archery(EnGe1* this, PlayState* play) {
|
||||
}
|
||||
} else {
|
||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||
if (!IS_RANDO) {
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!IS_RANDO) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
getItemId = GI_HEART_PIECE;
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -590,33 +571,21 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
|
||||
}
|
||||
|
||||
if (this->stateFlags & GE1_STATE_GIVE_QUIVER) {
|
||||
if (!IS_RANDO) {
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1500_POINTS, CUR_UPG_VALUE(UPG_QUIVER) == 1 ? GI_QUIVER_40 : GI_QUIVER_50);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
switch (CUR_UPG_VALUE(UPG_QUIVER)) {
|
||||
//! @bug Asschest. See next function for details
|
||||
case 1:
|
||||
getItemId = GI_QUIVER_40;
|
||||
break;
|
||||
case 2:
|
||||
getItemId = GI_QUIVER_50;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!IS_RANDO) {
|
||||
getItemId = GI_HEART_PIECE;
|
||||
} else {
|
||||
getItemEntry = Randomizer_GetItemFromKnownCheck(RC_GF_HBA_1000_POINTS, GI_HEART_PIECE);
|
||||
getItemId = getItemEntry.getItemId;
|
||||
}
|
||||
getItemId = GI_HEART_PIECE;
|
||||
}
|
||||
|
||||
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);
|
||||
} else {
|
||||
GiveItemEntryFromActor(&this->actor, play, getItemEntry, 10000.0f, 50.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user