forked from public/foundryvtt-wh4-lang-fr-fr
Sync to latest WFRP release
This commit is contained in:
31
scripts/97yDvwmUqkwHktQj.js
Normal file
31
scripts/97yDvwmUqkwHktQj.js
Normal file
@@ -0,0 +1,31 @@
|
||||
let data = this.effect.getFlag("wfrp4e", "handOfGlory");
|
||||
let changes = [];
|
||||
|
||||
if (!data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.characteristic == "movement")
|
||||
{
|
||||
changes = [{key: "system.details.move.value", mode: 2, value: 2}]
|
||||
}
|
||||
else
|
||||
{
|
||||
let currentTotal = this.actor.system.characteristics[data.characteristic].value;
|
||||
let newTotal = this.actor.system.characteristics[data.characteristic].value + data.roll;
|
||||
let bonusOffset = Math.floor(currentTotal / 10) - Math.floor(newTotal / 10); // e.g. 37 + 15 bonus = 52, calculation bonus modifier should be -2
|
||||
|
||||
changes = changes.concat({
|
||||
key: `system.characteristics.${data.characteristic}.modifier`,
|
||||
mode: 2,
|
||||
value: data.roll
|
||||
},
|
||||
{
|
||||
key: `system.characteristics.${data.characteristic}.calculationBonusModifier`,
|
||||
mode: 2,
|
||||
value: bonusOffset
|
||||
})
|
||||
}
|
||||
|
||||
this.effect.updateSource({changes});
|
||||
Reference in New Issue
Block a user