diff options
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_player_lib.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index aefc14db8..f589748f0 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -742,12 +742,26 @@ void func_8008EE08(Player* this) { func_8008EDF0(this); } -void func_8008EEAC(PlayState* play, Actor* actor) { +/** + * Sets the "auto lock-on actor" to lock onto an actor without Player's input. + * This function will first release any existing lock-on or (try to) release parallel. + * + * When using Switch Targeting, it is not possible to carry an auto lock-on actor into a normal + * lock-on when the auto lock-on is finished. + * This is because the `PLAYER_STATE2_LOCK_ON_WITH_SWITCH` flag is never set with an auto lock-on. + * With Hold Targeting it is possible to keep the auto lock-on going by keeping the Z button held down. + * + * The auto lock-on is considered "friendly" even if the actor is actually hostile. If the auto lock-on is hostile, + * Player's battle response will not occur (if he is actionable) and the camera behaves differently. + * When transitioning from auto lock-on to normal lock-on (with Hold Targeting) there will be a noticeable change + * when it switches from "friendly" mode to "hostile" mode. + */ +void Player_SetAutoLockOnActor(PlayState* play, Actor* actor) { Player* this = GET_PLAYER(play); func_8008EE08(this); this->focusActor = actor; - this->unk_684 = actor; + this->autoLockOnActor = actor; this->stateFlags1 |= PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS; Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, actor); Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), CAM_MODE_Z_TARGET_FRIENDLY); |
