Perhaps you would like something like this:
- type: STR_SNIPER_RIFLE
size: ?
costBuy: ?
costSell:
weight: ?
bigSprite: ?
floorSprite: ?
handSprite: ?
bulletSprite: ?
fireSound: 4
compatibleAmmo:
- STR_SNIPER_RIFLE_CLIP
accuracyAuto: ?
accuracySnap:
accuracyAimed: ?
tuAuto: ?
tuSnap: ?
tuAimed: ?
battleType: 1
twoHanded: true
invWidth: 1
invHeight: 3
reactionFiring: [STR_AIMED_SHOT, STR_AUTO_SHOT, STR_SNAP_SHOT]
where reactionFiring: [STR_AIMED_SHOT, STR_AUTO_SHOT, STR_SNAP_SHOT]
is used to order the reaction fire options.
The code should check each action in order seeing if there are enough TUs and ammo, then check actions short on ammo but not TUs in the same order.
This would cause the effective order to be aimed, snap, then auto if auto is short on ammo, which makes auto less likely to hit.
This could also be hard-coded, but would have to be replaced if custom actions for individual items can be added in the future.
For example:
A future machine gun mod may have snap, aimed, semi-auto, and full-auto actions.
reactionFiring: [STR_FULL_AUTO_SHOT, STR_SEMI_AUTO_SHOT, STR_AIMED_SHOT, STR_SNAP_SHOT]