diff --git a/mods/cnc/languages/lua/en.ftl b/mods/cnc/languages/lua/en.ftl new file mode 100644 index 0000000000..9ca0d703b7 --- /dev/null +++ b/mods/cnc/languages/lua/en.ftl @@ -0,0 +1,149 @@ +## campaign +objective-failed = Objective failed +objective-completed = Objective completed + +primary = Primary +secondary = Secondary + +new-primary-objective = New primary objective +new-secondary-objective = New secondary objective + +# cnc64gdi01 +destroy-obelisk-sams = Destroy the SAM sites protecting the Obelisk. +destroy-obelisk = Destroy the Obelisk. +destroy-biotech = Destroy the biotech facility. + +## gdi03, gdi05abc, gdi07 gdi08ab, gdi09 +destroy-sams = Destroy the SAM sites to receive air support. + +## funpark01 +investigate-village = Investigate the nearby village for reports of + strange activity. +reach-village = Reach the village. +kill-creatures = Kill all creatures in the area. + +## gdi01 +establish-beachhead = Establish a beachhead. + +## gdi01, gdi02, gdi03, gdi04c, gdi05abc, nod07a, nod08ab, nod09, nod10b +eliminate-nod = Eliminate all Nod forces in the area. + +## gdi02, nod09 +capture-refinery = Capture the Tiberium refinery. + +## gdi02, gdi04c, gdi05abc +destroy-gdi = Destroy all GDI troops. + +## gdi04ab +battlefield-control = Battlefield Control +apcs-left = APC squads in reserve: { $apcs } +retrieve-rods = Retrieve the crate with the stolen rods. +eliminate-reinforcements = Eliminate { $kills } Nod units for reinforcements. + +## gdi04c +defend-bialystok = Defend the town of Białystok. + +## gdi05abc +find-gdi-base = Find the GDI base. + +## gdi06 +destroy-nod-building = Destroy the Nod ********. + +## gdi07 +destroy-nod = Destroy remaining Nod structures and units. +construct-base = Construct all available buildings. + +## gdi08a +repair-base-vehicles = Repair GDI base and vehicles. + +## gdi08a, gdi09 +destroy-nod-force = Destroy the Nod strike force. + +## gdi08b +protect-mobius = Protect Dr. Mobius. +protect-hospital = Protect the Hospital. +keep-civilians-alive = Keep at least { $civilians } out of 14 Civilians alive. +destroy-nod-bases = Destroy the Nod bases. + +## gdi08ab, gdi09, nod02ab, nod05, nod07c +kill-all-enemies = Kill all enemies! + +## gdi09 +destroy-nod-bunkers = Destroy the Nod bunkers to allow Carter's + convoy to pass through safely. +convoy-passed-partly = Part of Carter's convoy passed through! + +## nod01 +destroy-gdi-troops-area = Destroy all GDI troops in the area. +kill-nikoomba = Kill Nikoomba. +destroy-village = Destroy the village. +eliminate-nod-forces = Eliminate all Nod forces. + +## nod02a +destroy-gdi-units = Destroy all GDI units. + +## nod02ab +build-base = Build a base. + +## nod02b, nod05 +destroy-gdi-base = Destroy the GDI base. + +## nod03ab +capture-prison = Capture the prison. +destroy-gdi-forces = Destroy all GDI forces. + +## nod04a +destroy-village-kill-civilians = Destroy the village and kill all civilians. +kill-gdi-units = Kill all GDI units in the area. + +## nod04b +protect-nod-supporters = Protect the civilians that support Nod. +kill-gdi-supporters = Kill all civilian GDI supporters. + +## nod05, nod07ab, nod09 +build-sams = Build { $sams } SAMs to fend off the GDI bombers. + +## nod06abc +steal-nuclear-detonator = Steal the GDI nuclear detonator. +move-to-evacuation-point = Move to the evacuation point. + +## nod06ab +destroy-gdi-supporter-houses = Destroy the houses of the GDI supporters + in the village. + +## nod06c +infiltrate-barracks-factory-conyard = Infiltrate the barracks, weapon factory and + the construction yard. + +## nod07a +find-nod-base = Find the Nod base. + +## nod07ab, nod08ab, nod09 +eliminate-gdi-forces = Eliminate all GDI forces in the area. + +## nod07c +capture-gdi-helipad = Capture the GDI helipad. +dont-capture-or-destroy = Don't capture or destroy any other + GDI main building. +orca-wreak-havoc = Use the GDI orca to wreak havoc at the village. +distract-guards = Distract the guards by attacking the + main entrance with your vehicles. + +## nod08ab +capture-gdi-outpost = Capture the GDI outpost. + +## nod08ab, nod09 +locate-nod-base = Locate the Nod base. + +## nod09 +secure-first-landing-zone = Secure the first landing zone. +secure-second-landing-zone = Secure the second landing zone. + +## nod10a +kill-gdi-scientist = Kill the GDI scientist. +destroy-tech-center = Destroy the GDI R&D center. + +## nod10b +destroy-capture-warfactory = Destroy or capture the Weapons Factory. +destroy-mammoth-tanks = Destroy the Mammoth tanks in the R&D base. +keep-commando-alive = Keep your Commando alive. diff --git a/mods/cnc/maps/cnc64gdi01/cnc64gdi01.lua b/mods/cnc/maps/cnc64gdi01/cnc64gdi01.lua index 02a11114ad..593cf0bf9d 100644 --- a/mods/cnc/maps/cnc64gdi01/cnc64gdi01.lua +++ b/mods/cnc/maps/cnc64gdi01/cnc64gdi01.lua @@ -38,9 +38,9 @@ WorldLoaded = function() InitObjectives(GDI) - DestroySAMs = GDI.AddObjective("Destroy the SAM sites protecting the Obelisk.") - DestroyObelisk = GDI.AddObjective("Destroy the Obelisk.") - DestroyBiotechCenter = GDI.AddObjective("Destroy the biotech facility.") + DestroySAMs = AddPrimaryObjective(GDI, "destroy-obelisk-sams") + DestroyObelisk = AddPrimaryObjective(GDI, "destroy-obelisk") + DestroyBiotechCenter = AddPrimaryObjective(GDI, "destroy-biotech") Trigger.OnAllKilled(SamSites, function() AirSupport = Actor.Create("airstrike.proxy", true, { Owner = GDI }) diff --git a/mods/cnc/maps/cnc64gdi01/map.yaml b/mods/cnc/maps/cnc64gdi01/map.yaml index 248cac81eb..3df027a179 100644 --- a/mods/cnc/maps/cnc64gdi01/map.yaml +++ b/mods/cnc/maps/cnc64gdi01/map.yaml @@ -714,3 +714,5 @@ Actors: Location: 26,14 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/funpark01/map.yaml b/mods/cnc/maps/funpark01/map.yaml index 61d1f9cdfe..4092047a8c 100644 --- a/mods/cnc/maps/funpark01/map.yaml +++ b/mods/cnc/maps/funpark01/map.yaml @@ -413,3 +413,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/funpark01/scj01ea.lua b/mods/cnc/maps/funpark01/scj01ea.lua index 5f0619b83b..c0d49a9062 100644 --- a/mods/cnc/maps/funpark01/scj01ea.lua +++ b/mods/cnc/maps/funpark01/scj01ea.lua @@ -16,16 +16,16 @@ WorldLoaded = function() Dinosaur = Player.GetPlayer("Dinosaur") Civilian = Player.GetPlayer("Civilian") - InvestigateObj = Nod.AddObjective("Investigate the nearby village for reports of\nstrange activity.") + InvestigateObj = AddPrimaryObjective(Nod, "investigate-village") InitObjectives(Nod) - ReachVillageObj = Nod.AddObjective("Reach the village.") + ReachVillageObj = AddPrimaryObjective(Nod, "reach-village") Trigger.OnPlayerDiscovered(Civilian, function(_, discoverer) if discoverer == Nod and not Nod.IsObjectiveCompleted(ReachVillageObj) then if not Dinosaur.HasNoRequiredUnits() then - KillDinos = Nod.AddObjective("Kill all creatures in the area.") + KillDinos = AddPrimaryObjective(Nod, "kill-creatures") end Nod.MarkCompletedObjective(ReachVillageObj) diff --git a/mods/cnc/maps/gdi01/gdi01.lua b/mods/cnc/maps/gdi01/gdi01.lua index fdadd75cb5..ff1d080286 100644 --- a/mods/cnc/maps/gdi01/gdi01.lua +++ b/mods/cnc/maps/gdi01/gdi01.lua @@ -32,8 +32,8 @@ WorldLoaded = function() InitObjectives(GDI) - SecureAreaObjective = GDI.AddObjective("Eliminate all Nod forces in the area.") - BeachheadObjective = GDI.AddObjective("Establish a beachhead.", "Secondary", false) + SecureAreaObjective = AddPrimaryObjective(GDI, "eliminate-nod") + BeachheadObjective = AddSecondaryObjective(GDI, "establish-beachhead") ReinforceWithLandingCraft(GDI, MCVReinforcements, lstStart.Location + CVec.New(2, 0), lstEnd.Location + CVec.New(2, 0), mcvTarget.Location) Reinforce(InfantryReinforcements) diff --git a/mods/cnc/maps/gdi01/map.yaml b/mods/cnc/maps/gdi01/map.yaml index 16ca5e13cf..d429a68799 100644 --- a/mods/cnc/maps/gdi01/map.yaml +++ b/mods/cnc/maps/gdi01/map.yaml @@ -236,3 +236,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi02/gdi02.lua b/mods/cnc/maps/gdi02/gdi02.lua index 90038cfb91..e922a37d90 100644 --- a/mods/cnc/maps/gdi02/gdi02.lua +++ b/mods/cnc/maps/gdi02/gdi02.lua @@ -44,9 +44,9 @@ WorldLoaded = function() InitObjectives(GDI) - NodObjective = Nod.AddObjective("Destroy all GDI troops.") - GDIObjective1 = GDI.AddObjective("Eliminate all Nod forces in the area.") - GDIObjective2 = GDI.AddObjective("Capture the Tiberium refinery.", "Secondary", false) + NodObjective = AddPrimaryObjective(Nod, "destroy-gdi") + GDIObjective1 = AddPrimaryObjective(GDI, "eliminate-nod") + GDIObjective2 = AddSecondaryObjective(GDI, "capture-refinery") Trigger.OnCapture(NodRefinery, function() GDI.MarkCompletedObjective(GDIObjective2) end) Trigger.OnKilled(NodRefinery, function() GDI.MarkFailedObjective(GDIObjective2) end) diff --git a/mods/cnc/maps/gdi02/map.yaml b/mods/cnc/maps/gdi02/map.yaml index 264a6f9005..2eb5fb028e 100644 --- a/mods/cnc/maps/gdi02/map.yaml +++ b/mods/cnc/maps/gdi02/map.yaml @@ -625,3 +625,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi03/gdi03.lua b/mods/cnc/maps/gdi03/gdi03.lua index eda145f6e1..1719e05cc5 100644 --- a/mods/cnc/maps/gdi03/gdi03.lua +++ b/mods/cnc/maps/gdi03/gdi03.lua @@ -60,8 +60,8 @@ WorldLoaded = function() InitObjectives(GDI) - DestroyNod = GDI.AddObjective("Eliminate all Nod forces in the area.") - local airSupportObjective = GDI.AddObjective("Destroy the SAM sites to receive air support.", "Secondary", false) + DestroyNod = AddPrimaryObjective(GDI, "eliminate-nod") + local airSupportObjective = AddSecondaryObjective(GDI, "destroy-sams") Trigger.OnAllKilled(SamSites, function() GDI.MarkCompletedObjective(airSupportObjective) diff --git a/mods/cnc/maps/gdi03/map.yaml b/mods/cnc/maps/gdi03/map.yaml index 8e268228d4..254cb822bb 100644 --- a/mods/cnc/maps/gdi03/map.yaml +++ b/mods/cnc/maps/gdi03/map.yaml @@ -699,3 +699,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi04a/gdi04a.lua b/mods/cnc/maps/gdi04a/gdi04a.lua index 90cf251293..f3aaaf88e6 100644 --- a/mods/cnc/maps/gdi04a/gdi04a.lua +++ b/mods/cnc/maps/gdi04a/gdi04a.lua @@ -54,7 +54,7 @@ SendGDIReinforcements = function() if GDIReinforcementsLeft > 0 then GDIReinforcementsLeft = GDIReinforcementsLeft - 1 Trigger.AfterDelay(DateTime.Seconds(5), function() - Media.DisplayMessage("APC squads in reserve: " .. GDIReinforcementsLeft, "Battlefield Control") + Media.DisplayMessage(UserInterface.Translate("apcs-left", { ["apcs"] = GDIReinforcementsLeft }), UserInterface.Translate("battlefield-control")) SendGDIReinforcements() end) end @@ -113,8 +113,9 @@ WorldLoaded = function() InitObjectives(GDI) - GDIObjective = GDI.AddObjective("Retrieve the crate with the stolen rods.") - ReinforcementsObjective = GDI.AddObjective("Eliminate " .. KillsUntilReinforcements .. " Nod units for reinforcements.", "Secondary", false) + GDIObjective = AddPrimaryObjective(GDI, "retrieve-rods") + local eliminateReinforcements = UserInterface.Translate("eliminate-reinforcements", { ["kills"] = KillsUntilReinforcements }) + ReinforcementsObjective = AddSecondaryObjective(GDI, eliminateReinforcements) BuildNod() Utils.Do(NodHelis, function(heli) diff --git a/mods/cnc/maps/gdi04a/map.yaml b/mods/cnc/maps/gdi04a/map.yaml index cf2cb5d37d..e905122d39 100644 --- a/mods/cnc/maps/gdi04a/map.yaml +++ b/mods/cnc/maps/gdi04a/map.yaml @@ -451,3 +451,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi04b/gdi04b.lua b/mods/cnc/maps/gdi04b/gdi04b.lua index fabafe1e12..5d1449a293 100644 --- a/mods/cnc/maps/gdi04b/gdi04b.lua +++ b/mods/cnc/maps/gdi04b/gdi04b.lua @@ -51,7 +51,7 @@ SendGDIReinforcements = function() if GDIReinforcementsLeft > 0 then GDIReinforcementsLeft = GDIReinforcementsLeft - 1 Trigger.AfterDelay(DateTime.Seconds(5), function() - Media.DisplayMessage("APC squads in reserve: " .. GDIReinforcementsLeft, "Battlefield Control") + Media.DisplayMessage(UserInterface.Translate("apcs-left", { ["apcs"] = GDIReinforcementsLeft }), UserInterface.Translate("battlefield-control")) SendGDIReinforcements() end) end @@ -104,8 +104,9 @@ WorldLoaded = function() InitObjectives(GDI) - GDIObjective = GDI.AddObjective("Retrieve the crate with the stolen rods.") - ReinforcementsObjective = GDI.AddObjective("Eliminate " .. KillsUntilReinforcements .. " Nod units for reinforcements.", "Secondary", false) + GDIObjective = AddPrimaryObjective(GDI, "retrieve-rods") + local eliminateReinforcements = UserInterface.Translate("eliminate-reinforcements", { ["kills"] = KillsUntilReinforcements }) + ReinforcementsObjective = AddSecondaryObjective(GDI, eliminateReinforcements) SetupWorld() diff --git a/mods/cnc/maps/gdi04b/map.yaml b/mods/cnc/maps/gdi04b/map.yaml index 3712ec4ce0..4c73124fda 100644 --- a/mods/cnc/maps/gdi04b/map.yaml +++ b/mods/cnc/maps/gdi04b/map.yaml @@ -528,3 +528,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi04c/gdi04c.lua b/mods/cnc/maps/gdi04c/gdi04c.lua index 78978585a6..0c5d34b5cc 100644 --- a/mods/cnc/maps/gdi04c/gdi04c.lua +++ b/mods/cnc/maps/gdi04c/gdi04c.lua @@ -73,9 +73,9 @@ WorldLoaded = function() GDI.MarkFailedObjective(DefendTown) end) - NodObjective = Nod.AddPrimaryObjective("Destroy all GDI troops.") - DefendTown = GDI.AddPrimaryObjective("Defend the town of Białystok.") - EliminateNod = GDI.AddPrimaryObjective("Eliminate all Nod forces in the area.") + NodObjective = AddPrimaryObjective(Nod, "destroy-gdi") + DefendTown = AddPrimaryObjective(GDI, "defend-bialystok") + EliminateNod = AddPrimaryObjective(GDI, "eliminate-nod") Trigger.OnExitedFootprint(TownAttackTrigger, function(a, id) if not TownAttackTriggered and a.Owner == GDI then diff --git a/mods/cnc/maps/gdi04c/map.yaml b/mods/cnc/maps/gdi04c/map.yaml index 0ff0ce69e0..1af3b4a379 100644 --- a/mods/cnc/maps/gdi04c/map.yaml +++ b/mods/cnc/maps/gdi04c/map.yaml @@ -745,3 +745,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi05a/gdi05a.lua b/mods/cnc/maps/gdi05a/gdi05a.lua index c68615e7b3..f92c3a876b 100644 --- a/mods/cnc/maps/gdi05a/gdi05a.lua +++ b/mods/cnc/maps/gdi05a/gdi05a.lua @@ -109,7 +109,7 @@ DiscoverGDIBase = function(actor, discoverer) BaseDiscovered = true - EliminateNod = GDI.AddObjective("Eliminate all Nod forces in the area.") + EliminateNod = AddPrimaryObjective(GDI, "eliminate-nod") GDI.MarkCompletedObjective(FindBase) Attack() @@ -168,9 +168,9 @@ WorldLoaded = function() InitObjectives(GDI) - NodObjective = Nod.AddObjective("Destroy all GDI troops.") - FindBase = GDI.AddObjective("Find the GDI base.") - DestroySAMs = GDI.AddObjective("Destroy all SAM sites to receive air support.", "Secondary", false) + NodObjective = AddPrimaryObjective(Nod, "destroy-gdi") + FindBase = AddPrimaryObjective(GDI, "find-gdi-base") + DestroySAMs = AddSecondaryObjective(GDI, "destroy-sams") SetupWorld() diff --git a/mods/cnc/maps/gdi05a/map.yaml b/mods/cnc/maps/gdi05a/map.yaml index 82110fe011..dc5a0145e4 100644 --- a/mods/cnc/maps/gdi05a/map.yaml +++ b/mods/cnc/maps/gdi05a/map.yaml @@ -757,3 +757,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi05b/gdi05b.lua b/mods/cnc/maps/gdi05b/gdi05b.lua index d2bc483106..4676086696 100644 --- a/mods/cnc/maps/gdi05b/gdi05b.lua +++ b/mods/cnc/maps/gdi05b/gdi05b.lua @@ -75,7 +75,7 @@ DiscoverGDIBase = function(actor, discoverer) BaseDiscovered = true - EliminateNod = GDI.AddObjective("Eliminate all Nod forces in the area.") + EliminateNod = AddPrimaryObjective(GDI, "eliminate-nod") GDI.MarkCompletedObjective(FindBase) end @@ -115,9 +115,9 @@ WorldLoaded = function() RepairNamedActors(Nod, RepairThreshold) - FindBase = GDI.AddObjective("Find the GDI base.") - DestroySAMs = GDI.AddObjective("Destroy all SAM sites to receive air support.", "Secondary", false) - NodObjective = Nod.AddObjective("Destroy all GDI troops.") + FindBase = AddPrimaryObjective(GDI, "find-gdi-base") + DestroySAMs = AddSecondaryObjective(GDI, "destroy-sams") + NodObjective = AddPrimaryObjective(Nod, "destroy-gdi") Trigger.AfterDelay(Atk1Delay, Atk1TriggerFunction) Trigger.AfterDelay(Atk2Delay, Atk2TriggerFunction) diff --git a/mods/cnc/maps/gdi05b/map.yaml b/mods/cnc/maps/gdi05b/map.yaml index c8adde5fa1..6726078c8b 100644 --- a/mods/cnc/maps/gdi05b/map.yaml +++ b/mods/cnc/maps/gdi05b/map.yaml @@ -613,3 +613,5 @@ Actors: Owner: Nod Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi05c/gdi05c.lua b/mods/cnc/maps/gdi05c/gdi05c.lua index 40374e6353..89ac533f6e 100644 --- a/mods/cnc/maps/gdi05c/gdi05c.lua +++ b/mods/cnc/maps/gdi05c/gdi05c.lua @@ -72,7 +72,7 @@ DiscoverGDIBase = function(actor, discoverer) BaseDiscovered = true - EliminateNod = GDI.AddObjective("Eliminate all Nod forces in the area.") + EliminateNod = AddPrimaryObjective(GDI, "eliminate-nod") GDI.MarkCompletedObjective(FindBase) end @@ -108,9 +108,9 @@ WorldLoaded = function() RepairNamedActors(Nod, RepairThreshold[Difficulty]) - FindBase = GDI.AddObjective("Find the GDI base.") - DestroySAMs = GDI.AddObjective("Destroy all SAM sites to receive air support.", "Secondary", false) - NodObjective = Nod.AddObjective("Destroy all GDI troops.") + FindBase = AddPrimaryObjective(GDI, "find-gdi-base") + DestroySAMs = AddSecondaryObjective(GDI, "destroy-sams") + NodObjective = AddPrimaryObjective(Nod, "destroy-gdi") Utils.Do(ActorRemovals[Difficulty], function(unit) unit.Destroy() diff --git a/mods/cnc/maps/gdi05c/map.yaml b/mods/cnc/maps/gdi05c/map.yaml index dc7666b8a5..fd048ae70a 100644 --- a/mods/cnc/maps/gdi05c/map.yaml +++ b/mods/cnc/maps/gdi05c/map.yaml @@ -766,3 +766,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi06/gdi06.lua b/mods/cnc/maps/gdi06/gdi06.lua index 635b57e3cd..ffb33d7fae 100644 --- a/mods/cnc/maps/gdi06/gdi06.lua +++ b/mods/cnc/maps/gdi06/gdi06.lua @@ -99,7 +99,7 @@ WorldLoaded = function() KillCounterHuntThreshold = 20 end - DestroyObjective = GDI.AddObjective("Destroy the Nod ********.") + DestroyObjective = AddPrimaryObjective(GDI, "destroy-nod-building") Trigger.OnKilled(Airfield, function() GDI.MarkCompletedObjective(DestroyObjective) diff --git a/mods/cnc/maps/gdi06/map.yaml b/mods/cnc/maps/gdi06/map.yaml index 0167b23875..07619fd561 100644 --- a/mods/cnc/maps/gdi06/map.yaml +++ b/mods/cnc/maps/gdi06/map.yaml @@ -1020,3 +1020,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Music: music.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi07/gdi07.lua b/mods/cnc/maps/gdi07/gdi07.lua index 6e1f8967c4..602c2d524e 100644 --- a/mods/cnc/maps/gdi07/gdi07.lua +++ b/mods/cnc/maps/gdi07/gdi07.lua @@ -118,12 +118,12 @@ WorldLoaded = function() InitObjectives(GDI) - DestroyNod = GDI.AddObjective("Destroy remaining Nod structures and units.") - ConstructBase = GDI.AddObjective("Construct all available buildings.", "Secondary", false) + DestroyNod = AddPrimaryObjective(GDI, "destroy-nod") + ConstructBase = AddSecondaryObjective(GDI, "construct-base") SendReinforcements() - local destroySAMs = GDI.AddSecondaryObjective("Destroy the SAM sites to receive air support.") + local destroySAMs = AddSecondaryObjective(GDI, "destroy-sams") Trigger.OnAllKilled(SamSites, function() GDI.MarkCompletedObjective(destroySAMs) Actor.Create("airstrike.proxy", true, { Owner = GDI }) diff --git a/mods/cnc/maps/gdi07/map.yaml b/mods/cnc/maps/gdi07/map.yaml index 510a597b7c..b3609152ce 100644 --- a/mods/cnc/maps/gdi07/map.yaml +++ b/mods/cnc/maps/gdi07/map.yaml @@ -1028,3 +1028,5 @@ Actors: Location: 14,46 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi08a/gdi08a.lua b/mods/cnc/maps/gdi08a/gdi08a.lua index 94bd0c087c..999b9e2d29 100644 --- a/mods/cnc/maps/gdi08a/gdi08a.lua +++ b/mods/cnc/maps/gdi08a/gdi08a.lua @@ -96,13 +96,13 @@ WorldLoaded = function() InitObjectives(GDI) - SecureArea = GDI.AddObjective("Destroy the Nod strike force.") - KillGDI = Nod.AddObjective("Kill all enemies!") + SecureArea = AddPrimaryObjective(GDI, "destroy-nod-force") + KillGDI = AddPrimaryObjective(Nod, "kill-all-enemies") - RepairAssets = GDI.AddObjective("Repair GDI base and vehicles.", "Secondary", false) + RepairAssets = AddSecondaryObjective(GDI, "repair-base-vehicles") Trigger.AfterDelay(DateTime.Seconds(5), function() CheckRepairGDIAssetsObjective() end) - AirSupport = GDI.AddObjective("Destroy the SAM sites to receive air support.", "Secondary", false) + AirSupport = AddSecondaryObjective(GDI, "destroy-sams") Trigger.OnAllKilled(SamSites, function() GDI.MarkCompletedObjective(AirSupport) Actor.Create("airstrike.proxy", true, { Owner = GDI }) diff --git a/mods/cnc/maps/gdi08a/map.yaml b/mods/cnc/maps/gdi08a/map.yaml index 8dbbe46ade..ae8b6f19d1 100644 --- a/mods/cnc/maps/gdi08a/map.yaml +++ b/mods/cnc/maps/gdi08a/map.yaml @@ -887,3 +887,5 @@ Actors: Location: 5,42 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi08b/gdi08b.lua b/mods/cnc/maps/gdi08b/gdi08b.lua index 8adb3571cb..86d37c7868 100644 --- a/mods/cnc/maps/gdi08b/gdi08b.lua +++ b/mods/cnc/maps/gdi08b/gdi08b.lua @@ -105,18 +105,20 @@ WorldLoaded = function() InitObjectives(GDI) - ProtectMoebius = GDI.AddObjective("Protect Dr. Mobius.") + ProtectMoebius = AddPrimaryObjective(GDI, "protect-mobius") Trigger.OnKilled(DrMoebius, function() GDI.MarkFailedObjective(ProtectMoebius) end) - ProtectHospital = GDI.AddObjective("Protect the Hospital.") + ProtectHospital = AddPrimaryObjective(GDI, "protect-hospital") Trigger.OnKilled(Hospital, function() GDI.MarkFailedObjective(ProtectHospital) end) CiviliansKilledThreshold = CiviliansKilledThreshold[Difficulty] - ProtectCivilians = GDI.AddObjective("Keep at least " .. 14 - CiviliansKilledThreshold .. " out of 14 Civilians alive.") + local civilians = 14 - CiviliansKilledThreshold + local keepCiviliansAlive = UserInterface.Translate("keep-civilians-alive", { ["civilians"] = civilians }) + ProtectCivilians = AddPrimaryObjective(GDI, keepCiviliansAlive) Utils.Do(Civilians, function(civilian) Trigger.OnKilled(civilian, function() CivilianCasualties = CivilianCasualties + 1 @@ -126,11 +128,11 @@ WorldLoaded = function() end) end) - SecureArea = GDI.AddObjective("Destroy the Nod bases.") + SecureArea = AddPrimaryObjective(GDI, "destroy-nod-bases") - KillGDI = Nod.AddObjective("Kill all enemies!") + KillGDI = AddPrimaryObjective(Nod, "kill-all-enemies") - AirSupport = GDI.AddObjective("Destroy the SAM sites to receive air support.", "Secondary", false) + AirSupport = AddSecondaryObjective(GDI, "destroy-sams") Trigger.OnAllKilled(SamSites, function() GDI.MarkCompletedObjective(AirSupport) Actor.Create("airstrike.proxy", true, { Owner = GDI }) diff --git a/mods/cnc/maps/gdi08b/map.yaml b/mods/cnc/maps/gdi08b/map.yaml index f91e720a35..7f4d5056ff 100644 --- a/mods/cnc/maps/gdi08b/map.yaml +++ b/mods/cnc/maps/gdi08b/map.yaml @@ -1062,3 +1062,5 @@ Actors: Location: 57,24 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/gdi09/gdi09.lua b/mods/cnc/maps/gdi09/gdi09.lua index 64b83c7263..925f272b0c 100644 --- a/mods/cnc/maps/gdi09/gdi09.lua +++ b/mods/cnc/maps/gdi09/gdi09.lua @@ -109,7 +109,7 @@ WorldLoaded = function() Camera.Position = DefaultCameraPosition.CenterPosition - DestroyBunkers = GDI.AddObjective("Destroy the Nod bunkers to allow Carter's\nconvoy to pass through safely.") + DestroyBunkers = AddPrimaryObjective(GDI, "destroy-nod-bunkers") Trigger.OnAllKilled(NodBunkersNorth, function() GDI.MarkCompletedObjective(DestroyBunkers) Trigger.AfterDelay(DateTime.Seconds(1), SpawnGunboat) @@ -123,17 +123,17 @@ WorldLoaded = function() if a.Type == "boat" then a.Stop() a.Destroy() - Media.DisplayMessage("Part of Carter's convoy passed through!") + Media.DisplayMessage(UserInterface.Translate("convoy-passed-partly")) Media.PlaySoundNotification(GDI, "Beepy6") end end) - SecureArea = GDI.AddObjective("Destroy the Nod strike force.") - KillGDI = Nod.AddObjective("Kill all enemies!") + SecureArea = AddPrimaryObjective(GDI, "destroy-nod-force") + KillGDI = AddPrimaryObjective(Nod, "kill-all-enemies") Trigger.AfterDelay(DateTime.Seconds(5), SendGDIReinforcements) - AirSupport = GDI.AddObjective("Destroy the SAM sites to receive air support.", "Secondary", false) + AirSupport = AddSecondaryObjective(GDI, "destroy-sams") Trigger.OnAllKilled(SamSites, function() GDI.MarkCompletedObjective(AirSupport) Actor.Create("airstrike.proxy", true, { Owner = GDI }) diff --git a/mods/cnc/maps/gdi09/map.yaml b/mods/cnc/maps/gdi09/map.yaml index 6fbb45f18c..d8e2b07194 100644 --- a/mods/cnc/maps/gdi09/map.yaml +++ b/mods/cnc/maps/gdi09/map.yaml @@ -783,3 +783,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod01/map.yaml b/mods/cnc/maps/nod01/map.yaml index cb8225d92d..ab2b079c68 100644 --- a/mods/cnc/maps/nod01/map.yaml +++ b/mods/cnc/maps/nod01/map.yaml @@ -232,3 +232,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod01/nod01.lua b/mods/cnc/maps/nod01/nod01.lua index 27d74d158e..be58b39061 100644 --- a/mods/cnc/maps/nod01/nod01.lua +++ b/mods/cnc/maps/nod01/nod01.lua @@ -41,10 +41,10 @@ WorldLoaded = function() InitObjectives(Nod) - KillNikoomba = Nod.AddObjective("Kill Nikoomba.") - DestroyVillage = Nod.AddObjective("Destroy the village.") - DestroyGDI = Nod.AddObjective("Destroy all GDI troops in the area.", "Secondary", false) - GDIObjective = GDI.AddObjective("Eliminate all Nod forces.") + KillNikoomba = AddPrimaryObjective(Nod, "kill-nikoomba") + DestroyVillage = AddPrimaryObjective(Nod, "destroy-village") + DestroyGDI = AddSecondaryObjective(Nod, "destroy-gdi-troops-area") + GDIObjective = AddPrimaryObjective(GDI, "eliminate-nod-forces") Trigger.OnKilled(Nikoomba, function() Nod.MarkCompletedObjective(KillNikoomba) diff --git a/mods/cnc/maps/nod02a/map.yaml b/mods/cnc/maps/nod02a/map.yaml index fb39ef6425..33d93def4a 100644 --- a/mods/cnc/maps/nod02a/map.yaml +++ b/mods/cnc/maps/nod02a/map.yaml @@ -235,3 +235,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod02a/nod02a.lua b/mods/cnc/maps/nod02a/nod02a.lua index 06865989f8..434bddf99d 100644 --- a/mods/cnc/maps/nod02a/nod02a.lua +++ b/mods/cnc/maps/nod02a/nod02a.lua @@ -31,9 +31,9 @@ WorldLoaded = function() InitObjectives(Nod) - GDIObjective = GDI.AddObjective("Kill all enemies.") - BuildBase = Nod.AddObjective("Build a base.") - DestroyGDI = Nod.AddObjective("Destroy all GDI units.") + GDIObjective = AddPrimaryObjective(GDI, "kill-all-enemies") + BuildBase = AddPrimaryObjective(Nod, "build-base") + DestroyGDI = AddPrimaryObjective(Nod, "destroy-gdi-units") Utils.Do({ Refinery, Yard }, function(actor) Trigger.OnDamaged(actor, function() diff --git a/mods/cnc/maps/nod02b/map.yaml b/mods/cnc/maps/nod02b/map.yaml index 63330edea4..0ca5a5ba11 100644 --- a/mods/cnc/maps/nod02b/map.yaml +++ b/mods/cnc/maps/nod02b/map.yaml @@ -196,3 +196,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod02b/nod02b.lua b/mods/cnc/maps/nod02b/nod02b.lua index f9d032367b..e40dcea1b0 100644 --- a/mods/cnc/maps/nod02b/nod02b.lua +++ b/mods/cnc/maps/nod02b/nod02b.lua @@ -38,9 +38,9 @@ WorldLoaded = function() InitObjectives(Nod) - BuildBase = Nod.AddObjective("Build a base.") - DestroyGDI = Nod.AddObjective("Destroy the GDI base.") - GDIObjective = GDI.AddObjective("Kill all enemies.") + BuildBase = AddPrimaryObjective(Nod, "build-base") + DestroyGDI = AddPrimaryObjective(Nod, "destroy-gdi-base") + GDIObjective = AddPrimaryObjective(GDI, "kill-all-enemies") Utils.Do(Guards, function(actor) Trigger.OnDamaged(actor, function() diff --git a/mods/cnc/maps/nod03a/map.yaml b/mods/cnc/maps/nod03a/map.yaml index 2ca2a02904..d4eb72a0ba 100644 --- a/mods/cnc/maps/nod03a/map.yaml +++ b/mods/cnc/maps/nod03a/map.yaml @@ -435,3 +435,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod03a/nod03a.lua b/mods/cnc/maps/nod03a/nod03a.lua index 5d2069ef23..f4e85d6115 100644 --- a/mods/cnc/maps/nod03a/nod03a.lua +++ b/mods/cnc/maps/nod03a/nod03a.lua @@ -27,8 +27,8 @@ WorldLoaded = function() InitObjectives(Nod) - CapturePrison = Nod.AddObjective("Capture the prison.") - DestroyGDI = Nod.AddObjective("Destroy all GDI forces.", "Secondary", false) + CapturePrison = AddPrimaryObjective(Nod, "capture-prison") + DestroyGDI = AddSecondaryObjective(Nod, "destroy-gdi-forces") Trigger.OnCapture(TechCenter, function() Trigger.AfterDelay(DateTime.Seconds(2), function() diff --git a/mods/cnc/maps/nod03b/map.yaml b/mods/cnc/maps/nod03b/map.yaml index 4465ce6f99..e73a968c00 100644 --- a/mods/cnc/maps/nod03b/map.yaml +++ b/mods/cnc/maps/nod03b/map.yaml @@ -476,3 +476,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod03b/nod03b.lua b/mods/cnc/maps/nod03b/nod03b.lua index 9fbba3af22..6ed3f658b5 100644 --- a/mods/cnc/maps/nod03b/nod03b.lua +++ b/mods/cnc/maps/nod03b/nod03b.lua @@ -41,8 +41,8 @@ WorldLoaded = function() InitObjectives(Nod) - CapturePrison = Nod.AddObjective("Capture the prison.") - DestroyGDI = Nod.AddObjective("Destroy all GDI forces.", "Secondary", false) + CapturePrison = AddPrimaryObjective(Nod, "capture-prison") + DestroyGDI = AddSecondaryObjective(Nod, "destroy-gdi-forces") Trigger.OnKilled(TechCenter, function() Nod.MarkFailedObjective(CapturePrison) diff --git a/mods/cnc/maps/nod04a/map.yaml b/mods/cnc/maps/nod04a/map.yaml index 7ce06e41d9..df2bb2d75d 100644 --- a/mods/cnc/maps/nod04a/map.yaml +++ b/mods/cnc/maps/nod04a/map.yaml @@ -478,3 +478,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod04a/nod04a.lua b/mods/cnc/maps/nod04a/nod04a.lua index 8256c03945..e301aa8fd4 100644 --- a/mods/cnc/maps/nod04a/nod04a.lua +++ b/mods/cnc/maps/nod04a/nod04a.lua @@ -106,8 +106,8 @@ WorldLoaded = function() InitObjectives(Nod) - KillCivilians = Nod.AddObjective("Destroy the village and kill all civilians.") - KillGDI = Nod.AddObjective("Kill all GDI units in the area.", "Secondary", false) + KillCivilians = AddPrimaryObjective(Nod, "destroy-village-kill-civilians") + KillGDI = AddSecondaryObjective(Nod, "kill-gdi-units") Camera.Position = CameraPoint.CenterPosition diff --git a/mods/cnc/maps/nod04b/map.yaml b/mods/cnc/maps/nod04b/map.yaml index 56fe60a230..c905ef451e 100644 --- a/mods/cnc/maps/nod04b/map.yaml +++ b/mods/cnc/maps/nod04b/map.yaml @@ -537,3 +537,5 @@ Actors: SubCell: 2 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod04b/nod04b.lua b/mods/cnc/maps/nod04b/nod04b.lua index f2a1fb7a0f..235f17ff02 100644 --- a/mods/cnc/maps/nod04b/nod04b.lua +++ b/mods/cnc/maps/nod04b/nod04b.lua @@ -73,7 +73,7 @@ CreateCivilians = function(actor, discoverer) actor.Owner = Nod end) - ProtectCivilians = Nod.AddPrimaryObjective("Protect the civilians that support Nod.") + ProtectCivilians = AddPrimaryObjective(Nod, "protect-nod-supporters") Trigger.OnAllKilled(NodCiviliansActors, function() Nod.MarkFailedObjective(ProtectCivilians) end) @@ -189,7 +189,7 @@ WorldLoaded = function() end end) - KillGDI = Nod.AddObjective("Kill all civilian GDI supporters.") + KillGDI = AddPrimaryObjective(Nod, "kill-gdi-supporters") Media.PlaySpeechNotification(Nod, "Reinforce") Reinforcements.Reinforce(Nod, NodUnitsBuggy, { UnitsEntryBuggy.Location, UnitsRallyBuggy.Location }, 11) diff --git a/mods/cnc/maps/nod05/map.yaml b/mods/cnc/maps/nod05/map.yaml index d9c272763c..9f4e6dac96 100644 --- a/mods/cnc/maps/nod05/map.yaml +++ b/mods/cnc/maps/nod05/map.yaml @@ -376,3 +376,5 @@ Actors: Owner: GDI Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod05/nod05.lua b/mods/cnc/maps/nod05/nod05.lua index 293d6a20fe..c772cc4615 100644 --- a/mods/cnc/maps/nod05/nod05.lua +++ b/mods/cnc/maps/nod05/nod05.lua @@ -25,6 +25,8 @@ AllUnits = { GDI1Units, GDI2Units, GDI3Units, GDI4Units, GDI5Units, GDI6Units, G AirstrikeDelay = DateTime.Minutes(1) + DateTime.Seconds(40) +SamSiteGoal = 3 + DelyCellTriggerActivator = { CPos.New(29,30), CPos.New(28,30), CPos.New(27,30), CPos.New(26,30), CPos.New(25,30), CPos.New(24,30), CPos.New(23,30), CPos.New(22,30), CPos.New(21,30), CPos.New(29,29), CPos.New(28,29), CPos.New(27,29), CPos.New(26,29), CPos.New(25,29), CPos.New(24,29), CPos.New(23,29), CPos.New(22,29) } DelzCellTriggerActivator = { CPos.New(29,27), CPos.New(28,27), CPos.New(27,27), CPos.New(26,27), CPos.New(25,27), CPos.New(24,27), CPos.New(29,26), CPos.New(28,26), CPos.New(27,26), CPos.New(26,26), CPos.New(25,26), CPos.New(24,26) } Atk5CellTriggerActivator = { CPos.New(10,33), CPos.New(9,33), CPos.New(8,33), CPos.New(9,32), CPos.New(8,32), CPos.New(7,32), CPos.New(8,31), CPos.New(7,31), CPos.New(6,31) } @@ -112,9 +114,10 @@ WorldLoaded = function() InitObjectives(Nod) - BuildSAMObjective = Nod.AddObjective("Build 3 SAMs.") - DestroyGDI = Nod.AddObjective("Destroy the GDI base.") - GDIObjective = GDI.AddObjective("Kill all enemies.") + local localBuildSAMs = UserInterface.Translate("build-sams", { ["sams"] = SamSiteGoal }) + BuildSAMObjective = AddPrimaryObjective(Nod, localBuildSAMs) + DestroyGDI = AddPrimaryObjective(Nod, "destroy-gdi-base") + GDIObjective = AddPrimaryObjective(GDI, "kill-all-enemies") Trigger.AfterDelay(AirstrikeDelay, SendGDIAirstrike) Trigger.AfterDelay(DateTime.Minutes(1) + DateTime.Seconds(30), SendGDI2Units) @@ -195,5 +198,5 @@ end CheckForSams = function(Nod) local sams = Nod.GetActorsByType("sam") - return #sams >= 3 + return #sams >= SamSiteGoal end diff --git a/mods/cnc/maps/nod06a/map.yaml b/mods/cnc/maps/nod06a/map.yaml index f5c3613723..c022fd204a 100644 --- a/mods/cnc/maps/nod06a/map.yaml +++ b/mods/cnc/maps/nod06a/map.yaml @@ -668,3 +668,5 @@ Actors: Facing: 368 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod06a/nod06a.lua b/mods/cnc/maps/nod06a/nod06a.lua index 9549c636c3..32368161e9 100644 --- a/mods/cnc/maps/nod06a/nod06a.lua +++ b/mods/cnc/maps/nod06a/nod06a.lua @@ -104,8 +104,8 @@ WorldLoaded = function() InitObjectives(Nod) - StealDetonator = Nod.AddObjective("Steal the GDI nuclear detonator.") - DestroyVillage = Nod.AddObjective("Destroy the houses of the GDI supporters\nin the village.", "Secondary", false) + StealDetonator = AddPrimaryObjective(Nod, "steal-nuclear-detonator") + DestroyVillage = AddSecondaryObjective(Nod, "destroy-gdi-supporter-houses") InsertNodUnits() @@ -162,7 +162,7 @@ WorldLoaded = function() Trigger.OnEnteredFootprint(DetonatorArea, function(a, id) if a.Owner == Nod then - EvacuateObjective = Nod.AddObjective("Move to the evacuation point.") + EvacuateObjective = AddPrimaryObjective(Nod, "move-to-evacuation-point") Nod.MarkCompletedObjective(StealDetonator) Trigger.RemoveFootprintTrigger(id) end diff --git a/mods/cnc/maps/nod06b/map.yaml b/mods/cnc/maps/nod06b/map.yaml index 5e253a9250..038820d516 100644 --- a/mods/cnc/maps/nod06b/map.yaml +++ b/mods/cnc/maps/nod06b/map.yaml @@ -598,3 +598,5 @@ Actors: Facing: 368 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod06b/nod06b.lua b/mods/cnc/maps/nod06b/nod06b.lua index e915e6ec5f..677bcc26af 100644 --- a/mods/cnc/maps/nod06b/nod06b.lua +++ b/mods/cnc/maps/nod06b/nod06b.lua @@ -93,8 +93,8 @@ WorldLoaded = function() InitObjectives(Nod) - StealDetonator = Nod.AddObjective("Steal the GDI nuclear detonator.") - DestroyVillage = Nod.AddObjective("Destroy the houses of the GDI supporters\nin the village.", "Secondary", false) + StealDetonator = AddPrimaryObjective(Nod, "steal-nuclear-detonator") + DestroyVillage = AddSecondaryObjective(Nod, "destroy-gdi-supporter-houses") InsertNodUnits() @@ -120,7 +120,7 @@ WorldLoaded = function() Trigger.OnEnteredFootprint(Win1CellTriggerActivator, function(a, id) if a.Owner == Nod then - EvacuateObjective = Nod.AddObjective("Move to the evacuation point.") + EvacuateObjective = AddPrimaryObjective(Nod, "move-to-evacuation-point") Nod.MarkCompletedObjective(StealDetonator) Trigger.RemoveFootprintTrigger(id) end diff --git a/mods/cnc/maps/nod06c/map.yaml b/mods/cnc/maps/nod06c/map.yaml index 14b54c071b..54f360fb20 100644 --- a/mods/cnc/maps/nod06c/map.yaml +++ b/mods/cnc/maps/nod06c/map.yaml @@ -466,3 +466,5 @@ Actors: Owner: GDI Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod06c/nod06c.lua b/mods/cnc/maps/nod06c/nod06c.lua index 99e040e105..ffc24cbd4c 100644 --- a/mods/cnc/maps/nod06c/nod06c.lua +++ b/mods/cnc/maps/nod06c/nod06c.lua @@ -61,8 +61,8 @@ WorldLoaded = function() InitObjectives(Nod) - NodObjective1 = Nod.AddObjective("Steal the GDI nuclear detonator.") - InfiltrateObjective = Nod.AddObjective("Infiltrate the barracks, weapon factory and\nthe construction yard.", "Secondary", false) + NodObjective1 = AddPrimaryObjective(Nod, "steal-nuclear-detonator") + InfiltrateObjective = AddSecondaryObjective(Nod, "infiltrate-barracks-factory-conyard") InsertNodUnits() @@ -95,7 +95,7 @@ WorldLoaded = function() Trigger.OnEnteredFootprint(Win1CellTriggerActivator, function(a, id) if a.Owner == Nod then - EvacuateObjective = Nod.AddObjective("Move to the evacuation point.") + EvacuateObjective = AddPrimaryObjective(Nod, "move-to-evacuation-point") Nod.MarkCompletedObjective(NodObjective1) Trigger.RemoveFootprintTrigger(id) end diff --git a/mods/cnc/maps/nod07a/map.yaml b/mods/cnc/maps/nod07a/map.yaml index fe992bde22..7b649ffde1 100644 --- a/mods/cnc/maps/nod07a/map.yaml +++ b/mods/cnc/maps/nod07a/map.yaml @@ -599,3 +599,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod07a/nod07a.lua b/mods/cnc/maps/nod07a/nod07a.lua index 8a5e103f7b..843e3e2b2c 100644 --- a/mods/cnc/maps/nod07a/nod07a.lua +++ b/mods/cnc/maps/nod07a/nod07a.lua @@ -36,9 +36,11 @@ NodBase = { NodBuilding1, NodBuilding2, NodBuilding3, NodHarvester } AbandonedBaseTrigger = { CPos.New(12, 42), CPos.New(11, 42), CPos.New(10, 42), CPos.New(13, 41), CPos.New(12, 41), CPos.New(11, 41), CPos.New(14, 40), CPos.New(13, 40), CPos.New(12, 40), CPos.New(6, 40), CPos.New(5, 40), CPos.New(4, 40), CPos.New(6, 39), CPos.New(5, 39), CPos.New(4, 39), CPos.New(6, 38), CPos.New(5, 38), CPos.New(4, 38) } ReinforcementsTrigger = { CPos.New(35, 23), CPos.New(34, 23), CPos.New(35, 22), CPos.New(34, 22), CPos.New(35, 21), CPos.New(34, 21), CPos.New(35, 20), CPos.New(34, 20), CPos.New(35, 19), CPos.New(34, 19), CPos.New(35, 18), CPos.New(34, 18), CPos.New(35, 17), CPos.New(34, 17), CPos.New(35, 16), CPos.New(34, 16), CPos.New(35, 15), CPos.New(34, 15), CPos.New(35, 14), CPos.New(34, 14), CPos.New(35, 13), CPos.New(34, 13), CPos.New(35, 12), CPos.New(34, 12), CPos.New(47, 11), CPos.New(46, 11), CPos.New(57, 19), CPos.New(56, 19), CPos.New(55, 19), CPos.New(54, 19), CPos.New(53, 19), CPos.New(52, 19), CPos.New(51, 19), CPos.New(50, 19), CPos.New(49, 19), CPos.New(48, 19), CPos.New(47, 19), CPos.New(46, 19), CPos.New(57, 18), CPos.New(56, 18), CPos.New(55, 18), CPos.New(54, 18), CPos.New(53, 18), CPos.New(52, 18), CPos.New(51, 18), CPos.New(50, 18), CPos.New(49, 18), CPos.New(48, 18), CPos.New(47, 18), CPos.New(46, 18), CPos.New(47, 17), CPos.New(46, 17), CPos.New(47, 16), CPos.New(46, 16), CPos.New(47, 15), CPos.New(46, 15), CPos.New(47, 14), CPos.New(46, 14), CPos.New(47, 13), CPos.New(46, 13), CPos.New(47, 12), CPos.New(46, 12) } +SamSiteGoal = 3 + CaptureStructures = function(actor) for i = 1, #WhitelistedStructures do - structures = Nod.GetActorsByType(WhitelistedStructures[i]) + local structures = Nod.GetActorsByType(WhitelistedStructures[i]) if #structures > 0 and not actor.IsDead and not structures[1].IsDead then actor.Capture(structures[1]) return @@ -48,7 +50,7 @@ end CheckForSams = function() local sams = Nod.GetActorsByType("sam") - return #sams >= 3 + return #sams >= SamSiteGoal end InsertNodUnits = function() @@ -171,10 +173,11 @@ WorldLoaded = function() InitObjectives(Nod) - FindBase = Nod.AddObjective("Find the Nod base.") - EliminateGDI = Nod.AddObjective("Eliminate all GDI forces in the area.") - BuildSAMs = Nod.AddObjective("Build 3 SAMs to fend off the GDI bombers.", "Secondary", false) - GDIObjective = GDI.AddObjective("Eliminate all Nod forces in the area.") + FindBase = AddPrimaryObjective(Nod, "find-nod-base") + EliminateGDI = AddPrimaryObjective(Nod, "eliminate-gdi-forces") + local buildSAMs = UserInterface.Translate("build-sams", { ["sams"] = SamSiteGoal }) + BuildSAMs = AddPrimaryObjective(Nod, buildSAMs) + GDIObjective = AddPrimaryObjective(GDI, "eliminate-nod") Trigger.OnKilled(GDIProc, function() Actor.Create("moneycrate", true, { Owner = GDI, Location = CPos.New(24, 54) }) diff --git a/mods/cnc/maps/nod07b/map.yaml b/mods/cnc/maps/nod07b/map.yaml index 88e37714bf..d32bab121e 100644 --- a/mods/cnc/maps/nod07b/map.yaml +++ b/mods/cnc/maps/nod07b/map.yaml @@ -956,3 +956,5 @@ Actors: Location: 12,5 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod07b/nod07b.lua b/mods/cnc/maps/nod07b/nod07b.lua index 47556454e2..06deeea348 100644 --- a/mods/cnc/maps/nod07b/nod07b.lua +++ b/mods/cnc/maps/nod07b/nod07b.lua @@ -43,6 +43,8 @@ Atk2 = { CPos.New(16, 52), CPos.New(15, 52), CPos.New(14, 52), CPos.New(13, 52), Atk3 = { CPos.New(53, 58), CPos.New(52, 58), CPos.New(51, 58), CPos.New(53, 57), CPos.New(52, 57), CPos.New(51, 57), CPos.New(53, 56), CPos.New(52, 56), CPos.New(51, 56), CPos.New(53, 55), CPos.New(52, 55), CPos.New(51, 55) } Atk4 = { CPos.New(54, 47), CPos.New(53, 47), CPos.New(52, 47), CPos.New(51, 47), CPos.New(43, 47), CPos.New(54, 46), CPos.New(53, 46), CPos.New(52, 46), CPos.New(51, 46), CPos.New(50, 46), CPos.New(43, 46), CPos.New(42, 46), CPos.New(41, 46), CPos.New(43, 45), CPos.New(42, 45), CPos.New(41, 45), CPos.New(43, 44), CPos.New(42, 44), CPos.New(41, 44), CPos.New(43, 43), CPos.New(42, 43), CPos.New(41, 43), CPos.New(43, 42) } +SamSiteGoal = 3 + CaptureStructures = function(actor) for i = 1, #WhitelistedStructures do structures = Nod.GetActorsByType(WhitelistedStructures[i]) @@ -55,7 +57,7 @@ end CheckForSams = function() local sams = Nod.GetActorsByType("sam") - return #sams >= 3 + return #sams >= SamSiteGoal end InsertNodUnits = function() @@ -169,8 +171,9 @@ WorldLoaded = function() InitObjectives(Nod) - EliminateGDI = Nod.AddObjective("Eliminate all GDI forces in the area.") - BuildSAMs = Nod.AddObjective("Build 3 SAMs to fend off the GDI bombers.", "Secondary", false) + EliminateGDI = AddPrimaryObjective(Nod, "eliminate-gdi-forces") + local buildSAMs = UserInterface.Translate("build-sams", { ["sams"] = SamSiteGoal }) + BuildSAMs = AddSecondaryObjective(Nod, buildSAMs) end Tick = function() diff --git a/mods/cnc/maps/nod07c/map.yaml b/mods/cnc/maps/nod07c/map.yaml index c56f3226e6..583968c11c 100644 --- a/mods/cnc/maps/nod07c/map.yaml +++ b/mods/cnc/maps/nod07c/map.yaml @@ -771,3 +771,5 @@ Actors: Location: 50,27 Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod07c/nod07c.lua b/mods/cnc/maps/nod07c/nod07c.lua index d735ba8f90..c820289a37 100644 --- a/mods/cnc/maps/nod07c/nod07c.lua +++ b/mods/cnc/maps/nod07c/nod07c.lua @@ -141,11 +141,11 @@ WorldLoaded = function() end end) - CaptureHelipad = Nod.AddObjective("Capture the GDI helipad.") - NoCaptureObjective = Nod.AddObjective("Don't capture or destroy any other\nGDI main building.") - UseOrcaObjective = Nod.AddObjective("Use the GDI orca to wreak havoc at the village.") - DistractGuardsObjective = Nod.AddObjective("Distract the guards by attacking the\nmain entrance with your vehicles.", "Secondary", false) - GDIObjective = GDI.AddObjective("Kill all enemies.") + CaptureHelipad = AddPrimaryObjective(Nod, "capture-gdi-helipad") + NoCaptureObjective = AddPrimaryObjective(Nod, "dont-capture-or-destroy") + UseOrcaObjective = AddPrimaryObjective(Nod, "orca-wreak-havoc") + DistractGuardsObjective = AddSecondaryObjective(Nod, "distract-guards") + GDIObjective = AddPrimaryObjective(GDI, "kill-all-enemies") end Tick = function() diff --git a/mods/cnc/maps/nod08a/map.yaml b/mods/cnc/maps/nod08a/map.yaml index b1e42464bd..871de18214 100644 --- a/mods/cnc/maps/nod08a/map.yaml +++ b/mods/cnc/maps/nod08a/map.yaml @@ -613,3 +613,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod08a/nod08a.lua b/mods/cnc/maps/nod08a/nod08a.lua index e2adbf83ec..2c2783e700 100644 --- a/mods/cnc/maps/nod08a/nod08a.lua +++ b/mods/cnc/maps/nod08a/nod08a.lua @@ -159,10 +159,10 @@ WorldLoaded = function() InitObjectives(Nod) - LocateNodBase = Nod.AddObjective("Locate the Nod base.") - CaptureGDIOutpost = Nod.AddObjective("Capture the GDI outpost.") - EliminateGDI = Nod.AddObjective("Eliminate all GDI forces in the area.") - GDIObjective = GDI.AddObjective("Eliminate all Nod forces in the area.") + LocateNodBase = AddPrimaryObjective(Nod, "locate-nod-base") + CaptureGDIOutpost = AddPrimaryObjective(Nod, "capture-gdi-outpost") + EliminateGDI = AddPrimaryObjective(Nod, "eliminate-gdi-forces") + GDIObjective = AddPrimaryObjective(GDI, "eliminate-nod") end Tick = function() diff --git a/mods/cnc/maps/nod08b/map.yaml b/mods/cnc/maps/nod08b/map.yaml index 97f74e656b..401963b2db 100644 --- a/mods/cnc/maps/nod08b/map.yaml +++ b/mods/cnc/maps/nod08b/map.yaml @@ -772,3 +772,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod08b/nod08b.lua b/mods/cnc/maps/nod08b/nod08b.lua index 6b8a4d76d8..5139a7d9ef 100644 --- a/mods/cnc/maps/nod08b/nod08b.lua +++ b/mods/cnc/maps/nod08b/nod08b.lua @@ -154,10 +154,10 @@ WorldLoaded = function() InitObjectives(Nod) - LocateNodBase = Nod.AddObjective("Locate the Nod base.") - CaptureGDIOutpost = Nod.AddObjective("Capture the GDI outpost.") - NodObjective3 = Nod.AddObjective("Eliminate all GDI forces in the area.") - GDIObjective = GDI.AddObjective("Eliminate all Nod forces in the area.") + LocateNodBase = AddPrimaryObjective(Nod, "locate-nod-base") + CaptureGDIOutpost = AddPrimaryObjective(Nod, "capture-gdi-outpost") + NodObjective3 = AddPrimaryObjective(Nod, "eliminate-gdi-forces") + GDIObjective = AddPrimaryObjective(GDI, "eliminate-nod") end Tick = function() diff --git a/mods/cnc/maps/nod09/map.yaml b/mods/cnc/maps/nod09/map.yaml index dd25c88998..aad4a42cc4 100644 --- a/mods/cnc/maps/nod09/map.yaml +++ b/mods/cnc/maps/nod09/map.yaml @@ -885,3 +885,5 @@ Actors: Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml Weapons: weapons.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod09/nod09.lua b/mods/cnc/maps/nod09/nod09.lua index 25034a2249..a78325c6cd 100644 --- a/mods/cnc/maps/nod09/nod09.lua +++ b/mods/cnc/maps/nod09/nod09.lua @@ -15,6 +15,8 @@ else Rambo = "rmbo" end +SamSiteGoal = 3 + WaypointGroup1 = { waypoint0, waypoint3, waypoint2, waypoint4, waypoint5, waypoint7 } WaypointGroup2 = { waypoint0, waypoint3, waypoint2, waypoint4, waypoint5, waypoint6 } WaypointGroup3 = { waypoint0, waypoint8, waypoint9, waypoint10, waypoint11, waypoint12, waypoint6, waypoint13 } @@ -48,7 +50,7 @@ AirstrikeDelay = DateTime.Minutes(2) + DateTime.Seconds(30) CheckForSams = function(Nod) local sams = Nod.GetActorsByType("sam") - return #sams >= 3 + return #sams >= SamSiteGoal end SendGDIAirstrike = function(hq, delay) @@ -189,13 +191,14 @@ WorldLoaded = function() InitObjectives(Nod) - SecureFirstLanding = Nod.AddObjective("Secure the first landing zone.") - SecureSecondLanding = Nod.AddObjective("Secure the second landing zone.") - LocateNodBase = Nod.AddObjective("Locate the Nod base.") - CaptureRefinery = Nod.AddObjective("Capture the refinery.") - EliminateGDI = Nod.AddObjective("Eliminate all GDI forces in the area.") - BuildSAMs = Nod.AddObjective("Build 3 SAMs to fend off the GDI bombers.", "Secondary", false) - GDIObjective = GDI.AddObjective("Eliminate all Nod forces in the area.") + SecureFirstLanding = AddPrimaryObjective(Nod, "secure-first-landing-zone") + SecureSecondLanding = AddPrimaryObjective(Nod, "secure-second-landing-zone") + LocateNodBase = AddPrimaryObjective(Nod, "locate-nod-base") + CaptureRefinery = AddPrimaryObjective(Nod, "capture-refinery") + EliminateGDI = AddPrimaryObjective(Nod, "eliminate-gdi-forces") + local buildSAMs = UserInterface.Translate("build-sams", { ["sams"] = SamSiteGoal }) + BuildSAMs = AddSecondaryObjective(Nod, buildSAMs) + GDIObjective = AddPrimaryObjective(GDI, "eliminate-nod") end Tick = function() diff --git a/mods/cnc/maps/nod10a/map.yaml b/mods/cnc/maps/nod10a/map.yaml index b54588bd97..3f1b1b6976 100644 --- a/mods/cnc/maps/nod10a/map.yaml +++ b/mods/cnc/maps/nod10a/map.yaml @@ -1344,3 +1344,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod10a/nod10a.lua b/mods/cnc/maps/nod10a/nod10a.lua index 760b3bea56..3163c57700 100644 --- a/mods/cnc/maps/nod10a/nod10a.lua +++ b/mods/cnc/maps/nod10a/nod10a.lua @@ -32,7 +32,7 @@ end CreateScientist = function() local scientist = Actor.Create("CHAN", true, { Owner = GDI, Location = ScientistLocation.Location }) - KillScientistObjective = Nod.AddObjective("Kill the GDI scientist.") + KillScientistObjective = AddPrimaryObjective(Nod, "kill-gdi-scientist") Nod.MarkCompletedObjective(DestroyTechCenterObjective) Trigger.OnKilled(scientist, function() @@ -54,7 +54,7 @@ WorldLoaded = function() RepairBuilding(GDI, building, 0.75) end) - DestroyTechCenterObjective = Nod.AddObjective("Destroy the GDI R&D center.") + DestroyTechCenterObjective = AddPrimaryObjective(Nod, "destroy-tech-center") Actor.Create(Rambo, true, { Owner = Nod, Location = RamboLocation.Location }) diff --git a/mods/cnc/maps/nod10b/map.yaml b/mods/cnc/maps/nod10b/map.yaml index 769da92b03..a728d9b258 100644 --- a/mods/cnc/maps/nod10b/map.yaml +++ b/mods/cnc/maps/nod10b/map.yaml @@ -725,3 +725,5 @@ Actors: Owner: Neutral Rules: cnc|rules/campaign-maprules.yaml, cnc|rules/campaign-tooltips.yaml, cnc|rules/campaign-palettes.yaml, rules.yaml + +Translations: cnc|languages/lua/en.ftl diff --git a/mods/cnc/maps/nod10b/nod10b.lua b/mods/cnc/maps/nod10b/nod10b.lua index e54e45fba5..32be07208d 100644 --- a/mods/cnc/maps/nod10b/nod10b.lua +++ b/mods/cnc/maps/nod10b/nod10b.lua @@ -52,10 +52,10 @@ WorldLoaded = function() InitObjectives(Nod) - GDIObjective = GDI.AddPrimaryObjective("Eliminate all Nod forces in the area.") - WarFactoryObjective = Nod.AddPrimaryObjective("Destroy or capture the Weapons Factory.") - DestroyTanksObjective = Nod.AddPrimaryObjective("Destroy the Mammoth tanks in the R&D base.") - KeepRamboAliveObjective = Nod.AddObjective("Keep your Commando alive.", "Secondary", false) + GDIObjective = AddPrimaryObjective(Nod, "eliminate-nod") + WarFactoryObjective = AddPrimaryObjective(Nod, "destroy-capture-warfactory") + DestroyTanksObjective = AddPrimaryObjective(Nod, "destroy-mammoth-tanks") + KeepRamboAliveObjective = AddSecondaryObjective(Nod, "keep-commando-alive") Trigger.OnKilledOrCaptured(WeaponsFactory, function() Nod.MarkCompletedObjective(WarFactoryObjective) diff --git a/mods/cnc/scripts/campaign.lua b/mods/cnc/scripts/campaign.lua index f0e3c5cc39..bca0362609 100644 --- a/mods/cnc/scripts/campaign.lua +++ b/mods/cnc/scripts/campaign.lua @@ -10,15 +10,11 @@ Difficulty = Map.LobbyOption("difficulty") InitObjectives = function(player) - Trigger.OnObjectiveAdded(player, function(p, id) - 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.DisplayMessage(p.GetObjectiveDescription(id), UserInterface.Translate("objective-completed")) end) Trigger.OnObjectiveFailed(player, function(p, id) - Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") + Media.DisplayMessage(p.GetObjectiveDescription(id), UserInterface.Translate("objective-failed")) end) Trigger.OnPlayerLost(player, function() diff --git a/mods/common/scripts/utils.lua b/mods/common/scripts/utils.lua index 0b9fdab40a..b400bd6e0d 100644 --- a/mods/common/scripts/utils.lua +++ b/mods/common/scripts/utils.lua @@ -12,3 +12,23 @@ IdleHunt = function(actor) Trigger.OnIdle(actor, actor.Hunt) end end + +---Adds a new mandatory objective, translates it and announces it via in-game chat message. +---@param player player recipient of the objective +---@param description string key of the translation string +---@return number id used to query for the objective later +AddPrimaryObjective = function(player, description) + local translation = UserInterface.Translate(description) + Media.DisplayMessage(translation, UserInterface.Translate("new-primary-objective")) + return player.AddObjective(translation, UserInterface.Translate("primary"), true) +end + +---Adds a new optional objective, translates it and announces it via in-game chat message. +---@param player player recipient of the objective +---@param description string key of the translation string +---@return number id used to query for the objective later +AddSecondaryObjective = function(player, description) + local translation = UserInterface.Translate(description) + Media.DisplayMessage(translation, UserInterface.Translate("new-secondary-objective")) + return player.AddObjective(translation, UserInterface.Translate("secondary"), false) +end