Player Docs: FocusActor and Lock-On Cleanup (#1711)

* focus actor docs

* small cleanup

* brackets

* remaining lock-on docs

* more cleanup/docs

* more reticle docs

* oops
This commit is contained in:
engineer124
2024-10-16 11:52:45 +11:00
committed by GitHub
parent 917d214951
commit 86d8dc6a9f
19 changed files with 288 additions and 258 deletions
+11 -11
View File
@@ -280,27 +280,27 @@ typedef enum {
#define ACTORCTX_FLAG_6 (1 << 6)
#define ACTORCTX_FLAG_7 (1 << 7)
// A set of 4 triangles which appear around an actor when the player Z-Targets it
typedef struct LockOnTriangleSet {
// A set of 4 triangles which appear as a ring around an actor when locked-on
typedef struct LockOnReticle {
/* 0x00 */ Vec3f pos;
/* 0x0C */ f32 radius; // distance towards the center of the locked on
/* 0x0C */ f32 radius; // distance towards the center of the locked-on actor
/* 0x10 */ Color_RGBA8 color;
} LockOnTriangleSet; // size = 0x14
} LockOnReticle; // size = 0x14
typedef struct TargetContext {
/* 0x00 */ Vec3f fairyPos; // Used by Tatl to indicate a targetable actor or general hint
/* 0x0C */ Vec3f lockOnPos;
/* 0x0C */ Vec3f reticlePos; // Main reticle pos which each `LockOnReticle` instance can reference
/* 0x18 */ Color_RGBAf fairyInnerColor;
/* 0x28 */ Color_RGBAf fairyOuterColor;
/* 0x38 */ Actor* fairyActor;
/* 0x3C */ Actor* lockOnActor;
/* 0x3C */ Actor* reticleActor; // Actor to draw a reticle over
/* 0x40 */ f32 fairyMoveProgressFactor; // Controls Tatl so she can smootly transition to the target actor
/* 0x44 */ f32 lockOnRadius; // Control the circle lock-on triangles coming in from offscreen when you first target
/* 0x48 */ s16 lockOnAlpha;
/* 0x44 */ f32 reticleRadius; // Main reticle radius value which each `LockOnReticle` instance can reference
/* 0x48 */ s16 reticleFadeAlphaControl; // Set and fade the reticle alpha; Non-zero values control if it should draw
/* 0x4A */ u8 fairyActorCategory;
/* 0x4B */ u8 rotZTick;
/* 0x4C */ s8 lockOnIndex;
/* 0x50 */ LockOnTriangleSet lockOnTriangleSets[3];
/* 0x4B */ u8 reticleSpinCounter; // Counts up when a reticle is active, used for the spinning animation
/* 0x4C */ s8 curReticle; // Indexes lockOnReticles[]
/* 0x50 */ LockOnReticle lockOnReticles[3]; // Multiple reticles are used for a motion-blur effect
/* 0x8C */ Actor* forcedTargetActor; // Never set to non-NULL
/* 0x90 */ Actor* bgmEnemy;
/* 0x94 */ Actor* arrowPointedActor;
+9 -9
View File
@@ -894,8 +894,8 @@ typedef enum PlayerCueId {
#define PLAYER_STATE1_4000 (1 << 14)
//
#define PLAYER_STATE1_8000 (1 << 15)
//
#define PLAYER_STATE1_10000 (1 << 16)
// Currently focusing on a friendly actor. Includes friendly lock-on, talking, and more. Usually does not include hostile actor lock-on, see `PLAYER_STATE3_HOSTILE_LOCK_ON`.
#define PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS (1 << 16)
//
#define PLAYER_STATE1_20000 (1 << 17)
//
@@ -954,8 +954,8 @@ typedef enum PlayerCueId {
#define PLAYER_STATE2_800 (1 << 11)
//
#define PLAYER_STATE2_1000 (1 << 12)
//
#define PLAYER_STATE2_2000 (1 << 13)
// Actor lock-on is active, specifically with Switch Targeting. Hold Targeting checks the state of the Z button instead of this flag.
#define PLAYER_STATE2_LOCK_ON_WITH_SWITCH (1 << 13)
//
#define PLAYER_STATE2_4000 (1 << 14)
//
@@ -1193,7 +1193,7 @@ typedef struct Player {
/* 0x564 */ ColliderQuad meleeWeaponQuads[2];
/* 0x664 */ ColliderQuad shieldQuad;
/* 0x6E4 */ ColliderCylinder shieldCylinder;
/* 0x730 */ Actor* lockOnActor; // Z/L-Targeted actor
/* 0x730 */ Actor* focusActor; // Actor that Player and the camera are looking at; Used for lock-on, talking, and more
/* 0x734 */ char unk_734[4];
/* 0x738 */ s32 unk_738;
/* 0x73C */ s32 meleeWeaponEffectIndex[3];
@@ -1207,7 +1207,7 @@ typedef struct Player {
/* 0xA6C */ u32 stateFlags1;
/* 0xA70 */ u32 stateFlags2;
/* 0xA74 */ u32 stateFlags3;
/* 0xA78 */ Actor* unk_A78;
/* 0xA78 */ Actor* autoLockOnActor; // Actor that is locked onto automatically without player input; see `Player_SetAutoLockOnActor`
/* 0xA7C */ Actor* boomerangActor;
/* 0xA80 */ Actor* tatlActor;
/* 0xA84 */ s16 tatlTextId;
@@ -1396,9 +1396,9 @@ void Player_SetModelGroup(Player* player, PlayerModelGroup modelGroup);
void func_80123C58(Player* player);
void Player_SetEquipmentData(struct PlayState* play, Player* player);
void Player_UpdateBottleHeld(struct PlayState* play, Player* player, ItemId itemId, PlayerItemAction itemAction);
void Player_Untarget(Player* player);
void func_80123DC0(Player* player);
void func_80123E90(struct PlayState* play, Actor* actor);
void Player_ReleaseLockOn(Player* player);
void Player_ClearZTargeting(Player* player);
void Player_SetAutoLockOnActor(struct PlayState* play, Actor* actor);
s32 Player_SetBButtonAmmo(struct PlayState* play, s32 ammo);
bool Player_IsBurningStickInRange(struct PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange);
u8 Player_GetStrength(void);