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

Method SDS_StartExplode

src/SB/Game/zNPCGoalDuplotron.cpp:220–268  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218}
219
220void zNPCGoalDuploLive::SDS_StartExplode()
221{
222 zNPCDuplotron* npc = (zNPCDuplotron*)psyche->clt_owner;
223
224 xScrFXGlareAdd(xEntGetCenter(npc), 1.5f, 0.4f, 10.0f, 1.0f, 1.0f, 0.75f, 1.0f, NULL);
225
226 NPCHazard* haz;
227
228 haz = HAZ_Acquire();
229
230 if (!haz)
231 {
232 return;
233 }
234
235 haz->ConfigHelper(NPC_HAZ_DUPLOBOOM);
236 haz->SetNPCOwner(npc);
237 haz->Start(xEntGetCenter(npc), -1.0f);
238
239 haz = HAZ_Acquire();
240
241 if (!haz)
242 {
243 return;
244 }
245
246 haz->ConfigHelper(NPC_HAZ_DUPLOBOOM);
247 haz->flg_hazard &= ~0x2000;
248 haz->SetNPCOwner(npc);
249 haz->custdata.typical.rad_max *= 0.5f;
250 haz->Start(xEntGetCenter(npc), -1.0f);
251
252 haz = HAZ_Acquire();
253
254 if (!haz)
255 {
256 return;
257 }
258
259 haz->ConfigHelper(NPC_HAZ_DUPLO_SHROOM);
260 haz->Start(xEntGetCenter(npc), -1.0f);
261
262 if (npc->explosion && npc->explosion->initCB)
263 {
264 npc->explosion->initCB(npc->explosion, npc->model, NULL, NULL);
265 }
266
267 npc->GiveReward();
268}

Callers

nothing calls this directly

Calls 7

xEntGetCenterFunction · 0.85
ConfigHelperMethod · 0.80
SetNPCOwnerMethod · 0.80
StartMethod · 0.80
GiveRewardMethod · 0.80
HAZ_AcquireFunction · 0.70
xScrFXGlareAddFunction · 0.50

Tested by

no test coverage detected