From 3c106ac107c4a3603216beed60437abea2d323c7 Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Thu, 26 Jun 2025 22:02:32 +0200 Subject: [PATCH] Reevaluate player knockback types names --- include/player.h | 16 +++++----- src/code/z_actor.c | 4 +-- .../actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c | 2 +- .../actors/ovl_En_Torch2/z_en_torch2.c | 4 +-- .../actors/ovl_player_actor/z_player.c | 30 +++++++++---------- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/player.h b/include/player.h index 63c9d25b65..d9c7a05322 100644 --- a/include/player.h +++ b/include/player.h @@ -643,17 +643,17 @@ typedef enum PlayerStickDirection { /* 3 */ PLAYER_STICK_DIR_RIGHT } PlayerStickDirection; -typedef enum PlayerKnockbackType { - /* 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_ELECTRIFIED // Same as`PLAYER_KNOCKBACK_LARGE` with a shock effect -} PlayerKnockbackType; +typedef enum PlayerKnockType { + /* 0 */ PLAYER_KNOCK_NONE, // No knockback + /* 1 */ PLAYER_KNOCK_BACK, // A small hop, remains standing up + /* 2 */ PLAYER_KNOCK_DOWN, // Sent flying in the air and lands laying down on the floor + /* 3 */ PLAYER_KNOCK_DOWN_ELECTRIFIED // Same as`PLAYER_KNOCK_DOWN` with a shock effect +} PlayerKnockType; typedef enum PlayerHitResponseType { /* 0 */ PLAYER_HIT_RESPONSE_NONE, - /* 1 */ PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, - /* 2 */ PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL, + /* 1 */ PLAYER_HIT_RESPONSE_KNOCK_DOWN, + /* 2 */ PLAYER_HIT_RESPONSE_KNOCK_BACK, /* 3 */ PLAYER_HIT_RESPONSE_FROZEN, /* 4 */ PLAYER_HIT_RESPONSE_ELECTRIFIED } PlayerHitResponseType; diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 7501925080..732c7b30f4 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -1983,7 +1983,7 @@ void Actor_SetPlayerKnockback(PlayState* play, Actor* actor, f32 speed, s16 rot, * @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); + Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCK_DOWN, damage); } /** @@ -2010,7 +2010,7 @@ void Actor_SetPlayerKnockbackLargeNoDamage(PlayState* play, Actor* actor, f32 sp * @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); + Actor_SetPlayerKnockback(play, actor, speed, rot, yVelocity, PLAYER_KNOCK_BACK, damage); } /** diff --git a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c index e594e42291..8fa00b70f8 100644 --- a/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c +++ b/src/overlays/actors/ovl_En_Fhg_Fire/z_en_fhg_fire.c @@ -550,7 +550,7 @@ void EnFhgFire_EnergyBall(EnFhgFire* this, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EN_FANTOM_LAUGH); } Actor_SetPlayerKnockback(play, &this->actor, 3.0f, this->actor.world.rot.y, 0.0f, - PLAYER_KNOCKBACK_LARGE_ELECTRIFIED, 0x10); + PLAYER_KNOCK_DOWN_ELECTRIFIED, 0x10); } break; case FHGFIRE_LIGHT_BLUE: diff --git a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c index 9d54250bcd..c9e1e8eed9 100644 --- a/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c +++ b/src/overlays/actors/ovl_En_Torch2/z_en_torch2.c @@ -602,7 +602,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { if (!Actor_ApplyDamage(&this->actor)) { func_800F5B58(); this->actor.flags &= ~(ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE); - this->knockbackType = PLAYER_KNOCKBACK_LARGE; + this->knockbackType = PLAYER_KNOCK_DOWN; this->knockbackSpeed = 6.0f; this->knockbackYVelocity = 6.0f; this->knockbackDamage = this->actor.colChkInfo.damage; @@ -623,7 +623,7 @@ void EnTorch2_Update(Actor* thisx, PlayState* play2) { } else { this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED; this->knockbackDamage = this->actor.colChkInfo.damage; - this->knockbackType = PLAYER_KNOCKBACK_SMALL; + this->knockbackType = PLAYER_KNOCK_BACK; this->knockbackYVelocity = 6.0f; this->knockbackSpeed = 8.0f; this->knockbackRot = this->actor.yawTowardsPlayer + 0x8000; diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c index ff7fbb1b3e..50645ba6e9 100644 --- a/src/overlays/actors/ovl_player_actor/z_player.c +++ b/src/overlays/actors/ovl_player_actor/z_player.c @@ -4673,8 +4673,8 @@ void func_80837C0C(PlayState* play, Player* this, s32 hitResponseType, f32 speed anim = &gPlayerAnim_link_swimer_swim_hit; Player_PlayVoiceSfx(this, NA_SE_VO_LI_DAMAGE_S); - } else if ((hitResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE) || - (hitResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) || + } else if ((hitResponseType == PLAYER_HIT_RESPONSE_KNOCK_DOWN) || + (hitResponseType == PLAYER_HIT_RESPONSE_KNOCK_BACK) || !(this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) || (this->stateFlags1 & (PLAYER_STATE1_13 | PLAYER_STATE1_14 | PLAYER_STATE1_21))) { Player_SetupAction(play, this, Player_Action_8084377C, 0); @@ -4684,7 +4684,7 @@ void func_80837C0C(PlayState* play, Player* this, s32 hitResponseType, f32 speed Player_RequestRumble(this, 255, 20, 150, 0); func_80832224(this); - if (hitResponseType == PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL) { + if (hitResponseType == PLAYER_HIT_RESPONSE_KNOCK_BACK) { this->av2.actionVar2 = 4; this->actor.speed = 3.0f; @@ -4857,17 +4857,17 @@ s32 func_808382DC(Player* this, PlayState* play) { Player_PlayVoiceSfx(this, NA_SE_VO_LI_TAKEN_AWAY); play->haltAllActors = true; Sfx_PlaySfxCentered(NA_SE_OC_ABYSS); - } else if ((this->knockbackType != PLAYER_KNOCKBACK_NONE) && - ((this->knockbackType >= PLAYER_KNOCKBACK_LARGE) || (this->invincibilityTimer == 0))) { + } else if ((this->knockbackType != PLAYER_KNOCK_NONE) && + ((this->knockbackType >= PLAYER_KNOCK_DOWN) || (this->invincibilityTimer == 0))) { u8 knockbackResponse[] = { - PLAYER_HIT_RESPONSE_KNOCKBACK_SMALL, - PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, - PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, + PLAYER_HIT_RESPONSE_KNOCK_BACK, + PLAYER_HIT_RESPONSE_KNOCK_DOWN, + PLAYER_HIT_RESPONSE_KNOCK_DOWN, }; func_80838280(this); - if (this->knockbackType == PLAYER_KNOCKBACK_LARGE_ELECTRIFIED) { + if (this->knockbackType == PLAYER_KNOCK_DOWN_ELECTRIFIED) { this->bodyShockTimer = 40; } @@ -4943,7 +4943,7 @@ s32 func_808382DC(Player* this, PlayState* play) { } else if (this->actor.colChkInfo.acHitSpecialEffect == HIT_SPECIAL_EFFECT_ELECTRIC) { sp4C = PLAYER_HIT_RESPONSE_ELECTRIFIED; } else if (this->actor.colChkInfo.acHitSpecialEffect == HIT_SPECIAL_EFFECT_KNOCKBACK) { - sp4C = PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE; + sp4C = PLAYER_HIT_RESPONSE_KNOCK_DOWN; } else { func_80838280(this); sp4C = PLAYER_HIT_RESPONSE_NONE; @@ -9302,7 +9302,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) { func_808382BC(this); if (!(this->stateFlags1 & PLAYER_STATE1_29) && (this->av2.actionVar2 == 0) && - (this->knockbackType != PLAYER_KNOCKBACK_NONE)) { + (this->knockbackType != PLAYER_KNOCK_NONE)) { s16 temp = this->actor.shape.rot.y - this->knockbackRot; this->yaw = this->actor.shape.rot.y = this->knockbackRot; @@ -9325,7 +9325,7 @@ void Player_Action_8084377C(Player* this, PlayState* play) { func_80853080(this, play); } } else if ((this->stateFlags1 & PLAYER_STATE1_29) || - (!(this->cylinder.base.acFlags & AC_HIT) && (this->knockbackType == PLAYER_KNOCKBACK_NONE))) { + (!(this->cylinder.base.acFlags & AC_HIT) && (this->knockbackType == PLAYER_KNOCK_NONE))) { if (this->stateFlags1 & PLAYER_STATE1_29) { this->av2.actionVar2++; } else { @@ -9790,7 +9790,7 @@ void Player_Action_80844A44(Player* this, PlayState* play) { if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) { this->actor.colChkInfo.damage = 0x10; - func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 4.0f, 5.0f, this->actor.shape.rot.y, 20); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCK_DOWN, 4.0f, 5.0f, this->actor.shape.rot.y, 20); } } @@ -10616,7 +10616,7 @@ void Player_StartMode_Grotto(PlayState* play, Player* this) { } void Player_StartMode_KnockedOver(PlayState* play, Player* this) { - func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCKBACK_LARGE, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0); + func_80837C0C(play, this, PLAYER_HIT_RESPONSE_KNOCK_DOWN, 2.0f, 2.0f, this->actor.shape.rot.y + 0x8000, 0); } void Player_StartMode_WarpSong(PlayState* play, Player* this) { @@ -12030,7 +12030,7 @@ void Player_UpdateCommon(Player* this, PlayState* play, Input* input) { temp_f0 = this->actor.world.pos.y - this->actor.prevPos.y; this->doorType = PLAYER_DOORTYPE_NONE; - this->knockbackType = PLAYER_KNOCKBACK_NONE; + this->knockbackType = PLAYER_KNOCK_NONE; this->autoLockOnActor = NULL; phi_f12 =