Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/attackManager.js
Show First 20 Lines • Show All 468 Lines • ▼ Show 20 Lines | if (attack.type == "Rush") | ||||
for (let i = 1; i < gameState.sharedScript.playersData.length; ++i) | for (let i = 1; i < gameState.sharedScript.playersData.length; ++i) | ||||
{ | { | ||||
if (!gameState.isPlayerEnemy(i) || veto[i]) | if (!gameState.isPlayerEnemy(i) || veto[i]) | ||||
continue; | continue; | ||||
if (this.defeated[i]) | if (this.defeated[i]) | ||||
continue; | continue; | ||||
let enemyDefense = 0; | let enemyDefense = 0; | ||||
for (let ent of gameState.getEnemyStructures(i).values()) | for (let ent of gameState.getEnemyStructures(i).values()) | ||||
if (ent.hasClass("Tower") || ent.hasClass("Fortress")) | if (MatchesClassList(ent.classes(), ["Tower", "Fortress"])) | ||||
Stan: MatchesClassList ? | |||||
Done Inline ActionsIs in the hasClasses. Freagarach: Is in the `hasClasses`. | |||||
enemyDefense++; | enemyDefense++; | ||||
if (enemyDefense > 6) | if (enemyDefense > 6) | ||||
veto[i] = true; | veto[i] = true; | ||||
} | } | ||||
} | } | ||||
// then if not a huge attack, continue attacking our previous target as long as it has some entities, | // then if not a huge attack, continue attacking our previous target as long as it has some entities, | ||||
// otherwise target the most accessible one | // otherwise target the most accessible one | ||||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
MatchesClassList ?