1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Some doc on actor overlays alloc types (#1266)

* Some doc on actor overlays alloc types

* Line breaks between defines at the top of actor.h

* plain english

* `ACTOR_ALLOC_` -> `ACTOROVL_ALLOC_`

* More line breaks

* `ACTOR_OVERLAY_ABSOLUTE_SPACE_SIZE` -> `ACTOROVL_ABSOLUTE_SPACE_SIZE`

* Document bug about Scarecrow's Song not setting the flag to restore Nayru's Love

* Try to document the check for needing to actor_kill to leave the absolute space being too broad

* "which overlay uses" (bad english) -> simplify to "which uses"

* Run formatter
This commit is contained in:
Dragorn421 2022-06-20 13:17:09 -07:00 committed by GitHub
parent b602276fef
commit 017a3aaf5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 539 additions and 463 deletions

View file

@ -180,11 +180,15 @@ void ArrowFire_Fly(ArrowFire* this, PlayState* play) {
void ArrowFire_Update(Actor* thisx, PlayState* play) {
ArrowFire* this = (ArrowFire*)thisx;
if (play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK || play->msgCtx.msgMode == MSGMODE_SONG_PLAYED) {
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
if ((play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (play->msgCtx.msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(&this->actor);
} else {
this->actionFunc(this, play);
return;
}
this->actionFunc(this, play);
}
void ArrowFire_Draw(Actor* thisx, PlayState* play2) {

View file

@ -181,11 +181,15 @@ void ArrowIce_Fly(ArrowIce* this, PlayState* play) {
void ArrowIce_Update(Actor* thisx, PlayState* play) {
ArrowIce* this = (ArrowIce*)thisx;
if (play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK || play->msgCtx.msgMode == MSGMODE_SONG_PLAYED) {
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
if ((play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (play->msgCtx.msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(&this->actor);
} else {
this->actionFunc(this, play);
return;
}
this->actionFunc(this, play);
}
void ArrowIce_Draw(Actor* thisx, PlayState* play) {

View file

@ -179,11 +179,15 @@ void ArrowLight_Fly(ArrowLight* this, PlayState* play) {
void ArrowLight_Update(Actor* thisx, PlayState* play) {
ArrowLight* this = (ArrowLight*)thisx;
if (play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK || play->msgCtx.msgMode == MSGMODE_SONG_PLAYED) {
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
if ((play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (play->msgCtx.msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(&this->actor);
} else {
this->actionFunc(this, play);
return;
}
this->actionFunc(this, play);
}
void ArrowLight_Draw(Actor* thisx, PlayState* play) {

View file

@ -78,6 +78,12 @@ void MagicDark_DiamondUpdate(Actor* thisx, PlayState* play) {
if (1) {}
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
//! This happens with all magic effects actors, but is especially visible with Nayru's Love as it lasts longer than
//! other magic actors, and the Nayru's Love actor is supposed to be spawned back after ocarina effects actors are
//! done. But with warp songs, whether the player warps away or not, the actor won't be spawned back.
if ((msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(thisx);
return;

View file

@ -99,10 +99,14 @@ void MagicFire_UpdateBeforeCast(Actor* thisx, PlayState* play) {
MagicFire* this = (MagicFire*)thisx;
Player* player = GET_PLAYER(play);
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
if ((play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (play->msgCtx.msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(&this->actor);
return;
}
if (this->actionTimer > 0) {
this->actionTimer--;
} else {
@ -119,10 +123,15 @@ void MagicFire_Update(Actor* thisx, PlayState* play) {
if (1) {}
this->actor.world.pos = player->actor.world.pos;
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
if ((play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (play->msgCtx.msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(&this->actor);
return;
}
if (this->action == DF_ACTION_EXPAND_SLOWLY) {
this->collider.info.toucher.damage = this->actionTimer + 25;
} else if (this->action == DF_ACTION_STOP_EXPANDING) {

View file

@ -131,7 +131,11 @@ void MagicWind_Shrink(MagicWind* this, PlayState* play) {
void MagicWind_Update(Actor* thisx, PlayState* play) {
MagicWind* this = (MagicWind*)thisx;
if (play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK || play->msgCtx.msgMode == MSGMODE_SONG_PLAYED) {
// See `ACTOROVL_ALLOC_ABSOLUTE`
//! @bug This condition is too broad, the actor will also be killed by warp songs. But warp songs do not use an
//! actor which uses `ACTOROVL_ALLOC_ABSOLUTE`. There is no reason to kill the actor in this case.
if ((play->msgCtx.msgMode == MSGMODE_OCARINA_CORRECT_PLAYBACK) || (play->msgCtx.msgMode == MSGMODE_SONG_PLAYED)) {
Actor_Kill(thisx);
return;
}

View file

@ -71,7 +71,7 @@ void OceffSpot_Destroy(Actor* thisx, PlayState* play) {
LightContext_RemoveLight(play, &play->lightCtx, this->lightNode2);
Magic_Reset(play);
if ((gSaveContext.nayrusLoveTimer != 0) && (play->actorCtx.actorLists[ACTORCAT_PLAYER].length != 0)) {
player->stateFlags3 |= PLAYER_STATE3_6;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -61,7 +61,7 @@ void OceffStorm_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= PLAYER_STATE3_6;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -41,7 +41,7 @@ void OceffWipe_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= PLAYER_STATE3_6;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -41,7 +41,7 @@ void OceffWipe2_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= PLAYER_STATE3_6;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -44,7 +44,7 @@ void OceffWipe3_Destroy(Actor* thisx, PlayState* play) {
Magic_Reset(play);
if (gSaveContext.nayrusLoveTimer != 0) {
player->stateFlags3 |= PLAYER_STATE3_6;
player->stateFlags3 |= PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
}

View file

@ -39,6 +39,9 @@ void OceffWipe4_Destroy(Actor* thisx, PlayState* play) {
OceffWipe4* this = (OceffWipe4*)thisx;
Magic_Reset(play);
//! @bug `PLAYER_STATE3_RESTORE_NAYRUS_LOVE` is not set, unlike other Oceff actors.
//! This means playing Scarecrow's Song interrupts Nayru's Love without restoring it later.
}
void OceffWipe4_Update(Actor* thisx, PlayState* play) {

View file

@ -9383,7 +9383,7 @@ void Player_Init(Actor* thisx, PlayState* play2) {
if (gSaveContext.nayrusLoveTimer != 0) {
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
func_80846A00(play, this, 1);
this->stateFlags3 &= ~PLAYER_STATE3_6;
this->stateFlags3 &= ~PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
if (gSaveContext.entranceSound != 0) {
@ -10169,11 +10169,11 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) {
func_80848C74(play, this);
}
if ((this->stateFlags3 & PLAYER_STATE3_6) && (gSaveContext.nayrusLoveTimer != 0) &&
if ((this->stateFlags3 & PLAYER_STATE3_RESTORE_NAYRUS_LOVE) && (gSaveContext.nayrusLoveTimer != 0) &&
(gSaveContext.magicState == MAGIC_STATE_IDLE)) {
gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1;
func_80846A00(play, this, 1);
this->stateFlags3 &= ~PLAYER_STATE3_6;
this->stateFlags3 &= ~PLAYER_STATE3_RESTORE_NAYRUS_LOVE;
}
if (this->stateFlags2 & PLAYER_STATE2_15) {