Lasers

Lasers

> Game rules

Lasers have a specific AoE type. Their behavior is different from classic areas of effect.

The getWeaponArea and getChipArea functions return the constant AREA_LASER_LINE if the weapon or chip has a laser-like area of effect .

A so-called "laser" weapon or chip can only fire in line, so you have to line up with the target, using moveTowardLine and isOnSameLine.

Behavior of the laser

The behavior of the laser will depend on the target cell and the presence or not of an obstacle in the direction of the shot.

Barrier-free

In the case of a laser with a range of 2 to 7 cells, if there is no obstacle and you aim at the cell that is 2 away from you, the area will be this:

!Laser line

All entities within the area will be affected by the laser. Lasers are not subject to the same reduction as other areas of effect: each cell will suffer 100% of the effect.

The cells hit will be those within range, in the example, all those between 2 and 7 range, 2 and 7 inclusive. If an entity or an obstacle is before the first cell of the area of effect (cell 1 in the example), it is not possible to shoot.

The same area from 2 to 7 will be affected regardless of the box targeted among the boxes in red.

With obstacles

Obstacles stop the laser. Thus a laser "continues on its way" until it reaches its maximum range or an obstacle.

Still with a range of 2 to 7, if the cell 2 away is targeted and an obstacle is 5 cells away, then the affected area will be this:

!Laser obst