foundryvtt-wh4-lang-fr-fr/scripts/2W9uMTT6iJhfQ044.js

19 lines
424 B
JavaScript
Raw Normal View History

let skill = `Métier (${this.item.parenthesesText})`
2024-05-16 17:57:51 +02:00
let currentCareer = this.actor.system.currentCareer;
let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);
if (!currentCareer) return
let inCurrentCareer = currentCareer.system.skills.includes(skill);
if (existingSkill && inCurrentCareer)
{
existingSkill.system.advances.costModifier = -5;
}
else
{
currentCareer.system.skills.push(skill);
}