mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-08-13 04:29:30 -04:00
Hookify Shooting Gallery options (#6972)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.h"
|
||||
#include "overlays/actors/ovl_En_Ex_Ruppy/z_en_ex_ruppy.h"
|
||||
#include "overlays/actors/ovl_En_G_Switch/z_en_g_switch.h"
|
||||
#include "soh/Enhancements/game-interactor/GameInteractor_Hooks.h"
|
||||
|
||||
#define FLAGS ACTOR_FLAG_UPDATE_CULLING_DISABLED
|
||||
|
||||
@@ -110,11 +111,7 @@ void EnSyatekiItm_Idle(EnSyatekiItm* this, PlayState* play) {
|
||||
player->actor.world.rot.x = player->actor.shape.rot.x = player->actor.world.rot.z = player->actor.shape.rot.z =
|
||||
0;
|
||||
s32 ammunition = 15;
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0)) {
|
||||
ammunition = CVarGetInteger(LINK_IS_ADULT ? CVAR_ENHANCEMENT("ShootingGalleryAmmoAdult")
|
||||
: CVAR_ENHANCEMENT("ShootingGalleryAmmoChild"),
|
||||
15);
|
||||
}
|
||||
GameInteractor_Should(VB_SET_SHOOTING_GALLERY_AMMO, true, &ammunition);
|
||||
func_8008EF44(play, ammunition);
|
||||
this->roundNum = this->hitCount = 0;
|
||||
for (i = 0; i < 6; i++) {
|
||||
@@ -133,8 +130,7 @@ void EnSyatekiItm_StartRound(EnSyatekiItm* this, PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
if (this->unkTimer == 0) {
|
||||
if (LINK_IS_ADULT && !(CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0) &&
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("ConstantAdultGallery"), 0))) {
|
||||
if (GameInteractor_Should(VB_SHOOTING_GALLERY_SHUFFLE_ADULT_RUPEES, LINK_IS_ADULT)) {
|
||||
for (i = 0, j = 0; i < SYATEKI_ROUND_MAX; i++) {
|
||||
if (this->roundFlags[i]) {
|
||||
j++;
|
||||
|
||||
@@ -287,11 +287,7 @@ void EnSyatekiMan_StartGame(EnSyatekiMan* this, PlayState* play) {
|
||||
Message_CloseTextbox(play);
|
||||
gallery = ((EnSyatekiItm*)this->actor.parent);
|
||||
if (gallery->actor.update != NULL) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0) &&
|
||||
CVarGetInteger(CVAR_ENHANCEMENT("InstantShootingGalleryWin"), 0)) {
|
||||
gallery->hitCount = 10;
|
||||
gallery->signal = ENSYATEKI_END;
|
||||
} else {
|
||||
if (GameInteractor_Should(VB_PLAY_SHOOTING_GALLERY, true, gallery)) {
|
||||
gallery->signal = ENSYATEKI_START;
|
||||
}
|
||||
this->actionFunc = EnSyatekiMan_WaitForGame;
|
||||
@@ -389,11 +385,7 @@ void EnSyatekiMan_EndGame(EnSyatekiMan* this, PlayState* play) {
|
||||
case SYATEKI_RESULT_ALMOST:
|
||||
this->timer = 20;
|
||||
s32 ammunition = 15;
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("CustomizeShootingGallery"), 0)) {
|
||||
ammunition = CVarGetInteger(LINK_IS_ADULT ? CVAR_ENHANCEMENT("ShootingGalleryAmmoAdult")
|
||||
: CVAR_ENHANCEMENT("ShootingGalleryAmmoChild"),
|
||||
15);
|
||||
}
|
||||
GameInteractor_Should(VB_SET_SHOOTING_GALLERY_AMMO, true, &ammunition);
|
||||
func_8008EF44(play, ammunition);
|
||||
this->actionFunc = EnSyatekiMan_RestartGame;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user