I think I've mostly figured it out. One that's still causing me a minor headache is the Weapon Master bonus aka STR_MEDAL_WEAPON_PROFICIENCY_NAME.
In the commendations diary of my save file it appears twice, once for each gun:
- {commendationName: STR_MEDAL_WEAPON_PROFICIENCY_NAME, noun: STR_BLACKOPS_MAGNUM, decorationLevel: 0}
...
- {commendationName: STR_MEDAL_WEAPON_PROFICIENCY_NAME, noun: STR_NITRO_EXPRESS, decorationLevel: 0}
But I gather the bonus (+1 throwing) is not in fact added twice. How does the game compute the bonus to apply? Does it pick the entry with the highest decorationLevel and ignore the others?
Would the same logic apply to STR_MEDAL_RACE_KILLS_NAME and any other case where there are multiple entries with the same commendationName but differing nouns?
In case it helps, the relevant section in commendations_XCOMFILES.rul is:
- type: STR_MEDAL_WEAPON_PROFICIENCY_NAME #KOs by weapon
description: STR_MEDAL_WEAPON_PROFICIENCY_UFOPEDIA
soldierBonusTypes: [STR_MEDAL_WEAPON_PROFICIENCY_1, STR_MEDAL_WEAPON_PROFICIENCY_2, STR_MEDAL_WEAPON_PROFICIENCY_3, STR_MEDAL_WEAPON_PROFICIENCY_4, STR_MEDAL_WEAPON_PROFICIENCY_5, STR_MEDAL_WEAPON_PROFICIENCY_6, STR_MEDAL_WEAPON_PROFICIENCY_7, STR_MEDAL_WEAPON_PROFICIENCY_8, STR_MEDAL_WEAPON_PROFICIENCY_9, STR_MEDAL_WEAPON_PROFICIENCY_10]
sprite: 2
criteria:
totalKillsWithAWeapon: [15, 25, 40, 60, 80, 100, 150, 200, 350, 500]
and in soldierBonuses_XCOMFILES.rul:
- name: STR_MEDAL_WEAPON_PROFICIENCY_1
stats:
throwing: 1
- name: STR_MEDAL_WEAPON_PROFICIENCY_2
stats:
throwing: 1
melee: 1
...