diff --git a/mods/cnc/maps/gdi04a/gdi04a.lua b/mods/cnc/maps/gdi04a/gdi04a.lua index 61e5d2122e..9dfe0f91e1 100644 --- a/mods/cnc/maps/gdi04a/gdi04a.lua +++ b/mods/cnc/maps/gdi04a/gdi04a.lua @@ -18,6 +18,7 @@ HeliDelay = { 83, 137, 211 } GDIReinforcements = { "e2", "e2", "e2", "e2", "e2" } GDIReinforcementsWaypoints = { GDIReinforcementsEntry.Location, GDIReinforcementsWP1.Location } +GDIReinforcementsLeft = 3 NodHelis = { @@ -49,8 +50,15 @@ SendGDIReinforcements = function() Media.PlaySpeechNotification(GDI, "Reinforce") Reinforcements.ReinforceWithTransport(GDI, "apc", GDIReinforcements, GDIReinforcementsWaypoints, nil, function(apc, team) table.insert(team, apc) - Trigger.OnAllKilled(team, function() Trigger.AfterDelay(DateTime.Seconds(5), SendGDIReinforcements) end) - Utils.Do(team, function(unit) unit.Stance = "Defend" end) + Trigger.OnAllKilled(team, function() + if GDIReinforcementsLeft > 0 then + GDIReinforcementsLeft = GDIReinforcementsLeft - 1 + Trigger.AfterDelay(DateTime.Seconds(5), function() + Media.DisplayMessage("APC squads in reserve: " .. GDIReinforcementsLeft, "Battlefield Control") + SendGDIReinforcements() + end) + end + end) end) end @@ -81,8 +89,8 @@ end Tick = function() Nod.Cash = 1000 - if GDI.HasNoRequiredUnits() then - Trigger.AfterDelay(DateTime.Seconds(1), function() GDI.MarkFailedObjective(GDIObjective) end) + if (GDIReinforcementsLeft == 0 or not GDI.IsObjectiveCompleted(ReinforcementsObjective)) and GDI.HasNoRequiredUnits() then + GDI.MarkFailedObjective(GDIObjective) end end diff --git a/mods/cnc/maps/gdi04b/gdi04b.lua b/mods/cnc/maps/gdi04b/gdi04b.lua index 30c1085a46..22132c3f53 100644 --- a/mods/cnc/maps/gdi04b/gdi04b.lua +++ b/mods/cnc/maps/gdi04b/gdi04b.lua @@ -21,6 +21,7 @@ KillsUntilReinforcements = 12 GDIReinforcements = { "e2", "e2", "e2", "e2", "e2" } GDIReinforcementsWaypoints = { GDIReinforcementsEntry.Location, GDIReinforcementsWP1.Location } +GDIReinforcementsLeft = 3 NodHeli = { { HeliEntry.Location, NodHeliLZ.Location }, { "e1", "e1", "e3", "e3" } } @@ -46,7 +47,15 @@ SendGDIReinforcements = function() Media.PlaySpeechNotification(GDI, "Reinforce") Reinforcements.ReinforceWithTransport(GDI, "apc", GDIReinforcements, GDIReinforcementsWaypoints, nil, function(apc, team) table.insert(team, apc) - Trigger.OnAllKilled(team, function() Trigger.AfterDelay(DateTime.Seconds(5), SendGDIReinforcements) end) + Trigger.OnAllKilled(team, function() + if GDIReinforcementsLeft > 0 then + GDIReinforcementsLeft = GDIReinforcementsLeft - 1 + Trigger.AfterDelay(DateTime.Seconds(5), function() + Media.DisplayMessage("APC squads in reserve: " .. GDIReinforcementsLeft, "Battlefield Control") + SendGDIReinforcements() + end) + end + end) end) end @@ -70,10 +79,8 @@ end Tick = function() Nod.Cash = 1000 - if GDI.HasNoRequiredUnits() then - Trigger.AfterDelay(DateTime.Seconds(1), function() - GDI.MarkFailedObjective(gdiObjective) - end) + if (GDIReinforcementsLeft == 0 or not GDI.IsObjectiveCompleted(ReinforcementsObjective)) and GDI.HasNoRequiredUnits() then + GDI.MarkFailedObjective(GDIObjective) end end