Range
The range of weapons etc. is based on the following table. It is kind of counter intuitive because if you want to reach the tile which is two tiles up you need a range of three. The advantage is that it allows far more options than an intuitive correct mapping from range to tiles, e.g. you can have a weapon with a very short range which disallows directional attacks.
14 | 12 | 10 | 8 | 7 | 8 | 10 | 12 | 14 |
12 | 10 | 8 | 6 | 5 | 6 | 8 | 10 | 12 |
10 | 8 | 6 | 4 | 3 | 4 | 6 | 8 | 10 |
8 | 6 | 4 | 2 | 1 | 2 | 4 | 6 | 8 |
7 | 5 | 3 | 1 | 0 | 1 | 3 | 5 | 7 |
8 | 6 | 4 | 2 | 1 | 2 | 4 | 6 | 8 |
10 | 8 | 6 | 4 | 3 | 4 | 6 | 8 | 10 |
12 | 10 | 8 | 6 | 5 | 6 | 8 | 10 | 12 |
14 | 12 | 10 | 8 | 7 | 8 | 10 | 12 | 14 |
Range formula
Here is the formula which is used to calculate the range:
x = |PosX1 – PosX2|
y = |PosY1 – PosY2|
(y * 2) -1 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 |
(y * 2) -1 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 |
(y * 2) -1 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 |
(y * 2) -1 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 | (x + y) * 2 – 2 |
0 | (x * 2) -1 | (x * 2) -1 | (x * 2) -1 | (x * 2) -1 |