1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-19 21:41:59 +00:00

Document Timers (#1412)

* Document Timers, First Draft

* some progress

* more timer docs

* cleanup

* small cleanup

* more cleanup

* comments

* more cleanup

* extra comment

* more docs

* brackets

* PR Suggestions

* cleanup, missed some

* more suggestions

* more PR Suggestions

* small change

* environmental
This commit is contained in:
engineer124 2022-11-16 13:41:27 -05:00 committed by GitHub
parent cc2409606e
commit 40639e698d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 550 additions and 435 deletions

View file

@ -73,39 +73,44 @@ static AnimationFrameCountInfo sAnimationInfo[] = {
u16 func_80AA2AA0(PlayState* play, Actor* thisx) {
Player* player = GET_PLAYER(play);
s16* timer1ValuePtr; // weirdness with this necessary to match
if (!GET_INFTABLE(INFTABLE_B8)) {
return 0x2000;
}
timer1ValuePtr = &gSaveContext.timer1Value;
if (GET_EVENTINF(EVENTINF_HORSES_0A)) {
gSaveContext.timer1Value = gSaveContext.timer1Value;
gSaveContext.timerSeconds = gSaveContext.timerSeconds;
thisx->flags |= ACTOR_FLAG_16;
if (gSaveContext.timer1Value >= 0xD3) {
if (((void)0, gSaveContext.timerSeconds) > 210) {
return 0x208E;
}
if ((HIGH_SCORE(HS_HORSE_RACE) == 0) || (HIGH_SCORE(HS_HORSE_RACE) >= 0xB4)) {
HIGH_SCORE(HS_HORSE_RACE) = 0xB4;
gSaveContext.timer1Value = *timer1ValuePtr;
if ((HIGH_SCORE(HS_HORSE_RACE) == 0) || (HIGH_SCORE(HS_HORSE_RACE) >= 180)) {
HIGH_SCORE(HS_HORSE_RACE) = 180;
}
if (!GET_EVENTCHKINF(EVENTCHKINF_1E) && (gSaveContext.timer1Value < 0x32)) {
if (!GET_EVENTCHKINF(EVENTCHKINF_1E) && (((void)0, gSaveContext.timerSeconds) < 50)) {
return 0x208F;
} else if (gSaveContext.timer1Value < HIGH_SCORE(HS_HORSE_RACE)) {
return 0x2012;
} else {
return 0x2004;
}
if (HIGH_SCORE(HS_HORSE_RACE) > ((void)0, gSaveContext.timerSeconds)) {
return 0x2012;
}
return 0x2004;
}
if (!(player->stateFlags1 & PLAYER_STATE1_23) &&
(Actor_FindNearby(play, thisx, ACTOR_EN_HORSE, 1, 1200.0f) == NULL)) {
return 0x2001;
}
if (!GET_INFTABLE(INFTABLE_B9)) {
return 0x2002;
} else {
return 0x2003;
}
return 0x2003;
}
s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
@ -119,7 +124,7 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
play->transitionType = TRANS_TYPE_CIRCLE(TCA_STARBURST, TCC_BLACK, TCS_FAST);
play->transitionTrigger = TRANS_TRIGGER_START;
SET_EVENTINF(EVENTINF_HORSES_0A);
gSaveContext.timer1State = 0xF;
gSaveContext.timerState = TIMER_STATE_UP_FREEZE;
}
break;
case TEXT_STATE_CHOICE:
@ -147,15 +152,15 @@ s16 func_80AA2BD4(PlayState* play, Actor* thisx) {
FALLTHROUGH;
case 0x2004:
case 0x2012:
if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timer1Value) {
HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timer1Value;
if (HIGH_SCORE(HS_HORSE_RACE) > gSaveContext.timerSeconds) {
HIGH_SCORE(HS_HORSE_RACE) = gSaveContext.timerSeconds;
}
FALLTHROUGH;
case 0x208E:
CLEAR_EVENTINF(EVENTINF_HORSES_0A);
thisx->flags &= ~ACTOR_FLAG_16;
ret = 0;
gSaveContext.timer1State = 0xA;
gSaveContext.timerState = TIMER_STATE_STOP;
break;
case 0x2002:
SET_INFTABLE(INFTABLE_B9);