Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Cheat.js
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | case "defeatplayer": | ||||
cmpPlayer = QueryPlayerIDInterface(input.parameter); | cmpPlayer = QueryPlayerIDInterface(input.parameter); | ||||
if (cmpPlayer) | if (cmpPlayer) | ||||
cmpPlayer.SetState("defeated", markForTranslation("%(player)s has been defeated (cheat).")); | cmpPlayer.SetState("defeated", markForTranslation("%(player)s has been defeated (cheat).")); | ||||
return; | return; | ||||
case "createunits": | case "createunits": | ||||
var cmpProductionQueue = input.selected.length && Engine.QueryInterface(input.selected[0], IID_ProductionQueue); | var cmpProductionQueue = input.selected.length && Engine.QueryInterface(input.selected[0], IID_ProductionQueue); | ||||
if (!cmpProductionQueue) | if (!cmpProductionQueue) | ||||
{ | { | ||||
cmpGuiInterface.PushNotification({ | cmpGuiInterface.PushTimeNotification({ | ||||
"type": "text", | |||||
"players": [input.player], | "players": [input.player], | ||||
"message": markForTranslation("You need to select a building that trains units."), | "message": markForTranslation("You need to select a building that trains units.") | ||||
"translateMessage": true | |||||
}); | }); | ||||
return; | return; | ||||
} | } | ||||
for (let i = 0; i < Math.min(input.parameter, cmpPlayer.GetMaxPopulation() - cmpPlayer.GetPopulationCount()); ++i) | 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": | ||||
▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator