Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/victoryManager.js
Show First 20 Lines • Show All 673 Lines • ▼ Show 20 Lines | let units = gameState.getOwnUnits().filter(ent => { | ||||
if (ent.getMetadata(PlayerID, "PartOfArmy") !== undefined) | if (ent.getMetadata(PlayerID, "PartOfArmy") !== undefined) | ||||
return false; | return false; | ||||
let plan = ent.getMetadata(PlayerID, "plan"); | let plan = ent.getMetadata(PlayerID, "plan"); | ||||
if (plan == -2 || plan == -3) | if (plan == -2 || plan == -3) | ||||
return false; | return false; | ||||
if (plan !== undefined && plan >= 0) | if (plan !== undefined && plan >= 0) | ||||
{ | { | ||||
let attack = gameState.ai.HQ.attackManager.getPlan(plan); | let attack = gameState.ai.HQ.attackManager.getPlan(plan); | ||||
if (attack && (attack.state != "unexecuted" || attack.type == "Raid")) | if (attack && (attack.state != PETRA.AttackPlan.STATE_UNEXECUTED || attack.type == PETRA.AttackPlan.TYPE_RAID)) | ||||
return false; | return false; | ||||
} | } | ||||
if (PETRA.getLandAccess(gameState, ent) != access) | if (PETRA.getLandAccess(gameState, ent) != access) | ||||
return false; | return false; | ||||
return true; | return true; | ||||
}).filterNearest(relicPosition); | }).filterNearest(relicPosition); | ||||
let expedition = []; | let expedition = []; | ||||
for (let ent of units.values()) | for (let ent of units.values()) | ||||
▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator