Merge pull request #12842 from abc013/Allies06SubFix

Allies 06a: Make the AI only build submarines if the player has a shipyard
This commit is contained in:
Paul Chote
2017-03-15 20:12:18 +00:00
committed by GitHub
2 changed files with 18 additions and 3 deletions

View File

@@ -107,6 +107,13 @@ ProduceVehicles = function()
end
ProduceNaval = function()
if not shouldProduce and #Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == player and self.Type == "syrd" end) < 1 then
Trigger.AfterDelay(DateTime.Minutes(1), ProduceNaval)
return
end
shouldProduce = true
if SubPen.IsDead or SubPen.Owner ~= ussr then
return
end

View File

@@ -110,7 +110,6 @@ CaptureRadarDome = function()
end)
end
infiltrated = false
InfiltrateTechCenter = function()
Utils.Do(SovietTechLabs, function(a)
Trigger.OnInfiltrated(a, function()
@@ -127,9 +126,15 @@ InfiltrateTechCenter = function()
end)
Proxy.Destroy()
end)
Trigger.OnCapture(a, function()
if not infiltrated then
Media.DisplayMessage("Do not capture the tech centers! Infiltrate one with a spy.")
end
end)
end)
Trigger.OnAllKilled(SovietTechLabs, function()
Trigger.OnAllKilledOrCaptured(SovietTechLabs, function()
if not player.IsObjectiveCompleted(InfiltrateTechCenterObj) then
player.MarkFailedObjective(InfiltrateTechCenterObj)
end
@@ -140,6 +145,9 @@ InfiltrateRef = function()
Trigger.OnInfiltrated(Refinery, function()
player.MarkCompletedObjective(InfiltrateRefObj)
end)
Trigger.OnCapture(Refinery, function()
player.MarkCompletedObjective(InfiltrateRefObj)
end)
Trigger.OnKilled(Refinery, function()
if not player.IsObjectiveCompleted(InfiltrateRefObj) then
player.MarkFailedObjective(InfiltrateRefObj)
@@ -180,7 +188,7 @@ WorldLoaded = function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
InfiltrateTechCenterObj = player.AddPrimaryObjective("Infiltrate one of the Soviet tech centers.")
InfiltrateTechCenterObj = player.AddPrimaryObjective("Infiltrate one of the Soviet tech centers with a spy.")
CaptureRadarDomeObj = player.AddSecondaryObjective("Capture the Radar Dome at the shore.")
InfiltrateRefObj = player.AddSecondaryObjective("Infiltrate the Refinery for money.")