mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-12 01:40:47 +00:00
Document z_horse.c and related actors (#2278)
* document z_horse.h * .bss * suggestions and more comments * bss * INGORACE -> INGO_RACE * format header macros * FIx incorrect type comparision * EnInMode -> EnInStartMode * R_EXITED_SCENE_RIDING_HORSE
This commit is contained in:
parent
524597dc14
commit
1adf696588
24 changed files with 418 additions and 314 deletions
|
@ -52,7 +52,7 @@ void BgInGate_Init(Actor* thisx, PlayState* play) {
|
|||
|
||||
Actor_SetScale(&this->dyna.actor, 0.1f);
|
||||
if ((PARAMS_GET_U(this->dyna.actor.params, 0, 1) != 0) &&
|
||||
(GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6)) {
|
||||
(GET_EVENTINF_INGO_RACE_STATE() == INGO_RACE_STATE_TRAPPED_WIN_EPONA)) {
|
||||
play->csCtx.curFrame = 0;
|
||||
BgInGate_SetupAction(this, func_80892890);
|
||||
} else {
|
||||
|
|
|
@ -41,7 +41,7 @@ void BgUmaJump_Init(Actor* thisx, PlayState* play) {
|
|||
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
|
||||
|
||||
if (this->dyna.actor.params == 1) {
|
||||
if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && (DREG(1) == 0)) {
|
||||
if (!(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED)) {
|
||||
Actor_Kill(&this->dyna.actor);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "z_en_ge1.h"
|
||||
#include "z64horse.h"
|
||||
#include "terminal.h"
|
||||
#include "assets/objects/object_ge1/object_ge1.h"
|
||||
|
||||
|
@ -224,7 +225,7 @@ void EnGe1_KickPlayer(EnGe1* this, PlayState* play) {
|
|||
if (this->cutsceneTimer > 0) {
|
||||
this->cutsceneTimer--;
|
||||
} else {
|
||||
func_8006D074(play);
|
||||
Horse_ResetHorseData(play);
|
||||
|
||||
if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) {
|
||||
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_1;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "z_en_ge2.h"
|
||||
#include "z64horse.h"
|
||||
#include "terminal.h"
|
||||
#include "assets/objects/object_gla/object_gla.h"
|
||||
|
||||
|
@ -238,7 +239,7 @@ void EnGe2_CaptureClose(EnGe2* this, PlayState* play) {
|
|||
if (this->timer > 0) {
|
||||
this->timer--;
|
||||
} else {
|
||||
func_8006D074(play);
|
||||
Horse_ResetHorseData(play);
|
||||
|
||||
if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) {
|
||||
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_1;
|
||||
|
@ -264,7 +265,7 @@ void EnGe2_CaptureCharge(EnGe2* this, PlayState* play) {
|
|||
if (this->timer > 0) {
|
||||
this->timer--;
|
||||
} else {
|
||||
func_8006D074(play);
|
||||
Horse_ResetHorseData(play);
|
||||
|
||||
if ((INV_CONTENT(ITEM_HOOKSHOT) == ITEM_NONE) || (INV_CONTENT(ITEM_LONGSHOT) == ITEM_NONE)) {
|
||||
play->nextEntranceIndex = ENTR_GERUDO_VALLEY_1;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include "z_en_horse.h"
|
||||
#include "z64horse.h"
|
||||
#include "global.h"
|
||||
#include "versions.h"
|
||||
#include "overlays/actors/ovl_En_In/z_en_in.h"
|
||||
|
@ -525,7 +526,7 @@ void EnHorse_RaceWaypointPos(RaceWaypoint* waypoints, s32 index, Vec3f* pos) {
|
|||
}
|
||||
|
||||
void EnHorse_RotateToPoint(EnHorse* this, PlayState* play, Vec3f* pos, s16 turnAmount) {
|
||||
func_8006DD9C(&this->actor, pos, turnAmount);
|
||||
Horse_RotateToPoint(&this->actor, pos, turnAmount);
|
||||
}
|
||||
|
||||
void EnHorse_UpdateIngoRaceInfo(EnHorse* this, PlayState* play, RaceInfo* raceInfo) {
|
||||
|
@ -678,7 +679,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
|
|||
if (play->sceneId != SCENE_LON_LON_RANCH ||
|
||||
//! Same flag checked twice
|
||||
(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) &&
|
||||
(GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_6 ||
|
||||
(GET_EVENTINF_INGO_RACE_STATE() != INGO_RACE_STATE_TRAPPED_WIN_EPONA ||
|
||||
Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) ||
|
||||
// always load two spawns inside lon lon
|
||||
((sHorseSpawns[i].pos.x == 856 && sHorseSpawns[i].pos.y == 0 && sHorseSpawns[i].pos.z == -918) ||
|
||||
|
@ -747,7 +748,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
EnHorse* this = (EnHorse*)thisx;
|
||||
PlayState* play = play2;
|
||||
|
||||
AREG(6) = 0;
|
||||
R_EXITED_SCENE_RIDING_HORSE = false;
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
EnHorse_ClearDustFlags(&this->dustFlags);
|
||||
R_EPONAS_SONG_PLAYED = false;
|
||||
|
@ -782,7 +783,7 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
|
||||
// params was -1
|
||||
if (this->actor.params == 0x7FFF) {
|
||||
this->actor.params = 1;
|
||||
this->actor.params = HORSE_PTYPE_1;
|
||||
}
|
||||
|
||||
if (play->sceneId == SCENE_LON_LON_BUILDINGS) {
|
||||
|
@ -790,25 +791,25 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
} else if (play->sceneId == SCENE_GERUDOS_FORTRESS && this->type == HORSE_HNI) {
|
||||
this->stateFlags = ENHORSE_FLAG_18 | ENHORSE_UNRIDEABLE;
|
||||
} else {
|
||||
if (this->actor.params == 3) {
|
||||
if (this->actor.params == HORSE_PTYPE_INGO_SPAWNED_RIDING) {
|
||||
this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP | ENHORSE_UNRIDEABLE;
|
||||
} else if (this->actor.params == 6) {
|
||||
} else if (this->actor.params == HORSE_PTYPE_6) {
|
||||
this->stateFlags = ENHORSE_FLAG_19 | ENHORSE_CANT_JUMP;
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0) {
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED) {
|
||||
this->stateFlags &= ~ENHORSE_CANT_JUMP;
|
||||
this->stateFlags |= ENHORSE_FLAG_26;
|
||||
} else if (GET_EVENTINF(EVENTINF_HORSES_06) && this->type == HORSE_HNI) {
|
||||
} else if (GET_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE) && this->type == HORSE_HNI) {
|
||||
this->stateFlags |= ENHORSE_FLAG_21 | ENHORSE_FLAG_20;
|
||||
}
|
||||
} else if (this->actor.params == 1) {
|
||||
} else if (this->actor.params == HORSE_PTYPE_1) {
|
||||
this->stateFlags = ENHORSE_FLAG_7;
|
||||
} else {
|
||||
this->stateFlags = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (play->sceneId == SCENE_LON_LON_RANCH && GET_EVENTINF_HORSES_STATE() == EVENTINF_HORSES_STATE_6 &&
|
||||
!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1)) {
|
||||
if (play->sceneId == SCENE_LON_LON_RANCH && GET_EVENTINF_INGO_RACE_STATE() == INGO_RACE_STATE_TRAPPED_WIN_EPONA &&
|
||||
!(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED)) {
|
||||
this->stateFlags |= ENHORSE_FLAG_25;
|
||||
}
|
||||
|
||||
|
@ -842,12 +843,13 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
} else if (!Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1) && !IS_DAY) {
|
||||
} else if (!(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED) && !IS_DAY) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
} else if (play->sceneId == SCENE_STABLE) {
|
||||
if (IS_DAY || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1) != 0 || !LINK_IS_ADULT) {
|
||||
if (IS_DAY || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED ||
|
||||
!LINK_IS_ADULT) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
|
@ -865,24 +867,25 @@ void EnHorse_Init(Actor* thisx, PlayState* play2) {
|
|||
EnHorse_ResetRace(this, play);
|
||||
EnHorse_ResetHorsebackArchery(this, play);
|
||||
|
||||
if (this->actor.params == 2) {
|
||||
if (this->actor.params == HORSE_PTYPE_INACTIVE) {
|
||||
EnHorse_InitInactive(this);
|
||||
} else if (this->actor.params == 3) {
|
||||
} else if (this->actor.params == HORSE_PTYPE_INGO_SPAWNED_RIDING) {
|
||||
EnHorse_InitIngoHorse(this);
|
||||
this->rider = Actor_Spawn(&play->actorCtx, play, ACTOR_EN_IN, this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, this->actor.shape.rot.x, this->actor.shape.rot.y, 1, 1);
|
||||
ASSERT(this->rider != NULL, "this->race.rider != NULL", "../z_en_horse.c", 3077);
|
||||
if (!GET_EVENTINF(EVENTINF_HORSES_06)) {
|
||||
if (!GET_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE)) {
|
||||
this->ingoHorseMaxSpeed = 12.07f;
|
||||
} else {
|
||||
this->ingoHorseMaxSpeed = 12.625f;
|
||||
}
|
||||
} else if (this->actor.params == 7) {
|
||||
} else if (this->actor.params == HORSE_PTYPE_7) {
|
||||
EnHorse_InitCutscene(this, play);
|
||||
} else if (this->actor.params == 8) {
|
||||
} else if (this->actor.params == HORSE_PTYPE_HORSEBACK_ARCHERY) {
|
||||
EnHorse_InitHorsebackArchery(this);
|
||||
Interface_InitHorsebackArchery(play);
|
||||
} else if (play->sceneId == SCENE_LON_LON_RANCH && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && !DREG(1)) {
|
||||
} else if (play->sceneId == SCENE_LON_LON_RANCH && !Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) &&
|
||||
!R_DEBUG_FORCE_EPONA_OBTAINED) {
|
||||
EnHorse_InitFleePlayer(this);
|
||||
} else {
|
||||
if (play->sceneId == SCENE_LON_LON_BUILDINGS) {
|
||||
|
@ -918,7 +921,7 @@ void EnHorse_RotateToPlayer(EnHorse* this, PlayState* play) {
|
|||
|
||||
void EnHorse_Freeze(EnHorse* this) {
|
||||
if (this->action != ENHORSE_ACT_CS_UPDATE && this->action != ENHORSE_ACT_HBA) {
|
||||
if (sResetNoInput[this->actor.params] != 0 && this->actor.params != 4) {
|
||||
if (!(sResetNoInput[this->actor.params] == 0 || this->actor.params == HORSE_PTYPE_4)) {
|
||||
this->noInputTimer = 0;
|
||||
this->noInputTimerMax = 0;
|
||||
}
|
||||
|
@ -945,10 +948,10 @@ void EnHorse_Frozen(EnHorse* this, PlayState* play) {
|
|||
this->jntSph.base.ocFlags1 |= OC1_ON;
|
||||
if (this->playerControlled == true) {
|
||||
this->stateFlags &= ~ENHORSE_FLAG_7;
|
||||
if (this->actor.params == 4) {
|
||||
if (this->actor.params == HORSE_PTYPE_4) {
|
||||
EnHorse_StartMountedIdleResetAnim(this);
|
||||
} else if (this->actor.params == 9) {
|
||||
this->actor.params = 5;
|
||||
} else if (this->actor.params == HORSE_PTYPE_PLAYER_SPAWNED_RIDING) {
|
||||
this->actor.params = HORSE_PTYPE_5;
|
||||
if (play->csCtx.state != CS_STATE_IDLE) {
|
||||
EnHorse_StartMountedIdle(this);
|
||||
} else {
|
||||
|
@ -960,8 +963,8 @@ void EnHorse_Frozen(EnHorse* this, PlayState* play) {
|
|||
} else {
|
||||
EnHorse_StartMountedIdleResetAnim(this);
|
||||
}
|
||||
if (this->actor.params != 0) {
|
||||
this->actor.params = 0;
|
||||
if (this->actor.params != HORSE_PTYPE_0) {
|
||||
this->actor.params = HORSE_PTYPE_0;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
|
@ -1741,7 +1744,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) {
|
|||
|
||||
if (R_EPONAS_SONG_PLAYED && this->type == HORSE_EPONA) {
|
||||
R_EPONAS_SONG_PLAYED = false;
|
||||
if (EnHorse_Spawn(this, play) != 0) {
|
||||
if (EnHorse_Spawn(this, play)) {
|
||||
#if OOT_VERSION >= PAL_1_0
|
||||
Audio_PlaySfxGeneral(NA_SE_EV_HORSE_NEIGH, &this->actor.projectedPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
|
@ -1758,7 +1761,7 @@ void EnHorse_Inactive(EnHorse* this, PlayState* play2) {
|
|||
if (!(this->stateFlags & ENHORSE_INACTIVE)) {
|
||||
this->followTimer = 0;
|
||||
EnHorse_SetFollowAnimation(this, play);
|
||||
this->actor.params = 0;
|
||||
this->actor.params = HORSE_PTYPE_0;
|
||||
this->cyl1.base.ocFlags1 |= OC1_ON;
|
||||
this->cyl2.base.ocFlags1 |= OC1_ON;
|
||||
this->jntSph.base.ocFlags1 |= OC1_ON;
|
||||
|
@ -2397,7 +2400,7 @@ void EnHorse_CutsceneUpdate(EnHorse* this, PlayState* play) {
|
|||
|
||||
if (play->csCtx.state == 3) {
|
||||
this->playerControlled = 1;
|
||||
this->actor.params = 10;
|
||||
this->actor.params = HORSE_PTYPE_10;
|
||||
this->action = ENHORSE_ACT_IDLE;
|
||||
EnHorse_Freeze(this);
|
||||
return;
|
||||
|
|
|
@ -28,7 +28,7 @@ typedef enum EnHorseAction {
|
|||
/* 19 */ ENHORSE_ACT_FLEE_PLAYER
|
||||
} EnHorseAction;
|
||||
|
||||
|
||||
// stateFlags
|
||||
#define ENHORSE_BOOST (1 << 0) /* 0x1 */
|
||||
#define ENHORSE_BOOST_DECEL (1 << 1) /* 0x2 */
|
||||
#define ENHORSE_JUMPING (1 << 2) /* 0x4 */
|
||||
|
@ -90,6 +90,21 @@ typedef enum HorseType {
|
|||
/* 1 */ HORSE_HNI
|
||||
} HorseType;
|
||||
|
||||
typedef enum HorseParamType {
|
||||
/* 00 */ HORSE_PTYPE_0,
|
||||
/* 01 */ HORSE_PTYPE_1,
|
||||
/* 02 */ HORSE_PTYPE_INACTIVE, // Waits for Epona's Song to appear
|
||||
/* 03 */ HORSE_PTYPE_INGO_SPAWNED_RIDING,
|
||||
/* 04 */ HORSE_PTYPE_4,
|
||||
/* 05 */ HORSE_PTYPE_5,
|
||||
/* 06 */ HORSE_PTYPE_6,
|
||||
/* 07 */ HORSE_PTYPE_7,
|
||||
/* 08 */ HORSE_PTYPE_HORSEBACK_ARCHERY,
|
||||
/* 09 */ HORSE_PTYPE_PLAYER_SPAWNED_RIDING,
|
||||
/* 10 */ HORSE_PTYPE_10,
|
||||
/* 11 */ HORSE_PTYPE_11
|
||||
} HorseParamType;
|
||||
|
||||
typedef void (*EnHorsePostdrawFunc)(struct EnHorse*, struct PlayState*);
|
||||
|
||||
typedef struct EnHorse {
|
||||
|
|
|
@ -17,15 +17,15 @@
|
|||
(Math3D_PointInSquare2D(sRanchExit[0], sRanchExit[1], sRanchExit[2], sRanchExit[3], (actor)->world.pos.x, \
|
||||
(actor)->world.pos.z))
|
||||
|
||||
#define INGORACE_PLAYER_MOVE (1 << 0)
|
||||
#define INGORACE_SET_TIMER (1 << 1)
|
||||
#define INGORACE_INGO_MOVE (1 << 2)
|
||||
#define INGO_RACE_PLAYER_MOVE (1 << 0)
|
||||
#define INGO_RACE_SET_TIMER (1 << 1)
|
||||
#define INGO_RACE_INGO_MOVE (1 << 2)
|
||||
|
||||
typedef enum HorseGameIngoRaceResult {
|
||||
/* 0 */ INGORACE_NO_RESULT,
|
||||
/* 1 */ INGORACE_PLAYER_WIN,
|
||||
/* 2 */ INGORACE_INGO_WIN,
|
||||
/* 3 */ INGORACE_TIME_UP
|
||||
/* 0 */ INGO_RACE_NO_RESULT,
|
||||
/* 1 */ INGO_RACE_PLAYER_WIN,
|
||||
/* 2 */ INGO_RACE_INGO_WIN,
|
||||
/* 3 */ INGO_RACE_TIME_UP
|
||||
} HorseGameIngoRaceResult;
|
||||
|
||||
#define MALONRACE_PLAYER_MOVE (1 << 0)
|
||||
|
@ -96,7 +96,7 @@ s32 EnHorseGameCheck_InitIngoRace(EnHorseGameCheckBase* base, PlayState* play) {
|
|||
|
||||
this->startTimer = 0;
|
||||
this->finishTimer = 0;
|
||||
this->result = INGORACE_NO_RESULT;
|
||||
this->result = INGO_RACE_NO_RESULT;
|
||||
this->playerFinish = 0;
|
||||
this->ingoFinish = 0;
|
||||
|
||||
|
@ -109,24 +109,24 @@ s32 EnHorseGameCheck_DestroyIngoRace(EnHorseGameCheckBase* base, PlayState* play
|
|||
|
||||
void EnHorseGameCheck_FinishIngoRace(EnHorseGameCheckIngoRace* this, PlayState* play) {
|
||||
gSaveContext.save.cutsceneIndex = 0;
|
||||
if (this->result == INGORACE_PLAYER_WIN) {
|
||||
if (this->result == INGO_RACE_PLAYER_WIN) {
|
||||
play->nextEntranceIndex = ENTR_LON_LON_RANCH_7;
|
||||
if (GET_EVENTINF(EVENTINF_HORSES_06)) {
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_6);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
if (GET_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE)) {
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_TRAPPED_WIN_EPONA);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
play->transitionType = TRANS_TYPE_FADE_WHITE;
|
||||
Environment_ForcePlaySequence(NA_BGM_INGO);
|
||||
} else {
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_4);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_FIRST_WIN);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
Environment_ForcePlaySequence(NA_BGM_INGO);
|
||||
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_WHITE, TCS_FAST);
|
||||
}
|
||||
} else {
|
||||
play->nextEntranceIndex = ENTR_LON_LON_RANCH_8;
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_3);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_PLAYER_LOSE);
|
||||
play->transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
}
|
||||
DREG(25) = 0;
|
||||
play->transitionTrigger = TRANS_TRIGGER_START;
|
||||
|
@ -140,20 +140,20 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
|
|||
EnHorse* ingoHorse;
|
||||
Player* player2 = player;
|
||||
|
||||
if ((this->startTimer > 50) && !(this->startFlags & INGORACE_SET_TIMER)) {
|
||||
this->startFlags |= INGORACE_SET_TIMER;
|
||||
if ((this->startTimer > 50) && !(this->startFlags & INGO_RACE_SET_TIMER)) {
|
||||
this->startFlags |= INGO_RACE_SET_TIMER;
|
||||
Interface_SetTimer(0);
|
||||
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->startFlags & INGORACE_PLAYER_MOVE)) {
|
||||
} else if ((this->startTimer > 80) && (player->rideActor != NULL) && !(this->startFlags & INGO_RACE_PLAYER_MOVE)) {
|
||||
EnHorse* horse;
|
||||
|
||||
this->startFlags |= INGORACE_PLAYER_MOVE;
|
||||
this->startFlags |= INGO_RACE_PLAYER_MOVE;
|
||||
horse = (EnHorse*)player->rideActor;
|
||||
horse->inRace = 1;
|
||||
} else if ((this->startTimer > 81) && !(this->startFlags & INGORACE_INGO_MOVE)) {
|
||||
} else if ((this->startTimer > 81) && !(this->startFlags & INGO_RACE_INGO_MOVE)) {
|
||||
ingoHorse = (EnHorse*)this->ingoHorse;
|
||||
|
||||
ingoHorse->inRace = 1;
|
||||
this->startFlags |= INGORACE_INGO_MOVE;
|
||||
this->startFlags |= INGO_RACE_INGO_MOVE;
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
}
|
||||
|
@ -178,11 +178,11 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
|
|||
}
|
||||
}
|
||||
|
||||
if (this->result == INGORACE_NO_RESULT) {
|
||||
if (this->result == INGO_RACE_NO_RESULT) {
|
||||
if ((player2->rideActor != NULL) && (this->playerCheck[2] == 1) && AT_FINISH_LINE(player2->rideActor)) {
|
||||
this->playerFinish++;
|
||||
if (this->playerFinish > 0) {
|
||||
this->result = INGORACE_PLAYER_WIN;
|
||||
this->result = INGO_RACE_PLAYER_WIN;
|
||||
this->finishTimer = 55;
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
|
||||
Audio_PlaySfxGeneral(NA_SE_SY_START_SHOT, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
|
||||
|
@ -197,7 +197,7 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
|
|||
if (this->ingoFinish > 0) {
|
||||
ingoHorse = (EnHorse*)this->ingoHorse;
|
||||
|
||||
this->result = INGORACE_INGO_WIN;
|
||||
this->result = INGO_RACE_INGO_WIN;
|
||||
this->finishTimer = 70;
|
||||
ingoHorse->stateFlags |= ENHORSE_INGO_WON;
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
|
||||
|
@ -210,12 +210,12 @@ s32 EnHorseGameCheck_UpdateIngoRace(EnHorseGameCheckBase* base, PlayState* play)
|
|||
}
|
||||
if (((player2->rideActor != NULL) && AT_RANCH_EXIT(player2->rideActor)) || AT_RANCH_EXIT(&player2->actor)) {
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
|
||||
this->result = INGORACE_INGO_WIN;
|
||||
this->result = INGO_RACE_INGO_WIN;
|
||||
this->finishTimer = 20;
|
||||
}
|
||||
if ((gSaveContext.timerSeconds >= 180) && (this->startFlags & 2)) {
|
||||
SEQCMD_PLAY_SEQUENCE(SEQ_PLAYER_BGM_MAIN, 0, 0, NA_BGM_HORSE_GOAL);
|
||||
this->result = INGORACE_TIME_UP;
|
||||
this->result = INGO_RACE_TIME_UP;
|
||||
this->finishTimer = 20;
|
||||
}
|
||||
} else {
|
||||
|
@ -447,7 +447,8 @@ void EnHorseGameCheck_Init(Actor* thisx, PlayState* play) {
|
|||
s32 pad;
|
||||
EnHorseGameCheckBase* this = (EnHorseGameCheckBase*)thisx;
|
||||
|
||||
if ((play->sceneId == SCENE_LON_LON_RANCH) && (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || DREG(1))) {
|
||||
if ((play->sceneId == SCENE_LON_LON_RANCH) &&
|
||||
(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED)) {
|
||||
this->actor.params = HORSEGAME_MALON_RACE;
|
||||
}
|
||||
if (sInitFuncs[this->actor.params] != NULL) {
|
||||
|
|
|
@ -4,6 +4,17 @@
|
|||
* Description: Young Epona
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include "gfx.h"
|
||||
#include "gfx_setupdl.h"
|
||||
#include "ichain.h"
|
||||
#include "rand.h"
|
||||
#include "regs.h"
|
||||
#include "sfx.h"
|
||||
#include "z64actor.h"
|
||||
#include "z64horse.h"
|
||||
#include "z64player.h"
|
||||
#include "z64play.h"
|
||||
#include "z_en_horse_link_child.h"
|
||||
#include "assets/objects/object_horse_link_child/object_horse_link_child.h"
|
||||
|
||||
|
@ -451,7 +462,7 @@ void func_80A6A5A4(EnHorseLinkChild* this, PlayState* play) {
|
|||
yawDiff = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor) - this->actor.world.rot.y;
|
||||
// 0.7071 = cos(pi/4)
|
||||
if ((Math_CosS(yawDiff) < 0.7071f) && (this->animationIdx == 2)) {
|
||||
func_8006DD9C(&this->actor, &GET_PLAYER(play)->actor.world.pos, 300);
|
||||
Horse_RotateToPoint(&this->actor, &GET_PLAYER(play)->actor.world.pos, 300);
|
||||
}
|
||||
|
||||
if (SkelAnime_Update(&this->skin.skelAnime)) {
|
||||
|
@ -488,9 +499,9 @@ void func_80A6A7D0(EnHorseLinkChild* this, PlayState* play) {
|
|||
|
||||
if ((this->animationIdx == 4) || (this->animationIdx == 3) || (this->animationIdx == 2)) {
|
||||
if (!this->unk_1E8) {
|
||||
func_8006DD9C(&this->actor, &player->actor.world.pos, 300);
|
||||
Horse_RotateToPoint(&this->actor, &player->actor.world.pos, 300);
|
||||
} else {
|
||||
func_8006DD9C(&this->actor, &this->actor.home.pos, 300);
|
||||
Horse_RotateToPoint(&this->actor, &this->actor.home.pos, 300);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,11 +2,12 @@
|
|||
#define Z_EN_HORSE_LINK_CHILD_H
|
||||
|
||||
#include "ultra64.h"
|
||||
#include "global.h"
|
||||
#include "z64actor.h"
|
||||
#include "z64skin.h"
|
||||
|
||||
struct EnHorseLinkChild;
|
||||
|
||||
typedef void (*EnHorseLinkChildActionFunc)(struct EnHorseLinkChild*, PlayState*);
|
||||
typedef void (*EnHorseLinkChildActionFunc)(struct EnHorseLinkChild*, struct PlayState*);
|
||||
|
||||
typedef struct EnHorseLinkChild {
|
||||
/* 0x0000 */ Actor actor;
|
||||
|
|
|
@ -216,7 +216,7 @@ void EnHorseNormal_Init(Actor* thisx, PlayState* play) {
|
|||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
} else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
|
||||
} else if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED) {
|
||||
if (this->actor.world.rot.z != 7) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
|
|
|
@ -72,6 +72,14 @@ typedef enum EnInAnimation {
|
|||
/* 9 */ ENIN_ANIM_9
|
||||
} EnInAnimation;
|
||||
|
||||
typedef enum EnInStartMode {
|
||||
/* 0 */ ENIN_START_MODE_0,
|
||||
/* 1 */ ENIN_START_MODE_1,
|
||||
/* 2 */ ENIN_START_MODE_2,
|
||||
/* 3 */ ENIN_START_MODE_3,
|
||||
/* 4 */ ENIN_START_MODE_4
|
||||
} EnInStartMode;
|
||||
|
||||
static AnimationFrameCountInfo sAnimationInfo[] = {
|
||||
{ &object_in_Anim_001CC0, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_in_Anim_001CC0, 1.0f, ANIMMODE_LOOP, -10.0f },
|
||||
{ &object_in_Anim_013C6C, 1.0f, ANIMMODE_LOOP, 0.0f }, { &object_in_Anim_013C6C, 1.0f, ANIMMODE_LOOP, -10.0f },
|
||||
|
@ -140,8 +148,8 @@ u16 EnIn_GetTextIdAdult(PlayState* play) {
|
|||
if (IS_NIGHT) {
|
||||
return 0x204E;
|
||||
}
|
||||
switch (GET_EVENTINF_HORSES_STATE()) {
|
||||
case EVENTINF_HORSES_STATE_1:
|
||||
switch (GET_EVENTINF_INGO_RACE_STATE()) {
|
||||
case INGO_RACE_STATE_HORSE_RENTAL_PERIOD:
|
||||
if (!(player->stateFlags1 & PLAYER_STATE1_23)) {
|
||||
return 0x2036;
|
||||
} else if (GET_EVENTCHKINF(EVENTCHKINF_1B)) {
|
||||
|
@ -153,24 +161,27 @@ u16 EnIn_GetTextIdAdult(PlayState* play) {
|
|||
} else {
|
||||
return 0x2037;
|
||||
}
|
||||
case EVENTINF_HORSES_STATE_3:
|
||||
if (GET_EVENTINF(EVENTINF_HORSES_06) || GET_EVENTINF(EVENTINF_HORSES_05)) {
|
||||
case INGO_RACE_STATE_PLAYER_LOSE:
|
||||
if (GET_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE) || GET_EVENTINF(EVENTINF_INGO_RACE_LOST_ONCE)) {
|
||||
return 0x203E;
|
||||
} else {
|
||||
return 0x203D;
|
||||
}
|
||||
case EVENTINF_HORSES_STATE_4:
|
||||
case INGO_RACE_STATE_FIRST_WIN:
|
||||
return 0x203A;
|
||||
case EVENTINF_HORSES_STATE_5:
|
||||
case EVENTINF_HORSES_STATE_6:
|
||||
case INGO_RACE_STATE_TRAPPED_WIN_UNUSED:
|
||||
case INGO_RACE_STATE_TRAPPED_WIN_EPONA:
|
||||
return 0x203C;
|
||||
case EVENTINF_HORSES_STATE_7:
|
||||
case INGO_RACE_STATE_REMATCH:
|
||||
// Ask to race again after losing race
|
||||
return 0x205B;
|
||||
case EVENTINF_HORSES_STATE_2:
|
||||
case INGO_RACE_STATE_RACING:
|
||||
default:
|
||||
if (GET_INFTABLE(INFTABLE_9A)) {
|
||||
// Pay to Ride
|
||||
return 0x2031;
|
||||
} else {
|
||||
// Adult Ingo first dialog, branches to pay to ride
|
||||
return 0x2030;
|
||||
}
|
||||
}
|
||||
|
@ -256,9 +267,9 @@ s16 EnIn_UpdateTalkStateOnChoice(PlayState* play, Actor* thisx) {
|
|||
talkState = NPC_TALK_STATE_ACTION;
|
||||
} else {
|
||||
Message_ContinueTextbox(play, this->actor.textId = 0x2039);
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
|
||||
CLEAR_EVENTINF(EVENTINF_HORSES_05);
|
||||
CLEAR_EVENTINF(EVENTINF_HORSES_06);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_OFFER_RENTAL);
|
||||
CLEAR_EVENTINF(EVENTINF_INGO_RACE_LOST_ONCE);
|
||||
CLEAR_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE);
|
||||
this->actionFunc = func_80A7A4C8;
|
||||
}
|
||||
break;
|
||||
|
@ -361,40 +372,40 @@ s32 func_80A7975C(EnIn* this, PlayState* play) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
s32 func_80A79830(EnIn* this, PlayState* play) {
|
||||
s32 EnIn_GetStartMode(EnIn* this, PlayState* play) {
|
||||
if (play->sceneId == SCENE_LON_LON_RANCH && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 1 &&
|
||||
!GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
|
||||
return 1;
|
||||
return ENIN_START_MODE_1;
|
||||
}
|
||||
if (play->sceneId == SCENE_STABLE && LINK_IS_CHILD && IS_DAY && this->actor.shape.rot.z == 3 &&
|
||||
GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
|
||||
return 1;
|
||||
return ENIN_START_MODE_1;
|
||||
}
|
||||
if (play->sceneId == SCENE_STABLE && LINK_IS_CHILD && IS_NIGHT) {
|
||||
if ((this->actor.shape.rot.z == 2) && !GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
|
||||
return 1;
|
||||
return ENIN_START_MODE_1;
|
||||
}
|
||||
if ((this->actor.shape.rot.z == 4) && GET_EVENTCHKINF(EVENTCHKINF_TALON_RETURNED_FROM_CASTLE)) {
|
||||
return 1;
|
||||
return ENIN_START_MODE_1;
|
||||
}
|
||||
}
|
||||
if (play->sceneId == SCENE_LON_LON_RANCH && LINK_IS_ADULT && IS_DAY) {
|
||||
if ((this->actor.shape.rot.z == 5) && !GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
|
||||
return 2;
|
||||
return ENIN_START_MODE_2;
|
||||
}
|
||||
if ((this->actor.shape.rot.z == 7) && GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
|
||||
return 4;
|
||||
return ENIN_START_MODE_4;
|
||||
}
|
||||
}
|
||||
if (play->sceneId == SCENE_LON_LON_BUILDINGS && LINK_IS_ADULT && IS_NIGHT) {
|
||||
if (this->actor.shape.rot.z == 6 && !GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
|
||||
return 3;
|
||||
return ENIN_START_MODE_3;
|
||||
}
|
||||
if (this->actor.shape.rot.z == 8 && GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
|
||||
return 3;
|
||||
return ENIN_START_MODE_3;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return ENIN_START_MODE_0;
|
||||
}
|
||||
|
||||
void EnIn_UpdateEyes(EnIn* this) {
|
||||
|
@ -434,7 +445,7 @@ void func_80A79BAC(EnIn* this, PlayState* play, s32 index, u32 transitionType) {
|
|||
Player_SetCsActionWithHaltedActors(play, &this->actor, PLAYER_CSACTION_8);
|
||||
Interface_ChangeHudVisibilityMode(HUD_VISIBILITY_NOTHING);
|
||||
if (index == 0) {
|
||||
AREG(6) = 0;
|
||||
R_EXITED_SCENE_RIDING_HORSE = false;
|
||||
}
|
||||
gSaveContext.timerState = TIMER_STATE_OFF;
|
||||
}
|
||||
|
@ -506,7 +517,7 @@ void EnIn_Destroy(Actor* thisx, PlayState* play) {
|
|||
// This function does not actually wait since it waits for OBJECT_IN,
|
||||
// but the object is already loaded at this point from being set in the ActorProfile data
|
||||
void EnIn_WaitForObject(EnIn* this, PlayState* play) {
|
||||
s32 sp3C = 0;
|
||||
s32 staySpawned = false;
|
||||
|
||||
if (Object_IsLoaded(&play->objectCtx, this->requiredObjectSlot) || this->actor.params <= 0) {
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 36.0f);
|
||||
|
@ -515,7 +526,7 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) {
|
|||
Collider_SetCylinder(play, &this->collider, &this->actor, &sCylinderInit);
|
||||
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
|
||||
if (func_80A7975C(this, play)) {
|
||||
SET_EVENTINF_HORSES_0F(0);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(0);
|
||||
return;
|
||||
}
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
|
@ -523,83 +534,83 @@ void EnIn_WaitForObject(EnIn* this, PlayState* play) {
|
|||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
this->actionFunc = func_80A7A4BC;
|
||||
|
||||
switch (func_80A79830(this, play)) {
|
||||
case 1:
|
||||
switch (EnIn_GetStartMode(this, play)) {
|
||||
case ENIN_START_MODE_1:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_9);
|
||||
this->actionFunc = func_80A7A4BC;
|
||||
break;
|
||||
case 3:
|
||||
case ENIN_START_MODE_3:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_7);
|
||||
this->actionFunc = func_80A7A4BC;
|
||||
if (!GET_EVENTCHKINF(EVENTCHKINF_EPONA_OBTAINED)) {
|
||||
this->actor.params = 5;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
case ENIN_START_MODE_4:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_8);
|
||||
this->eyeIndex = 3;
|
||||
this->actionFunc = func_80A7A4BC;
|
||||
break;
|
||||
case 0:
|
||||
case ENIN_START_MODE_0:
|
||||
Actor_Kill(&this->actor);
|
||||
break;
|
||||
default:
|
||||
switch (GET_EVENTINF_HORSES_STATE()) {
|
||||
case EVENTINF_HORSES_STATE_0:
|
||||
case EVENTINF_HORSES_STATE_2:
|
||||
case EVENTINF_HORSES_STATE_3:
|
||||
case EVENTINF_HORSES_STATE_4:
|
||||
case EVENTINF_HORSES_STATE_7:
|
||||
default: // ENIN_START_MODE_2
|
||||
switch (GET_EVENTINF_INGO_RACE_STATE()) {
|
||||
case INGO_RACE_STATE_OFFER_RENTAL:
|
||||
case INGO_RACE_STATE_RACING:
|
||||
case INGO_RACE_STATE_PLAYER_LOSE:
|
||||
case INGO_RACE_STATE_FIRST_WIN:
|
||||
case INGO_RACE_STATE_REMATCH:
|
||||
if (this->actor.params == 2) {
|
||||
sp3C = 1;
|
||||
staySpawned = true;
|
||||
}
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_1:
|
||||
case INGO_RACE_STATE_HORSE_RENTAL_PERIOD:
|
||||
if (this->actor.params == 3) {
|
||||
sp3C = 1;
|
||||
staySpawned = true;
|
||||
}
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_5:
|
||||
case EVENTINF_HORSES_STATE_6:
|
||||
case INGO_RACE_STATE_TRAPPED_WIN_UNUSED:
|
||||
case INGO_RACE_STATE_TRAPPED_WIN_EPONA:
|
||||
if (this->actor.params == 4) {
|
||||
sp3C = 1;
|
||||
staySpawned = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (sp3C != 1) {
|
||||
if (staySpawned != true) {
|
||||
Actor_Kill(&this->actor);
|
||||
return;
|
||||
}
|
||||
switch (GET_EVENTINF_HORSES_STATE()) {
|
||||
case EVENTINF_HORSES_STATE_0:
|
||||
case EVENTINF_HORSES_STATE_2:
|
||||
switch (GET_EVENTINF_INGO_RACE_STATE()) {
|
||||
case INGO_RACE_STATE_OFFER_RENTAL:
|
||||
case INGO_RACE_STATE_RACING:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_2);
|
||||
this->actionFunc = func_80A7A4C8;
|
||||
gSaveContext.eventInf[EVENTINF_HORSES_INDEX] = 0;
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_1:
|
||||
case INGO_RACE_STATE_HORSE_RENTAL_PERIOD:
|
||||
this->actor.attentionRangeType = ATTENTION_RANGE_3;
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_2);
|
||||
this->actionFunc = func_80A7A568;
|
||||
Interface_SetTimer(60);
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_3:
|
||||
case INGO_RACE_STATE_PLAYER_LOSE:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_4);
|
||||
this->actionFunc = func_80A7A770;
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_4:
|
||||
case INGO_RACE_STATE_FIRST_WIN:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_6);
|
||||
this->unk_1EC = 8;
|
||||
this->actionFunc = func_80A7A940;
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_5:
|
||||
case EVENTINF_HORSES_STATE_6:
|
||||
case INGO_RACE_STATE_TRAPPED_WIN_UNUSED:
|
||||
case INGO_RACE_STATE_TRAPPED_WIN_EPONA:
|
||||
this->actor.attentionRangeType = ATTENTION_RANGE_3;
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_6);
|
||||
this->unk_1EC = 8;
|
||||
this->actionFunc = func_80A7AA40;
|
||||
break;
|
||||
case EVENTINF_HORSES_STATE_7:
|
||||
case INGO_RACE_STATE_REMATCH:
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_2);
|
||||
this->actionFunc = func_80A7A848;
|
||||
break;
|
||||
|
@ -640,8 +651,8 @@ void func_80A7A4BC(EnIn* this, PlayState* play) {
|
|||
void func_80A7A4C8(EnIn* this, PlayState* play) {
|
||||
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
|
||||
func_80A79BAC(this, play, 1, TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST));
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_1);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_HORSE_RENTAL_PERIOD);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
CLEAR_INFTABLE(INFTABLE_A2);
|
||||
Environment_ForcePlaySequence(NA_BGM_HORSE);
|
||||
play->msgCtx.stateTimer = 0;
|
||||
|
@ -672,8 +683,8 @@ void func_80A7A568(EnIn* this, PlayState* play) {
|
|||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
return;
|
||||
}
|
||||
SET_EVENTINF_HORSES_HORSETYPE(((EnHorse*)GET_PLAYER(play)->rideActor)->type);
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_2);
|
||||
WRITE_EVENTINF_INGO_RACE_HORSETYPE(((EnHorse*)GET_PLAYER(play)->rideActor)->type);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_RACING);
|
||||
phi_a2 = 2;
|
||||
transitionType = TRANS_TYPE_FADE_BLACK;
|
||||
} else {
|
||||
|
@ -685,13 +696,13 @@ void func_80A7A568(EnIn* this, PlayState* play) {
|
|||
SET_INFTABLE(INFTABLE_AB);
|
||||
}
|
||||
}
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_OFFER_RENTAL);
|
||||
phi_a2 = 0;
|
||||
transitionType = TRANS_TYPE_CIRCLE(TCA_NORMAL, TCC_BLACK, TCS_FAST);
|
||||
}
|
||||
func_80A79BAC(this, play, phi_a2, transitionType);
|
||||
play->msgCtx.stateTimer = 0;
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
}
|
||||
|
@ -705,11 +716,10 @@ void func_80A7A770(EnIn* this, PlayState* play) {
|
|||
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
|
||||
EnIn_ChangeAnim(this, ENIN_ANIM_3);
|
||||
this->actionFunc = func_80A7A848;
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_7);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_REMATCH);
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
gSaveContext.eventInf[EVENTINF_HORSES_INDEX] =
|
||||
(gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & 0xFFFF) | EVENTINF_HORSES_05_MASK;
|
||||
if (!GET_EVENTINF(EVENTINF_HORSES_06)) {
|
||||
SET_EVENTINF_INGO_RACE_FLAG(EVENTINF_INGO_RACE_LOST_ONCE);
|
||||
if (!GET_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE)) {
|
||||
play->msgCtx.stateTimer = 4;
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
}
|
||||
|
@ -720,18 +730,18 @@ void func_80A7A848(EnIn* this, PlayState* play) {
|
|||
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
|
||||
if ((play->msgCtx.choiceIndex == 0 && gSaveContext.save.info.playerData.rupees < 50) ||
|
||||
play->msgCtx.choiceIndex == 1) {
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_OFFER_RENTAL);
|
||||
this->actionFunc = func_80A7A4C8;
|
||||
} else {
|
||||
func_80A79BAC(this, play, 2, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_2);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_RACING);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
play->msgCtx.stateTimer = 0;
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
}
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
CLEAR_EVENTINF(EVENTINF_HORSES_05);
|
||||
CLEAR_EVENTINF(EVENTINF_HORSES_06);
|
||||
CLEAR_EVENTINF(EVENTINF_INGO_RACE_LOST_ONCE);
|
||||
CLEAR_EVENTINF(EVENTINF_INGO_RACE_SECOND_RACE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -749,13 +759,12 @@ void func_80A7A940(EnIn* this, PlayState* play) {
|
|||
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
|
||||
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
|
||||
func_80A79BAC(this, play, 2, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_2);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_RACING);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
play->msgCtx.stateTimer = 0;
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
gSaveContext.eventInf[EVENTINF_HORSES_INDEX] =
|
||||
(gSaveContext.eventInf[EVENTINF_HORSES_INDEX] & 0xFFFF) | EVENTINF_HORSES_06_MASK;
|
||||
SET_EVENTINF_INGO_RACE_FLAG(EVENTINF_INGO_RACE_SECOND_RACE);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -904,8 +913,8 @@ void func_80A7B024(EnIn* this, PlayState* play) {
|
|||
}
|
||||
|
||||
func_80A79BAC(this, play, 0, TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST));
|
||||
SET_EVENTINF_HORSES_STATE(EVENTINF_HORSES_STATE_0);
|
||||
SET_EVENTINF_HORSES_0F(1);
|
||||
SET_EVENTINF_INGO_RACE_STATE(INGO_RACE_STATE_OFFER_RENTAL);
|
||||
WRITE_EVENTINF_INGO_RACE_0F(1);
|
||||
play->msgCtx.stateTimer = 4;
|
||||
play->msgCtx.msgMode = MSGMODE_TEXT_CLOSING;
|
||||
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
|
||||
|
@ -925,7 +934,7 @@ void EnIn_Update(Actor* thisx, PlayState* play) {
|
|||
if (this->actionFunc != func_80A7A304) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->skelAnime.animation == &object_in_Anim_001BE0 &&
|
||||
GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_6) {
|
||||
GET_EVENTINF_INGO_RACE_STATE() != INGO_RACE_STATE_TRAPPED_WIN_EPONA) {
|
||||
func_80A79690(&this->skelAnime, this, play);
|
||||
}
|
||||
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_2);
|
||||
|
|
|
@ -81,7 +81,7 @@ void OceffSpot_End(OceffSpot* this, PlayState* play) {
|
|||
} else {
|
||||
Actor_Kill(&this->actor);
|
||||
if (gTimeSpeed != 400 && !play->msgCtx.disableSunsSong &&
|
||||
GET_EVENTINF_HORSES_STATE() != EVENTINF_HORSES_STATE_1) {
|
||||
GET_EVENTINF_INGO_RACE_STATE() != INGO_RACE_STATE_HORSE_RENTAL_PERIOD) {
|
||||
if (play->msgCtx.ocarinaAction != OCARINA_ACTION_CHECK_NOWARP_DONE ||
|
||||
play->msgCtx.ocarinaMode != OCARINA_MODE_08) {
|
||||
gSaveContext.sunsSongState = SUNSSONG_START;
|
||||
|
|
|
@ -11842,7 +11842,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
|
|||
if (DREG(25) != 0) {
|
||||
DREG(25) = 0;
|
||||
} else {
|
||||
AREG(6) = 1;
|
||||
R_EXITED_SCENE_RIDING_HORSE = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13216,7 +13216,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) {
|
|||
}
|
||||
|
||||
if (LinkAnimation_OnFrame(&this->skelAnime, arr[1])) {
|
||||
func_8002DE74(play, this);
|
||||
Actor_RequestHorseCameraSetting(play, this);
|
||||
Player_PlaySfx(this, NA_SE_PL_SIT_ON_HORSE);
|
||||
return;
|
||||
}
|
||||
|
@ -13224,7 +13224,7 @@ void Player_Action_8084CC98(Player* this, PlayState* play) {
|
|||
return;
|
||||
}
|
||||
|
||||
func_8002DE74(play, this);
|
||||
Actor_RequestHorseCameraSetting(play, this);
|
||||
this->skelAnime.prevTransl = D_8085499C;
|
||||
|
||||
if ((rideActor->animationIdx != this->av2.actionVar2) &&
|
||||
|
@ -13383,9 +13383,9 @@ void Player_Action_8084D3E4(Player* this, PlayState* play) {
|
|||
func_8083C0E8(this, play);
|
||||
this->stateFlags1 &= ~PLAYER_STATE1_23;
|
||||
this->actor.parent = NULL;
|
||||
AREG(6) = 0;
|
||||
R_EXITED_SCENE_RIDING_HORSE = false;
|
||||
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || (DREG(1) != 0)) {
|
||||
if (Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) || R_DEBUG_FORCE_EPONA_OBTAINED) {
|
||||
gSaveContext.save.info.horseData.pos.x = rideActor->actor.world.pos.x;
|
||||
gSaveContext.save.info.horseData.pos.y = rideActor->actor.world.pos.y;
|
||||
gSaveContext.save.info.horseData.pos.z = rideActor->actor.world.pos.z;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue