diff --git a/include/functions.h b/include/functions.h index 51d8fc9676..5810b3edb8 100644 --- a/include/functions.h +++ b/include/functions.h @@ -447,8 +447,8 @@ Actor* Actor_GetProjectileActor(PlayState* play, Actor* refActor, f32 radius); void Actor_ChangeCategory(PlayState* play, ActorContext* actorCtx, Actor* actor, u8 actorCategory); void Actor_SetTextWithPrefix(PlayState* play, Actor* actor, s16 baseTextId); s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 angle); -s32 Actor_IsTargeted(PlayState* play, Actor* actor); -s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor); +s32 Actor_IsLockedOn(PlayState* play, Actor* actor); +s32 Actor_OtherIsLockedOn(PlayState* play, Actor* actor); f32 func_80033AEC(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5); void func_80033C30(Vec3f* arg0, Vec3f* arg1, u8 alpha, PlayState* play); void Actor_RequestQuake(PlayState* play, s16 y, s16 duration); diff --git a/include/z64actor.h b/include/z64actor.h index a04a3f53a4..df91a14d4b 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -287,7 +287,7 @@ typedef struct Actor { /* 0x0F8 */ f32 uncullZoneScale; // Amount to increase the uncull zone scale by (in projected space) /* 0x0FC */ f32 uncullZoneDownward; // Amount to increase uncull zone downward by (in projected space) /* 0x100 */ Vec3f prevPos; // World position from the previous update cycle - /* 0x10C */ u8 isTargeted; // Set to true if the actor is currently being targeted by the player + /* 0x10C */ u8 isLockedOn; // Set to true if the actor is currently locked-on by Player /* 0x10D */ u8 targetPriority; // Lower values have higher priority. Resets to 0 when player stops targeting /* 0x10E */ u16 textId; // Text ID to pass to player/display when interacting with the actor /* 0x110 */ u16 freezeTimer; // Actor does not update when set. Timer decrements automatically diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 599500770b..00855214a8 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1680,7 +1680,7 @@ s32 Actor_OfferTalkExchange(Actor* actor, PlayState* play, f32 xzRange, f32 yRan Player* player = GET_PLAYER(play); if ((player->actor.flags & ACTOR_FLAG_TALK) || ((exchangeItemId != EXCH_ITEM_NONE) && Player_InCsMode(play)) || - (!actor->isTargeted && + (!actor->isLockedOn && ((yRange < fabsf(actor->yDistToPlayer)) || (player->talkActorDistance < actor->xzDistToPlayer) || (xzRange < actor->xzDistToPlayer)))) { return false; @@ -2334,9 +2334,9 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { if ((DECR(actor->freezeTimer) == 0) && (actor->flags & (ACTOR_FLAG_4 | ACTOR_FLAG_6))) { if (actor == player->focusActor) { - actor->isTargeted = true; + actor->isLockedOn = true; } else { - actor->isTargeted = false; + actor->isLockedOn = false; } if ((actor->targetPriority != 0) && (player->focusActor == NULL)) { @@ -3745,12 +3745,12 @@ s16 Actor_TestFloorInDirection(Actor* actor, PlayState* play, f32 distance, s16 } /** - * Returns true if the player is targeting the provided actor + * Returns true if the player is locked onto the specified actor */ -s32 Actor_IsTargeted(PlayState* play, Actor* actor) { +s32 Actor_IsLockedOn(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_4) && actor->isTargeted) { + if ((player->stateFlags1 & PLAYER_STATE1_4) && actor->isLockedOn) { return true; } else { return false; @@ -3758,12 +3758,12 @@ s32 Actor_IsTargeted(PlayState* play, Actor* actor) { } /** - * Returns true if the player is targeting an actor other than the provided actor + * Returns true if the player is locked onto an actor other than the specified actor */ -s32 Actor_OtherIsTargeted(PlayState* play, Actor* actor) { +s32 Actor_OtherIsLockedOn(PlayState* play, Actor* actor) { Player* player = GET_PLAYER(play); - if ((player->stateFlags1 & PLAYER_STATE1_4) && !actor->isTargeted) { + if ((player->stateFlags1 & PLAYER_STATE1_4) && !actor->isLockedOn) { return true; } else { return false; @@ -5904,7 +5904,7 @@ s32 func_80037D98(PlayState* play, Actor* actor, s16 arg2, s32* arg3) { return false; } - if ((actor->xyzDistToPlayerSq > SQ(160.0f)) && !actor->isTargeted) { + if ((actor->xyzDistToPlayerSq > SQ(160.0f)) && !actor->isLockedOn) { return false; } diff --git a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c index e6a4f1cae2..5a31476cb1 100644 --- a/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c +++ b/src/overlays/actors/ovl_Bg_Treemouth/z_bg_treemouth.c @@ -143,7 +143,7 @@ void func_808BC8B8(BgTreemouth* this, PlayState* play) { if (Flags_GetEventChkInf(EVENTCHKINF_0C)) { if (Actor_IsFacingAndNearPlayer(&this->dyna.actor, 1658.0f, 0x7530)) { this->dyna.actor.flags |= ACTOR_FLAG_0; - if (this->dyna.actor.isTargeted) { + if (this->dyna.actor.isLockedOn) { this->dyna.actor.flags &= ~ACTOR_FLAG_0; play->csCtx.script = D_808BD2A0; gSaveContext.cutsceneTrigger = 1; diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index 853437b44f..5c33397cdd 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -346,7 +346,7 @@ void EnDns_Idle(EnDns* this, PlayState* play) { if (Actor_TalkOfferAccepted(&this->actor, play)) { this->actionFunc = EnDns_Talk; } else { - if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isTargeted) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isLockedOn) { this->actor.flags |= ACTOR_FLAG_16; } else { this->actor.flags &= ~ACTOR_FLAG_16; diff --git a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c index 469f88b78e..aec28ecaa6 100644 --- a/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c +++ b/src/overlays/actors/ovl_En_GeldB/z_en_geldb.c @@ -334,7 +334,7 @@ s32 EnGeldB_ReactToPlayer(PlayState* play, EnGeldB* this, s16 arg2) { } else { s16 angleToFacingLink = player->actor.shape.rot.y - thisx->shape.rot.y; - if ((thisx->xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, thisx) && + if ((thisx->xzDistToPlayer <= 45.0f) && !Actor_OtherIsLockedOn(play, thisx) && ((play->gameplayFrames & 7) || (ABS(angleToFacingLink) < 0x38E0))) { EnGeldB_SetupSlash(this); return true; @@ -456,7 +456,7 @@ void EnGeldB_Ready(EnGeldB* this, PlayState* play) { if (Actor_IsFacingPlayer(&this->actor, 30 * 0x10000 / 360)) { if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && (Rand_ZeroOne() < 0.3f)) { - if (Actor_OtherIsTargeted(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || + if (Actor_OtherIsLockedOn(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleToLink) < 0x38E0)) { EnGeldB_SetupRollForward(this); } else { @@ -525,10 +525,10 @@ void EnGeldB_Advance(EnGeldB* this, PlayState* play) { EnGeldB_SetupReady(this); } } else if (this->actor.xzDistToPlayer < 90.0f) { - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.03f || (this->actor.xzDistToPlayer <= 45.0f && facingAngletoLink < 0x38E0))) { EnGeldB_SetupSlash(this); - } else if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + } else if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnGeldB_SetupRollBack(this); } else { EnGeldB_SetupCircle(this); @@ -537,7 +537,7 @@ void EnGeldB_Advance(EnGeldB* this, PlayState* play) { if (!EnGeldB_ReactToPlayer(play, this, 0)) { if ((this->actor.xzDistToPlayer < 210.0f) && (this->actor.xzDistToPlayer > 150.0f) && Actor_IsFacingPlayer(&this->actor, 0x71C)) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { if (Rand_ZeroOne() > 0.5f) { EnGeldB_SetupRollForward(this); } else { @@ -588,7 +588,7 @@ void EnGeldB_RollForward(EnGeldB* this, PlayState* play) { if (ABS(facingAngleToLink) < 0x38E0) { this->lookTimer = 20; } - } else if (!Actor_OtherIsTargeted(play, &this->actor) && + } else if (!Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f || (ABS(facingAngleToLink) < 0x3FFC))) { EnGeldB_SetupSlash(this); } else { @@ -728,10 +728,10 @@ void EnGeldB_Circle(EnGeldB* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_GERUDOFT_BREATH); } if ((Math_CosS(angleBehindLink - this->actor.shape.rot.y) < -0.85f) && - !Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) { + !Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer <= 45.0f)) { EnGeldB_SetupSlash(this); } else if (--this->timer == 0) { - if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnGeldB_SetupRollBack(this); } else { EnGeldB_SetupReady(this); @@ -827,7 +827,7 @@ void EnGeldB_SpinDodge(EnGeldB* this, PlayState* play) { if (this->timer == 0) { this->actor.shape.rot.y = this->actor.yawTowardsPlayer; if (!EnGeldB_DodgeRanged(play, this)) { - if (!Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) { + if (!Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer <= 70.0f)) { EnGeldB_SetupSlash(this); } else { EnGeldB_SetupRollBack(this); @@ -994,7 +994,7 @@ void EnGeldB_SetupRollBack(EnGeldB* this) { void EnGeldB_RollBack(EnGeldB* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { - if (!Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { EnGeldB_SetupSpinAttack(this); } else if (play->gameplayFrames & 1) { @@ -1077,7 +1077,7 @@ void EnGeldB_Damaged(EnGeldB* this, PlayState* play) { (this->actor.xzDistToPlayer < 90.0f)) { EnGeldB_SetupJump(this); } else if (!EnGeldB_DodgeRanged(play, this)) { - if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (play->gameplayFrames & 7)) { EnGeldB_SetupSlash(this); } else { @@ -1114,7 +1114,7 @@ void EnGeldB_Jump(EnGeldB* this, PlayState* play) { this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; - if (!Actor_OtherIsTargeted(play, &this->actor)) { + if (!Actor_OtherIsLockedOn(play, &this->actor)) { EnGeldB_SetupSlash(this); } else { EnGeldB_SetupReady(this); @@ -1160,7 +1160,7 @@ void EnGeldB_Block(EnGeldB* this, PlayState* play) { } } else { angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && ((play->gameplayFrames & 1) || (ABS(angleFacingLink) < 0x38E0))) { EnGeldB_SetupSlash(this); } else { @@ -1291,12 +1291,12 @@ void EnGeldB_Sidestep(EnGeldB* this, PlayState* play) { s16 angleFacingPlayer2 = player2->actor.shape.rot.y - this->actor.shape.rot.y; this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 45.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (!(play->gameplayFrames & 3) || (ABS(angleFacingPlayer2) < 0x38E0))) { EnGeldB_SetupSlash(this); } else if ((210.0f > this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 150.0f) && !(play->gameplayFrames & 1)) { - if (Actor_OtherIsTargeted(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || + if (Actor_OtherIsLockedOn(play, &this->actor) || (Rand_ZeroOne() > 0.5f) || (ABS(angleFacingPlayer2) < 0x38E0)) { EnGeldB_SetupRollForward(this); } else { diff --git a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c index fec4d5e61a..c86721e661 100644 --- a/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c +++ b/src/overlays/actors/ovl_En_Hintnuts/z_en_hintnuts.c @@ -323,7 +323,7 @@ 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.isTargeted) { + if ((this->collider.base.ocFlags1 & OC1_HIT) || this->actor.isLockedOn) { this->actor.flags |= ACTOR_FLAG_16; } else { this->actor.flags &= ~ACTOR_FLAG_16; diff --git a/src/overlays/actors/ovl_En_Ko/z_en_ko.c b/src/overlays/actors/ovl_En_Ko/z_en_ko.c index 3a0fa5ced7..9bf438673b 100644 --- a/src/overlays/actors/ovl_En_Ko/z_en_ko.c +++ b/src/overlays/actors/ovl_En_Ko/z_en_ko.c @@ -1250,7 +1250,7 @@ void func_80A995CC(EnKo* this, PlayState* play) { this->actor.world.pos.z += 80.0f * Math_CosS(homeYawToPlayer); this->actor.shape.rot.y = this->actor.world.rot.y = this->actor.yawTowardsPlayer; - if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE || !this->actor.isTargeted) { + if (this->interactInfo.talkState == NPC_TALK_STATE_IDLE || !this->actor.isLockedOn) { temp_f2 = fabsf((f32)this->actor.yawTowardsPlayer - homeYawToPlayer) * 0.001f * 3.0f; if (temp_f2 < 1.0f) { this->skelAnime.playSpeed = 1.0f; diff --git a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c index 735f07fe70..605dca232f 100644 --- a/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c +++ b/src/overlays/actors/ovl_En_Po_Sisters/z_en_po_sisters.c @@ -1108,7 +1108,7 @@ void func_80ADBF58(EnPoSisters* this, PlayState* play) { } void func_80ADC034(EnPoSisters* this, PlayState* play) { - if (this->actor.isTargeted && this->unk_22E.a == 255) { + if (this->actor.isLockedOn && this->unk_22E.a == 255) { if (this->unk_197 != 0) { this->unk_197--; } diff --git a/src/overlays/actors/ovl_En_Poh/z_en_poh.c b/src/overlays/actors/ovl_En_Poh/z_en_poh.c index a95fb1fe36..f6c1231a84 100644 --- a/src/overlays/actors/ovl_En_Poh/z_en_poh.c +++ b/src/overlays/actors/ovl_En_Poh/z_en_poh.c @@ -883,7 +883,7 @@ void EnPoh_UpdateVisibility(EnPoh* this) { this->visibilityTimer--; } if (this->lightColor.a == 255) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { this->unk_194++; this->unk_194 = CLAMP_MAX(this->unk_194, 20); } else { diff --git a/src/overlays/actors/ovl_En_Test/z_en_test.c b/src/overlays/actors/ovl_En_Test/z_en_test.c index 4ade2d19fb..15ca70b247 100644 --- a/src/overlays/actors/ovl_En_Test/z_en_test.c +++ b/src/overlays/actors/ovl_En_Test/z_en_test.c @@ -335,7 +335,7 @@ void EnTest_ChooseRandomAction(EnTest* this, PlayState* play) { case 5: case 6: if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 170.0f) && - Actor_IsFacingPlayer(&this->actor, 0x71C) && Actor_IsTargeted(play, &this->actor)) { + Actor_IsFacingPlayer(&this->actor, 0x71C) && Actor_IsLockedOn(play, &this->actor)) { EnTest_SetupJumpslash(this); break; } @@ -395,7 +395,7 @@ void EnTest_ChooseAction(EnTest* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnTest_SetupJumpBack(this); } else if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 170.0f)) { - if (Actor_IsFacingPlayer(&this->actor, 0x71C) && !Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsFacingPlayer(&this->actor, 0x71C) && !Actor_IsLockedOn(play, &this->actor)) { EnTest_SetupJumpslash(this); } } else { @@ -405,7 +405,7 @@ void EnTest_ChooseAction(EnTest* this, PlayState* play) { if (this->actor.xzDistToPlayer < 110.0f) { if (Rand_ZeroOne() > 0.2f) { if (player->stateFlags1 & PLAYER_STATE1_4) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { EnTest_SetupSlashDown(this); } else { func_808627C4(this, play); @@ -512,7 +512,7 @@ void EnTest_Idle(EnTest* this, PlayState* play) { if (Actor_IsFacingPlayer(&this->actor, 0x1555)) { if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 160.0f) && (Rand_ZeroOne() < 0.3f)) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { EnTest_SetupJumpslash(this); } else { func_808627C4(this, play); @@ -578,7 +578,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if (!EnTest_ReactToProjectile(play, this)) { this->timer++; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { checkDist = 150.0f; } @@ -659,13 +659,13 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 220.0f) && (this->actor.xzDistToPlayer > 160.0f) && (Actor_IsFacingPlayer(&this->actor, 0x71C))) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { if (Rand_ZeroOne() < 0.1f) { EnTest_SetupJumpslash(this); return; } } else if (player->heldItemAction != PLAYER_IA_NONE) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { if ((play->gameplayFrames % 2) != 0) { func_808627C4(this, play); return; @@ -691,7 +691,7 @@ void EnTest_WalkAndBlock(EnTest* this, PlayState* play) { if (this->actor.xzDistToPlayer < 110.0f) { if (Rand_ZeroOne() > 0.2f) { if (player->stateFlags1 & PLAYER_STATE1_4) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { EnTest_SetupSlashDown(this); } else { func_808627C4(this, play); @@ -845,7 +845,7 @@ void func_80860F84(EnTest* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { checkDist = 200.0f; } @@ -976,7 +976,7 @@ void EnTest_SlashDownEnd(EnTest* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; EnTest_SetupJumpBack(this); } else if (player->stateFlags1 & PLAYER_STATE1_4) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { EnTest_SetupSlashDown(this); } else if ((play->gameplayFrames % 2) != 0) { func_808627C4(this, play); @@ -1345,7 +1345,7 @@ void EnTest_Stunned(EnTest* this, PlayState* play) { // a variation of sidestep void func_808627C4(EnTest* this, PlayState* play) { - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { func_80860EC0(this); return; } @@ -1421,7 +1421,7 @@ void func_808628C8(EnTest* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y + 0x3FFF; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { checkDist = 200.0f; } @@ -1457,9 +1457,9 @@ void func_808628C8(EnTest* this, PlayState* play) { } if (this->timer == 0) { - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { EnTest_SetupIdle(this); - } else if (Actor_IsTargeted(play, &this->actor)) { + } else if (Actor_IsLockedOn(play, &this->actor)) { if (!EnTest_ReactToProjectile(play, this)) { EnTest_ChooseAction(this, play); } @@ -2007,7 +2007,7 @@ s32 EnTest_ReactToProjectile(PlayState* play, EnTest* this) { } if (Math_Vec3f_DistXYZ(&this->actor.world.pos, &projectileActor->world.pos) < 200.0f) { - if (Actor_IsTargeted(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { + if (Actor_IsLockedOn(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { EnTest_SetupJumpUp(this); } else if (ABS(yawToProjectile) < 0x2000) { EnTest_SetupStopAndBlock(this); @@ -2020,7 +2020,7 @@ s32 EnTest_ReactToProjectile(PlayState* play, EnTest* this) { return true; } - if (Actor_IsTargeted(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { + if (Actor_IsLockedOn(play, &this->actor) && (projectileActor->id == ACTOR_ARMS_HOOK)) { EnTest_SetupJumpUp(this); return true; } diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 3b285868c3..5153837a76 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -218,7 +218,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { this->skelAnime.playSpeed = 0.0f; this->actor.world.pos.x = (Math_SinS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.x; this->actor.world.pos.z = (Math_CosS(this->actor.world.rot.y) * 25.0f) + sSpawnPoint.z; - if ((this->actor.xzDistToPlayer <= 120.0f) || Actor_IsTargeted(play, &this->actor) || + if ((this->actor.xzDistToPlayer <= 120.0f) || Actor_IsLockedOn(play, &this->actor) || (attackItem != NULL)) { if (attackItem != NULL) { sDodgeRollState = 1; @@ -355,7 +355,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { if ((this->meleeWeaponState == 0) && (sCounterState == 0) && (player->invincibilityTimer == 0) && (player->meleeWeaponAnimation == PLAYER_MWA_STAB_1H) && - (this->actor.xzDistToPlayer <= 85.0f) && Actor_IsTargeted(play, &this->actor)) { + (this->actor.xzDistToPlayer <= 85.0f) && Actor_IsLockedOn(play, &this->actor)) { sStickTilt = 0.0f; sSwordJumpState = 1; @@ -407,7 +407,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { sStickAngle = thisx->yawTowardsPlayer; if ((90.0f >= this->actor.xzDistToPlayer) && (this->actor.xzDistToPlayer > 70.0f) && (ABS(sp5A) >= 0x7800) && - (this->actor.isTargeted || !(player->stateFlags1 & PLAYER_STATE1_22))) { + (this->actor.isLockedOn || !(player->stateFlags1 & PLAYER_STATE1_22))) { EnTorch2_SwingSword(play, input, this); } else { f32 sp50 = 0.0f; @@ -422,7 +422,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } else if (this->actor.xzDistToPlayer <= 50 + sp50) { sStickTilt = 127.0f; sStickAngle = this->actor.yawTowardsPlayer; - if (!this->actor.isTargeted) { + if (!this->actor.isLockedOn) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } else if (this->actor.xzDistToPlayer > 100.0f + sp50) { @@ -432,7 +432,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { (this->actor.xzDistToPlayer >= 280.0f)) { sStickTilt = 127.0f; sStickAngle = this->actor.yawTowardsPlayer; - if (!this->actor.isTargeted) { + if (!this->actor.isLockedOn) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } @@ -443,7 +443,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { !EnTorch2_SwingSword(play, input, this)) { sStickAngle = this->actor.yawTowardsPlayer; sStickTilt = 127.0f; - if (!this->actor.isTargeted) { + if (!this->actor.isLockedOn) { Math_SmoothStepToS(&sStickAngle, player->actor.shape.rot.y + 0x7FFF, 1, 0x2328, 0); } } diff --git a/src/overlays/actors/ovl_En_Wf/z_en_wf.c b/src/overlays/actors/ovl_En_Wf/z_en_wf.c index ef24ceba45..acd0730c48 100644 --- a/src/overlays/actors/ovl_En_Wf/z_en_wf.c +++ b/src/overlays/actors/ovl_En_Wf/z_en_wf.c @@ -354,7 +354,7 @@ s32 EnWf_ChangeAction(PlayState* play, EnWf* this, s16 mustChoose) { playerFacingAngleDiff = player->actor.shape.rot.y - this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (((play->gameplayFrames % 8) != 0) || (ABS(playerFacingAngleDiff) < 0x38E0))) { EnWf_SetupSlash(this); return true; @@ -502,7 +502,7 @@ void EnWf_RunAtPlayer(EnWf* this, PlayState* play) { Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 0x2EE, 0); this->actor.world.rot.y = this->actor.shape.rot.y; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 150.0f; } @@ -542,10 +542,10 @@ void EnWf_RunAtPlayer(EnWf* this, PlayState* play) { } else if (this->actor.xzDistToPlayer < (90.0f + baseRange)) { s16 temp_v1 = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && ((Rand_ZeroOne() > 0.03f) || ((this->actor.xzDistToPlayer <= 80.0f) && (ABS(temp_v1) < 0x38E0)))) { EnWf_SetupSlash(this); - } else if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + } else if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnWf_SetupBackflipAway(this); } else { EnWf_SetupRunAroundPlayer(this); @@ -658,7 +658,7 @@ void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 150.0f; } @@ -696,14 +696,14 @@ void EnWf_RunAroundPlayer(EnWf* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_WOLFOS_CRY); } - if ((Math_CosS(angle1 - this->actor.shape.rot.y) < -0.85f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((Math_CosS(angle1 - this->actor.shape.rot.y) < -0.85f) && !Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer <= 80.0f)) { EnWf_SetupSlash(this); } else { this->actionTimer--; if (this->actionTimer == 0) { - if (Actor_OtherIsTargeted(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { + if (Actor_OtherIsLockedOn(play, &this->actor) && (Rand_ZeroOne() > 0.5f)) { EnWf_SetupBackflipAway(this); } else { EnWf_SetupWait(this); @@ -747,7 +747,7 @@ void EnWf_Slash(EnWf* this, PlayState* play) { this->slashStatus = 0; } - if (((curFrame == 15) && !Actor_IsTargeted(play, &this->actor) && + if (((curFrame == 15) && !Actor_IsLockedOn(play, &this->actor) && (!Actor_IsFacingPlayer(&this->actor, 0x2000) || (this->actor.xzDistToPlayer >= 100.0f))) || SkelAnime_Update(&this->skelAnime)) { if ((curFrame != 15) && (this->actionTimer != 0)) { @@ -850,7 +850,7 @@ void EnWf_SetupBackflipAway(EnWf* this) { void EnWf_BackflipAway(EnWf* this, PlayState* play) { if (SkelAnime_Update(&this->skelAnime)) { - if (!Actor_OtherIsTargeted(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (this->actor.xzDistToPlayer < 170.0f) && (this->actor.xzDistToPlayer > 140.0f) && (Rand_ZeroOne() < 0.2f)) { EnWf_SetupRunAtPlayer(this, play); } else if ((play->gameplayFrames % 2) != 0) { @@ -940,7 +940,7 @@ void EnWf_Damaged(EnWf* this, PlayState* play) { (this->actor.xzDistToPlayer < 120.0f)) { EnWf_SetupSomersaultAndAttack(this); } else if (!EnWf_DodgeRanged(play, this)) { - if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && ((play->gameplayFrames % 8) != 0)) { EnWf_SetupSlash(this); } else if (Rand_ZeroOne() > 0.5f) { @@ -985,7 +985,7 @@ void EnWf_SomersaultAndAttack(EnWf* this, PlayState* play) { this->actor.speed = this->actor.velocity.y = 0.0f; this->actor.world.pos.y = this->actor.floorHeight; - if (!Actor_OtherIsTargeted(play, &this->actor)) { + if (!Actor_OtherIsLockedOn(play, &this->actor)) { EnWf_SetupSlash(this); } else { EnWf_SetupWait(this); @@ -1035,7 +1035,7 @@ void EnWf_Blocking(EnWf* this, PlayState* play) { } else { s16 angleFacingLink = player->actor.shape.rot.y - this->actor.shape.rot.y; - if (!Actor_OtherIsTargeted(play, &this->actor) && + if (!Actor_OtherIsLockedOn(play, &this->actor) && (((play->gameplayFrames % 2) != 0) || (ABS(angleFacingLink) < 0x38E0))) { EnWf_SetupSlash(this); } else { @@ -1114,7 +1114,7 @@ void EnWf_Sidestep(EnWf* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 150.0f; } @@ -1159,7 +1159,7 @@ void EnWf_Sidestep(EnWf* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y; - if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsTargeted(play, &this->actor) && + if ((this->actor.xzDistToPlayer <= 80.0f) && !Actor_OtherIsLockedOn(play, &this->actor) && (((play->gameplayFrames % 4) == 0) || (ABS(angleDiff2) < 0x38E0))) { EnWf_SetupSlash(this); } else { diff --git a/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/src/overlays/actors/ovl_En_Zf/z_en_zf.c index a401bad5a3..34dc457e18 100644 --- a/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -549,7 +549,7 @@ s32 EnZf_CanAttack(PlayState* play, EnZf* this) { return true; } } else { - if (!Actor_OtherIsTargeted(play, &this->actor)) { + if (!Actor_OtherIsLockedOn(play, &this->actor)) { return true; } if (this->actor.params == ENZF_TYPE_DINOLFOS) { @@ -836,7 +836,7 @@ void EnZf_ApproachPlayer(EnZf* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { sp40 = 100.0f; } @@ -897,7 +897,7 @@ void EnZf_ApproachPlayer(EnZf* this, PlayState* play) { if ((this->actor.xzDistToPlayer < 180.0f) && (this->actor.xzDistToPlayer > 160.0f) && Actor_IsFacingPlayer(&this->actor, 0x71C)) { - if (Actor_IsTargeted(play, &this->actor)) { + if (Actor_IsLockedOn(play, &this->actor)) { if (Rand_ZeroOne() < 0.1f) { this->actor.world.rot.y = this->actor.shape.rot.y = this->actor.yawTowardsPlayer; EnZf_SetupJumpForward(this); @@ -1113,7 +1113,7 @@ void func_80B463E4(EnZf* this, PlayState* play) { } } - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 100.0f; } @@ -1224,7 +1224,7 @@ void EnZf_Slash(EnZf* this, PlayState* play) { this->actor.world.rot.y = this->actor.yawTowardsPlayer; func_80B483E4(this, play); } else if (player->stateFlags1 & (PLAYER_STATE1_4 | PLAYER_STATE1_13 | PLAYER_STATE1_14)) { - if (this->actor.isTargeted) { + if (this->actor.isLockedOn) { EnZf_SetupSlash(this); } else { func_80B483E4(this, play); @@ -1827,7 +1827,7 @@ void EnZf_CircleAroundPlayer(EnZf* this, PlayState* play) { this->actor.world.rot.y = this->actor.shape.rot.y + 0x4000; - if (Actor_OtherIsTargeted(play, &this->actor)) { + if (Actor_OtherIsLockedOn(play, &this->actor)) { baseRange = 100.0f; } diff --git a/tools/disasm/ntsc-1.2/functions.txt b/tools/disasm/ntsc-1.2/functions.txt index 3194bccd86..612e83e537 100644 --- a/tools/disasm/ntsc-1.2/functions.txt +++ b/tools/disasm/ntsc-1.2/functions.txt @@ -487,8 +487,8 @@ Actor_ChangeCategory = 0x80026C14; // type:func Actor_GetProjectileActor = 0x80026C54; // type:func Actor_SetTextWithPrefix = 0x80026E14; // type:func Actor_TestFloorInDirection = 0x80026E90; // type:func -Actor_IsTargeted = 0x80026F5C; // type:func -Actor_OtherIsTargeted = 0x80026F90; // type:func +Actor_IsLockedOn = 0x80026F5C; // type:func +Actor_OtherIsLockedOn = 0x80026F90; // type:func func_80033AEC = 0x80026FC4; // type:func func_80033C30 = 0x80027110; // type:func Actor_RequestQuake = 0x8002725C; // type:func