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

Function zCombo_Update

src/SB/Game/zCombo.cpp:185–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

183}
184
185void zCombo_Update(F32 dt)
186{
187 xVec3Copy(&sUnderCamPos, &globals.camera.mat.pos);
188 xVec3AddScaled(&sUnderCamPos, &globals.camera.mat.up, -3.0f);
189
190 S32 toShow = comboCounter;
191 if (comboCounter >= 16)
192 {
193 toShow = 15;
194 }
195
196 zComboReward* c = &comboReward[toShow];
197
198 if (comboLastCounter != comboCounter && c->reward != 0)
199 {
200 if (comboHUD != NULL)
201 {
202 strcpy(comboHUD->w.text, xTextAssetGetText(c->textAsset));
203 comboHUD->w.show();
204 }
205 comboLastCounter = comboCounter;
206 }
207
208 for (S32 i = 0; i < 5; i++)
209 {
210 if (sHideText[i] != NULL && sHideText[i]->visible())
211 {
212 comboHUD->w.text[0] = '\0';
213 break;
214 }
215 }
216
217 if (sHideUIF != NULL && xEntIsVisible(sHideUIF))
218 {
219 comboHUD->w.text[0] = '\0';
220 }
221
222 if (comboTimer >= 0.0f)
223 {
224 comboTimer -= dt;
225
226 if (comboTimer < 0.0f)
227 {
228 if (c->reward > 0)
229 {
230 zEntPickup_SpawnNRewards(c->rewardList, c->rewardNum, &sUnderCamPos);
231
232 switch (toShow)
233 {
234 case 5:
235 zEntPlayer_SNDPlayStreamRandom(0, 1, ePlayerStreamSnd_Combo1,
236 ePlayerStreamSnd_Combo2, 0.1f);
237 break;
238 case 6:
239 case 7:
240 zEntPlayer_SNDPlayStreamRandom(0, 2, ePlayerStreamSnd_Combo1,
241 ePlayerStreamSnd_Combo2, 0.1f);
242 break;

Callers 1

zSceneUpdateFunction · 0.70

Calls 10

xVec3CopyFunction · 0.85
xVec3AddScaledFunction · 0.85
xEntIsVisibleFunction · 0.85
zEntPlayer_SNDPlayStreamFunction · 0.85
add_motiveMethod · 0.80
zEntPickup_SpawnNRewardsFunction · 0.70
motiveClass · 0.50
showMethod · 0.45
visibleMethod · 0.45

Tested by

no test coverage detected