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

Function zEntPickup_SceneUpdate

src/SB/Game/zEntPickup.cpp:1449–1563  ·  view source on GitHub ↗

wip

Source from the content-addressed store, hash-verified

1447
1448// wip
1449void zEntPickup_SceneUpdate(F32 dt)
1450{
1451 if (zGameIsPaused())
1452 {
1453 return;
1454 }
1455
1456 xMat3x3RMulRotY((xMat3x3*)&sPickupOrientation, (xMat3x3*)&sPickupOrientation, PI * dt);
1457
1458 sPickupOrientation.flags = rwMATRIXTYPEORTHONORMAL;
1459
1460 if (globals.player.Health >= globals.player.MaxHealth)
1461 {
1462 if (sUnderwearFade > 0.35f)
1463 {
1464 sUnderwearFade -= 0.5f * dt;
1465
1466 if (sUnderwearFade < 0.35f)
1467 {
1468 sUnderwearFade = 0.35f;
1469 }
1470 }
1471 }
1472 else
1473 {
1474 if (sUnderwearFade < 1.0f)
1475 {
1476 sUnderwearFade += 0.5f * dt;
1477
1478 if (sUnderwearFade > 1.0f)
1479 {
1480 sUnderwearFade = 1.0f;
1481 }
1482 }
1483 }
1484
1485 for (S32 i = 0; i < REWARD_COUNT; i++)
1486 {
1487 if (sRewards[i].active && (!sRewards[i].currRequest || 0.0f == sRewards[i].timer))
1488 {
1489 sRewards[i].timer = 0.2f;
1490
1491 U32 ret = rewardRequest(sRewards[i].pickups[sRewards[i].currRequest], sRewards[i].ppos,
1492 sRewards[i].pos);
1493
1494 if (!ret)
1495 {
1496 switch (sRewards[i].pickups[sRewards[i].currRequest])
1497 {
1498 case SHINY_PURPLE:
1499 {
1500 globals.player.Inv_Shiny += globals.player.g.ShinyValuePurple;
1501 break;
1502 }
1503 case SHINY_BLUE:
1504 {
1505 globals.player.Inv_Shiny += globals.player.g.ShinyValueBlue;
1506 break;

Callers 1

zSceneUpdateFunction · 0.70

Calls 7

zGameIsPausedFunction · 0.85
memsetFunction · 0.85
xEntGetPosFunction · 0.85
xEntShowFunction · 0.85
zEntPickup_DoPickupFunction · 0.85
rewardRequestFunction · 0.70
xMat3x3RMulRotYFunction · 0.50

Tested by

no test coverage detected