foundryvtt-reve-de-dragon/module/tmr/augmentation-seuil.js
2022-11-10 00:42:01 +01:00

19 lines
588 B
JavaScript

import { Grammar } from "../grammar.js";
import { Draconique } from "./draconique.js";
import { Misc } from "../misc.js";
export class AugmentationSeuil extends Draconique {
constructor() {
super();
}
type() { return 'tete' }
match(item) { return Draconique.isTeteDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('augmentation du seuil de reve'); }
manualMessage() { return false }
async onActorCreateOwned(actor, tete) {
const seuil = Misc.toInt(actor.system.reve.seuil.value) + 2;
await actor.update({ "system.reve.seuil.value": seuil })
}
}