what do you want to do?
accuracy and damage can be modded to oblivion also without scripts, have you checked the existing ruleset attributes?
Yes, they can, but I want to give soldiers a penalty to accuracy when they are flying, and that does not seem to be doable without scripts. The script for reducing the accuracy is already working, here it is:
accuracyMultiplierBonusStats:
- offset: 10
code: |
var int unitFloating;
var int unitSoldier;
var ptr RuleItem itemRuleset;
unit.isFloating unitFloating;
if eq unitFloating 1;
muldiv bonus 8 10;
end;
debug_log 1 bonus;
debug_log 2 unitFloating;
return bonus;
Now I only need to insert a check for whether a unit is a soldier or not, since I don't want to affect other flying units. (Since soldiers in flying suits are affected by not having a foothold, while for massive hovertanks and cyberdiscs it is not such an issue, and flying aliens should be adapted to it, since flying is their natural means of locomotion).