diff --git a/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn-AI.lua b/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn-AI.lua index 2ebb10a3d4..9df1680a5c 100644 --- a/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn-AI.lua +++ b/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn-AI.lua @@ -100,6 +100,7 @@ GroundWavesDelays = normal = 3, hard = 2 } +GroundWavesDelay = GroundWavesDelays[Difficulty] GroundWaves = function() if not ForwardCommand.IsDead then @@ -107,7 +108,7 @@ GroundWaves = function() local units = Reinforcements.Reinforce(BadGuy, Utils.Random(GroundAttackUnits), path) Utils.Do(units, IdleHunt) - Trigger.AfterDelay(DateTime.Minutes(GroundWavesDelays), GroundWaves) + Trigger.AfterDelay(DateTime.Minutes(GroundWavesDelay), GroundWaves) end end @@ -132,8 +133,6 @@ ProduceAircraft = function() end ActivateAI = function() - GroundWavesDelays = GroundWavesDelays[Difficulty] - local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) Trigger.OnDamaged(actor, function(building) @@ -146,6 +145,6 @@ ActivateAI = function() ProduceBadGuyInfantry() ProduceUSSRInfantry() ProduceVehicles() - Trigger.AfterDelay(DateTime.Minutes(GroundWavesDelays), GroundWaves) + Trigger.AfterDelay(DateTime.Minutes(GroundWavesDelay), GroundWaves) Trigger.AfterDelay(DateTime.Minutes(5), ProduceAircraft) end diff --git a/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn.lua b/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn.lua index 9d0538f6a1..a137849c7a 100644 --- a/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn.lua +++ b/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn.lua @@ -66,14 +66,21 @@ SetupTriggers = function() Trigger.OnAllKilledOrCaptured(SarinPlants, function() Greece.MarkCompletedObjective(CaptureSarin) end) + + Trigger.OnEnteredProximityTrigger(AlliesMove.CenterPosition, WDist.FromCells(3), function(actor, id) + if actor.Owner == Greece then + Trigger.RemoveProximityTrigger(id) + Media.PlaySpeechNotification(Greece, "SignalFlareSouth") + end + end) end MCVArrived = false MCVArrivedTick = false PowerDownTeslas = function() if not MCVArrived then - CaptureSarin = Greece.AddObjective("capture-sarin-plants-intact") - KillBase = Greece.AddObjective("destroy-enemy-compound") + CaptureSarin = AddPrimaryObjective(Greece, "capture-sarin-plants-intact") + KillBase = AddPrimaryObjective(Greece, "destroy-enemy-compound") Greece.MarkCompletedObjective(TakeOutPower) Media.PlaySpeechNotification(Greece, "ReinforcementsArrived") Reinforcements.Reinforce(Greece, MCVReinforcements[Difficulty], { AlliesSpawn.Location, AlliesMove.Location }) @@ -85,6 +92,7 @@ PowerDownTeslas = function() Trigger.AfterDelay(DateTime.Seconds(1), function() MCVArrivedTick = true + PrepareFinishingHunt(USSR) end) Trigger.AfterDelay(DateTime.Seconds(60), function() @@ -99,6 +107,25 @@ PowerDownTeslas = function() end end +PrepareFinishingHunt = function(player) + local buildings = GetBaseBuildings(player) + + Trigger.OnAllKilledOrCaptured(buildings, function() + Utils.Do(player.GetGroundAttackers(), function(actor) + actor.Stop() + IdleHunt(actor) + end) + end) +end + +GetBaseBuildings = function(player) + -- Excludes the unrepairable sarin plants, which is desired anyway. + local buildings = Utils.Where(player.GetActors(), function(actor) + return actor.HasProperty("StartBuildingRepairs") + end) + return buildings +end + Tick = function() USSR.Cash = 10000 BadGuy.Cash = 10000 diff --git a/mods/ra/maps/sarin-gas-3-controlled-burn/rules.yaml b/mods/ra/maps/sarin-gas-3-controlled-burn/rules.yaml index 7e89e13573..a319d5096a 100644 --- a/mods/ra/maps/sarin-gas-3-controlled-burn/rules.yaml +++ b/mods/ra/maps/sarin-gas-3-controlled-burn/rules.yaml @@ -19,6 +19,9 @@ Player: PlayerResources: DefaultCash: 7500 +HARV: + -MustBeDestroyed: + APC: Buildable: Prerequisites: ~vehicles.allies