MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / SndPlayRandom

Method SndPlayRandom

src/SB/Game/zNPCTypeCommon.cpp:3063–3083  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3061}
3062
3063S32 zNPCCommon::SndPlayRandom(en_NPC_SOUND sndtype)
3064{
3065 U32 xsid;
3066 NPCConfig* cfg;
3067 NPCSndProp* sprop;
3068 U32 aidToPlay;
3069
3070 xsid = 0;
3071 cfg = this->cfg_npc;
3072
3073 if (NPCS_SndOkToPlay(sndtype))
3074 {
3075 sprop = NPCS_SndFindProps(sndtype);
3076 aidToPlay = NPCS_SndPickSimilar(sndtype, cfg->snd_trax, cfg->snd_traxShare);
3077 if (aidToPlay != 0)
3078 {
3079 xsid = this->SndStart(aidToPlay, sprop, cfg->rad_sound);
3080 }
3081 }
3082 return (-xsid | xsid) >> 0x1f;
3083}
3084
3085U32 zNPCCommon::SndStart(U32 aid_toplay, NPCSndProp* sprop, F32 radius)
3086{

Callers 15

ProcessMethod · 0.80
SDS_CountdownMethod · 0.80
EnterMethod · 0.80
ProcessMethod · 0.80
DetonateMethod · 0.80
BombzAwayMethod · 0.80
DieTheGoodDeathMethod · 0.80
MaryAttackMethod · 0.80
ExitMethod · 0.80
zNPCTiki_ExplodeFXFunction · 0.80
ProcessMethod · 0.80
thunderCountCBFunction · 0.80

Calls 4

SndStartMethod · 0.95
NPCS_SndOkToPlayFunction · 0.85
NPCS_SndFindPropsFunction · 0.70
NPCS_SndPickSimilarFunction · 0.70

Tested by

no test coverage detected