Require silos to be captured or destroyed in GDI02.

This commit is contained in:
Paul Chote
2014-10-26 10:30:25 +13:00
parent 6f7d20681b
commit 99c0d8bd53
2 changed files with 12 additions and 3 deletions

View File

@@ -88,6 +88,15 @@ WorldLoaded = function()
gdiObjective1 = player.AddPrimaryObjective("Eliminate all Nod forces in the area")
gdiObjective2 = player.AddSecondaryObjective("Capture the Tiberium Refinery")
-- Work around limitations with the yaml merger that prevent MustBeDestroyed from working on the silos
siloARemoved = false
Trigger.OnCapture(SiloA, function() siloARemoved = true end)
Trigger.OnKilled(SiloA, function() siloARemoved = true end)
siloBRemoved = false
Trigger.OnCapture(SiloB, function() siloBRemoved = true end)
Trigger.OnKilled(SiloB, function() siloBRemoved = true end)
Trigger.OnCapture(NodRefinery, function() player.MarkCompletedObjective(gdiObjective2) end)
Trigger.OnKilled(NodRefinery, function() player.MarkFailedObjective(gdiObjective2) end)
@@ -98,7 +107,7 @@ Tick = function()
if player.HasNoRequiredUnits() then
enemy.MarkCompletedObjective(nodObjective)
end
if enemy.HasNoRequiredUnits() then
if enemy.HasNoRequiredUnits() and siloARemoved and siloBRemoved then
player.MarkCompletedObjective(gdiObjective1)
end
end

View File

@@ -302,12 +302,12 @@ Actors:
Owner: GDI
Health: 0.34375
Facing: 0
Actor79: silo
SiloA: silo
Location: 57,32
Owner: Nod
Health: 1
Facing: 0
Actor80: silo
SiloB: silo
Location: 59,32
Owner: Nod
Health: 1