foundryvtt-wh4-lang-fr-fr/reference_scripts/5sYpJkT2WXIe0gIZ.js

19 lines
565 B
JavaScript
Raw Permalink Normal View History

2024-06-06 21:09:27 +02:00
const rating = parseInt(this.effect.name.match(/\d+/)?.[0]) || 1;
let crewList = foundry.utils.duplicate(this.actor.system.passengers.list);
let selectedCrew = [];
while (selectedCrew.length < rating && crewList.length) {
selectedCrew.push(crewList.splice(crewList.length * Math.random() | 0, 1)[0]);
}
for (let member of selectedCrew) {
let actor = game.actors.get(member.id);
actor.applyBasicDamage(9, {
damageType: game.wfrp4e.config.DAMAGE_TYPE.NORMAL,
minimumOne: true,
loc: "roll",
suppressMsg: false,
hideDSN: false
});
}