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

Method Upd_TubeletBlast

src/SB/Game/zNPCHazard.cpp:530–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530void NPCHazard::Upd_TubeletBlast(F32 dt)
531{
532 HAZBall* ball = &this->custdata.ball;
533 ball->rad_cur = LERP(this->pam_interp, ball->rad_min, ball->rad_max);
534
535 if (this->flg_hazard & 0x2000 && !(globals.player.DamageTimer > 0.0f))
536 {
537 if (ColPlyrSphere(ball->rad_cur))
538 {
539 HurtThePlayer();
540 }
541 }
542
543 if (this->flg_hazard & 0x8)
544 {
545 xSndPlay3D(xStrHash(""), 0.77f, 0.0f, 0x80, 0x0, &this->pos_hazard, 1.0f, 20.0f,
546 SND_CAT_GAME, 0.0f);
547 }
548
549 static S32 moreorless = 0;
550
551 if (--moreorless < 0)
552 {
553 moreorless = 3;
554
555 xVec3 vel_emit = { 0.0f, 0.0f, 0.0f };
556 vel_emit.x = 2.0f * (xurand() - 5.0f);
557 vel_emit.y = xurand();
558 vel_emit.z = 2.0f * (xurand() - 5.0f);
559 vel_emit *= 8.0f;
560
561 xVec3 pos_emit = this->pos_hazard;
562 pos_emit.x += 2.0f * (xurand() - 0.5f) * ball->rad_cur;
563 pos_emit.y += 2.0f * (xurand() - 0.5f) * ball->rad_cur;
564 pos_emit.z += 2.0f * (xurand() - 0.5f) * ball->rad_cur;
565
566 NPAR_EmitTubeSparklies(&pos_emit, &vel_emit);
567 }
568}
569
570void NPCHazard::Upd_DuploBoom(F32 dt)
571{

Callers

nothing calls this directly

Calls 5

LERPFunction · 0.85
xurandFunction · 0.85
NPAR_EmitTubeSparkliesFunction · 0.85
xSndPlay3DFunction · 0.70
xStrHashFunction · 0.50

Tested by

no test coverage detected