data/claims/oot.yamlThe Legend of Zelda: Ocarina of Time (the zeldaret decompilation, zeldaret/oot)
In the N64 NTSC 1.0 code, pressing Z locks Link onto the actor Navi hovers over, unless that actor has lock-on disabled; with nothing to lock onto, Z starts "parallel" mode instead. Under the Hold setting the lock lasts while Z is held; under Switch, a flag keeps it after Z is let go. oot/z-lock-on
About: The Legend of Zelda: Ocarina of Time Lock-on targeting
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L3932-L3950CHECK_BTN_ALL(sControlInput->press.button, BTN_Z)) {
…
nextLockOnActor = play->actorCtx.attention.naviHoverActor;
…
usingHoldTargeting = (gSaveContext.zTargetSetting != 0) || (this->actor.category != ACTORCAT_PLAYER);
…
if ((nextLockOnActor != NULL) && !(nextLockOnActor->flags & ACTOR_FLAG_LOCK_ON_DISABLED)) {oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L3962-L3966if (!usingHoldTargeting) {
this->stateFlags2 |= PLAYER_STATE2_LOCK_ON_WITH_SWITCH;
}
this->focusActor = nextLockOnActor;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L3976-L3979} else {
// Lock-on was not started above. Set Parallel Mode.
…
Player_SetParallel(this);oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L3898-L3899} else if (zButtonHeld || (this->stateFlags2 & PLAYER_STATE2_LOCK_ON_WITH_SWITCH) ||
(this->autoLockOnActor != NULL)) {oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · include/save.h#L9-L12typedef enum ZTargetSetting { … Z_TARGET_SETTING_SWITCH, … Z_TARGET_SETTING_HOLD } ZTargetSetting;Checked by claude, 2026-10-25 — read Player_UpdateZTargeting (L3881-L4022), called each update from Player_UpdateCommon (L11721); no version #if in the function; the held-Z or Switch-flag branch keeps the lock-on timer at 5 or more, and the function clears Z-targeting once the timer reaches 0 (L4020-L4021); Hold is zTargetSetting 1, the second member of enum ZTargetSetting (include/save.h L9-L12)Pressing Z on the current target moves the lock to the actor Navi's arrow hovers over (L3955-L3957), and in Switch, pressing it again with no new target releases the lock (L3969-L3972). A lock also ends when Attention_ShouldReleaseLockOn says so (L3987-L3990), in code (z_actor.c) the atlas hasn't fetched. Parallel mode keeps Link and the camera facing the angle they had when Z was pressed, as the decompilers' comment above the function says (L3863).
Cited by: Lock-on targeting, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, unless an earlier branch applies (hookshot flight, pushing or pulling, and a few others), while Link has a focus actor his update makes that actor the main camera's view target and picks a mode for it: talk mode if Link's actor has the talk flag set, else, with the friendly-focus flag set, boomerang-follow mode if a boomerang is out or the friendly Z-target mode, and otherwise the unfriendly Z-target mode. In parallel mode it picks Z-aim mode when either of two checks the decomp leaves unnamed (func_8002DD78, func_808334B4) passes, else Z-wall-climb mode with an unnamed state flag (stateFlags1 bit 21) set, else the Z-parallel mode. oot/z-target-camera
About: The Legend of Zelda: Ocarina of Time Lock-on targeting
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L11379-L11391} else if ((focusActor = this->focusActor) != NULL) {
if (ACTOR_FLAGS_CHECK_ALL(&this->actor, ACTOR_FLAG_TALK)) {
camMode = CAM_MODE_TALK;
} else if (this->stateFlags1 & PLAYER_STATE1_FRIENDLY_ACTOR_FOCUS) {
if (this->stateFlags1 & PLAYER_STATE1_BOOMERANG_THROWN) {
camMode = CAM_MODE_FOLLOW_BOOMERANG;
} else {
camMode = CAM_MODE_Z_TARGET_FRIENDLY;
…
camMode = CAM_MODE_Z_TARGET_UNFRIENDLY;
}
Camera_SetViewParam(Play_GetCamera(play, CAM_ID_MAIN), CAM_VIEW_TARGET, focusActor);oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L11403-L11409} else if (this->stateFlags1 & (PLAYER_STATE1_PARALLEL | PLAYER_STATE1_LOCK_ON_FORCED_TO_RELEASE)) {
if (func_8002DD78(this) || func_808334B4(this)) {
camMode = CAM_MODE_Z_AIM;
} else if (this->stateFlags1 & PLAYER_STATE1_21) {
camMode = CAM_MODE_Z_WALL_CLIMB;
} else {
camMode = CAM_MODE_Z_PARALLEL;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L11431Camera_RequestMode(Play_GetCamera(play, CAM_ID_MAIN), camMode);Checked by claude, 2026-10-21 — read Player_UpdateCamAndSeqModes from L11360; the branch order puts cutscenes, hookshot flight, one still-camera action, and pushing or pulling ahead of the focus-actor branch; no version #if in the rangeThe earlier branches cover cutscenes, hookshot flight, one still-camera action, and pushing or pulling (L11366-L11378). The friendly-focus flag is set for a non-hostile actor, or for any actor while Link carries something (L4003-L4009). What each camera mode does is in z_camera.c, which this pass didn't trace.
Cited by: Lock-on targeting, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, while Link has a lock-on target and the reticle counter (reticleSpinCounter, which the decompilers' comment says counts up while a reticle is active) isn't 0, Link's model turns each update toward the locked-on actor's focus point, and in parallel mode toward the parallel angle; the direction he moves in is a separate yaw, which the stick sets relative to the camera. Two state flags the decomp leaves unnamed skip the turn, and the Z-target run and the roll set one of them. oot/z-target-facing
About: The Legend of Zelda: Ocarina of Time Lock-on targeting
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L3765-L3785* Updates Shape Yaw (`shape.rot.y`). In other words, the Y rotation of Player's model.
* This does not affect the direction Player will move in.
…
if (!(this->stateFlags2 & (PLAYER_STATE2_5 | PLAYER_STATE2_6))) {
…
((play->actorCtx.attention.reticleSpinCounter != 0) || (this->actor.category != ACTORCAT_PLAYER))) {
Math_ScaledStepToS(&this->actor.shape.rot.y, Math_Vec3f_Yaw(&this->actor.world.pos, &focusActor->focus.pos),
…
Math_ScaledStepToS(&this->actor.shape.rot.y, this->parallelYaw, 4000);oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · include/actor.h#L430/* 0x4B */ u8 reticleSpinCounter; // Counts up when a reticle is active, used for the spinning animationoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L4146-L4148} else {
*outYawTarget += Camera_GetInputDirYaw(GET_ACTIVE_CAM(play));
return true;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L8832this->stateFlags2 |= PLAYER_STATE2_5;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L9695this->stateFlags2 |= PLAYER_STATE2_5;Checked by claude, 2026-10-25 — read Player_UpdateShapeYaw (L3773-L3792), Player_GetMovementSpeedAndYaw (L4132-L4149), Player_Action_8084227C (L8828, the action func_8083C858 picks while Z-targeting, L6668-L6669), and Player_Action_Roll (L9686); no version #if in these ranges. The reticle counter is set in src/code/z_actor.c, outside the paths the atlas fetches, so the statement names it by the decompilers' commentWith PLAYER_STATE2_5 set and PLAYER_STATE2_6 clear, the model turns toward the movement yaw instead (L3788-L3789). With the stick neutral and a reticle up, the movement code also aims the target yaw at the locked-on actor (L4135-L4138). The turn's step, 4000 binary-angle units, is scaled by the update rate inside Math_ScaledStepToS (z_lib.c, not fetched), so no per-update figure is given here. Read at the pin but not fetched, z_actor.c makes the counter nonzero only once the reticle has finished zooming in (L617-L623) and resets it to 0 when the lock ends (L2533-L2536), so the turn would begin after the zoom rather than with the lock.
Cited by: Lock-on targeting, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, each update sorts the control stick into one of four quarters relative to the way Link's model faces: forward, left, backward, or right, each 90° wide and centered on its direction, after turning the stick angle by the camera's. Below a magnitude of 55 the stick counts as no direction. oot/stick-quarters
About: The Legend of Zelda: Ocarina of Time Evasive hop
Value: 55 stick magnitude
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L2211-L2223sControlStickWorldYaw = Camera_GetInputDirYaw(GET_ACTIVE_CAM(play)) + sControlStickAngle;
…
if (sControlStickMagnitude < 55.0f) {
direction = PLAYER_STICK_DIR_NONE;
…
direction = (u16)((s16)(sControlStickWorldYaw - this->actor.shape.rot.y) + 0x2000) >> 14;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · include/player.h#L639-L643/* -1 */ PLAYER_STICK_DIR_NONE = -1,
/* 0 */ PLAYER_STICK_DIR_FORWARD,
/* 1 */ PLAYER_STICK_DIR_LEFT,
/* 2 */ PLAYER_STICK_DIR_BACKWARD,
/* 3 */ PLAYER_STICK_DIR_RIGHTChecked by claude, 2026-10-21 — read Player_ProcessControlStick (L2201-L2226); adding 0x2000 (45°) before taking the top two bits of the 16-bit angle difference centers each quarter on its direction; no version #if in the functionThe stick's magnitude comes from Lib_GetControlStickData, outside the fetched files, so the scale of 55 isn't read here. The quarter is relative to the model's yaw, which a lock-on keeps aimed at the target (z-target-facing), so while locked on "backward" means away from the target.
Cited by: Evasive hop, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, the action handler the decomp calls Player_ActionHandler_10 acts on a press of A, except in a room of the indoors type, on floor type 7, or on a floor with floor effect 1 (both unnamed): with the stick backward, left, or right it starts a hop that way; with the stick forward or neutral, only while Z-targeting, it starts a jump slash if Link holds a melee weapon and can use items, and a roll otherwise. oot/hop-trigger
About: The Legend of Zelda: Ocarina of Time Evasive hop
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L6385-L6417if (CHECK_BTN_ALL(sControlInput->press.button, BTN_A) && (play->roomCtx.curRoom.type != ROOM_TYPE_INDOORS) &&
(sFloorType != FLOOR_TYPE_7) &&
(SurfaceType_GetFloorEffect(&play->colCtx, this->actor.floorPoly, this->actor.floorBgId) != FLOOR_EFFECT_1)) {
controlStickDirection = this->controlStickDirections[this->controlStickDataIndex];
if (controlStickDirection <= PLAYER_STICK_DIR_FORWARD) {
if (Player_IsZTargeting(this)) {
…
if ((Player_GetMeleeWeaponHeld(this) != 0) && Player_CanUpdateItems(this)) {
func_8083BA90(play, this, PLAYER_MWA_JUMPSLASH_START, 5.0f, 5.0f);
} else {
Player_SetupRoll(this, play);
…Checked by claude, 2026-10-21 — read Player_ActionHandler_10 (L6385-L6420) and the stick-direction enum (include/player.h L639-L643); the branch skipped above (L6395-L6400) is for a non-player actor using Link's code (Dark Link); no version #if in the rangePlayer_IsZTargeting covers both a lock-on and parallel mode, per the decompilers' comment (L2585). The hop branch doesn't test Z-targeting itself; which actions offer this handler is in the claim hop-handler-lists.
Cited by: Evasive hop, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, the action that holds Link standing while he Z-targets (Player_Action_808407CC in the decomp) offers the hop handler to A, and hands control to the idle action once Z-targeting ends; the idle action's own handler list leaves the hop handler out. oot/hop-handler-lists
About: The Legend of Zelda: Ocarina of Time Evasive hop
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L4174-L4178static s8 sActionHandlerList2[] = {
PLAYER_ACTION_HANDLER_13, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2, PLAYER_ACTION_HANDLER_5,
PLAYER_ACTION_HANDLER_3, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9, PLAYER_ACTION_HANDLER_10,
PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_7, PLAYER_ACTION_HANDLER_8, -PLAYER_ACTION_HANDLER_ROLL,
};oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L4201-L4205static s8 sActionHandlerListIdle[] = {
PLAYER_ACTION_HANDLER_0, PLAYER_ACTION_HANDLER_11, PLAYER_ACTION_HANDLER_1, PLAYER_ACTION_HANDLER_2,
PLAYER_ACTION_HANDLER_3, PLAYER_ACTION_HANDLER_5, PLAYER_ACTION_HANDLER_TALK, PLAYER_ACTION_HANDLER_9,
PLAYER_ACTION_HANDLER_8, PLAYER_ACTION_HANDLER_7, -PLAYER_ACTION_HANDLER_ROLL,
};oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L8158-L8167if (!Player_TryActionHandlerList(play, this, sActionHandlerList2, true)) {
if (Player_UpdateHostileLockOn(this)) {
func_8083CEAC(this, play);
return;
}
if (!Player_FriendlyLockOnOrParallel(this)) {
Player_SetupActionPreserveAnimMovement(play, this, Player_Action_Idle, 1);
this->yaw = this->actor.shape.rot.y;
return;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L4259Player_ActionHandler_10, // PLAYER_ACTION_HANDLER_10Checked by claude, 2026-10-21 — read Player_Action_808407CC (L8144-L8180), the handler lists (L4169-L4230), and the handler table (L4248-L4263); a hostile lock-on goes to func_8083CEAC, any other end of Z-targeting to the idle action; no version #if in these rangesThe handler also sits in lists 1, 3, 4, 5, 9, and 10, used by other actions (L8091, L8399, L8522, L8566, L8584, L8611, L8835, L8866, L8896); several of those leave when Z-targeting ends, but this pass traced only the standing one. The list runs before the Z-targeting test in the same update.
Cited by: The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, the backward hop (a backflip, by its animation) launches Link at a vertical velocity of 5.8 and a horizontal speed of 6.0 aimed straight behind his facing, and a sideways hop at 3.5 up and 8.5 aimed 90° to the left or right. The vertical value is multiplied by a water factor, sWaterSpeedFactor, which this pass didn't read. oot/hop-speeds
About: The Legend of Zelda: Ocarina of Time Evasive hop
Value: 5.8
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L6368-L6378void func_8083BCD0(Player* this, PlayState* play, s32 controlStickDirection) {
func_80838940(this, D_80853D4C[controlStickDirection][0], !(controlStickDirection & 1) ? 5.8f : 3.5f, play,
…
this->yaw = this->actor.shape.rot.y + (controlStickDirection << 0xE);
this->speedXZ = !(controlStickDirection & 1) ? 6.0f : 8.5f;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L4982-L4989void func_80838940(Player* this, LinkAnimationHeader* anim, f32 arg2, PlayState* play, u16 sfxId) {
…
this->actor.velocity.y = arg2 * sWaterSpeedFactor;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L1120-L1128static LinkAnimationHeader* D_80853D4C[][3] = {
…
{ &gPlayerAnim_link_fighter_Lside_jump, &gPlayerAnim_link_fighter_Lside_jump_end,
…
{ &gPlayerAnim_link_fighter_backturn_jump, &gPlayerAnim_link_fighter_backturn_jump_end,
…
{ &gPlayerAnim_link_fighter_Rside_jump, &gPlayerAnim_link_fighter_Rside_jump_end,Checked by claude, 2026-10-21 — read func_8083BCD0 (L6368-L6383) with the stick quarters of include/player.h L639-L643: backward is 2 (even, so 5.8 and 6.0, and 2 << 14 is 0x8000, half a turn), left and right are 1 and 3 (odd, so 3.5 and 8.5, a quarter turn either way); func_80838940 (L4982-L4997); no version #if in these rangesThe values are the code's own; how the actor code turns speed into distance per frame is in z_actor.c, which this pass didn't fetch, so no unit is given. The backward hop plays the roll sound and the side hops a skip sound (L6382). The animation table names the backward one "backturn_jump"; "backflip" and "sidehop" are players' names.
Cited by: Evasive hop, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, the jump slash started from the Z-targeting A press (stick forward or neutral, holding a melee weapon) sends Link forward along his facing at a speed of 5.0 with a vertical velocity of 5.0. oot/jump-slash
About: The Legend of Zelda: Ocarina of Time Lock-on targeting
Value: 5
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L6403func_8083BA90(play, this, PLAYER_MWA_JUMPSLASH_START, 5.0f, 5.0f);oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L6313-L6321void func_8083BA90(PlayState* play, Player* this, s32 arg2, f32 xzSpeed, f32 yVelocity) {
…
this->yaw = this->actor.shape.rot.y;
this->speedXZ = xzSpeed;
this->actor.velocity.y = yVelocity;Checked by claude, 2026-10-21 — read func_8083BA90 (L6313-L6328) and its call in Player_ActionHandler_10; no versionAnother call starts the same jump slash at 3.0 forward and 4.5 up when B is pressed on a usable floor (func_8083BBA0, L6341-L6343); which actions offer it wasn't traced.
Cited by: The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, Link rolls when A is pressed with the stick forward, provided there is no hostile lock-on, his upper body isn't busy, an unnamed state flag (stateFlags1 bit 23) is clear, and the floor isn't floor type 7; with the stick elsewhere the same press puts away a held item or toggles Navi. The roll animation plays at 1.25 times speed (1.5 in the PAL N64 builds). oot/roll
About: The Legend of Zelda: Ocarina of Time Dodge roll
Value: 1.25 × animation speed
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L6489-L6498s32 Player_ActionHandler_Roll(Player* this, PlayState* play) {
if (!Player_UpdateHostileLockOn(this) && !sUpperBodyIsBusy && !(this->stateFlags1 & PLAYER_STATE1_23) &&
CHECK_BTN_ALL(sControlInput->press.button, BTN_A)) {
if (Player_TryRoll(this, play)) {
return true;
} else if ((this->putAwayCooldownTimer == 0) && (this->heldItemAction >= PLAYER_IA_SWORD_MASTER)) {
Player_UseItem(play, this, ITEM_NONE);
} else {
this->stateFlags2 ^= PLAYER_STATE2_NAVI_ACTIVE;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L6350-L6360void Player_SetupRoll(Player* this, PlayState* play) {
Player_SetupAction(play, this, Player_Action_Roll, 0);
…
FRAMERATE_CONST(1.25f, 1.5f) * sWaterSpeedFactor);
}
s32 Player_TryRoll(Player* this, PlayState* play) {
if ((this->controlStickDirections[this->controlStickDataIndex] == PLAYER_STICK_DIR_FORWARD) &&
(sFloorType != FLOOR_TYPE_7)) {oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · include/versions.h#L44-L50#if !OOT_PAL_N64
#define FRAMERATE_CONST(value60Hz, value50Hz) (value60Hz)
#else
#define FRAMERATE_CONST(value60Hz, value50Hz) (value50Hz)
#endifChecked by claude, 2026-10-21 — read Player_ActionHandler_Roll (L6489-L6501), Player_SetupRoll and Player_TryRoll (L6350-L6364), and versions.h (OOT_PAL_N64 is set only for PAL 1.0 and 1.1); no version #if in the z_player.c rangesThe animation speed is also multiplied by sWaterSpeedFactor. The put-away test is heldItemAction >= PLAYER_IA_SWORD_MASTER: the enum puts the fishing rod and a cutscene sword before it, and the swords, Deku Stick, hammer, bows, and further items after it (include/player.h L115-L128). The roll handler sits in the idle list among others (L4201-L4205).
Cited by: Dodge roll, The Legend of Zelda: Ocarina of Time
In the N64 NTSC 1.0 code, a roll makes Link invulnerable for 10 updates from frame 8 of its animation (8 updates in the PAL N64 builds): damage is ignored but, per the decompilers' comment, not the responses to it such as knockback. oot/roll-invulnerability
About: The Legend of Zelda: Ocarina of Time Dodge roll
Value: 10 updates
Codeoot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) ·src/overlays/actors/ovl_player_actor/z_player.c#L9700-L9702if (LinkAnimation_OnFrame(&this->skelAnime, 8.0f)) {
Player_SetInvulnerability(this, FRAMERATE_CONST(-10, -8));
}oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L4584-L4590* @param timer must be a negative value representing the number of invulnerability frames.
* @note Intangibility prevents taking damage and responses to damage like knockback, while invulnerability only
* prevents taking damage.
*/
void Player_SetInvulnerability(Player* this, s32 timer) {
if (this->invincibilityTimer > timer) {
this->invincibilityTimer = timer;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · src/overlays/actors/ovl_player_actor/z_player.c#L11709-L11710if (this->invincibilityTimer < 0) {
this->invincibilityTimer++;oot: a decompilation of The Legend of Zelda: Ocarina of Time (zeldaret/oot) · include/player.h#L979/* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero. Positive values are intangibility, negative are invulnerabilityChecked by claude, 2026-10-21 — read Player_Action_Roll's opening (L9686-L9702), Player_SetInvulnerability (L4583-L4593), and the count-up in Player_UpdateCommon (L11709-L11713), which Player_Update calls once per update (L12151); no version #if in these rangesPlayer_SetInvulnerability keeps the longer of an existing window and the new one. An update is one run of Link's code, not a video field; the game's update rate isn't read here.
Cited by: Dodge roll, The Legend of Zelda: Ocarina of Time