Make warfactory infiltration a secondary objective
This commit is contained in:
@@ -84,7 +84,7 @@ GroupPatrol = function(units, waypoints, delay)
|
|||||||
end
|
end
|
||||||
|
|
||||||
Tick = function()
|
Tick = function()
|
||||||
if FollowTruk then
|
if FollowTruk and not Truk.IsDead then
|
||||||
Camera.Position = Truk.CenterPosition
|
Camera.Position = Truk.CenterPosition
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -236,6 +236,12 @@ end
|
|||||||
InitTriggers = function()
|
InitTriggers = function()
|
||||||
Trigger.OnInfiltrated(Warfactory, function()
|
Trigger.OnInfiltrated(Warfactory, function()
|
||||||
if greece.IsObjectiveCompleted(infWarfactory) then
|
if greece.IsObjectiveCompleted(infWarfactory) then
|
||||||
|
return
|
||||||
|
elseif Truk.IsDead then
|
||||||
|
if not greece.IsObjectiveCompleted(mainObj) then
|
||||||
|
ussr.MarkCompletedObjective(ussrObj)
|
||||||
|
end
|
||||||
|
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -244,6 +250,14 @@ InitTriggers = function()
|
|||||||
WarfactoryInfiltrated()
|
WarfactoryInfiltrated()
|
||||||
end)
|
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()
|
Trigger.OnInfiltrated(Prison, function()
|
||||||
if greece.IsObjectiveCompleted(mainObj) then
|
if greece.IsObjectiveCompleted(mainObj) then
|
||||||
return
|
return
|
||||||
@@ -354,7 +368,7 @@ InitObjectives = function()
|
|||||||
ussrObj = ussr.AddPrimaryObjective("Deny the Allies.")
|
ussrObj = ussr.AddPrimaryObjective("Deny the Allies.")
|
||||||
mainObj = greece.AddPrimaryObjective("Rescue Tanya.")
|
mainObj = greece.AddPrimaryObjective("Rescue Tanya.")
|
||||||
KillAll = greece.AddPrimaryObjective("Eliminate all Soviet units in this area.")
|
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)
|
Trigger.OnObjectiveCompleted(greece, function(p, id)
|
||||||
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
|
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
|
||||||
|
|||||||
Reference in New Issue
Block a user