Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/gamedescription.js
Show First 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | function getGameDescription(mapCache) | ||||
for (let victoryCondition of g_VictoryConditions) | for (let victoryCondition of g_VictoryConditions) | ||||
{ | { | ||||
if (g_GameAttributes.settings.VictoryConditions.indexOf(victoryCondition.Name) == -1) | if (g_GameAttributes.settings.VictoryConditions.indexOf(victoryCondition.Name) == -1) | ||||
continue; | continue; | ||||
let title = translateVictoryCondition(victoryCondition.Name); | let title = translateVictoryCondition(victoryCondition.Name); | ||||
if (victoryCondition.Name == "wonder") | if (victoryCondition.Name == "wonder") | ||||
{ | |||||
let wonderDuration = Math.round(g_GameAttributes.settings.WonderDuration); | |||||
title = sprintf( | title = sprintf( | ||||
translatePluralWithContext( | translatePluralWithContext( | ||||
"victory condition", | "victory condition", | ||||
"Wonder (%(min)s minute)", | "Wonder (%(min)s minute)", | ||||
"Wonder (%(min)s minutes)", | "Wonder (%(min)s minutes)", | ||||
wonderDuration | g_GameAttributes.settings.WonderDuration | ||||
), | ), | ||||
{ "min": wonderDuration }); | { "min": g_GameAttributes.settings.WonderDuration }); | ||||
} | |||||
let isCaptureTheRelic = victoryCondition.Name == "capture_the_relic"; | let isCaptureTheRelic = victoryCondition.Name == "capture_the_relic"; | ||||
if (isCaptureTheRelic) | if (isCaptureTheRelic) | ||||
{ | |||||
let relicDuration = Math.round(g_GameAttributes.settings.RelicDuration); | |||||
title = sprintf( | title = sprintf( | ||||
translatePluralWithContext( | translatePluralWithContext( | ||||
"victory condition", | "victory condition", | ||||
"Capture the Relic (%(min)s minute)", | "Capture the Relic (%(min)s minute)", | ||||
"Capture the Relic (%(min)s minutes)", | "Capture the Relic (%(min)s minutes)", | ||||
relicDuration | g_GameAttributes.settings.RelicDuration | ||||
), | ), | ||||
{ "min": relicDuration }); | { "min": g_GameAttributes.settings.RelicDuration }); | ||||
} | |||||
titles.push({ | titles.push({ | ||||
"label": title, | "label": title, | ||||
"value": victoryCondition.Description | "value": victoryCondition.Description | ||||
}); | }); | ||||
if (isCaptureTheRelic) | if (isCaptureTheRelic) | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Relic Count"), | "label": translate("Relic Count"), | ||||
"value": Math.round(g_GameAttributes.settings.RelicCount) | "value": g_GameAttributes.settings.RelicCount | ||||
}); | }); | ||||
if (victoryCondition.Name == "regicide") | if (victoryCondition.Name == "regicide") | ||||
if (g_GameAttributes.settings.RegicideGarrison) | if (g_GameAttributes.settings.RegicideGarrison) | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Hero Garrison"), | "label": translate("Hero Garrison"), | ||||
"value": translate("Heroes can be garrisoned.") | "value": translate("Heroes can be garrisoned.") | ||||
}); | }); | ||||
Show All 28 Lines | titles.push({ | ||||
"value": translate("Only one player can win the game. If the remaining players are allies, the game continues until only one remains.") | "value": translate("Only one player can win the game. If the remaining players are allies, the game continues until only one remains.") | ||||
}); | }); | ||||
else | else | ||||
titles.push({ | titles.push({ | ||||
"label": translate("Allied Victory"), | "label": translate("Allied Victory"), | ||||
"value": translate("If one player wins, his or her allies win too. If one group of allies remains, they win.") | "value": translate("If one player wins, his or her allies win too. If one group of allies remains, they win.") | ||||
}); | }); | ||||
let ceasefire = Math.round(g_GameAttributes.settings.Ceasefire); | |||||
titles.push({ | titles.push({ | ||||
"label": translate("Ceasefire"), | "label": translate("Ceasefire"), | ||||
"value": | "value": | ||||
ceasefire == 0 ? | g_GameAttributes.settings.Ceasefire == 0 ? | ||||
translate("disabled") : | translate("disabled") : | ||||
sprintf(translatePlural( | sprintf(translatePlural( | ||||
"For the first minute, other players will stay neutral.", | "For the first minute, other players will stay neutral.", | ||||
"For the first %(min)s minutes, other players will stay neutral.", | "For the first %(min)s minutes, other players will stay neutral.", | ||||
ceasefire), | g_GameAttributes.settings.Ceasefire), | ||||
{ "min": ceasefire }) | { "min": g_GameAttributes.settings.Ceasefire }) | ||||
}); | }); | ||||
if (g_GameAttributes.map == "random") | if (g_GameAttributes.map == "random") | ||||
titles.push({ | titles.push({ | ||||
"label": translateWithContext("Map Selection", "Random Map"), | "label": translateWithContext("Map Selection", "Random Map"), | ||||
"value": translate("Randomly select a map from the list.") | "value": translate("Randomly select a map from the list.") | ||||
}); | }); | ||||
else | else | ||||
▲ Show 20 Lines • Show All 141 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator