diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-05-17 05:04:23 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-16 15:04:23 -0400 |
| commit | 83ac58d739a0ce0f177a6d4380af36085cc6c5bc (patch) | |
| tree | fac606ba1ebcb29e636d481f6ac82dac0b64f210 /src/code | |
| parent | 858d10a38b20cf4288c0044c2fe93a5b49746a40 (diff) | |
Player Impact Documentation From ActorContext (#1226)
* playerImpact
* discord feedback
* namefixer
* rm comment
* adjust not-logic
* pr review
* fix bss
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index d18193de7..6ede10773 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -908,41 +908,38 @@ s32 func_800B6434(PlayState* play, TitleCardContext* titleCtx) { return true; } -// ActorContext_1F4 Init -void func_800B6468(PlayState* play) { - play->actorCtx.unk_1F4.timer = 0; +void Actor_InitPlayerImpact(PlayState* play) { + play->actorCtx.playerImpact.timer = 0; } -// ActorContext_1F4 Update -void func_800B6474(PlayState* play) { - DECR(play->actorCtx.unk_1F4.timer); +void Actor_UpdatePlayerImpact(PlayState* play) { + DECR(play->actorCtx.playerImpact.timer); } -// ActorContext_1F4 setter something -s32 func_800B648C(PlayState* play, s32 arg1, s32 timer, f32 arg3, Vec3f* arg4) { - if ((play->actorCtx.unk_1F4.timer != 0) && (arg3 < play->actorCtx.unk_1F4.unk_04)) { +s32 Actor_SetPlayerImpact(PlayState* play, PlayerImpactType type, s32 timer, f32 dist, Vec3f* pos) { + if ((play->actorCtx.playerImpact.timer != 0) && (dist < play->actorCtx.playerImpact.dist)) { return false; } - play->actorCtx.unk_1F4.unk_00 = arg1; - play->actorCtx.unk_1F4.timer = timer; - play->actorCtx.unk_1F4.unk_04 = arg3; - Math_Vec3f_Copy(&play->actorCtx.unk_1F4.unk_08, arg4); + play->actorCtx.playerImpact.type = type; + play->actorCtx.playerImpact.timer = timer; + play->actorCtx.playerImpact.dist = dist; + Math_Vec3f_Copy(&play->actorCtx.playerImpact.pos, pos); return true; } -// ActorContext_1F4 getter something -f32 func_800B64FC(PlayState* play, f32 arg1, Vec3f* arg2, u32* arg3) { - f32 temp_f8; +f32 Actor_GetPlayerImpact(PlayState* play, f32 range, Vec3f* pos, PlayerImpactType* type) { + f32 dist; - if ((play->actorCtx.unk_1F4.timer == 0) || (arg1 == 0.0f)) { + if ((play->actorCtx.playerImpact.timer == 0) || (range == 0.0f)) { return -1.0f; } - temp_f8 = Math_Vec3f_DistXYZ(&play->actorCtx.unk_1F4.unk_08, arg2) / arg1; - *arg3 = play->actorCtx.unk_1F4.unk_00; - return play->actorCtx.unk_1F4.unk_04 - temp_f8; + dist = Math_Vec3f_DistXYZ(&play->actorCtx.playerImpact.pos, pos) / range; + *type = play->actorCtx.playerImpact.type; + + return play->actorCtx.playerImpact.dist - dist; } /** @@ -2303,7 +2300,7 @@ void Actor_InitContext(PlayState* play, ActorContext* actorCtx, ActorEntry* acto actorCtx->sceneFlags.clearedRoom = cycleFlags->clearedRoom; TitleCard_ContextInit(&play->state, &actorCtx->titleCtxt); - func_800B6468(play); + Actor_InitPlayerImpact(play); actorCtx->absoluteSpace = NULL; @@ -2559,7 +2556,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) { } TitleCard_Update(&play->state, &actorCtx->titleCtxt); - func_800B6474(play); + Actor_UpdatePlayerImpact(play); DynaPoly_UpdateBgActorTransforms(play, &play->colCtx.dyna); } |
