MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / ufoShotDown

Method ufoShotDown

src/Savegame/AlienMission.cpp:493–510  ·  view source on GitHub ↗

* This function is called when one of the mission's UFOs is shot down (crashed or destroyed). * Currently the only thing that happens is delaying the next UFO in the mission sequence. * @param ufo The UFO that was shot down. * @param engine The game engine, unused for now. * @param globe The earth globe, unused for now. */

Source from the content-addressed store, hash-verified

491 * @param globe The earth globe, unused for now.
492 */
493void AlienMission::ufoShotDown(Ufo &ufo, Game &, const Globe &)
494{
495 switch (ufo.getStatus())
496 {
497 case Ufo::FLYING:
498 case Ufo::LANDED:
499 assert(0 && "Ufo seems ok!");
500 break;
501 case Ufo::CRASHED:
502 case Ufo::DESTROYED:
503 if (_nextWave != _rule.getWaveCount())
504 {
505 // Delay next wave
506 _spawnCountdown += 30 * (RNG::generate(0, 48) + 400);
507 }
508 break;
509 }
510}
511
512/**
513 * This function is called when one of the mission's UFOs has finished it's time on the ground.

Callers 1

moveMethod · 0.80

Calls 3

generateFunction · 0.85
getWaveCountMethod · 0.80
getStatusMethod · 0.45

Tested by

no test coverage detected