Extract translation strings.

This commit is contained in:
Matthias Mailänder
2022-10-21 21:26:30 +02:00
committed by abcdefg30
parent 640e9d68b7
commit 5032b2b872
65 changed files with 575 additions and 268 deletions

View File

@@ -7,6 +7,26 @@
information, see COPYING. information, see COPYING.
]] ]]
---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.DisplayMessageToPlayer(player, 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.DisplayMessageToPlayer(player, translation, UserInterface.Translate("new-secondary-objective"))
return player.AddObjective(translation, UserInterface.Translate("secondary"), false)
end
IdleHunt = function(actor) IdleHunt = function(actor)
if actor.HasProperty("Hunt") and not actor.IsDead then if actor.HasProperty("Hunt") and not actor.IsDead then
Trigger.OnIdle(actor, actor.Hunt) Trigger.OnIdle(actor, actor.Hunt)

View File

@@ -0,0 +1,155 @@
## campaign.lua
objective-failed = Objective failed
objective-completed = Objective completed
primary = Primary
secondary = Secondary
new-primary-objective = New primary objective
new-secondary-objective = New secondary objectives
mentat = Mentat
## atreides-01ab, atreides03ab, harkonnen-01a, ordos-05
harvested-resources = Harvested resources: { $harvested }/{ $goal }
harvest-spice = Harvest { $spice } Solaris worth of Spice.
not-enough-silos = We don't have enough silo space to store the required amount of Spice!
## atreides-01ab, harkonnen-01ab, ordos01ab
build-concrete = Build a concrete foundation before placing your buildings.
build-windtrap = Build a Wind Trap for power.
build-refinery = Build a Refinery to collect Spice.
build-silo = Build a Silo to store additional Spice.
## atreides-01ab, ordos01a, ordos-03ab
eliminate-harkonnen-units-reinforcements = Eliminate all Harkonnen units and reinforcements
in the area.
## atreides-02a, atreides-04, atreides-05, ordos-02ab, ordos-03ab, ordos-04, ordos-06a
harkonnen-annihilated = The Harkonnen have been annihilated!
## atreides-02a, ordos02ab
destroy-harkonnen-forces = Destroy all Harkonnen forces.
## atreides-02b, atreides-03b, harkonnen-05, harkonnen-06ab, harkonnen-08
ordos-annihilated = The Ordos have been annihilated!
## atreides-02b, atreides-03b, harkonnen-03ab, ordos-03a
upgrade-barracks-light-factory = Upgrade Barracks and Light Factory to produce more advanced units.
## atreides-02b
eliminate-ordos-units-reinforcements = Eliminate all Ordos units and reinforcements
in the area.
## atreides-04, ordos-04, ordos-06a
destroy-harkonnen = Destroy the Harkonnen.
## atreides-04
sietch-integrity = Sietch structural integrity: { $integrity }%
protect-fremen-sietch = Protect the Fremen Sietch.
keep-sietch-intact = Keep the Sietch { $integrity }% intact!
fremen-sietch-southeast = Fremen Sietch detected to the southeast.
sietch-destroyed = Sietch destroyed!
fremen-sietch-under-attack = The Fremen Sietch is under attack!
## atreides-05, harkonnen-06ab, harkonnen09ab
smugglers-annihilated = The Smugglers have been annihilated!
## atreides-05
incoming-mercenary-force = Incoming hostile Mercenary force detected.
contraband-has-arrived = The contraband has arrived!
contraband-confiscated = Contraband has arrived and been confiscated.
contraband-not-confiscated = Smuggler contraband has arrived. It is too late to confiscate.
contraband-arrives-in = The contraband will arrive in { $time }
capture-barracks-sietch-tabr = Capture the Barracks at Sietch Tabr.
annihilate-harkonnen-units-reinforcements = Annihilate all other Harkonnen units
and reinforcements.
capture-smuggler-starport-confiscate-contraband = Capture the Smuggler Starport and
confiscate the contraband.
contraband-approaching-starport-north-in = The contraband is approaching the Starport to the north in { $time }.
starport-destroyed-no-contraband = Starport destroyed! Contraband can't land.
do-not-destroy-starport = Don't destroy the Starport!
defend-captured-starport = Defend the captured Starport.
do-not-destroy-barracks = Don't destroy the Barracks!
hostages-released = Hostages released!
stay-away-from-starport = Stay away from our Starport.
smuggler-leader = Smuggler Leader
were-warned-will-pay = You were warned. Now you will pay.
destroy-smugglers-mercenaries = Destroy the Smugglers and their Mercenaries.
capture-harkonnen-barracks-release-hostages = Capture the Harkonnen barracks to release the hostages.
## harkonnen-01ab, harkonnen-03ab
eliminate-atreides-units-reinforcements = Eliminate all Atreides units and reinforcements
in the area.
## harkonnen-02ab, harkonnen-03ab, harkonnen-04, harkonnen-07, harkonnen-08, harkonnen-09, ordos-05, ordos-06a
atreides-annihilated = The Atreides have been annihilated!
## harkonnen-02ab, harkonnen-03ab, harkonnen-04
destroy-atreides-forces = Destroy all Atreides forces.
## harkonnen-04, harkonnen-07, harkonnen-08, harkonnen-09ab, ordos-05, ordos-06a
destroy-atreides = Destroy the Atreides.
## harkonnen-04
fremen-annihilated = The Fremen have been annihilated!
destroy-fremen = Destroy the Fremen.
fremen-spotted-north-southeast = Fremen concentrations spotted to the north and southwest.
## harkonnen-05
imperial-ships-penetrating-defense-grid = Imperial ships penetrating defense grid!
enemy-carryall-drop-detected = Enemy carryall drop detected!
keep-modified-outpost-intact = Keep the modified Outpost intact.
protect-outpost = Protect the Outpost from attack.
## harkonnen-05, harkonnen-09ab
destroy-imperial-forces = Destroy the Imperial forces.
## harkonnen-05, harkonnen-07, harkonnen-09ab
emperor-annihilated = The Emperor has been annihilated!
## harkonnen-05, harkonnen-08
destroy-ordos = Destroy the Ordos.
## harkonnen-06ab
ixian-transports-detected = Ixian transports detected.
capture-destroy-ordos-starport = Capture or destroy the Ordos Starport.
## harkonnen-06ab, harkonnen-09ab
smugglers-now-hostile = The Smugglers are now hostile!
## harkonnen-07
high-tech-factory-neutralized-imperial-reinforcements = High Tech Factory neutralized! Atreides cut off from Imperial reinforcement!
capture-atreides-construction-yard-south = Capture the Atreides Construction Yard in the south.
destroy-corrino = Destroy the Corrino.
destroy-atreides-high-tech-factory-imperial-reinforcements = Destroy Atreides High Tech Factory to cut off Atreides from Imperial reinforcements.
## harkonnen-08
atreides-hostile = The Atreides are now hostile!
mercenaries-annihilated = The Mercenaries have been annihilated!
ally-mercenaries = Persuade the Mercenaries to fight with
House Harkonnen.
mercenary-leader-captured-allied = Leader Captured. Mercenaries have been persuaded to fight with House Harkonnen.
can-not-stand-harkonnen-must-become-neutral = We cannot stand against the Harkonnen. We must become neutral.
atreides-commander = Atreides Commander
## harkonnen-09ab
build-deploy-mcv = Build an MCV and deploy it into a Construction Yard.
## ordos-01ab, ordos-02ab, ordos-03ab, ordos-04, ordos-05
outpost-not-captured-destroyed = Don't let the Outpost to be captured or destroyed.
capture-smuggler-outpost = Capture the Smuggler Outpost.
do-not-destroy-outpost = Don't destroy the Outpost!
warning-large-force-approaching = WARNING: Large force approaching!
## ordos-05
capture-atreides-starport-establish-base = Capture the Atreides Starport and establish a base.
## ordos-06a
ixian-reinforcements-arrived = Ixian reinforcements have arrived!
deliveries-arriving-massive-reinforcements = Deliveries beginning to arrive. Massive reinforcements expected!
initial-reinforcements-arrive-in = Initial reinforcements will arrive in { $time }
additional-reinforcements-arrive-in = Additional reinforcements will arrive in { $time }
defend-starport = Defend the Starport.
ixian-reinforcements-in = The first batch of Ixian reinforcements will arrive in { $time }.
enemy-reinforcements-arrived = Enemy reinforcements have arrived.

View File

@@ -53,12 +53,13 @@ AtreidesEntryPath = { AtreidesWaypoint.Location, AtreidesRally.Location }
Messages = Messages =
{ {
"Build a concrete foundation before placing your buildings.", UserInterface.Translate("build-concrete"),
"Build a Wind Trap for power.", UserInterface.Translate("build-windtrap"),
"Build a Refinery to collect Spice.", UserInterface.Translate("build-refinery"),
"Build a Silo to store additional Spice." UserInterface.Translate("build-silo")
} }
CachedResources = -1
Tick = function() Tick = function()
if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
@@ -71,21 +72,26 @@ Tick = function()
-- player has no Wind Trap -- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false HasPower = false
Media.DisplayMessage(Messages[2], "Mentat") Media.DisplayMessage(Messages[2], Mentat)
else else
HasPower = true HasPower = true
end end
-- player has no Refinery and no Silos -- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat") Media.DisplayMessage(Messages[3], Mentat)
end end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat") Media.DisplayMessage(Messages[4], Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -95,14 +101,15 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(harkonnen, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillHarkonnen = player.AddSecondaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillHarkonnen = AddSecondaryObjective(player, "eliminate-harkonnen-units-reinforcements")
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillAtreides)
end) end)
@@ -133,7 +140,7 @@ WorldLoaded = function()
end end
end) end)
Media.DisplayMessage(Messages[1], "Mentat") Media.DisplayMessage(Messages[1], Mentat)
Trigger.AfterDelay(DateTime.Seconds(25), function() Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")

View File

@@ -113,3 +113,5 @@ Actors:
Owner: Neutral Owner: Neutral
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -53,12 +53,13 @@ AtreidesEntryPath = { AtreidesWaypoint.Location, AtreidesRally.Location }
Messages = Messages =
{ {
"Build a concrete foundation before placing your buildings.", UserInterface.Translate("build-concrete"),
"Build a Wind Trap for power.", UserInterface.Translate("build-windtrap"),
"Build a Refinery to collect Spice.", UserInterface.Translate("build-refinery"),
"Build a Silo to store additional Spice." UserInterface.Translate("build-silo")
} }
CachedResources = -1
Tick = function() Tick = function()
if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
@@ -71,21 +72,26 @@ Tick = function()
-- player has no Wind Trap -- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false HasPower = false
Media.DisplayMessage(Messages[2], "Mentat") Media.DisplayMessage(Messages[2], Mentat)
else else
HasPower = true HasPower = true
end end
-- player has no Refinery and no Silos -- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat") Media.DisplayMessage(Messages[3], Mentat)
end end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat") Media.DisplayMessage(Messages[4], Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -95,14 +101,15 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(harkonnen, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillHarkonnen = player.AddSecondaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillHarkonnen = AddSecondaryObjective(player, "eliminate-harkonnen-units-reinforcements")
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillAtreides)
end) end)
@@ -133,7 +140,7 @@ WorldLoaded = function()
end end
end) end)
Media.DisplayMessage(Messages[1], "Mentat") Media.DisplayMessage(Messages[1], Mentat)
Trigger.AfterDelay(DateTime.Seconds(25), function() Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")

View File

@@ -112,3 +112,5 @@ Actors:
Owner: Neutral Owner: Neutral
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -70,7 +70,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
end end
@@ -80,8 +80,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Atreides") player = Player.GetPlayer("Atreides")
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(harkonnen, "")
KillHarkonnen = player.AddPrimaryObjective("Destroy all Harkonnen forces.") KillHarkonnen = AddPrimaryObjective(player, "destroy-harkonnen-forces")
Camera.Position = AConyard.CenterPosition Camera.Position = AConyard.CenterPosition

View File

@@ -170,3 +170,5 @@ Actors:
Location: 30,28 Location: 30,28
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -70,7 +70,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
end end
@@ -80,8 +80,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Atreides") player = Player.GetPlayer("Atreides")
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(harkonnen, "")
KillHarkonnen = player.AddPrimaryObjective("Destroy all Harkonnen forces.") KillHarkonnen = AddPrimaryObjective(player, "destroy-harkonnen-forces")
Camera.Position = AConyard.CenterPosition Camera.Position = AConyard.CenterPosition

View File

@@ -140,3 +140,5 @@ Actors:
Location: 30,28 Location: 30,28
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -81,13 +81,14 @@ MessageCheck = function(index)
return #player.GetActorsByType(AtreidesBaseBuildings[index]) > 0 and not player.HasPrerequisites({ AtreidesUpgrades[index] }) return #player.GetActorsByType(AtreidesBaseBuildings[index]) > 0 and not player.HasPrerequisites({ AtreidesUpgrades[index] })
end end
CachedResources = -1
Tick = function() Tick = function()
if player.HasNoRequiredUnits() then if player.HasNoRequiredUnits() then
ordos.MarkCompletedObjective(KillAtreides) ordos.MarkCompletedObjective(KillAtreides)
end end
if ordos.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then if ordos.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then
Media.DisplayMessage("The Ordos have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("ordos-annihilated"), Mentat)
player.MarkCompletedObjective(KillOrdos) player.MarkCompletedObjective(KillOrdos)
end end
@@ -105,10 +106,15 @@ Tick = function()
end end
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
Media.DisplayMessage("Upgrade barracks and light factory to produce more advanced units.", "Mentat") Media.DisplayMessage(UserInterface.Translate("upgrade-barracks-light-factory"), Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -118,16 +124,17 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillAtreides = ordos.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(ordos, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillOrdos = player.AddSecondaryObjective("Eliminate all Ordos units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillOrdos = AddSecondaryObjective(player, "eliminate-ordos-units-reinforcements")
Camera.Position = AConyard.CenterPosition Camera.Position = AConyard.CenterPosition
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
ordos.MarkCompletedObjective(KillAtreides) ordos.MarkCompletedObjective(KillAtreides)
end) end)

View File

@@ -137,3 +137,5 @@ Actors:
Location: 39,30 Location: 39,30
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -81,13 +81,14 @@ MessageCheck = function(index)
return #player.GetActorsByType(AtreidesBaseBuildings[index]) > 0 and not player.HasPrerequisites({ AtreidesUpgrades[index] }) return #player.GetActorsByType(AtreidesBaseBuildings[index]) > 0 and not player.HasPrerequisites({ AtreidesUpgrades[index] })
end end
CachedResources = -1
Tick = function() Tick = function()
if player.HasNoRequiredUnits() then if player.HasNoRequiredUnits() then
ordos.MarkCompletedObjective(KillAtreides) ordos.MarkCompletedObjective(KillAtreides)
end end
if ordos.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then if ordos.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then
Media.DisplayMessage("The Ordos have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("ordos-annihilated"), Mentat)
player.MarkCompletedObjective(KillOrdos) player.MarkCompletedObjective(KillOrdos)
end end
@@ -105,10 +106,15 @@ Tick = function()
end end
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
Media.DisplayMessage("Upgrade barracks and light factory to produce more advanced units.", "Mentat") Media.DisplayMessage(UserInterface.Translate("upgrade-barracks-light-factory"), Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -118,16 +124,17 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillAtreides = ordos.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(ordos, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillOrdos = player.AddSecondaryObjective("Eliminate all Ordos units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillOrdos = AddSecondaryObjective(player, "eliminate-ordos-units-reinforcements")
Camera.Position = AConyard.CenterPosition Camera.Position = AConyard.CenterPosition
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
ordos.MarkCompletedObjective(KillAtreides) ordos.MarkCompletedObjective(KillAtreides)
end) end)

View File

@@ -134,3 +134,5 @@ Actors:
Location: 15,34 Location: 15,34
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -108,7 +108,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
player.MarkCompletedObjective(ProtectFremen) player.MarkCompletedObjective(ProtectFremen)
player.MarkCompletedObjective(KeepIntegrity) player.MarkCompletedObjective(KeepIntegrity)
@@ -126,7 +126,8 @@ Tick = function()
if not Sietch.IsDead then if not Sietch.IsDead then
AttackNotifier = AttackNotifier - 1 AttackNotifier = AttackNotifier - 1
local integrity = math.floor((Sietch.Health * 100) / Sietch.MaxHealth) local integrity = math.floor((Sietch.Health * 100) / Sietch.MaxHealth)
UserInterface.SetMissionText("Sietch structural integrity: " .. integrity .. "%", player.Color) SiegeIntegrity = UserInterface.Translate("sietch-integrity", { ["integrity"] = integrity })
UserInterface.SetMissionText(SiegeIntegrity, player.Color)
if integrity < IntegrityLevel[Difficulty] then if integrity < IntegrityLevel[Difficulty] then
player.MarkFailedObjective(KeepIntegrity) player.MarkFailedObjective(KeepIntegrity)
@@ -140,17 +141,18 @@ WorldLoaded = function()
player = Player.GetPlayer("Atreides") player = Player.GetPlayer("Atreides")
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(harkonnen, "")
ProtectFremen = player.AddPrimaryObjective("Protect the Fremen Sietch.") ProtectFremen = AddPrimaryObjective(player, "protect-fremen-sietch")
KillHarkonnen = player.AddPrimaryObjective("Destroy the Harkonnen.") KillHarkonnen = AddPrimaryObjective(player, "destroy-harkonnen")
KeepIntegrity = player.AddSecondaryObjective("Keep the Sietch " .. IntegrityLevel[Difficulty] .. "% intact!") local keepSietchIntact = UserInterface.Translate("keep-sietch-intact", { ["integrity"] = IntegrityLevel[Difficulty] })
KeepIntegrity = AddPrimaryObjective(player, keepSietchIntact)
Camera.Position = AConyard.CenterPosition Camera.Position = AConyard.CenterPosition
HarkonnenAttackLocation = AConyard.Location HarkonnenAttackLocation = AConyard.Location
Trigger.AfterDelay(DateTime.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
Beacon.New(player, Sietch.CenterPosition + WVec.New(0, 1024, 0)) Beacon.New(player, Sietch.CenterPosition + WVec.New(0, 1024, 0))
Media.DisplayMessage("Fremen Sietch detected to the southeast.", "Mentat") Media.DisplayMessage(UserInterface.Translate("fremen-sietch-southeast"), Mentat)
end) end)
Trigger.OnAllKilledOrCaptured(HarkonnenBase, function() Trigger.OnAllKilledOrCaptured(HarkonnenBase, function()
@@ -159,14 +161,14 @@ WorldLoaded = function()
Trigger.OnKilled(Sietch, function() Trigger.OnKilled(Sietch, function()
Actor.Create("invisibleBlocker", true, { Owner = fremen, Location = CPos.New(62, 59) }) Actor.Create("invisibleBlocker", true, { Owner = fremen, Location = CPos.New(62, 59) })
UserInterface.SetMissionText("Sietch destroyed!", player.Color) UserInterface.SetMissionText(UserInterface.Translate("sietch-destroyed"), player.Color)
player.MarkFailedObjective(ProtectFremen) player.MarkFailedObjective(ProtectFremen)
end) end)
Trigger.OnDamaged(Sietch, function() Trigger.OnDamaged(Sietch, function()
if AttackNotifier <= 0 then if AttackNotifier <= 0 then
AttackNotifier = DateTime.Seconds(10) AttackNotifier = DateTime.Seconds(10)
Beacon.New(player, Sietch.CenterPosition + WVec.New(0, 1024, 0), DateTime.Seconds(7)) Beacon.New(player, Sietch.CenterPosition + WVec.New(0, 1024, 0), DateTime.Seconds(7))
Media.DisplayMessage("The Fremen Sietch is under attack!", "Mentat") Media.DisplayMessage(UserInterface.Translate("fremen-sietch-under-attack"), Mentat)
local defenders = fremen.GetGroundAttackers() local defenders = fremen.GetGroundAttackers()
if #defenders > 0 then if #defenders > 0 then

View File

@@ -418,3 +418,5 @@ Actors:
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Sequences: sequences.yaml Sequences: sequences.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -186,7 +186,7 @@ SendMercenaries = function()
Trigger.AfterDelay(MercenaryAttackDelay[Difficulty], function() Trigger.AfterDelay(MercenaryAttackDelay[Difficulty], function()
mercWave = mercWave + 1 mercWave = mercWave + 1
Media.DisplayMessage("Incoming hostile Mercenary force detected.", "Mentat") Media.DisplayMessage(UserInterface.Translate("incoming-mercenary-force"), Mentat)
local units = Reinforcements.Reinforce(mercenary, MercenaryReinforcements[Difficulty][mercWave], MercenarySpawn) local units = Reinforcements.Reinforce(mercenary, MercenaryReinforcements[Difficulty][mercWave], MercenarySpawn)
Utils.Do(units, function(unit) Utils.Do(units, function(unit)
@@ -206,7 +206,7 @@ end
SendContraband = function(owner) SendContraband = function(owner)
ContrabandArrived = true ContrabandArrived = true
UserInterface.SetMissionText("The Contraband has arrived!", player.Color) UserInterface.SetMissionText(UserInterface.Translate("contraband-has-arrived"), player.Color)
local units = SmugglerReinforcements local units = SmugglerReinforcements
if owner == player then if owner == player then
@@ -218,10 +218,10 @@ SendContraband = function(owner)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
if owner == player then if owner == player then
player.MarkCompletedObjective(CaptureStarport) player.MarkCompletedObjective(CaptureStarport)
Media.DisplayMessage("Contraband has arrived and been confiscated.", "Mentat") Media.DisplayMessage(UserInterface.Translate("contraband-confiscated"), Mentat)
else else
player.MarkFailedObjective(CaptureStarport) player.MarkFailedObjective(CaptureStarport)
Media.DisplayMessage("Smuggler contraband has arrived. It is too late to confiscate.", "Mentat") Media.DisplayMessage(UserInterface.Translate("contraband-not-confiscated"), Mentat)
end end
end) end)
@@ -251,12 +251,12 @@ Tick = function()
end end
if LastHarkonnenArrived and not player.IsObjectiveCompleted(KillHarkonnen) and harkonnen.HasNoRequiredUnits() then if LastHarkonnenArrived and not player.IsObjectiveCompleted(KillHarkonnen) and harkonnen.HasNoRequiredUnits() then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-05"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
if LastMercenariesArrived and not player.IsObjectiveCompleted(KillSmuggler) and smuggler.HasNoRequiredUnits() and mercenary.HasNoRequiredUnits() then if LastMercenariesArrived and not player.IsObjectiveCompleted(KillSmuggler) and smuggler.HasNoRequiredUnits() and mercenary.HasNoRequiredUnits() then
Media.DisplayMessage("The Smugglers have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-annihilated"), Mentat)
player.MarkCompletedObjective(KillSmuggler) player.MarkCompletedObjective(KillSmuggler)
end end
@@ -273,7 +273,10 @@ Tick = function()
if TimerTicks and not ContrabandArrived then if TimerTicks and not ContrabandArrived then
TimerTicks = TimerTicks - 1 TimerTicks = TimerTicks - 1
UserInterface.SetMissionText("The contraband will arrive in " .. Utils.FormatTime(TimerTicks), player.Color) if (TimerTicks % DateTime.Seconds(1)) == 0 then
local contrabandArrivesIn = UserInterface.Translate("contraband-arrives-in", { ["time"] = Utils.FormatTime(TimerTicks)})
UserInterface.SetMissionText(contrabandArrivesIn, player.Color)
end
if TimerTicks <= 0 then if TimerTicks <= 0 then
SendContraband(smuggler) SendContraband(smuggler)
@@ -290,10 +293,10 @@ WorldLoaded = function()
InfantryReinforcements = Difficulty ~= "easy" InfantryReinforcements = Difficulty ~= "easy"
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Atreides units.") KillAtreides = AddPrimaryObjective(harkonnen, "")
CaptureBarracks = player.AddPrimaryObjective("Capture the Barracks at Sietch Tabr.") CaptureBarracks = AddPrimaryObjective(player, "capture-barracks-sietch-tabr")
KillHarkonnen = player.AddSecondaryObjective("Annihilate all other Harkonnen units\nand reinforcements.") KillHarkonnen = AddSecondaryObjective(player, "annihilate-harkonnen-units-reinforcements")
CaptureStarport = player.AddSecondaryObjective("Capture the Smuggler Starport and\nconfiscate the contraband.") CaptureStarport = AddSecondaryObjective(player, "capture-smuggler-starport-confiscate-contraband")
Camera.Position = ARefinery.CenterPosition Camera.Position = ARefinery.CenterPosition
HarkonnenAttackLocation = AtreidesRally.Location HarkonnenAttackLocation = AtreidesRally.Location
@@ -302,7 +305,9 @@ WorldLoaded = function()
Trigger.AfterDelay(DateTime.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
TimerTicks = ContrabandTimes[Difficulty] TimerTicks = ContrabandTimes[Difficulty]
Media.DisplayMessage("The contraband is approaching the Starport to the north in " .. Utils.FormatTime(TimerTicks) .. ".", "Mentat") local time = { ["time"] = Utils.FormatTime(TimerTicks) }
local contrabandApproaching = UserInterface.Translate("contraband-approaching-starport-north-in", time)
Media.DisplayMessage(contrabandApproaching, Mentat)
end) end)
Trigger.OnAllKilledOrCaptured(HarkonnenBase, function() Trigger.OnAllKilledOrCaptured(HarkonnenBase, function()
@@ -312,7 +317,7 @@ WorldLoaded = function()
Trigger.OnKilled(Starport, function() Trigger.OnKilled(Starport, function()
if not player.IsObjectiveCompleted(CaptureStarport) then if not player.IsObjectiveCompleted(CaptureStarport) then
ContrabandArrived = true ContrabandArrived = true
UserInterface.SetMissionText("Starport destroyed! Contraband can't land.", player.Color) UserInterface.SetMissionText(UserInterface.Translate("starport-destroyed-no-contraband"), player.Color)
player.MarkFailedObjective(CaptureStarport) player.MarkFailedObjective(CaptureStarport)
SmugglersAttack() SmugglersAttack()
@@ -332,7 +337,7 @@ WorldLoaded = function()
if AttackNotifier <= 0 then if AttackNotifier <= 0 then
AttackNotifier = DateTime.Seconds(10) AttackNotifier = DateTime.Seconds(10)
Media.DisplayMessage("Don't destroy the Starport!", "Mentat") Media.DisplayMessage(UserInterface.Translate("do-not-destroy-starport"), Mentat)
local defenders = smuggler.GetGroundAttackers() local defenders = smuggler.GetGroundAttackers()
if #defenders > 0 then if #defenders > 0 then
@@ -343,7 +348,7 @@ WorldLoaded = function()
end end
end) end)
Trigger.OnCapture(Starport, function() Trigger.OnCapture(Starport, function()
DefendStarport = player.AddSecondaryObjective("Defend the captured Starport.") DefendStarport = AddSecondaryObjective(player, "defend-captured-starport")
Trigger.ClearAll(Starport) Trigger.ClearAll(Starport)
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
@@ -364,11 +369,11 @@ WorldLoaded = function()
Trigger.OnDamaged(HarkonnenBarracks, function() Trigger.OnDamaged(HarkonnenBarracks, function()
if AttackNotifier <= 0 and HarkonnenBarracks.Health < HarkonnenBarracks.MaxHealth * 3/4 then if AttackNotifier <= 0 and HarkonnenBarracks.Health < HarkonnenBarracks.MaxHealth * 3/4 then
AttackNotifier = DateTime.Seconds(10) AttackNotifier = DateTime.Seconds(10)
Media.DisplayMessage("Don't destroy the Barracks!", "Mentat") Media.DisplayMessage(UserInterface.Translate("do-not-destroy-barracks"), Mentat)
end end
end) end)
Trigger.OnCapture(HarkonnenBarracks, function() Trigger.OnCapture(HarkonnenBarracks, function()
Media.DisplayMessage("Hostages Released!", "Mentat") Media.DisplayMessage(UserInterface.Translate("hostages-released"), Mentat)
if DefendStarport then if DefendStarport then
player.MarkCompletedObjective(DefendStarport) player.MarkCompletedObjective(DefendStarport)
@@ -395,7 +400,7 @@ WorldLoaded = function()
if not warned and a.Owner == player and a.Type ~= "carryall" then if not warned and a.Owner == player and a.Type ~= "carryall" then
warned = true warned = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Media.DisplayMessage("Stay away from our Starport.", "Smuggler Leader") Media.DisplayMessage(UserInterface.Translate("stay-away-from-starport"), UserInterface.Translate("smuggler-leader"))
end end
end) end)
@@ -403,13 +408,13 @@ WorldLoaded = function()
if not paid and a.Owner == player and a.Type ~= "carryall" then if not paid and a.Owner == player and a.Type ~= "carryall" then
paid = true paid = true
Trigger.RemoveFootprintTrigger(id) Trigger.RemoveFootprintTrigger(id)
Media.DisplayMessage("You were warned. Now you will pay.", "Smuggler Leader") Media.DisplayMessage(UserInterface.Translate("were-warned-will-pay"), UserInterface.Translate("smuggler-leader"))
Utils.Do(smuggler.GetGroundAttackers(), function(unit) Utils.Do(smuggler.GetGroundAttackers(), function(unit)
unit.AttackMove(SmugglerWaypoint2.Location) unit.AttackMove(SmugglerWaypoint2.Location)
end) end)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
KillSmuggler = player.AddSecondaryObjective("Destroy the Smugglers and their Mercenaries.") KillSmuggler = AddSecondaryObjective(player, "destroy-smugglers-mercenaries")
SendMercenaries() SendMercenaries()
end) end)
end end
@@ -418,7 +423,7 @@ WorldLoaded = function()
Trigger.OnEnteredProximityTrigger(HarkonnenBarracks.CenterPosition, WDist.New(5 * 1024), function(a, id) Trigger.OnEnteredProximityTrigger(HarkonnenBarracks.CenterPosition, WDist.New(5 * 1024), function(a, id)
if a.Owner == player and a.Type ~= "carryall" then if a.Owner == player and a.Type ~= "carryall" then
Trigger.RemoveProximityTrigger(id) Trigger.RemoveProximityTrigger(id)
Media.DisplayMessage("Capture the Harkonnen barracks to release the hostages.", "Mentat") Media.DisplayMessage(UserInterface.Translate("capture-harkonnen-barracks-release-hostages"), Mentat)
StopInfantryProduction = true StopInfantryProduction = true
end end
end) end)

View File

@@ -367,3 +367,5 @@ Actors:
Location: 49,4 Location: 49,4
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -53,12 +53,13 @@ HarkonnenEntryPath = { HarkonnenWaypoint.Location, HarkonnenRally.Location }
Messages = Messages =
{ {
"Build a concrete foundation before placing your buildings.", UserInterface.Translate("build-concrete"),
"Build a Wind Trap for power.", UserInterface.Translate("build-windtrap"),
"Build a Refinery to collect Spice.", UserInterface.Translate("build-refinery"),
"Build a Silo to store additional Spice." UserInterface.Translate("build-silo")
} }
CachedResources = -1
Tick = function() Tick = function()
if AtreidesArrived and atreides.HasNoRequiredUnits() then if AtreidesArrived and atreides.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
@@ -71,21 +72,26 @@ Tick = function()
-- player has no Wind Trap -- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false HasPower = false
Media.DisplayMessage(Messages[2], "Mentat") Media.DisplayMessage(Messages[2], Mentat)
else else
HasPower = true HasPower = true
end end
-- player has no Refinery and no Silos -- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat") Media.DisplayMessage(Messages[3], Mentat)
end end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat") Media.DisplayMessage(Messages[4], Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -95,14 +101,15 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillAtreides = player.AddSecondaryObjective("Eliminate all Atreides units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillAtreides = AddSecondaryObjective(player, "eliminate-atreides-units-reinforcements")
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillAtreides)
end) end)
@@ -134,7 +141,7 @@ WorldLoaded = function()
end end
end) end)
Media.DisplayMessage(Messages[1], "Mentat") Media.DisplayMessage(Messages[1], Mentat)
Trigger.AfterDelay(DateTime.Seconds(25), function() Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")

View File

@@ -108,3 +108,5 @@ Actors:
Location: 29,7 Location: 29,7
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -53,12 +53,13 @@ HarkonnenEntryPath = { HarkonnenWaypoint.Location, HarkonnenRally.Location }
Messages = Messages =
{ {
"Build a concrete foundation before placing your buildings.", UserInterface.Translate("build-concrete"),
"Build a Wind Trap for power.", UserInterface.Translate("build-windtrap"),
"Build a Refinery to collect Spice.", UserInterface.Translate("build-refinery"),
"Build a Silo to store additional Spice." UserInterface.Translate("build-silo")
} }
CachedResources = -1
Tick = function() Tick = function()
if AtreidesArrived and atreides.HasNoRequiredUnits() then if AtreidesArrived and atreides.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
@@ -71,21 +72,26 @@ Tick = function()
-- player has no Wind Trap -- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false HasPower = false
Media.DisplayMessage(Messages[2], "Mentat") Media.DisplayMessage(Messages[2], Mentat)
else else
HasPower = true HasPower = true
end end
-- player has no Refinery and no Silos -- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat") Media.DisplayMessage(Messages[3], Mentat)
end end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat") Media.DisplayMessage(Messages[4], Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -95,14 +101,15 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillAtreides = player.AddSecondaryObjective("Eliminate all Atreides units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillAtreides = AddSecondaryObjective(player, "eliminate-atreides-units-reinforcements")
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillAtreides)
end) end)
@@ -134,7 +141,7 @@ WorldLoaded = function()
end end
end) end)
Media.DisplayMessage(Messages[1], "Mentat") Media.DisplayMessage(Messages[1], Mentat)
Trigger.AfterDelay(DateTime.Seconds(25), function() Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")

View File

@@ -108,3 +108,5 @@ Actors:
Location: 28,2 Location: 28,2
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -70,7 +70,7 @@ Tick = function()
end end
if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
end end
@@ -80,8 +80,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
KillAtreides = player.AddPrimaryObjective("Destroy all Atreides forces.") KillAtreides = AddSecondaryObjective(player, "destroy-atreides-forces")
Camera.Position = HConyard.CenterPosition Camera.Position = HConyard.CenterPosition

View File

@@ -164,3 +164,5 @@ Actors:
Location: 47,4 Location: 47,4
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -70,7 +70,7 @@ Tick = function()
end end
if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
end end
@@ -80,8 +80,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
KillAtreides = player.AddPrimaryObjective("Destroy all Atreides forces.") KillAtreides = AddSecondaryObjective(player, "destroy-atreides-forces")
Camera.Position = HConyard.CenterPosition Camera.Position = HConyard.CenterPosition

View File

@@ -146,3 +146,5 @@ Actors:
Location: 23,16 Location: 23,16
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -103,7 +103,7 @@ Tick = function()
end end
if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
@@ -117,7 +117,7 @@ Tick = function()
end end
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
Media.DisplayMessage("Upgrade barracks and light factory to produce more advanced units.", "Mentat") Media.DisplayMessage(UserInterface.Translate("upgrade-barracks-light-factory"), Mentat)
end end
end end
@@ -126,8 +126,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
KillAtreides = player.AddPrimaryObjective("Eliminate all Atreides units and reinforcements\nin the area.") KillAtreides = AddPrimaryObjective(player, "eliminate-atreides-units-reinforcements")
Camera.Position = HConyard.CenterPosition Camera.Position = HConyard.CenterPosition

View File

@@ -179,3 +179,5 @@ Actors:
Location: 29,2 Location: 29,2
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -105,7 +105,7 @@ Tick = function()
end end
if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
@@ -119,7 +119,7 @@ Tick = function()
end end
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
Media.DisplayMessage("Upgrade barracks and light factory to produce more advanced units.", "Mentat") Media.DisplayMessage(UserInterface.Translate("upgrade-barracks-light-factory"), Mentat)
end end
end end
@@ -128,8 +128,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
KillAtreides = player.AddPrimaryObjective("Eliminate all Atreides units and reinforcements\nin the area.") KillAtreides = AddPrimaryObjective(player, "eliminate-atreides-units-reinforcements")
Camera.Position = HConyard.CenterPosition Camera.Position = HConyard.CenterPosition

View File

@@ -209,3 +209,5 @@ Actors:
Location: 65,45 Location: 65,45
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -133,12 +133,12 @@ Tick = function()
end end
if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
if fremen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillFremen) then if fremen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillFremen) then
Media.DisplayMessage("The Fremen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("fremen-annihilated"), Mentat)
player.MarkCompletedObjective(KillFremen) player.MarkCompletedObjective(KillFremen)
end end
@@ -158,9 +158,9 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillAtreides = player.AddPrimaryObjective("Destroy the Atreiedes.") KillAtreides = AddPrimaryObjective(player, "destroy-atreides")
KillFremen = player.AddPrimaryObjective("Destroy the Fremen.") KillFremen = AddPrimaryObjective(player, "destroy-fremen")
KillHarkonnen = atreides.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen = AddPrimaryObjective(atreides, "")
Camera.Position = HConyard.CenterPosition Camera.Position = HConyard.CenterPosition
FremenAttackLocation = HConyard.Location FremenAttackLocation = HConyard.Location
@@ -191,7 +191,7 @@ WorldLoaded = function()
end) end)
Trigger.AfterDelay(DateTime.Seconds(15), function() Trigger.AfterDelay(DateTime.Seconds(15), function()
Media.DisplayMessage("Fremen concentrations spotted to the North and Southwest.", "Mentat") Media.DisplayMessage(UserInterface.Translate("fremen-spotted-north-southeast"), Mentat)
end) end)
local atreidesCondition = function() return player.IsObjectiveCompleted(KillAtreides) end local atreidesCondition = function() return player.IsObjectiveCompleted(KillAtreides) end

View File

@@ -378,3 +378,5 @@ Actors:
Location: 22,91 Location: 22,91
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -147,7 +147,7 @@ SendStarportReinforcements = function()
return return
end end
Media.DisplayMessage("Imperial ships penetrating defense grid!", "Mentat") Media.DisplayMessage(UserInterface.Translate("imperial-ships-penetrating-defense-grid"), Mentat)
end) end)
end end
@@ -171,7 +171,7 @@ OrdosReinforcementNotification = function(currentWave, totalWaves)
return return
end end
Media.DisplayMessage("Enemy carryall drop detected!", "Mentat") Media.DisplayMessage(UserInterface.Translate("enemy-carryall-drop-detected"), Mentat)
OrdosReinforcementNotification(currentWave, totalWaves) OrdosReinforcementNotification(currentWave, totalWaves)
end) end)
@@ -186,12 +186,12 @@ Tick = function()
end end
if ordos_main.HasNoRequiredUnits() and ordos_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then if ordos_main.HasNoRequiredUnits() and ordos_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then
Media.DisplayMessage("The Ordos have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("ordos-annihilated"), Mentat)
player.MarkCompletedObjective(KillOrdos) player.MarkCompletedObjective(KillOrdos)
end end
if corrino.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then if corrino.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then
Media.DisplayMessage("The Emperor has been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("emperor-annihilated"), Mentat)
player.MarkCompletedObjective(KillCorrino) player.MarkCompletedObjective(KillCorrino)
end end
@@ -229,12 +229,12 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillOrdos = player.AddPrimaryObjective("Destroy the Ordos.") KillOrdos = AddPrimaryObjective(player, "destroy-ordos")
KillCorrino = player.AddPrimaryObjective("Destroy the Imperial Forces.") KillCorrino = AddPrimaryObjective(player, "destroy-imperial-forces")
GuardOutpost = player.AddSecondaryObjective("Keep the Modified Outpost intact.") GuardOutpost = AddSecondaryObjective(player, "keep-modified-outpost-intact")
KillHarkonnen1 = ordos_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(ordos_main, "")
KillHarkonnen2 = ordos_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(ordos_small, "")
KillHarkonnen3 = corrino.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen3 = AddPrimaryObjective(corrino, "")
HOutpost.GrantCondition("modified") HOutpost.GrantCondition("modified")
@@ -254,7 +254,7 @@ WorldLoaded = function()
end) end)
Trigger.AfterDelay(DateTime.Seconds(5), function() Trigger.AfterDelay(DateTime.Seconds(5), function()
Media.DisplayMessage("Protect the Outpost from attack.", "Mentat") Media.DisplayMessage(UserInterface.Translate("protect-outpost"), Mentat)
end) end)
local path = function() return Utils.Random(OrdosPaths) end local path = function() return Utils.Random(OrdosPaths) end

View File

@@ -516,3 +516,5 @@ Actors:
Location: 2,29 Location: 2,29
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -125,7 +125,7 @@ SendStarportReinforcements = function()
IdleHunt(unit) IdleHunt(unit)
end) end)
Media.DisplayMessage("Ixian transports detected.", "Mentat") Media.DisplayMessage(UserInterface.Translate("ixian-transports-detected"), Mentat)
SendStarportReinforcements() SendStarportReinforcements()
end) end)
@@ -191,7 +191,7 @@ CheckSmugglerEnemies = function()
if attacker.Owner == player and not message_check then if attacker.Owner == player and not message_check then
message_check = true message_check = true
Media.DisplayMessage("The Smugglers are now hostile!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-now-hostile"), Mentat)
end end
end) end)
end) end)
@@ -204,12 +204,12 @@ Tick = function()
end end
if ordos_main.HasNoRequiredUnits() and ordos_small.HasNoRequiredUnits() and not OrdosKilled then if ordos_main.HasNoRequiredUnits() and ordos_small.HasNoRequiredUnits() and not OrdosKilled then
Media.DisplayMessage("The Ordos have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("ordos-annihilated"), Mentat)
OrdosKilled = true OrdosKilled = true
end end
if smuggler_neutral.HasNoRequiredUnits() and smuggler_harkonnen.HasNoRequiredUnits() and smuggler_ordos.HasNoRequiredUnits() and smuggler_both.HasNoRequiredUnits() and not SmugglersKilled then if smuggler_neutral.HasNoRequiredUnits() and smuggler_harkonnen.HasNoRequiredUnits() and smuggler_ordos.HasNoRequiredUnits() and smuggler_both.HasNoRequiredUnits() and not SmugglersKilled then
Media.DisplayMessage("The Smugglers have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-annihilated"), Mentat)
SmugglersKilled = true SmugglersKilled = true
end end
@@ -246,9 +246,9 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
DestroyStarport = player.AddPrimaryObjective("Capture or Destroy the Ordos Starport.") DestroyStarport = AddPrimaryObjective(player, "capture-destroy-ordos-starport")
KillHarkonnen1 = ordos_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(ordos_main, "")
KillHarkonnen2 = ordos_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(ordos_small, "")
-- Wait for carryall drop -- Wait for carryall drop
Trigger.AfterDelay(DateTime.Seconds(10), function() Trigger.AfterDelay(DateTime.Seconds(10), function()

View File

@@ -717,3 +717,5 @@ Actors:
Location: 2,68 Location: 2,68
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -112,7 +112,7 @@ SendStarportReinforcements = function()
IdleHunt(unit) IdleHunt(unit)
end) end)
Media.DisplayMessage("Ixian transports detected.", "Mentat") Media.DisplayMessage(UserInterface.Translate("ixian-transports-detected"), Mentat)
SendStarportReinforcements() SendStarportReinforcements()
end) end)
@@ -149,7 +149,7 @@ CheckSmugglerEnemies = function()
if attacker.Owner == player and not message_check then if attacker.Owner == player and not message_check then
message_check = true message_check = true
Media.DisplayMessage("The Smugglers are now hostile!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-now-hostile"), Mentat)
end end
end) end)
end) end)
@@ -162,12 +162,12 @@ Tick = function()
end end
if ordos_main.HasNoRequiredUnits() and ordos_small.HasNoRequiredUnits() and not OrdosKilled then if ordos_main.HasNoRequiredUnits() and ordos_small.HasNoRequiredUnits() and not OrdosKilled then
Media.DisplayMessage("The Ordos have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("ordos-annihilated"), Mentat)
OrdosKilled = true OrdosKilled = true
end end
if smuggler_neutral.HasNoRequiredUnits() and smuggler_harkonnen.HasNoRequiredUnits() and smuggler_ordos.HasNoRequiredUnits() and smuggler_both.HasNoRequiredUnits() and not SmugglersKilled then if smuggler_neutral.HasNoRequiredUnits() and smuggler_harkonnen.HasNoRequiredUnits() and smuggler_ordos.HasNoRequiredUnits() and smuggler_both.HasNoRequiredUnits() and not SmugglersKilled then
Media.DisplayMessage("The Smugglers have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-annihilated"), Mentat)
SmugglersKilled = true SmugglersKilled = true
end end
@@ -204,9 +204,9 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
DestroyStarport = player.AddPrimaryObjective("Capture or Destroy the Ordos Starport.") DestroyStarport = AddPrimaryObjective(player, "capture-destroy-ordos-starport")
KillHarkonnen1 = ordos_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(ordos_main, "")
KillHarkonnen2 = ordos_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(ordos_small, "")
-- Wait for carryall drop -- Wait for carryall drop
Trigger.AfterDelay(DateTime.Seconds(15), function() Trigger.AfterDelay(DateTime.Seconds(15), function()

View File

@@ -654,3 +654,5 @@ Actors:
Location: 2,9 Location: 2,9
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -177,12 +177,12 @@ Tick = function()
end end
if atreides_main.HasNoRequiredUnits() and atreides_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides_main.HasNoRequiredUnits() and atreides_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
if corrino.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then if corrino.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then
Media.DisplayMessage("The Emperor have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("emperor-annihilated"), Mentat)
player.MarkCompletedObjective(KillCorrino) player.MarkCompletedObjective(KillCorrino)
end end
@@ -191,7 +191,7 @@ Tick = function()
end end
if (AHiTechFactory.IsDead or AHiTechFactory.Owner ~= atreides_main) and not HiTechIsDead then if (AHiTechFactory.IsDead or AHiTechFactory.Owner ~= atreides_main) and not HiTechIsDead then
Media.DisplayMessage("High Tech Factory neutralized! Atreides cut off from Imperial reinforcement!", "Mentat") Media.DisplayMessage(UserInterface.Translate("high-tech-factory-neutralized-imperial-reinforcements"), Mentat)
HiTechIsDead = true HiTechIsDead = true
end end
@@ -221,14 +221,14 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
CaptureAtreidesConYard = player.AddPrimaryObjective("Capture the Atreides Construction Yard at the South.") CaptureAtreidesConYard = AddPrimaryObjective(player, "capture-atreides-construction-yard-south")
KillAtreides = player.AddPrimaryObjective("Destroy the Atreides.") KillAtreides = AddPrimaryObjective(player, "destroy-atreides")
KillCorrino = player.AddPrimaryObjective("Destroy the Corrino.") KillCorrino = AddPrimaryObjective(player, "destroy-corrino")
KillHarkonnen1 = atreides_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(atreides_main, "")
KillHarkonnen2 = atreides_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(atreides_small, "")
KillHarkonnen3 = corrino.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen3 = AddPrimaryObjective(corrino, "")
Media.DisplayMessage("Destroy Atreides High Tech Factory to cut off Atreides from Imperial reinforcements.", "Mentat") Media.DisplayMessage(UserInterface.Translate("destroy-atreides-high-tech-factory-imperial-reinforcements"), Mentat)
Camera.Position = HEngineer.CenterPosition Camera.Position = HEngineer.CenterPosition
AtreidesAttackLocation = AConYard2.Location AtreidesAttackLocation = AConYard2.Location

View File

@@ -771,3 +771,5 @@ Actors:
Location: 2,27 Location: 2,27
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -201,7 +201,7 @@ CheckAttackToAtreides = function()
end) end)
check = true check = true
Media.DisplayMessage("The Atreides are now hostile!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-hostile"), Mentat)
end end
end) end)
end) end)
@@ -223,17 +223,17 @@ Tick = function()
end end
if ordos.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then if ordos.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillOrdos) then
Media.DisplayMessage("The Ordos have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("ordos-annihilated"), Mentat)
player.MarkCompletedObjective(KillOrdos) player.MarkCompletedObjective(KillOrdos)
end end
if atreides_enemy.HasNoRequiredUnits() and atreides_neutral.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides_enemy.HasNoRequiredUnits() and atreides_neutral.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
if mercenary_enemy.HasNoRequiredUnits() and mercenary_ally.HasNoRequiredUnits() and not MercenariesDestroyed then if mercenary_enemy.HasNoRequiredUnits() and mercenary_ally.HasNoRequiredUnits() and not MercenariesDestroyed then
Media.DisplayMessage("The Mercenaries have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("mercenaries-annihilated"), Mentat)
MercenariesDestroyed = true MercenariesDestroyed = true
end end
@@ -265,11 +265,11 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillOrdos = player.AddPrimaryObjective("Destroy the Ordos.") KillOrdos = AddPrimaryObjective(player, "destroy-ordos")
KillAtreides = player.AddSecondaryObjective("Destroy the Atreides.") KillAtreides = AddSecondaryObjective(player, "destroy-atreides")
AllyWithMercenaries = player.AddSecondaryObjective("Persuade the Mercenaries to fight with\nHouse Harkonnen.") AllyWithMercenaries = AddSecondaryObjective(player, "ally-mercenaries")
KillHarkonnen1 = ordos.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(ordos, "")
KillHarkonnen2 = atreides_enemy.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(atreides_enemy, "")
Camera.Position = HMCV.CenterPosition Camera.Position = HMCV.CenterPosition
OrdosAttackLocation = HMCV.Location OrdosAttackLocation = HMCV.Location
@@ -280,7 +280,7 @@ WorldLoaded = function()
Trigger.OnCapture(MHeavyFactory, function() Trigger.OnCapture(MHeavyFactory, function()
player.MarkCompletedObjective(AllyWithMercenaries) player.MarkCompletedObjective(AllyWithMercenaries)
Media.DisplayMessage("Leader Captured. Mercenaries have been persuaded to fight with House Harkonnen.", "Mentat") Media.DisplayMessage(UserInterface.Translate("mercenary-leader-captured-allied"), Mentat)
MercenaryAttackLocation = MercenaryAttackPoint.Location MercenaryAttackLocation = MercenaryAttackPoint.Location
ChangeOwner(mercenary_enemy, mercenary_ally) ChangeOwner(mercenary_enemy, mercenary_ally)
@@ -296,7 +296,7 @@ WorldLoaded = function()
end) end)
Trigger.OnKilledOrCaptured(OPalace, function() Trigger.OnKilledOrCaptured(OPalace, function()
Media.DisplayMessage("We cannot stand against the Harkonnen. We must become neutral.", "Atreides Commander") Media.DisplayMessage(UserInterface.Translate("can-not-stand-harkonnen-must-become-neutral"), UserInterface.Translate("atreides-commander"))
ChangeOwner(atreides_enemy, atreides_neutral) ChangeOwner(atreides_enemy, atreides_neutral)
DefendAndRepairBase(atreides_neutral, AtreidesBase, 0.75, AttackGroupSize[Difficulty]) DefendAndRepairBase(atreides_neutral, AtreidesBase, 0.75, AttackGroupSize[Difficulty])

View File

@@ -654,3 +654,5 @@ Actors:
Location: 53,38 Location: 53,38
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -220,12 +220,12 @@ Tick = function()
end end
if atreides_main.HasNoRequiredUnits() and atreides_small_1.HasNoRequiredUnits() and atreides_small_2.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides_main.HasNoRequiredUnits() and atreides_small_1.HasNoRequiredUnits() and atreides_small_2.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
if corrino_main.HasNoRequiredUnits() and corrino_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then if corrino_main.HasNoRequiredUnits() and corrino_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then
Media.DisplayMessage("The Emperor has been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("emperor-annihilated"), Mentat)
player.MarkCompletedObjective(KillCorrino) player.MarkCompletedObjective(KillCorrino)
end end
@@ -275,13 +275,13 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
KillAtreides = player.AddPrimaryObjective("Destroy the Atreides.") KillAtreides = AddPrimaryObjective(player, "destroy-atreides")
KillCorrino = player.AddPrimaryObjective("Destroy the Imperial Forces.") KillCorrino = AddPrimaryObjective(player, "destroy-imperial-forces")
KillHarkonnen1 = atreides_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(atreides_main, "")
KillHarkonnen2 = atreides_small_1.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(atreides_small_1, "")
KillHarkonnen3 = atreides_small_2.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen3 = AddPrimaryObjective(atreides_small_2, "")
KillHarkonnen4 = corrino_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen4 = AddPrimaryObjective(corrino_main, "")
KillHarkonnen5 = corrino_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen5 = AddPrimaryObjective(corrino_small, "")
Camera.Position = HMCV.CenterPosition Camera.Position = HMCV.CenterPosition
AtreidesAttackLocation = HarkonnenRally.Location AtreidesAttackLocation = HarkonnenRally.Location

View File

@@ -1044,3 +1044,5 @@ Actors:
Location: 2,13 Location: 2,13
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -265,9 +265,8 @@ CheckSmugglerEnemies = function()
end end
if attacker.Owner == player and not message_check then if attacker.Owner == player and not message_check then
message_check = true message_check = true
Media.DisplayMessage("The Smugglers are now hostile!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-now-hostile"), Mentat)
end end
end) end)
end) end)
@@ -282,17 +281,17 @@ Tick = function()
end end
if atreides_main.HasNoRequiredUnits() and atreides_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides_main.HasNoRequiredUnits() and atreides_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
if corrino_main.HasNoRequiredUnits() and corrino_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then if corrino_main.HasNoRequiredUnits() and corrino_small.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillCorrino) then
Media.DisplayMessage("The Emperor has been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("emperor-annihilated"), Mentat)
player.MarkCompletedObjective(KillCorrino) player.MarkCompletedObjective(KillCorrino)
end end
if smuggler_neutral.HasNoRequiredUnits() and smuggler_harkonnen.HasNoRequiredUnits() and smuggler_ai.HasNoRequiredUnits() and smuggler_both.HasNoRequiredUnits() and not SmugglersKilled then if smuggler_neutral.HasNoRequiredUnits() and smuggler_harkonnen.HasNoRequiredUnits() and smuggler_ai.HasNoRequiredUnits() and smuggler_both.HasNoRequiredUnits() and not SmugglersKilled then
Media.DisplayMessage("The Smugglers have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("smugglers-annihilated"), Mentat)
SmugglersKilled = true SmugglersKilled = true
end end
@@ -350,13 +349,13 @@ WorldLoaded = function()
player = Player.GetPlayer("Harkonnen") player = Player.GetPlayer("Harkonnen")
InitObjectives(player) InitObjectives(player)
DeployMCV = player.AddSecondaryObjective("Build an MCV and deploy it into a Construction Yard.") DeployMCV = AddSecondaryObjective(player, "build-deploy-mcv")
KillAtreides = player.AddPrimaryObjective("Destroy the Atreides.") KillAtreides = AddPrimaryObjective(player, "destroy-atreides")
KillCorrino = player.AddPrimaryObjective("Destroy the Imperial Forces.") KillCorrino = AddPrimaryObjective(player, "destroy-imperial-forces")
KillHarkonnen1 = atreides_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen1 = AddPrimaryObjective(atreides_main, "")
KillHarkonnen2 = atreides_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen2 = AddPrimaryObjective(atreides_small, "")
KillHarkonnen3 = corrino_main.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen3 = AddPrimaryObjective(corrino_main, "")
KillHarkonnen4 = corrino_small.AddPrimaryObjective("Kill all Harkonnen units.") KillHarkonnen4 = AddPrimaryObjective(corrino_small, "")
-- Wait for carryall drop -- Wait for carryall drop
Trigger.AfterDelay(DateTime.Seconds(10), function() Trigger.AfterDelay(DateTime.Seconds(10), function()

View File

@@ -1007,3 +1007,5 @@ Actors:
Location: 90,48 Location: 90,48
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -103,3 +103,5 @@ Actors:
Location: 29,15 Location: 29,15
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -53,12 +53,13 @@ OrdosEntryPath = { OrdosWaypoint.Location, OrdosRally.Location }
Messages = Messages =
{ {
"Build a concrete foundation before placing your buildings.", UserInterface.Translate("build-concrete"),
"Build a Wind Trap for power.", UserInterface.Translate("build-windtrap"),
"Build a Refinery to collect Spice.", UserInterface.Translate("build-refinery"),
"Build a Silo to store additional Spice." UserInterface.Translate("build-silo")
} }
CachedResources = -1
Tick = function() Tick = function()
if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
@@ -71,21 +72,26 @@ Tick = function()
-- player has no Wind Trap -- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false HasPower = false
Media.DisplayMessage(Messages[2], "Mentat") Media.DisplayMessage(Messages[2], Mentat)
else else
HasPower = true HasPower = true
end end
-- player has no Refinery and no Silos -- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat") Media.DisplayMessage(Messages[3], Mentat)
end end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat") Media.DisplayMessage(Messages[4], Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -95,14 +101,15 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillOrdos = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdos = AddPrimaryObjective(harkonnen, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillHarkonnen = player.AddSecondaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillHarkonnen = AddSecondaryObjective(player, "eliminate-harkonnen-units-reinforcements")
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillAtreides)
end) end)
@@ -134,7 +141,7 @@ WorldLoaded = function()
end end
end) end)
Media.DisplayMessage(Messages[1], "Mentat") Media.DisplayMessage(Messages[1], Mentat)
Trigger.AfterDelay(DateTime.Seconds(25), function() Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")

View File

@@ -103,3 +103,5 @@ Actors:
Location: 24,2 Location: 24,2
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -53,12 +53,13 @@ OrdosEntryPath = { OrdosWaypoint.Location, OrdosRally.Location }
Messages = Messages =
{ {
"Build a concrete foundation before placing your buildings.", UserInterface.Translate("build-concrete"),
"Build a Wind Trap for power.", UserInterface.Translate("build-windtrap"),
"Build a Refinery to collect Spice.", UserInterface.Translate("build-refinery"),
"Build a Silo to store additional Spice." UserInterface.Translate("build-silo")
} }
CachedResources = -1
Tick = function() Tick = function()
if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then if HarkonnenArrived and harkonnen.HasNoRequiredUnits() then
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
@@ -71,21 +72,26 @@ Tick = function()
-- player has no Wind Trap -- player has no Wind Trap
if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then if (player.PowerProvided <= 20 or player.PowerState ~= "Normal") and DateTime.GameTime % DateTime.Seconds(32) == 0 then
HasPower = false HasPower = false
Media.DisplayMessage(Messages[2], "Mentat") Media.DisplayMessage(Messages[2], Mentat)
else else
HasPower = true HasPower = true
end end
-- player has no Refinery and no Silos -- player has no Refinery and no Silos
if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.ResourceCapacity == 0 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[3], "Mentat") Media.DisplayMessage(Messages[3], Mentat)
end end
if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then if HasPower and player.Resources > player.ResourceCapacity * 0.8 and DateTime.GameTime % DateTime.Seconds(32) == 0 then
Media.DisplayMessage(Messages[4], "Mentat") Media.DisplayMessage(Messages[4], Mentat)
end end
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
WorldLoaded = function() WorldLoaded = function()
@@ -95,16 +101,17 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillAtreides = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdos = AddPrimaryObjective(harkonnen, "")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillHarkonnen = player.AddSecondaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillHarkonnen = AddSecondaryObjective(player, "eliminate-harkonnen-units-reinforcements")
local checkResourceCapacity = function() local checkResourceCapacity = function()
Trigger.AfterDelay(0, function() Trigger.AfterDelay(0, function()
if player.ResourceCapacity < SpiceToHarvest then if player.ResourceCapacity < SpiceToHarvest then
Media.DisplayMessage("We don't have enough silo space to store the required amount of Spice!", "Mentat") Media.DisplayMessage(UserInterface.Translate("not-enough-silos"), Mentat)
Trigger.AfterDelay(DateTime.Seconds(3), function() Trigger.AfterDelay(DateTime.Seconds(3), function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillOrdos)
end) end)
return true return true
@@ -122,10 +129,10 @@ WorldLoaded = function()
local refs = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "refinery" and actor.Owner == player end) local refs = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "refinery" and actor.Owner == player end)
if #refs == 0 then if #refs == 0 then
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillOrdos)
else else
Trigger.OnAllRemovedFromWorld(refs, function() Trigger.OnAllRemovedFromWorld(refs, function()
harkonnen.MarkCompletedObjective(KillAtreides) harkonnen.MarkCompletedObjective(KillOrdos)
end) end)
local silos = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "silo" and actor.Owner == player end) local silos = Utils.Where(Map.ActorsInWorld, function(actor) return actor.Type == "silo" and actor.Owner == player end)
@@ -134,7 +141,7 @@ WorldLoaded = function()
end end
end) end)
Media.DisplayMessage(Messages[1], "Mentat") Media.DisplayMessage(Messages[1], Mentat)
Trigger.AfterDelay(DateTime.Seconds(25), function() Trigger.AfterDelay(DateTime.Seconds(25), function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")

View File

@@ -154,3 +154,5 @@ Actors:
Location: 25,17 Location: 25,17
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -86,7 +86,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
end end
@@ -96,8 +96,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Ordos") player = Player.GetPlayer("Ordos")
InitObjectives(player) InitObjectives(player)
KillOrdos = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdos = AddPrimaryObjective(harkonnen, "")
KillHarkonnen = player.AddPrimaryObjective("Destroy all Harkonnen forces.") KillHarkonnen = AddPrimaryObjective(player, "destroy-harkonnen-forces")
Camera.Position = OConyard.CenterPosition Camera.Position = OConyard.CenterPosition

View File

@@ -139,3 +139,5 @@ Actors:
Location: 9,8 Location: 9,8
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -70,7 +70,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
end end
@@ -80,8 +80,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Ordos") player = Player.GetPlayer("Ordos")
InitObjectives(player) InitObjectives(player)
KillOrdos = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdos = AddPrimaryObjective(harkonnen, "")
KillHarkonnen = player.AddPrimaryObjective("Destroy all Harkonnen forces.") KillHarkonnen = AddPrimaryObjective(player, "destroy-harkonnen-forces")
Camera.Position = OConyard.CenterPosition Camera.Position = OConyard.CenterPosition

View File

@@ -145,3 +145,5 @@ Actors:
Location: 4,60 Location: 4,60
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -86,7 +86,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
@@ -100,7 +100,7 @@ Tick = function()
end end
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
Media.DisplayMessage("Upgrade barracks and light factory to produce more advanced units.", "Mentat") Media.DisplayMessage(UserInterface.Translate("upgrade-barracks-light-factory"), Mentat)
end end
end end
@@ -109,8 +109,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Ordos") player = Player.GetPlayer("Ordos")
InitObjectives(player) InitObjectives(player)
KillOrdos = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdos = AddPrimaryObjective(harkonnen, "")
KillHarkonnen = player.AddPrimaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") KillHarkonnen = AddPrimaryObjective(player, "eliminate-harkonnen-units-reinforcements")
Camera.Position = OConyard.CenterPosition Camera.Position = OConyard.CenterPosition

View File

@@ -256,3 +256,5 @@ Actors:
Location: 2,20 Location: 2,20
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -123,7 +123,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
@@ -137,7 +137,7 @@ Tick = function()
end end
if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then if DateTime.GameTime % DateTime.Seconds(32) == 0 and (MessageCheck(1) or MessageCheck(2)) then
Media.DisplayMessage("Upgrade barracks and light factory to produce more advanced units.", "Mentat") Media.DisplayMessage(UserInterface.Translate("upgrade-barracks-light-factory"), Mentat)
end end
end end
@@ -146,8 +146,8 @@ WorldLoaded = function()
player = Player.GetPlayer("Ordos") player = Player.GetPlayer("Ordos")
InitObjectives(player) InitObjectives(player)
KillOrdos = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdos = AddPrimaryObjective(harkonnen, "")
KillHarkonnen = player.AddPrimaryObjective("Eliminate all Harkonnen units and reinforcements\nin the area.") KillHarkonnen = AddPrimaryObjective(player, "eliminate-harkonnen-units-reinforcements")
Camera.Position = OConyard.CenterPosition Camera.Position = OConyard.CenterPosition

View File

@@ -518,3 +518,5 @@ Actors:
Location: 49,19 Location: 49,19
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -90,7 +90,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
@@ -106,11 +106,11 @@ WorldLoaded = function()
player = Player.GetPlayer("Ordos") player = Player.GetPlayer("Ordos")
InitObjectives(player) InitObjectives(player)
KillOrdosH = harkonnen.AddPrimaryObjective("Kill all Ordos units.") KillOrdosH = AddPrimaryObjective(harkonnen, "")
KillOrdosS = smuggler.AddSecondaryObjective("Kill all Ordos units.") KillOrdosS = AddSecondaryObjective(smuggler, "")
DefendOutpost = smuggler.AddPrimaryObjective("Don't let the outpost to be captured or destroyed.") DefendOutpost = AddPrimaryObjective(smuggler, "outpost-not-captured-destroyed")
CaptureOutpost = player.AddPrimaryObjective("Capture the Smuggler Outpost.") CaptureOutpost = AddPrimaryObjective(player, "capture-smuggler-outpost")
KillHarkonnen = player.AddSecondaryObjective("Destroy the Harkonnen.") KillHarkonnen = AddSecondaryObjective(player, "destroy-harkonnen")
SOutpost.GrantCondition("modified") SOutpost.GrantCondition("modified")
@@ -146,7 +146,7 @@ WorldLoaded = function()
if AttackNotifier <= 0 then if AttackNotifier <= 0 then
AttackNotifier = DateTime.Seconds(10) AttackNotifier = DateTime.Seconds(10)
Media.DisplayMessage("Don't destroy the Outpost!", "Mentat") Media.DisplayMessage(UserInterface.Translate("do-not-destroy-outpost"), Mentat)
end end
end) end)
@@ -156,6 +156,6 @@ WorldLoaded = function()
end) end)
Trigger.AfterDelay(HarkonnenAttackDelay[Difficulty], function() Trigger.AfterDelay(HarkonnenAttackDelay[Difficulty], function()
Media.DisplayMessage("WARNING: Large force approaching!", "Mentat") Media.DisplayMessage(UserInterface.Translate("warning-large-force-approaching"), Mentat)
end) end)
end end

View File

@@ -572,3 +572,5 @@ Actors:
Location: 2,58 Location: 2,58
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -108,6 +108,7 @@ CheckHarvester = function(house)
end end
end end
CachedResources = -1
Tick = function() Tick = function()
if player.Resources > SpiceToHarvest - 1 then if player.Resources > SpiceToHarvest - 1 then
player.MarkCompletedObjective(GatherSpice) player.MarkCompletedObjective(GatherSpice)
@@ -121,7 +122,7 @@ Tick = function()
end end
if atreides_main.HasNoRequiredUnits() and atreides_small_1.HasNoRequiredUnits() and atreides_small_2.HasNoRequiredUnits() and atreides_small_3.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then if atreides_main.HasNoRequiredUnits() and atreides_small_1.HasNoRequiredUnits() and atreides_small_2.HasNoRequiredUnits() and atreides_small_3.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillAtreides) then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
end end
@@ -130,7 +131,12 @@ Tick = function()
end end
if player.IsObjectiveCompleted(CaptureStarport) then if player.IsObjectiveCompleted(CaptureStarport) then
UserInterface.SetMissionText("Harvested resources: " .. player.Resources .. "/" .. SpiceToHarvest, player.Color) if player.Resources ~= CachedResources then
local parameters = { ["harvested"] = player.Resources, ["goal"] = SpiceToHarvest }
local harvestedResources = UserInterface.Translate("harvested-resources", parameters)
UserInterface.SetMissionText(harvestedResources)
CachedResources = player.Resources
end
end end
CheckHarvester(atreides_main) CheckHarvester(atreides_main)
@@ -147,13 +153,14 @@ WorldLoaded = function()
SpiceToHarvest = ToHarvest[Difficulty] SpiceToHarvest = ToHarvest[Difficulty]
InitObjectives(player) InitObjectives(player)
KillOrdos1 = atreides_main.AddPrimaryObjective("Kill all Ordos units.") KillOrdos1 = AddPrimaryObjective(atreides_main, "")
KillOrdos2 = atreides_small_1.AddPrimaryObjective("Kill all Ordos units.") KillOrdos2 = AddPrimaryObjective(atreides_small_1, "")
KillOrdos3 = atreides_small_2.AddPrimaryObjective("Kill all Ordos units.") KillOrdos3 = AddPrimaryObjective(atreides_small_2, "")
KillOrdos4 = atreides_small_3.AddPrimaryObjective("Kill all Ordos units.") KillOrdos4 = AddPrimaryObjective(atreides_small_3, "")
CaptureStarport = player.AddPrimaryObjective("Capture the Atreides Starport and establish a base.") CaptureStarport = AddPrimaryObjective(player, "capture-atreides-starport-establish-base")
GatherSpice = player.AddPrimaryObjective("Harvest " .. tostring(SpiceToHarvest) .. " Solaris worth of Spice.") local harvestSpice = UserInterface.Translate("harvest-spice", { ["spice"] = SpiceToHarvest })
KillAtreides = player.AddSecondaryObjective("Destroy the Atreides.") GatherSpice = AddPrimaryObjective(player, harvestSpice)
KillAtreides = AddSecondaryObjective(player, "destroy-atreides")
Camera.Position = OEngi1.CenterPosition Camera.Position = OEngi1.CenterPosition
AtreidesAttackLocation = OEngi1.Location AtreidesAttackLocation = OEngi1.Location

View File

@@ -576,3 +576,5 @@ Actors:
Location: 34,2 Location: 34,2
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
Translations: d2k|languages/lua/en.ftl

View File

@@ -141,6 +141,7 @@ ContrabandTimes =
hard = DateTime.Minutes(7) hard = DateTime.Minutes(7)
} }
IxianReinforcementsHaveArrived = UserInterface.Translate("ixian-reinforcements-arrived")
SendContraband = function() SendContraband = function()
Media.PlaySpeechNotification(player, "Reinforce") Media.PlaySpeechNotification(player, "Reinforce")
@@ -150,7 +151,7 @@ SendContraband = function()
c = HSLColor.White c = HSLColor.White
end end
Trigger.AfterDelay(DateTime.Seconds(i), function() UserInterface.SetMissionText("Ixian reinforcements have arrived!", c) end) Trigger.AfterDelay(DateTime.Seconds(i), function() UserInterface.SetMissionText(IxianReinforcementsHaveArrived, c) end)
end end
Trigger.AfterDelay(DateTime.Seconds(6), function() Trigger.AfterDelay(DateTime.Seconds(6), function()
TimerTicks = ContrabandTimes[Difficulty] TimerTicks = ContrabandTimes[Difficulty]
@@ -180,7 +181,7 @@ end
Tick = function() Tick = function()
if not player.IsObjectiveCompleted(KillAtreides) and atreides.HasNoRequiredUnits() then if not player.IsObjectiveCompleted(KillAtreides) and atreides.HasNoRequiredUnits() then
Media.DisplayMessage("The Atreides have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("atreides-annihilated"), Mentat)
player.MarkCompletedObjective(KillAtreides) player.MarkCompletedObjective(KillAtreides)
DestroyCarryalls(atreides) DestroyCarryalls(atreides)
@@ -190,7 +191,7 @@ Tick = function()
end end
if not player.IsObjectiveCompleted(KillHarkonnen) and harkonnen.HasNoRequiredUnits() then if not player.IsObjectiveCompleted(KillHarkonnen) and harkonnen.HasNoRequiredUnits() then
Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat") Media.DisplayMessage(UserInterface.Translate("harkonnen-annihilated"), Mentat)
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
DestroyCarryalls(harkonnen) DestroyCarryalls(harkonnen)
@@ -204,18 +205,19 @@ Tick = function()
if TimerTicks == 0 then if TimerTicks == 0 then
if not FirstIxiansArrived then if not FirstIxiansArrived then
Media.DisplayMessage("Deliveries beginning to arrive. Massive reinforcements expected!", "Mentat") Media.DisplayMessage(UserInterface.Translate("deliveries-arriving-massive-reinforcements"), Mentat)
end end
FirstIxiansArrived = true FirstIxiansArrived = true
SendContraband() SendContraband()
else elseif (TimerTicks % DateTime.Seconds(1)) == 0 then
local text = "Initial" local time = { ["time"] = Utils.FormatTime(TimerTicks) }
local reinforcementsText = UserInterface.Translate("initial-reinforcements-arrive-in", time)
if FirstIxiansArrived then if FirstIxiansArrived then
text = "Additional" reinforcementsText = UserInterface.Translate("additional-reinforcements-arrive-in", time)
end end
UserInterface.SetMissionText(text .. " reinforcements will arrive in " .. Utils.FormatTime(TimerTicks), player.Color) UserInterface.SetMissionText(reinforcementsText, player.Color)
end end
end end
@@ -229,9 +231,9 @@ WorldLoaded = function()
player = Player.GetPlayer("Ordos") player = Player.GetPlayer("Ordos")
InitObjectives(player) InitObjectives(player)
GuardStarport = player.AddObjective("Defend the Starport.") GuardStarport = AddPrimaryObjective(player, "defend-starport")
KillAtreides = player.AddObjective("Destroy the Atreides.") KillAtreides = AddPrimaryObjective(player, "destroy-atreides")
KillHarkonnen = player.AddObjective("Destroy the Harkonnen.") KillHarkonnen = AddPrimaryObjective(player, "destroy-harkonnen")
Camera.Position = OConyard.CenterPosition Camera.Position = OConyard.CenterPosition
EnemyAttackLocations = { OConyard.Location, OStarport.Location } EnemyAttackLocations = { OConyard.Location, OStarport.Location }
@@ -242,7 +244,8 @@ WorldLoaded = function()
Trigger.AfterDelay(DateTime.Seconds(2), function() Trigger.AfterDelay(DateTime.Seconds(2), function()
TimerTicks = InitialContrabandTimes[Difficulty] TimerTicks = InitialContrabandTimes[Difficulty]
Media.DisplayMessage("The first batch of Ixian reinforcements will arrive in " .. Utils.FormatTime(TimerTicks) .. ".", "Mentat") local time = { ["time"] = Utils.FormatTime(TimerTicks) }
Media.DisplayMessage(UserInterface.Translate("ixian-reinforcements-in", time), Mentat)
end) end)
Hunt(atreides) Hunt(atreides)
@@ -257,7 +260,7 @@ WorldLoaded = function()
IdleHunt(unit) IdleHunt(unit)
end end
local announcementFunction = function() local announcementFunction = function()
Media.DisplayMessage("Enemy reinforcements have arrived.", "Mentat") Media.DisplayMessage(UserInterface.Translate("enemy-reinforcements-arrived"), Mentat)
end end
SendCarryallReinforcements(atreides, 0, AtreidesAttackWaves[Difficulty], EnemyAttackDelay[Difficulty], atreidesPath, AtreidesReinforcements[Difficulty], atreidesCondition, huntFunction, announcementFunction) SendCarryallReinforcements(atreides, 0, AtreidesAttackWaves[Difficulty], EnemyAttackDelay[Difficulty], atreidesPath, AtreidesReinforcements[Difficulty], atreidesCondition, huntFunction, announcementFunction)

View File

@@ -10,15 +10,11 @@
Difficulty = Map.LobbyOption("difficulty") Difficulty = Map.LobbyOption("difficulty")
InitObjectives = function(player) 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) Trigger.OnObjectiveCompleted(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective completed") Media.DisplayMessage(p.GetObjectiveDescription(id), UserInterface.Translate("objective-completed"))
end) end)
Trigger.OnObjectiveFailed(player, function(p, id) Trigger.OnObjectiveFailed(player, function(p, id)
Media.DisplayMessage(p.GetObjectiveDescription(id), "Objective failed") Media.DisplayMessage(p.GetObjectiveDescription(id), UserInterface.Translate("objective-failed"))
end) end)
Trigger.OnPlayerLost(player, function() Trigger.OnPlayerLost(player, function()
@@ -33,6 +29,8 @@ InitObjectives = function(player)
end) end)
end end
Mentat = UserInterface.Translate("mentat")
SendCarryallReinforcements = function(player, currentWave, totalWaves, delay, pathFunction, unitTypes, customCondition, customHuntFunction, announcementFunction) SendCarryallReinforcements = function(player, currentWave, totalWaves, delay, pathFunction, unitTypes, customCondition, customHuntFunction, announcementFunction)
Trigger.AfterDelay(delay, function() Trigger.AfterDelay(delay, function()
if customCondition and customCondition() then if customCondition and customCondition() then