Use global difficulty.

This commit is contained in:
Matthias Mailänder
2021-10-10 22:06:03 +02:00
committed by abcdefg30
parent 58b105f0d4
commit d42edfc0b9
70 changed files with 241 additions and 279 deletions

View File

@@ -92,7 +92,7 @@ ProduceInfantry = function()
Greece.Build({ Utils.Random(AlliedInfantry) }, function(units)
table.insert(AttackGroup, units[1])
SendAttackGroup()
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry)
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry)
end)
end
@@ -104,7 +104,7 @@ ProduceVehicles = function()
Greece.Build({ Utils.Random(AlliedVehicles[AlliedVehicleType]) }, function(units)
table.insert(AttackGroup, units[1])
SendAttackGroup()
Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles)
Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles)
end)
end
@@ -120,7 +120,7 @@ BringDDPatrol = function(patrolPath)
if GreeceNavalYard.IsDead then
return
else
if Map.LobbyOption("difficulty") == "easy" then
if Difficulty == "easy" then
Trigger.AfterDelay(DateTime.Minutes(7), function() BringDDPatrol(patrolPath) end)
else
Trigger.AfterDelay(DateTime.Minutes(4), function() BringDDPatrol(patrolPath) end)
@@ -130,9 +130,8 @@ BringDDPatrol = function(patrolPath)
end
ActivateAI = function()
local difficulty = Map.LobbyOption("difficulty")
WTransUnits = WTransUnits[difficulty]
WTransDelays = WTransDelays[difficulty]
WTransUnits = WTransUnits[Difficulty]
WTransDelays = WTransDelays[Difficulty]
local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == Greece and self.HasProperty("StartBuildingRepairs") end)
Utils.Do(buildings, function(actor)