Explanation:
There are three parts to this line:
-
if value ~vp >= -1 then if value ~vp <= 1 then
if value ~vo >= -1 then if value ~vo <= 1
If both ~vp and ~vo
are between -1 and 1, then there is an enemy on Torque's permeter.
-
if value #enemy_x <> 0
If the enemy is cloaked, then the information
gathered by the perimeter-scan formula will be wrong. The value of #enemy_x
in this situation is 0, so this check means that the condition is false.
Normally this just stops Torque from discharging energy unnecessarily.
-
if value ~v9 = ~v9
OK, so this probably looks a bit wierd at first
sight! The reason for its inclusion is as follows: When AI Wars is in the
process of being updated, there are lots of beta versions, and aspects
of the game change. In this case, the introduction of cloaking meant that
there had to be a decision on whether a cloaked enemy's coordinates would
be 0 or whether the coordinates would be those of the next-closest enemy.
While this was still being decided, Shea put this statement in so that
if necessary, he could add a statement to this line using a simple copy
and replace. If no extra statements were needed, then this code doesn't
affect the operation of Torque in any way, so it just gets left in.
If all these conditions are met, then it means that there is probably
an enemy next to Torque, so the 'Goto 2' statement jumps to a routine for
zapping it with energy discharges.