EDIT: Revised, tested. Happy Easter!
Born out of
this thread, as something I would like to do for
this mod, I made a "medic stat" that grows with healed wounds and increases the HP restored with every heal. After mixing up all the very similar variables ten thousand times I finally got it to work! Please take a look at it and let me know there is an obvious problem with it. Thanks to Yankes and everybody else working on this project and all the modders for providing examples I could borrow.
(attached file identical to the below code)
commendations:
- type: STR_MEDAL_MEDICAL_STAT #healed lethal wounds
description: STR_MEDAL_MEDICAL_STAT_UFOPEDIA
sprite: 5
soldierBonusTypes: [STR_MEDIC_BONUS_1,STR_MEDIC_BONUS_1,STR_MEDIC_BONUS_1,STR_MEDIC_BONUS_1,STR_MEDIC_BONUS_1,STR_MEDIC_BONUS_1,STR_MEDIC_BONUS_2,STR_MEDIC_BONUS_2,STR_MEDIC_BONUS_2,STR_MEDIC_BONUS_3]
criteria:
totalWoundsHealed: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
extended:
tags:
RuleSoldierBonus:
TAG_MEDIC_PLUS: int
BattleUnit:
TAG_MEDIC_STAT: int
scripts:
applySoldierBonuses: # apply tag
- offset: 14
code: |
var int bonus_temp;
var int soldier_temp;
soldier_bonus.getTag bonus_temp Tag.TAG_MEDIC_PLUS;
unit.getTag soldier_temp Tag.TAG_MEDIC_STAT;
if gt bonus_temp soldier_temp;
unit.setTag Tag.TAG_MEDIC_STAT bonus_temp;
end;
return;
healUnit:
- offset: 15
#*** extra Healing ***
code: |
var int medic_stat;
actor.getTag medic_stat Tag.TAG_MEDIC_STAT;
if gt medic_stat 0;
if eq medikit_action_type 1;
add health_recovery medic_stat;
debug_log "Medic Stat used. " medic_stat " extra HP for a Total of " health_recovery;
end;
end;
return;
soldierBonuses:
- name: STR_MEDIC_BONUS_1
tags:
TAG_MEDIC_PLUS: 1
- name: STR_MEDIC_BONUS_2
tags:
TAG_MEDIC_PLUS: 2
- name: STR_MEDIC_BONUS_3
tags:
TAG_MEDIC_PLUS: 3