<- CRPL reference <- Utility Commands

DestroyAllEnemyUnits

Arguments Result Notation
Explosion Mode (0,1,2,3) n1--

Description

Destroys enemy units such as emitters and spore towers. These are the units the player needs to destroy to win the level. Thus the command ends the level in victory, and is the opposite of FailMission.

Note that if the map contains uncollected tech artifacts, the level will not end until the player collects them even if this command is called.

Examples

End the level in victory:

# Destroy any uncollected tech artifacts.
GetAllUnitsInRange(0 0 9999 1) 0 do
	->unit
	if(GetUnitType(<-unit) "TECHARTIFACT" eq) Destroy(<-unit 0) endif
loop
DestroyAllEnemyUnits(0)