1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-08 00:44:42 +00:00

Document autoLockOnActor (#2212)

* document autoLockOnActor

* format.py

* backtick

* grammar

* comment adjustments

* word

* letter
This commit is contained in:
fig02 2024-09-21 14:49:45 -04:00 committed by GitHub
parent 5178011b64
commit 05b908d0eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 43 additions and 13 deletions

View file

@ -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);