AoE

AoE

> Concepts and strategies

Area damage (or AOE, for Area Of Effect) exists in many games. In Leek Wars, they don't just provide a way to affect multiple opponents. They also offer an interesting aspect to code.

Explanations

The functions getWeaponArea and getChipArea respectively return the AOE type of a weapon or a chip.

These functions return a constant that can be:

The 3-cell radius AoE is currently the largest in the game. The area affected is substantial. ![](https://imgur.com/8zk5LQa.png)

Reduction of effects

The potency of the effect decreases with distance from the center of the AoE\*.

Thus, the targeted cell, in the center, undergoes 100% of the effect. For the rest of the cells, the calculation of the proportion of the effect is linear. The calculation of the percentage is done with the following equation:

Knowing that we can't exceed the impact radius!

\* Lasers are not affected by this reduction, every cell receives 100% of the effect.

!AOE values

Through the obstacles

Area damage passes through obstacles. It is therefore possible to hit a leek located behind an obstacle by aiming at a specific cell.

It is possible to target a specific cell in order to take full advantage of the possibilities of area damage. To do this, use the functions useWeaponOnCell and useChipOnCell. Thus, you can shoot the cell right next to your opponent to inflict damage even if he is hiding behind an obstacle!

On the other hand, it is not possible to shoot at an obstacle. Only the cells on which you have vision are reachable.

Example : !AOE Obstacles

In gray, the obstacles and in red, the cells affected by area damage.

The targeted cell is the cell located in the center of the image.