From 3c24a3f9c7479833093332961cf4855714328e10 Mon Sep 17 00:00:00 2001 From: Smittytron Date: Tue, 28 Dec 2021 20:36:45 -0600 Subject: [PATCH] Update Allies10a to work with Lua cleanup --- mods/ra/maps/allies-10a/allies10a-AI.lua | 13 ++++++------- mods/ra/maps/allies-10a/allies10a.lua | 17 +---------------- mods/ra/maps/allies-10a/rules.yaml | 2 +- 3 files changed, 8 insertions(+), 24 deletions(-) diff --git a/mods/ra/maps/allies-10a/allies10a-AI.lua b/mods/ra/maps/allies-10a/allies10a-AI.lua index 6cfb658ab9..c16857a906 100644 --- a/mods/ra/maps/allies-10a/allies10a-AI.lua +++ b/mods/ra/maps/allies-10a/allies10a-AI.lua @@ -45,7 +45,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 @@ -74,7 +74,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 @@ -86,7 +86,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 @@ -103,7 +103,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) @@ -155,9 +155,8 @@ SendParabombs = function() end ActivateAI = function() - local difficulty = Map.LobbyOption("difficulty") - ParadropDelay = ParadropDelay[difficulty] - BombDelays = BombDelays[difficulty] + ParadropDelay = ParadropDelay[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-10a/allies10a.lua b/mods/ra/maps/allies-10a/allies10a.lua index e20bc7f3b1..33e59affbb 100644 --- a/mods/ra/maps/allies-10a/allies10a.lua +++ b/mods/ra/maps/allies-10a/allies10a.lua @@ -160,26 +160,11 @@ WorldLoaded = function() USSR = Player.GetPlayer("USSR") BadGuy = Player.GetPlayer("BadGuy") - Trigger.OnObjectiveAdded(Greece, function(p, id) - Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") - end) + InitObjectives(Greece) HoldOut = USSR.AddObjective("Hold out until missiles reach their destination") ApproachBase = Greece.AddObjective("Find a way to take the atomic weapons off-line.") - Trigger.OnObjectiveCompleted(Greece, function(p, id) - Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed") - end) - Trigger.OnObjectiveFailed(Greece, function(p, id) - Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") - end) - Trigger.OnPlayerLost(Greece, function() - Media.PlaySpeechNotification(Greece, "Lose") - end) - Trigger.OnPlayerWon(Greece, function() - Media.PlaySpeechNotification(Greece, "Win") - end) - Camera.Position = DefaultCameraPosition.CenterPosition StandardDrop = Actor.Create("paradrop", false, { Owner = USSR }) MissionStart() diff --git a/mods/ra/maps/allies-10a/rules.yaml b/mods/ra/maps/allies-10a/rules.yaml index 7fce955324..c3a66c5bb6 100644 --- a/mods/ra/maps/allies-10a/rules.yaml +++ b/mods/ra/maps/allies-10a/rules.yaml @@ -1,6 +1,6 @@ World: LuaScript: - Scripts: allies10a.lua, allies10a-AI.lua, campaign-global.lua + Scripts: allies10a.lua, allies10a-AI.lua, campaign.lua, utils.lua MissionData: BriefingVideo: ally10.vqa LossVideo: trinity.vqa