I seem to almost get it. So for example —
items:
- type: STR_HIGH_EXPLOSIVE
twoHanded: true
- type: STR_SNIPER_RIFLE
# [. . .] from "Sniper Rifle" or "New Heavy Weapons".
soldiers:
- type: STR_SOLDIER
skills:
- STR_SNIPE
- STR_PLANT_CHARGE
soldierTransformation:
- name: STR_SNIPER_TRAINING
keepSoldierArmor: true
allowsDeadSoldiers: false
allowsLiveSoldiers: true
allowedSoldierTypes:
- STR_SOLDIER
forbiddenPreviousTransformations:
- STR_SNIPER_TRAINING
cost: 2000
transferTime: 120
includeBonusesForMinStats: true
requiredMinStats:
firing: 60
soldierBonusType: STR_TRAINED_SNIPER
lowerBoundAtMinStats: true
upperBoundAtMaxStats: false
upperBoundAtStatCaps: true
flatOverallStatChange: # ??? are adjustments this needed in both places, if only for indication? or will this add stats both here and from the bonus?
reactions: 5
firing: 10
- name: STR_DEMOLITIONS_TRAINING
keepSoldierArmor: true
allowsDeadSoldiers: false
allowsLiveSoldiers: true
allowedSoldierTypes:
- STR_SOLDIER
forbiddenPreviousTransformations:
- STR_DEMOLITIONS_TRAINING
cost: 2000
transferTime: 120
includeBonusesForMinStats: true
requiredMinStats:
bravery: 40
tu: 40
soldierBonusType: STR_TRAINED_DEMOMAN
lowerBoundAtMinStats: true
upperBoundAtMaxStats: false
upperBoundAtStatCaps: true
flatOverallStatChange:
bravery: 5
tu: 6
soldierBonuses:
- name: STR_TRAINED_SNIPER
stats:
reactions: 5
firing: 10
recovery:
morale:
flatOne: 1
- name: STR_TRAINED_DEMOMAN
stats:
bravery: 5
tu: 6
skills:
- type: STR_SNIPE
tags:
SKILL_ID: 1
costUse:
time: 5
flatUse:
time: true
targetMode: 9
requiredBonuses: STR_TRAINED_SNIPER
compatibleWeapons: [STR_RIFLE STR_LASER_RIFLE STR_PLASMA_RIFLE STR_SNIPER_RIFLE]
checkHandsOnly: true
- STR_PLANT_CHARGE
tags:
SKILL_ID: 2
costUse:
time: 10
targetMode: 11
requiredBonuses: STR_TRAINED_DEMOMAN
compatibleWeapons: STR_HIGH_EXPLOSIVE
checkHandsOnly: true
extended:
tags:
RuleSkill:
SKILL_ID: int
scripts:
skillUseUnit:
- offset: 22 # ??? how to determine this?
code: |
var int skill_id;
skill.getTag skill_id Tag.SKILL_ID;
battle_game.flashMessage "SkillUse triggered {0} {1}" skill_id have_tu;
if eq have_tu 0;
debug_log "No Time. Aborted.";
set continue_action 0;
return;
end;
# do stuff here
if eq skill_id 1;
#???
return;
end;
if eq skill_id 2;
#???
return;
end;
return;
Is this right this far?
Now… I want to add for (1) tweaked item properties, such as increased kneelBonus, accuracy and confAimed: range: …
and for (2) damageAlter: ToTile: 0.92
I want to do it just for this one action, without altering anything permanently? So, no messing with RuleItem?
If that can be done, are LOSRequired and blockBothHands for this action checked before script hook of Skill, or they can be introduced in the script (and likewise either used locally or reset later) too?
If so, when a two-handed item is required, is there a way to make sure the other hand is empty for this action (rather than just give it blockBothHands always)? Or drop the other item (if any)?
Or check for 2 items in hands (including empty hand) somehow? The latter would also allow pistols akimbo.