Enable Battle Music for Leever option + Modularize EnemyBGMDisable (#5985)

Add "Enable Enemy Proximity Music for Leever" option + Modularize EnemyBGMDisable
This commit is contained in:
nclok1405
2026-01-06 00:07:05 +09:00
committed by GitHub
parent 392bb6c59f
commit 7c4a3359f0
6 changed files with 70 additions and 4 deletions

View File

@@ -3571,9 +3571,12 @@ void func_800328D4(PlayState* play, ActorContext* actorCtx, Player* player, u32
// This block below is for determining the closest actor to player in determining the volume
// used while playing enemy bgm music
if ((actorCategory == ACTORCAT_ENEMY) &&
CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) &&
(actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sbgmEnemyDistSq)) {
if (GameInteractor_Should(
VB_DETECT_BGM_ENEMY,
(actorCategory == ACTORCAT_ENEMY) &&
CHECK_FLAG_ALL(actor->flags, ACTOR_FLAG_ATTENTION_ENABLED | ACTOR_FLAG_HOSTILE) &&
(actor->xyzDistToPlayerSq < SQ(500.0f)) && (actor->xyzDistToPlayerSq < sbgmEnemyDistSq),
actor, &sbgmEnemyDistSq, (int32_t)actorCategory)) {
actorCtx->targetCtx.bgmEnemy = actor;
sbgmEnemyDistSq = actor->xyzDistToPlayerSq;
}