z_parameter: Minigames (#1131)

* minigame docs

* cleanup

* vertices and cleanup

* fix bss

* change to perfectLetters

* fix parameter static

* more PR, namefixer

* PR Suggestions
This commit is contained in:
engineer124
2022-11-19 14:13:05 -03:00
committed by GitHub
parent eafc5bb4c1
commit 1792268c94
29 changed files with 1176 additions and 222 deletions
+7 -7
View File
@@ -119,13 +119,13 @@
<Texture Name="gMinigameCountdown3Tex" OutName="minigame_countdown_3" Format="ia8" Width="24" Height="32" Offset="0x7828"/>
<!-- The letters of "PERFECT!" -->
<Texture Name="gMinigameLetterPTex" OutName="minigame_letter_p" Format="i4" Width="32" Height="33" Offset="0x7B28"/>
<Texture Name="gMinigameLetterETex" OutName="minigame_letter_e" Format="i4" Width="32" Height="33" Offset="0x7D38"/>
<Texture Name="gMinigameLetterRTex" OutName="minigame_letter_r" Format="i4" Width="32" Height="33" Offset="0x7F48"/>
<Texture Name="gMinigameLetterFTex" OutName="minigame_letter_f" Format="i4" Width="32" Height="33" Offset="0x8158"/>
<Texture Name="gMinigameLetterCTex" OutName="minigame_letter_c" Format="i4" Width="32" Height="33" Offset="0x8368"/>
<Texture Name="gMinigameLetterTTex" OutName="minigame_letter_t" Format="i4" Width="32" Height="33" Offset="0x8578"/>
<Texture Name="gMinigameExclamationTex" OutName="minigame_exclamation" Format="i4" Width="32" Height="33" Offset="0x8788"/>
<Texture Name="gPerfectLetterPTex" OutName="letter_perfect_p" Format="i4" Width="32" Height="33" Offset="0x7B28"/>
<Texture Name="gPerfectLetterETex" OutName="letter_perfect_e" Format="i4" Width="32" Height="33" Offset="0x7D38"/>
<Texture Name="gPerfectLetterRTex" OutName="letter_perfect_r" Format="i4" Width="32" Height="33" Offset="0x7F48"/>
<Texture Name="gPerfectLetterFTex" OutName="letter_perfect_f" Format="i4" Width="32" Height="33" Offset="0x8158"/>
<Texture Name="gPerfectLetterCTex" OutName="letter_perfect_c" Format="i4" Width="32" Height="33" Offset="0x8368"/>
<Texture Name="gPerfectLetterTTex" OutName="letter_perfect_t" Format="i4" Width="32" Height="33" Offset="0x8578"/>
<Texture Name="gPerfectLetterExclamationTex" OutName="letter_perfect_exclamation" Format="i4" Width="32" Height="33" Offset="0x8788"/>
<!-- Similar to stray fairy icons in icon_item_dungeon_static, except with a turned head -->
<Texture Name="gStrayFairyWoodfallIconTex" OutName="stray_fairy_woodfall_icon" Format="rgba32" Width="32" Height="24" Offset="0x8998"/>
+6 -24
View File
@@ -1705,7 +1705,6 @@ Gfx* Gfx_DrawTexRectI8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textu
Gfx* Gfx_DrawTexQuadIA8(Gfx* gfx, TexturePtr texture, s16 textureWidth, s16 textureHeight, u16 point);
Gfx* Gfx_DrawTexQuad4b(Gfx* gfx, TexturePtr texture, s32 fmt, s16 textureWidth, s16 textureHeight, u16 point);
// void func_8010E028(void);
void Interface_StartTimer(s16 timerId, s16 seconds);
void Interface_StartPostmanTimer(s16 seconds, s16 bunnyHoodState);
void func_8010EE74(PlayState* play, s32 day);
@@ -1713,7 +1712,7 @@ void Interface_SetHudVisibility(u16 hudVisibility);
void func_80110038(PlayState* play);
// void func_80111CB4(void);
// void func_801129E4(void);
void func_80112AFC(PlayState* play);
void Interface_InitMinigame(PlayState* play);
void Interface_LoadItemIconImpl(PlayState* play, u8 btn);
void Interface_LoadItemIcon(PlayState* play, u8 btn);
void func_80112C0C(PlayState* play, u16 flag);
@@ -1741,30 +1740,13 @@ void Inventory_ChangeAmmo(s16 item, s16 ammoChange);
void Magic_Add(PlayState* play, s16 magicToAdd);
void Magic_Reset(PlayState* play);
s32 Magic_Consume(PlayState* play, s16 magicToConsume, s16 type);
// void func_80116FD8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_801170B8(void);
// void func_80117100(void);
// void func_80117A20(void);
// void func_80117BD0(void);
// void func_80118084(void);
// void func_80118890(void);
// void func_80118BA4(void);
// void func_80119030(void);
// void func_80119610(void);
void func_8011B4E0(PlayState* play, s32 arg1);
// void func_8011B5C0(void);
// void func_8011B9E0(void);
// void func_8011BF70(void);
// void func_8011C4C4(void);
void Interface_SetPerfectLetters(PlayState* play, s16 perfectLettersType);
void Interface_StartMoonCrash(PlayState* play);
// void func_8011E730(void);
// void func_8011F0E0(UNK_TYPE4 ctxt);
// void func_80120F90(void);
// void func_80121000(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE1 param_8, UNK_TYPE1 param_9, UNK_TYPE1 param_10, UNK_TYPE4 param_11, UNK_TYPE4 param_12, UNK_TYPE4 param_13, UNK_TYPE4 param_14);
// void func_80121064(void);
// void func_801210E0(void);
void Interface_Draw(PlayState* play);
void Interface_Update(PlayState* play);
void Interface_Destroy(PlayState* play);
void func_80121FC4(PlayState* play);
void Interface_Init(PlayState* play);
Path* Path_GetByIndex(PlayState* play, s16 index, s16 max);
f32 Path_OrientAndGetDistSq(Actor* actor, Path* path, s16 waypoint, s16* yaw);
void Path_CopyLastPoint(Path* path, Vec3f* dest);
-18
View File
@@ -690,13 +690,6 @@ extern UNK_PTR D_801BF5C0;
// extern UNK_TYPE2 D_801BF9F8;
// extern UNK_TYPE2 D_801BF9FC;
// extern UNK_TYPE2 D_801BFA00;
// extern UNK_TYPE2 D_801BFA04;
// extern UNK_TYPE2 D_801BFA1C;
// extern UNK_TYPE2 D_801BFA34;
// extern UNK_TYPE2 D_801BFA4C;
// extern UNK_TYPE2 D_801BFA64;
// extern UNK_TYPE2 D_801BFA74;
// extern UNK_TYPE4 sPostmanTimerInputBtnAPressed;
// extern UNK_TYPE1 D_801BFAB0;
// extern UNK_TYPE1 D_801BFAB8;
// extern UNK_TYPE1 D_801BFAC4;
@@ -737,17 +730,6 @@ extern UNK_PTR D_801BF5C0;
// extern UNK_TYPE1 D_801BFC10;
// extern UNK_TYPE1 D_801BFC14;
// extern UNK_TYPE1 D_801BFC40;
// extern UNK_TYPE2 D_801BFC50;
// extern UNK_TYPE2 D_801BFC60;
// extern UNK_TYPE2 D_801BFC62;
// extern UNK_TYPE2 D_801BFC64;
// extern UNK_TYPE2 D_801BFC6C;
// extern UNK_TYPE2 D_801BFC7C;
// extern UNK_TYPE1 D_801BFC8C;
// extern UNK_TYPE2 D_801BFC98;
// extern UNK_TYPE2 D_801BFCA8;
// extern UNK_TYPE1 D_801BFCB8;
// extern UNK_TYPE4 D_801BFCC4;
// extern UNK_TYPE2 sTimerStateTimer;
// extern UNK_TYPE2 sTimerDigits;
// extern UNK_TYPE2 D_801BFCEA;
+21 -20
View File
@@ -35,6 +35,7 @@
#include "z64cutscene.h"
#include "z64dma.h"
#include "z64effect.h"
#include "z64interface.h"
#include "z64item.h"
#include "z64light.h"
#include "z64map.h"
@@ -506,10 +507,10 @@ typedef struct {
/* 0x256 */ s16 unk_256;
/* 0x258 */ s16 magicConsumptionTimer; // For certain magic states, 1 unit of magic is consumed every time the timer reaches 0
/* 0x25A */ u8 numHorseBoosts;
/* 0x25C */ u16 unk_25C;
/* 0x25E */ u16 unk_25E;
/* 0x260 */ u16 hbaAmmo;
/* 0x262 */ u16 unk_262;
/* 0x25C */ u16 minigamePoints; // Points to add to the minigame score. Reset to 0 every frame.
/* 0x25E */ u16 minigameHiddenPoints; // Points to add to the secondary set of minigame points not displayed. Reset to 0 every frame.
/* 0x260 */ u16 minigameAmmo;
/* 0x262 */ u16 minigameUnusedPoints; // Associated with other minigame points, unused
/* 0x264 */ s16 unk_264;
/* 0x266 */ s16 aAlpha;
/* 0x268 */ s16 bAlpha;
@@ -525,22 +526,22 @@ typedef struct {
/* 0x27C */ s16 mapRoomNum;
/* 0x27E */ u8 unk_27E;
/* 0x27F */ u8 unk_27F;
/* 0x280 */ u8 unk_280;
/* 0x282 */ s16 unk_282;
/* 0x284 */ s16 unk_284;
/* 0x286 */ s16 unk_286;
/* 0x288 */ s16 unk_288;
/* 0x28A */ s16 unk_28A[8];
/* 0x29A */ u16 unk_29A[8];
/* 0x2AA */ s16 unk_2AA[8];
/* 0x2BC */ f32 unk_2BC[8];
/* 0x2DC */ f32 unk_2DC[8];
/* 0x2FC */ s16 unk_2FC[4];
/* 0x304 */ s16 unk_304;
/* 0x306 */ s16 unk_306;
/* 0x308 */ s16 unk_308;
/* 0x30A */ s16 unk_30A;
/* 0x30C */ s16 unk_30C;
/* 0x280 */ u8 minigameState;
/* 0x282 */ s16 minigameCountdownAlpha;
/* 0x284 */ s16 minigameCountdownScale;
/* 0x286 */ s16 perfectLettersOn;
/* 0x288 */ s16 perfectLettersType;
/* 0x28A */ s16 perfectLettersState[PERFECT_LETTERS_NUM_LETTERS];
/* 0x29A */ u16 perfectLettersAngles[PERFECT_LETTERS_NUM_LETTERS]; // Angle that follows the projectory of an ellipse
/* 0x2AA */ s16 perfectLettersOffsetX[PERFECT_LETTERS_NUM_LETTERS];
/* 0x2BC */ f32 perfectLettersSemiAxisX[PERFECT_LETTERS_NUM_LETTERS];
/* 0x2DC */ f32 perfectLettersSemiAxisY[PERFECT_LETTERS_NUM_LETTERS];
/* 0x2FC */ s16 perfectLettersPrimColor[4];
/* 0x304 */ s16 perfectLettersCount;
/* 0x306 */ s16 perfectLettersUnused;
/* 0x308 */ s16 perfectLettersColorIndex;
/* 0x30A */ s16 perfectLettersColorTimer;
/* 0x30C */ s16 perfectLettersTimer;
struct {
/* 0x30E */ u8 unk_30E; // "h_gauge"
/* 0x30F */ u8 bButton;
+41
View File
@@ -0,0 +1,41 @@
#ifndef Z64INTERFACE_H
#define Z64INTERFACE_H
#include "ultra64.h"
typedef enum {
/* 0 */ MINIGAME_STATE_NONE,
/* 1 */ MINIGAME_STATE_COUNTDOWN_SETUP_3,
/* 2 */ MINIGAME_STATE_COUNTDOWN_3,
/* 3 */ MINIGAME_STATE_COUNTDOWN_SETUP_2,
/* 4 */ MINIGAME_STATE_COUNTDOWN_2,
/* 5 */ MINIGAME_STATE_COUNTDOWN_SETUP_1,
/* 6 */ MINIGAME_STATE_COUNTDOWN_1,
/* 7 */ MINIGAME_STATE_COUNTDOWN_SETUP_GO,
/* 8 */ MINIGAME_STATE_COUNTDOWN_GO,
/* 20 */ MINIGAME_STATE_NO_COUNTDOWN_SETUP = 20,
/* 21 */ MINIGAME_STATE_NO_COUNTDOWN,
/* 30 */ MINIGAME_STATE_PLAYING = 30
} MinigameState;
typedef enum {
/* 0 */ PERFECT_LETTERS_TYPE_OFF,
/* 1 */ PERFECT_LETTERS_TYPE_1,
/* 2 */ PERFECT_LETTERS_TYPE_2,
/* 3 */ PERFECT_LETTERS_TYPE_3
} PerfectLettersType;
typedef enum {
/* 0 */ PERFECT_LETTERS_STATE_OFF,
/* 1 */ PERFECT_LETTERS_STATE_INIT,
/* 2 */ PERFECT_LETTERS_STATE_ENTER,
/* 3 */ PERFECT_LETTERS_STATE_STATIONARY, // Display for type 1
/* 4 */ PERFECT_LETTERS_STATE_SPREAD, // Exit for type 1
/* 5 */ PERFECT_LETTERS_STATE_DISPLAY,
/* 6 */ PERFECT_LETTERS_STATE_EXIT
} PerfectLettersState;
#define PERFECT_LETTERS_NUM_LETTERS 8
#define PERFECT_LETTERS_ANGLE_PER_LETTER (0x10000 / PERFECT_LETTERS_NUM_LETTERS)
#endif
+8 -2
View File
@@ -105,6 +105,12 @@ typedef enum {
/* 1 */ BOTTLE_TIMER_STATE_COUNTING
} BottleTimerState;
typedef enum {
/* 0 */ MINIGAME_STATUS_INACTIVE,
/* 1 */ MINIGAME_STATUS_ACTIVE,
/* 3 */ MINIGAME_STATUS_END = 3
} MinigameStatus;
typedef enum {
/* 0 */ HUD_VISIBILITY_IDLE,
/* 1 */ HUD_VISIBILITY_NONE,
@@ -343,9 +349,9 @@ typedef struct SaveContext {
/* 0x3F32 */ s16 magicToConsume; // accumulated magic that is requested to be consumed "magic_used"
/* 0x3F34 */ s16 magicToAdd; // accumulated magic that is requested to be added "magic_recovery"
/* 0x3F36 */ u16 mapIndex; // "scene_ID"
/* 0x3F38 */ u16 minigameState; // "yabusame_mode"
/* 0x3F38 */ u16 minigameStatus; // "yabusame_mode"
/* 0x3F3A */ u16 minigameScore; // "yabusame_total"
/* 0x3F3C */ u16 unk_3F3C; // "yabusame_out_ct"
/* 0x3F3C */ u16 minigameHiddenScore; // "yabusame_out_ct"
/* 0x3F3E */ u8 unk_3F3E; // "no_save"
/* 0x3F3F */ u8 unk_3F3F; // "flash_flag"
/* 0x3F40 */ SaveOptions options;
-1
View File
@@ -1,4 +1,3 @@
//#include "prevent_bss_reordering.h"
#include "global.h"
#include "z64quake.h"
#include "z64shrink_window.h"
+988 -55
View File
File diff suppressed because it is too large Load Diff
@@ -342,7 +342,7 @@ void BgIngate_Init(Actor* thisx, PlayState* play2) {
if (play->curSpawn == 6) {
func_80953F14(this, play);
if (CHECK_EVENTINF(EVENTINF_35)) {
func_80112AFC(play);
Interface_InitMinigame(play);
} else {
SET_EVENTINF(EVENTINF_41);
}
+3 -3
View File
@@ -1482,9 +1482,9 @@ void func_80A97D5C(EnAz* this, PlayState* play) {
Player* player = GET_PLAYER(play);
player->stateFlags1 |= PLAYER_STATE1_20;
func_80112AFC(play);
Interface_InitMinigame(play);
gSaveContext.minigameScore = (this->unk_374 & 2) ? 25 : 20;
play->interfaceCtx.unk_280 = 1;
play->interfaceCtx.minigameState = MINIGAME_STATE_COUNTDOWN_SETUP_3;
if ((this->unk_2FA == 1) || (this->unk_2FA == 3)) {
Interface_StartTimer(TIMER_ID_MINIGAME_2, 120);
} else if (CHECK_WEEKEVENTREG(WEEKEVENTREG_25_01)) {
@@ -1498,7 +1498,7 @@ void func_80A97D5C(EnAz* this, PlayState* play) {
void func_80A97E48(EnAz* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (play->interfaceCtx.unk_280 >= 8) {
if (play->interfaceCtx.minigameState >= MINIGAME_STATE_COUNTDOWN_GO) {
player->stateFlags1 &= ~PLAYER_STATE1_20;
func_80A97EAC(this, play);
}
+2 -2
View File
@@ -800,7 +800,7 @@ void func_80962F4C(EnFu* this, PlayState* play) {
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] = SECONDS_TO_TIMER(0);
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_STOP;
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
func_8011B4E0(play, 1);
Interface_SetPerfectLetters(play, PERFECT_LETTERS_TYPE_1);
this->unk_54A = 3;
func_809632D0(this);
}
@@ -848,7 +848,7 @@ void func_80963350(EnFu* this, PlayState* play) {
D_80964C24 = 1;
}
if ((this->unk_54A == 3) && (play->interfaceCtx.unk_286 == 0)) {
if ((this->unk_54A == 3) && !play->interfaceCtx.perfectLettersOn) {
this->unk_54A = 2;
D_80964C24 = 1;
}
@@ -875,7 +875,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
EnHorse_InitCutscene(this, play);
} else if (thisx->params == ENHORSE_10) {
EnHorse_InitHorsebackArchery(this);
func_80112AFC(play);
Interface_InitMinigame(play);
} else if (thisx->params == ENHORSE_14) {
func_808846F0(this, play);
if ((play->sceneId == SCENE_LOST_WOODS) && !Cutscene_IsPlaying(play)) {
@@ -2917,22 +2917,23 @@ void EnHorse_UpdateHorsebackArchery(EnHorse* this, PlayState* play) {
EnHorse_PlayWalkingSound(this);
}
if (play->interfaceCtx.hbaAmmo == 0) {
if (play->interfaceCtx.minigameAmmo == 0) {
this->hbaTimer++;
}
sp28 = Audio_IsSequencePlaying(NA_BGM_HORSE_GOAL);
EnHorse_UpdateHbaRaceInfo(this, play, &sHbaInfo);
if (((this->hbaFlags & 1) || (this->hbaTimer > 45)) && (sp28 != 1) && (gSaveContext.minigameState != 3)) {
if (((this->hbaFlags & 1) || (this->hbaTimer > 45)) && (sp28 != 1) &&
(gSaveContext.minigameStatus != MINIGAME_STATUS_END)) {
gSaveContext.save.cutscene = 0;
play->transitionTrigger = TRANS_TRIGGER_START;
play->transitionType = TRANS_TYPE_64;
}
if (play->interfaceCtx.hbaAmmo) {}
if (play->interfaceCtx.minigameAmmo) {}
if (((play->interfaceCtx.hbaAmmo == 0) || (this->hbaFlags & 2)) && (this->hbaFlags & 4)) {
if (((play->interfaceCtx.minigameAmmo == 0) || (this->hbaFlags & 2)) && (this->hbaFlags & 4)) {
this->hbaFlags &= ~4;
Audio_QueueSeqCmd(0x8041);
}
@@ -122,7 +122,7 @@ s32 func_808F8CCC(EnHorseGameCheck* this, PlayState* play2) {
}
Interface_StartTimer(TIMER_ID_MINIGAME_2, 0);
play->interfaceCtx.unk_280 = 1;
play->interfaceCtx.minigameState = MINIGAME_STATE_COUNTDOWN_SETUP_3;
this->horse1 = (EnHorse*)Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, -1149.0f, -106.0f, 470.0f, 0, 0x7FFF, 0,
ENHORSE_PARAMS(ENHORSE_PARAM_BANDIT, ENHORSE_4));
@@ -212,10 +212,10 @@ s32 func_808F8FAC(EnHorseGameCheck* this, PlayState* play) {
if ((this->unk_168 > 50) && !(this->unk_164 & 2)) {
this->unk_164 |= 2;
} else if ((play->interfaceCtx.unk_280 >= 8) && !(this->unk_164 & 1)) {
} else if ((play->interfaceCtx.minigameState >= MINIGAME_STATE_COUNTDOWN_GO) && !(this->unk_164 & 1)) {
this->unk_164 |= 1;
horse->inRace = true;
} else if ((play->interfaceCtx.unk_280 >= 8) && !(this->unk_164 & 8)) {
} else if ((play->interfaceCtx.minigameState >= MINIGAME_STATE_COUNTDOWN_GO) && !(this->unk_164 & 8)) {
EnHorse* horse = this->horse1;
horse->inRace = true;
@@ -94,7 +94,7 @@ s32 EnJcMato_CheckForHit(EnJcMato* this, PlayState* play) {
if ((this->collider.base.acFlags & AC_HIT) && !this->hitFlag && (this->actor.colChkInfo.damageEffect == 0xF)) {
this->collider.base.acFlags &= ~AC_HIT;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
play->interfaceCtx.unk_25C = 1;
play->interfaceCtx.minigamePoints = 1;
this->hitFlag = true;
return 1;
} else {
@@ -284,8 +284,8 @@ void func_80C1410C(EnJgameTsn* this, PlayState* play) {
player->stateFlags1 |= PLAYER_STATE1_20;
func_801A2BB8(0x25);
play->interfaceCtx.unk_280 = 1;
func_80112AFC(play);
play->interfaceCtx.minigameState = MINIGAME_STATE_COUNTDOWN_SETUP_3;
Interface_InitMinigame(play);
SET_WEEKEVENTREG(WEEKEVENTREG_90_20);
Interface_StartTimer(TIMER_ID_MINIGAME_2, 120);
this->actionFunc = func_80C1418C;
@@ -294,7 +294,7 @@ void func_80C1410C(EnJgameTsn* this, PlayState* play) {
void func_80C1418C(EnJgameTsn* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (play->interfaceCtx.unk_280 == 8) {
if (play->interfaceCtx.minigameState == MINIGAME_STATE_COUNTDOWN_GO) {
func_80C141DC(this);
player->stateFlags1 &= ~PLAYER_STATE1_20;
}
@@ -478,7 +478,7 @@ void func_80C147B4(EnJgameTsn* this, PlayState* play) {
case 0x10A0:
case 0x10A1:
func_801477B4(play);
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
gSaveContext.timerStates[TIMER_ID_MINIGAME_2] = TIMER_STATE_STOP;
CLEAR_WEEKEVENTREG(WEEKEVENTREG_90_20);
func_80C144E4(this);
@@ -563,14 +563,14 @@ s32 func_80C14BCC(EnJgameTsn* this, PlayState* play) {
if (phi_s3 == this->unk_218) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
*this->unk_208[phi_s3] |= OBJLUPYGAMELIFT_DISPLAY_CORRECT;
play->interfaceCtx.unk_25C = 1;
play->interfaceCtx.minigamePoints = 1;
return true;
}
if (*this->unk_208[phi_s3] & OBJLUPYGAMELIFT_IGNITE_FIRE) {
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
*this->unk_208[phi_s3] |= OBJLUPYGAMELIFT_DISPLAY_CORRECT;
play->interfaceCtx.unk_25C = 1;
play->interfaceCtx.minigamePoints = 1;
} else {
*this->unk_208[phi_s3] |= OBJLUPYGAMELIFT_DISPLAY_INCORRECT;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_ERROR);
@@ -297,14 +297,14 @@ void func_80B269A4(EnKendoJs* this, PlayState* play) {
case 0x273B:
func_801477B4(play);
func_80112AFC(play);
Interface_InitMinigame(play);
player->stateFlags1 |= PLAYER_STATE1_20;
func_80B273D0(this);
break;
case 0x272D:
func_801477B4(play);
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
func_80B276C4(this);
func_80B276D8(this, play);
break;
@@ -334,7 +334,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) {
}
if ((this->unk_288 == 0x272E) || (this->unk_288 == 0x272F) || (this->unk_288 == 0x2730)) {
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
}
player->stateFlags1 &= ~PLAYER_STATE1_20;
@@ -625,14 +625,14 @@ void func_80B274BC(EnKendoJs* this, PlayState* play) {
if (this->unk_28E == 1) {
if ((player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_START) ||
(player->meleeWeaponAnimation == PLAYER_MWA_JUMPSLASH_FINISH)) {
play->interfaceCtx.unk_25C = 3;
play->interfaceCtx.minigamePoints = 3;
if (gSaveContext.minigameScore >= 27) {
player->stateFlags1 |= PLAYER_STATE1_20;
}
} else if (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H) {
play->interfaceCtx.unk_25C = 2;
play->interfaceCtx.minigamePoints = 2;
} else {
play->interfaceCtx.unk_25C = 1;
play->interfaceCtx.minigamePoints = 1;
}
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
this->unk_28E = 0;
+4 -4
View File
@@ -688,10 +688,10 @@ void EnMa4_HorsebackGameTalking(EnMa4* this, PlayState* play) {
void EnMa4_InitHorsebackGame(EnMa4* this, PlayState* play) {
Player* player = GET_PLAYER(play);
play->interfaceCtx.unk_280 = 1;
play->interfaceCtx.minigameState = MINIGAME_STATE_COUNTDOWN_SETUP_3;
Interface_StartTimer(TIMER_ID_MINIGAME_2, 0);
SET_WEEKEVENTREG(WEEKEVENTREG_08_01);
func_80112AFC(play);
Interface_InitMinigame(play);
player->stateFlags1 |= PLAYER_STATE1_20;
this->actionFunc = EnMa4_SetupHorsebackGameWait;
}
@@ -699,7 +699,7 @@ void EnMa4_InitHorsebackGame(EnMa4* this, PlayState* play) {
void EnMa4_SetupHorsebackGameWait(EnMa4* this, PlayState* play) {
Player* player = GET_PLAYER(play);
if (play->interfaceCtx.unk_280 == 8) {
if (play->interfaceCtx.minigameState == MINIGAME_STATE_COUNTDOWN_GO) {
this->actionFunc = EnMa4_HorsebackGameWait;
player->stateFlags1 &= ~PLAYER_STATE1_20;
}
@@ -714,7 +714,7 @@ void EnMa4_HorsebackGameWait(EnMa4* this, PlayState* play) {
if (this->poppedBalloonCounter != D_80AC0258) {
D_80AC0258 = this->poppedBalloonCounter;
play->interfaceCtx.unk_25C = 1;
play->interfaceCtx.minigamePoints = 1;
}
if ((gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_2] >= SECONDS_TO_TIMER(120)) ||
@@ -315,11 +315,11 @@ void EnMttag_RaceStart(EnMttag* this, PlayState* play) {
} else {
if (DECR(this->timer) == 60) {
Interface_StartTimer(TIMER_ID_MINIGAME_2, 0);
play->interfaceCtx.unk_280 = 1;
play->interfaceCtx.minigameState = MINIGAME_STATE_COUNTDOWN_SETUP_3;
Audio_QueueSeqCmd(NA_BGM_GORON_RACE | 0x8000);
play->envCtx.unk_E4 = 0xFE;
player->stateFlags1 &= ~PLAYER_STATE1_20;
} else if ((this->timer < 60) && (play->interfaceCtx.unk_280 == 8)) {
} else if ((this->timer < 60) && (play->interfaceCtx.minigameState == MINIGAME_STATE_COUNTDOWN_GO)) {
this->timer = 0;
SET_EVENTINF(EVENTINF_10);
this->actionFunc = EnMttag_Race;
+3 -3
View File
@@ -59,9 +59,9 @@ EnOtUnkStruct* func_80B5DF58(EnOtUnkStruct* arg0, u8 arg1, Vec3f* arg2, Vec3s* a
void func_80B5E078(PlayState* play, EnOtUnkStruct* arg1, s32 arg2);
void func_80B5E1D8(PlayState* play, EnOtUnkStruct* arg1, s32 arg2);
static EnOt* D_80B5E880;
static EnOt* D_80B5E884;
static EnOt* D_80B5E888;
EnOt* D_80B5E880;
EnOt* D_80B5E884;
EnOt* D_80B5E888;
ActorInit En_Ot_InitVars = {
ACTOR_EN_OT,
@@ -334,7 +334,7 @@ void EnSyatekiMan_Swamp_HandleChoice(EnSyatekiMan* this, PlayState* play) {
Message_StartTextbox(play, 0xA31, &this->actor);
this->prevTextId = 0xA31;
if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) {
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
}
this->shootingGameState = SG_GAME_STATE_NOT_PLAYING;
@@ -373,7 +373,7 @@ void EnSyatekiMan_Swamp_HandleChoice(EnSyatekiMan* this, PlayState* play) {
}
if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) {
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
}
this->shootingGameState = SG_GAME_STATE_NOT_PLAYING;
@@ -399,8 +399,8 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
player->actor.freezeTimer = 0;
func_80112AFC(play);
play->interfaceCtx.hbaAmmo = 80;
Interface_InitMinigame(play);
play->interfaceCtx.minigameAmmo = 80;
func_80123F2C(play, 80);
this->shootingGameState = SG_GAME_STATE_RUNNING;
this->actionFunc = EnSyatekiMan_Swamp_StartGame;
@@ -414,7 +414,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
CLEAR_WEEKEVENTREG(WEEKEVENTREG_63_01);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_63_02);
this->actionFunc = EnSyatekiMan_Swamp_Idle;
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
this->shootingGameState = SG_GAME_STATE_NONE;
} else {
// Wanna play again?
@@ -434,7 +434,7 @@ void EnSyatekiMan_Swamp_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
player->actor.freezeTimer = 0;
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
player->stateFlags1 |= PLAYER_STATE1_20;
this->actionFunc = EnSyatekiMan_Swamp_SetupGiveReward;
EnSyatekiMan_Swamp_SetupGiveReward(this, play);
@@ -641,7 +641,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) {
if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) {
player->stateFlags3 &= ~PLAYER_STATE3_400;
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
}
this->shootingGameState = SG_GAME_STATE_NOT_PLAYING;
@@ -677,7 +677,7 @@ void EnSyatekiMan_Town_HandleChoice(EnSyatekiMan* this, PlayState* play) {
if (this->shootingGameState == SG_GAME_STATE_ONE_MORE_GAME) {
player->stateFlags3 &= ~PLAYER_STATE3_400;
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
}
this->shootingGameState = SG_GAME_STATE_NOT_PLAYING;
@@ -759,7 +759,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
play->msgCtx.stateTimer = 4;
player->actor.freezeTimer = 0;
this->flagsIndex = 0;
func_80112AFC(play);
Interface_InitMinigame(play);
func_80123F2C(play, 0x63);
this->shootingGameState = SG_GAME_STATE_RUNNING;
func_801A2BB8(NA_BGM_TIMED_MINI_GAME);
@@ -808,7 +808,7 @@ void EnSyatekiMan_Town_HandleNormalMessage(EnSyatekiMan* this, PlayState* play)
play->msgCtx.msgMode = 0x43;
play->msgCtx.stateTimer = 4;
player->actor.freezeTimer = 0;
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
this->actionFunc = EnSyatekiMan_Town_SetupGiveReward;
EnSyatekiMan_Town_SetupGiveReward(this, play);
break;
@@ -1090,7 +1090,7 @@ void EnSyatekiMan_Swamp_RunGame(EnSyatekiMan* this, PlayState* play) {
func_801A2C20();
this->shootingGameState = SG_GAME_STATE_GIVING_BONUS;
if (this->score == 2120) {
func_8011B4E0(play, 2);
Interface_SetPerfectLetters(play, PERFECT_LETTERS_TYPE_2);
gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_6;
this->actionFunc = EnSyatekiMan_Swamp_AddBonusPoints;
} else {
@@ -1122,7 +1122,7 @@ void EnSyatekiMan_Swamp_EndGame(EnSyatekiMan* this, PlayState* play) {
CLEAR_WEEKEVENTREG(WEEKEVENTREG_63_01);
CLEAR_WEEKEVENTREG(WEEKEVENTREG_63_02);
this->shootingGameState = SG_GAME_STATE_NONE;
gSaveContext.minigameState = 3;
gSaveContext.minigameStatus = MINIGAME_STATUS_END;
this->actionFunc = EnSyatekiMan_Swamp_Idle;
return;
}
@@ -1156,7 +1156,7 @@ void EnSyatekiMan_Swamp_AddBonusPoints(EnSyatekiMan* this, PlayState* play) {
Player* player = GET_PLAYER(play);
player->stateFlags1 |= PLAYER_STATE1_20;
if (play->interfaceCtx.unk_286 == 0) {
if (!play->interfaceCtx.perfectLettersOn) {
if (gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] == SECONDS_TO_TIMER(0)) {
gSaveContext.timerCurTimes[TIMER_ID_MINIGAME_1] = SECONDS_TO_TIMER(0);
gSaveContext.timerStates[TIMER_ID_MINIGAME_1] = TIMER_STATE_STOP;
@@ -1166,7 +1166,7 @@ void EnSyatekiMan_Swamp_AddBonusPoints(EnSyatekiMan* this, PlayState* play) {
sBonusTimer = 0;
} else if (sBonusTimer > 10) {
gSaveContext.timerStopTimes[TIMER_ID_MINIGAME_1] += SECONDS_TO_TIMER(1);
play->interfaceCtx.unk_25C += 10;
play->interfaceCtx.minigamePoints += 10;
this->score += 10;
Actor_PlaySfxAtPos(&this->actor, NA_SE_SY_TRE_BOX_APPEAR);
sBonusTimer = 0;
@@ -1359,7 +1359,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) {
this->actionFunc = EnSyatekiMan_Town_EndGame;
if (this->score == 50) {
Audio_PlayFanfare(NA_BGM_GET_ITEM | 0x900);
func_8011B4E0(play, 1);
Interface_SetPerfectLetters(play, PERFECT_LETTERS_TYPE_1);
}
}
}
@@ -1368,7 +1368,7 @@ void EnSyatekiMan_Town_RunGame(EnSyatekiMan* this, PlayState* play) {
void EnSyatekiMan_Town_EndGame(EnSyatekiMan* this, PlayState* play) {
if (this->shootingGameState == SG_GAME_STATE_RUNNING) {
this->octorokFlags = 0;
if ((this->talkWaitTimer <= 0) && (play->interfaceCtx.unk_286 == 0)) {
if ((this->talkWaitTimer <= 0) && !play->interfaceCtx.perfectLettersOn) {
Flags_SetAllTreasure(play, this->score);
this->talkWaitTimer = 15;
if ((GET_TOWN_SHOOTING_GALLERY_HIGH_SCORE() < this->score) || (this->score == 50)) {

Some files were not shown because too many files have changed in this diff Show More