Combat
Unit perform combat by using their various offensive systems onto each other. The most prevalent method is the use of weapons to lower the enemy hp to kill it by have it reach 0 hp.
A unit can have multiple weapons. Before firing the unit must be sufficiently facing the target, the weapon must be ready to fire (not reloading) and the target needs to be within weapon range. Each weapon can have a separate reload cycle as well as range. Each weapon has a damage type that affects different kinds of armor with differing efficiency (the balance is not heavily based on this fact).
Some weapons are lob weapons and can bypass things obstructing the line of sight. Direct fire units can not do so (can you use yourself as a meatshield by blocking the line of fire?). Some weapons have a area of effect.
Targeting Priorities
- When idle or told to attack move, a unit will attack targets based on priorities:
- 2) Any attack-capable enemy is targeted second, including turrets
- 3) Any remaining enemy unit, i.e., passive buildings are targeted last
In each of these three priority levels, weaker units are targeted before stronger units, i.e., a damaged unit will be targeted over its healthier counterpart. However, a fully healthy unit may be targeted before a partially damaged but much stronger/powerful unit.
Rescript
The resequence engine has the primitive action called ATTACK_POSITION and EQUIP. Presumably the current equipped weapon is stored in resource U_WEAPON. Weapon animations are brought about by unit action animations.
Achron standard way
U_ACTION 25 signifies something. Forced unit actions are used to switch the equipped weapon between the weapons usable. Unit actions 3 ACTION_ATTACK, 4 ACTION_ATTACK_W1, 5 ACTION_ATTACK_W2, 24 ACTION_attack_w0, 25 ACTION_attack_w1-2, 26 ACTION_Post_w1_switch, 28 ACTION_Post_w2_switch, 29 ACTION_Default_w1, 40 ACTION_SWITCH_WEAPON0 and 41 ACTION_SWITCH_WEAPON1 are involved.