Use global objective initialisation.

This commit is contained in:
Matthias Mailänder
2021-10-10 22:11:07 +02:00
committed by abcdefg30
parent d42edfc0b9
commit b9bfbfd5ac
53 changed files with 103 additions and 968 deletions

View File

@@ -103,36 +103,18 @@ WorldLoaded = function()
StartAI() StartAI()
Trigger.OnObjectiveAdded(GDI, function(p, id) InitObjectives(GDI)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(GDI, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(GDI, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(GDI, function()
Media.PlaySpeechNotification(Nod, "Win")
end)
Trigger.OnPlayerLost(GDI, function()
Media.PlaySpeechNotification(Nod, "Lose")
end)
ProtectMoebius = GDI.AddObjective("Protect Dr. Mobius.") ProtectMoebius = GDI.AddObjective("Protect Dr. Mobius.")
Trigger.OnKilled(DrMoebius, function() Trigger.OnKilled(DrMoebius, function()
GDI.MarkFailedObjective(ProtectMoebius) GDI.MarkFailedObjective(ProtectMoebius)
end) end)
ProtectHospital = GDI.AddObjective("Protect the Hospital.") ProtectHospital = GDI.AddObjective("Protect the Hospital.")
Trigger.OnKilled(Hospital, function() Trigger.OnKilled(Hospital, function()
GDI.MarkFailedObjective(ProtectHospital) GDI.MarkFailedObjective(ProtectHospital)
end) end)
CiviliansKilledThreshold = CiviliansKilledThreshold[Difficulty] CiviliansKilledThreshold = CiviliansKilledThreshold[Difficulty]
ProtectCivilians = GDI.AddObjective("Keep at least " .. 14 - CiviliansKilledThreshold .. " out of 14 Civilians alive.") ProtectCivilians = GDI.AddObjective("Keep at least " .. 14 - CiviliansKilledThreshold .. " out of 14 Civilians alive.")
Utils.Do(Civilians, function(civilian) Utils.Do(Civilians, function(civilian)
@@ -143,11 +125,11 @@ WorldLoaded = function()
end end
end) end)
end) end)
SecureArea = GDI.AddObjective("Destroy the Nod bases.") SecureArea = GDI.AddObjective("Destroy the Nod bases.")
KillGDI = Nod.AddObjective("Kill all enemies!") KillGDI = Nod.AddObjective("Kill all enemies!")
AirSupport = GDI.AddObjective("Destroy the SAM sites to receive air support.", "Secondary", false) AirSupport = GDI.AddObjective("Destroy the SAM sites to receive air support.", "Secondary", false)
Trigger.OnAllKilled(SamSites, function() Trigger.OnAllKilled(SamSites, function()
GDI.MarkCompletedObjective(AirSupport) GDI.MarkCompletedObjective(AirSupport)
@@ -159,20 +141,20 @@ WorldLoaded = function()
Trigger.AfterDelay(DateTime.Minutes(1), function() SendWaves(1, AutoAttackWaves) end) Trigger.AfterDelay(DateTime.Minutes(1), function() SendWaves(1, AutoAttackWaves) end)
Trigger.AfterDelay(DateTime.Minutes(2), function() ProduceInfantry(handofnod) end) Trigger.AfterDelay(DateTime.Minutes(2), function() ProduceInfantry(handofnod) end)
Trigger.AfterDelay(DateTime.Minutes(3), function() ProduceVehicle(nodairfield) end) Trigger.AfterDelay(DateTime.Minutes(3), function() ProduceVehicle(nodairfield) end)
local InitialArrivingUnits = local InitialArrivingUnits =
{ {
{ units = { Actor252, Actor253, Actor223, Actor225, Actor222, Actor258, Actor259, Actor260, Actor261, Actor254, Actor255, Actor256, Actor257 }, distance = -1 }, { units = { Actor252, Actor253, Actor223, Actor225, Actor222, Actor258, Actor259, Actor260, Actor261, Actor254, Actor255, Actor256, Actor257 }, distance = -1 },
{ units = { Actor218, Actor220, Actor224, Actor226 }, distance = -2 }, { units = { Actor218, Actor220, Actor224, Actor226 }, distance = -2 },
{ units = { gdiAPC1 }, distance = -3 } { units = { gdiAPC1 }, distance = -3 }
} }
Utils.Do(InitialArrivingUnits, function(group) Utils.Do(InitialArrivingUnits, function(group)
Utils.Do(group.units, function(unit) Utils.Do(group.units, function(unit)
unit.Move(unit.Location + CVec.New(0, group.distance), 0) unit.Move(unit.Location + CVec.New(0, group.distance), 0)
end) end)
end) end)
Utils.Do(NodHelis, function(heli) Utils.Do(NodHelis, function(heli)
if heli.delay == DateTime.Seconds(0) then -- heli1 comes only when specific units are killed, see below if heli.delay == DateTime.Seconds(0) then -- heli1 comes only when specific units are killed, see below
return return

View File

@@ -171,14 +171,6 @@ HelicopterGone = function()
end end
end end
MissionAccomplished = function()
Media.PlaySpeechNotification(Greece, "MissionAccomplished")
end
MissionFailed = function()
Media.PlaySpeechNotification(Greece, "MissionFailed")
end
SetUnitStances = function() SetUnitStances = function()
Utils.Do(Map.NamedActors, function(a) Utils.Do(Map.NamedActors, function(a)
if a.Owner == Greece then if a.Owner == Greece then
@@ -196,18 +188,7 @@ WorldLoaded = function()
England = Player.GetPlayer("England") England = Player.GetPlayer("England")
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(Greece, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
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, MissionFailed)
Trigger.OnPlayerWon(Greece, MissionAccomplished)
FindEinsteinObjective = Greece.AddObjective("Find Einstein.") FindEinsteinObjective = Greece.AddObjective("Find Einstein.")
TanyaSurviveObjective = Greece.AddObjective("Tanya must survive.") TanyaSurviveObjective = Greece.AddObjective("Tanya must survive.")

View File

@@ -218,21 +218,7 @@ WorldLoaded = function()
england = Player.GetPlayer("England") england = Player.GetPlayer("England")
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
ussrObj = ussr.AddObjective("Deny the allies!") ussrObj = ussr.AddObjective("Deny the allies!")

View File

@@ -106,34 +106,12 @@ InitPlayers = function()
ussr.Cash = 10000 ussr.Cash = 10000
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
KillBridges = player.AddObjective("Destroy all bridges.") KillBridges = player.AddObjective("Destroy all bridges.")
TanyaSurvive = player.AddObjective("Tanya must survive.") TanyaSurvive = player.AddObjective("Tanya must survive.")
KillUSSR = player.AddObjective("Destroy all Soviet oil pumps.", "Secondary", false) KillUSSR = player.AddObjective("Destroy all Soviet oil pumps.", "Secondary", false)
FreePrisoners = player.AddObjective("Free all Allied soldiers and keep them alive.", "Secondary", false) FreePrisoners = player.AddObjective("Free all Allied soldiers and keep them alive.", "Secondary", false)
ussr.AddObjective("Bridges must not be destroyed.") ussr.AddObjective("Bridges must not be destroyed.")
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(player, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
end)
end end
InitTriggers = function() InitTriggers = function()
@@ -276,7 +254,8 @@ WorldLoaded = function()
InitPlayers() InitPlayers()
InitObjectives() InitObjectives(player)
AddObjectives()
InitTriggers() InitTriggers()
SendAlliedUnits() SendAlliedUnits()
end end

View File

@@ -170,34 +170,14 @@ InitPlayers = function()
ussr.Cash = 10000 ussr.Cash = 10000
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
KillBridges = player.AddObjective("Destroy all bridges.") KillBridges = player.AddObjective("Destroy all bridges.")
TanyaSurvive = player.AddObjective("Tanya must survive.") TanyaSurvive = player.AddObjective("Tanya must survive.")
FindAllies = player.AddObjective("Find our lost tanks.", "Secondary", false) FindAllies = player.AddObjective("Find our lost tanks.", "Secondary", false)
FreePrisoners = player.AddObjective("Free all Allied soldiers and keep them alive.", "Secondary", false) FreePrisoners = player.AddObjective("Free all Allied soldiers and keep them alive.", "Secondary", false)
ussr.AddObjective("Bridges must not be destroyed.") ussr.AddObjective("Bridges must not be destroyed.")
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(player, "Lose")
end)
end)
Trigger.OnPlayerWon(player, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(player, "Win")
end)
end)
end end
InitTriggers = function() InitTriggers = function()
@@ -381,7 +361,7 @@ WorldLoaded = function()
InitPlayers() InitPlayers()
InitObjectives() AddObjectives()
InitTriggers() InitTriggers()
SetupAlliedUnits() SetupAlliedUnits()
end end

View File

@@ -138,31 +138,9 @@ Tick = function()
end end
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
KillUSSR = player.AddObjective("Destroy all Soviet units and buildings in this region.") KillUSSR = player.AddObjective("Destroy all Soviet units and buildings in this region.")
DestroyConvoys = player.AddObjective("Eliminate all passing Soviet convoys.", "Secondary", false) DestroyConvoys = player.AddObjective("Eliminate all passing Soviet convoys.", "Secondary", false)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(player, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
end)
end end
WorldLoaded = function() WorldLoaded = function()
@@ -171,7 +149,8 @@ WorldLoaded = function()
Camera.Position = AlliedConyard.CenterPosition Camera.Position = AlliedConyard.CenterPosition
InitObjectives() InitObjectives(player)
AddObjectives()
ConvoyDelay = ConvoyDelays[Difficulty] ConvoyDelay = ConvoyDelays[Difficulty]
ParadropDelay = ParadropDelays[Difficulty] ParadropDelay = ParadropDelays[Difficulty]

View File

@@ -371,36 +371,19 @@ InitTriggers = function()
end) end)
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(greece, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
ussrObj = ussr.AddObjective("Deny the Allies.") ussrObj = ussr.AddObjective("Deny the Allies.")
mainObj = greece.AddObjective("Rescue Tanya.") mainObj = greece.AddObjective("Rescue Tanya.")
KillAll = greece.AddObjective("Eliminate all Soviet units in this area.") KillAll = greece.AddObjective("Eliminate all Soviet units in this area.")
infWarfactory = greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false) infWarfactory = greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false)
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(player, "Lose")
end)
Trigger.OnPlayerWon(greece, function()
Media.PlaySpeechNotification(player, "Win")
end)
end end
WorldLoaded = function() WorldLoaded = function()
greece = Player.GetPlayer("Greece") greece = Player.GetPlayer("Greece")
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
InitObjectives() InitObjectives(greece)
AddObjectives()
InitTriggers() InitTriggers()
SendSpy() SendSpy()

View File

@@ -386,29 +386,13 @@ WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
GoodGuy = Player.GetPlayer("GoodGuy") GoodGuy = Player.GetPlayer("GoodGuy")
Trigger.OnObjectiveAdded(Greece, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
USSRObj = USSR.AddObjective("Deny the Allies.") USSRObj = USSR.AddObjective("Deny the Allies.")
MainObj = Greece.AddObjective("Rescue Tanya.") MainObj = Greece.AddObjective("Rescue Tanya.")
KillAll = Greece.AddObjective("Eliminate all Soviet units in this area.") KillAll = Greece.AddObjective("Eliminate all Soviet units in this area.")
InfWarfactory = Greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false) InfWarfactory = Greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false)
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)
InitTriggers() InitTriggers()
SendSpy() SendSpy()
ChurchFootprint() ChurchFootprint()

View File

@@ -344,29 +344,13 @@ WorldLoaded = function()
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(Greece, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
USSRObj = USSR.AddObjective("Deny the Allies.") USSRObj = USSR.AddObjective("Deny the Allies.")
MainObj = Greece.AddObjective("Rescue Tanya.") MainObj = Greece.AddObjective("Rescue Tanya.")
KillAll = Greece.AddObjective("Eliminate all Soviet units in this area.") KillAll = Greece.AddObjective("Eliminate all Soviet units in this area.")
InfWarfactory = Greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false) InfWarfactory = Greece.AddObjective("Infiltrate the Soviet warfactory.", "Secondary", false)
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)
InitTriggers() InitTriggers()
SendSpy() SendSpy()
Trigger.AfterDelay(DateTime.Seconds(3), ActivatePatrols) Trigger.AfterDelay(DateTime.Seconds(3), ActivatePatrols)

View File

@@ -179,24 +179,7 @@ WorldLoaded = function()
player = Player.GetPlayer("Greece") player = Player.GetPlayer("Greece")
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
InfiltrateTechCenterObj = player.AddObjective("Infiltrate one of the Soviet tech centers with a spy.") InfiltrateTechCenterObj = player.AddObjective("Infiltrate one of the Soviet tech centers with a spy.")
CaptureRadarDomeObj = player.AddObjective("Capture the Radar Dome at the shore.", "Secondary", false) CaptureRadarDomeObj = player.AddObjective("Capture the Radar Dome at the shore.", "Secondary", false)

View File

@@ -183,24 +183,7 @@ WorldLoaded = function()
player = Player.GetPlayer("Greece") player = Player.GetPlayer("Greece")
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
InfiltrateTechCenterObj = player.AddObjective("Infiltrate one of the Soviet tech centers with a spy.") InfiltrateTechCenterObj = player.AddObjective("Infiltrate one of the Soviet tech centers with a spy.")
CaptureRadarDomeObj = player.AddObjective("Capture the Radar Dome at the shore.", "Secondary", false) CaptureRadarDomeObj = player.AddObjective("Capture the Radar Dome at the shore.", "Secondary", false)

View File

@@ -185,29 +185,12 @@ WorldLoaded = function()
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
InitObjectives(greece)
CaptureRadarDomeObj = greece.AddObjective("Capture the Radar Dome.") CaptureRadarDomeObj = greece.AddObjective("Capture the Radar Dome.")
DestroySubPens = greece.AddObjective("Destroy all Soviet Sub Pens") DestroySubPens = greece.AddObjective("Destroy all Soviet Sub Pens")
ClearSubActivity = greece.AddObjective("Clear the area of all sub activity", "Secondary", false) ClearSubActivity = greece.AddObjective("Clear the area of all sub activity", "Secondary", false)
BeatAllies = ussr.AddObjective("Defeat the Allied forces.") BeatAllies = ussr.AddObjective("Defeat the Allied forces.")
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()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(greece, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(greece, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(greece, "MissionAccomplished")
end)
end)
PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr }) PowerProxy = Actor.Create("powerproxy.paratroopers", false, { Owner = ussr })
InitialAlliedReinforcements() InitialAlliedReinforcements()

View File

@@ -119,29 +119,12 @@ WorldLoaded = function()
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
germany = Player.GetPlayer("Germany") germany = Player.GetPlayer("Germany")
InitObjectives(greece)
DefendChronosphere = greece.AddObjective("Defend the Chronosphere and the Tech Center\nat all costs.") DefendChronosphere = greece.AddObjective("Defend the Chronosphere and the Tech Center\nat all costs.")
KeepBasePowered = greece.AddObjective("The Chronosphere must have power when the\ntimer runs out.") KeepBasePowered = greece.AddObjective("The Chronosphere must have power when the\ntimer runs out.")
EvacuateScientists = greece.AddObjective("Evacuate all scientists from the island to\nthe west.", "Secondary", false) EvacuateScientists = greece.AddObjective("Evacuate all scientists from the island to\nthe west.", "Secondary", false)
BeatAllies = ussr.AddObjective("Defeat the Allied forces.") BeatAllies = ussr.AddObjective("Defeat the Allied forces.")
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()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(greece, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(greece, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(greece, "MissionAccomplished")
end)
end)
Trigger.AfterDelay(DateTime.Minutes(1), function() Trigger.AfterDelay(DateTime.Minutes(1), function()
Media.PlaySpeechNotification(greece, "TwentyMinutesRemaining") Media.PlaySpeechNotification(greece, "TwentyMinutesRemaining")
end) end)

View File

@@ -119,29 +119,12 @@ WorldLoaded = function()
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
england = Player.GetPlayer("England") england = Player.GetPlayer("England")
InitObjectives(greece)
DefendChronosphere = greece.AddObjective("Defend the Chronosphere and the Tech Center\nat all costs.") DefendChronosphere = greece.AddObjective("Defend the Chronosphere and the Tech Center\nat all costs.")
KeepBasePowered = greece.AddObjective("The Chronosphere must have power when the\ntimer runs out.") KeepBasePowered = greece.AddObjective("The Chronosphere must have power when the\ntimer runs out.")
EvacuateScientists = greece.AddObjective("Evacuate all scientists from the island to\nthe east.", "Secondary", false) EvacuateScientists = greece.AddObjective("Evacuate all scientists from the island to\nthe east.", "Secondary", false)
BeatAllies = ussr.AddObjective("Defeat the Allied forces.") BeatAllies = ussr.AddObjective("Defeat the Allied forces.")
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()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(greece, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(greece, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(greece, "MissionAccomplished")
end)
end)
Trigger.AfterDelay(DateTime.Minutes(1), function() Trigger.AfterDelay(DateTime.Minutes(1), function()
Media.PlaySpeechNotification(greece, "TwentyMinutesRemaining") Media.PlaySpeechNotification(greece, "TwentyMinutesRemaining")
end) end)

View File

@@ -25,14 +25,6 @@ HuntDogsGroup = { Dog701, Dog702, Dog703, Dog704, Dog705, Dog706 }
KosyginType = "gnrl" KosyginType = "gnrl"
KosyginContacted = false KosyginContacted = false
MissionAccomplished = function()
Media.PlaySpeechNotification(Greece, "MissionAccomplished")
end
MissionFailed = function()
Media.PlaySpeechNotification(Greece, "MissionFailed")
end
InitialAlliedReinforcements = function() InitialAlliedReinforcements = function()
Trigger.AfterDelay(DateTime.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(Greece, "ReinforcementsArrived") Media.PlaySpeechNotification(Greece, "ReinforcementsArrived")
@@ -138,7 +130,7 @@ TriggerRevealUSSRBase = function()
Trigger.AfterDelay(DateTime.Seconds(15), cam.Destroy) Trigger.AfterDelay(DateTime.Seconds(15), cam.Destroy)
end end
end) end)
end end
TriggerRevealUSSRFC = function() TriggerRevealUSSRFC = function()
Trigger.OnEnteredProximityTrigger(UpperBaseWP.CenterPosition, WDist.FromCells(10), function(a, id) Trigger.OnEnteredProximityTrigger(UpperBaseWP.CenterPosition, WDist.FromCells(10), function(a, id)
@@ -148,14 +140,14 @@ TriggerRevealUSSRFC = function()
Trigger.AfterDelay(DateTime.Seconds(15), cam.Destroy) Trigger.AfterDelay(DateTime.Seconds(15), cam.Destroy)
end end
end) end)
end end
TriggerExtractKosygin = function() TriggerExtractKosygin = function()
Trigger.OnEnteredProximityTrigger(KosyginExtractPoint.CenterPosition, WDist.FromCells(10), function(actor, triggerflee) Trigger.OnEnteredProximityTrigger(KosyginExtractPoint.CenterPosition, WDist.FromCells(10), function(actor, triggerflee)
if actor.Type == KosyginType then if actor.Type == KosyginType then
Reinforcements.ReinforceWithTransport(Greece, ExtractionHelicopterType, nil, ExtractionPath) Reinforcements.ReinforceWithTransport(Greece, ExtractionHelicopterType, nil, ExtractionPath)
Trigger.RemoveProximityTrigger(triggerflee) Trigger.RemoveProximityTrigger(triggerflee)
Trigger.AfterDelay(DateTime.Seconds(10), function() Trigger.AfterDelay(DateTime.Seconds(10), function()
Greece.MarkCompletedObjective(KosyginSurviveObjective) Greece.MarkCompletedObjective(KosyginSurviveObjective)
Greece.MarkCompletedObjective(ExtractObjective) Greece.MarkCompletedObjective(ExtractObjective)
Media.PlaySpeechNotification(Greece, "ObjectiveMet") Media.PlaySpeechNotification(Greece, "ObjectiveMet")
@@ -167,12 +159,11 @@ end
WorldLoaded = function() WorldLoaded = function()
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
InitObjectives(Greece)
UseSpyObjective = Greece.AddObjective("Infiltrate the Soviet command center and\ncontact Kosygin.") UseSpyObjective = Greece.AddObjective("Infiltrate the Soviet command center and\ncontact Kosygin.")
KosyginSurviveObjective = Greece.AddObjective("Kosygin must survive.") KosyginSurviveObjective = Greece.AddObjective("Kosygin must survive.")
USSRObj = USSR.AddObjective("Eliminate all Allied forces.") USSRObj = USSR.AddObjective("Eliminate all Allied forces.")
Trigger.OnPlayerLost(Greece, MissionFailed)
Trigger.OnPlayerWon(Greece, MissionAccomplished)
InitialAlliedReinforcements() InitialAlliedReinforcements()
InfiltrateForwardCenter() InfiltrateForwardCenter()
InitialSovietPatrols() InitialSovietPatrols()

View File

@@ -137,10 +137,8 @@ Tick = function()
end end
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(Allies, function(p, id) InitObjectives(Allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
DiscoverObjective = Allies.AddObjective("Find the outpost.") DiscoverObjective = Allies.AddObjective("Find the outpost.")
@@ -154,21 +152,6 @@ InitObjectives = function()
Creeps.GetActorsByType("harv")[1].Stop() Creeps.GetActorsByType("harv")[1].Stop()
end) end)
Trigger.OnObjectiveCompleted(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Allies, function()
Media.PlaySpeechNotification(Allies, "MissionFailed")
end)
Trigger.OnPlayerWon(Allies, function()
Trigger.AfterDelay(DateTime.Seconds(1), function() Media.PlaySpeechNotification(Allies, "MissionAccomplished") end)
end)
Camera.Position = Ranger.CenterPosition Camera.Position = Ranger.CenterPosition
end end
@@ -176,7 +159,7 @@ WorldLoaded = function()
Allies = Player.GetPlayer("Spain") Allies = Player.GetPlayer("Spain")
AntMan = Player.GetPlayer("AntMan") AntMan = Player.GetPlayer("AntMan")
Creeps = Player.GetPlayer("Creeps") Creeps = Player.GetPlayer("Creeps")
InitObjectives() AddObjectives()
Trigger.OnKilled(MoneyDerrick, function() Trigger.OnKilled(MoneyDerrick, function()
Actor.Create("moneycrate", true, { Owner = Allies, Location = MoneyDerrick.Location + CVec.New(1,0) }) Actor.Create("moneycrate", true, { Owner = Allies, Location = MoneyDerrick.Location + CVec.New(1,0) })
end) end)

View File

@@ -92,27 +92,12 @@ WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
England = Player.GetPlayer("England") England = Player.GetPlayer("England")
Trigger.OnObjectiveAdded(Spain, function(p, id) InitObjectives(Spain)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
EatSpain = BadGuy.AddObjective("For the Swarm!") EatSpain = BadGuy.AddObjective("For the Swarm!")
GasNests = Spain.AddObjective("Gas every ant nest.") GasNests = Spain.AddObjective("Gas every ant nest.")
KillAll = Spain.AddObjective("Kill every ant lurking above ground.") KillAll = Spain.AddObjective("Kill every ant lurking above ground.")
Trigger.OnObjectiveCompleted(Spain, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Spain, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Spain, function()
Media.PlaySpeechNotification(Spain, "Lose")
end)
Trigger.OnPlayerWon(Spain, function()
Media.PlaySpeechNotification(Spain, "Win")
end)
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
Start() Start()
GasAntNests() GasAntNests()

View File

@@ -322,25 +322,7 @@ WorldLoaded = function()
Utils.Do({ allies1, allies2 }, function(player) Utils.Do({ allies1, allies2 }, function(player)
if player and player.IsLocalPlayer then if player and player.IsLocalPlayer then
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
end end
end) end)

View File

@@ -295,26 +295,7 @@ WorldLoaded = function()
humans = { allies1, allies2 } humans = { allies1, allies2 }
Utils.Do(humans, function(player) Utils.Do(humans, function(player)
if player and player.IsLocalPlayer then if player and player.IsLocalPlayer then
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
TextColor = player.Color TextColor = player.Color
end end
end) end)

View File

@@ -490,28 +490,12 @@ WorldLoaded = function()
England = Player.GetPlayer("England") England = Player.GetPlayer("England")
Civilians = Player.GetPlayer("GreekCivilians") Civilians = Player.GetPlayer("GreekCivilians")
Trigger.OnObjectiveAdded(Allies, function(p, id) AddObjectives(Allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
SovietObj = USSR.AddObjective("Kill Stavros.") SovietObj = USSR.AddObjective("Kill Stavros.")
ProtectVIPs = Allies.AddObjective("Keep Stavros and Tanya alive.") ProtectVIPs = Allies.AddObjective("Keep Stavros and Tanya alive.")
ExtractStavros = Allies.AddObjective("Get Stavros and Tanya to the extraction helicopter.") ExtractStavros = Allies.AddObjective("Get Stavros and Tanya to the extraction helicopter.")
Trigger.OnObjectiveCompleted(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Allies, function()
Media.PlaySpeechNotification(Allies, "Lose")
end)
Trigger.OnPlayerWon(Allies, function()
Media.PlaySpeechNotification(Allies, "Win")
end)
InsertionDrop = Actor.Create("insertiondrop", false, { Owner = Allies }) InsertionDrop = Actor.Create("insertiondrop", false, { Owner = Allies })
InsertionDropHard = Actor.Create("insertiondrophard", false, { Owner = Allies }) InsertionDropHard = Actor.Create("insertiondrophard", false, { Owner = Allies })
RifleDropA = Actor.Create("rifledrop", false, { Owner = Allies }) RifleDropA = Actor.Create("rifledrop", false, { Owner = Allies })

View File

@@ -233,9 +233,7 @@ WorldLoaded = function()
Allies = Player.GetPlayer("Allies") Allies = Player.GetPlayer("Allies")
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Trigger.OnObjectiveAdded(Allies, function(p, id) InitObjectives(Allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
if Difficulty == "easy" then if Difficulty == "easy" then
RescueCivilians = Allies.AddObjective("Evacuate at least half of the civilians to the island\nshelter.") RescueCivilians = Allies.AddObjective("Evacuate at least half of the civilians to the island\nshelter.")
@@ -248,20 +246,6 @@ WorldLoaded = function()
ClearWaterway = Allies.AddObjective("Clear the area of enemy submarine activity.", "Secondary", false) ClearWaterway = Allies.AddObjective("Clear the area of enemy submarine activity.", "Secondary", false)
SovietObj = USSR.AddObjective("Defeat Allies.") SovietObj = USSR.AddObjective("Defeat Allies.")
Trigger.OnObjectiveCompleted(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Allies, function()
Media.PlaySpeechNotification(Allies, "Lose")
end)
Trigger.OnPlayerWon(Allies, function()
Media.PlaySpeechNotification(Allies, "Win")
end)
CiviliansEvacuatedThreshold = CiviliansEvacuatedThreshold[Difficulty] CiviliansEvacuatedThreshold = CiviliansEvacuatedThreshold[Difficulty]
CiviliansKilledThreshold = CiviliansKilledThreshold[Difficulty] CiviliansKilledThreshold = CiviliansKilledThreshold[Difficulty]
TextColor = Allies.Color TextColor = Allies.Color

View File

@@ -92,7 +92,7 @@ AlliedReinforcements = function()
Reinforcements.Reinforce(Greece, AlliedHouseSquad, { VillageSpawnAllies.Location, VillageRally.Location }, 0) Reinforcements.Reinforce(Greece, AlliedHouseSquad, { VillageSpawnAllies.Location, VillageRally.Location }, 0)
end end
end) end)
end end
end end
end) end)
@@ -356,26 +356,11 @@ WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
GoodGuy = Player.GetPlayer("GoodGuy") GoodGuy = Player.GetPlayer("GoodGuy")
Trigger.OnObjectiveAdded(Greece, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
SovietObj = USSR.AddObjective("Defeat Allies.") SovietObj = USSR.AddObjective("Defeat Allies.")
RescueScientists = Greece.AddObjective("Rescue the scientists and escort them back to the\nextraction point.") RescueScientists = Greece.AddObjective("Rescue the scientists and escort them back to the\nextraction point.")
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 Camera.Position = DefaultCameraPosition.CenterPosition
Paradrop1 = Actor.Create("paradrop1", false, { Owner = USSR }) Paradrop1 = Actor.Create("paradrop1", false, { Owner = USSR })
Paradrop2 = Actor.Create("paradrop2", false, { Owner = USSR }) Paradrop2 = Actor.Create("paradrop2", false, { Owner = USSR })

View File

@@ -353,26 +353,7 @@ WorldLoaded = function()
Utils.Do(humans, function(player) Utils.Do(humans, function(player)
if player and player.IsLocalPlayer then if player and player.IsLocalPlayer then
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
local objectiveType = string.lower(p.GetObjectiveType(id))
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. objectiveType .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
end end
end) end)

View File

@@ -243,23 +243,7 @@ WorldLoaded = function()
player = Player.GetPlayer("Allies") player = Player.GetPlayer("Allies")
soviets = Player.GetPlayer("Soviets") soviets = Player.GetPlayer("Soviets")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
sovietObjective = soviets.AddObjective("Destroy the village.") sovietObjective = soviets.AddObjective("Destroy the village.")
villageObjective = player.AddObjective("Save the village.") villageObjective = player.AddObjective("Save the village.")

View File

@@ -107,7 +107,7 @@ SetupAlliedBase = function()
end end
SendAlliedUnits = function() SendAlliedUnits = function()
InitObjectives() AddObjectives()
Camera.Position = StartEntryPoint.CenterPosition Camera.Position = StartEntryPoint.CenterPosition
@@ -124,7 +124,7 @@ SendAlliedUnits = function()
Trigger.OnKilled(unit, function() Trigger.OnKilled(unit, function()
player.MarkFailedObjective(StealMoney) player.MarkFailedObjective(StealMoney)
end) end)
end end
end) end)
end) end)
end) end)
@@ -294,10 +294,8 @@ InitPlayers = function()
Trigger.AfterDelay(0, function() badguy.Resources = badguy.ResourceCapacity * 0.75 end) Trigger.AfterDelay(0, function() badguy.Resources = badguy.ResourceCapacity * 0.75 end)
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
EliminateSuperTanks = player.AddObjective("Eliminate these super tanks.") EliminateSuperTanks = player.AddObjective("Eliminate these super tanks.")
StealMoney = player.AddObjective("Steal money from the nearby outpost with the Thief.") StealMoney = player.AddObjective("Steal money from the nearby outpost with the Thief.")
@@ -309,25 +307,15 @@ InitObjectives = function()
UkraineObj = ukraine.AddObjective("Survive.") UkraineObj = ukraine.AddObjective("Survive.")
TurkeyObj = turkey.AddObjective("Destroy.") TurkeyObj = turkey.AddObjective("Destroy.")
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(player, function() Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
ussr.MarkCompletedObjective(USSRObj) ussr.MarkCompletedObjective(USSRObj)
badguy.MarkCompletedObjective(BadGuyObj) badguy.MarkCompletedObjective(BadGuyObj)
ukraine.MarkCompletedObjective(UkraineObj) ukraine.MarkCompletedObjective(UkraineObj)
turkey.MarkCompletedObjective(TurkeyObj) turkey.MarkCompletedObjective(TurkeyObj)
end) end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
Media.DisplayMessage("Dr. Demitri has been extracted and the super tanks have been dealt with.")
Trigger.OnPlayerWon(player, function()
Media.DisplayMessage("Dr. Demitri has been extracted and the super tanks have been dealt with.")
ussr.MarkFailedObjective(USSRObj) ussr.MarkFailedObjective(USSRObj)
badguy.MarkFailedObjective(BadGuyObj) badguy.MarkFailedObjective(BadGuyObj)
ukraine.MarkFailedObjective(UkraineObj) ukraine.MarkFailedObjective(UkraineObj)

View File

@@ -227,22 +227,7 @@ WorldLoaded = function()
StopProduction = Greece.AddObjective("Destroy the Soviet sub pen.") StopProduction = Greece.AddObjective("Destroy the Soviet sub pen.")
PowerDownTeslaCoils = Greece.AddObjective("Take down power to the tesla coils.") PowerDownTeslaCoils = Greece.AddObjective("Take down power to the tesla coils.")
Trigger.OnObjectiveAdded(Greece, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
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)
Trigger.AfterDelay(DateTime.Minutes(2), function() Trigger.AfterDelay(DateTime.Minutes(2), function()
Media.PlaySpeechNotification(Greece, "TenMinutesRemaining") Media.PlaySpeechNotification(Greece, "TenMinutesRemaining")

View File

@@ -137,29 +137,13 @@ WorldLoaded = function()
ussr = Player.GetPlayer("USSR") ussr = Player.GetPlayer("USSR")
badguy = Player.GetPlayer("BadGuy") badguy = Player.GetPlayer("BadGuy")
Trigger.OnObjectiveAdded(greece, function(p, id) InitObjectives(greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
objDestroyAllTrucks = greece.AddObjective("Prevent Soviet convoy trucks from escaping.") objDestroyAllTrucks = greece.AddObjective("Prevent Soviet convoy trucks from escaping.")
objKillAll = greece.AddObjective("Clear the sector of all Soviet presence.") objKillAll = greece.AddObjective("Clear the sector of all Soviet presence.")
objRadarSpy = greece.AddObjective("Infiltrate the Soviet Radar Dome to reveal truck \necape routes.", "Secondary", false) objRadarSpy = greece.AddObjective("Infiltrate the Soviet Radar Dome to reveal truck \necape routes.", "Secondary", false)
ussrObj = ussr.AddObjective("Deny the Allies.") ussrObj = ussr.AddObjective("Deny the Allies.")
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(player, "Lose")
end)
Trigger.OnPlayerWon(greece, function()
Media.PlaySpeechNotification(player, "Win")
end)
ActivateAI() ActivateAI()
SetupTriggers() SetupTriggers()
MissionStart() MissionStart()

View File

@@ -457,9 +457,7 @@ WorldLoaded = function()
france = Player.GetPlayer("France") france = Player.GetPlayer("France")
germany = Player.GetPlayer("Germany") germany = Player.GetPlayer("Germany")
Trigger.OnObjectiveAdded(greece, function(p, id) InitObjectives(greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
ussrObj = ussr.AddObjective("Defeat the Allies.") ussrObj = ussr.AddObjective("Defeat the Allies.")
ExitBase = greece.AddObjective("Reach the eastern exit of the facility.") ExitBase = greece.AddObjective("Reach the eastern exit of the facility.")
@@ -470,20 +468,6 @@ WorldLoaded = function()
NoCasualties = greece.AddPrimaryObjective("Do not lose a single soldier or civilian\nunder your command.") NoCasualties = greece.AddPrimaryObjective("Do not lose a single soldier or civilian\nunder your command.")
end end
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)
StartSpy.DisguiseAsType("e1", ussr) StartSpy.DisguiseAsType("e1", ussr)
StartAttacker1.AttackMove(start.Location) StartAttacker1.AttackMove(start.Location)
StartAttacker2.AttackMove(start.Location) StartAttacker2.AttackMove(start.Location)

View File

@@ -124,22 +124,7 @@ WorldLoaded = function()
SovietObj = USSR.AddObjective("Defeat the Allies.") SovietObj = USSR.AddObjective("Defeat the Allies.")
TakeOutPower = Greece.AddObjective("Bring down the power of the base to the east.") TakeOutPower = Greece.AddObjective("Bring down the power of the base to the east.")
Trigger.OnObjectiveAdded(Greece, function(p, id) InitObjectives(Greece)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
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)
StartSpy.DisguiseAsType("e1", BadGuy) StartSpy.DisguiseAsType("e1", BadGuy)
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition

View File

@@ -120,7 +120,7 @@ MissionTriggers = function()
end end
end) end)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
if not NEVillage3.IsDead then if not NEVillage3.IsDead then
Reinforcements.Reinforce(Spain, Utils.Random(CivSquads), { NECivSpawn3.Location, CivRallyNW.Location }, 0) Reinforcements.Reinforce(Spain, Utils.Random(CivSquads), { NECivSpawn3.Location, CivRallyNW.Location }, 0)
end end
if not NEVillage4.IsDead then if not NEVillage4.IsDead then
@@ -249,7 +249,7 @@ MissionTriggers = function()
if not SWVillage3.IsDead then if not SWVillage3.IsDead then
Reinforcements.Reinforce(Spain, Utils.Random(CivSquads), { SWCivSpawn3.Location, CivRallySE.Location }, 0) Reinforcements.Reinforce(Spain, Utils.Random(CivSquads), { SWCivSpawn3.Location, CivRallySE.Location }, 0)
end end
if not SWVillage4.IsDead then if not SWVillage4.IsDead then
Reinforcements.Reinforce(Spain, Utils.Random(CivSquads), { SWCivSpawn4.Location, CivRallyNW.Location }, 0) Reinforcements.Reinforce(Spain, Utils.Random(CivSquads), { SWCivSpawn4.Location, CivRallyNW.Location }, 0)
end end
end) end)
@@ -307,32 +307,12 @@ WorldLoaded = function()
GoodGuy = Player.GetPlayer("GoodGuy") GoodGuy = Player.GetPlayer("GoodGuy")
Spain = Player.GetPlayer("Spain") Spain = Player.GetPlayer("Spain")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
BeatRussia = Greece.AddObjective("Stop Ivan.") BeatRussia = Greece.AddObjective("Stop Ivan.")
KillAll = USSR.AddObjective("Destroy all that oppose us.") KillAll = USSR.AddObjective("Destroy all that oppose us.")
CaptureDome = USSR.AddObjective("Capture the enemy radar dome.", "Secondary", false) CaptureDome = USSR.AddObjective("Capture the enemy radar dome.", "Secondary", false)
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
Camera.Position = LZ.CenterPosition Camera.Position = LZ.CenterPosition
ShockDrop = Actor.Create("shockdrop", false, { Owner = USSR }) ShockDrop = Actor.Create("shockdrop", false, { Owner = USSR })
MissionStart() MissionStart()

View File

@@ -240,22 +240,7 @@ WorldLoaded = function()
StopTrucks = Allies.AddObjective("Destroy all Soviet convoy trucks.") StopTrucks = Allies.AddObjective("Destroy all Soviet convoy trucks.")
DestroyBridges = Allies.AddObjective("Destroy the nearby bridges to slow the\nconvoys down.", "Secondary", false) DestroyBridges = Allies.AddObjective("Destroy the nearby bridges to slow the\nconvoys down.", "Secondary", false)
Trigger.OnObjectiveAdded(Allies, function(p, id) InitObjectives(Allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Allies, function()
Media.PlaySpeechNotification(Allies, "Lose")
end)
Trigger.OnPlayerWon(Allies, function()
Media.PlaySpeechNotification(Allies, "Win")
end)
Trigger.AfterDelay(DateTime.Minutes(3), function() Trigger.AfterDelay(DateTime.Minutes(3), function()
Media.PlaySpeechNotification(Allies, "WarningFiveMinutesRemaining") Media.PlaySpeechNotification(Allies, "WarningFiveMinutesRemaining")

View File

@@ -54,27 +54,11 @@ WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
BadGuy = Player.GetPlayer("BadGuy") BadGuy = Player.GetPlayer("BadGuy")
Trigger.OnObjectiveAdded(Allies, function(p, id) InitObjectives(Allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
SovietObj = USSR.AddObjective("Stop the Allies") SovietObj = USSR.AddObjective("Stop the Allies")
DestroyAll = Allies.AddObjective("Destroy all Soviet units and structures.") DestroyAll = Allies.AddObjective("Destroy all Soviet units and structures.")
Trigger.OnObjectiveCompleted(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(Allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(Allies, function()
Media.PlaySpeechNotification(Allies, "Lose")
end)
Trigger.OnPlayerWon(Allies, function()
Media.PlaySpeechNotification(Allies, "Win")
end)
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
PowerProxy = Actor.Create("paratroopers", false, { Owner = BadGuy }) PowerProxy = Actor.Create("paratroopers", false, { Owner = BadGuy })
Setup() Setup()

View File

@@ -169,9 +169,7 @@ WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Turkey = Player.GetPlayer("Turkey") Turkey = Player.GetPlayer("Turkey")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
LaunchMissles = Turkey.AddObjective("Survive until time expires.") LaunchMissles = Turkey.AddObjective("Survive until time expires.")
KillPower = USSR.AddObjective("Bring the base to low power. Volkov will arrive\nonce the defenses are down.") KillPower = USSR.AddObjective("Bring the base to low power. Volkov will arrive\nonce the defenses are down.")
@@ -180,24 +178,6 @@ WorldLoaded = function()
KillSams = USSR.AddObjective("Destroy all sam sites on the island.\nOur strategic bombers will finish the rest.", "Secondary", false) KillSams = USSR.AddObjective("Destroy all sam sites on the island.\nOur strategic bombers will finish the rest.", "Secondary", false)
VolkovSurvive = USSR.AddObjective("Volkov must survive.") VolkovSurvive = USSR.AddObjective("Volkov must survive.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
Trigger.AfterDelay(DateTime.Minutes(3), function() Trigger.AfterDelay(DateTime.Minutes(3), function()
Media.PlaySpeechNotification(USSR, "WarningFiveMinutesRemaining") Media.PlaySpeechNotification(USSR, "WarningFiveMinutesRemaining")
end) end)

View File

@@ -72,15 +72,7 @@ WorldLoaded = function()
france = Player.GetPlayer("France") france = Player.GetPlayer("France")
germany = Player.GetPlayer("Germany") germany = Player.GetPlayer("Germany")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
VillageRaidObjective = player.AddObjective("Raze the village.") VillageRaidObjective = player.AddObjective("Raze the village.")
@@ -90,14 +82,6 @@ WorldLoaded = function()
JeepDemolishingBridge() JeepDemolishingBridge()
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Paradrop = Actor.Create("powerproxy.paratroopers", false, { Owner = player }) Paradrop = Actor.Create("powerproxy.paratroopers", false, { Owner = player })
Trigger.AfterDelay(DateTime.Seconds(2), InsertYaks) Trigger.AfterDelay(DateTime.Seconds(2), InsertYaks)
Paratroopers() Paratroopers()

View File

@@ -50,26 +50,11 @@ WorldLoaded = function()
player = Player.GetPlayer("USSR") player = Player.GetPlayer("USSR")
greece = Player.GetPlayer("Greece") greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
CommandCenterIntact = player.AddObjective("Protect the Command Center.") CommandCenterIntact = player.AddObjective("Protect the Command Center.")
DestroyAllAllied = player.AddObjective("Destroy all Allied units and structures.") DestroyAllAllied = player.AddObjective("Destroy all Allied units and structures.")
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Camera.Position = CameraWaypoint.CenterPosition Camera.Position = CameraWaypoint.CenterPosition
Trigger.OnKilled(CommandCenter, function() Trigger.OnKilled(CommandCenter, function()

View File

@@ -178,21 +178,8 @@ WorldLoaded = function()
end) end)
end) end)
end) end)
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") InitObjectives(player)
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
alliedObjective = enemy.AddObjective("Destroy all Soviet troops.") alliedObjective = enemy.AddObjective("Destroy all Soviet troops.")
sovietObjective1 = player.AddObjective("Protect the Command Center.") sovietObjective1 = player.AddObjective("Protect the Command Center.")
sovietObjective2 = player.AddObjective("Destroy all Allied units and structures.") sovietObjective2 = player.AddObjective("Destroy all Allied units and structures.")

View File

@@ -335,23 +335,11 @@ WorldLoaded = function()
player = Player.GetPlayer("USSR") player = Player.GetPlayer("USSR")
enemy = Player.GetPlayer("England") enemy = Player.GetPlayer("England")
greece = Player.GetPlayer("Greece") greece = Player.GetPlayer("Greece")
Camera.Position = Playerbase.CenterPosition Camera.Position = Playerbase.CenterPosition
IntroSequence() IntroSequence()
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") InitObjectives(player)
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
alliedObjective = enemy.AddObjective("Destroy all Soviet troops.") alliedObjective = enemy.AddObjective("Destroy all Soviet troops.")
sovietObjective1 = player.AddObjective("Kill the enemy spy.") sovietObjective1 = player.AddObjective("Kill the enemy spy.")
sovietObjective2 = player.AddObjective("Clear the nearby farm for reinforcements.", "Secondary", false) sovietObjective2 = player.AddObjective("Clear the nearby farm for reinforcements.", "Secondary", false)

View File

@@ -132,28 +132,12 @@ WorldLoaded = function()
RunInitialActivities() RunInitialActivities()
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
KillAll = player.AddObjective("Defeat the Allied forces.") KillAll = player.AddObjective("Defeat the Allied forces.")
BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.") BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.")
KillRadar = player.AddObjective("Destroy Allied Radar Dome to stop enemy\nreinforcements.", "Secondary", false) KillRadar = player.AddObjective("Destroy Allied Radar Dome to stop enemy\nreinforcements.", "Secondary", false)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnKilled(RadarDome, function() Trigger.OnKilled(RadarDome, function()
player.MarkCompletedObjective(KillRadar) player.MarkCompletedObjective(KillRadar)
Media.PlaySpeechNotification(player, "ObjectiveMet") Media.PlaySpeechNotification(player, "ObjectiveMet")

View File

@@ -117,28 +117,12 @@ WorldLoaded = function()
RunInitialActivities() RunInitialActivities()
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
KillAll = player.AddObjective("Defeat the Allied forces.") KillAll = player.AddObjective("Defeat the Allied forces.")
BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.") BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.")
KillRadar = player.AddObjective("Destroy Allied Radar Dome to stop enemy\nreinforcements.", "Secondary", false) KillRadar = player.AddObjective("Destroy Allied Radar Dome to stop enemy\nreinforcements.", "Secondary", false)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnKilled(RadarDome, function() Trigger.OnKilled(RadarDome, function()
player.MarkCompletedObjective(KillRadar) player.MarkCompletedObjective(KillRadar)
Media.PlaySpeechNotification(player, "ObjectiveMet") Media.PlaySpeechNotification(player, "ObjectiveMet")

View File

@@ -186,16 +186,7 @@ WorldLoaded = function()
GoodGuy = Player.GetPlayer("GoodGuy") GoodGuy = Player.GetPlayer("GoodGuy")
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
Media.PlaySpeechNotification(player, "ObjectiveMet")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
CaptureObjective = player.AddObjective("Capture the Radar Dome.") CaptureObjective = player.AddObjective("Capture the Radar Dome.")
KillAll = player.AddObjective("Defeat the Allied forces.") KillAll = player.AddObjective("Defeat the Allied forces.")
@@ -271,13 +262,5 @@ WorldLoaded = function()
end end
end) end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Camera.Position = StartCamPoint.CenterPosition Camera.Position = StartCamPoint.CenterPosition
end end

View File

@@ -113,12 +113,15 @@ end)
WorldLoaded = function() WorldLoaded = function()
player = Player.GetPlayer("USSR") player = Player.GetPlayer("USSR")
enemy = Player.GetPlayer("Greece") enemy = Player.GetPlayer("Greece")
Camera.Position = CameraStart.CenterPosition Camera.Position = CameraStart.CenterPosition
Mcv.Move(McvWaypoint.Location) Mcv.Move(McvWaypoint.Location)
Harvester.FindResources() Harvester.FindResources()
Utils.Do(IntroAttackers, function(actor) Utils.Do(IntroAttackers, function(actor)
IdleHunt(actor) IdleHunt(actor)
end) end)
Utils.Do(Map.NamedActors, function(actor) Utils.Do(Map.NamedActors, function(actor)
if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
@@ -128,23 +131,12 @@ WorldLoaded = function()
end) end)
end end
end) end)
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements1, SovietReinforcements1Waypoints) Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements1, SovietReinforcements1Waypoints)
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements2, SovietReinforcements2Waypoints) Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements2, SovietReinforcements2Waypoints)
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") InitObjectives(player)
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
alliedObjective = enemy.AddObjective("Destroy all Soviet troops.") alliedObjective = enemy.AddObjective("Destroy all Soviet troops.")
sovietObjective = player.AddObjective("Escort the Convoy.") sovietObjective = player.AddObjective("Escort the Convoy.")
sovietObjective2 = player.AddObjective("Destroy or capture the Allied radar dome to stop\nenemy reinforcements.", "Secondary", false) sovietObjective2 = player.AddObjective("Destroy or capture the Allied radar dome to stop\nenemy reinforcements.", "Secondary", false)

View File

@@ -78,14 +78,18 @@ end)
WorldLoaded = function() WorldLoaded = function()
player = Player.GetPlayer("USSR") player = Player.GetPlayer("USSR")
enemy = Player.GetPlayer("Greece") enemy = Player.GetPlayer("Greece")
Camera.Position = CameraStart.CenterPosition Camera.Position = CameraStart.CenterPosition
Mcv.Move(McvWaypoint.Location) Mcv.Move(McvWaypoint.Location)
Harvester.FindResources() Harvester.FindResources()
Utils.Do(IntroAttackers, function(actor) Utils.Do(IntroAttackers, function(actor)
IdleHunt(actor) IdleHunt(actor)
end) end)
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements1, SovietReinforcements1Waypoints) Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements1, SovietReinforcements1Waypoints)
Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements2, SovietReinforcements2Waypoints) Reinforcements.ReinforceWithTransport(player, "apc", SovietReinforcements2, SovietReinforcements2Waypoints)
Utils.Do(Map.NamedActors, function(actor) Utils.Do(Map.NamedActors, function(actor)
if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then if actor.Owner == enemy and actor.HasProperty("StartBuildingRepairs") then
Trigger.OnDamaged(actor, function(building) Trigger.OnDamaged(actor, function(building)
@@ -95,21 +99,8 @@ WorldLoaded = function()
end) end)
end end
end) end)
Trigger.OnObjectiveAdded(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective") InitObjectives(player)
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
alliedObjective = enemy.AddObjective("Destroy all Soviet troops.") alliedObjective = enemy.AddObjective("Destroy all Soviet troops.")
sovietObjective = player.AddObjective("Escort the Convoy.") sovietObjective = player.AddObjective("Escort the Convoy.")
sovietObjective2 = player.AddObjective("Destroy or capture the Allied radar dome to stop\nenemy reinforcements.", "Secondary", false) sovietObjective2 = player.AddObjective("Destroy or capture the Allied radar dome to stop\nenemy reinforcements.", "Secondary", false)

View File

@@ -277,22 +277,7 @@ WorldLoaded = function()
IntroSequence() IntroSequence()
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "Win")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "Lose")
end)
alliedObjective = enemy.AddObjective("Destroy all Soviet troops.") alliedObjective = enemy.AddObjective("Destroy all Soviet troops.")
sovietObjective1 = player.AddObjective("Deactivate the security system.") sovietObjective1 = player.AddObjective("Deactivate the security system.")
sovietObjective2 = player.AddObjective("Rescue the engineers.") sovietObjective2 = player.AddObjective("Rescue the engineers.")

View File

@@ -119,32 +119,12 @@ WorldLoaded = function()
Germany = Player.GetPlayer("Germany") Germany = Player.GetPlayer("Germany")
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
KillAll = USSR.AddObjective("Destroy all Allied units and structures.") KillAll = USSR.AddObjective("Destroy all Allied units and structures.")
DestroyVillageObjective = USSR.AddObjective("Destroy the village of Allied sympathizers.", "Secondary", false) DestroyVillageObjective = USSR.AddObjective("Destroy the village of Allied sympathizers.", "Secondary", false)
BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.") BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
AddEastReinforcementTrigger() AddEastReinforcementTrigger()
AddSouthReinforcementTrigger() AddSouthReinforcementTrigger()
AddParadropReinforcementTrigger() AddParadropReinforcementTrigger()

View File

@@ -119,32 +119,12 @@ WorldLoaded = function()
Germany = Player.GetPlayer("Germany") Germany = Player.GetPlayer("Germany")
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
KillAll = USSR.AddObjective("Destroy all Allied units and structures.") KillAll = USSR.AddObjective("Destroy all Allied units and structures.")
DestroyVillageObjective = USSR.AddObjective("Destroy the village of Allied sympathizers.", "Secondary", false) DestroyVillageObjective = USSR.AddObjective("Destroy the village of Allied sympathizers.", "Secondary", false)
BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.") BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
FirstReinforcementTrigger() FirstReinforcementTrigger()
SecondReinforcementTrigger() SecondReinforcementTrigger()
AddParadropReinforcementTrigger() AddParadropReinforcementTrigger()

View File

@@ -77,31 +77,11 @@ WorldLoaded = function()
Germany = Player.GetPlayer("Germany") Germany = Player.GetPlayer("Germany")
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
DestroyTruck = USSR.AddObjective("Destroy the stolen convoy truck.\nDo not let it escape.") DestroyTruck = USSR.AddObjective("Destroy the stolen convoy truck.\nDo not let it escape.")
DefendCommand = USSR.AddObjective("Defend our forward command center.") DefendCommand = USSR.AddObjective("Defend our forward command center.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
MissionStart() MissionStart()

View File

@@ -309,33 +309,13 @@ WorldLoaded = function()
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Turkey = Player.GetPlayer("Turkey") Turkey = Player.GetPlayer("Turkey")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
EscortTrucks = USSR.AddObjective("Escort the convoy through the mountain pass.") EscortTrucks = USSR.AddObjective("Escort the convoy through the mountain pass.")
ProtectEveryTruck = USSR.AddObjective("Do not lose a single truck.", "Secondary", false) ProtectEveryTruck = USSR.AddObjective("Do not lose a single truck.", "Secondary", false)
SaveMigs = USSR.AddObjective("Do not squander any of our new MiG aircraft.", "Secondary", false) SaveMigs = USSR.AddObjective("Do not squander any of our new MiG aircraft.", "Secondary", false)
BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.") BeatUSSR = Greece.AddObjective("Defeat the Soviet forces.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
ConvoyEscort = ConvoyEscort[Difficulty] ConvoyEscort = ConvoyEscort[Difficulty]
StartTimerDelay = StartTimerDelay[Difficulty] StartTimerDelay = StartTimerDelay[Difficulty]

View File

@@ -31,31 +31,11 @@ end
WorldLoaded = function() WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
DestroyNavalBase = USSR.AddPrimaryObjective("Destroy all Allied units and structures.") DestroyNavalBase = USSR.AddPrimaryObjective("Destroy all Allied units and structures.")
BeatSoviets = Greece.AddPrimaryObjective("Destroy all Soviet troops.") BeatSoviets = Greece.AddPrimaryObjective("Destroy all Soviet troops.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
InitialSovietReinforcements() InitialSovietReinforcements()

View File

@@ -31,31 +31,11 @@ end
WorldLoaded = function() WorldLoaded = function()
USSR = Player.GetPlayer("USSR") USSR = Player.GetPlayer("USSR")
Greece = Player.GetPlayer("Greece") Greece = Player.GetPlayer("Greece")
Trigger.OnObjectiveAdded(USSR, function(p, id) InitObjectives(USSR)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
DestroyNavalBase = USSR.AddPrimaryObjective("Destroy Allied naval base") DestroyNavalBase = USSR.AddPrimaryObjective("Destroy Allied naval base")
BeatSoviets = Greece.AddPrimaryObjective("Destroy all Soviet troops.") BeatSoviets = Greece.AddPrimaryObjective("Destroy all Soviet troops.")
Trigger.OnObjectiveCompleted(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(USSR, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionFailed")
end)
end)
Trigger.OnPlayerWon(USSR, function()
Trigger.AfterDelay(DateTime.Seconds(1), function()
Media.PlaySpeechNotification(USSR, "MissionAccomplished")
end)
end)
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
InitialSovietReinforcements() InitialSovietReinforcements()

View File

@@ -62,28 +62,13 @@ WorldLoaded = function()
end end
--Objectives Setup --Objectives Setup
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
DestroyControlCenter = player.AddObjective("Destroy the Control Center.") DestroyControlCenter = player.AddObjective("Destroy the Control Center.")
KeepTanksAlive = player.AddObjective("Your tank division must not be destroyed before\n the alloy facility is dealt with.") KeepTanksAlive = player.AddObjective("Your tank division must not be destroyed before\n the alloy facility is dealt with.")
KeepVolkovAlive = player.AddObjective("Keep Volkov Alive.") KeepVolkovAlive = player.AddObjective("Keep Volkov Alive.")
KeepChitzkoiAlive = player.AddObjective("Keep Chitzkoi Alive.", "Secondary", false) KeepChitzkoiAlive = player.AddObjective("Keep Chitzkoi Alive.", "Secondary", false)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Trigger.OnKilled(ControlCenter, function() Trigger.OnKilled(ControlCenter, function()
Utils.Do(HeavyTurrets, function(struc) Utils.Do(HeavyTurrets, function(struc)
if not struc.IsDead then struc.Kill() end if not struc.IsDead then struc.Kill() end

View File

@@ -296,10 +296,8 @@ SendLongBowReinforcements = function()
end end
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(allies, function(p, id) InitObjectives(allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
SurviveObj = allies.AddObjective("Enforce your position and hold-out the onslaught\nuntil reinforcements arrive.") SurviveObj = allies.AddObjective("Enforce your position and hold-out the onslaught\nuntil reinforcements arrive.")
KillSams = allies.AddObjective("Destroy the two SAM sites before reinforcements\narrive.", "Secondary", false) KillSams = allies.AddObjective("Destroy the two SAM sites before reinforcements\narrive.", "Secondary", false)
@@ -307,18 +305,7 @@ InitObjectives = function()
CaptureAirfields = allies.AddObjective("Capture and hold the Soviet airbase\nin the northeast.", "Secondary", false) CaptureAirfields = allies.AddObjective("Capture and hold the Soviet airbase\nin the northeast.", "Secondary", false)
SovietObj = soviets.AddObjective("Eliminate all Allied forces.") SovietObj = soviets.AddObjective("Eliminate all Allied forces.")
Trigger.OnObjectiveCompleted(allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(allies, function()
Media.PlaySpeechNotification(allies, "MissionFailed")
end)
Trigger.OnPlayerWon(allies, function() Trigger.OnPlayerWon(allies, function()
Media.PlaySpeechNotification(allies, "MissionAccomplished")
Media.DisplayMessage("The French forces have survived and dismantled the Soviet presence in the area!") Media.DisplayMessage("The French forces have survived and dismantled the Soviet presence in the area!")
end) end)
end end
@@ -422,7 +409,7 @@ WorldLoaded = function()
allies = Player.GetPlayer("Allies") allies = Player.GetPlayer("Allies")
soviets = Player.GetPlayer("Soviets") soviets = Player.GetPlayer("Soviets")
InitObjectives() AddObjectives()
InitMission() InitMission()
SetupSoviets() SetupSoviets()
end end

View File

@@ -282,10 +282,8 @@ InitCountDown = function()
Trigger.AfterDelay(DateTime.Minutes(4), function() Media.PlaySpeechNotification(allies, "WarningOneMinuteRemaining") end) Trigger.AfterDelay(DateTime.Minutes(4), function() Media.PlaySpeechNotification(allies, "WarningOneMinuteRemaining") end)
end end
InitObjectives = function() AddObjectives = function()
Trigger.OnObjectiveAdded(allies, function(p, id) InitObjectives(allies)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
SurviveObj = allies.AddObjective("Enforce your position and hold-out the onslaught.") SurviveObj = allies.AddObjective("Enforce your position and hold-out the onslaught.")
SovietObj = soviets.AddObjective("Eliminate all Allied forces.") SovietObj = soviets.AddObjective("Eliminate all Allied forces.")
@@ -294,18 +292,7 @@ InitObjectives = function()
SetupBridges() SetupBridges()
end) end)
Trigger.OnObjectiveCompleted(allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(allies, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
Trigger.OnPlayerLost(allies, function()
Media.PlaySpeechNotification(allies, "Lose")
end)
Trigger.OnPlayerWon(allies, function() Trigger.OnPlayerWon(allies, function()
Media.PlaySpeechNotification(allies, "Win")
Media.DisplayMessage("We have destroyed the remaining Soviet presence!", "Incoming Report") Media.DisplayMessage("We have destroyed the remaining Soviet presence!", "Incoming Report")
end) end)
end end
@@ -398,7 +385,7 @@ WorldLoaded = function()
allies = Player.GetPlayer("Allies") allies = Player.GetPlayer("Allies")
soviets = Player.GetPlayer("Soviets") soviets = Player.GetPlayer("Soviets")
InitObjectives() AddObjectives()
InitMission() InitMission()
SetupSoviets() SetupSoviets()
end end

View File

@@ -100,28 +100,13 @@ WorldLoaded = function()
Camera.Position = DefaultCameraPosition.CenterPosition Camera.Position = DefaultCameraPosition.CenterPosition
--Objectives Setup --Objectives Setup
Trigger.OnObjectiveAdded(player, function(p, id) InitObjectives(player)
Media.DisplayMessage(p.GetObjectiveDescription(id), "New " .. string.lower(p.GetObjectiveType(id)) .. " objective")
end)
Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed")
end)
Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed")
end)
BringSupplyTruck = player.AddObjective("Bring the supply truck to the waystation.") BringSupplyTruck = player.AddObjective("Bring the supply truck to the waystation.")
ProtectWaystation = player.AddObjective("The waystation must not be destroyed.") ProtectWaystation = player.AddObjective("The waystation must not be destroyed.")
DestroyAAGuns = player.AddObjective("Destroy all the AA Guns to enable air support.", "Secondary", false) DestroyAAGuns = player.AddObjective("Destroy all the AA Guns to enable air support.", "Secondary", false)
PreventAlliedIncursions = player.AddObjective("Find and destroy the bridge the allies are using\nto bring their reinforcements in the area.", "Secondary", false) PreventAlliedIncursions = player.AddObjective("Find and destroy the bridge the allies are using\nto bring their reinforcements in the area.", "Secondary", false)
Trigger.OnPlayerWon(player, function()
Media.PlaySpeechNotification(player, "MissionAccomplished")
end)
Trigger.OnPlayerLost(player, function()
Media.PlaySpeechNotification(player, "MissionFailed")
end)
Trigger.OnKilled(USSRTechCenter01, function() Trigger.OnKilled(USSRTechCenter01, function()
player.MarkFailedObjective(ProtectWaystation) player.MarkFailedObjective(ProtectWaystation)
end) end)