Gestion du dé d'usure des degats des armes, gestion des munitions, gestion de la limute dégats vs DV
Release Creation / build (release) Successful in 1m11s

This commit is contained in:
2026-05-22 09:50:48 +02:00
parent 09f2349bab
commit 6742830f40
31 changed files with 372 additions and 58 deletions
+26 -1
View File
@@ -31,6 +31,14 @@ export class DonjonEtCieItem extends Item {
return Number(this.system.deltaMax ?? this.system.delta ?? 0);
}
get ammunitionUsageDie() {
return Number(this.system.munitionsDelta ?? 0);
}
get damageUsageDie() {
return Number(this.system.degatsDelta ?? 0);
}
async roll() {
if (this.type === "arme") return DonjonEtCieRollDialog.createWeapon(this.actor, this);
if (this.type === "sortilege") return DonjonEtCieRollDialog.createSpell(this.actor, this);
@@ -43,10 +51,27 @@ export class DonjonEtCieItem extends Item {
}
async rollDamage() {
if (!this.system.degats) return null;
if (this.system.degatsEstUsageDe) {
if (!Number(this.system.degatsDelta ?? 0)) {
ui.notifications.warn(game.i18n.localize("DNC.Warn.DamageExhausted"));
return null;
}
} else if (!this.system.degats) {
return null;
}
return DonjonEtCieRollDialog.createDamage(this.actor, this);
}
async rollAmmoUsage() {
if (this.type !== "arme") return null;
return game.system.donjonEtCie.rolls.rollWeaponAmmoUsage(this);
}
async rollDamageUsage() {
if (this.type !== "arme") return null;
return game.system.donjonEtCie.rolls.rollWeaponDamageUsage(this);
}
async postToChat() {
const content = await foundry.applications.handlebars.renderTemplate(
"systems/fvtt-donjon-et-cie/templates/chat/item-card.hbs",