Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/attackManager.js
Show First 20 Lines • Show All 469 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 (ent.hasClass("Tower") || ent.hasClass("WallTower") || ent.hasClass("Fortress")) | ||||
enemyDefense++; | enemyDefense++; | ||||
if (enemyDefense > 6) | if (enemyDefense > 6) | ||||
veto[i] = true; | veto[i] = true; | ||||
Nescio: Doesn't this automatically veto Iberians with starting walls? | |||||
SilierUnsubmitted Not Done Inline ActionsThats the point, to avoid well defended enemies Silier: Thats the point, to avoid well defended enemies | |||||
} | } | ||||
} | } | ||||
// 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 | ||||
if (attack.type != "HugeAttack") | if (attack.type != "HugeAttack") | ||||
{ | { | ||||
if (attack.targetPlayer === undefined && this.currentEnemyPlayer !== undefined && | if (attack.targetPlayer === undefined && this.currentEnemyPlayer !== undefined && | ||||
▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Doesn't this automatically veto Iberians with starting walls?