forked from public/foundryvtt-wh4-lang-fr-fr
Sync to latest WFRP release
This commit is contained in:
21
scripts/HrOBAXsEX073ReKl.js
Normal file
21
scripts/HrOBAXsEX073ReKl.js
Normal file
@@ -0,0 +1,21 @@
|
||||
let skill = `${game.i18n.localize("NAME.Entertain")} (${game.i18n.localize("SPEC.Singing")})`;
|
||||
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.concat(currentCareer.system.addedSkills).includes(skill);
|
||||
let perfectPitchAdded = this.actor.getFlag("wfrp4e", "perfectPitchAdded") || {};
|
||||
if (existingSkill && inCurrentCareer && !perfectPitchAdded[existingSkill.name])
|
||||
{
|
||||
existingSkill.system.advances.costModifier = -5;
|
||||
}
|
||||
else
|
||||
{
|
||||
perfectPitchAdded[skill] = true;
|
||||
currentCareer.system.addedSkills.push(skill);
|
||||
foundry.utils.setProperty(this.actor, "flags.wfrp4e.perfectPitchAdded", perfectPitchAdded)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user