Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Setup.js
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | function LoadMapSettings(settings) | ||||
else if (settings.SupportedTriggerDifficulties) // used by Atlas and autostart games | else if (settings.SupportedTriggerDifficulties) // used by Atlas and autostart games | ||||
{ | { | ||||
let difficulties = Engine.ReadJSONFile("simulation/data/settings/trigger_difficulties.json").Data; | let difficulties = Engine.ReadJSONFile("simulation/data/settings/trigger_difficulties.json").Data; | ||||
let defaultDiff = difficulties.find(d => d.Name == settings.SupportedTriggerDifficulties.Default).Difficulty; | let defaultDiff = difficulties.find(d => d.Name == settings.SupportedTriggerDifficulties.Default).Difficulty; | ||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger).SetDifficulty(defaultDiff); | Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger).SetDifficulty(defaultDiff); | ||||
} | } | ||||
let cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager); | let cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager); | ||||
let gameTypeSettings = {}; | let gameSettings = { "victoryConditions": settings.VictoryConditions }; | ||||
if (settings.GameType && settings.GameType == "capture_the_relic") | if (gameSettings.victoryConditions.indexOf("capture_the_relic") != -1) | ||||
elexis: fallback unnecessary as you updated all 3 gamesetup mechanisms?
Also can merge those two lines | |||||
gameTypeSettings.relicCount = settings.RelicCount; | { | ||||
if (settings.GameType && settings.GameType == "capture_the_relic") | gameSettings.relicCount = settings.RelicCount; | ||||
gameTypeSettings.relicDuration = settings.RelicDuration * 60 * 1000; | gameSettings.relicDuration = settings.RelicDuration * 60 * 1000; | ||||
if (settings.GameType && settings.GameType == "wonder") | } | ||||
gameTypeSettings.wonderDuration = settings.WonderDuration * 60 * 1000; | if (gameSettings.victoryConditions.indexOf("wonder") != -1) | ||||
if (settings.GameType && settings.GameType == "regicide") | gameSettings.wonderDuration = settings.WonderDuration * 60 * 1000; | ||||
gameTypeSettings.regicideGarrison = settings.RegicideGarrison; | if (gameSettings.victoryConditions.indexOf("regicide") != -1) | ||||
if (settings.GameType) | gameSettings.regicideGarrison = settings.RegicideGarrison; | ||||
cmpEndGameManager.SetGameType(settings.GameType, gameTypeSettings); | cmpEndGameManager.SetGameSettings(gameSettings); | ||||
Not Done Inline ActionsI hereby declare opposition to this hunk. You didn't introduce it, so not the problem of this patch. elexis: I hereby declare opposition to this hunk. You didn't introduce it, so not the problem of this… | |||||
Not Done Inline Actionsmuch true bb: much true | |||||
cmpEndGameManager.SetAlliedVictory(settings.LockTeams || !settings.LastManStanding); | cmpEndGameManager.SetAlliedVictory(settings.LockTeams || !settings.LastManStanding); | ||||
if (settings.LockTeams && settings.LastManStanding) | if (settings.LockTeams && settings.LastManStanding) | ||||
warn("Last man standing is only available in games with unlocked teams!"); | warn("Last man standing is only available in games with unlocked teams!"); | ||||
if (settings.Garrison) | if (settings.Garrison) | ||||
for (let holder in settings.Garrison) | for (let holder in settings.Garrison) | ||||
{ | { | ||||
Show All 13 Lines |
Wildfire Games · Phabricator
fallback unnecessary as you updated all 3 gamesetup mechanisms?
Also can merge those two lines