From 958d839802c150a5154cdc99ce492767be87dbac Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 31 May 2015 17:42:36 +0200 Subject: [PATCH 1/4] Remove Ukraine from allies02 --- mods/ra/maps/allies-02/allies02.lua | 3 +-- mods/ra/maps/allies-02/map.yaml | 37 ++++++++++++----------------- 2 files changed, 16 insertions(+), 24 deletions(-) diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index 3a9ecc2607..392e332133 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -34,7 +34,7 @@ ticked = TimerTicks Tick = function() ussr.Resources = ussr.Resources - (0.01 * ussr.ResourceCapacity / 25) - if ukraine.HasNoRequiredUnits() then + if ussr.HasNoRequiredUnits() then SendTrucks() player.MarkCompletedObjective(ConquestObjective) end @@ -114,7 +114,6 @@ WorldLoaded = function() player = Player.GetPlayer("Greece") france = Player.GetPlayer("France") ussr = Player.GetPlayer("USSR") - ukraine = Player.GetPlayer("Ukraine") Trigger.OnObjectiveAdded(player, function(p, id) Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index a63ff33729..b270c96ca8 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -39,26 +39,19 @@ Players: Name: USSR Faction: soviet ColorRamp: 3,255,127 - Allies: Ukraine Enemies: Greece, France PlayerReference@France: Name: France NonCombatant: True Faction: allies ColorRamp: 115,115,143 - Allies: Greece, France - Enemies: USSR, Ukraine + Allies: Greece + Enemies: USSR PlayerReference@Neutral: Name: Neutral OwnsWorld: True NonCombatant: True Faction: allies - PlayerReference@Ukraine: - Name: Ukraine - Faction: soviet - ColorRamp: 3,255,127 - Allies: USSR - Enemies: Greece, France PlayerReference@Greece: Name: Greece Playable: True @@ -71,7 +64,7 @@ Players: LockSpawn: True LockTeam: True Allies: France - Enemies: USSR, Ukraine + Enemies: USSR Actors: EntryPoint: t06 @@ -395,7 +388,7 @@ Actors: SubCell: 0 Actor103: e1 Location: 77,74 - Owner: Ukraine + Owner: USSR Facing: 128 SubCell: 2 Actor104: e1 @@ -505,56 +498,56 @@ Actors: SubCell: 1 Actor125: dog Location: 78,75 - Owner: Ukraine + Owner: USSR Facing: 160 SubCell: 1 Actor126: e1 Location: 71,61 - Owner: Ukraine + Owner: USSR Facing: 160 SubCell: 0 Actor127: dog Location: 70,61 - Owner: Ukraine + Owner: USSR Facing: 96 SubCell: 4 Actor128: e1 Location: 50,46 - Owner: Ukraine + Owner: USSR Facing: 32 SubCell: 1 Actor129: e1 Location: 49,47 - Owner: Ukraine + Owner: USSR Facing: 64 SubCell: 0 Actor130: e2 Location: 49,49 - Owner: Ukraine + Owner: USSR Facing: 160 SubCell: 1 Actor131: e2 Location: 47,46 - Owner: Ukraine + Owner: USSR Facing: 96 SubCell: 3 Actor132: e2 Location: 48,63 - Owner: Ukraine + Owner: USSR SubCell: 1 Actor133: e1 Location: 49,63 - Owner: Ukraine + Owner: USSR Facing: 96 SubCell: 2 Actor134: e1 Location: 74,81 - Owner: Ukraine + Owner: USSR Facing: 64 SubCell: 3 Actor135: e2 Location: 75,83 - Owner: Ukraine + Owner: USSR Facing: 96 SubCell: 0 Actor136: e2 From 4556a6ebb3d7ad6212c1789e948abd96e75c9523 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 31 May 2015 19:28:16 +0200 Subject: [PATCH 2/4] Adjust the objectives in allies02 --- mods/ra/maps/allies-02/allies02.lua | 35 +++---- mods/ra/maps/allies-02/map.yaml | 148 ++++++++++++++-------------- 2 files changed, 92 insertions(+), 91 deletions(-) diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index 392e332133..1ccf47a9d0 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -7,11 +7,9 @@ JeepPath = { ReinforcementsEntryPoint.Location, ReinforcementsRallyPoint.Locatio TruckReinforcements = { "truk", "truk", "truk" } TruckPath = { TruckEntryPoint.Location, TruckRallyPoint.Location } -TimerTicks = DateTime.Minutes(10) +PathGuards = { PathGuard1, PathGuard2, PathGuard3, PathGuard4, PathGuard5, PathGuard6, PathGuard7, PathGuard8, PathGuard9, PathGuard10, PathGuard11, PathGuard12, PathGuard13, PathGuard14, PathGuard15 } -SendConstructionVehicleReinforcements = function() - local mcv = Reinforcements.Reinforce(player, ConstructionVehicleReinforcements, ConstructionVehiclePath)[1] -end +TimerTicks = DateTime.Minutes(10) SendJeepReinforcements = function() Media.PlaySpeechNotification(player, "ReinforcementsArrived") @@ -20,14 +18,8 @@ end RunInitialActivities = function() Harvester.FindResources() -end -MissionAccomplished = function() - Media.PlaySpeechNotification(player, "MissionAccomplished") -end - -MissionFailed = function() - Media.PlaySpeechNotification(player, "MissionFailed") + Trigger.OnAllKilled(PathGuards, SendTrucks) end ticked = TimerTicks @@ -35,12 +27,11 @@ Tick = function() ussr.Resources = ussr.Resources - (0.01 * ussr.ResourceCapacity / 25) if ussr.HasNoRequiredUnits() then - SendTrucks() player.MarkCompletedObjective(ConquestObjective) end if player.HasNoRequiredUnits() then - player.MarkFailedObjective(ConquestObjective) + ussr.MarkCompletedObjective(ussrObj) end if ticked > 0 then @@ -69,8 +60,11 @@ ConvoyOnSite = false SendTrucks = function() if not ConvoyOnSite then ConvoyOnSite = true + ticked = 0 ConvoyObjective = player.AddPrimaryObjective("Escort the convoy.") + player.MarkCompletedObjective(SecureObjective) + Media.PlaySpeechNotification(player, "ConvoyApproaching") Trigger.AfterDelay(DateTime.Seconds(3), function() ConvoyUnharmed = true @@ -124,16 +118,23 @@ WorldLoaded = function() Trigger.OnObjectiveFailed(player, function(p, id) Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") end) - Trigger.OnPlayerLost(player, MissionFailed) - Trigger.OnPlayerWon(player, MissionAccomplished) + Trigger.OnPlayerLost(player, function() + Media.PlaySpeechNotification(player, "MissionFailed") + end) + Trigger.OnPlayerWon(player, function() + Media.PlaySpeechNotification(player, "MissionAccomplished") + end) - ConquestObjective = player.AddPrimaryObjective("Secure the area.") + ussrObj = ussr.AddPrimaryObjective("Deny the allies!") + + SecureObjective = player.AddPrimaryObjective("Secure the convoy's path.") + ConquestObjective = player.AddPrimaryObjective("Eliminate the entire soviet presence in this area.") Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(allies, "MissionTimerInitialised") end) RunInitialActivities() - SendConstructionVehicleReinforcements() + Reinforcements.Reinforce(player, ConstructionVehicleReinforcements, ConstructionVehiclePath) Trigger.AfterDelay(DateTime.Seconds(5), SendJeepReinforcements) Trigger.AfterDelay(DateTime.Seconds(10), SendJeepReinforcements) diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index b270c96ca8..3818599f5f 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -401,11 +401,6 @@ Actors: Owner: USSR Facing: 160 SubCell: 3 - Actor106: e1 - Location: 50,72 - Owner: USSR - Facing: 160 - SubCell: 4 Actor107: e1 Location: 73,60 Owner: USSR @@ -421,31 +416,6 @@ Actors: Owner: USSR Facing: 64 SubCell: 0 - Actor110: e1 - Location: 49,58 - Owner: USSR - Facing: 192 - SubCell: 0 - Actor111: e1 - Location: 51,58 - Owner: USSR - Facing: 32 - SubCell: 1 - Actor112: e1 - Location: 60,78 - Owner: USSR - Facing: 192 - SubCell: 4 - Actor113: e2 - Location: 62,79 - Owner: USSR - Facing: 160 - SubCell: 4 - Actor114: e1 - Location: 57,82 - Owner: USSR - Facing: 160 - SubCell: 1 Actor115: e1 Location: 60,64 Owner: USSR @@ -456,11 +426,6 @@ Actors: Owner: USSR Facing: 96 SubCell: 0 - Actor117: e1 - Location: 48,72 - Owner: USSR - Facing: 96 - SubCell: 0 Actor118: e1 Location: 57,69 Owner: USSR @@ -511,45 +476,6 @@ Actors: Owner: USSR Facing: 96 SubCell: 4 - Actor128: e1 - Location: 50,46 - Owner: USSR - Facing: 32 - SubCell: 1 - Actor129: e1 - Location: 49,47 - Owner: USSR - Facing: 64 - SubCell: 0 - Actor130: e2 - Location: 49,49 - Owner: USSR - Facing: 160 - SubCell: 1 - Actor131: e2 - Location: 47,46 - Owner: USSR - Facing: 96 - SubCell: 3 - Actor132: e2 - Location: 48,63 - Owner: USSR - SubCell: 1 - Actor133: e1 - Location: 49,63 - Owner: USSR - Facing: 96 - SubCell: 2 - Actor134: e1 - Location: 74,81 - Owner: USSR - Facing: 64 - SubCell: 3 - Actor135: e2 - Location: 75,83 - Owner: USSR - Facing: 96 - SubCell: 0 Actor136: e2 Location: 69,66 Owner: USSR @@ -669,6 +595,80 @@ Actors: Owner: USSR Health: 50 Facing: 160 + PathGuard1: e1 + Location: 50,72 + Owner: USSR + Facing: 160 + SubCell: 4 + PathGuard2: e1 + Location: 49,58 + Owner: USSR + Facing: 192 + SubCell: 0 + PathGuard3: e1 + Location: 51,58 + Owner: USSR + Facing: 32 + SubCell: 1 + PathGuard4: e1 + Location: 60,78 + Owner: USSR + Facing: 192 + SubCell: 4 + PathGuard5: e2 + Location: 62,79 + Owner: USSR + Facing: 160 + SubCell: 4 + PathGuard6: e1 + Location: 48,72 + Owner: USSR + Facing: 96 + SubCell: 0 + PathGuard7: e1 + Location: 50,46 + Owner: USSR + Facing: 32 + SubCell: 1 + PathGuard8: e1 + Location: 49,47 + Owner: USSR + Facing: 64 + SubCell: 0 + PathGuard9: e2 + Location: 49,49 + Owner: USSR + Facing: 160 + SubCell: 1 + PathGuard10: e2 + Location: 47,46 + Owner: USSR + Facing: 96 + SubCell: 3 + PathGuard11: e2 + Location: 48,63 + Owner: USSR + SubCell: 1 + PathGuard12: e1 + Location: 49,63 + Owner: USSR + Facing: 96 + SubCell: 2 + PathGuard13: e1 + Location: 74,81 + Owner: USSR + Facing: 64 + SubCell: 3 + PathGuard14: e2 + Location: 75,83 + Owner: USSR + Facing: 96 + SubCell: 0 + PathGuard15: e1 + Location: 57,82 + Owner: USSR + Facing: 160 + SubCell: 1 TruckEntryPoint: waypoint Location: 49,44 Owner: Neutral From 384a67def59e1c73fd2df5892e850389a7db1938 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 31 May 2015 22:52:13 +0200 Subject: [PATCH 3/4] Add different difficulties to allies02 --- mods/ra/maps/allies-02/allies02.lua | 154 +++++++++++++++++++++++++--- mods/ra/maps/allies-02/map.yaml | 18 ++-- 2 files changed, 152 insertions(+), 20 deletions(-) diff --git a/mods/ra/maps/allies-02/allies02.lua b/mods/ra/maps/allies-02/allies02.lua index 1ccf47a9d0..cf6af42e3b 100644 --- a/mods/ra/maps/allies-02/allies02.lua +++ b/mods/ra/maps/allies-02/allies02.lua @@ -9,7 +9,61 @@ TruckPath = { TruckEntryPoint.Location, TruckRallyPoint.Location } PathGuards = { PathGuard1, PathGuard2, PathGuard3, PathGuard4, PathGuard5, PathGuard6, PathGuard7, PathGuard8, PathGuard9, PathGuard10, PathGuard11, PathGuard12, PathGuard13, PathGuard14, PathGuard15 } -TimerTicks = DateTime.Minutes(10) +IdlingUnits = { } + +if Map.Difficulty == "Easy" then + TimerTicks = DateTime.Minutes(10) + Announcements = + { + { "TenMinutesRemaining", DateTime.Seconds(3) }, + { "WarningFiveMinutesRemaining", DateTime.Minutes(5) }, + { "WarningFourMinutesRemaining", DateTime.Minutes(6) }, + { "WarningThreeMinutesRemaining", DateTime.Minutes(7) }, + { "WarningTwoMinutesRemaining", DateTime.Minutes(8) }, + { "WarningOneMinuteRemaining", DateTime.Minutes(9) } + } + +elseif Map.Difficulty == "Normal" then + TimerTicks = DateTime.Minutes(5) + Announcements = + { + { "WarningFiveMinutesRemaining", DateTime.Seconds(3) }, + { "WarningFourMinutesRemaining", DateTime.Minutes(6) }, + { "WarningThreeMinutesRemaining", DateTime.Minutes(7) }, + { "WarningTwoMinutesRemaining", DateTime.Minutes(8) }, + { "WarningOneMinuteRemaining", DateTime.Minutes(9) } + } + + InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" } + InfantryDelay = DateTime.Seconds(18) + AttackGroupSize = 5 + +elseif Map.Difficulty == "Hard" then + TimerTicks = DateTime.Minutes(3) + Announcements = + { + { "WarningThreeMinutesRemaining", DateTime.Seconds(3) }, + { "WarningTwoMinutesRemaining", DateTime.Minutes(1) }, + { "WarningOneMinuteRemaining", DateTime.Minutes(2) }, + } + + InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "e1" } + InfantryDelay = DateTime.Seconds(10) + VehicleTypes = { "ftrk" } + VehicleDelay = DateTime.Seconds(30) + AttackGroupSize = 7 + +else + TimerTicks = DateTime.Minutes(1) + Announcements = { { "WarningOneMinuteRemaining", DateTime.Seconds(3) } } + ConstructionVehicleReinforcements = { "jeep" } + + InfantryTypes = { "e1", "e1", "e1", "e2", "e2", "dog", "dog" } + InfantryDelay = DateTime.Seconds(10) + VehicleTypes = { "ftrk" } + VehicleDelay = DateTime.Minutes(1) + DateTime.Seconds(10) + AttackGroupSize = 5 +end SendJeepReinforcements = function() Media.PlaySpeechNotification(player, "ReinforcementsArrived") @@ -18,8 +72,85 @@ end RunInitialActivities = function() Harvester.FindResources() + Trigger.OnKilled(Harvester, function() HarvesterKilled = true end) Trigger.OnAllKilled(PathGuards, SendTrucks) + + if InfantryTypes then + Trigger.AfterDelay(InfantryDelay, InfantryProduction) + end + + if VehicleTypes then + Trigger.AfterDelay(VehicleDelay, VehicleProduction) + end +end + +InfantryProduction = function() + if SovietBarracks.IsDead then + return + end + + local toBuild = { Utils.Random(InfantryTypes) } + + if SovietKennel.IsDead and toBuild == "dog" then + toBuild = "e1" + end + + ussr.Build(toBuild, function(unit) + IdlingUnits[#IdlingUnits + 1] = unit[1] + Trigger.AfterDelay(InfantryDelay, InfantryProduction) + + if #IdlingUnits >= (AttackGroupSize * 1.5) then + SendAttack() + end + end) +end + +VehicleProduction = function() + if SovietWarfactory.IsDead then + return + end + + if HarvesterKilled then + ussr.Build({ "harv" }, function(harv) + harv[1].FindResources() + Trigger.OnKilled(harv[1], function() HarvesterKilled = true end) + + HarvesterKilled = false + VehicleProduction() + end) + return + end + + local toBuild = { Utils.Random(VehicleTypes) } + ussr.Build(toBuild, function(unit) + IdlingUnits[#IdlingUnits + 1] = unit[1] + Trigger.AfterDelay(VehicleDelay, VehicleProduction) + + if #IdlingUnits >= (AttackGroupSize * 1.5) then + SendAttack() + end + end) +end + +SendAttack = function() + local units = { } + + for i = 0, AttackGroupSize, 1 do + local number = Utils.RandomInteger(1, #IdlingUnits) + + if IdlingUnits[number] and not IdlingUnits[number].IsDead then + units[i] = IdlingUnits[number] + table.remove(IdlingUnits, number) + end + end + + Utils.Do(units, function(unit) + if Map.Difficulty ~= "Real tough guy" then + unit.AttackMove(DeployPoint.Location) + end + Trigger.OnIdle(unit, unit.Hunt) + end) end ticked = TimerTicks @@ -96,12 +227,14 @@ ConvoyCasualites = function() end end -ConvoyTimer = function(delay, notification) - Trigger.AfterDelay(delay, function() - if not ConvoyOnSite then - Media.PlaySpeechNotification(player, notification) - end - end) +ConvoyTimerAnnouncements = function() + for i = #Announcements, 1, -1 do + Trigger.AfterDelay(Announcements[i][2], function() + if not ConvoyOnSite then + Media.PlaySpeechNotification(player, Announcements[i][1]) + end + end) + end end WorldLoaded = function() @@ -141,10 +274,5 @@ WorldLoaded = function() Camera.Position = ReinforcementsEntryPoint.CenterPosition TimerColor = player.Color - ConvoyTimer(DateTime.Seconds(3), "TenMinutesRemaining") - ConvoyTimer(DateTime.Minutes(5), "WarningFiveMinutesRemaining") - ConvoyTimer(DateTime.Minutes(6), "WarningFourMinutesRemaining") - ConvoyTimer(DateTime.Minutes(7), "WarningThreeMinutesRemaining") - ConvoyTimer(DateTime.Minutes(8), "WarningTwoMinutesRemaining") - ConvoyTimer(DateTime.Minutes(9), "WarningOneMinuteRemaining") + ConvoyTimerAnnouncements() end diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index 3818599f5f..709c02729e 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -33,6 +33,7 @@ Options: StartingCash: 5700 ConfigurableStartingUnits: False ShortGame: False + Difficulties: Easy, Normal, Hard, Real tough guy Players: PlayerReference@USSR: @@ -248,16 +249,9 @@ Actors: Actor60: powr Location: 57,62 Owner: USSR - Actor61: barr - Location: 56,66 - Owner: USSR Actor62: powr Location: 59,62 Owner: USSR - Actor63: kenn - Location: 58,68 - Owner: USSR - Health: 99 Actor64: brl3 Location: 65,59 Owner: USSR @@ -587,6 +581,13 @@ Actors: Actor170: fenc Location: 50,51 Owner: USSR + SovietKennel: kenn + Location: 58,68 + Owner: USSR + Health: 99 + SovietBarracks: barr + Location: 56,66 + Owner: USSR SovietWarfactory: weap Location: 60,66 Owner: USSR @@ -741,6 +742,9 @@ Rules: GenericVisibility: Enemy, Ally, Neutral GenericStancePrefix: false ShowOwnerRow: false + HARV: + Buildable: + Prerequisites: weap APWR: Buildable: Prerequisites: ~disabled From 5ddf94e62406b829f6654d1ba79a57e406116206 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 31 May 2015 22:52:44 +0200 Subject: [PATCH 4/4] HIJACKER can not be build by allies --- mods/ra/maps/allies-02/map.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/mods/ra/maps/allies-02/map.yaml b/mods/ra/maps/allies-02/map.yaml index 709c02729e..29b7fa9cc7 100644 --- a/mods/ra/maps/allies-02/map.yaml +++ b/mods/ra/maps/allies-02/map.yaml @@ -802,9 +802,6 @@ Rules: E7: Buildable: Prerequisites: ~disabled - HIJACKER: - Buildable: - Prerequisites: ~disabled FACF: Buildable: Prerequisites: ~disabled