I discovered something really strange today while tinkering with Reavers. It seems that the Reaver's attack code consists of three parts, each of which determine whether the Reaver can and should attack a target unit.
The first part determines whether the target unit can be attacked by the Reaver. If the Reaver is on un-walkable terrain (cliffs, water, space, etc.), or if the Reaver or target unit is on an island, the Reaver will be unable to attack.
The second part decides whether the Reaver is actually close enough to the target unit. It is dependent on the amount of distance the Reaver (not the Scarab) must cover to reach the target unit. Because of this, if the Reaver is made into a flying unit, it will use the direct distance instead of the length of the Scarab's path. If the distance is too long, the Reaver will move toward the target instead.
This creates some interesting behavior in StarCraft mods. If the Reaver is turned into an air unit and ordered to attack enemies under a hill, the Scarabs will go a long way round to reach the targets, sometimes defusing before reaching them. Also, a flying Reaver can attack enemies only when it is on a terrain that enemy ground units can reach.
0 comments:
Post a Comment