1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-25 01:34:18 +00:00

Name Talking Related Actor Flags (#2230)

* document talking related actor flags

* tweak comment

* review

* tweak

* accept -> accepted

* add more clarification
This commit is contained in:
fig02 2024-09-30 06:24:43 -04:00 committed by GitHub
parent f7f38ff874
commit 80ed596c56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 84 additions and 76 deletions

View file

@ -161,14 +161,18 @@ typedef struct ActorShape {
//
#define ACTOR_FLAG_15 (1 << 15)
//
#define ACTOR_FLAG_16 (1 << 16)
// Player automatically accepts a Talk Offer without needing to press the A button.
// Player still has to meet all conditions to be able to receive a talk offer (for example, being in range).
#define ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED (1 << 16)
//
#define ACTOR_FLAG_17 (1 << 17)
//
#define ACTOR_FLAG_18 (1 << 18)
// When locked onto an actor with this flag set, the C-Up button can be used to talk to this actor.
// A C-Up button labeled "Navi" will appear on the HUD when locked on which indicates the actor can be checked with Navi.
// With this flag Player talks directly to the actor with C-Up. It is expected that the resulting dialog should appear
// to be coming from Navi, even though she is not involved at all with this interaction.
#define ACTOR_FLAG_TALK_WITH_C_UP (1 << 18)
// Flags controlling the use of `Actor.sfx`. Do not use directly.
#define ACTOR_FLAG_SFX_ACTOR_POS_2 (1 << 19) // see Actor_PlaySfx_Flagged2

View file

@ -4320,7 +4320,7 @@ void Message_Update(PlayState* play) {
// Later, if the ocarina has not been played and another textbox is closed, this handling
// for Saria's song will be carried out.
player->naviTextId = -0xE0;
player->naviActor->flags |= ACTOR_FLAG_16;
player->naviActor->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
if (msgCtx->ocarinaAction == OCARINA_ACTION_FREE_PLAY_DONE &&
(play->msgCtx.ocarinaMode == OCARINA_MODE_01 || play->msgCtx.ocarinaMode == OCARINA_MODE_0B)) {

View file

@ -88,8 +88,7 @@ void ElfMsg2_Init(Actor* thisx, PlayState* play) {
ElfMsg2_SetupAction(this, ElfMsg2_WaitUntilActivated);
} else {
ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead);
this->actor.flags |=
ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_18; // Make actor targetable and Navi-checkable
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP;
this->actor.textId = ElfMsg2_GetMessageId(this);
}
this->actor.shape.rot.x = this->actor.shape.rot.y = this->actor.shape.rot.z = 0;
@ -141,7 +140,7 @@ void ElfMsg2_WaitUntilActivated(ElfMsg2* this, PlayState* play) {
if ((this->actor.world.rot.y >= 0x41) && (this->actor.world.rot.y <= 0x80) &&
(Flags_GetSwitch(play, (this->actor.world.rot.y - 0x41)))) {
ElfMsg2_SetupAction(this, ElfMsg2_WaitForTextRead);
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_18; // Make actor targetable and Navi-checkable
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP;
this->actor.textId = ElfMsg2_GetMessageId(this);
}
}

View file

@ -217,7 +217,7 @@ void EnCow_UpdateAnimation(EnCow* this, PlayState* play) {
void EnCow_TalkEnd(EnCow* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Message_CloseTextbox(play);
this->actionFunc = EnCow_Idle;
}
@ -225,7 +225,7 @@ void EnCow_TalkEnd(EnCow* this, PlayState* play) {
void EnCow_GiveMilkEnd(EnCow* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnCow_Idle;
}
}
@ -241,7 +241,7 @@ void EnCow_GiveMilkWait(EnCow* this, PlayState* play) {
void EnCow_GiveMilk(EnCow* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Message_CloseTextbox(play);
this->actionFunc = EnCow_GiveMilkWait;
Actor_OfferGetItem(&this->actor, play, GI_MILK, 10000.0f, 100.0f);
@ -264,7 +264,7 @@ void EnCow_Talk(EnCow* this, PlayState* play) {
if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->actionFunc = EnCow_CheckForEmptyBottle;
} else {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalk(&this->actor, play, 170.0f);
this->actor.textId = 0x2006;
}
@ -290,7 +290,7 @@ void EnCow_Idle(EnCow* this, PlayState* play) {
(ABS((s16)(this->actor.yawTowardsPlayer - this->actor.shape.rot.y)) < 25000)) {
R_EPONAS_SONG_PLAYED = false;
this->actionFunc = EnCow_Talk;
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalk(&this->actor, play, 170.0f);
this->actor.textId = 0x2006;
} else {

View file

@ -347,9 +347,9 @@ void EnDns_Idle(EnDns* this, PlayState* play) {
this->actionFunc = EnDns_Talk;
} else {
if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isLockedOn) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
if (this->actor.xzDistToPlayer < 130.0f) {
Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play);

View file

@ -53,7 +53,7 @@ void EnDs_Destroy(Actor* thisx, PlayState* play) {
void EnDs_Talk(EnDs* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actionFunc = EnDs_Wait;
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
this->unk_1E8 |= 1;
}
@ -70,7 +70,7 @@ void EnDs_TalkAfterGiveOddPotion(EnDs* this, PlayState* play) {
if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->actionFunc = EnDs_Talk;
} else {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalk(&this->actor, play, 1000.0f);
}
}
@ -188,7 +188,7 @@ void EnDs_OfferBluePotion(EnDs* this, PlayState* play) {
return;
case 2: // have 100 rupees and empty bottle
Rupees_ChangeBy(-100);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferGetItem(&this->actor, play, GI_BOTTLE_POTION_BLUE, 10000.0f, 50.0f);
this->actionFunc = EnDs_GiveBluePotion;
return;

View file

@ -1397,7 +1397,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
}
} else if (player->naviTextId < 0) {
// trigger dialog instantly for negative message IDs
thisx->flags |= ACTOR_FLAG_16;
thisx->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
if (Actor_TalkOfferAccepted(thisx, play)) {
@ -1418,7 +1418,7 @@ void func_80A053F0(Actor* thisx, PlayState* play) {
this->elfMsg->actor.flags |= ACTOR_FLAG_TALK;
}
thisx->flags &= ~ACTOR_FLAG_16;
thisx->flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
this->actionFunc(this, play);
thisx->shape.rot.y = this->unk_2BC;

View file

@ -167,11 +167,11 @@ void func_80A1DBD4(EnFu* this, PlayState* play) {
if (play->msgCtx.ocarinaMode >= OCARINA_MODE_04) {
this->actionFunc = EnFu_WaitAdult;
play->msgCtx.ocarinaMode = OCARINA_MODE_04;
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else if (play->msgCtx.ocarinaMode == OCARINA_MODE_03) {
Sfx_PlaySfxCentered(NA_SE_SY_CORRECT_CHIME);
this->actionFunc = func_80A1DB60;
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
play->csCtx.script = SEGMENTED_TO_VIRTUAL(gSongOfStormsCs);
gSaveContext.cutsceneTrigger = 1;
Item_Give(play, ITEM_SONG_STORMS);

View file

@ -518,7 +518,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
s32 getItemId;
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnGe1_WaitTillItemGiven_Archery;
}
@ -545,7 +545,7 @@ void EnGe1_BeginGiveItem_Archery(EnGe1* this, PlayState* play) {
void EnGe1_TalkWinPrize_Archery(EnGe1* this, PlayState* play) {
if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->actionFunc = EnGe1_BeginGiveItem_Archery;
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
Actor_OfferTalk(&this->actor, play, 200.0f);
}
@ -567,7 +567,7 @@ void EnGe1_BeginGame_Archery(EnGe1* this, PlayState* play) {
Actor* horse;
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_CHOICE) && Message_ShouldAdvance(play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
switch (play->msgCtx.choiceIndex) {
case 0:
@ -627,7 +627,7 @@ void EnGe1_TalkAfterGame_Archery(EnGe1* this, PlayState* play) {
// With the current `SaveContext` struct definition, the expression in the debug string is an out-of-bounds read,
// see the other occurrence of this for more details.
LOG_NUM("z_common_data.memory.information.room_inf[127][ 0 ]", HIGH_SCORE(HS_HBA), "../z_en_ge1.c", 1111);
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
if (HIGH_SCORE(HS_HBA) < gSaveContext.minigameScore) {
HIGH_SCORE(HS_HBA) = gSaveContext.minigameScore;

View file

@ -438,7 +438,7 @@ void EnGe2_SetActionAfterTalk(EnGe2* this, PlayState* play) {
break;
}
this->actor.update = EnGe2_UpdateFriendly;
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
EnGe2_TurnToFacePlayer(this, play);
}
@ -459,7 +459,7 @@ void EnGe2_WaitTillCardGiven(EnGe2* this, PlayState* play) {
void EnGe2_GiveCard(EnGe2* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnGe2_WaitTillCardGiven;
Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f);
}
@ -471,7 +471,7 @@ void EnGe2_ForceTalk(EnGe2* this, PlayState* play) {
this->actionFunc = EnGe2_GiveCard;
} else {
this->actor.textId = 0x6004;
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalkExchange(&this->actor, play, 300.0f, 300.0f, EXCH_ITEM_NONE);
}
EnGe2_LookAtPlayer(this, play);

View file

@ -128,7 +128,7 @@ void EnGe3_Wait(EnGe3* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actionFunc = EnGe3_WaitLookAtPlayer;
this->actor.update = EnGe3_UpdateWhenNotTalking;
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
EnGe3_TurnToFacePlayer(this, play);
}
@ -149,7 +149,7 @@ void EnGe3_WaitTillCardGiven(EnGe3* this, PlayState* play) {
void EnGe3_GiveCard(EnGe3* this, PlayState* play) {
if ((Message_GetState(&play->msgCtx) == TEXT_STATE_EVENT) && Message_ShouldAdvance(play)) {
Message_CloseTextbox(play);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnGe3_WaitTillCardGiven;
Actor_OfferGetItem(&this->actor, play, GI_GERUDOS_CARD, 10000.0f, 50.0f);
}
@ -164,7 +164,7 @@ void EnGe3_ForceTalk(EnGe3* this, PlayState* play) {
this->unk_30C |= 4;
}
this->actor.textId = 0x6004;
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalkExchange(&this->actor, play, 300.0f, 300.0f, EXCH_ITEM_NONE);
}
EnGe3_LookAtPlayer(this, play);

View file

@ -640,7 +640,7 @@ void func_80A544AC(EnHeishi2* this, PlayState* play) {
this->actor.world.rot.z = this->actor.shape.rot.z;
if (this->actor.shape.rot.z < -6000) {
Message_StartTextbox(play, 0x708F, NULL);
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = func_80A5455C;
this->unk_2E4 = 0.0f;
}

View file

@ -324,9 +324,9 @@ void EnHintnuts_BeginFreeze(EnHintnuts* this, PlayState* play) {
void EnHintnuts_CheckProximity(EnHintnuts* this, PlayState* play) {
if (this->actor.category != ACTORCAT_ENEMY) {
if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isLockedOn) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
if (this->actor.xzDistToPlayer < 130.0f) {
this->actor.textId = this->textIdCopy;
@ -377,7 +377,8 @@ void EnHintnuts_Run(EnHintnuts* this, PlayState* play) {
fabsf(this->actor.world.pos.y - this->actor.home.pos.y) < 2.0f) {
this->actor.speed = 0.0f;
if (this->actor.category == ACTORCAT_BG) {
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_16);
this->actor.flags &=
~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED);
this->actor.flags |= ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE;
Actor_ChangeCategory(play, &play->actorCtx, &this->actor, ACTORCAT_ENEMY);
}

View file

@ -699,10 +699,10 @@ void func_80A7A568(EnIn* this, PlayState* play) {
void func_80A7A770(EnIn* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
Rupees_ChangeBy(-50);
this->actor.flags &= ~ACTOR_FLAG_16;
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);
@ -737,7 +737,7 @@ void func_80A7A848(EnIn* this, PlayState* play) {
void func_80A7A940(EnIn* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
return;
}
if (this->unk_1EC != 0) {
@ -747,7 +747,7 @@ void func_80A7A940(EnIn* this, PlayState* play) {
}
}
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
this->actor.flags &= ~ACTOR_FLAG_16;
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);

View file

@ -103,7 +103,7 @@ void func_80A89008(EnJs* this) {
void func_80A89078(EnJs* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
func_80A89008(this);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
}
@ -119,7 +119,7 @@ void func_80A8910C(EnJs* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actor.textId = 0x6078;
En_Js_SetupAction(this, func_80A890C0);
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
}

View file

@ -348,7 +348,7 @@ void EnMa1_IdleTeachSong(EnMa1* this, PlayState* play) {
this->actor.textId = 0x2061;
Message_StartTextbox(play, this->actor.textId, NULL);
this->interactInfo.talkState = NPC_TALK_STATE_TALKING;
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnMa1_StartTeachSong;
} else if (this->actor.xzDistToPlayer < 30.0f + this->collider.dim.radius) {
player->stateFlags2 |= PLAYER_STATE2_23;
@ -361,7 +361,7 @@ void EnMa1_StartTeachSong(EnMa1* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_MALON);
Message_StartOcarina(play, OCARINA_ACTION_TEACH_EPONA);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnMa1_TeachSong;
}
}

View file

@ -255,7 +255,7 @@ void EnMa2_Destroy(Actor* thisx, PlayState* play) {
void func_80AA2018(EnMa2* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
}
}
@ -298,10 +298,10 @@ void func_80AA21C8(EnMa2* this, PlayState* play) {
player->stateFlags2 |= PLAYER_STATE2_23;
} else {
if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Message_CloseTextbox(play);
} else {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = func_80AA2018;
}
}

View file

@ -78,7 +78,7 @@ u16 EnMa3_GetTextId(PlayState* play, Actor* thisx) {
if (GET_EVENTINF(EVENTINF_HORSES_0A)) {
gSaveContext.timerSeconds = gSaveContext.timerSeconds;
thisx->flags |= ACTOR_FLAG_16;
thisx->flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
if (((void)0, gSaveContext.timerSeconds) > 210) {
return 0x208E;
@ -156,7 +156,7 @@ s16 EnMa3_UpdateTalkState(PlayState* play, Actor* thisx) {
FALLTHROUGH;
case 0x208E:
CLEAR_EVENTINF(EVENTINF_HORSES_0A);
thisx->flags &= ~ACTOR_FLAG_16;
thisx->flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
talkState = NPC_TALK_STATE_IDLE;
gSaveContext.timerState = TIMER_STATE_STOP;
break;
@ -283,7 +283,7 @@ void EnMa3_Destroy(Actor* thisx, PlayState* play) {
void func_80AA3200(EnMa3* this, PlayState* play) {
if (this->interactInfo.talkState == NPC_TALK_STATE_ACTION) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->interactInfo.talkState = NPC_TALK_STATE_IDLE;
}
}

View file

@ -81,7 +81,7 @@ void EnMk_Destroy(Actor* thisx, PlayState* play) {
void func_80AACA40(EnMk* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnMk_Wait;
}

View file

@ -276,7 +276,7 @@ s32 EnOwl_CheckInitTalk(EnOwl* this, PlayState* play, u16 textId, f32 targetDist
this->actor.textId = textId;
distCheck = (flags & 2) ? 200.0f : 1000.0f;
if (this->actor.xzDistToPlayer < targetDist) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalkExchange(&this->actor, play, targetDist, distCheck, EXCH_ITEM_NONE);
}
return false;
@ -342,7 +342,7 @@ void func_80ACA76C(EnOwl* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
func_80ACA62C(this, play);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
}
@ -358,7 +358,7 @@ void func_80ACA7E0(EnOwl* this, PlayState* play) {
func_80ACA71C(this);
this->actionFunc = func_80ACA690;
}
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
}
@ -552,7 +552,7 @@ void func_80ACB03C(EnOwl* this, PlayState* play) {
if (Actor_TextboxIsClosing(&this->actor, play)) {
SEQCMD_STOP_SEQUENCE(SEQ_PLAYER_FANFARE, 0);
func_80ACA62C(this, play);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
}
}

View file

@ -195,7 +195,7 @@ void EnPoField_SetupWaitForSpawn(EnPoField* this, PlayState* play) {
Lights_PointSetColorAndRadius(&this->lightInfo, 0, 0, 0, 0);
this->actionTimer = 200;
Actor_SetScale(&this->actor, 0.0f);
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_16);
this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED);
this->collider.base.acFlags &= ~AC_ON;
this->collider.base.ocFlags1 = OC1_ON | OC1_TYPE_ALL;
this->actor.colChkInfo.health = D_80AD70D8.health;
@ -655,15 +655,15 @@ void func_80AD58D4(EnPoField* this, PlayState* play) {
}
if (this->actionTimer == 0) {
Actor_PlaySfx(&this->actor, NA_SE_EN_PO_LAUGH);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
EnPoField_SetupSoulDisappear(this);
return;
}
if (this->collider.base.ocFlags1 & OC1_HIT) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play);
} else {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
}
this->actor.world.pos.y = Math_SinS(this->unk_194 * 0x800) * 5.0f + this->actor.home.pos.y;

View file

@ -8,8 +8,9 @@
#include "overlays/actors/ovl_En_Honotrap/z_en_honotrap.h"
#include "assets/objects/object_tk/object_tk.h"
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | ACTOR_FLAG_16)
#define FLAGS \
(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_4 | ACTOR_FLAG_IGNORE_QUAKE | \
ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED)
void EnPoRelay_Init(Actor* thisx, PlayState* play);
void EnPoRelay_Destroy(Actor* thisx, PlayState* play);
@ -161,10 +162,10 @@ void EnPoRelay_CorrectY(EnPoRelay* this) {
void EnPoRelay_Idle(EnPoRelay* this, PlayState* play) {
Math_ScaledStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 0x100);
if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actionFunc = EnPoRelay_Talk;
} else if (this->actor.xzDistToPlayer < 250.0f) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
this->actor.textId = this->textId;
Actor_OfferTalk(&this->actor, play, 250.0f);
}

View file

@ -773,14 +773,14 @@ void func_80ADFE80(EnPoh* this, PlayState* play) {
}
if (this->unk_198 == 0) {
func_80ADE950(this, 1);
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
return;
}
if (this->colliderCyl.base.ocFlags1 & OC1_HIT) {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalkNearColChkInfoCylinder(&this->actor, play);
} else {
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCyl.base);
}
this->actor.world.pos.y = Math_SinS(this->unk_195 * 0x800) * 5.0f + this->actor.home.pos.y;

View file

@ -668,7 +668,7 @@ void EnTa_IdleFoundSuperCucco(EnTa* this, PlayState* play) {
if (Actor_TalkOfferAccepted(&this->actor, play)) {
this->actionFunc = EnTa_TalkFoundSuperCucco;
// Unset auto-talking
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
Actor_OfferTalk(&this->actor, play, 1000.0f);
}
@ -784,7 +784,7 @@ void EnTa_RunCuccoGame(EnTa* this, PlayState* play) {
this->actionFunc = EnTa_IdleFoundSuperCucco;
// Automatically talk to player
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalk(&this->actor, play, 1000.0f);
return;
}
@ -1130,9 +1130,9 @@ void EnTa_IdleAfterCuccoGameFinished(EnTa* this, PlayState* play) {
this->actionFunc = EnTa_TalkAfterCuccoGameWon;
break;
}
this->actor.flags &= ~ACTOR_FLAG_16;
this->actor.flags &= ~ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
} else {
this->actor.flags |= ACTOR_FLAG_16;
this->actor.flags |= ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED;
Actor_OfferTalk(&this->actor, play, 1000.0f);
}
this->stateFlags |= TALON_STATE_FLAG_TRACKING_PLAYER;

View file

@ -5996,8 +5996,9 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) {
s32 canTalkToLockOnWithCUp;
canTalkToLockOnWithCUp =
(lockOnActor != NULL) && (CHECK_FLAG_ALL(lockOnActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_18) ||
(lockOnActor->naviEnemyId != NAVI_ENEMY_NONE));
(lockOnActor != NULL) &&
(CHECK_FLAG_ALL(lockOnActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) ||
(lockOnActor->naviEnemyId != NAVI_ENEMY_NONE));
if (canTalkToLockOnWithCUp || (this->naviTextId != 0)) {
// If `naviTextId` is negative and outside the 0x2XX range, talk to Navi instantly
@ -6027,7 +6028,7 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) {
if (this->stateFlags1 & PLAYER_STATE1_CARRYING_ACTOR) {
if ((this->heldActor == NULL) ||
(!forceTalkToNavi && (talkOfferActor != this->heldActor) && (cUpTalkActor != this->heldActor) &&
((talkOfferActor == NULL) || !(talkOfferActor->flags & ACTOR_FLAG_16)))) {
((talkOfferActor == NULL) || !(talkOfferActor->flags & ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED)))) {
goto dont_talk;
}
}
@ -6044,7 +6045,9 @@ s32 Player_ActionHandler_Talk(Player* this, PlayState* play) {
// "Speak" or "Check" will appear on the A button in the HUD.
this->stateFlags2 |= PLAYER_STATE2_CAN_ACCEPT_TALK_OFFER;
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) || (talkOfferActor->flags & ACTOR_FLAG_16)) {
if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) ||
(talkOfferActor->flags & ACTOR_FLAG_TALK_OFFER_AUTO_ACCEPTED)) {
// Talk Offer has been accepted.
// Clearing `cUpTalkActor` guarantees that `talkOfferActor` is the actor that will be spoken to
cUpTalkActor = NULL;
} else if (cUpTalkActor == NULL) {
@ -6109,7 +6112,7 @@ s32 Player_ActionHandler_0(Player* this, PlayState* play) {
}
if ((this->focusActor != NULL) &&
(CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_18) ||
(CHECK_FLAG_ALL(this->focusActor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP) ||
(this->focusActor->naviEnemyId != NAVI_ENEMY_NONE))) {
this->stateFlags2 |= PLAYER_STATE2_21;
} else if ((this->naviTextId == 0) && !Player_CheckHostileLockOn(this) &&
@ -15805,7 +15808,7 @@ void func_80853148(PlayState* play, Actor* actor) {
s32 pad;
if ((this->talkActor != NULL) || (actor == this->naviActor) ||
CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_18)) {
CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_TALK_WITH_C_UP)) {
actor->flags |= ACTOR_FLAG_TALK;
}