Document ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT (#2276)

* name ACTOR_FLAG_HIT_PLAYER_THUMP_SFX

* ACTOR_FLAG_HIT_PLAYER_THUMP_SFX -> ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT
This commit is contained in:
fig02 2024-10-20 22:29:50 -04:00 committed by GitHub
parent e55e909477
commit f4210323a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 32 additions and 32 deletions

View File

@ -188,8 +188,8 @@ typedef struct ActorShape {
// Typically an actor can only be thrown when moving, but this allows an actor to be thrown when standing still.
#define ACTOR_FLAG_THROW_ONLY (1 << 23)
//
#define ACTOR_FLAG_24 (1 << 24)
// When colliding with Player's body AC collider, a "thump" sound will play indicating his body has been hit
#define ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT (1 << 24)
// Actor can update even if Player is currently using the ocarina.
// Typically an actor will halt while the ocarina is active (depending on category).

View File

@ -2426,7 +2426,7 @@ void Actor_UpdateAll(PlayState* play, ActorContext* actorCtx) {
actor->xyzDistToPlayerSq = SQ(actor->xzDistToPlayer) + SQ(actor->yDistToPlayer);
actor->yawTowardsPlayer = Actor_WorldYawTowardActor(actor, &player->actor);
actor->flags &= ~ACTOR_FLAG_24;
actor->flags &= ~ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
if ((DECR(actor->freezeTimer) == 0) && (actor->flags & (ACTOR_FLAG_4 | ACTOR_FLAG_6))) {
if (actor == player->focusActor) {

View File

@ -730,7 +730,7 @@ void BossDodongo_Roll(BossDodongo* this, PlayState* play) {
f32 sp4C;
f32 sp48;
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
SkelAnime_Update(&this->skelAnime);
if (this->unk_1DA == 10) {

View File

@ -687,7 +687,7 @@ void BossFd_Fly(BossFd* this, PlayState* play) {
}
break;
case BOSSFD_FLY_CHASE:
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
temp_y = Math_SinS(this->work[BFD_MOVE_TIMER] * 2396.0f) * 30.0f + this->fwork[BFD_TARGET_Y_OFFSET];
this->targetPosition.x = player->actor.world.pos.x;
this->targetPosition.y = player->actor.world.pos.y + temp_y + 30.0f;

View File

@ -1296,7 +1296,7 @@ void BossGoma_FloorPrepareAttack(BossGoma* this, PlayState* play) {
void BossGoma_FloorAttack(BossGoma* this, PlayState* play) {
s16 i;
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
SkelAnime_Update(&this->skelanime);
switch (this->actionState) {

View File

@ -630,7 +630,7 @@ void BossMo_Tentacle(BossMo* this, PlayState* play) {
}
break;
case MO_TENT_ATTACK:
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
Sfx_PlaySfxAtPos(&this->tentTipPos, NA_SE_EN_MOFER_ATTACK - SFX_FLAG);
Math_ApproachF(&this->waterLevelMod, -5.0f, 0.1f, 0.4f);
for (indS1 = 0; indS1 < 41; indS1++) {

View File

@ -590,7 +590,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
switch (this->actor.params) {
case BOSSVA_BODY:
SkelAnime_Init(play, &this->skelAnime, &gBarinadeBodySkel, &gBarinadeBodyAnim, NULL, NULL, 0);
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
break;
case BOSSVA_SUPPORT_1:
case BOSSVA_SUPPORT_2:
@ -609,7 +609,7 @@ void BossVa_Init(Actor* thisx, PlayState* play2) {
SkelAnime_InitFlex(play, &this->skelAnime, &gBarinadeStumpSkel, &gBarinadeStumpAnim, NULL, NULL, 0);
break;
default:
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
SkelAnime_Init(play, &this->skelAnime, &gBarinadeBariSkel, &gBarinadeBariAnim, NULL, NULL, 0);
this->actor.shape.yOffset = 400.0f;
break;

View File

@ -8,7 +8,7 @@
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/objects/object_Bb/object_Bb.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_24)
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT)
#define vBombHopPhase actionVar1
#define vTrailIdx actionVar1

View File

@ -785,7 +785,7 @@ void EnBigokuta_Update(Actor* thisx, PlayState* play2) {
for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->cylinder[i].base);
}
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
} else {
for (i = 0; i < ARRAY_COUNT(this->cylinder); i++) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->cylinder[i].base);

View File

@ -435,7 +435,7 @@ void func_809CF8F0(EnBw* this) {
this->unk_222 = 1000;
this->actor.velocity.y = 11.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_STAL_JUMP);
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
EnBw_SetupAction(this, func_809CF984);
}
@ -465,7 +465,7 @@ void func_809CF984(EnBw* this, PlayState* play) {
}
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos, 30.0f, 11, 4.0f, 0, 0, false);
this->unk_222 = 3000;
this->actor.flags &= ~ACTOR_FLAG_24;
this->actor.flags &= ~ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
this->actor.speed = 0.0f;
Actor_PlaySfx(&this->actor, NA_SE_EN_DODO_M_GND);
EnBw_SetupAction(this, func_809CE884);

View File

@ -1132,7 +1132,7 @@ void EnDekubaba_Update(Actor* thisx, PlayState* play) {
}
if (this->actionFunc == EnDekubaba_Lunge) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
}
if (this->collider.base.acFlags & AC_ON) {

View File

@ -535,7 +535,7 @@ void EnDodojr_Stunned(EnDodojr* this, PlayState* play) {
}
void EnDodojr_JumpAttackBounce(EnDodojr* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
Actor_UpdateVelocityXZGravity(&this->actor);
if (EnDodojr_UpdateBounces(this, play)) {

View File

@ -461,7 +461,7 @@ void EnFd_Init(Actor* thisx, PlayState* play) {
Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colSphs);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0xF), &sColChkInit);
this->actor.flags &= ~ACTOR_FLAG_ATTENTION_ENABLED;
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
Actor_SetScale(&this->actor, 0.01f);
this->firstUpdateFlag = true;
this->actor.gravity = -1.0f;

View File

@ -1047,7 +1047,7 @@ void EnFloormas_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_4);
Collider_UpdateCylinder(&this->actor, &this->collider);
if (this->actionFunc == EnFloormas_Charge) {
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if (this->actionFunc != EnFloormas_GrabLink) {

View File

@ -888,7 +888,7 @@ s32 func_80A44AB0(EnGo2* this, PlayState* play) {
if (this->collider.base.acFlags & AC_HIT) {
Audio_PlaySfxGeneral(NA_SE_SY_CORRECT_CHIME, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
this->actor.flags &= ~ACTOR_FLAG_24;
this->actor.flags &= ~ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
this->collider.base.acFlags &= ~AC_HIT;
EnGo2_StopRolling(this, play);
return true;
@ -1349,7 +1349,7 @@ void EnGo2_SetupRolling(EnGo2* this, PlayState* play) {
} else {
this->actor.speed = 6.0f;
}
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
this->animTimer = 10;
this->actor.shape.yOffset = 1800.0f;
this->actor.speed *= 2.0f; // Speeding up

View File

@ -498,7 +498,7 @@ void EnGoma_SetupJump(EnGoma* this) {
}
void EnGoma_Jump(EnGoma* this, PlayState* play) {
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
SkelAnime_Update(&this->skelanime);
Math_ApproachF(&this->actor.speed, 10.0f, 0.5f, 5.0f);

View File

@ -156,7 +156,7 @@ void EnNutsball_Update(Actor* thisx, PlayState* play) {
UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
Collider_UpdateCylinder(&this->actor, &this->collider);
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View File

@ -624,7 +624,7 @@ void EnOkuta_Update(Actor* thisx, PlayState* play2) {
this->collider.dim.radius = sOctorockColliderInit.dim.radius * this->actor.scale.x * 100.0f;
}
if (this->actor.params == 0x10) {
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if (this->actionFunc != EnOkuta_WaitToAppear) {

View File

@ -3,7 +3,7 @@
#include "overlays/actors/ovl_En_Bom/z_en_bom.h"
#include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h"
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_24)
#define FLAGS (ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_4 | ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT)
#define GROUND_HOVER_HEIGHT 75.0f
#define MAX_LARVA 3

View File

@ -1216,7 +1216,7 @@ void EnPoSisters_Update(Actor* thisx, PlayState* play) {
this->unk_198 = CLAMP_MIN(temp, 1);
}
if (this->actionFunc == func_80ADA8C0) {
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
}
if (this->unk_199 & 1) {

View File

@ -996,7 +996,7 @@ void EnPoh_UpdateLiving(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
Actor_MoveXZGravity(&this->actor);
if (this->actionFunc == EnPoh_Attack && this->unk_198 < 10) {
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderSph.base);
}
Collider_UpdateCylinder(&this->actor, &this->colliderCyl);

View File

@ -799,7 +799,7 @@ void EnSt_Init(Actor* thisx, PlayState* play) {
}
EnSt_CheckCeilingPos(this, play);
this->actor.flags |= ACTOR_FLAG_14;
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
EnSt_SetColliderScale(this);
this->actor.gravity = 0.0f;
this->initialYaw = this->actor.world.rot.y;

View File

@ -288,7 +288,7 @@ void EnTite_Attack(EnTite* this, PlayState* play) {
case TEKTITE_MID_LUNGE:
// Continue trajectory until tektite has negative velocity and has landed on ground/water surface
// Snap to ground/water surface, or if falling fast dip into the water and slow fall speed
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
if ((this->actor.bgCheckFlags & (BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH)) ||
((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER))) {
if (this->actor.velocity.y <= 0.0f) {
@ -571,7 +571,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) {
} else {
this->actor.velocity.y = 10.0f;
this->actor.speed = 4.0f;
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
this->actor.gravity = -1.0f;
if ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP_WATER);
@ -582,7 +582,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) {
} else {
this->actor.velocity.y = 10.0f;
this->actor.speed = 4.0f;
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
this->actor.gravity = -1.0f;
if ((this->actor.params == TEKTITE_BLUE) && (this->actor.bgCheckFlags & BGCHECKFLAG_WATER)) {
Actor_PlaySfx(&this->actor, NA_SE_EN_TEKU_JUMP_WATER);
@ -593,7 +593,7 @@ void EnTite_MoveTowardPlayer(EnTite* this, PlayState* play) {
// If in midair:
} else {
// Turn slowly toward player
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 1, 1000, 0);
if (this->actor.velocity.y >= 6.0f) {
if (this->actor.bgCheckFlags & BGCHECKFLAG_GROUND) {

View File

@ -134,7 +134,7 @@ void EnYukabyun_Update(Actor* thisx, PlayState* play) {
Actor_UpdateBgCheckInfo(play, &this->actor, 5.0f, 20.0f, 8.0f, UPDBGCHECKINFO_FLAG_0 | UPDBGCHECKINFO_FLAG_2);
Collider_UpdateCylinder(&this->actor, &this->collider);
this->actor.flags |= ACTOR_FLAG_24;
this->actor.flags |= ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT;
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View File

@ -4911,7 +4911,7 @@ s32 func_808382DC(Player* this, PlayState* play) {
Actor* ac = this->cylinder.base.ac;
s32 sp4C;
if (ac->flags & ACTOR_FLAG_24) {
if (ac->flags & ACTOR_FLAG_SFX_FOR_PLAYER_BODY_HIT) {
Player_PlaySfx(this, NA_SE_PL_BODY_HIT);
}