Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/maps/scripts/CaptureTheRelic.js
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if (potentialGaiaSpawnPoints.length) | ||||
potentialSpawnPoints = potentialGaiaSpawnPoints; | potentialSpawnPoints = potentialGaiaSpawnPoints; | ||||
if (!potentialSpawnPoints.length) | if (!potentialSpawnPoints.length) | ||||
{ | { | ||||
error("No gaia entities found on this map that could be used as spawn points!"); | error("No gaia entities found on this map that could be used as spawn points!"); | ||||
return; | return; | ||||
} | } | ||||
let numSpawnedRelics = Math.ceil(TriggerHelper.GetNumberOfPlayers() / 2); | let cmpEndGameManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_EndGameManager); | ||||
let numSpawnedRelics = cmpEndGameManager.GetGameTypeSettings().relicCount; | |||||
this.playerRelicsCount = new Array(TriggerHelper.GetNumberOfPlayers()).fill(0, 1); | this.playerRelicsCount = new Array(TriggerHelper.GetNumberOfPlayers()).fill(0, 1); | ||||
this.playerRelicsCount[0] = numSpawnedRelics; | this.playerRelicsCount[0] = numSpawnedRelics; | ||||
for (let i = 0; i < numSpawnedRelics; ++i) | for (let i = 0; i < numSpawnedRelics; ++i) | ||||
{ | { | ||||
this.relics[i] = TriggerHelper.SpawnUnits(pickRandom(potentialSpawnPoints), catafalqueTemplates[i], 1, 0)[0]; | this.relics[i] = TriggerHelper.SpawnUnits(pickRandom(potentialSpawnPoints), catafalqueTemplates[i], 1, 0)[0]; | ||||
let cmpDamageReceiver = Engine.QueryInterface(this.relics[i], IID_DamageReceiver); | let cmpDamageReceiver = Engine.QueryInterface(this.relics[i], IID_DamageReceiver); | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator