Class: AttackManager

AttackManager()

Attack Manager

Constructor

new AttackManager()

Source:

Methods

assignBombers()

Check for any structure in range from within our territory, and bomb it
Source:

cancelAttacksAgainstPlayer()

f.e. if we have changed diplomacy with another player.
Source:

getEnemyPlayer()

Determine which player should be attacked: when called when starting the attack, attack.targetPlayer is undefined and in that case, we keep track of the chosen target for future attacks.
Source:

getRelicEnemyPlayer()

Target the player with the most relics (including gaia).
Source:

getWonderEnemyPlayer()

Target the player with the most advanced wonder. TODO currently the first built wonder is kept, should chek on the minimum wonderDuration left instead.
Source:

init()

More initialisation for stuff that needs the gameState
Source:

numAttackingUnitsAround()

Return the number of units from any of our attacking armies around this position
Source:

switchDefenseToAttack()

Switch defense armies into an attack one against the given target data.range: transform all defense armies inside range of the target into a new attack data.armyID: transform only the defense army ID into a new attack data.uniqueTarget: the attack will stop when the target is destroyed or captured
Source:

update()

Some functions are run every turn Others once in a while
Source: