Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/helpers/Commands.js
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | var g_Commands = { | ||||
"tribute": function(player, cmd, data) | "tribute": function(player, cmd, data) | ||||
{ | { | ||||
data.cmpPlayer.TributeResource(cmd.player, cmd.amounts); | data.cmpPlayer.TributeResource(cmd.player, cmd.amounts); | ||||
}, | }, | ||||
"control-all": function(player, cmd, data) | "control-all": function(player, cmd, data) | ||||
{ | { | ||||
if (!data.cmpPlayer.GetCheatsEnabled()) | |||||
return; | |||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | ||||
cmpGuiInterface.PushNotification({ | cmpGuiInterface.PushNotification({ | ||||
"type": "aichat", | "type": "aichat", | ||||
"players": [player], | "players": [player], | ||||
"message": markForTranslation("(Cheat - control all units)") | "message": markForTranslation("(Cheat - control all units)") | ||||
}); | }); | ||||
data.cmpPlayer.SetControlAllUnits(cmd.flag); | data.cmpPlayer.SetControlAllUnits(cmd.flag); | ||||
}, | }, | ||||
"reveal-map": function(player, cmd, data) | "reveal-map": function(player, cmd, data) | ||||
{ | { | ||||
if (!data.cmpPlayer.GetCheatsEnabled()) | |||||
return; | |||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | ||||
cmpGuiInterface.PushNotification({ | cmpGuiInterface.PushNotification({ | ||||
"type": "aichat", | "type": "aichat", | ||||
"players": [player], | "players": [player], | ||||
"message": markForTranslation("(Cheat - reveal map)") | "message": markForTranslation("(Cheat - reveal map)") | ||||
}); | }); | ||||
// Reveal the map for all players, not just the current player, | // Reveal the map for all players, not just the current player, | ||||
▲ Show 20 Lines • Show All 421 Lines • ▼ Show 20 Lines | var g_Commands = { | ||||
{ | { | ||||
GetFormationUnitAIs(data.entities, player, cmd.name).forEach(cmpUnitAI => { | GetFormationUnitAIs(data.entities, player, cmd.name).forEach(cmpUnitAI => { | ||||
cmpUnitAI.MoveIntoFormation(cmd); | cmpUnitAI.MoveIntoFormation(cmd); | ||||
}); | }); | ||||
}, | }, | ||||
"promote": function(player, cmd, data) | "promote": function(player, cmd, data) | ||||
{ | { | ||||
if (!data.cmpPlayer.GetCheatsEnabled()) | |||||
return; | |||||
var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | var cmpGuiInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); | ||||
cmpGuiInterface.PushNotification({ | cmpGuiInterface.PushNotification({ | ||||
"type": "aichat", | "type": "aichat", | ||||
"players": [player], | "players": [player], | ||||
"message": markForTranslation("(Cheat - promoted units)"), | "message": markForTranslation("(Cheat - promoted units)"), | ||||
"translateMessage": true | "translateMessage": true | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 1,085 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator