| 183 | } |
| 184 | |
| 185 | void 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; |
no test coverage detected