Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/attackManager.js
Show First 20 Lines • Show All 210 Lines • ▼ Show 20 Lines | if (this.rushNumber < this.maxRushes && barracksNb >= 1) | ||||
} | } | ||||
} | } | ||||
else if (unexecutedAttacks.Attack === 0 && unexecutedAttacks.HugeAttack === 0 && | else if (unexecutedAttacks.Attack === 0 && unexecutedAttacks.HugeAttack === 0 && | ||||
this.startedAttacks.Attack.length + this.startedAttacks.HugeAttack.length < Math.min(2, 1 + Math.round(gameState.getPopulationMax()/100))) | this.startedAttacks.Attack.length + this.startedAttacks.HugeAttack.length < Math.min(2, 1 + Math.round(gameState.getPopulationMax()/100))) | ||||
{ | { | ||||
if ((barracksNb >= 1 && (gameState.currentPhase() > 1 || gameState.isResearching(gameState.townPhase()))) || | if ((barracksNb >= 1 && (gameState.currentPhase() > 1 || gameState.isResearching(gameState.townPhase()))) || | ||||
!gameState.ai.HQ.baseManagers[1]) // if we have no base ... nothing else to do than attack | !gameState.ai.HQ.baseManagers[1]) // if we have no base ... nothing else to do than attack | ||||
{ | { | ||||
let type = (this.attackNumber < 2 || this.startedAttacks.HugeAttack.length > 0) ? "Attack" : "HugeAttack"; | let type = this.attackNumber < 2 || this.startedAttacks.HugeAttack.length > 0 ? "Attack" : "HugeAttack"; | ||||
let attackPlan = new m.AttackPlan(gameState, this.Config, this.totalNumber, type); | let attackPlan = new m.AttackPlan(gameState, this.Config, this.totalNumber, type); | ||||
if (attackPlan.failed) | if (attackPlan.failed) | ||||
this.attackPlansEncounteredWater = true; // hack | this.attackPlansEncounteredWater = true; // hack | ||||
else | else | ||||
{ | { | ||||
if (this.Config.debug > 1) | if (this.Config.debug > 1) | ||||
API3.warn("Military Manager: Creating the plan " + type + " " + this.totalNumber); | API3.warn("Military Manager: Creating the plan " + type + " " + this.totalNumber); | ||||
this.totalNumber++; | this.totalNumber++; | ||||
▲ Show 20 Lines • Show All 340 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator