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

Method Upd_BoneFlight

src/SB/Game/zNPCHazard.cpp:1339–1402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1337}
1338
1339void NPCHazard::Upd_BoneFlight(F32 dt)
1340{
1341 HAZTarTar* tartar = &this->custdata.tartar;
1342 xParabola* parab = &tartar->parabinfo;
1343
1344 if (this->tmr_remain < dt)
1345 {
1346 if (this->flg_hazard & 0x20000)
1347 {
1348 xParabolaEvalPos(parab, &this->pos_hazard, parab->maxTime);
1349 if (!(this->flg_hazard & 0x40000))
1350 {
1351 ReconArfBone();
1352 return;
1353 }
1354 else
1355 {
1356 MarkForRecycle();
1357 return;
1358 }
1359 }
1360 else
1361 {
1362 MarkForRecycle();
1363 return;
1364 }
1365 }
1366
1367 if (this->flg_hazard & 0x8)
1368 {
1369 xVec3Sub(&tartar->vel, &tartar->pos_tgt, &this->pos_hazard);
1370 xVec3SMulBy(&tartar->vel, 1.0f / this->tmr_remain);
1371
1372 tartar->vel.y += 0.5f * this->tmr_remain * 0.5f;
1373 }
1374
1375 if (this->flg_hazard & 0x8)
1376 {
1377 PreCollide();
1378 }
1379
1380 F32 tym = tym_lifespan - tmr_remain;
1381 xParabolaEvalPos(parab, &this->pos_hazard, tym);
1382 xParabolaEvalVel(parab, &tartar->vel, tym);
1383
1384 static S32 moreorless = 0;
1385 if (--moreorless < 0)
1386 {
1387 moreorless = 3;
1388 zFX_SpawnBubbleTrail(&this->pos_hazard, 0x1);
1389 }
1390
1391 if (this->flg_hazard & 0x2000)
1392 {
1393 if (!(globals.player.DamageTimer > 0.0f) && ColPlyrSphere(tartar->rad_cur))
1394 {
1395 HurtThePlayer();
1396 MarkForRecycle();

Callers

nothing calls this directly

Calls 7

xParabolaEvalPosFunction · 0.85
xVec3SubFunction · 0.85
xVec3SMulByFunction · 0.85
xParabolaEvalVelFunction · 0.85
StaggeredCollideFunction · 0.85
zFX_SpawnBubbleTrailFunction · 0.70
PreCollideFunction · 0.50

Tested by

no test coverage detected