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

Method UpdateDiscreet

src/SB/Game/zNPCSpawner.cpp:188–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void zNPCSpawner::UpdateDiscreet(F32 dt)
189{
190 SMSPStatus* spstat = NULL;
191
192 switch (wavestat)
193 {
194 case SM_STAT_BEGIN:
195 FillPending();
196
197 if (pendlist.cnt > 0)
198 {
199 wavestat = SM_STAT_INPROG;
200 zEntEvent(npc_owner, eEventDuploWaveBegin);
201
202 flg_spawner &= ~0x20;
203 }
204
205 tmr_wave = tym_delay;
206
207 break;
208 case SM_STAT_INPROG:
209 if (pendlist.cnt < 1)
210 {
211 wavestat = SM_STAT_MARKTIME;
212 }
213 else if (max_spawn > 0 && !(cnt_spawn < max_spawn))
214 {
215 wavestat = SM_STAT_ABORT;
216 }
217 else if (tmr_wave < 0.0f)
218 {
219 SMNPCStatus* npcstat = NextPendingNPC(0);
220 if (npcstat != NULL)
221 {
222 spstat = SelectSP(npcstat);
223 }
224
225 if (!(spstat == NULL))
226 {
227 SpawnBeastie(npcstat, spstat);
228 }
229
230 tmr_wave = tym_delay * (0.25f * (xurand() - 0.5f)) + tym_delay;
231 }
232
233 break;
234 case SM_STAT_MARKTIME:
235 if (actvlist.cnt < 1)
236 {
237 wavestat = SM_STAT_DONE;
238 }
239 else if (max_spawn > 0 && !(cnt_spawn < max_spawn))
240 {
241 wavestat = SM_STAT_ABORT;
242 }
243
244 break;
245 case SM_STAT_ABORT:

Callers

nothing calls this directly

Calls 4

SelectSPFunction · 0.85
SpawnBeastieFunction · 0.85
xurandFunction · 0.85
zEntEventFunction · 0.50

Tested by

no test coverage detected