Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/helpers/Cheat.js
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | for (let i = 0; i < Math.min(input.parameter, cmpPlayer.GetMaxPopulation() - cmpPlayer.GetPopulationCount()); ++i) | ||||
cmpProductionQueue.SpawnUnits(input.templates[i % input.templates.length], 1, null); | cmpProductionQueue.SpawnUnits(input.templates[i % input.templates.length], 1, null); | ||||
return; | return; | ||||
case "fastactions": | case "fastactions": | ||||
let cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager); | let cmpModifiersManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ModifiersManager); | ||||
if (cmpModifiersManager.HasAnyModifier("cheat/fastactions", playerEnt)) | if (cmpModifiersManager.HasAnyModifier("cheat/fastactions", playerEnt)) | ||||
cmpModifiersManager.RemoveAllModifiers("cheat/fastactions", playerEnt); | cmpModifiersManager.RemoveAllModifiers("cheat/fastactions", playerEnt); | ||||
else | else | ||||
cmpModifiersManager.AddModifiers("cheat/fastactions", { | cmpModifiersManager.AddModifiers("cheat/fastactions", { | ||||
"Cost/BuildTime": { "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }, | "Cost/BuildTime": [{ "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }], | ||||
"ResourceGatherer/BaseSpeed": { "affects": [["Structure"], ["Unit"]], "multiply": 1000 }, | "ResourceGatherer/BaseSpeed": [{ "affects": [["Structure"], ["Unit"]], "multiply": 1000 }], | ||||
"Pack/Time": { "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }, | "Pack/Time": [{ "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }], | ||||
"Upgrade/Time": { "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }, | "Upgrade/Time": [{ "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }], | ||||
"ProductionQueue/TechCostMultiplier/time": { "affects": [["Structure"], ["Unit"]], "multiply": 0.01 } | "ProductionQueue/TechCostMultiplier/time": [{ "affects": [["Structure"], ["Unit"]], "multiply": 0.01 }] | ||||
}, playerEnt); | }, playerEnt); | ||||
return; | return; | ||||
case "changephase": | case "changephase": | ||||
var cmpTechnologyManager = Engine.QueryInterface(playerEnt, IID_TechnologyManager); | var cmpTechnologyManager = Engine.QueryInterface(playerEnt, IID_TechnologyManager); | ||||
if (!cmpTechnologyManager) | if (!cmpTechnologyManager) | ||||
return; | return; | ||||
// store the phase we want in the next input parameter | // store the phase we want in the next input parameter | ||||
▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator