From d42edfc0b99aac72f4fc6c9776a4ad1b4fda9cf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 10 Oct 2021 22:06:03 +0200 Subject: [PATCH] Use global difficulty. --- mods/cnc/maps/funpark01/scj01ea.lua | 2 +- mods/cnc/maps/gdi05a/gdi05a.lua | 1 - mods/cnc/maps/gdi05c/gdi05c.lua | 2 -- mods/cnc/maps/gdi06/gdi06.lua | 1 - mods/cnc/maps/gdi08b/gdi08b.lua | 2 -- mods/cnc/maps/nod06a/nod06a.lua | 1 - mods/cnc/maps/nod06b/nod06b.lua | 1 - mods/cnc/maps/nod09/nod09.lua | 1 - mods/cnc/maps/nod10a/nod10a.lua | 1 - mods/cnc/maps/nod10b/nod10b.lua | 1 - mods/ra/maps/allies-02/allies02.lua | 8 +++---- mods/ra/maps/allies-03a/allies03a.lua | 2 +- mods/ra/maps/allies-03b/allies03b.lua | 2 +- mods/ra/maps/allies-04/allies04-AI.lua | 5 ++-- mods/ra/maps/allies-04/allies04.lua | 9 ++++---- mods/ra/maps/allies-05a/allies05a-AI.lua | 2 +- mods/ra/maps/allies-05a/allies05a.lua | 12 +++++----- mods/ra/maps/allies-05b/allies05b-AI.lua | 6 ++--- mods/ra/maps/allies-05b/allies05b.lua | 4 ++-- mods/ra/maps/allies-05c/allies05c-AI.lua | 6 ++--- mods/ra/maps/allies-05c/allies05c.lua | 8 +++---- mods/ra/maps/allies-06a/allies06a-AI.lua | 11 ++++----- mods/ra/maps/allies-06a/allies06a.lua | 6 ++--- mods/ra/maps/allies-06b/allies06b-AI.lua | 11 ++++----- mods/ra/maps/allies-06b/allies06b.lua | 8 +++---- mods/ra/maps/allies-07/allies07-AI.lua | 11 ++++----- mods/ra/maps/allies-07/allies07.lua | 6 ++--- mods/ra/maps/allies-08a/allies08a-AI.lua | 15 ++++++------ mods/ra/maps/allies-08b/allies08b-AI.lua | 15 ++++++------ mods/ra/maps/allies-09a/allies09a-AI.lua | 15 ++++++------ mods/ra/maps/ant-01/ant-01.lua | 1 - mods/ra/maps/ant-01/ant-attack.lua | 13 +++++------ mods/ra/maps/ant-03/ant-03-AI.lua | 3 +-- mods/ra/maps/evacuation/evacuation.lua | 16 ++++++------- mods/ra/maps/exodus/exodus.lua | 1 - .../personal-war.lua | 12 +++++----- .../evacuation-AI.lua | 6 ++--- .../evacuation.lua | 5 ++-- mods/ra/maps/fort-lonestar/fort-lonestar.lua | 12 +++++----- mods/ra/maps/fort-lonestar/rules.yaml | 2 +- mods/ra/maps/infiltration/infiltration.lua | 1 - mods/ra/maps/intervention/intervention.lua | 3 +-- .../production-disruption.lua | 2 +- .../sarin-gas-1-crackdown/crackdown-AI.lua | 9 ++++---- .../maps/sarin-gas-1-crackdown/crackdown.lua | 3 +-- .../maps/sarin-gas-2-down-under/downunder.lua | 6 ++--- .../controlledburn-AI.lua | 15 ++++++------ .../controlledburn.lua | 4 ++-- .../fresh-tracks.lua | 11 ++++----- .../wasteland-AI.lua | 19 ++++++++------- mods/ra/maps/soviet-03/soviet03.lua | 10 ++++---- .../soviet04a-reinforcements_teams.lua | 6 ++--- mods/ra/maps/soviet-04a/soviet04a.lua | 6 ++--- .../soviet04b-reinforcements_teams.lua | 6 ++--- mods/ra/maps/soviet-04b/soviet04b.lua | 6 ++--- .../soviet05-reinforcements_teams.lua | 18 +++++++-------- mods/ra/maps/soviet-05/soviet05.lua | 10 ++++---- .../soviet06a-reinforcements_teams.lua | 6 ++--- .../soviet06b-reinforcements_teams.lua | 6 ++--- mods/ra/maps/soviet-07/soviet07.lua | 8 +++---- mods/ra/maps/soviet-08a/soviet08a-AI.lua | 11 ++++----- mods/ra/maps/soviet-08b/soviet08b-AI.lua | 13 +++++------ mods/ra/maps/soviet-09/soviet09-AI.lua | 13 +++++------ mods/ra/maps/soviet-10/soviet10.lua | 9 ++++---- mods/ra/maps/soviet-11a/soviet11a-AI.lua | 23 +++++++++---------- mods/ra/maps/soviet-11b/soviet11b-AI.lua | 23 +++++++++---------- .../soviet-soldier-volkov-n-chitzkoi-AI.lua | 8 +++---- .../soviet-soldier-volkov-n-chitzkoi.lua | 8 +++---- mods/ra/maps/survival01/survival01.lua | 1 - .../maps/top-o-the-world/top-o-the-world.lua | 10 ++++---- 70 files changed, 241 insertions(+), 279 deletions(-) diff --git a/mods/cnc/maps/funpark01/scj01ea.lua b/mods/cnc/maps/funpark01/scj01ea.lua index b198722018..2b7ffc2654 100644 --- a/mods/cnc/maps/funpark01/scj01ea.lua +++ b/mods/cnc/maps/funpark01/scj01ea.lua @@ -46,7 +46,7 @@ WorldLoaded = function() Trigger.AfterDelay(DateTime.Seconds(3), function() InitialUnitsArrived = true end) Trigger.AfterDelay(DateTime.Seconds(15), function() ReinforceWithLandingCraft(Nod, BazookaReinforcments, SeaEntryB.Location, BeachReinforceB.Location, BeachReinforceB.Location) end) - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Trigger.AfterDelay(DateTime.Seconds(25), function() ReinforceWithLandingCraft(Nod, BikeReinforcments, SeaEntryA.Location, BeachReinforceA.Location, BeachReinforceA.Location) end) Trigger.AfterDelay(DateTime.Seconds(30), function() ReinforceWithLandingCraft(Nod, BikeReinforcments, SeaEntryB.Location, BeachReinforceB.Location, BeachReinforceB.Location) end) end diff --git a/mods/cnc/maps/gdi05a/gdi05a.lua b/mods/cnc/maps/gdi05a/gdi05a.lua index fe1f79d6e1..45715ad1a9 100644 --- a/mods/cnc/maps/gdi05a/gdi05a.lua +++ b/mods/cnc/maps/gdi05a/gdi05a.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") RepairThreshold = { easy = 0.3, normal = 0.6, hard = 0.9 } diff --git a/mods/cnc/maps/gdi05c/gdi05c.lua b/mods/cnc/maps/gdi05c/gdi05c.lua index d4312229ad..a5d22cf490 100644 --- a/mods/cnc/maps/gdi05c/gdi05c.lua +++ b/mods/cnc/maps/gdi05c/gdi05c.lua @@ -7,8 +7,6 @@ information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") - RepairThreshold = { easy = 0.3, normal = 0.6, hard = 0.9 } ActorRemovals = diff --git a/mods/cnc/maps/gdi06/gdi06.lua b/mods/cnc/maps/gdi06/gdi06.lua index 0b4f9158e4..6d848b3524 100644 --- a/mods/cnc/maps/gdi06/gdi06.lua +++ b/mods/cnc/maps/gdi06/gdi06.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") IslandSamSites = { SAM01, SAM02 } NodBase = { PowerPlant1, PowerPlant2, PowerPlant3, PowerPlant4, PowerPlant5, Refinery, HandOfNod, Silo1, Silo2, Silo3, Silo4, ConYard, CommCenter } diff --git a/mods/cnc/maps/gdi08b/gdi08b.lua b/mods/cnc/maps/gdi08b/gdi08b.lua index f27e432c02..d01e9a4737 100644 --- a/mods/cnc/maps/gdi08b/gdi08b.lua +++ b/mods/cnc/maps/gdi08b/gdi08b.lua @@ -7,8 +7,6 @@ information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") - SamSites = { sam1, sam2, sam3, sam4, sam5 } NodRetaliateIfDestroyedUnits = { harv1, bggy, ltnk1, ltnk2, ltnk3, arty1, arty2, arty3} diff --git a/mods/cnc/maps/nod06a/nod06a.lua b/mods/cnc/maps/nod06a/nod06a.lua index d7126752bc..7b35d497da 100644 --- a/mods/cnc/maps/nod06a/nod06a.lua +++ b/mods/cnc/maps/nod06a/nod06a.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") NodStartUnitsRight = { diff --git a/mods/cnc/maps/nod06b/nod06b.lua b/mods/cnc/maps/nod06b/nod06b.lua index 5349acc45b..0d913d6f0d 100644 --- a/mods/cnc/maps/nod06b/nod06b.lua +++ b/mods/cnc/maps/nod06b/nod06b.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") NodUnitsVehicle1 = { diff --git a/mods/cnc/maps/nod09/nod09.lua b/mods/cnc/maps/nod09/nod09.lua index f9015f6764..b0796db1d0 100644 --- a/mods/cnc/maps/nod09/nod09.lua +++ b/mods/cnc/maps/nod09/nod09.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") if Difficulty == "easy" then Rambo = "rmbo.easy" diff --git a/mods/cnc/maps/nod10a/nod10a.lua b/mods/cnc/maps/nod10a/nod10a.lua index 28b81eb1dd..22eb007924 100644 --- a/mods/cnc/maps/nod10a/nod10a.lua +++ b/mods/cnc/maps/nod10a/nod10a.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") if Difficulty == "easy" then Rambo = "rmbo.easy" diff --git a/mods/cnc/maps/nod10b/nod10b.lua b/mods/cnc/maps/nod10b/nod10b.lua index b911475678..e7f3e01f08 100644 --- a/mods/cnc/maps/nod10b/nod10b.lua +++ b/mods/cnc/maps/nod10b/nod10b.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") if Difficulty == "easy" then Rambo = "rmbo.easy" diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index 7dbcaabb2b..7a3d7cf221 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -21,16 +21,16 @@ SovietBase = { SovietConyard, SovietRefinery, SovietPower1, SovietPower2, Soviet IdlingUnits = { } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then DateTime.TimeLimit = DateTime.Minutes(10) + DateTime.Seconds(3) -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then DateTime.TimeLimit = DateTime.Minutes(5) + DateTime.Seconds(3) InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" } InfantryDelay = DateTime.Seconds(18) AttackGroupSize = 5 -elseif Map.LobbyOption("difficulty") == "hard" then +elseif Difficulty == "hard" then DateTime.TimeLimit = DateTime.Minutes(3) + DateTime.Seconds(3) InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" } InfantryDelay = DateTime.Seconds(10) @@ -141,7 +141,7 @@ SendAttack = function() end Utils.Do(units, function(unit) - if Map.LobbyOption("difficulty") ~= "tough" then + if Difficulty ~= "tough" then unit.AttackMove(DeployPoint.Location) end Trigger.OnIdle(unit, unit.Hunt) diff --git a/mods/ra/maps/allies-03a/allies03a.lua b/mods/ra/maps/allies-03a/allies03a.lua index 3aefad22b5..f49d41044d 100644 --- a/mods/ra/maps/allies-03a/allies03a.lua +++ b/mods/ra/maps/allies-03a/allies03a.lua @@ -17,7 +17,7 @@ WaterTransportTriggerArea = { CPos.New(39, 54), CPos.New(40, 54), CPos.New(41, 5 ParadropTriggerArea = { CPos.New(81, 60), CPos.New(82, 60), CPos.New(83, 60), CPos.New(63, 63), CPos.New(64, 63), CPos.New(65, 63), CPos.New(66, 63), CPos.New(67, 63), CPos.New(68, 63), CPos.New(69, 63), CPos.New(70, 63), CPos.New(71, 63), CPos.New(72, 63) } ReinforcementsTriggerArea = { CPos.New(96, 55), CPos.New(97, 55), CPos.New(97, 56), CPos.New(98, 56) } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then TanyaType = "e7" else TanyaType = "e7.noautotarget" diff --git a/mods/ra/maps/allies-03b/allies03b.lua b/mods/ra/maps/allies-03b/allies03b.lua index d4b9a4702d..7881108e2e 100644 --- a/mods/ra/maps/allies-03b/allies03b.lua +++ b/mods/ra/maps/allies-03b/allies03b.lua @@ -28,7 +28,7 @@ GuardTanks = { Heavy1, Heavy2, Heavy3 } CheckpointGuards = { USSRCheckpointGuard1, USSRCheckpointGuard2 } CheckpointGuardWaypoints = { CheckpointGuardWaypoint1, CheckpointGuardWaypoint2 } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then TanyaType = "e7" else TanyaType = "e7.noautotarget" diff --git a/mods/ra/maps/allies-04/allies04-AI.lua b/mods/ra/maps/allies-04/allies04-AI.lua index 9deb53eafe..0dd5fc1ebf 100644 --- a/mods/ra/maps/allies-04/allies04-AI.lua +++ b/mods/ra/maps/allies-04/allies04-AI.lua @@ -246,9 +246,8 @@ ActivateAI = function() InitAIUnits() ProtectHarvester(Harvester) - local difficulty = Map.LobbyOption("difficulty") - AttackDelay = AttackDelays[difficulty] - AttackGroupSize = AttackGroupSizes[difficulty] + AttackDelay = AttackDelays[Difficulty] + AttackGroupSize = AttackGroupSizes[Difficulty] Trigger.AfterDelay(DateTime.Seconds(10), function() ProduceInfantry() ProduceVehicles() diff --git a/mods/ra/maps/allies-04/allies04.lua b/mods/ra/maps/allies-04/allies04.lua index 3ed2e8214b..d0075e5466 100644 --- a/mods/ra/maps/allies-04/allies04.lua +++ b/mods/ra/maps/allies-04/allies04.lua @@ -65,7 +65,7 @@ Paradrop = function() end) Paradropped = Paradropped + 1 - if Paradropped <= ParadropWaves[Map.LobbyOption("difficulty")] then + if Paradropped <= ParadropWaves[Difficulty] then Paradrop() end end) @@ -114,7 +114,7 @@ SendConvoys = function() Trigger.RemoveFootprintTrigger(id) ConvoysSent = ConvoysSent + 1 - if ConvoysSent <= Convoys[Map.LobbyOption("difficulty")] then + if ConvoysSent <= Convoys[Difficulty] then SendConvoys() else player.MarkCompletedObjective(DestroyConvoys) @@ -173,9 +173,8 @@ WorldLoaded = function() InitObjectives() - local difficulty = Map.LobbyOption("difficulty") - ConvoyDelay = ConvoyDelays[difficulty] - ParadropDelay = ParadropDelays[difficulty] + ConvoyDelay = ConvoyDelays[Difficulty] + ParadropDelay = ParadropDelays[Difficulty] PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr }) Paradrop() SendConvoys() diff --git a/mods/ra/maps/allies-05a/allies05a-AI.lua b/mods/ra/maps/allies-05a/allies05a-AI.lua index df2338d7fd..3c001b4fc2 100644 --- a/mods/ra/maps/allies-05a/allies05a-AI.lua +++ b/mods/ra/maps/allies-05a/allies05a-AI.lua @@ -164,7 +164,7 @@ InitProductionBuildings = function() end) end - if Map.LobbyOption("difficulty") ~= "easy" then + if Difficulty ~= "easy" then if not Airfield1.IsDead then Trigger.OnKilled(Airfield1, function() diff --git a/mods/ra/maps/allies-05a/allies05a.lua b/mods/ra/maps/allies-05a/allies05a.lua index 1420183526..b435c59ee9 100644 --- a/mods/ra/maps/allies-05a/allies05a.lua +++ b/mods/ra/maps/allies-05a/allies05a.lua @@ -7,12 +7,12 @@ information, see COPYING. ]] -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then TanyaType = "e7" ReinforceCash = 5000 HoldAITime = DateTime.Minutes(3) SpecialCameras = true -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then TanyaType = "e7.noautotarget" ReinforceCash = 2250 HoldAITime = DateTime.Minutes(2) @@ -89,7 +89,7 @@ Tick = function() end if ussr.HasNoRequiredUnits() then - if not greece.IsObjectiveCompleted(KillAll) and Map.LobbyOption("difficulty") == "tough" then + if not greece.IsObjectiveCompleted(KillAll) and Difficulty == "tough" then SendWaterExtraction() end greece.MarkCompletedObjective(KillAll) @@ -191,7 +191,7 @@ FreeTanya = function() Trigger.OnKilled(Tanya, function() ussr.MarkCompletedObjective(ussrObj) end) - if Map.LobbyOption("difficulty") == "tough" then + if Difficulty == "tough" then KillSams = greece.AddObjective("Destroy all four SAM Sites that block\nour reinforcements' helicopter.") greece.MarkCompletedObjective(mainObj) @@ -316,7 +316,7 @@ InitTriggers = function() end end) - if Map.LobbyOption("difficulty") ~= "tough" then + if Difficulty ~= "tough" then Trigger.OnKilled(Mammoth, function() Trigger.AfterDelay(HoldAITime - DateTime.Seconds(45), function() HoldProduction = false end) Trigger.AfterDelay(HoldAITime, function() Attacking = true end) @@ -342,7 +342,7 @@ InitTriggers = function() Trigger.AfterDelay(DateTime.Seconds(7), flare.Destroy) Media.PlaySpeechNotification(greece, "SignalFlare") - if Map.LobbyOption("difficulty") == "tough" then + if Difficulty == "tough" then Reinforcements.ReinforceWithTransport(greece, InsertionHeliType, HeliReinforcements, ExtractionPath, { ExtractionPath[1] }) if not Harvester.IsDead then Harvester.FindResources() diff --git a/mods/ra/maps/allies-05b/allies05b-AI.lua b/mods/ra/maps/allies-05b/allies05b-AI.lua index 07c388bf93..a7a4a694ea 100644 --- a/mods/ra/maps/allies-05b/allies05b-AI.lua +++ b/mods/ra/maps/allies-05b/allies05b-AI.lua @@ -44,7 +44,7 @@ ProduceUSSRInfantry = function() USSR.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry) end) end @@ -56,7 +56,7 @@ ProduceUSSRVehicles = function() USSR.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRVehicles) end) end @@ -73,7 +73,7 @@ ProduceAircraft = function() local alive = Utils.Where(Planes, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(plane, Greece) diff --git a/mods/ra/maps/allies-05b/allies05b.lua b/mods/ra/maps/allies-05b/allies05b.lua index 85fd166ea2..474836c8f7 100644 --- a/mods/ra/maps/allies-05b/allies05b.lua +++ b/mods/ra/maps/allies-05b/allies05b.lua @@ -413,12 +413,12 @@ WorldLoaded = function() SendSpy() ChurchFootprint() - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then TanyaType = "e7" ReinforceCash = 5000 USSR.Cash = 8000 SpecialCameras = true - elseif Map.LobbyOption("difficulty") == "normal" then + elseif Difficulty == "normal" then TanyaType = "e7.noautotarget" ReinforceCash = 2250 USSR.Cash = 15000 diff --git a/mods/ra/maps/allies-05c/allies05c-AI.lua b/mods/ra/maps/allies-05c/allies05c-AI.lua index 2807506fc5..a52b95371d 100644 --- a/mods/ra/maps/allies-05c/allies05c-AI.lua +++ b/mods/ra/maps/allies-05c/allies05c-AI.lua @@ -44,7 +44,7 @@ ProduceUSSRInfantry = function() USSR.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry) end) end @@ -56,7 +56,7 @@ ProduceUSSRVehicles = function() USSR.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRVehicles) end) end @@ -73,7 +73,7 @@ ProduceAircraft = function() local alive = Utils.Where(Planes, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(plane, Greece) diff --git a/mods/ra/maps/allies-05c/allies05c.lua b/mods/ra/maps/allies-05c/allies05c.lua index bea9ece177..e2f40d2000 100644 --- a/mods/ra/maps/allies-05c/allies05c.lua +++ b/mods/ra/maps/allies-05c/allies05c.lua @@ -6,12 +6,12 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then TanyaType = "e7" ReinforceCash = 5000 HoldAITime = DateTime.Minutes(3) SpecialCameras = true -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then TanyaType = "e7.noautotarget" ReinforceCash = 3500 HoldAITime = DateTime.Minutes(2) @@ -190,7 +190,7 @@ FreeTanya = function() Trigger.OnKilled(Tanya, function() USSR.MarkCompletedObjective(USSRObj) end) - if Map.LobbyOption("difficulty") == "tough" then + if Difficulty == "tough" then KillSams = Greece.AddObjective("Destroy all six SAM Sites that block\nour reinforcements' helicopter.") Greece.MarkCompletedObjective(MainObj) @@ -324,7 +324,7 @@ Tick = function() end if USSR.HasNoRequiredUnits() then - if not Greece.IsObjectiveCompleted(KillAll) and Map.LobbyOption("difficulty") == "tough" then + if not Greece.IsObjectiveCompleted(KillAll) and Difficulty == "tough" then SendWaterExtraction() end Greece.MarkCompletedObjective(KillAll) diff --git a/mods/ra/maps/allies-06a/allies06a-AI.lua b/mods/ra/maps/allies-06a/allies06a-AI.lua index f8fb76cd5c..a1eddfc381 100644 --- a/mods/ra/maps/allies-06a/allies06a-AI.lua +++ b/mods/ra/maps/allies-06a/allies06a-AI.lua @@ -197,12 +197,11 @@ WTransWaves = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - WaterAttackTypes = WaterAttackTypes[difficulty] - WaterAttacks = WaterAttacks[difficulty] - WTransUnits = WTransUnits[difficulty] - WTransDelays = WTransDelays[difficulty] - BuildDelays = BuildDelays[difficulty] + WaterAttackTypes = WaterAttackTypes[Difficulty] + WaterAttacks = WaterAttacks[Difficulty] + WTransUnits = WTransUnits[Difficulty] + WTransDelays = WTransDelays[Difficulty] + BuildDelays = BuildDelays[Difficulty] InitialiseAttack() Trigger.AfterDelay(DateTime.Seconds(10), ProduceInfantry) diff --git a/mods/ra/maps/allies-06a/allies06a.lua b/mods/ra/maps/allies-06a/allies06a.lua index 26c9d6e63a..a8af019a44 100644 --- a/mods/ra/maps/allies-06a/allies06a.lua +++ b/mods/ra/maps/allies-06a/allies06a.lua @@ -121,14 +121,14 @@ CaptureRadarDome = function() end Beacon.New(player, a.CenterPosition) - if Map.LobbyOption("difficulty") ~= "hard" then + if Difficulty ~= "hard" then Actor.Create("TECH.CAM", true, { Owner = player, Location = a.Location + CVec.New(1, 1) }) end end) Media.DisplayMessage("Coordinates of the Soviet tech centers discovered.") - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Actor.Create("Camera", true, { Owner = player, Location = Weapcam.Location }) end end) @@ -145,7 +145,7 @@ InfiltrateTechCenter = function() player.MarkCompletedObjective(InfiltrateTechCenterObj) local Proxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr }) - Utils.Do(ParadropWaypoints[Map.LobbyOption("difficulty")], function(waypoint) + Utils.Do(ParadropWaypoints[Difficulty], function(waypoint) Proxy.TargetParatroopers(waypoint.CenterPosition, Angle.South) end) Proxy.Destroy() diff --git a/mods/ra/maps/allies-06b/allies06b-AI.lua b/mods/ra/maps/allies-06b/allies06b-AI.lua index f9afa9a196..f0c97d5754 100644 --- a/mods/ra/maps/allies-06b/allies06b-AI.lua +++ b/mods/ra/maps/allies-06b/allies06b-AI.lua @@ -209,12 +209,11 @@ WTransWaves = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - WaterAttackTypes = WaterAttackTypes[difficulty] - WaterAttacks = WaterAttacks[difficulty] - WTransUnits = WTransUnits[difficulty] - WTransDelays = WTransDelays[difficulty] - BuildDelays = BuildDelays[difficulty] + WaterAttackTypes = WaterAttackTypes[Difficulty] + WaterAttacks = WaterAttacks[Difficulty] + WTransUnits = WTransUnits[Difficulty] + WTransDelays = WTransDelays[Difficulty] + BuildDelays = BuildDelays[Difficulty] InitialiseAttack() Trigger.AfterDelay(DateTime.Seconds(40), ProduceInfantry) diff --git a/mods/ra/maps/allies-06b/allies06b.lua b/mods/ra/maps/allies-06b/allies06b.lua index b2fc4f0abb..e28d95c049 100644 --- a/mods/ra/maps/allies-06b/allies06b.lua +++ b/mods/ra/maps/allies-06b/allies06b.lua @@ -131,14 +131,14 @@ CaptureRadarDome = function() end Beacon.New(player, a.CenterPosition) - if Map.LobbyOption("difficulty") ~= "hard" then + if Difficulty ~= "hard" then Actor.Create("TECH.CAM", true, { Owner = player, Location = a.Location + CVec.New(1, 1) }) end end) Media.DisplayMessage("Coordinates of the Soviet tech centers discovered.") - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Actor.Create("Camera", true, { Owner = player, Location = Weapcam.Location }) end end) @@ -207,7 +207,7 @@ WorldLoaded = function() Camera.Position = DefaultCameraPosition.CenterPosition - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Trigger.OnEnteredProximityTrigger(SovietDefenseCam.CenterPosition, WDist.New(1024 * 7), function(a, id) if a.Owner == player then Trigger.RemoveProximityTrigger(id) @@ -225,7 +225,7 @@ WorldLoaded = function() end) end - if Map.LobbyOption("difficulty") ~= "hard" then + if Difficulty ~= "hard" then Trigger.OnKilled(DefBrl1, function(a, b) if not DefenseFlame1.IsDead then DefenseFlame1.Kill() diff --git a/mods/ra/maps/allies-07/allies07-AI.lua b/mods/ra/maps/allies-07/allies07-AI.lua index 04c0d5801a..9a590b2f75 100644 --- a/mods/ra/maps/allies-07/allies07-AI.lua +++ b/mods/ra/maps/allies-07/allies07-AI.lua @@ -71,7 +71,7 @@ ProduceBadGuyInfantry = function() badguy.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(BGAttackGroup, units[1]) SendBGAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry) end) end @@ -97,7 +97,7 @@ ProduceUSSRInfantry = function() ussr.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry) end) end @@ -109,7 +109,7 @@ ProduceVehicles = function() ussr.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end @@ -126,7 +126,7 @@ ProduceAircraft = function() local alive = Utils.Where(Yaks, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(yak, greece) @@ -134,8 +134,7 @@ ProduceAircraft = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - SovietVehicles = SovietVehicles[difficulty] + SovietVehicles = SovietVehicles[Difficulty] local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == ussr and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) diff --git a/mods/ra/maps/allies-07/allies07.lua b/mods/ra/maps/allies-07/allies07.lua index 100184b1fa..82be8ccf54 100644 --- a/mods/ra/maps/allies-07/allies07.lua +++ b/mods/ra/maps/allies-07/allies07.lua @@ -27,7 +27,7 @@ lstReinforcements = } } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then ActivateAIDelay = DateTime.Minutes(1) else ActivateAIDelay = DateTime.Seconds(30) @@ -82,7 +82,7 @@ CaptureRadarDome = function() end BaseRaids = function() - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then return else Trigger.AfterDelay(Utils.RandomInteger(BaseRaidDelay1[1], BaseRaidDelay1[2]), function() @@ -108,7 +108,7 @@ BaseRaids = function() end StartTimerFunction = function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then StartTimer = true Media.PlaySpeechNotification(greece, "TimerStarted") end diff --git a/mods/ra/maps/allies-08a/allies08a-AI.lua b/mods/ra/maps/allies-08a/allies08a-AI.lua index 741cfaf0d3..a3020acce9 100644 --- a/mods/ra/maps/allies-08a/allies08a-AI.lua +++ b/mods/ra/maps/allies-08a/allies08a-AI.lua @@ -91,7 +91,7 @@ ProduceInfantry = function() ussr.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry) end) end @@ -103,7 +103,7 @@ ProduceVehicles = function() ussr.Build({ Utils.Random(SovietVehicles) }, 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 @@ ProduceAircraft = function() local alive = Utils.Where(Migs, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(mig, greece) @@ -194,11 +194,10 @@ SendParabombs = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - GroundWavesDelays = GroundWavesDelays[difficulty] - WTransDelays = WTransDelays[difficulty] - ParadropDelays = ParadropDelays[difficulty] - BombDelays = BombDelays[difficulty] + GroundWavesDelays = GroundWavesDelays[Difficulty] + WTransDelays = WTransDelays[Difficulty] + ParadropDelays = ParadropDelays[Difficulty] + BombDelays = BombDelays[Difficulty] local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == ussr and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) diff --git a/mods/ra/maps/allies-08b/allies08b-AI.lua b/mods/ra/maps/allies-08b/allies08b-AI.lua index 6d69cf88ed..acfd9f9873 100644 --- a/mods/ra/maps/allies-08b/allies08b-AI.lua +++ b/mods/ra/maps/allies-08b/allies08b-AI.lua @@ -90,7 +90,7 @@ ProduceInfantry = function() ussr.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry) end) end @@ -102,7 +102,7 @@ ProduceVehicles = function() ussr.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end @@ -119,7 +119,7 @@ ProduceAircraft = function() local alive = Utils.Where(Migs, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(mig, greece) @@ -194,11 +194,10 @@ SendParabombs = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - GroundWavesDelays = GroundWavesDelays[difficulty] - WTransDelays = WTransDelays[difficulty] - ParadropDelays = ParadropDelays[difficulty] - BombDelays = BombDelays[difficulty] + GroundWavesDelays = GroundWavesDelays[Difficulty] + WTransDelays = WTransDelays[Difficulty] + ParadropDelays = ParadropDelays[Difficulty] + BombDelays = BombDelays[Difficulty] local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == ussr and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) diff --git a/mods/ra/maps/allies-09a/allies09a-AI.lua b/mods/ra/maps/allies-09a/allies09a-AI.lua index 749179908e..d880b1c110 100644 --- a/mods/ra/maps/allies-09a/allies09a-AI.lua +++ b/mods/ra/maps/allies-09a/allies09a-AI.lua @@ -30,7 +30,7 @@ SubAttackGroupSize = normal = 2, hard = 3 } -InfantryUnits = +InfantryUnits = { hard = { "e1", "e2", "e2", "e4", "e4" }, normal = { "e1", "e1", "e2", "e2", "e4" }, @@ -180,13 +180,12 @@ Paradrop = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - WTransUnits = WTransUnits[difficulty] - WTransDelays = WTransDelays[difficulty] - SubAttackGroupSize = SubAttackGroupSize[difficulty] - InfantryUnits = InfantryUnits[difficulty] - ProductionInterval = ProductionInterval[difficulty] - ParadropDelay = ParadropDelay[difficulty] + WTransUnits = WTransUnits[Difficulty] + WTransDelays = WTransDelays[Difficulty] + SubAttackGroupSize = SubAttackGroupSize[Difficulty] + InfantryUnits = InfantryUnits[Difficulty] + ProductionInterval = ProductionInterval[Difficulty] + ParadropDelay = ParadropDelay[Difficulty] PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = USSR }) local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) diff --git a/mods/ra/maps/ant-01/ant-01.lua b/mods/ra/maps/ant-01/ant-01.lua index 06723aa352..40e99a54f7 100644 --- a/mods/ra/maps/ant-01/ant-01.lua +++ b/mods/ra/maps/ant-01/ant-01.lua @@ -12,7 +12,6 @@ baseDiscovered = false AtEndGame = false --Basic Vars -DifficultySetting = Map.LobbyOption("difficulty") TimerColor = Player.GetPlayer("Spain").Color InsertionHelicopterType = "tran.insertion" TimerTicks = DateTime.Minutes(18) -- 18 minutes is roughly 30 mins in the original game diff --git a/mods/ra/maps/ant-01/ant-attack.lua b/mods/ra/maps/ant-01/ant-attack.lua index 58cec9373b..131bab6ed0 100644 --- a/mods/ra/maps/ant-01/ant-attack.lua +++ b/mods/ra/maps/ant-01/ant-attack.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -DifficultySetting = Map.LobbyOption("difficulty") timeTracker = 0 amount = 1 SendAnts = true @@ -53,19 +52,19 @@ StartAntAttack = function() antType = Utils.Random(AntTypes) end - if antType == "warriorant" and DifficultySetting == "easy" then + if antType == "warriorant" and Difficulty == "easy" then antType = "scoutant" end - if DifficultySetting == "normal" and timeTracker < DateTime.Minutes(6) and antType == "scoutant" then + if Difficulty == "normal" and timeTracker < DateTime.Minutes(6) and antType == "scoutant" then antType = "warriorant" - elseif DifficultySetting == "hard" and timeTracker < DateTime.Minutes(8) and antType == "scoutant" then + elseif Difficulty == "hard" and timeTracker < DateTime.Minutes(8) and antType == "scoutant" then antType = "warriorant" end - local max = MaxAnts[DifficultySetting] - math.ceil(timeTracker / DateTime.Minutes(6)) + local max = MaxAnts[Difficulty] - math.ceil(timeTracker / DateTime.Minutes(6)) if timeTracker > DateTime.Minutes(3) and antType == "fireant" then - amount = Utils.RandomInteger(1, MaxFireAnts[DifficultySetting]) + amount = Utils.RandomInteger(1, MaxFireAnts[Difficulty]) elseif timeTracker > 15 and antType == "fireant" then antType = "scoutant" else @@ -83,7 +82,7 @@ StartAntAttack = function() -- Setup next wave if SendAnts then - Trigger.AfterDelay(AttackInterval[DifficultySetting], function() + Trigger.AfterDelay(AttackInterval[Difficulty], function() StartAntAttack() end) end diff --git a/mods/ra/maps/ant-03/ant-03-AI.lua b/mods/ra/maps/ant-03/ant-03-AI.lua index 6874c340d2..4b2866bc42 100644 --- a/mods/ra/maps/ant-03/ant-03-AI.lua +++ b/mods/ra/maps/ant-03/ant-03-AI.lua @@ -91,8 +91,7 @@ ActivateHive7 = function() end ActivateAntHives = function() - local difficulty = Map.LobbyOption("difficulty") - AntSquad = AntSquad[difficulty] + AntSquad = AntSquad[Difficulty] Trigger.AfterDelay(DateTime.Minutes(1), ActivateHive1) Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(30), ActivateHive2) diff --git a/mods/ra/maps/evacuation/evacuation.lua b/mods/ra/maps/evacuation/evacuation.lua index 22c5861549..a132b59b02 100644 --- a/mods/ra/maps/evacuation/evacuation.lua +++ b/mods/ra/maps/evacuation/evacuation.lua @@ -13,7 +13,7 @@ DeathThreshold = } TanyaType = "e7" -if Map.LobbyOption("difficulty") ~= "easy" then +if Difficulty ~= "easy" then TanyaType = "e7.noautotarget" end @@ -150,7 +150,7 @@ ProduceInfantry = function() soviets.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry) end) end @@ -162,7 +162,7 @@ ProduceVehicles = function() soviets.Build({ Utils.Random(SovietVehicles[SovietVehicleType]) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end @@ -183,7 +183,7 @@ Tick = function() allies2.MarkCompletedObjective(objCutSovietPower) end - if not allies2.IsObjectiveCompleted(objLimitLosses) and allies2.UnitsLost > DeathThreshold[Map.LobbyOption("difficulty")] then + if not allies2.IsObjectiveCompleted(objLimitLosses) and allies2.UnitsLost > DeathThreshold[Difficulty] then allies2.MarkFailedObjective(objLimitLosses) end @@ -197,7 +197,7 @@ end SetupSoviets = function() soviets.Cash = 1000 - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Utils.Do(Sams, function(sam) local camera = Actor.Create("Camera.SAM", true, { Owner = allies1, Location = sam.Location }) Trigger.OnKilledOrCaptured(sam, function() @@ -209,7 +209,7 @@ SetupSoviets = function() local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == soviets and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) Trigger.OnDamaged(actor, function(building) - if building.Owner == soviets and building.Health < (building.MaxHealth * RepairTriggerThreshold[Map.LobbyOption("difficulty")] / 100) then + if building.Owner == soviets and building.Health < (building.MaxHealth * RepairTriggerThreshold[Difficulty] / 100) then building.StartBuildingRepairs() end end) @@ -290,7 +290,7 @@ end SpawnTanya = function() Tanya = Actor.Create(TanyaType, true, { Owner = allies1, Location = TanyaLocation.Location }) - if Map.LobbyOption("difficulty") ~= "easy" and allies1.IsLocalPlayer then + if Difficulty ~= "easy" and allies1.IsLocalPlayer then Trigger.AfterDelay(DateTime.Seconds(2), function() Media.DisplayMessage("According to the rules of engagement I need your explicit orders to fire, Commander!", "Tanya") end) @@ -362,7 +362,7 @@ WorldLoaded = function() objDestroySamSites = allies1.AddObjective("Destroy the SAM sites.") objHoldPosition = allies2.AddObjective("Hold your position and protect the base.") - objLimitLosses = allies2.AddObjective("Do not lose more than " .. DeathThreshold[Map.LobbyOption("difficulty")] .. " units.", "Secondary", false) + objLimitLosses = allies2.AddObjective("Do not lose more than " .. DeathThreshold[Difficulty] .. " units.", "Secondary", false) objCutSovietPower = allies2.AddObjective("Take out the Soviet power grid.", "Secondary", false) SetupTriggers() diff --git a/mods/ra/maps/exodus/exodus.lua b/mods/ra/maps/exodus/exodus.lua index e3a92b5fc0..77591cd3a4 100644 --- a/mods/ra/maps/exodus/exodus.lua +++ b/mods/ra/maps/exodus/exodus.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") UnitsEvacuatedThreshold = { diff --git a/mods/ra/maps/fall-of-greece-1-personal-war/personal-war.lua b/mods/ra/maps/fall-of-greece-1-personal-war/personal-war.lua index d9a9485473..38ca4c9c79 100644 --- a/mods/ra/maps/fall-of-greece-1-personal-war/personal-war.lua +++ b/mods/ra/maps/fall-of-greece-1-personal-war/personal-war.lua @@ -62,7 +62,7 @@ MissionStart = function() local insertionFlare = Actor.Create("flare", true, { Owner = Allies, Location = LightFlare.Location }) Trigger.AfterDelay(DateTime.Seconds(2), function() FlareBoy.AttackMove(FlareBoyAttack.Location) - if Map.LobbyOption("difficulty") == "normal" then + if Difficulty == "normal" then local normalDrop = InsertionDrop.TargetParatroopers(InsertionPoint.CenterPosition, Angle.New(892)) Utils.Do(normalDrop, function(a) Trigger.OnPassengerExited(a, function(t,p) @@ -77,7 +77,7 @@ MissionStart = function() VIPs[#VIPs + 1] = p FailTrigger() end) - end) + end) Trigger.AfterDelay(DateTime.Seconds(6), function() Media.DisplayMessage("Commander, there are several civilians in the area.\nWe'll need you to call out targets.", "Tanya") end) @@ -95,7 +95,7 @@ FailTrigger = function() Trigger.OnAnyKilled(VIPs, function() Allies.MarkFailedObjective(ProtectVIPs) end) -end +end FootprintTriggers = function() local foot1Triggered @@ -208,7 +208,7 @@ FootprintTriggers = function() Media.DisplayMessage("Extraction point is compromised. Evacuate the base!", "Headquarters") local defenders = Reinforcements.Reinforce(England, TentTeam, { Tent.Location, TentMove.Location }, 0) Utils.Do(defenders, IdleHunt) - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Seconds(30), function() local wave2 = Reinforcements.Reinforce(USSR, SovietAttackers, { BaseAttackersSpawn.Location, SovietAttack.Location }) Utils.Do(wave2, IdleHunt) @@ -367,7 +367,7 @@ FootprintTriggers = function() end) end -SetupTriggers = function() +SetupTriggers = function() Utils.Do(USSR.GetGroundAttackers(), function(unit) Trigger.OnDamaged(unit, function() IdleHunt(unit) end) end) @@ -451,7 +451,7 @@ SovBaseAttack = function() end end) - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then local barracksTeam = Reinforcements.Reinforce(USSR, RaxTeam, { SovRaxSpawn.Location, SovBaseCam.Location }, 0) Utils.Do(barracksTeam, IdleHunt) end diff --git a/mods/ra/maps/fall-of-greece-2-evacuation/evacuation-AI.lua b/mods/ra/maps/fall-of-greece-2-evacuation/evacuation-AI.lua index d21f732df4..256cb4f28c 100644 --- a/mods/ra/maps/fall-of-greece-2-evacuation/evacuation-AI.lua +++ b/mods/ra/maps/fall-of-greece-2-evacuation/evacuation-AI.lua @@ -51,7 +51,7 @@ ProduceInfantry = function() USSR.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceInfantry) end) end @@ -63,7 +63,7 @@ ProduceVehicles = function() USSR.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end @@ -80,7 +80,7 @@ ProduceAircraft = function() local alive = Utils.Where(Yaks, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(yak, Allies) diff --git a/mods/ra/maps/fall-of-greece-2-evacuation/evacuation.lua b/mods/ra/maps/fall-of-greece-2-evacuation/evacuation.lua index 01ad8004bd..c17093ad50 100644 --- a/mods/ra/maps/fall-of-greece-2-evacuation/evacuation.lua +++ b/mods/ra/maps/fall-of-greece-2-evacuation/evacuation.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") AlliedReinforcementsA = { "jeep", "jeep" } AlliedReinforcementsB = { "e1", "e1", "e1", "e3", "e3" } AlliedReinforcementsC = { "jeep", "mcv" } @@ -238,9 +237,9 @@ WorldLoaded = function() Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") end) - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then RescueCivilians = Allies.AddObjective("Evacuate at least half of the civilians to the island\nshelter.") - elseif Map.LobbyOption("difficulty") == "normal" then + elseif Difficulty == "normal" then RescueCivilians = Allies.AddObjective("Evacuate at least three quarters of the civilians to\nthe island shelter.") else RescueCivilians = Allies.AddObjective("Evacuate all civilians to the island shelter.") diff --git a/mods/ra/maps/fort-lonestar/fort-lonestar.lua b/mods/ra/maps/fort-lonestar/fort-lonestar.lua index 3f6ec6dbb6..1a582a6c5b 100644 --- a/mods/ra/maps/fort-lonestar/fort-lonestar.lua +++ b/mods/ra/maps/fort-lonestar/fort-lonestar.lua @@ -21,7 +21,7 @@ Walls = { WallBottomRight1, WallBottomRight2, WallBottomRight3, WallBottomRight4, WallBottomRight5, WallBottomRight6, WallBottomRight7, WallBottomRight8, WallBottomRight9 } } -if Map.LobbyOption("difficulty") == "veryeasy" then +if Difficulty == "veryeasy" then ParaChance = 20 Patrol = { "e1", "e2", "e1" } Infantry = { "e4", "e1", "e1", "e2", "e2" } @@ -30,7 +30,7 @@ if Map.LobbyOption("difficulty") == "veryeasy" then LongRange = { "arty" } Boss = { "v2rl" } Swarm = { "shok", "shok", "shok" } -elseif Map.LobbyOption("difficulty") == "easy" then +elseif Difficulty == "easy" then ParaChance = 25 Patrol = { "e1", "e2", "e1" } Infantry = { "e4", "e1", "e1", "e2", "e1", "e2", "e1" } @@ -39,7 +39,7 @@ elseif Map.LobbyOption("difficulty") == "easy" then LongRange = { "v2rl" } Boss = { "4tnk" } Swarm = { "shok", "shok", "shok", "shok", "ttnk" } -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then ParaChance = 30 Patrol = { "e1", "e2", "e1", "e1" } Infantry = { "e4", "e1", "e1", "e2", "e1", "e2", "e1" } @@ -48,7 +48,7 @@ elseif Map.LobbyOption("difficulty") == "normal" then LongRange = { "v2rl" } Boss = { "4tnk" } Swarm = { "shok", "shok", "shok", "shok", "ttnk", "ttnk", "ttnk" } -elseif Map.LobbyOption("difficulty") == "hard" then +elseif Difficulty == "hard" then ParaChance = 35 Patrol = { "e1", "e2", "e1", "e1", "e4" } Infantry = { "e4", "e1", "e1", "e2", "e1", "e2", "e1" } @@ -85,7 +85,7 @@ Waves = } -- Now do some adjustments to the waves -if Map.LobbyOption("difficulty") == "tough" or Map.LobbyOption("difficulty") == "endless" then +if Difficulty == "tough" or Difficulty == "endless" then Waves[8] = { delay = 1500, units = { Infantry, Infantry, Patrol, Infantry, Infantry, Infantry }, ironUnits = { LongRange } } Waves[9] = { delay = 1500, units = { Infantry, Infantry, Patrol, Infantry, Infantry, Infantry, Infantry, Infantry, LongRange, LongRange, Vehicles, Tank }, ironUnits = { Tank } } Waves[11] = { delay = 1500, units = { Vehicles, Infantry, Patrol, Patrol, Patrol, Infantry, LongRange, Tank, Boss, Infantry, Infantry, Patrol } } @@ -159,7 +159,7 @@ SendWave = function() SendWave() end else - if Map.LobbyOption("difficulty") == "endless" then + if Difficulty == "endless" then Wave = 0 IncreaseDifficulty() SendWave() diff --git a/mods/ra/maps/fort-lonestar/rules.yaml b/mods/ra/maps/fort-lonestar/rules.yaml index b998947cd9..fc7c078537 100644 --- a/mods/ra/maps/fort-lonestar/rules.yaml +++ b/mods/ra/maps/fort-lonestar/rules.yaml @@ -27,7 +27,7 @@ World: FlashPaletteEffect@LIGHTNINGSTRIKE: Type: LightningStrike LuaScript: - Scripts: fort-lonestar.lua, fort-lonestar-AI.lua + Scripts: fort-lonestar.lua, fort-lonestar-AI.lua, campaign.lua MapBuildRadius: AllyBuildRadiusCheckboxVisible: False BuildRadiusCheckboxVisible: False diff --git a/mods/ra/maps/infiltration/infiltration.lua b/mods/ra/maps/infiltration/infiltration.lua index d58658e4cd..6e6a979b96 100644 --- a/mods/ra/maps/infiltration/infiltration.lua +++ b/mods/ra/maps/infiltration/infiltration.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") if Difficulty == "hard" then TimerTicks = DateTime.Minutes(25) diff --git a/mods/ra/maps/intervention/intervention.lua b/mods/ra/maps/intervention/intervention.lua index 1b844b9345..87141f7eca 100644 --- a/mods/ra/maps/intervention/intervention.lua +++ b/mods/ra/maps/intervention/intervention.lua @@ -6,6 +6,7 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] + BeachheadTrigger = { CPos.New(120, 90), CPos.New(120, 89), CPos.New(120, 88), CPos.New(121, 88), CPos.New(122, 88), CPos.New(123, 88), CPos.New(124, 88), @@ -17,8 +18,6 @@ BeachheadTrigger = CPos.New(137, 104), CPos.New(137, 105), CPos.New(137, 106), CPos.New(136, 106), CPos.New(136, 107) } -Difficulty = Map.LobbyOption("difficulty") - if Difficulty == "normal" then BaseRaidInterval = DateTime.Minutes(3) BaseFrontAttackInterval = DateTime.Minutes(3) + DateTime.Seconds(30) diff --git a/mods/ra/maps/production-disruption/production-disruption.lua b/mods/ra/maps/production-disruption/production-disruption.lua index c43cb99fd4..1d426e2b3e 100644 --- a/mods/ra/maps/production-disruption/production-disruption.lua +++ b/mods/ra/maps/production-disruption/production-disruption.lua @@ -23,7 +23,7 @@ SubEscapePath = { SubPath1, SubPath2, SubPath3 } MissionStart = function() LZCamera = Actor.Create("camera", true, { Owner = Greece, Location = LZ.Location }) Chalk1.TargetParatroopers(LZ.CenterPosition, Angle.New(740)) - if Map.LobbyOption("difficulty") == "normal" then + if Difficulty == "normal" then Actor.Create("tsla", true, { Owner = USSR, Location = EasyCamera.Location }) Actor.Create("4tnk", true, { Owner = USSR, Facing = Angle.South, Location = Mammoth.Location }) Actor.Create("4tnk", true, { Owner = USSR, Facing = Angle.South, Location = Mammoth.Location + CVec.New(1,0) }) diff --git a/mods/ra/maps/sarin-gas-1-crackdown/crackdown-AI.lua b/mods/ra/maps/sarin-gas-1-crackdown/crackdown-AI.lua index 17fb8b8923..ddfca5ffb5 100644 --- a/mods/ra/maps/sarin-gas-1-crackdown/crackdown-AI.lua +++ b/mods/ra/maps/sarin-gas-1-crackdown/crackdown-AI.lua @@ -55,7 +55,7 @@ ProduceBadGuyInfantry = function() badguy.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(BGAttackGroup, units[1]) SendBGAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry) end) end @@ -81,7 +81,7 @@ ProduceUSSRInfantry = function() ussr.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry) end) end @@ -93,7 +93,7 @@ ProduceVehicles = function() ussr.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end @@ -106,8 +106,7 @@ GroundWaves = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - GroundWavesDelays = GroundWavesDelays[difficulty] + GroundWavesDelays = GroundWavesDelays[Difficulty] ProduceBadGuyInfantry() ProduceUSSRInfantry() diff --git a/mods/ra/maps/sarin-gas-1-crackdown/crackdown.lua b/mods/ra/maps/sarin-gas-1-crackdown/crackdown.lua index 5783c81086..261f3e2f73 100644 --- a/mods/ra/maps/sarin-gas-1-crackdown/crackdown.lua +++ b/mods/ra/maps/sarin-gas-1-crackdown/crackdown.lua @@ -86,8 +86,7 @@ MissionStart = function() end) Trigger.AfterDelay(DateTime.Minutes(1), function() - local difficulty = Map.LobbyOption("difficulty") - CombatTeam2 = CombatTeam2[difficulty] + CombatTeam2 = CombatTeam2[Difficulty] Reinforcements.Reinforce(greece, CombatTeam2, { TruckEscapeCenter.Location, DefaultCameraPosition.Location }) Media.PlaySpeechNotification(greece, "ReinforcementsArrived") end) diff --git a/mods/ra/maps/sarin-gas-2-down-under/downunder.lua b/mods/ra/maps/sarin-gas-2-down-under/downunder.lua index 292a1f107a..50d2cff581 100644 --- a/mods/ra/maps/sarin-gas-2-down-under/downunder.lua +++ b/mods/ra/maps/sarin-gas-2-down-under/downunder.lua @@ -32,7 +32,7 @@ ObjectiveTriggers = function() EscapeGoalTrigger = true greece.MarkCompletedObjective(ExitBase) - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then greece.MarkCompletedObjective(NoCasualties) end @@ -444,7 +444,7 @@ Tick = function() greece.MarkFailedObjective(ExitBase) end - if Map.LobbyOption("difficulty") == "hard" and greece.UnitsLost > AcceptableLosses then + if Difficulty == "hard" and greece.UnitsLost > AcceptableLosses then greece.MarkFailedObjective(NoCasualties) end end @@ -466,7 +466,7 @@ WorldLoaded = function() FreeTanya = greece.AddObjective("Free Tanya and keep her alive.") KillVIPs = greece.AddObjective("Kill all Soviet officers and scientists.", "Secondary", false) StealTank = greece.AddObjective("Steal a Soviet mammoth tank.", "Secondary", false) - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then NoCasualties = greece.AddPrimaryObjective("Do not lose a single soldier or civilian\nunder your command.") end 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 2cca7a7090..0abd888eb2 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 @@ -44,7 +44,7 @@ ProduceBadGuyInfantry = function() BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(BGAttackGroup, units[1]) SendBGAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry) end) end @@ -70,7 +70,7 @@ ProduceUSSRInfantry = function() USSR.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry) end) end @@ -82,14 +82,14 @@ ProduceVehicles = function() USSR.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end GroundAttackUnits = { {"4tnk", "3tnk", "e2", "e2", "e2", "e2" }, { "3tnk", "3tnk", "v2rl", "e4", "e4", "e4" }, {"ttnk", "ttnk", "ttnk", "shok", "shok", "shok" } } -GroundAttackPaths = -{ +GroundAttackPaths = +{ { SovietGroundEntry1.Location }, { SovietGroundEntry2.Location }, { SovietGroundEntry3.Location } @@ -124,7 +124,7 @@ ProduceAircraft = function() local alive = Utils.Where(Planes, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(plane, Greece) @@ -132,8 +132,7 @@ ProduceAircraft = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - GroundWavesDelays = GroundWavesDelays[difficulty] + 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) 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 b3e9816d0e..8c377e99ba 100644 --- a/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn.lua +++ b/mods/ra/maps/sarin-gas-3-controlled-burn/controlledburn.lua @@ -36,7 +36,7 @@ SetupTriggers = function() if actor.Owner == Greece then Trigger.RemoveProximityTrigger(trigger1) local baseCamera = Actor.Create("camera", true, { Owner = Greece, Location = BaseCam.Location }) - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Reinforcements.Reinforce(BadGuy, RaxTeam, { BadGuyRaxSpawn.Location, BaseCam.Location }, 0) end Trigger.AfterDelay(DateTime.Seconds(10), function() @@ -76,7 +76,7 @@ PowerDownTeslas = function() KillBase = Greece.AddObjective("Destroy the enemy compound.") Greece.MarkCompletedObjective(TakeOutPower) Media.PlaySpeechNotification(Greece, "ReinforcementsArrived") - Reinforcements.Reinforce(Greece, MCVReinforcements[Map.LobbyOption("difficulty")], { AlliesSpawn.Location, AlliesMove.Location }) + Reinforcements.Reinforce(Greece, MCVReinforcements[Difficulty], { AlliesSpawn.Location, AlliesMove.Location }) local baseFlare = Actor.Create("flare", true, { Owner = Greece, Location = AlliedBase.Location }) Actor.Create("proc", true, { Owner = USSR, Location = Proc1.Location }) Actor.Create("proc", true, { Owner = USSR, Location = Proc2.Location }) diff --git a/mods/ra/maps/siberian-conflict-1-fresh-tracks/fresh-tracks.lua b/mods/ra/maps/siberian-conflict-1-fresh-tracks/fresh-tracks.lua index bde203b941..2142b0a95a 100644 --- a/mods/ra/maps/siberian-conflict-1-fresh-tracks/fresh-tracks.lua +++ b/mods/ra/maps/siberian-conflict-1-fresh-tracks/fresh-tracks.lua @@ -63,7 +63,7 @@ AttackWaveDelays = } AttackWaves = function() - local attackpath = Utils.Random(AttackPaths) + local attackpath = Utils.Random(AttackPaths) local attackers = Reinforcements.Reinforce(USSR, Utils.Random(AttackWaveUnits), { attackpath[1] }) Utils.Do(attackers, function(unit) Trigger.OnAddedToWorld(unit, function() @@ -75,7 +75,7 @@ AttackWaves = function() Trigger.AfterDelay(Utils.RandomInteger(AttackWaveDelay[1], AttackWaveDelay[2]), AttackWaves) end -ConvoyWaves = +ConvoyWaves = { easy = 2, normal = 3, @@ -109,7 +109,7 @@ SendConvoys = function() end) ConvoysPassed = ConvoysPassed + 1 - if ConvoysPassed <= ConvoyWaves[Map.LobbyOption("difficulty")] then + if ConvoysPassed <= ConvoyWaves[Difficulty] then Trigger.AfterDelay(DateTime.Seconds(90), SendConvoys) else FinalTrucks() @@ -274,7 +274,6 @@ WorldLoaded = function() ConvoyExit() BridgeTriggers() - local difficulty = Map.LobbyOption("difficulty") - ConvoyUnits = ConvoyUnits[difficulty] - AttackWaveDelay = AttackWaveDelays[difficulty] + ConvoyUnits = ConvoyUnits[Difficulty] + AttackWaveDelay = AttackWaveDelays[Difficulty] end diff --git a/mods/ra/maps/siberian-conflict-3-wasteland/wasteland-AI.lua b/mods/ra/maps/siberian-conflict-3-wasteland/wasteland-AI.lua index 8573c7e848..834e505913 100644 --- a/mods/ra/maps/siberian-conflict-3-wasteland/wasteland-AI.lua +++ b/mods/ra/maps/siberian-conflict-3-wasteland/wasteland-AI.lua @@ -69,7 +69,7 @@ ProduceBadGuyInfantry = function() BadGuy.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(BGAttackGroup, units[1]) SendBGAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyInfantry) end) end @@ -81,7 +81,7 @@ ProduceBadGuyVehicles = function() BadGuy.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(BGAttackGroup, units[1]) SendBGAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceBadGuyVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceBadGuyVehicles) end) end @@ -107,7 +107,7 @@ ProduceUSSRInfantry = function() USSR.Build({ Utils.Random(SovietInfantry) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRInfantry) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRInfantry) end) end @@ -119,7 +119,7 @@ ProduceUSSRVehicles = function() USSR.Build({ Utils.Random(SovietVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceUSSRVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceUSSRVehicles) end) end @@ -136,7 +136,7 @@ ProduceAircraft = function() local alive = Utils.Where(Planes, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), ProduceAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), ProduceAircraft) end InitializeAttackAircraft(plane, Allies) @@ -183,11 +183,10 @@ USSRMammoths = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - ParadropDelays = ParadropDelays[difficulty] - MammothDelays = MammothDelays[difficulty] - StartBGMammoths = StartBGMammoths[difficulty] - StartUSSRMammoths = StartUSSRMammoths[difficulty] + ParadropDelays = ParadropDelays[Difficulty] + MammothDelays = MammothDelays[Difficulty] + StartBGMammoths = StartBGMammoths[Difficulty] + StartUSSRMammoths = StartUSSRMammoths[Difficulty] local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner == USSR and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) diff --git a/mods/ra/maps/soviet-03/soviet03.lua b/mods/ra/maps/soviet-03/soviet03.lua index 709a67e5c3..940ef33052 100644 --- a/mods/ra/maps/soviet-03/soviet03.lua +++ b/mods/ra/maps/soviet-03/soviet03.lua @@ -6,11 +6,11 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then remainingTime = DateTime.Minutes(7) -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then remainingTime = DateTime.Minutes(6) -elseif Map.LobbyOption("difficulty") == "hard" then +elseif Difficulty == "hard" then remainingTime = DateTime.Minutes(5) end @@ -264,7 +264,7 @@ end) Trigger.OnEnteredFootprint(SpyHideout3Trigger, function(a, id) if not spyHideout3Trigger and a.Owner == player then spyHideout3Trigger = true - if Map.LobbyOption("difficulty") ~= "hard" then + if Difficulty ~= "hard" then Reinforcements.Reinforce(player, USSRReinforcements2, { ReinforcementSpawn.Location, CameraSpyHideout33.Location }, 0) Media.PlaySpeechNotification(player, "ReinforcementsArrived") end @@ -371,7 +371,7 @@ Tick = function() if not SpyHideout4.IsDead and SpyHideout4.HasPassengers then spyReachedHideout4 = true end - if remainingTime == DateTime.Minutes(5) and Map.LobbyOption("difficulty") ~= "hard" then + if remainingTime == DateTime.Minutes(5) and Difficulty ~= "hard" then Media.PlaySpeechNotification(player, "WarningFiveMinutesRemaining") elseif remainingTime == DateTime.Minutes(4) then Media.PlaySpeechNotification(player, "WarningFourMinutesRemaining") diff --git a/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua b/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua index 7b3b9d7387..ea5bb55362 100644 --- a/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-04a/soviet04a-reinforcements_teams.lua @@ -26,7 +26,7 @@ Patrol2Path = { BridgeEntrancePoint.Location, NERoadTurnPoint.Location, Crossroa VillageCamArea = { CPos.New(68, 75),CPos.New(68, 76),CPos.New(68, 77),CPos.New(68, 78),CPos.New(68, 79), CPos.New(68, 80), CPos.New(68, 81), CPos.New(68, 82) } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then ArmorReinfGreece = { "jeep", "1tnk", "1tnk" } else ArmorReinfGreece = { "jeep", "jeep", "1tnk", "1tnk", "1tnk" } @@ -68,7 +68,7 @@ BringPatrol1 = function() end) Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol1) else Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol1) @@ -87,7 +87,7 @@ BringPatrol2 = function() end) Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol2) else Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol2) diff --git a/mods/ra/maps/soviet-04a/soviet04a.lua b/mods/ra/maps/soviet-04a/soviet04a.lua index 9ccbf5f681..3f7761eb53 100644 --- a/mods/ra/maps/soviet-04a/soviet04a.lua +++ b/mods/ra/maps/soviet-04a/soviet04a.lua @@ -91,7 +91,7 @@ RunInitialActivities = function() Trigger.AfterDelay(DateTime.Minutes(1), ProduceInfantry) Trigger.AfterDelay(DateTime.Minutes(2), ProduceArmor) - if Map.LobbyOption("difficulty") == "hard" or Map.LobbyOption("difficulty") == "normal" then + if Difficulty == "hard" or Difficulty == "normal" then Trigger.AfterDelay(DateTime.Seconds(15), ReinfInf) end Trigger.AfterDelay(DateTime.Minutes(1), ReinfInf) @@ -116,9 +116,9 @@ Tick = function() if RCheck then RCheck = false - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Seconds(150), ReinfArmor) - elseif Map.LobbyOption("difficulty") == "normal" then + elseif Difficulty == "normal" then Trigger.AfterDelay(DateTime.Minutes(5), ReinfArmor) else Trigger.AfterDelay(DateTime.Minutes(8), ReinfArmor) diff --git a/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua b/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua index 2750a94f99..7cff32d3b5 100644 --- a/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-04b/soviet04b-reinforcements_teams.lua @@ -25,7 +25,7 @@ Patrol2Path = { EntranceSouthPoint.Location, ToRadarBridgePoint.Location, Island VillageCamArea = { CPos.New(37, 58),CPos.New(37, 59),CPos.New(37, 60),CPos.New(38, 60),CPos.New(39, 60), CPos.New(40, 60), CPos.New(41, 60), CPos.New(35, 57), CPos.New(34, 57), CPos.New(33, 57), CPos.New(32, 57) } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then ArmorReinfGreece = { "jeep", "1tnk", "1tnk" } else ArmorReinfGreece = { "jeep", "jeep", "1tnk", "1tnk", "1tnk" } @@ -68,7 +68,7 @@ BringPatrol1 = function() end) Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol1) else Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol1) @@ -87,7 +87,7 @@ BringPatrol2 = function() end) Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(4), BringPatrol2) else Trigger.AfterDelay(DateTime.Minutes(7), BringPatrol2) diff --git a/mods/ra/maps/soviet-04b/soviet04b.lua b/mods/ra/maps/soviet-04b/soviet04b.lua index 686cc81879..806a27e080 100644 --- a/mods/ra/maps/soviet-04b/soviet04b.lua +++ b/mods/ra/maps/soviet-04b/soviet04b.lua @@ -76,7 +76,7 @@ RunInitialActivities = function() Trigger.AfterDelay(DateTime.Minutes(1), ProduceInfantry) Trigger.AfterDelay(DateTime.Minutes(2), ProduceArmor) - if Map.LobbyOption("difficulty") == "hard" or Map.LobbyOption("difficulty") == "normal" then + if Difficulty == "hard" or Difficulty == "normal" then Trigger.AfterDelay(DateTime.Seconds(5), ReinfInf) end Trigger.AfterDelay(DateTime.Minutes(1), ReinfInf) @@ -101,9 +101,9 @@ Tick = function() if RCheck then RCheck = false - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Seconds(150), ReinfArmor) - elseif Map.LobbyOption("difficulty") == "normal" then + elseif Difficulty == "normal" then Trigger.AfterDelay(DateTime.Minutes(5), ReinfArmor) else Trigger.AfterDelay(DateTime.Minutes(8), ReinfArmor) diff --git a/mods/ra/maps/soviet-05/soviet05-reinforcements_teams.lua b/mods/ra/maps/soviet-05/soviet05-reinforcements_teams.lua index 88e509c69f..c99d777344 100644 --- a/mods/ra/maps/soviet-05/soviet05-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-05/soviet05-reinforcements_teams.lua @@ -12,7 +12,7 @@ SovietStartToBasePath = { StartPoint.Location, SovietBasePoint.Location } SovietMCVReinf = { "mcv", "3tnk", "3tnk", "e1", "e1" } SovExpansionPointGuard = { "2tnk", "2tnk", "e3", "e3", "e3" } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then ArmorReinfGreece = { "jeep", "1tnk", "1tnk" } else ArmorReinfGreece = { "jeep", "jeep", "1tnk", "1tnk", "1tnk" } @@ -79,11 +79,11 @@ IslandTroops1 = function() end) if not CheckForCYard() then return - elseif Map.LobbyOption("difficulty") == "easy" then + elseif Difficulty == "easy" then return else Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(3), IslandTroops1) else Trigger.AfterDelay(DateTime.Minutes(5), IslandTroops1) @@ -101,11 +101,11 @@ IslandTroops2 = function() end) if not CheckForCYard() then return - elseif Map.LobbyOption("difficulty") == "easy" then + elseif Difficulty == "easy" then return else Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(3), IslandTroops2) else Trigger.AfterDelay(DateTime.Minutes(5), IslandTroops2) @@ -123,11 +123,11 @@ IslandTroops3 = function() end) if not CheckForCYard() then return - elseif Map.LobbyOption("difficulty") == "easy" then + elseif Difficulty == "easy" then return else Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(3), IslandTroops3) else Trigger.AfterDelay(DateTime.Minutes(5), IslandTroops3) @@ -147,7 +147,7 @@ BringDDPatrol1 = function() return else Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(4), BringDDPatrol1) else Trigger.AfterDelay(DateTime.Minutes(7), BringDDPatrol1) @@ -167,7 +167,7 @@ BringDDPatrol2 = function() return else Trigger.OnAllKilled(units, function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Trigger.AfterDelay(DateTime.Minutes(4), BringDDPatrol2) else Trigger.AfterDelay(DateTime.Minutes(7), BringDDPatrol2) diff --git a/mods/ra/maps/soviet-05/soviet05.lua b/mods/ra/maps/soviet-05/soviet05.lua index da304084b7..597668e35e 100644 --- a/mods/ra/maps/soviet-05/soviet05.lua +++ b/mods/ra/maps/soviet-05/soviet05.lua @@ -28,7 +28,7 @@ CheckForSPen = function() end RunInitialActivities = function() - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Expand() ExpansionCheck = true else @@ -65,7 +65,7 @@ RunInitialActivities = function() ProduceInfantry() Trigger.AfterDelay(DateTime.Minutes(2), ProduceShips) - if Map.LobbyOption("difficulty") == "hard" or Map.LobbyOption("difficulty") == "normal" then + if Difficulty == "hard" or Difficulty == "normal" then Trigger.AfterDelay(DateTime.Seconds(25), ReinfInf) end Trigger.AfterDelay(DateTime.Minutes(2), ReinfInf) @@ -171,9 +171,9 @@ Tick = function() if not RCheck then RCheck = true - if Map.LobbyOption("difficulty") == "easy" and ReinfCheck then + if Difficulty == "easy" and ReinfCheck then Trigger.AfterDelay(DateTime.Minutes(6), ReinfArmor) - elseif Map.LobbyOption("difficulty") == "normal" then + elseif Difficulty == "normal" then Trigger.AfterDelay(DateTime.Minutes(4), ReinfArmor) else Trigger.AfterDelay(DateTime.Minutes(3), ReinfArmor) @@ -226,7 +226,7 @@ WorldLoaded = function() HoldObjective = player.AddObjective("Defend the Radar Dome.") player.MarkCompletedObjective(CaptureObjective) Beacon.New(player, MCVDeploy.CenterPosition) - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Actor.Create("camera", true, { Owner = player, Location = MCVDeploy.Location }) Media.DisplayMessage("Movement of an Allied expansion base discovered.") else diff --git a/mods/ra/maps/soviet-06a/soviet06a-reinforcements_teams.lua b/mods/ra/maps/soviet-06a/soviet06a-reinforcements_teams.lua index 22eedf3ff9..079030034a 100644 --- a/mods/ra/maps/soviet-06a/soviet06a-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-06a/soviet06a-reinforcements_teams.lua @@ -45,7 +45,7 @@ EnemyPaths = wave = 0 SendEnemies = function() - Trigger.AfterDelay(EnemyAttackDelay[Map.LobbyOption("difficulty")], function() + Trigger.AfterDelay(EnemyAttackDelay[Difficulty], function() wave = wave + 1 if wave > 3 then @@ -53,10 +53,10 @@ SendEnemies = function() end if wave == 1 then - local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2] + local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Difficulty][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2] Utils.Do(units, IdleHunt) else - local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2] + local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Difficulty][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2] Utils.Do(units, IdleHunt) end diff --git a/mods/ra/maps/soviet-06b/soviet06b-reinforcements_teams.lua b/mods/ra/maps/soviet-06b/soviet06b-reinforcements_teams.lua index 22eedf3ff9..079030034a 100644 --- a/mods/ra/maps/soviet-06b/soviet06b-reinforcements_teams.lua +++ b/mods/ra/maps/soviet-06b/soviet06b-reinforcements_teams.lua @@ -45,7 +45,7 @@ EnemyPaths = wave = 0 SendEnemies = function() - Trigger.AfterDelay(EnemyAttackDelay[Map.LobbyOption("difficulty")], function() + Trigger.AfterDelay(EnemyAttackDelay[Difficulty], function() wave = wave + 1 if wave > 3 then @@ -53,10 +53,10 @@ SendEnemies = function() end if wave == 1 then - local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2] + local units = Reinforcements.ReinforceWithTransport(enemy, "tran", EnemyReinforcements[Difficulty][wave], EnemyPaths[1], { EnemyPaths[1][1] })[2] Utils.Do(units, IdleHunt) else - local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Map.LobbyOption("difficulty")][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2] + local units = Reinforcements.ReinforceWithTransport(enemy, "lst", EnemyReinforcements[Difficulty][wave], EnemyPaths[2], { EnemyPaths[2][1] })[2] Utils.Do(units, IdleHunt) end diff --git a/mods/ra/maps/soviet-07/soviet07.lua b/mods/ra/maps/soviet-07/soviet07.lua index cc037d7d13..04d6b86306 100644 --- a/mods/ra/maps/soviet-07/soviet07.lua +++ b/mods/ra/maps/soviet-07/soviet07.lua @@ -6,11 +6,11 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then remainingTime = DateTime.Minutes(7) -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then remainingTime = DateTime.Minutes(6) -elseif Map.LobbyOption("difficulty") == "hard" then +elseif Difficulty == "hard" then remainingTime = DateTime.Minutes(5) end @@ -307,7 +307,7 @@ Tick = function() enemy.MarkCompletedObjective(alliedObjective) end - if remainingTime == DateTime.Minutes(5) and Map.LobbyOption("difficulty") ~= "hard" then + if remainingTime == DateTime.Minutes(5) and Difficulty ~= "hard" then Media.PlaySpeechNotification(player, "WarningFiveMinutesRemaining") elseif remainingTime == DateTime.Minutes(4) then Media.PlaySpeechNotification(player, "WarningFourMinutesRemaining") diff --git a/mods/ra/maps/soviet-08a/soviet08a-AI.lua b/mods/ra/maps/soviet-08a/soviet08a-AI.lua index 3b66ac30ba..935ff9aeb5 100644 --- a/mods/ra/maps/soviet-08a/soviet08a-AI.lua +++ b/mods/ra/maps/soviet-08a/soviet08a-AI.lua @@ -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) diff --git a/mods/ra/maps/soviet-08b/soviet08b-AI.lua b/mods/ra/maps/soviet-08b/soviet08b-AI.lua index c61a18931a..c77e191219 100644 --- a/mods/ra/maps/soviet-08b/soviet08b-AI.lua +++ b/mods/ra/maps/soviet-08b/soviet08b-AI.lua @@ -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) @@ -145,7 +144,7 @@ ActivateAI = function() Trigger.AfterDelay(DateTime.Minutes(3), WTransWaves) - Trigger.AfterDelay(AlliedVehiclesUpgradeDelay, function() AlliedVehicleType = "Upgraded" end) + Trigger.AfterDelay(AlliedVehiclesUpgradeDelay, function() AlliedVehicleType = "Upgraded" end) ProduceInfantry() ProduceVehicles() diff --git a/mods/ra/maps/soviet-09/soviet09-AI.lua b/mods/ra/maps/soviet-09/soviet09-AI.lua index 5551b39623..d234067ab5 100644 --- a/mods/ra/maps/soviet-09/soviet09-AI.lua +++ b/mods/ra/maps/soviet-09/soviet09-AI.lua @@ -73,7 +73,7 @@ ChinookAttack = function() end) ChinookAttacks = ChinookAttacks + 1 - if ChinookAttacks <= ChinookWaves[Map.LobbyOption("difficulty")] then + if ChinookAttacks <= ChinookWaves[Difficulty] then ChinookAttack() end end) @@ -87,7 +87,7 @@ ProduceInfantry = function() Germany.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 @@ -99,7 +99,7 @@ ProduceVehicles = function() Germany.Build({ Utils.Random(AlliedVehicles) }, function(units) table.insert(AttackGroup, units[1]) SendAttackGroup() - Trigger.AfterDelay(ProductionInterval[Map.LobbyOption("difficulty")], ProduceVehicles) + Trigger.AfterDelay(ProductionInterval[Difficulty], ProduceVehicles) end) end @@ -146,7 +146,7 @@ GermanAircraft = function() local alive = Utils.Where(Longbows, function(y) return not y.IsDead end) if #alive < 2 then - Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Map.LobbyOption("difficulty")] / 2), GermanAircraft) + Trigger.AfterDelay(DateTime.Seconds(ProductionInterval[Difficulty] / 2), GermanAircraft) end InitializeAttackAircraft(longbow, USSR) @@ -168,9 +168,8 @@ WTransWaves = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - WTransDelays = WTransDelays[difficulty] - ChinookDelay = ChinookDelay[difficulty] + WTransDelays = WTransDelays[Difficulty] + ChinookDelay = ChinookDelay[Difficulty] local buildings = Utils.Where(Map.ActorsInWorld, function(self) return self.Owner ~= USSR and self.HasProperty("StartBuildingRepairs") end) Utils.Do(buildings, function(actor) diff --git a/mods/ra/maps/soviet-10/soviet10.lua b/mods/ra/maps/soviet-10/soviet10.lua index af8af4a225..39e45bbd57 100644 --- a/mods/ra/maps/soviet-10/soviet10.lua +++ b/mods/ra/maps/soviet-10/soviet10.lua @@ -147,7 +147,7 @@ MissionSetup = function() if not attackTriggered and unit.Type == "3tnk" then Trigger.RemoveFootprintTrigger(id) attackTriggered = true - + Utils.Do(LightVehicleAttack, function(unit) if not unit.IsDead then IdleHunt(unit) @@ -177,7 +177,7 @@ MissionSetup = function() if not chinookTriggered and unit.Owner == USSR then Trigger.RemoveFootprintTrigger(id) chinookTriggered = true - + local chalk = Reinforcements.ReinforceWithTransport(Greece, "tran", ChinookChalk , ChinookPath, { ChinookPath[1] })[2] Utils.Do(chalk, function(unit) Trigger.OnAddedToWorld(unit, IdleHunt) @@ -336,9 +336,8 @@ WorldLoaded = function() end) end) - difficulty = Map.LobbyOption("difficulty") - ConvoyEscort = ConvoyEscort[difficulty] - StartTimerDelay = StartTimerDelay[difficulty] + ConvoyEscort = ConvoyEscort[Difficulty] + StartTimerDelay = StartTimerDelay[Difficulty] MissionStart() MissionSetup() diff --git a/mods/ra/maps/soviet-11a/soviet11a-AI.lua b/mods/ra/maps/soviet-11a/soviet11a-AI.lua index e502b37ecb..dce85af702 100644 --- a/mods/ra/maps/soviet-11a/soviet11a-AI.lua +++ b/mods/ra/maps/soviet-11a/soviet11a-AI.lua @@ -33,7 +33,7 @@ TransportDelays = } AlliedShips = -{ +{ easy = { "pt", "pt", "dd" }, normal = { "pt", "dd", "dd" }, hard = { "dd", "dd" , "dd" } @@ -44,7 +44,7 @@ Helis = { } PatrolWay = { ShipWaypoint1.Location, ShipWaypoint2.Location, ShipWaypoint3.Location, ShipWaypoint4.Location, ShipWaypoint5.Location } TransportWays = -{ +{ { AlliedTransportEntry1.Location, AlliedTransportDrop1.Location }, { AlliedTransportEntry2.Location, AlliedTransportDrop2.Location }, { AlliedTransportEntry3.Location, AlliedTransportDrop3.Location } @@ -169,7 +169,7 @@ ProduceHelicopters = function() Greece.Build(HeliType, function(helis) local heli = helis[1] Helis[#Helis+1] = heli - + Trigger.OnKilled(heli, ProduceHelicopters) local alive = Utils.Where(Helis, function(y) return not y.IsDead end) @@ -205,11 +205,11 @@ BridgeTrigger = function() TheBridge.Kill() end end) - + Trigger.OnEnteredProximityTrigger(BaseBridge.CenterPosition, WDist.FromCells(3), function(actor, id) if actor.Owner == USSR and actor.Type ~= "badr" and actor.Type ~= "u2" and actor.Type ~= "camera.spyplane" then Trigger.RemoveProximityTrigger(id) - + if not BridgeTank.IsDead and not BridgeBarrel.IsDead and not TheBridge.IsDead then BridgeTank.Attack(BridgeBarrel, true, true) end @@ -218,13 +218,12 @@ BridgeTrigger = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - TransportDelays = TransportDelays[difficulty] - DestroyerDelays = DestroyerDelays[difficulty] - TransportUnits = TransportUnits[difficulty] - ProductionDelays = ProductionDelays[difficulty] - AlliedShips = AlliedShips[difficulty] - SurpriseTransportUnits = SurpriseTransportUnits[difficulty] + TransportDelays = TransportDelays[Difficulty] + DestroyerDelays = DestroyerDelays[Difficulty] + TransportUnits = TransportUnits[Difficulty] + ProductionDelays = ProductionDelays[Difficulty] + AlliedShips = AlliedShips[Difficulty] + SurpriseTransportUnits = SurpriseTransportUnits[Difficulty] BuildingsHealing() AlliedTransportAmbush() diff --git a/mods/ra/maps/soviet-11b/soviet11b-AI.lua b/mods/ra/maps/soviet-11b/soviet11b-AI.lua index d8257e0805..79f7aa8c0f 100644 --- a/mods/ra/maps/soviet-11b/soviet11b-AI.lua +++ b/mods/ra/maps/soviet-11b/soviet11b-AI.lua @@ -36,7 +36,7 @@ TransportDelays = } AlliedShips = -{ +{ easy = { "pt", "pt", "dd" }, normal = { "pt", "dd", "dd" }, hard = { "dd", "dd" , "dd" } @@ -47,7 +47,7 @@ Helis = { } PatrolWay = { ShipWaypoint1.Location, ShipWaypoint2.Location, ShipWaypoint3.Location, ShipWaypoint4.Location, ShipWaypoint5.Location } TransportWays = -{ +{ { AlliedTransportEntry1.Location, AlliedTransportDrop1.Location }, { AlliedTransportEntry2.Location, AlliedTransportDrop2.Location }, { AlliedTransportEntry3.Location, AlliedTransportDrop3.Location } @@ -175,7 +175,7 @@ ProduceHelicopters = function() Greece.Build(HeliType, function(helis) local heli = helis[1] Helis[#Helis+1] = heli - + Trigger.OnKilled(heli, ProduceHelicopters) local alive = Utils.Where(Helis, function(y) return not y.IsDead end) @@ -211,11 +211,11 @@ BridgeTrigger = function() TheBridge.Kill() end end) - + Trigger.OnEnteredProximityTrigger(BaseBridge.CenterPosition, WDist.FromCells(3), function(actor, id) if actor.Owner == USSR and actor.Type ~= "badr" and actor.Type ~= "u2" and actor.Type ~= "camera.spyplane" then Trigger.RemoveProximityTrigger(id) - + if not BridgeTank.IsDead and not BridgeBarrel.IsDead and not TheBridge.IsDead then BridgeTank.Attack(BridgeBarrel, true, true) end @@ -224,13 +224,12 @@ BridgeTrigger = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - TransportDelays = TransportDelays[difficulty] - DestroyerDelays = DestroyerDelays[difficulty] - TransportUnits = TransportUnits[difficulty] - ProductionDelays = ProductionDelays[difficulty] - AlliedShips = AlliedShips[difficulty] - SurpriseTransportUnits = SurpriseTransportUnits[difficulty] + TransportDelays = TransportDelays[Difficulty] + DestroyerDelays = DestroyerDelays[Difficulty] + TransportUnits = TransportUnits[Difficulty] + ProductionDelays = ProductionDelays[Difficulty] + AlliedShips = AlliedShips[Difficulty] + SurpriseTransportUnits = SurpriseTransportUnits[Difficulty] BuildingsHealing() AlliedTransportAmbush() diff --git a/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi-AI.lua b/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi-AI.lua index 3e8566c3d0..33167acbc7 100644 --- a/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi-AI.lua +++ b/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi-AI.lua @@ -8,12 +8,12 @@ ]] AlliedInfantryTypes = { "e1", "e3" } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then AlliedArmorTypes = { "1tnk", "1tnk" } else AlliedArmorTypes = { "1tnk", "2tnk" } end -if Map.LobbyOption("difficulty") == "hard" then +if Difficulty == "hard" then AlliedNavyGuard = { "ca", "ca" } else AlliedNavyGuard = { "ca" } @@ -87,10 +87,10 @@ ProduceArmor = function() greece.Build(toBuild, function(unit) ArmorAttack[#ArmorAttack + 1] = unit[1] - if #ArmorAttack >= ArmorAttackNumbers[Map.LobbyOption("difficulty")] then + if #ArmorAttack >= ArmorAttackNumbers[Difficulty] then SendAttackToBase(ArmorAttack) ArmorAttack = { } - Trigger.AfterDelay(ArmorAttackDelays[Map.LobbyOption("difficulty")], ProduceArmor) + Trigger.AfterDelay(ArmorAttackDelays[Difficulty], ProduceArmor) else Trigger.AfterDelay(delay, ProduceArmor) end diff --git a/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi.lua b/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi.lua index b64d748dcf..259ab90a8f 100644 --- a/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi.lua +++ b/mods/ra/maps/soviet-soldier-volkov-n-chitzkoi/soviet-soldier-volkov-n-chitzkoi.lua @@ -53,11 +53,11 @@ WorldLoaded = function() --AI Production Setup ProduceArmor() - if Map.LobbyOption("difficulty") == "easy" then + if Difficulty == "easy" then Trigger.AfterDelay(DateTime.Minutes(10), ProduceNavyGuard) - elseif Map.LobbyOption("difficulty") == "normal" then + elseif Difficulty == "normal" then Trigger.AfterDelay(DateTime.Minutes(5), ProduceNavyGuard) - elseif Map.LobbyOption("difficulty") == "hard" then + elseif Difficulty == "hard" then ProduceNavyGuard() end @@ -334,7 +334,7 @@ WorldLoaded = function() Trigger.AfterDelay(DateTime.Seconds(10), function() if prtcamera.IsInWorld then prtcamera.Destroy() end end) - if Map.LobbyOption("difficulty") == "hard" and not RiflemanGuard01.IsDead then + if Difficulty == "hard" and not RiflemanGuard01.IsDead then Trigger.ClearAll(RiflemanGuard01) ProduceInfantry() --Greece will start infantry production right away if the difficulty is set to hard end diff --git a/mods/ra/maps/survival01/survival01.lua b/mods/ra/maps/survival01/survival01.lua index 3a970a685c..7fbb0bc06b 100644 --- a/mods/ra/maps/survival01/survival01.lua +++ b/mods/ra/maps/survival01/survival01.lua @@ -6,7 +6,6 @@ the License, or (at your option) any later version. For more information, see COPYING. ]] -Difficulty = Map.LobbyOption("difficulty") if Difficulty == "easy" then AttackAtFrameIncrement = DateTime.Seconds(22) diff --git a/mods/ra/maps/top-o-the-world/top-o-the-world.lua b/mods/ra/maps/top-o-the-world/top-o-the-world.lua index 8f5de130cc..f8417a8e1e 100644 --- a/mods/ra/maps/top-o-the-world/top-o-the-world.lua +++ b/mods/ra/maps/top-o-the-world/top-o-the-world.lua @@ -22,11 +22,11 @@ AlliedSquad02 = { AlliedSquad02RifleInf01, AlliedSquad02RifleInf02, AlliedSquad0 AlliedSquad03 = { AlliedSquad03LTank01, AlliedSquad03RocketInf01, AlliedSquad03RocketInf02, AlliedSquad03RocketInf03 } AlliedSquad04 = { AlliedSquad04MGG01, AlliedSquad04MTank01, AlliedSquad04MTank02, AlliedSquad04MTank03, AlliedSquad04MTank04, AlliedSquad04MTank05, AlliedSquad04Arty01, AlliedSquad04Arty02, AlliedSquad04Arty03 } AlliedTanksReinforcement = { "2tnk", "2tnk" } -if Map.LobbyOption("difficulty") == "easy" then +if Difficulty == "easy" then AlliedHuntingParty = { "1tnk" } -elseif Map.LobbyOption("difficulty") == "normal" then +elseif Difficulty == "normal" then AlliedHuntingParty = { "1tnk", "1tnk" } -elseif Map.LobbyOption("difficulty") == "hard" then +elseif Difficulty == "hard" then AlliedHuntingParty = { "1tnk", "1tnk", "1tnk" } end @@ -197,12 +197,12 @@ WorldLoaded = function() if bridgecamera01.IsInWorld then bridgecamera01.Destroy() end if bridgecamera02.IsInWorld then bridgecamera02.Destroy() end end) - if Map.LobbyOption("difficulty") == "normal" then + if Difficulty == "normal" then Reinforcements.Reinforce(goodguy, { "dd" }, { AlliedDestroyer01Spawn.Location, AlliedDestroyer01WP01.Location, AlliedDestroyer01WP02.Location }, 0, function(unit) unit.Stance = "Defend" end) end - if Map.LobbyOption("difficulty") == "hard" then + if Difficulty == "hard" then Reinforcements.Reinforce(goodguy, { "dd" }, { AlliedDestroyer01Spawn.Location, AlliedDestroyer01WP01.Location, AlliedDestroyer01WP02.Location }, 0, function(unit) unit.Stance = "Defend" end)