Add support for destroying enemy carryalls

This commit is contained in:
abcdefg30
2020-03-17 15:24:00 +01:00
committed by reaperrr
parent b580b4fd33
commit 3d69363f35
2 changed files with 6 additions and 0 deletions

View File

@@ -82,6 +82,10 @@ TriggerCarryallReinforcements = function(triggeringPlayer, reinforcingPlayer, ar
end)
end
DestroyCarryalls = function(player)
Utils.Do(player.GetActorsByType("carryall"), function(actor) actor.Kill() end)
end
-- Used for the AI:
IdlingUnits = { }

View File

@@ -182,6 +182,7 @@ Tick = function()
if not player.IsObjectiveCompleted(KillAtreides) and atreides.HasNoRequiredUnits() then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat")
player.MarkCompletedObjective(KillAtreides)
DestroyCarryalls(atreides)
if player.IsObjectiveCompleted(KillHarkonnen) then
player.MarkCompletedObjective(GuardStarport)
@@ -191,6 +192,7 @@ Tick = function()
if not player.IsObjectiveCompleted(KillHarkonnen) and harkonnen.HasNoRequiredUnits() then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat")
player.MarkCompletedObjective(KillHarkonnen)
DestroyCarryalls(harkonnen)
if player.IsObjectiveCompleted(KillAtreides) then
player.MarkCompletedObjective(GuardStarport)