Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Player Knockback related functions #1601

Merged
merged 18 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,11 @@ void Actor_SetClosestSecretDistance(Actor* actor, PlayState* play);
s32 Actor_IsMounted(PlayState* play, Actor* horse);
u32 Actor_SetRideActor(PlayState* play, Actor* horse, s32 mountSide);
s32 Actor_NotMounted(PlayState* play, Actor* horse);
void func_8002F698(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6);
void func_8002F6D4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5);
void func_8002F71C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5);
void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4);
void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, u32 damage);
void Actor_SetPlayerKnockbackLarge(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage);
void Actor_SetPlayerKnockbackLargeNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity);
void Actor_SetPlayerKnockbackSmall(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage);
void Actor_SetPlayerKnockbackSmallNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity);
void Player_PlaySfx(Player* player, u16 sfxId);
void Actor_PlaySfx(Actor* actor, u16 sfxId);
void Actor_PlaySfx_SurfaceBomb(PlayState* play, Actor* actor);
Expand Down
29 changes: 22 additions & 7 deletions include/z64player.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,21 @@ typedef enum PlayerStickDirection {
/* 3 */ PLAYER_STICK_DIR_RIGHT
} PlayerStickDirection;

typedef enum {
/* 0 */ PLAYER_KNOCKBACK_NONE, // No knockback
/* 1 */ PLAYER_KNOCKBACK_SMALL, // A small hop, remains standing up
/* 2 */ PLAYER_KNOCKBACK_LARGE, // Sent flying in the air and lands laying down on the floor
/* 3 */ PLAYER_KNOCKBACK_LARGE_SHOCK // Same as`PLAYER_KNOCKBACK_LARGE` with a shock effect
} PlayerKnockbackType;

typedef enum {
/* 0 */ PLAYER_HIT_RESPONSE_NONE,
/* 1 */ PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE,
/* 2 */ PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL,
/* 3 */ PLAYER_HIT_RESPONSE_ICE_TRAP,
/* 4 */ PLAYER_HIT_RESPONSE_ELECTRIC_SHOCK
} PlayerDamageResponseType;

typedef struct PlayerAgeProperties {
/* 0x00 */ f32 ceilingCheckHeight;
/* 0x04 */ f32 unk_04;
Expand Down Expand Up @@ -875,7 +890,7 @@ typedef struct Player {
/* 0x088C */ u8 ledgeClimbType;
/* 0x088D */ u8 ledgeClimbDelayTimer;
/* 0x088E */ u8 unk_88E;
/* 0x088F */ u8 unk_88F;
/* 0x088F */ u8 damageFlickerAnimCounter; // Used to flicker Link after taking damage
/* 0x0890 */ u8 unk_890;
/* 0x0891 */ u8 bodyShockTimer;
/* 0x0892 */ u8 unk_892;
Expand All @@ -886,11 +901,11 @@ typedef struct Player {
/* 0x089A */ s16 floorPitchAlt; // the calculation for this value is bugged and doesn't represent anything meaningful
/* 0x089C */ s16 unk_89C;
/* 0x089E */ u16 floorSfxOffset;
/* 0x08A0 */ u8 unk_8A0;
/* 0x08A1 */ u8 unk_8A1;
/* 0x08A2 */ s16 unk_8A2;
/* 0x08A4 */ f32 unk_8A4;
/* 0x08A8 */ f32 unk_8A8;
/* 0x08A0 */ u8 knockbackDamage;
/* 0x08A1 */ u8 knockbackType;
/* 0x08A2 */ s16 knockbackRot;
/* 0x08A4 */ f32 knockbackSpeed;
/* 0x08A8 */ f32 knockbackYVelocity;
/* 0x08AC */ f32 pushedSpeed; // Pushing player, examples include water currents, floor conveyors, climbing sloped surfaces
/* 0x08B0 */ s16 pushedYaw; // Yaw direction of player being pushed
/* 0x08B4 */ WeaponInfo meleeWeaponInfo[3];
Expand All @@ -901,7 +916,7 @@ typedef struct Player {
/* 0x0A61 */ u8 bodyFlameTimers[PLAYER_BODYPART_MAX]; // one flame per body part
/* 0x0A73 */ u8 unk_A73;
/* 0x0A74 */ AfterPutAwayFunc afterPutAwayFunc; // See `Player_SetupWaitForPutAway` and `Player_Action_WaitForPutAway`
/* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero (positive = visible, counts towards zero each frame)
/* 0x0A78 */ s8 invincibilityTimer; // prevents damage when nonzero. Positive values are intangibility, negative are invulnerability
/* 0x0A79 */ u8 floorTypeTimer; // counts up every frame the current floor type is the same as the last frame
/* 0x0A7A */ u8 floorProperty;
/* 0x0A7B */ u8 prevFloorType;
Expand Down
2 changes: 1 addition & 1 deletion src/boot/z_std_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#endif

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:111"
"ntsc-1.2:104"

StackEntry sDmaMgrStackInfo;
OSMesgQueue sDmaMgrMsgQueue;
Expand Down
2 changes: 1 addition & 1 deletion src/code/fault_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
*/
#if PLATFORM_GC

#pragma increment_block_number "gc-eu:208 gc-eu-mq:208 gc-eu-mq-dbg:192 gc-jp:208 gc-jp-ce:208 gc-jp-mq:208 gc-us:208" \
#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-eu-mq-dbg:192 gc-jp:208 gc-jp-ce:208 gc-jp-mq:208 gc-us:208" \
"gc-us-mq:208"

#include "global.h"
Expand Down
2 changes: 1 addition & 1 deletion src/code/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#define GFXPOOL_TAIL_MAGIC 0x5678

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:223"
"ntsc-1.2:192"

/**
* The time at which the previous `Graph_Update` ended.
Expand Down
2 changes: 1 addition & 1 deletion src/code/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern struct IrqMgr gIrqMgr;
#endif

#pragma increment_block_number "gc-eu:192 gc-eu-mq:192 gc-jp:192 gc-jp-ce:192 gc-jp-mq:192 gc-us:192 gc-us-mq:192" \
"ntsc-1.2:168"
"ntsc-1.2:162"

extern u8 _buffersSegmentEnd[];

Expand Down
77 changes: 63 additions & 14 deletions src/code/z_actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,30 +1899,79 @@ s32 Actor_NotMounted(PlayState* play, Actor* horse) {
}
}

void func_8002F698(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5, u32 arg6) {
/**
* Sets the player's knockback properties
*
* @param play
* @param actor source actor applying knockback damage
* @param speed
* @param rot the direction the player will be pushed
* @param yVelocity
* @param type PlayerKnockbackType
* @param damage additional amount of damage to deal to the player
*/
void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 type, u32 damage) {
Player* player = GET_PLAYER(play);

player->unk_8A0 = arg6;
player->unk_8A1 = arg5;
player->unk_8A4 = arg2;
player->unk_8A2 = arg3;
player->unk_8A8 = arg4;
player->knockbackDamage = damage;
player->knockbackType = type;
player->knockbackSpeed = speed;
player->knockbackRot = rot;
player->knockbackYVelocity = yVelocity;
}

void func_8002F6D4(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) {
func_8002F698(play, actor, arg2, arg3, arg4, 2, arg5);
/**
* Knocks the player to the ground
*
* @param play
* @param actor source actor applying knockback damage
* @param speed
* @param rot the direction the player will be pushed
* @param yVelocity
* @param damage additional amount of damage to deal to the player
*/
void Actor_SetPlayerKnockbackLarge(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) {
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_LARGE, damage);
}

void func_8002F71C(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) {
func_8002F6D4(play, actor, arg2, arg3, arg4, 0);
/**
* Knocks the player to the ground, without applying additional damage
*
* @param play
* @param actor source actor applying knockback damage
* @param speed
* @param rot the direction the player will be pushed
* @param yVelocity
*/
void Actor_SetPlayerKnockbackLargeNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity) {
Actor_SetPlayerKnockbackLarge(play, actor, speed, rot, yVelocity, 0);
}

void func_8002F758(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4, u32 arg5) {
func_8002F698(play, actor, arg2, arg3, arg4, 1, arg5);
/**
* Knocks the player back while keeping them on their feet
*
* @param play
* @param actor
* @param speed overridden
* @param rot the direction the player will be pushed
* @param yVelocity overridden
* @param damage additional amount of damage to deal to the player
*/
void Actor_SetPlayerKnockbackSmall(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity, u32 damage) {
Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCKBACK_SMALL, damage);
}

void func_8002F7A0(PlayState* play, Actor* actor, f32 arg2, s16 arg3, f32 arg4) {
func_8002F758(play, actor, arg2, arg3, arg4, 0);
/**
* Knocks the player back while keeping them on their feet, without applying additional damage
*
* @param play
* @param actor
* @param speed overridden
* @param rot the direction the player will be pushed
* @param yVelocity overridden
*/
void Actor_SetPlayerKnockbackSmallNoDamage(PlayState* play, Actor* actor, f32 speed, s16 rot, f32 yVelocity) {
Actor_SetPlayerKnockbackSmall(play, actor, speed, rot, yVelocity, 0);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -3638,7 +3638,7 @@ s32 Camera_KeepOn3(Camera* camera) {
}

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:112"
"ntsc-1.2:106"

s32 Camera_KeepOn4(Camera* camera) {
static Vec3f D_8015BD50;
Expand Down
2 changes: 1 addition & 1 deletion src/code/z_collision_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "overlays/effects/ovl_Effect_Ss_HitMark/z_eff_ss_hitmark.h"

#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:224"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:216"

typedef s32 (*ColChkResetFunc)(PlayState*, Collider*);
typedef void (*ColChkApplyFunc)(PlayState*, CollisionCheckContext*, Collider*);
Expand Down
3 changes: 1 addition & 2 deletions src/code/z_common_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#include "region.h"
#include "versions.h"

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:192"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:192"

ALIGNED(16) SaveContext gSaveContext;
u32 D_8015FA88;
Expand Down
5 changes: 2 additions & 3 deletions src/code/z_kankyo.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/gameplay_field_keep/gameplay_field_keep.h"

#pragma increment_block_number "gc-eu:128 gc-eu-mq:128 gc-jp:128 gc-jp-ce:128 gc-jp-mq:128 gc-us:128 gc-us-mq:128" \
"ntsc-1.2:0"
#pragma increment_block_number "gc-eu:0 gc-eu-mq:0 gc-jp:0 gc-jp-ce:0 gc-jp-mq:0 gc-us:0 gc-us-mq:0 ntsc-1.2:0"

typedef enum LightningBoltState {
/* 0x00 */ LIGHTNING_BOLT_START,
Expand Down Expand Up @@ -213,7 +212,7 @@ s16 sLightningFlashAlpha;
s16 sSunDepthTestX;
s16 sSunDepthTestY;

#pragma increment_block_number "gc-eu:112 gc-eu-mq:112 gc-jp:96 gc-jp-ce:96 gc-jp-mq:96 gc-us:96 gc-us-mq:96" \
#pragma increment_block_number "gc-eu:240 gc-eu-mq:240 gc-jp:216 gc-jp-ce:216 gc-jp-mq:216 gc-us:216 gc-us-mq:216" \
"ntsc-1.2:224"

LightNode* sNGameOverLightNode;
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Bg_Haka_Tubo/z_bg_haka_tubo.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ void BgHakaTubo_Idle(BgHakaTubo* this, PlayState* play) {
// Colliding with flame circle
if (this->flamesCollider.base.atFlags & AT_HIT) {
this->flamesCollider.base.atFlags &= ~AT_HIT;
func_8002F71C(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f);
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 5.0f, this->dyna.actor.yawTowardsPlayer, 5.0f);
}
// Colliding with collider inside the pot
if (this->potCollider.base.acFlags & AC_HIT) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ void BgHidanCurtain_Update(Actor* thisx, PlayState* play2) {
} else {
if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
func_8002F71C(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f);
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.yawTowardsPlayer, 1.0f);
}
if ((this->type == 4) || (this->type == 5)) {
this->actor.world.pos.y = (2.0f * this->actor.home.pos.y) - hcParams->riseDist - this->actor.world.pos.y;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void BgHidanFirewall_Collide(BgHidanFirewall* this, PlayState* play) {
phi_a3 = this->actor.shape.rot.y + 0x8000;
}

func_8002F71C(play, &this->actor, 5.0f, phi_a3, 1.0f);
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, phi_a3, 1.0f);
}

void BgHidanFirewall_ColliderFollowPlayer(BgHidanFirewall* this, PlayState* play) {
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Bg_Hidan_Fwbig/z_bg_hidan_fwbig.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void BgHidanFwbig_Update(Actor* thisx, PlayState* play) {

if (this->collider.base.atFlags & AT_HIT) {
this->collider.base.atFlags &= ~AT_HIT;
func_8002F71C(play, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f);
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->actor, 5.0f, this->actor.world.rot.y, 1.0f);
if (this->direction != 0) {
this->actionFunc = BgHidanFwbig_Lower;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void func_8088D750(BgHidanSekizou* this, PlayState* play) {
phi_a3 = -0x4000;
}
}
func_8002F71C(play, &this->dyna.actor, 5.0f, phi_a3, 1.0f);
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 5.0f, phi_a3, 1.0f);
}

void BgHidanSekizou_Update(Actor* thisx, PlayState* play2) {
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Bg_Jya_Goroiwa/z_bg_jya_goroiwa.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void BgJyaGoroiwa_Move(BgJyaGoroiwa* this, PlayState* play) {
thisx->world.rot.y += 0x8000;
}

func_8002F6D4(play, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0);
Actor_SetPlayerKnockbackLarge(play, thisx, 2.0f, thisx->yawTowardsPlayer, 0.0f, 0);
Player_PlaySfx(GET_PLAYER(play), NA_SE_PL_BODY_HIT);

this->yOffsetSpeed = 10.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ void func_8089B4C8(BgJyaZurerukabe* this, PlayState* play) {
case 3:
case 5:
if (fabsf(D_8089B9C0[D_8089BA30[i]]) > 1.0f) {
func_8002F6D4(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0);
Actor_SetPlayerKnockbackLarge(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0);
}
break;
case 1:
case 4:
if (fabsf(D_8089B9C0[D_8089BA30[i]] - D_8089B9C0[D_8089BA30[i + 1]]) > 1.0f) {
func_8002F6D4(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0);
Actor_SetPlayerKnockbackLarge(play, &this->dyna.actor, 1.5f, this->dyna.actor.shape.rot.y, 0.0f, 0);
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Bg_Ydan_Maruta/z_bg_ydan_maruta.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ void BgYdanMaruta_Destroy(Actor* thisx, PlayState* play) {

void func_808BEFF4(BgYdanMaruta* this, PlayState* play) {
if (this->collider.base.atFlags & AT_HIT) {
func_8002F71C(play, &this->dyna.actor, 7.0f, this->dyna.actor.shape.rot.y, 6.0f);
Actor_SetPlayerKnockbackLargeNoDamage(play, &this->dyna.actor, 7.0f, this->dyna.actor.shape.rot.y, 6.0f);
}
this->dyna.actor.shape.rot.x += 0x360;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1485,7 +1485,7 @@ void BossFd_UpdateEffects(BossFd* this, PlayState* play) {
diff.z = player->actor.world.pos.z - effect->pos.z;
if ((this->timers[3] == 0) && (sqrtf(SQ(diff.x) + SQ(diff.y) + SQ(diff.z)) < 20.0f)) {
this->timers[3] = 50;
func_8002F6D4(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30);
Actor_SetPlayerKnockbackLarge(play, NULL, 5.0f, effect->kbAngle, 0.0f, 0x30);
if (!player->bodyIsBurning) {
s16 i2;

Expand Down
2 changes: 1 addition & 1 deletion src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void BossFd2_Emerge(BossFd2* this, PlayState* play) {
case 2:
Math_ApproachS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0);
if ((this->timers[0] == 1) && (this->actor.xzDistToPlayer < 120.0f)) {
func_8002F6D4(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 2.0f, 0x20);
Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.yawTowardsPlayer, 2.0f, 0x20);
Actor_PlaySfx(&player->actor, NA_SE_PL_BODY_HIT);
}
if (Animation_OnFrame(&this->skelAnime, this->fwork[FD2_END_FRAME])) {
Expand Down
7 changes: 4 additions & 3 deletions src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c
Original file line number Diff line number Diff line change
Expand Up @@ -3981,7 +3981,7 @@ void BossGanon_LightBall_Update(Actor* thisx, PlayState* play2) {
} else {
if (sqrtf(SQ(xDistFromLink) + SQ(yDistFromLink) + SQ(zDistFromLink)) <= 25.0f) {
spBA = 5;
func_8002F6D4(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x30);
Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x30);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER);
ganondorf->timers[2] = 20;

Expand Down Expand Up @@ -4453,7 +4453,7 @@ void func_808E2544(Actor* thisx, PlayState* play) {
this->actor.speed = 0.0f;

if (dorf->timers[2] == 0) {
func_8002F6D4(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50);
Actor_SetPlayerKnockbackLarge(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, 0x50);
SfxSource_PlaySfxAtFixedWorldPos(play, &this->actor.world.pos, 40, NA_SE_EN_GANON_HIT_THUNDER);
dorf->timers[2] = 20;

Expand Down Expand Up @@ -4775,7 +4775,8 @@ void BossGanon_UpdateEffects(PlayState* play) {

if (((eff->scale * 150.0f) < distToPlayer) && (distToPlayer < (eff->scale * 300.0f))) {
eff->timer = 150;
func_8002F6D4(play, &sGanondorf->actor, 7.0f, sGanondorf->actor.yawTowardsPlayer, 0.0f, 0x20);
Actor_SetPlayerKnockbackLarge(play, &sGanondorf->actor, 7.0f,
sGanondorf->actor.yawTowardsPlayer, 0.0f, 0x20);
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,8 @@ void func_80902348(BossGanon2* this, PlayState* play) {
phi_v0_2 = 0;
}

func_8002F6D4(play, &this->actor, 15.0f, this->actor.yawTowardsPlayer + phi_v0_2, 2.0f, 0);
Actor_SetPlayerKnockbackLarge(play, &this->actor, 15.0f, this->actor.yawTowardsPlayer + phi_v0_2, 2.0f,
0);
sZelda->unk_3C8 = 8;
this->unk_316 = 10;
break;
Expand All @@ -1874,7 +1875,7 @@ void func_80902348(BossGanon2* this, PlayState* play) {
}

player->bodyIsBurning = true;
func_8002F6D4(play, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10);
Actor_SetPlayerKnockbackLarge(play, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10);
sZelda->unk_3C8 = 8;
}
}
Expand Down
Loading