Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/defenseManager.js
Show First 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | for (let i = 0; i < potentialDefenders.length; ++i) | ||||
{ | { | ||||
++backup; | ++backup; | ||||
potentialDefenders[i] = undefined; | potentialDefenders[i] = undefined; | ||||
continue; | continue; | ||||
} | } | ||||
else if (aMin === undefined) | else if (aMin === undefined) | ||||
continue; | continue; | ||||
armiesNeeding[aMin].need -= m.getMaxStrength(ent); | armiesNeeding[aMin].need -= m.getMaxStrength(ent, gameState.ai.Config.DamageTypeFactors); | ||||
armiesNeeding[aMin].army.addOwn(gameState, potentialDefenders[i]); | armiesNeeding[aMin].army.addOwn(gameState, potentialDefenders[i]); | ||||
Silier: same here, for future, check init function for this.Config = config | |||||
armiesNeeding[aMin].army.assignUnit(gameState, potentialDefenders[i]); | armiesNeeding[aMin].army.assignUnit(gameState, potentialDefenders[i]); | ||||
potentialDefenders[i] = undefined; | potentialDefenders[i] = undefined; | ||||
if (armiesNeeding[aMin].need <= 0) | if (armiesNeeding[aMin].need <= 0) | ||||
armiesNeeding.splice(aMin, 1); | armiesNeeding.splice(aMin, 1); | ||||
if (!armiesNeeding.length) | if (!armiesNeeding.length) | ||||
return; | return; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 459 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
same here, for future, check init function for this.Config = config