From 09834d3954bfbf14d06c2075968356b87f24c250 Mon Sep 17 00:00:00 2001 From: JovialFeline Date: Sat, 9 Dec 2023 15:51:17 -0500 Subject: [PATCH] Add Pillbox, early dog attack to allies-02 --- mods/ra/maps/allies-02/allies02.lua | 48 ++++++++++++++-- mods/ra/maps/allies-02/map.yaml | 86 ++++++++++++++--------------- mods/ra/maps/allies-02/rules.yaml | 4 -- 3 files changed, 87 insertions(+), 51 deletions(-) diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index d9860170f85d..cc19708dcd57 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -58,16 +58,22 @@ RunInitialActivities = function() Harvester.FindResources() Trigger.OnKilled(Harvester, function() HarvesterKilled = true end) + ScheduleEarlyAttackers() + Trigger.OnAllKilled(PathGuards, function() Greece.MarkCompletedObjective(SecureObjective) SendTrucks() end) Trigger.OnAllKilled(SovietBase, function() + local livePathGuards = Utils.Where(PathGuards, function(pg) return not pg.IsDead end) + Utils.Do(USSR.GetGroundAttackers(), function(unit) - if not Utils.Any(PathGuards, function(pg) return pg == unit end) then - Trigger.OnIdle(unit, unit.Hunt) + if Utils.Any(livePathGuards, function(pg) return pg == unit end) then + return end + + Trigger.OnIdle(unit, unit.Hunt) end) end) @@ -202,12 +208,12 @@ SendTrucks = function() end end end) - Trigger.OnAnyKilled(trucks, ConvoyCasualites) + Trigger.OnAnyKilled(trucks, ConvoyCasualties) end) end end -ConvoyCasualites = function() +ConvoyCasualties = function() Media.PlaySpeechNotification(Greece, "ConvoyUnitLost") if ConvoyUnharmed then ConvoyUnharmed = false @@ -215,6 +221,40 @@ ConvoyCasualites = function() end end +ScheduleEarlyAttackers = function() + if Difficulty == "tough" then + Trigger.AfterDelay(DateTime.Seconds(12), SendEarlyAttackers) + return + end + + Trigger.AfterDelay(DateTime.Seconds(6), function() + if not Greece.HasPrerequisites({ "anypower" }) then + ScheduleEarlyAttackers() + return + end + + SendEarlyAttackers() + end) +end + +SendEarlyAttackers = function() + local team = { EarlyAttacker1, EarlyAttacker2, EarlyAttacker3, EarlyAttacker4 } + local dogTargets = Greece.GetActorsByType("e1") + + Utils.Do(team, function(member) + if member.IsDead then + return + end + + -- Get attack dogs sprinting. + if member.Type == "dog" and #dogTargets > 0 then + member.Attack(Utils.Random(dogTargets)) + end + + Trigger.OnIdle(member, member.Hunt) + end) +end + WorldLoaded = function() Greece = Player.GetPlayer("Greece") England = Player.GetPlayer("England") diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index 3fd8ef41571f..d2dec45e2385 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -307,97 +307,97 @@ Actors: Actor97: dog Location: 65,68 Owner: USSR - Facing: 256 + Facing: 768 SubCell: 3 Actor98: dog Location: 65,66 Owner: USSR - Facing: 128 + Facing: 896 SubCell: 2 Actor99: dog Location: 59,70 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 2 Actor100: e2 Location: 61,56 Owner: USSR - Facing: 128 + Facing: 896 SubCell: 3 Actor101: e2 Location: 59,57 Owner: USSR - Facing: 896 + Facing: 128 SubCell: 4 Actor102: e2 Location: 64,67 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 0 - Actor103: e1 + EarlyAttacker3: e1 Location: 78,74 Owner: USSR - Facing: 512 SubCell: 2 + Facing: 512 Actor104: e1 Location: 80,74 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 0 Actor105: e1 Location: 56,68 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 3 Actor107: e1 Location: 73,60 Owner: USSR - Facing: 128 + Facing: 896 SubCell: 2 Actor108: e1 Location: 74,61 Owner: USSR - Facing: 896 + Facing: 128 SubCell: 1 Actor109: e1 Location: 72,60 Owner: USSR - Facing: 256 + Facing: 768 SubCell: 0 Actor115: e1 Location: 60,64 Owner: USSR - Facing: 896 + Facing: 128 SubCell: 3 Actor116: e2 Location: 68,45 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 0 Actor118: e1 Location: 57,69 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 1 Actor119: e2 Location: 60,70 Owner: USSR - Facing: 128 + Facing: 896 SubCell: 0 Actor120: e1 Location: 89,48 Owner: Greece - Facing: 640 + Facing: 384 SubCell: 1 Actor121: e1 Location: 87,48 Owner: Greece - Facing: 768 + Facing: 256 SubCell: 4 Actor122: e1 Location: 87,48 Owner: Greece - Facing: 768 + Facing: 256 SubCell: 1 Actor123: e1 Location: 88,48 @@ -409,21 +409,21 @@ Actors: Owner: Greece Facing: 512 SubCell: 1 - Actor125: dog + EarlyAttacker4: dog Location: 78,75 Owner: USSR - Facing: 640 SubCell: 1 - Actor126: e1 + Facing: 384 + EarlyAttacker1: e1 Location: 71,61 Owner: USSR - Facing: 640 SubCell: 0 - Actor127: dog + Facing: 384 + EarlyAttacker2: dog Location: 70,61 Owner: USSR - Facing: 384 SubCell: 4 + Facing: 640 Actor136: e2 Location: 69,66 Owner: USSR @@ -431,12 +431,12 @@ Actors: Actor137: e2 Location: 73,51 Owner: USSR - Facing: 896 + Facing: 128 SubCell: 4 Actor138: medi Location: 88,48 Owner: Greece - Facing: 640 + Facing: 384 SubCell: 1 Actor139: fenc Location: 57,75 @@ -562,56 +562,56 @@ Actors: Harvester: harv Location: 55,65 Owner: USSR - Facing: 640 + Facing: 384 PathGuard1: e1 Location: 50,72 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 4 PathGuard2: e1 Location: 49,58 Owner: USSR - Facing: 768 + Facing: 256 SubCell: 0 PathGuard3: e1 Location: 51,58 Owner: USSR - Facing: 128 + Facing: 896 SubCell: 1 PathGuard4: e1 Location: 60,78 Owner: USSR - Facing: 768 + Facing: 256 SubCell: 4 PathGuard5: e2 Location: 62,79 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 4 PathGuard6: e1 Location: 48,72 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 0 PathGuard7: e1 Location: 50,46 Owner: USSR - Facing: 128 + Facing: 896 SubCell: 1 PathGuard8: e1 Location: 49,47 Owner: USSR - Facing: 256 + Facing: 768 SubCell: 0 PathGuard9: e2 Location: 49,49 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 1 PathGuard10: e2 Location: 47,46 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 3 PathGuard11: e2 Location: 48,63 @@ -620,22 +620,22 @@ Actors: PathGuard12: e1 Location: 49,63 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 2 PathGuard13: e1 Location: 74,81 Owner: USSR - Facing: 256 + Facing: 768 SubCell: 3 PathGuard14: e2 Location: 75,83 Owner: USSR - Facing: 384 + Facing: 640 SubCell: 0 PathGuard15: e1 Location: 57,82 Owner: USSR - Facing: 640 + Facing: 384 SubCell: 1 TruckEntryPoint: waypoint Location: 49,44 diff --git a/mods/ra/maps/allies-02/rules.yaml b/mods/ra/maps/allies-02/rules.yaml index 52a00f0856ff..a8e8a7075643 100644 --- a/mods/ra/maps/allies-02/rules.yaml +++ b/mods/ra/maps/allies-02/rules.yaml @@ -66,10 +66,6 @@ HBOX: Buildable: Prerequisites: ~disabled -PBOX: - Buildable: - Prerequisites: ~disabled - GUN: Buildable: Prerequisites: ~disabled