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

Function zEntPickup_GiveAllRewardsNow

src/SB/Game/zEntPickup.cpp:1008–1085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1006}
1007
1008void zEntPickup_GiveAllRewardsNow()
1009{
1010 zEntPickup* ent;
1011 U32 i, j;
1012
1013 for (i = 0; i < REWARD_TYPE_COUNT; i++)
1014 {
1015 for (j = 0; j < REWARD_PICKUP_COUNT; j++)
1016 {
1017 ent = rewardPickups[i][j];
1018
1019 if (ent)
1020 {
1021 xEntHide(ent);
1022
1023 if (ent->state & 0x4)
1024 {
1025 zEntPickup_GivePickup(ent);
1026 }
1027
1028 ent->state = (ent->state & ~0x3f) | 0x8;
1029 ent->timer = 10.0f;
1030 ent->model->Mat->pos.x = ent->asset->pos.x;
1031 ent->model->Mat->pos.y = ent->asset->pos.y;
1032 ent->model->Mat->pos.z = ent->asset->pos.z;
1033 }
1034 }
1035 }
1036
1037 U32 total = 0;
1038
1039 for (i = 0; i < REWARD_COUNT; i++)
1040 {
1041 if (sRewards[i].active)
1042 {
1043 for (j = 0; j < sRewards[i].num; j++)
1044 {
1045 switch (sRewards[i].pickups[j])
1046 {
1047 case SHINY_PURPLE:
1048 {
1049 total += globals.player.g.ShinyValuePurple;
1050 break;
1051 }
1052 case SHINY_BLUE:
1053 {
1054 total += globals.player.g.ShinyValueBlue;
1055 break;
1056 }
1057 case SHINY_GREEN:
1058 {
1059 total += globals.player.g.ShinyValueGreen;
1060 break;
1061 }
1062 case SHINY_YELLOW:
1063 {
1064 total += globals.player.g.ShinyValueYellow;
1065 break;

Callers 1

zEntTeleportBox_UpdateFunction · 0.70

Calls 3

xEntHideFunction · 0.85
zEntPickup_GivePickupFunction · 0.85
memsetFunction · 0.85

Tested by

no test coverage detected