Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8718cfff05 | |||
| 6742830f40 |
+19
-1
@@ -12,6 +12,7 @@
|
|||||||
"TYPES.Item.entrainement": "Entrainement",
|
"TYPES.Item.entrainement": "Entrainement",
|
||||||
"DNC.Roll.Characteristic": "Jet de caracteristique",
|
"DNC.Roll.Characteristic": "Jet de caracteristique",
|
||||||
"DNC.Roll.Attack": "Jet d'attaque",
|
"DNC.Roll.Attack": "Jet d'attaque",
|
||||||
|
"DNC.Roll.Ammunition": "Munitions",
|
||||||
"DNC.Roll.Damage": "Jet de degats",
|
"DNC.Roll.Damage": "Jet de degats",
|
||||||
"DNC.Roll.Favor": "Faveur",
|
"DNC.Roll.Favor": "Faveur",
|
||||||
"DNC.Roll.HitDice": "Jet de de de vie",
|
"DNC.Roll.HitDice": "Jet de de de vie",
|
||||||
@@ -37,6 +38,8 @@
|
|||||||
"DNC.Chat.Kept": "Garde",
|
"DNC.Chat.Kept": "Garde",
|
||||||
"DNC.Chat.Rolls": "Lancers",
|
"DNC.Chat.Rolls": "Lancers",
|
||||||
"DNC.Chat.RollDamage": "Lancer les degats",
|
"DNC.Chat.RollDamage": "Lancer les degats",
|
||||||
|
"DNC.Chat.RollAmmunition": "Munitions",
|
||||||
|
"DNC.Chat.DamageCapped": "Degats plafonnes a {damage} par {dv}",
|
||||||
"DNC.Chat.RollValue": "Jet",
|
"DNC.Chat.RollValue": "Jet",
|
||||||
"DNC.Chat.AutoDisadvantage": "Desavantage automatique",
|
"DNC.Chat.AutoDisadvantage": "Desavantage automatique",
|
||||||
"DNC.Chat.RiskChaos": "Risquer le Chaos",
|
"DNC.Chat.RiskChaos": "Risquer le Chaos",
|
||||||
@@ -56,11 +59,16 @@
|
|||||||
"DNC.Chat.HpRemaining": "PV restants",
|
"DNC.Chat.HpRemaining": "PV restants",
|
||||||
"DNC.Chat.CasterRank": "Rang du lanceur",
|
"DNC.Chat.CasterRank": "Rang du lanceur",
|
||||||
"DNC.Chat.Difficulty": "Difficulte",
|
"DNC.Chat.Difficulty": "Difficulte",
|
||||||
|
"DNC.Chat.MartialDv": "DV martial",
|
||||||
|
"DNC.Chat.EffectiveDamage": "Degats retenus",
|
||||||
"DNC.Chat.Effect": "Effet",
|
"DNC.Chat.Effect": "Effet",
|
||||||
"DNC.Chat.StoredProtection": "Protection stockee pour ce combat",
|
"DNC.Chat.StoredProtection": "Protection stockee pour ce combat",
|
||||||
"DNC.Chat.ResourceWearsDown": "La ressource s'amenuise.",
|
"DNC.Chat.ResourceWearsDown": "La ressource s'amenuise.",
|
||||||
"DNC.Chat.ResourceStable": "La ressource tient bon.",
|
"DNC.Chat.ResourceStable": "La ressource tient bon.",
|
||||||
"DNC.Chat.ResourceExhausted": "La ressource est epuisee.",
|
"DNC.Chat.ResourceExhausted": "La ressource est epuisee.",
|
||||||
|
"DNC.Chat.AmmunitionWearsDown": "Les munitions diminuent d'un cran.",
|
||||||
|
"DNC.Chat.AmmunitionStable": "Le stock de munitions tient bon.",
|
||||||
|
"DNC.Chat.AmmunitionExhausted": "Il n'y a plus de munitions disponibles pour cette arme.",
|
||||||
"DNC.Chat.AutoDisadvantageCanceled": "le cout du sort depasse le rang du lanceur, mais une faveur l'a annule.",
|
"DNC.Chat.AutoDisadvantageCanceled": "le cout du sort depasse le rang du lanceur, mais une faveur l'a annule.",
|
||||||
"DNC.Chat.AutoDisadvantageApplies": "le cout du sort depasse le rang du lanceur.",
|
"DNC.Chat.AutoDisadvantageApplies": "le cout du sort depasse le rang du lanceur.",
|
||||||
"DNC.Chat.FocusFrom": "depuis",
|
"DNC.Chat.FocusFrom": "depuis",
|
||||||
@@ -89,6 +97,7 @@
|
|||||||
"DNC.UI.Focus": "Focus",
|
"DNC.UI.Focus": "Focus",
|
||||||
"DNC.UI.Chaos": "Chaos",
|
"DNC.UI.Chaos": "Chaos",
|
||||||
"DNC.UI.Weapon": "Arme",
|
"DNC.UI.Weapon": "Arme",
|
||||||
|
"DNC.UI.Ammunition": "Munitions",
|
||||||
"DNC.UI.Damage": "Degats",
|
"DNC.UI.Damage": "Degats",
|
||||||
"DNC.UI.Range": "Portee",
|
"DNC.UI.Range": "Portee",
|
||||||
"DNC.UI.Spell": "Sortilege",
|
"DNC.UI.Spell": "Sortilege",
|
||||||
@@ -96,10 +105,12 @@
|
|||||||
"DNC.Dialog.InitiativeCurrent": "DEX actuelle : <strong>{dex}</strong>, bonus de fiche : <strong>{initiativeBonus}</strong>",
|
"DNC.Dialog.InitiativeCurrent": "DEX actuelle : <strong>{dex}</strong>, bonus de fiche : <strong>{initiativeBonus}</strong>",
|
||||||
"DNC.Dialog.CharacteristicUsed": "Caracteristique utilisee",
|
"DNC.Dialog.CharacteristicUsed": "Caracteristique utilisee",
|
||||||
"DNC.Dialog.ActorDamageBonus": "Bonus de degats de l'acteur",
|
"DNC.Dialog.ActorDamageBonus": "Bonus de degats de l'acteur",
|
||||||
|
"DNC.Dialog.DamageCappedByDv": "Le DV martial actuel ({dv}) plafonne cette arme : {base} devient {damage}.",
|
||||||
"DNC.Dialog.SpellAutoDisadvantage": "Le cout depasse le rang du lanceur : le jet se fera automatiquement avec desavantage.",
|
"DNC.Dialog.SpellAutoDisadvantage": "Le cout depasse le rang du lanceur : le jet se fera automatiquement avec desavantage.",
|
||||||
"DNC.Dialog.UseUsageDie": "Utiliser <strong>{itemName}</strong> et lancer son de d'usage actuel.",
|
"DNC.Dialog.UseUsageDie": "Utiliser <strong>{itemName}</strong> et lancer son de d'usage actuel.",
|
||||||
"DNC.Dialog.CurrentValue": "Valeur actuelle",
|
"DNC.Dialog.CurrentValue": "Valeur actuelle",
|
||||||
"DNC.Warn.NoFavorAvailable": "Aucune faveur disponible pour {label}.",
|
"DNC.Warn.NoFavorAvailable": "Aucune faveur disponible pour {label}.",
|
||||||
|
"DNC.Warn.NoAmmunitionAvailable": "Il n'y a plus de munitions disponibles pour cette arme.",
|
||||||
"DNC.Warn.SpellInsufficientResources": "Le lanceur ne dispose pas d'assez de PV et de focus pour payer ce sort.",
|
"DNC.Warn.SpellInsufficientResources": "Le lanceur ne dispose pas d'assez de PV et de focus pour payer ce sort.",
|
||||||
"DNC.Warn.ChaosUnavailable": "Le Chaos n'est pas disponible pour ce sort.",
|
"DNC.Warn.ChaosUnavailable": "Le Chaos n'est pas disponible pour ce sort.",
|
||||||
"DNC.Warn.TrainingExhausted": "Cet entrainement est epuise pour aujourd'hui. Reinitialisez son delta quotidien pour le lendemain.",
|
"DNC.Warn.TrainingExhausted": "Cet entrainement est epuise pour aujourd'hui. Reinitialisez son delta quotidien pour le lendemain.",
|
||||||
@@ -187,5 +198,12 @@
|
|||||||
"DNC.Sheet.Create": "Creer",
|
"DNC.Sheet.Create": "Creer",
|
||||||
"DNC.Sheet.Delete": "Supprimer",
|
"DNC.Sheet.Delete": "Supprimer",
|
||||||
"DNC.Sheet.Edit": "Editer",
|
"DNC.Sheet.Edit": "Editer",
|
||||||
"DNC.Sheet.Post": "Poster dans le chat"
|
"DNC.Sheet.Post": "Poster dans le chat",
|
||||||
|
"DNC.Roll.DamageUsage": "Usage des degats",
|
||||||
|
"DNC.Chat.RollDamageUsage": "Usage degats",
|
||||||
|
"DNC.Chat.DamageUsageWearsDown": "Les degats de l'arme diminuent d'un cran.",
|
||||||
|
"DNC.Chat.DamageUsageStable": "L'arme tient bon, ses degats restent inchanges.",
|
||||||
|
"DNC.Chat.DamageUsageExhausted": "L'arme est epuisee, elle ne peut plus causer de degats.",
|
||||||
|
"DNC.UI.DamageExhausted": "Epuise",
|
||||||
|
"DNC.Warn.DamageExhausted": "Cette arme est epuisee et ne peut plus causer de degats."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,12 +201,17 @@ export class DonjonEtCieRollDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async createDamage(actor, item) {
|
static async createDamage(actor, item) {
|
||||||
|
const damageContext = DonjonEtCieUtility.getMartialDamageContext(actor, item);
|
||||||
const content = await foundry.applications.handlebars.renderTemplate(
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
"systems/fvtt-donjon-et-cie/templates/dialogs/damage-roll.hbs",
|
"systems/fvtt-donjon-et-cie/templates/dialogs/damage-roll.hbs",
|
||||||
{
|
{
|
||||||
actorName: actor?.name ?? item.actor?.name ?? "",
|
actorName: actor?.name ?? item.actor?.name ?? "",
|
||||||
item,
|
item,
|
||||||
actorBonus: actor?.system?.combat?.degatsBonus ?? 0
|
actorBonus: actor?.system?.combat?.degatsBonus ?? 0,
|
||||||
|
damageFormula: damageContext.effectiveFormula || item.system.degats,
|
||||||
|
damageBase: damageContext.baseFormula || item.system.degats,
|
||||||
|
damageCapped: damageContext.capped,
|
||||||
|
martialDvLabel: damageContext.martialDvSides ? `d${damageContext.martialDvSides}` : damageContext.martialDvFormula
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,9 @@ export default class DonjonEtCieItemSheet extends HandlebarsApplicationMixin(fou
|
|||||||
isCapacity: item.type === "capacite",
|
isCapacity: item.type === "capacite",
|
||||||
isLanguage: item.type === "langue",
|
isLanguage: item.type === "langue",
|
||||||
isTrait: item.type === "trait",
|
isTrait: item.type === "trait",
|
||||||
|
ammunitionUsageLabel: item.type === "arme" && Number(item.system.munitionsDelta ?? 0) > 0
|
||||||
|
? DonjonEtCieUtility.formatUsageDie(item.system.munitionsDelta)
|
||||||
|
: "—",
|
||||||
canResetUsage: item.type === "entrainement" && Number(item.system.deltaMax ?? 0) > 0 && Number(item.system.delta ?? 0) !== Number(item.system.deltaMax ?? 0),
|
canResetUsage: item.type === "entrainement" && Number(item.system.deltaMax ?? 0) > 0 && Number(item.system.delta ?? 0) !== Number(item.system.deltaMax ?? 0),
|
||||||
armorProtectionDisplay: Number(item.system.resultatProtection ?? 0) > 0 ? item.system.resultatProtection : "—",
|
armorProtectionDisplay: Number(item.system.resultatProtection ?? 0) > 0 ? item.system.resultatProtection : "—",
|
||||||
weaponCharacteristicLabel: item.type === "arme" ? DonjonEtCieUtility.getWeaponCharacteristicLabel(item.system.categorie) : null,
|
weaponCharacteristicLabel: item.type === "arme" ? DonjonEtCieUtility.getWeaponCharacteristicLabel(item.system.categorie) : null,
|
||||||
|
|||||||
@@ -31,6 +31,14 @@ export class DonjonEtCieItem extends Item {
|
|||||||
return Number(this.system.deltaMax ?? this.system.delta ?? 0);
|
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() {
|
async roll() {
|
||||||
if (this.type === "arme") return DonjonEtCieRollDialog.createWeapon(this.actor, this);
|
if (this.type === "arme") return DonjonEtCieRollDialog.createWeapon(this.actor, this);
|
||||||
if (this.type === "sortilege") return DonjonEtCieRollDialog.createSpell(this.actor, this);
|
if (this.type === "sortilege") return DonjonEtCieRollDialog.createSpell(this.actor, this);
|
||||||
@@ -43,10 +51,27 @@ export class DonjonEtCieItem extends Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async rollDamage() {
|
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);
|
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() {
|
async postToChat() {
|
||||||
const content = await foundry.applications.handlebars.renderTemplate(
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
"systems/fvtt-donjon-et-cie/templates/chat/item-card.hbs",
|
"systems/fvtt-donjon-et-cie/templates/chat/item-card.hbs",
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ function injectActorDirectoryMissionPackButton(app, element) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onChatActionClick(event) {
|
function onChatActionClick(event) {
|
||||||
const button = event.target.closest("[data-action='rollChatDamage'], [data-action='rollSpellChaos'], [data-action='applyDamage']");
|
const button = event.target.closest("[data-action='rollChatDamage'], [data-action='rollSpellChaos'], [data-action='applyDamage'], [data-action='rollAmmoUsage'], [data-action='rollDamageUsage']");
|
||||||
if (!(button instanceof HTMLElement)) return;
|
if (!(button instanceof HTMLElement)) return;
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -85,6 +85,12 @@ function onChatActionClick(event) {
|
|||||||
const itemUuid = button.dataset.itemUuid;
|
const itemUuid = button.dataset.itemUuid;
|
||||||
if (!itemUuid) return;
|
if (!itemUuid) return;
|
||||||
const item = await fromUuid(itemUuid);
|
const item = await fromUuid(itemUuid);
|
||||||
|
if (button.dataset.action === "rollAmmoUsage") {
|
||||||
|
return item?.rollAmmoUsage?.();
|
||||||
|
}
|
||||||
|
if (button.dataset.action === "rollDamageUsage") {
|
||||||
|
return item?.rollDamageUsage?.();
|
||||||
|
}
|
||||||
return item?.rollDamage?.();
|
return item?.rollDamage?.();
|
||||||
})();
|
})();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -308,12 +308,14 @@ export class DonjonEtCieRolls {
|
|||||||
favorLabel: favor?.label ?? null,
|
favorLabel: favor?.label ?? null,
|
||||||
favorNote: favor?.note ?? null,
|
favorNote: favor?.note ?? null,
|
||||||
showDamageButton: result.success && Boolean(item.system.degats),
|
showDamageButton: result.success && Boolean(item.system.degats),
|
||||||
|
showAmmoButton: Number(item.system.munitionsDelta ?? 0) > 0,
|
||||||
itemUuid: item.uuid,
|
itemUuid: item.uuid,
|
||||||
details: [
|
details: [
|
||||||
{ label: game.i18n.localize("DNC.UI.Weapon"), value: item.name },
|
{ label: game.i18n.localize("DNC.UI.Weapon"), value: item.name },
|
||||||
{ label: game.i18n.localize("DNC.UI.Characteristic"), value: characteristicLabel },
|
{ label: game.i18n.localize("DNC.UI.Characteristic"), value: characteristicLabel },
|
||||||
{ label: `Valeur de ${characteristicLabel}`, value: result.target },
|
{ label: `Valeur de ${characteristicLabel}`, value: result.target },
|
||||||
{ label: game.i18n.localize("DNC.UI.Damage"), value: item.system.degats || "—" },
|
{ label: game.i18n.localize("DNC.UI.Damage"), value: item.system.degats || "—" },
|
||||||
|
{ label: game.i18n.localize("DNC.UI.Ammunition"), value: Number(item.system.munitionsDelta ?? 0) > 0 ? DonjonEtCieUtility.formatUsageDie(item.system.munitionsDelta) : "—" },
|
||||||
{ label: game.i18n.localize("DNC.UI.Range"), value: item.system.portee || "—" },
|
{ label: game.i18n.localize("DNC.UI.Range"), value: item.system.portee || "—" },
|
||||||
...(favor ? [
|
...(favor ? [
|
||||||
{ label: game.i18n.localize("DNC.Chat.Favor"), value: favor.label },
|
{ label: game.i18n.localize("DNC.Chat.Favor"), value: favor.label },
|
||||||
@@ -327,11 +329,54 @@ export class DonjonEtCieRolls {
|
|||||||
return { ...result, favor, mode: effectiveMode };
|
return { ...result, favor, mode: effectiveMode };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async rollWeaponAmmoUsage(item, { mode = "normal" } = {}) {
|
||||||
|
const before = Number(item?.system?.munitionsDelta ?? 0);
|
||||||
|
if (!before) {
|
||||||
|
ui.notifications.warn(game.i18n.localize("DNC.Warn.NoAmmunitionAvailable"));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const resolved = await this.#resolveFormulaRoll(`1d${before}`, {}, { mode, favorable: "high" });
|
||||||
|
const result = resolved.kept;
|
||||||
|
const degraded = result <= 3;
|
||||||
|
const after = degraded ? DonjonEtCieUtility.degradeUsageDie(before) : before;
|
||||||
|
|
||||||
|
if (after !== before) {
|
||||||
|
await item.update({ "system.munitionsDelta": after });
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.#createChatCard(item.actor, "systems/fvtt-donjon-et-cie/templates/chat/usage-card.hbs", {
|
||||||
|
title: `${game.i18n.localize("DNC.Roll.Ammunition")} : ${item.name}`,
|
||||||
|
value: result,
|
||||||
|
values: resolved.values,
|
||||||
|
mode: resolved.mode,
|
||||||
|
modeLabel: this.#getModeLabel(resolved.mode),
|
||||||
|
before: DonjonEtCieUtility.formatUsageDie(before),
|
||||||
|
after: DonjonEtCieUtility.formatUsageDie(after),
|
||||||
|
protectionStored: null,
|
||||||
|
degraded,
|
||||||
|
exhausted: after === 0,
|
||||||
|
isAmmunition: true
|
||||||
|
}, { rolls: resolved.rolls });
|
||||||
|
|
||||||
|
return { result, values: resolved.values, mode: resolved.mode, before, after, degraded };
|
||||||
|
}
|
||||||
|
|
||||||
static async rollDamage(actor, item, { mode = "normal" } = {}) {
|
static async rollDamage(actor, item, { mode = "normal" } = {}) {
|
||||||
if (!item.system.degats) return null;
|
const isUsageDie = Boolean(item.system.degatsEstUsageDe);
|
||||||
|
const degatsDelta = Number(item.system.degatsDelta ?? 0);
|
||||||
|
|
||||||
|
if (isUsageDie && !degatsDelta) {
|
||||||
|
ui.notifications.warn(game.i18n.localize("DNC.Warn.DamageExhausted"));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (!isUsageDie && !item.system.degats) return null;
|
||||||
|
|
||||||
|
const damageContext = DonjonEtCieUtility.getMartialDamageContext(actor, item);
|
||||||
const actorBonus = Number(actor?.system?.combat?.degatsBonus ?? 0);
|
const actorBonus = Number(actor?.system?.combat?.degatsBonus ?? 0);
|
||||||
const totalBonus = actorBonus;
|
const totalBonus = actorBonus;
|
||||||
const formula = totalBonus ? `${item.system.degats} + ${totalBonus}` : item.system.degats;
|
const effectiveDamage = damageContext.effectiveFormula || (isUsageDie ? `1d${degatsDelta}` : item.system.degats);
|
||||||
|
const formula = totalBonus ? `${effectiveDamage} + ${totalBonus}` : effectiveDamage;
|
||||||
const result = await this.#resolveFormulaRoll(formula, {}, { mode, favorable: "high" });
|
const result = await this.#resolveFormulaRoll(formula, {}, { mode, favorable: "high" });
|
||||||
const targets = DonjonEtCieUtility.getSceneDamageTargets();
|
const targets = DonjonEtCieUtility.getSceneDamageTargets();
|
||||||
const rollDieLabels = result.rolls.map((roll) => {
|
const rollDieLabels = result.rolls.map((roll) => {
|
||||||
@@ -339,6 +384,7 @@ export class DonjonEtCieRolls {
|
|||||||
return dieValues.length ? dieValues.join(" + ") : String(roll.total ?? "—");
|
return dieValues.length ? dieValues.join(" + ") : String(roll.total ?? "—");
|
||||||
});
|
});
|
||||||
const keptDieLabel = rollDieLabels[result.keptIndex] ?? rollDieLabels[0] ?? String(result.kept);
|
const keptDieLabel = rollDieLabels[result.keptIndex] ?? rollDieLabels[0] ?? String(result.kept);
|
||||||
|
const baseDamageDisplay = isUsageDie ? DonjonEtCieUtility.formatUsageDie(degatsDelta) : item.system.degats;
|
||||||
|
|
||||||
await this.#createChatCard(actor ?? item.actor, "systems/fvtt-donjon-et-cie/templates/chat/damage-card.hbs", {
|
await this.#createChatCard(actor ?? item.actor, "systems/fvtt-donjon-et-cie/templates/chat/damage-card.hbs", {
|
||||||
title: `${game.i18n.localize("DNC.Roll.Damage")} : ${item.name}`,
|
title: `${game.i18n.localize("DNC.Roll.Damage")} : ${item.name}`,
|
||||||
@@ -351,13 +397,60 @@ export class DonjonEtCieRolls {
|
|||||||
values: result.values,
|
values: result.values,
|
||||||
total: result.kept,
|
total: result.kept,
|
||||||
bonus: totalBonus,
|
bonus: totalBonus,
|
||||||
baseDamage: item.system.degats,
|
baseDamage: baseDamageDisplay,
|
||||||
|
effectiveDamage,
|
||||||
|
damageCapped: damageContext.capped,
|
||||||
|
martialDvLabel: damageContext.martialDvSides ? `d${damageContext.martialDvSides}` : damageContext.martialDvFormula,
|
||||||
sourceLabel: item.name,
|
sourceLabel: item.name,
|
||||||
targets,
|
targets,
|
||||||
hasTargets: targets.length > 0
|
hasTargets: targets.length > 0,
|
||||||
|
showDamageUsageButton: isUsageDie && degatsDelta > 0,
|
||||||
|
itemUuid: item.uuid
|
||||||
}, { rolls: result.rolls });
|
}, { rolls: result.rolls });
|
||||||
|
|
||||||
return { total: result.kept, formula: result.formula, bonus: totalBonus, values: result.values, mode: result.mode };
|
return {
|
||||||
|
total: result.kept,
|
||||||
|
formula: result.formula,
|
||||||
|
baseDamage: baseDamageDisplay,
|
||||||
|
effectiveDamage,
|
||||||
|
damageCapped: damageContext.capped,
|
||||||
|
bonus: totalBonus,
|
||||||
|
values: result.values,
|
||||||
|
mode: result.mode
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static async rollWeaponDamageUsage(item, { mode = "normal" } = {}) {
|
||||||
|
const before = Number(item?.system?.degatsDelta ?? 0);
|
||||||
|
if (!before) {
|
||||||
|
ui.notifications.warn(game.i18n.localize("DNC.Warn.DamageExhausted"));
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const resolved = await this.#resolveFormulaRoll(`1d${before}`, {}, { mode, favorable: "high" });
|
||||||
|
const result = resolved.kept;
|
||||||
|
const degraded = result <= 3;
|
||||||
|
const after = degraded ? DonjonEtCieUtility.degradeUsageDie(before) : before;
|
||||||
|
|
||||||
|
if (after !== before) {
|
||||||
|
await item.update({ "system.degatsDelta": after });
|
||||||
|
}
|
||||||
|
|
||||||
|
await this.#createChatCard(item.actor, "systems/fvtt-donjon-et-cie/templates/chat/usage-card.hbs", {
|
||||||
|
title: `${game.i18n.localize("DNC.Roll.DamageUsage")} : ${item.name}`,
|
||||||
|
value: result,
|
||||||
|
values: resolved.values,
|
||||||
|
mode: resolved.mode,
|
||||||
|
modeLabel: this.#getModeLabel(resolved.mode),
|
||||||
|
before: DonjonEtCieUtility.formatUsageDie(before),
|
||||||
|
after: DonjonEtCieUtility.formatUsageDie(after),
|
||||||
|
protectionStored: null,
|
||||||
|
degraded,
|
||||||
|
exhausted: after === 0,
|
||||||
|
isDamageUsage: true
|
||||||
|
}, { rolls: resolved.rolls });
|
||||||
|
|
||||||
|
return { result, values: resolved.values, mode: resolved.mode, before, after, degraded };
|
||||||
}
|
}
|
||||||
|
|
||||||
static async applyDamage(target, { damage = 0, useArmor = false, sourceLabel = "" } = {}) {
|
static async applyDamage(target, { damage = 0, useArmor = false, sourceLabel = "" } = {}) {
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ export class DonjonEtCieUtility {
|
|||||||
static getSceneDamageTargets() {
|
static getSceneDamageTargets() {
|
||||||
const scene = canvas?.scene ?? game.scenes?.current;
|
const scene = canvas?.scene ?? game.scenes?.current;
|
||||||
const tokens = scene?.tokens?.contents ?? [];
|
const tokens = scene?.tokens?.contents ?? [];
|
||||||
|
|
||||||
|
const selectedTokens = canvas?.tokens?.controlled ?? [];
|
||||||
|
const selectedTokenUuid = selectedTokens.length === 1 ? selectedTokens[0]?.uuid : null;
|
||||||
|
|
||||||
return tokens
|
return tokens
|
||||||
.map((token) => {
|
.map((token) => {
|
||||||
@@ -89,7 +92,8 @@ export class DonjonEtCieUtility {
|
|||||||
tokenId: token.id,
|
tokenId: token.id,
|
||||||
tokenUuid: token.uuid,
|
tokenUuid: token.uuid,
|
||||||
actorUuid: actor.uuid,
|
actorUuid: actor.uuid,
|
||||||
label
|
label,
|
||||||
|
isSelected: token.uuid === selectedTokenUuid
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.filter(Boolean)
|
.filter(Boolean)
|
||||||
@@ -119,6 +123,87 @@ export class DonjonEtCieUtility {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static parseDieFormula(formula) {
|
||||||
|
const normalized = String(formula ?? "").trim();
|
||||||
|
if (!normalized) return null;
|
||||||
|
|
||||||
|
const dieMatch = normalized.match(/(?<count>\d*)d(?<sides>\d+)/i);
|
||||||
|
if (dieMatch?.groups?.sides) {
|
||||||
|
return {
|
||||||
|
formula: normalized,
|
||||||
|
count: Number(dieMatch.groups.count || 1),
|
||||||
|
countRaw: dieMatch.groups.count ?? "",
|
||||||
|
sides: Number(dieMatch.groups.sides),
|
||||||
|
match: dieMatch[0],
|
||||||
|
index: dieMatch.index ?? 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/^\d+$/.test(normalized)) {
|
||||||
|
const sides = Number(normalized);
|
||||||
|
if ([4, 6, 8, 10, 12, 20].includes(sides)) {
|
||||||
|
return {
|
||||||
|
formula: normalized,
|
||||||
|
count: 1,
|
||||||
|
countRaw: "",
|
||||||
|
sides,
|
||||||
|
match: normalized,
|
||||||
|
index: 0
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getMartialDamageContext(actor, item) {
|
||||||
|
const isUsageDie = Boolean(item?.system?.degatsEstUsageDe);
|
||||||
|
const degatsDelta = Number(item?.system?.degatsDelta ?? 0);
|
||||||
|
const baseFormula = isUsageDie
|
||||||
|
? (degatsDelta > 0 ? `1d${degatsDelta}` : "")
|
||||||
|
: String(item?.system?.degats ?? "").trim();
|
||||||
|
|
||||||
|
const baseContext = {
|
||||||
|
baseFormula,
|
||||||
|
effectiveFormula: baseFormula,
|
||||||
|
capped: false,
|
||||||
|
martialDvFormula: String(actor?.system?.sante?.dv ?? "").trim(),
|
||||||
|
martialDvSides: 0,
|
||||||
|
weaponSides: 0,
|
||||||
|
isUsageDie
|
||||||
|
};
|
||||||
|
|
||||||
|
if (actor?.type !== "employe" || item?.type !== "arme" || !baseFormula) {
|
||||||
|
return baseContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
const damageDie = this.parseDieFormula(baseFormula);
|
||||||
|
const martialDie = this.parseDieFormula(actor.system.sante?.dv);
|
||||||
|
if (!damageDie || !martialDie?.sides) return baseContext;
|
||||||
|
|
||||||
|
const cappedSides = Math.min(damageDie.sides, martialDie.sides);
|
||||||
|
if (cappedSides >= damageDie.sides) {
|
||||||
|
return {
|
||||||
|
...baseContext,
|
||||||
|
martialDvSides: martialDie.sides,
|
||||||
|
weaponSides: damageDie.sides
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const replacement = `${damageDie.countRaw || ""}d${cappedSides}`;
|
||||||
|
const effectiveFormula = damageDie.match === damageDie.formula
|
||||||
|
? replacement
|
||||||
|
: `${damageDie.formula.slice(0, damageDie.index)}${replacement}${damageDie.formula.slice(damageDie.index + damageDie.match.length)}`;
|
||||||
|
|
||||||
|
return {
|
||||||
|
...baseContext,
|
||||||
|
effectiveFormula,
|
||||||
|
capped: true,
|
||||||
|
martialDvSides: martialDie.sides,
|
||||||
|
weaponSides: damageDie.sides
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
static getFavorLabel(key) {
|
static getFavorLabel(key) {
|
||||||
return DONJON_ET_CIE.favorDepartments[key] ?? key;
|
return DONJON_ET_CIE.favorDepartments[key] ?? key;
|
||||||
}
|
}
|
||||||
@@ -173,12 +258,20 @@ export class DonjonEtCieUtility {
|
|||||||
const system = item.system;
|
const system = item.system;
|
||||||
const delta = Number(system.delta ?? 0);
|
const delta = Number(system.delta ?? 0);
|
||||||
const deltaMax = Number(system.deltaMax ?? delta ?? 0);
|
const deltaMax = Number(system.deltaMax ?? delta ?? 0);
|
||||||
|
const ammunitionDelta = Number(system.munitionsDelta ?? 0);
|
||||||
|
const isUsageDie = Boolean(system.degatsEstUsageDe);
|
||||||
|
const degatsDelta = Number(system.degatsDelta ?? 0);
|
||||||
const usageLabel = item.type === "entrainement" && deltaMax > 0
|
const usageLabel = item.type === "entrainement" && deltaMax > 0
|
||||||
? `${this.formatUsageDie(delta)} / ${this.formatUsageDie(deltaMax)}`
|
? `${this.formatUsageDie(delta)} / ${this.formatUsageDie(deltaMax)}`
|
||||||
: delta > 0
|
: delta > 0
|
||||||
? this.formatUsageDie(delta)
|
? this.formatUsageDie(delta)
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
const damageUsageLabel = isUsageDie
|
||||||
|
? (degatsDelta > 0 ? this.formatUsageDie(degatsDelta) : game.i18n.localize("DNC.UI.DamageExhausted"))
|
||||||
|
: null;
|
||||||
|
const damageLabel = isUsageDie ? damageUsageLabel : (system.degats || null);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: item.name,
|
name: item.name,
|
||||||
@@ -187,11 +280,15 @@ export class DonjonEtCieUtility {
|
|||||||
system,
|
system,
|
||||||
uuid: item.uuid,
|
uuid: item.uuid,
|
||||||
usageLabel,
|
usageLabel,
|
||||||
|
ammunitionUsageLabel: item.type === "arme" && ammunitionDelta > 0 ? this.formatUsageDie(ammunitionDelta) : null,
|
||||||
protectionLabel: item.type === "armure" && Number(system.resultatProtection ?? 0) > 0 ? `Protection ${system.resultatProtection}` : null,
|
protectionLabel: item.type === "armure" && Number(system.resultatProtection ?? 0) > 0 ? `Protection ${system.resultatProtection}` : null,
|
||||||
weaponCharacteristicLabel: item.type === "arme" ? this.getWeaponCharacteristicLabel(system.categorie) : null,
|
weaponCharacteristicLabel: item.type === "arme" ? this.getWeaponCharacteristicLabel(system.categorie) : null,
|
||||||
canRoll: ["arme", "sortilege"].includes(item.type),
|
canRoll: ["arme", "sortilege"].includes(item.type),
|
||||||
canUse: delta > 0,
|
canUse: delta > 0,
|
||||||
canRollDamage: Boolean(system.degats),
|
hasTrackedAmmunition: item.type === "arme" && ammunitionDelta > 0,
|
||||||
|
damageUsageLabel,
|
||||||
|
damageLabel,
|
||||||
|
canRollDamage: item.type === "arme" && (isUsageDie ? degatsDelta > 0 : Boolean(system.degats)),
|
||||||
rollAction: item.type === "sortilege" ? "rollSpell" : "rollWeapon",
|
rollAction: item.type === "sortilege" ? "rollSpell" : "rollWeapon",
|
||||||
damageAction: "rollDamage",
|
damageAction: "rollDamage",
|
||||||
isEquipped: Boolean(system.equipee),
|
isEquipped: Boolean(system.equipee),
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ export default class ArmeDataModel extends BaseItemDataModel {
|
|||||||
categorie: new fields.StringField({ initial: "melee" }),
|
categorie: new fields.StringField({ initial: "melee" }),
|
||||||
caracteristique: new fields.StringField({ initial: "force" }),
|
caracteristique: new fields.StringField({ initial: "force" }),
|
||||||
degats: new fields.StringField({ initial: "1d6" }),
|
degats: new fields.StringField({ initial: "1d6" }),
|
||||||
|
degatsEstUsageDe: new fields.BooleanField({ initial: false }),
|
||||||
|
degatsDelta: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
|
||||||
|
munitionsDelta: new fields.NumberField({ initial: 0, integer: true, min: 0 }),
|
||||||
portee: new fields.StringField({ initial: "" }),
|
portee: new fields.StringField({ initial: "" }),
|
||||||
mains: new fields.NumberField({ initial: 1, integer: true }),
|
mains: new fields.NumberField({ initial: 1, integer: true }),
|
||||||
equipee: new fields.BooleanField({ initial: false })
|
equipee: new fields.BooleanField({ initial: false })
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
MANIFEST-000077
|
MANIFEST-000165
|
||||||
|
|||||||
+7
-7
@@ -1,7 +1,7 @@
|
|||||||
2026/05/09-23:26:00.662378 7fe6d3fff6c0 Recovering log #75
|
2026/05/28-20:45:21.096499 7f3977fff6c0 Recovering log #163
|
||||||
2026/05/09-23:26:00.714642 7fe6d3fff6c0 Delete type=3 #73
|
2026/05/28-20:45:21.107112 7f3977fff6c0 Delete type=3 #161
|
||||||
2026/05/09-23:26:00.714705 7fe6d3fff6c0 Delete type=0 #75
|
2026/05/28-20:45:21.107149 7f3977fff6c0 Delete type=0 #163
|
||||||
2026/05/09-23:32:35.906147 7fe6d37fe6c0 Level-0 table #80: started
|
2026/05/28-20:46:40.064748 7f39767fc6c0 Level-0 table #168: started
|
||||||
2026/05/09-23:32:35.906185 7fe6d37fe6c0 Level-0 table #80: 0 bytes OK
|
2026/05/28-20:46:40.064805 7f39767fc6c0 Level-0 table #168: 0 bytes OK
|
||||||
2026/05/09-23:32:35.912511 7fe6d37fe6c0 Delete type=0 #78
|
2026/05/28-20:46:40.070966 7f39767fc6c0 Delete type=0 #166
|
||||||
2026/05/09-23:32:35.920264 7fe6d37fe6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
2026/05/28-20:46:40.093671 7f39767fc6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2026/05/09-23:24:27.244461 7fe6d3fff6c0 Recovering log #71
|
2026/05/27-07:43:05.019282 7f3ebcffe6c0 Recovering log #160
|
||||||
2026/05/09-23:24:27.261516 7fe6d3fff6c0 Delete type=3 #69
|
2026/05/27-07:43:05.053650 7f3ebcffe6c0 Delete type=0 #160
|
||||||
2026/05/09-23:24:27.261564 7fe6d3fff6c0 Delete type=0 #71
|
2026/05/27-07:43:05.053700 7f3ebcffe6c0 Delete type=3 #159
|
||||||
2026/05/09-23:25:01.848661 7fe6d37fe6c0 Level-0 table #76: started
|
2026/05/27-12:02:21.293983 7f3e6effd6c0 Level-0 table #164: started
|
||||||
2026/05/09-23:25:01.848715 7fe6d37fe6c0 Level-0 table #76: 0 bytes OK
|
2026/05/27-12:02:21.294005 7f3e6effd6c0 Level-0 table #164: 0 bytes OK
|
||||||
2026/05/09-23:25:01.854909 7fe6d37fe6c0 Delete type=0 #74
|
2026/05/27-12:02:21.299943 7f3e6effd6c0 Delete type=0 #162
|
||||||
2026/05/09-23:25:01.877929 7fe6d37fe6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
2026/05/27-12:02:21.306619 7f3e6effd6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000064
|
MANIFEST-000152
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2026/05/09-23:26:00.734399 7fe7211fe6c0 Recovering log #62
|
2026/05/28-20:45:21.112773 7f3976ffd6c0 Recovering log #150
|
||||||
2026/05/09-23:26:00.785619 7fe7211fe6c0 Delete type=3 #60
|
2026/05/28-20:45:21.122136 7f3976ffd6c0 Delete type=3 #148
|
||||||
2026/05/09-23:26:00.785680 7fe7211fe6c0 Delete type=0 #62
|
2026/05/28-20:45:21.122181 7f3976ffd6c0 Delete type=0 #150
|
||||||
2026/05/09-23:32:35.893861 7fe6d37fe6c0 Level-0 table #67: started
|
2026/05/28-20:46:40.081166 7f39767fc6c0 Level-0 table #155: started
|
||||||
2026/05/09-23:32:35.893901 7fe6d37fe6c0 Level-0 table #67: 0 bytes OK
|
2026/05/28-20:46:40.081191 7f39767fc6c0 Level-0 table #155: 0 bytes OK
|
||||||
2026/05/09-23:32:35.899905 7fe6d37fe6c0 Delete type=0 #65
|
2026/05/28-20:46:40.087200 7f39767fc6c0 Delete type=0 #153
|
||||||
2026/05/09-23:32:35.920244 7fe6d37fe6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
|
2026/05/28-20:46:40.093692 7f39767fc6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
2026/05/09-23:24:27.266509 7fe7211fe6c0 Recovering log #58
|
2026/05/27-07:43:05.067367 7f3e6ffff6c0 Recovering log #147
|
||||||
2026/05/09-23:24:27.282592 7fe7211fe6c0 Delete type=3 #56
|
2026/05/27-07:43:05.105287 7f3e6ffff6c0 Delete type=0 #147
|
||||||
2026/05/09-23:24:27.282660 7fe7211fe6c0 Delete type=0 #58
|
2026/05/27-07:43:05.105329 7f3e6ffff6c0 Delete type=3 #146
|
||||||
2026/05/09-23:25:01.864644 7fe6d37fe6c0 Level-0 table #63: started
|
2026/05/27-12:02:21.300011 7f3e6effd6c0 Level-0 table #151: started
|
||||||
2026/05/09-23:25:01.864678 7fe6d37fe6c0 Level-0 table #63: 0 bytes OK
|
2026/05/27-12:02:21.300030 7f3e6effd6c0 Level-0 table #151: 0 bytes OK
|
||||||
2026/05/09-23:25:01.871922 7fe6d37fe6c0 Delete type=0 #61
|
2026/05/27-12:02:21.306452 7f3e6effd6c0 Delete type=0 #149
|
||||||
2026/05/09-23:25:01.877952 7fe6d37fe6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
|
2026/05/27-12:02:21.306630 7f3e6effd6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
|||||||
MANIFEST-000002
|
MANIFEST-000087
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
2026/05/09-23:29:14.636398 7f54217ed6c0 Delete type=3 #1
|
2026/05/28-20:45:21.125760 7f39777fe6c0 Recovering log #85
|
||||||
2026/05/09-23:29:14.638741 7f5403fff6c0 Level-0 table #5: started
|
2026/05/28-20:45:21.135844 7f39777fe6c0 Delete type=3 #83
|
||||||
2026/05/09-23:29:14.666649 7f5403fff6c0 Level-0 table #5: 3056 bytes OK
|
2026/05/28-20:45:21.135894 7f39777fe6c0 Delete type=0 #85
|
||||||
2026/05/09-23:29:14.731617 7f5403fff6c0 Delete type=0 #3
|
2026/05/28-20:46:40.071060 7f39767fc6c0 Level-0 table #90: started
|
||||||
2026/05/09-23:29:14.731832 7f5403fff6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
2026/05/28-20:46:40.071086 7f39767fc6c0 Level-0 table #90: 0 bytes OK
|
||||||
|
2026/05/28-20:46:40.081072 7f39767fc6c0 Delete type=0 #88
|
||||||
|
2026/05/28-20:46:40.093682 7f39767fc6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||||
|
2026/05/28-20:46:40.093703 7f39767fc6c0 Manual compaction at level-1 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
2026/05/27-07:43:05.111469 7f3ebd7ff6c0 Recovering log #82
|
||||||
|
2026/05/27-07:43:05.152415 7f3ebd7ff6c0 Delete type=0 #82
|
||||||
|
2026/05/27-07:43:05.152455 7f3ebd7ff6c0 Delete type=3 #81
|
||||||
|
2026/05/27-12:02:21.287508 7f3e6effd6c0 Level-0 table #86: started
|
||||||
|
2026/05/27-12:02:21.287536 7f3e6effd6c0 Level-0 table #86: 0 bytes OK
|
||||||
|
2026/05/27-12:02:21.293897 7f3e6effd6c0 Delete type=0 #84
|
||||||
|
2026/05/27-12:02:21.306608 7f3e6effd6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||||
|
2026/05/27-12:02:21.319818 7f3e6effd6c0 Manual compaction at level-1 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||||
Binary file not shown.
@@ -93,7 +93,8 @@
|
|||||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
||||||
{{#if this.system.degats}}<p>Degats : {{this.system.degats}}</p>{{/if}}
|
{{#if this.damageLabel}}<p>Degats : {{this.damageLabel}}</p>{{/if}}
|
||||||
|
{{#if this.ammunitionUsageLabel}}<p>Munitions : {{this.ammunitionUsageLabel}}</p>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
{{#if this.canRoll}}
|
{{#if this.canRoll}}
|
||||||
@@ -138,7 +139,8 @@
|
|||||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
||||||
{{#if this.system.degats}}<p>Degats : {{this.system.degats}}</p>{{/if}}
|
{{#if this.damageLabel}}<p>Degats : {{this.damageLabel}}</p>{{/if}}
|
||||||
|
{{#if this.ammunitionUsageLabel}}<p>Munitions : {{this.ammunitionUsageLabel}}</p>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
{{#if this.canRoll}}
|
{{#if this.canRoll}}
|
||||||
@@ -234,7 +236,8 @@
|
|||||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
||||||
{{#if this.system.degats}}<p>Degats : {{this.system.degats}}</p>{{/if}}
|
{{#if this.damageLabel}}<p>Degats : {{this.damageLabel}}</p>{{/if}}
|
||||||
|
{{#if this.ammunitionUsageLabel}}<p>Munitions : {{this.ammunitionUsageLabel}}</p>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
{{#if this.canRoll}}
|
{{#if this.canRoll}}
|
||||||
@@ -278,7 +281,8 @@
|
|||||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
||||||
{{#if this.system.degats}}<p>Degats : {{this.system.degats}}</p>{{/if}}
|
{{#if this.damageLabel}}<p>Degats : {{this.damageLabel}}</p>{{/if}}
|
||||||
|
{{#if this.ammunitionUsageLabel}}<p>Munitions : {{this.ammunitionUsageLabel}}</p>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
{{#if this.canRoll}}
|
{{#if this.canRoll}}
|
||||||
@@ -395,7 +399,8 @@
|
|||||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
||||||
{{#if this.system.degats}}<p>Degats : {{this.system.degats}}</p>{{/if}}
|
{{#if this.damageLabel}}<p>Degats : {{this.damageLabel}}</p>{{/if}}
|
||||||
|
{{#if this.ammunitionUsageLabel}}<p>Munitions : {{this.ammunitionUsageLabel}}</p>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
{{#if this.canRoll}}
|
{{#if this.canRoll}}
|
||||||
|
|||||||
@@ -122,7 +122,8 @@
|
|||||||
{{#if this.usageLabel}}<span class="item-meta">{{this.usageLabel}}</span>{{/if}}
|
{{#if this.usageLabel}}<span class="item-meta">{{this.usageLabel}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
{{#if this.system.effet}}<p>{{this.system.effet}}</p>{{/if}}
|
||||||
{{#if this.system.degats}}<p>Degats : {{this.system.degats}}</p>{{/if}}
|
{{#if this.damageLabel}}<p>Degats : {{this.damageLabel}}</p>{{/if}}
|
||||||
|
{{#if this.ammunitionUsageLabel}}<p>Munitions : {{this.ammunitionUsageLabel}}</p>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="item-actions">
|
<div class="item-actions">
|
||||||
{{#if this.canRoll}}
|
{{#if this.canRoll}}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<div class="chat-pill-row">
|
<div class="chat-pill-row">
|
||||||
{{#if modeLabel}}<span class="chat-pill">{{modeLabel}}</span>{{/if}}
|
{{#if modeLabel}}<span class="chat-pill">{{modeLabel}}</span>{{/if}}
|
||||||
<span class="chat-pill success">Dé {{keptDieLabel}}</span>
|
<span class="chat-pill success">Dé {{keptDieLabel}}</span>
|
||||||
|
{{#if damageCapped}}<span class="chat-pill">{{localize "DNC.Chat.DamageCapped" damage=effectiveDamage dv=martialDvLabel}}</span>{{/if}}
|
||||||
{{#if bonus}}<span class="chat-pill">Bonus +{{bonus}}</span>{{/if}}
|
{{#if bonus}}<span class="chat-pill">Bonus +{{bonus}}</span>{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<p class="chat-formula">{{formula}}</p>
|
<p class="chat-formula">{{formula}}</p>
|
||||||
@@ -22,14 +23,14 @@
|
|||||||
<p class="roll-values">{{#each rollDieLabels}}<span>{{this}}</span>{{/each}}</p>
|
<p class="roll-values">{{#each rollDieLabels}}<span>{{this}}</span>{{/each}}</p>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<p class="chat-note"><strong>Base</strong> : {{baseDamage}}{{#if bonus}} · <strong>Bonus</strong> : +{{bonus}}{{/if}}</p>
|
<p class="chat-note"><strong>Base</strong> : {{baseDamage}}{{#if damageCapped}} · <strong>{{localize "DNC.Chat.MartialDv"}}</strong> : {{martialDvLabel}} · <strong>{{localize "DNC.Chat.EffectiveDamage"}}</strong> : {{effectiveDamage}}{{/if}}{{#if bonus}} · <strong>Bonus</strong> : +{{bonus}}{{/if}}</p>
|
||||||
<div class="chat-targeting">
|
<div class="chat-targeting">
|
||||||
<label class="chat-control">
|
<label class="chat-control">
|
||||||
<span class="chat-keyline-label">Cible</span>
|
<span class="chat-keyline-label">Cible</span>
|
||||||
<select class="chat-select" data-role="damage-target" {{#unless hasTargets}}disabled{{/unless}}>
|
<select class="chat-select" data-role="damage-target" {{#unless hasTargets}}disabled{{/unless}}>
|
||||||
{{#if hasTargets}}
|
{{#if hasTargets}}
|
||||||
{{#each targets}}
|
{{#each targets}}
|
||||||
<option value="{{this.tokenUuid}}">{{this.label}}</option>
|
<option value="{{this.tokenUuid}}"{{#if this.isSelected}} selected{{/if}}>{{this.label}}</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<option value="">Aucune cible sur la scène</option>
|
<option value="">Aucune cible sur la scène</option>
|
||||||
@@ -45,4 +46,11 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{{#if showDamageUsageButton}}
|
||||||
|
<div class="chat-actions">
|
||||||
|
<button type="button" class="chat-action-button" data-action="rollDamageUsage" data-item-uuid="{{itemUuid}}">
|
||||||
|
<i class="fa-solid fa-hourglass-half"></i> {{localize "DNC.Chat.RollDamageUsage"}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -28,7 +28,20 @@
|
|||||||
<button type="button" class="chat-action-button" data-action="rollChatDamage" data-item-uuid="{{itemUuid}}">
|
<button type="button" class="chat-action-button" data-action="rollChatDamage" data-item-uuid="{{itemUuid}}">
|
||||||
<i class="fa-solid fa-burst"></i> {{localize "DNC.Chat.RollDamage"}}
|
<i class="fa-solid fa-burst"></i> {{localize "DNC.Chat.RollDamage"}}
|
||||||
</button>
|
</button>
|
||||||
|
{{#if showAmmoButton}}
|
||||||
|
<button type="button" class="chat-action-button" data-action="rollAmmoUsage" data-item-uuid="{{itemUuid}}">
|
||||||
|
<i class="fa-solid fa-bullseye"></i> {{localize "DNC.Chat.RollAmmunition"}}
|
||||||
|
</button>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
{{else}}
|
||||||
|
{{#if showAmmoButton}}
|
||||||
|
<div class="chat-actions">
|
||||||
|
<button type="button" class="chat-action-button" data-action="rollAmmoUsage" data-item-uuid="{{itemUuid}}">
|
||||||
|
<i class="fa-solid fa-bullseye"></i> {{localize "DNC.Chat.RollAmmunition"}}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<ul class="chat-details chat-details-ornate">
|
<ul class="chat-details chat-details-ornate">
|
||||||
{{#each details}}
|
{{#each details}}
|
||||||
|
|||||||
@@ -21,6 +21,14 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if protectionStored}}<p class="chat-note">{{localize "DNC.Chat.StoredProtection"}} : <strong>{{protectionStored}}</strong>.</p>{{/if}}
|
{{#if protectionStored}}<p class="chat-note">{{localize "DNC.Chat.StoredProtection"}} : <strong>{{protectionStored}}</strong>.</p>{{/if}}
|
||||||
{{#if degraded}}<p class="chat-note">{{localize "DNC.Chat.ResourceWearsDown"}}</p>{{else}}<p class="chat-note">{{localize "DNC.Chat.ResourceStable"}}</p>{{/if}}
|
{{#if isAmmunition}}
|
||||||
{{#if exhausted}}<p class="warning">{{localize "DNC.Chat.ResourceExhausted"}}</p>{{/if}}
|
{{#if degraded}}<p class="chat-note">{{localize "DNC.Chat.AmmunitionWearsDown"}}</p>{{else}}<p class="chat-note">{{localize "DNC.Chat.AmmunitionStable"}}</p>{{/if}}
|
||||||
|
{{#if exhausted}}<p class="warning">{{localize "DNC.Chat.AmmunitionExhausted"}}</p>{{/if}}
|
||||||
|
{{else if isDamageUsage}}
|
||||||
|
{{#if degraded}}<p class="chat-note">{{localize "DNC.Chat.DamageUsageWearsDown"}}</p>{{else}}<p class="chat-note">{{localize "DNC.Chat.DamageUsageStable"}}</p>{{/if}}
|
||||||
|
{{#if exhausted}}<p class="warning">{{localize "DNC.Chat.DamageUsageExhausted"}}</p>{{/if}}
|
||||||
|
{{else}}
|
||||||
|
{{#if degraded}}<p class="chat-note">{{localize "DNC.Chat.ResourceWearsDown"}}</p>{{else}}<p class="chat-note">{{localize "DNC.Chat.ResourceStable"}}</p>{{/if}}
|
||||||
|
{{#if exhausted}}<p class="warning">{{localize "DNC.Chat.ResourceExhausted"}}</p>{{/if}}
|
||||||
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
<div class="dnc-dialog-form">
|
<div class="dnc-dialog-form">
|
||||||
<p><strong>{{item.name}}</strong> inflige <strong>{{item.system.degats}}</strong>.</p>
|
<p><strong>{{item.name}}</strong> inflige <strong>{{damageFormula}}</strong>.</p>
|
||||||
|
{{#if damageCapped}}
|
||||||
|
<p>{{localize "DNC.Dialog.DamageCappedByDv" dv=martialDvLabel damage=damageFormula base=damageBase}}</p>
|
||||||
|
{{/if}}
|
||||||
<p>{{localize "DNC.Dialog.ActorDamageBonus"}} : <strong>{{actorBonus}}</strong></p>
|
<p>{{localize "DNC.Dialog.ActorDamageBonus"}} : <strong>{{actorBonus}}</strong></p>
|
||||||
<label>
|
<label>
|
||||||
<span>{{localize "DNC.UI.Mode"}}</span>
|
<span>{{localize "DNC.UI.Mode"}}</span>
|
||||||
|
|||||||
@@ -19,8 +19,23 @@
|
|||||||
<p>{{weaponCharacteristicLabel}}</p>
|
<p>{{weaponCharacteristicLabel}}</p>
|
||||||
</div>
|
</div>
|
||||||
<label>
|
<label>
|
||||||
<span>Degats</span>
|
<span>Degats usage die (Δ)</span>
|
||||||
<input type="text" name="system.degats" value="{{system.degats}}">
|
<input type="checkbox" name="system.degatsEstUsageDe" {{checked system.degatsEstUsageDe}}>
|
||||||
|
</label>
|
||||||
|
{{#if system.degatsEstUsageDe}}
|
||||||
|
<label>
|
||||||
|
<span>Δ Degats courant</span>
|
||||||
|
<select name="system.degatsDelta">{{selectOptions config.usageDieOptions selected=system.degatsDelta localize=false blank="Epuise"}}</select>
|
||||||
|
</label>
|
||||||
|
{{else}}
|
||||||
|
<label>
|
||||||
|
<span>Degats</span>
|
||||||
|
<input type="text" name="system.degats" value="{{system.degats}}">
|
||||||
|
</label>
|
||||||
|
{{/if}}
|
||||||
|
<label>
|
||||||
|
<span>Munitions</span>
|
||||||
|
<select name="system.munitionsDelta">{{selectOptions config.usageDieOptions selected=system.munitionsDelta localize=false blank="Aucune"}}</select>
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<span>Portee</span>
|
<span>Portee</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user