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
Release Creation / build (release) Successful in 1m11s
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user