Differential D2952 Diff 14052 ps/trunk/binaries/data/mods/public/maps/scenarios/unit_motion_integration_test.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/scenarios/unit_motion_integration_test.js
const UNIT_TEMPLATE = "units/athen_infantry_marine_archer_b"; | const UNIT_TEMPLATE = "units/athen/infantry_marine_archer_b"; | ||||
const FAST_UNIT_TEMPLATE = "units/athen_cavalry_swordsman_a"; | const FAST_UNIT_TEMPLATE = "units/athen/cavalry_swordsman_a"; | ||||
const LARGE_UNIT_TEMPLATE = "units/brit_siege_ram"; | const LARGE_UNIT_TEMPLATE = "units/brit/siege_ram"; | ||||
const SMALL_STRUCTURE_TEMPLATE = "structures/athen_house"; | const SMALL_STRUCTURE_TEMPLATE = "structures/athen/house"; | ||||
var QuickSpawn = function(x, z, template, owner = 1) | var QuickSpawn = function(x, z, template, owner = 1) | ||||
{ | { | ||||
let ent = Engine.AddEntity(template); | let ent = Engine.AddEntity(template); | ||||
let cmpEntOwnership = Engine.QueryInterface(ent, IID_Ownership); | let cmpEntOwnership = Engine.QueryInterface(ent, IID_Ownership); | ||||
if (cmpEntOwnership) | if (cmpEntOwnership) | ||||
cmpEntOwnership.SetOwner(owner); | cmpEntOwnership.SetOwner(owner); | ||||
▲ Show 20 Lines • Show All 264 Lines • ▼ Show 20 Lines | for (let i = -3; i <= 3; ++i) | ||||
ents.push(QuickSpawn(gx + i * 2, gy + j * 2, UNIT_TEMPLATE)); | ents.push(QuickSpawn(gx + i * 2, gy + j * 2, UNIT_TEMPLATE)); | ||||
Do("formation", { "name": "special/formations/box" }, ents); | Do("formation", { "name": "special/formations/box" }, ents); | ||||
Do("attack", { "target": 5 }, ents); | Do("attack", { "target": 5 }, ents); | ||||
} | } | ||||
}; | }; | ||||
experiments.multiple_resources = { | experiments.multiple_resources = { | ||||
"spawn": () => { | "spawn": () => { | ||||
QuickSpawn(gx, gy + 80, "structures/athen_civil_centre"); | QuickSpawn(gx, gy + 80, "structures/athen/civil_centre"); | ||||
let chicken = QuickSpawn(gx, gy + 50, "gaia/fauna_chicken"); | let chicken = QuickSpawn(gx, gy + 50, "gaia/fauna_chicken"); | ||||
QuickSpawn(gx + 3, gy + 50, "gaia/fauna_chicken"); | QuickSpawn(gx + 3, gy + 50, "gaia/fauna_chicken"); | ||||
QuickSpawn(gx - 3, gy + 50, "gaia/fauna_chicken"); | QuickSpawn(gx - 3, gy + 50, "gaia/fauna_chicken"); | ||||
Do("gather", { "target": chicken }, QuickSpawn(gx, gy, UNIT_TEMPLATE)); | Do("gather", { "target": chicken }, QuickSpawn(gx, gy, UNIT_TEMPLATE)); | ||||
} | } | ||||
}; | }; | ||||
Show All 24 Lines |
Wildfire Games · Phabricator