From a8ff8e75fc0b918c947fb25db31c7eb6736a4f2a Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 28 Jul 2019 13:29:18 +0200 Subject: [PATCH] Make warfactory infiltration a secondary objective --- mods/ra/maps/allies-05a/allies05a.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/mods/ra/maps/allies-05a/allies05a.lua b/mods/ra/maps/allies-05a/allies05a.lua index d07d5b15c9..d1e3a49c51 100644 --- a/mods/ra/maps/allies-05a/allies05a.lua +++ b/mods/ra/maps/allies-05a/allies05a.lua @@ -84,7 +84,7 @@ GroupPatrol = function(units, waypoints, delay) end Tick = function() - if FollowTruk then + if FollowTruk and not Truk.IsDead then Camera.Position = Truk.CenterPosition end @@ -236,6 +236,12 @@ end InitTriggers = function() Trigger.OnInfiltrated(Warfactory, function() if greece.IsObjectiveCompleted(infWarfactory) then + return + elseif Truk.IsDead then + if not greece.IsObjectiveCompleted(mainObj) then + ussr.MarkCompletedObjective(ussrObj) + end + return end @@ -244,6 +250,14 @@ InitTriggers = function() WarfactoryInfiltrated() end) + Trigger.OnKilled(Truk, function() + if not greece.IsObjectiveCompleted(infWarfactory) then + greece.MarkFailedObjective(infWarfactory) + elseif FollowTruk then + ussr.MarkCompletedObjective(ussrObj) + end + end) + Trigger.OnInfiltrated(Prison, function() if greece.IsObjectiveCompleted(mainObj) then return @@ -354,7 +368,7 @@ InitObjectives = function() ussrObj = ussr.AddPrimaryObjective("Deny the Allies.") mainObj = greece.AddPrimaryObjective("Rescue Tanya.") KillAll = greece.AddPrimaryObjective("Eliminate all Soviet units in this area.") - infWarfactory = greece.AddPrimaryObjective("Infiltrate the Soviet warfactory.") + infWarfactory = greece.AddSecondaryObjective("Infiltrate the Soviet warfactory.") Trigger.OnObjectiveCompleted(greece, function(p, id) Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")