Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6742830f40 | |||
| 09f2349bab | |||
| d8eb23289e | |||
| 820a7d61cf |
+19
-1
@@ -12,6 +12,7 @@
|
||||
"TYPES.Item.entrainement": "Entrainement",
|
||||
"DNC.Roll.Characteristic": "Jet de caracteristique",
|
||||
"DNC.Roll.Attack": "Jet d'attaque",
|
||||
"DNC.Roll.Ammunition": "Munitions",
|
||||
"DNC.Roll.Damage": "Jet de degats",
|
||||
"DNC.Roll.Favor": "Faveur",
|
||||
"DNC.Roll.HitDice": "Jet de de de vie",
|
||||
@@ -37,6 +38,8 @@
|
||||
"DNC.Chat.Kept": "Garde",
|
||||
"DNC.Chat.Rolls": "Lancers",
|
||||
"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.AutoDisadvantage": "Desavantage automatique",
|
||||
"DNC.Chat.RiskChaos": "Risquer le Chaos",
|
||||
@@ -56,11 +59,16 @@
|
||||
"DNC.Chat.HpRemaining": "PV restants",
|
||||
"DNC.Chat.CasterRank": "Rang du lanceur",
|
||||
"DNC.Chat.Difficulty": "Difficulte",
|
||||
"DNC.Chat.MartialDv": "DV martial",
|
||||
"DNC.Chat.EffectiveDamage": "Degats retenus",
|
||||
"DNC.Chat.Effect": "Effet",
|
||||
"DNC.Chat.StoredProtection": "Protection stockee pour ce combat",
|
||||
"DNC.Chat.ResourceWearsDown": "La ressource s'amenuise.",
|
||||
"DNC.Chat.ResourceStable": "La ressource tient bon.",
|
||||
"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.AutoDisadvantageApplies": "le cout du sort depasse le rang du lanceur.",
|
||||
"DNC.Chat.FocusFrom": "depuis",
|
||||
@@ -89,6 +97,7 @@
|
||||
"DNC.UI.Focus": "Focus",
|
||||
"DNC.UI.Chaos": "Chaos",
|
||||
"DNC.UI.Weapon": "Arme",
|
||||
"DNC.UI.Ammunition": "Munitions",
|
||||
"DNC.UI.Damage": "Degats",
|
||||
"DNC.UI.Range": "Portee",
|
||||
"DNC.UI.Spell": "Sortilege",
|
||||
@@ -96,10 +105,12 @@
|
||||
"DNC.Dialog.InitiativeCurrent": "DEX actuelle : <strong>{dex}</strong>, bonus de fiche : <strong>{initiativeBonus}</strong>",
|
||||
"DNC.Dialog.CharacteristicUsed": "Caracteristique utilisee",
|
||||
"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.UseUsageDie": "Utiliser <strong>{itemName}</strong> et lancer son de d'usage actuel.",
|
||||
"DNC.Dialog.CurrentValue": "Valeur actuelle",
|
||||
"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.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.",
|
||||
@@ -187,5 +198,12 @@
|
||||
"DNC.Sheet.Create": "Creer",
|
||||
"DNC.Sheet.Delete": "Supprimer",
|
||||
"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."
|
||||
}
|
||||
|
||||
+16
-5
@@ -135,12 +135,18 @@
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.dnc-employe-sheet .sheet-header.compact .hp-field {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.dnc-employe-sheet .sheet-header.compact input[type="number"] {
|
||||
max-width: 4.75rem;
|
||||
}
|
||||
|
||||
.dnc-employe-sheet .sheet-header.compact .counter-field input[type="number"] {
|
||||
max-width: 4rem;
|
||||
.dnc-employe-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.value"],
|
||||
.dnc-employe-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.max"] {
|
||||
width: 5.25rem;
|
||||
max-width: 5.25rem;
|
||||
}
|
||||
|
||||
.dnc-pnj-sheet .sheet-header.compact .identity-grid {
|
||||
@@ -152,14 +158,19 @@
|
||||
gap: 0.25rem;
|
||||
}
|
||||
|
||||
.dnc-pnj-sheet .sheet-header.compact .hp-field {
|
||||
grid-column: span 2;
|
||||
}
|
||||
|
||||
.dnc-pnj-sheet .sheet-header.compact input[type="number"] {
|
||||
width: 4.5rem;
|
||||
max-width: 4.5rem;
|
||||
}
|
||||
|
||||
.dnc-pnj-sheet .sheet-header.compact .counter-field input[type="number"] {
|
||||
width: 3.75rem;
|
||||
max-width: 3.75rem;
|
||||
.dnc-pnj-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.value"],
|
||||
.dnc-pnj-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.max"] {
|
||||
width: 5.25rem;
|
||||
max-width: 5.25rem;
|
||||
}
|
||||
|
||||
.dnc-sheet label {
|
||||
|
||||
@@ -201,12 +201,17 @@ export class DonjonEtCieRollDialog {
|
||||
}
|
||||
|
||||
static async createDamage(actor, item) {
|
||||
const damageContext = DonjonEtCieUtility.getMartialDamageContext(actor, item);
|
||||
const content = await foundry.applications.handlebars.renderTemplate(
|
||||
"systems/fvtt-donjon-et-cie/templates/dialogs/damage-roll.hbs",
|
||||
{
|
||||
actorName: actor?.name ?? item.actor?.name ?? "",
|
||||
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",
|
||||
isLanguage: item.type === "langue",
|
||||
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),
|
||||
armorProtectionDisplay: Number(item.system.resultatProtection ?? 0) > 0 ? item.system.resultatProtection : "—",
|
||||
weaponCharacteristicLabel: item.type === "arme" ? DonjonEtCieUtility.getWeaponCharacteristicLabel(item.system.categorie) : null,
|
||||
|
||||
@@ -29,6 +29,19 @@ export class DonjonEtCieActor extends Actor {
|
||||
}
|
||||
}
|
||||
|
||||
async _preUpdate(changed, options, user) {
|
||||
if (
|
||||
foundry.utils.hasProperty(changed, "system.magie.focus.delta")
|
||||
&& !foundry.utils.hasProperty(changed, "system.magie.focus.resultat")
|
||||
&& !foundry.utils.hasProperty(changed, "system.magie.focus.sceneId")
|
||||
) {
|
||||
foundry.utils.setProperty(changed, "system.magie.focus.resultat", 0);
|
||||
foundry.utils.setProperty(changed, "system.magie.focus.sceneId", "");
|
||||
}
|
||||
|
||||
return super._preUpdate(changed, options, user);
|
||||
}
|
||||
|
||||
getCharacteristicEntries() {
|
||||
return DonjonEtCieUtility.getCharacteristicEntries(this.system);
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -46,7 +46,7 @@ function injectActorDirectoryMissionPackButton(app, element) {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
event.preventDefault();
|
||||
@@ -85,6 +85,12 @@ function onChatActionClick(event) {
|
||||
const itemUuid = button.dataset.itemUuid;
|
||||
if (!itemUuid) return;
|
||||
const item = await fromUuid(itemUuid);
|
||||
if (button.dataset.action === "rollAmmoUsage") {
|
||||
return item?.rollAmmoUsage?.();
|
||||
}
|
||||
if (button.dataset.action === "rollDamageUsage") {
|
||||
return item?.rollDamageUsage?.();
|
||||
}
|
||||
return item?.rollDamage?.();
|
||||
})();
|
||||
}
|
||||
|
||||
@@ -308,12 +308,14 @@ export class DonjonEtCieRolls {
|
||||
favorLabel: favor?.label ?? null,
|
||||
favorNote: favor?.note ?? null,
|
||||
showDamageButton: result.success && Boolean(item.system.degats),
|
||||
showAmmoButton: Number(item.system.munitionsDelta ?? 0) > 0,
|
||||
itemUuid: item.uuid,
|
||||
details: [
|
||||
{ label: game.i18n.localize("DNC.UI.Weapon"), value: item.name },
|
||||
{ label: game.i18n.localize("DNC.UI.Characteristic"), value: characteristicLabel },
|
||||
{ label: `Valeur de ${characteristicLabel}`, value: result.target },
|
||||
{ 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 || "—" },
|
||||
...(favor ? [
|
||||
{ label: game.i18n.localize("DNC.Chat.Favor"), value: favor.label },
|
||||
@@ -327,11 +329,54 @@ export class DonjonEtCieRolls {
|
||||
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" } = {}) {
|
||||
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 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 targets = DonjonEtCieUtility.getSceneDamageTargets();
|
||||
const rollDieLabels = result.rolls.map((roll) => {
|
||||
@@ -339,6 +384,7 @@ export class DonjonEtCieRolls {
|
||||
return dieValues.length ? dieValues.join(" + ") : String(roll.total ?? "—");
|
||||
});
|
||||
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", {
|
||||
title: `${game.i18n.localize("DNC.Roll.Damage")} : ${item.name}`,
|
||||
@@ -351,13 +397,60 @@ export class DonjonEtCieRolls {
|
||||
values: result.values,
|
||||
total: result.kept,
|
||||
bonus: totalBonus,
|
||||
baseDamage: item.system.degats,
|
||||
baseDamage: baseDamageDisplay,
|
||||
effectiveDamage,
|
||||
damageCapped: damageContext.capped,
|
||||
martialDvLabel: damageContext.martialDvSides ? `d${damageContext.martialDvSides}` : damageContext.martialDvFormula,
|
||||
sourceLabel: item.name,
|
||||
targets,
|
||||
hasTargets: targets.length > 0
|
||||
hasTargets: targets.length > 0,
|
||||
showDamageUsageButton: isUsageDie && degatsDelta > 0,
|
||||
itemUuid: item.uuid
|
||||
}, { 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 = "" } = {}) {
|
||||
@@ -393,6 +486,7 @@ export class DonjonEtCieRolls {
|
||||
static async rollSpell(actor, item, { mode = "normal", favorKey = "" } = {}) {
|
||||
const characteristicKey = item.system.caracteristique || "intelligence";
|
||||
const focus = await this.#ensureFocus(actor);
|
||||
const currentSceneId = DonjonEtCieUtility.getCurrentSceneId();
|
||||
const rank = Number(actor.system.anciennete?.rang ?? actor.system.sante?.dv ?? 0);
|
||||
const cost = Number(item.system.coutPv ?? 0);
|
||||
const autoDisadvantage = cost > rank;
|
||||
@@ -403,8 +497,13 @@ export class DonjonEtCieRolls {
|
||||
|
||||
if (!result) return null;
|
||||
|
||||
const currentPv = Number(actor.system.sante?.pv?.value ?? 0);
|
||||
const availableMagicHp = currentPv + focus.activeValue;
|
||||
const liveActor = game.actors.get(actor.id) ?? actor;
|
||||
const currentPv = Number(liveActor.system.sante?.pv?.value ?? 0);
|
||||
const currentFocusSceneId = liveActor.system.magie?.focus?.sceneId ?? "";
|
||||
const currentFocusValue = currentFocusSceneId === currentSceneId
|
||||
? Number(liveActor.system.magie?.focus?.resultat ?? 0)
|
||||
: 0;
|
||||
const availableMagicHp = currentPv + currentFocusValue;
|
||||
|
||||
if (cost > availableMagicHp) {
|
||||
ui.notifications.warn(game.i18n.localize("DNC.Warn.SpellInsufficientResources"));
|
||||
@@ -413,8 +512,8 @@ export class DonjonEtCieRolls {
|
||||
|
||||
const characteristicShort = DONJON_ET_CIE.characteristics[characteristicKey]?.short ?? characteristicKey;
|
||||
const success = result.isNaturalTwenty ? false : result.success;
|
||||
const focusSpent = result.isNaturalOne ? 0 : Math.min(cost, focus.activeValue);
|
||||
const focusRemaining = Math.max(focus.activeValue - focusSpent, 0);
|
||||
const focusSpent = result.isNaturalOne ? 0 : Math.min(cost, currentFocusValue);
|
||||
const focusRemaining = Math.max(currentFocusValue - focusSpent, 0);
|
||||
const spentPv = result.isNaturalOne ? 0 : Math.max(cost - focusSpent, 0);
|
||||
const remainingPv = Math.max(currentPv - spentPv, 0);
|
||||
const updateData = {};
|
||||
|
||||
@@ -119,6 +119,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) {
|
||||
return DONJON_ET_CIE.favorDepartments[key] ?? key;
|
||||
}
|
||||
@@ -173,12 +254,20 @@ export class DonjonEtCieUtility {
|
||||
const system = item.system;
|
||||
const delta = Number(system.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
|
||||
? `${this.formatUsageDie(delta)} / ${this.formatUsageDie(deltaMax)}`
|
||||
: delta > 0
|
||||
? this.formatUsageDie(delta)
|
||||
: null;
|
||||
|
||||
const damageUsageLabel = isUsageDie
|
||||
? (degatsDelta > 0 ? this.formatUsageDie(degatsDelta) : game.i18n.localize("DNC.UI.DamageExhausted"))
|
||||
: null;
|
||||
const damageLabel = isUsageDie ? damageUsageLabel : (system.degats || null);
|
||||
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
@@ -187,11 +276,15 @@ export class DonjonEtCieUtility {
|
||||
system,
|
||||
uuid: item.uuid,
|
||||
usageLabel,
|
||||
ammunitionUsageLabel: item.type === "arme" && ammunitionDelta > 0 ? this.formatUsageDie(ammunitionDelta) : null,
|
||||
protectionLabel: item.type === "armure" && Number(system.resultatProtection ?? 0) > 0 ? `Protection ${system.resultatProtection}` : null,
|
||||
weaponCharacteristicLabel: item.type === "arme" ? this.getWeaponCharacteristicLabel(system.categorie) : null,
|
||||
canRoll: ["arme", "sortilege"].includes(item.type),
|
||||
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",
|
||||
damageAction: "rollDamage",
|
||||
isEquipped: Boolean(system.equipee),
|
||||
|
||||
@@ -20,6 +20,9 @@ export default class ArmeDataModel extends BaseItemDataModel {
|
||||
categorie: new fields.StringField({ initial: "melee" }),
|
||||
caracteristique: new fields.StringField({ initial: "force" }),
|
||||
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: "" }),
|
||||
mains: new fields.NumberField({ initial: 1, integer: true }),
|
||||
equipee: new fields.BooleanField({ initial: false })
|
||||
|
||||
@@ -1 +1 @@
|
||||
MANIFEST-000069
|
||||
MANIFEST-000085
|
||||
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
2026/05/03-21:07:42.001613 7f8452bfd6c0 Recovering log #67
|
||||
2026/05/03-21:07:42.055968 7f8452bfd6c0 Delete type=3 #65
|
||||
2026/05/03-21:07:42.056020 7f8452bfd6c0 Delete type=0 #67
|
||||
2026/05/03-21:51:13.488361 7f8451bfb6c0 Level-0 table #72: started
|
||||
2026/05/03-21:51:13.488402 7f8451bfb6c0 Level-0 table #72: 0 bytes OK
|
||||
2026/05/03-21:51:13.495004 7f8451bfb6c0 Delete type=0 #70
|
||||
2026/05/03-21:51:13.509020 7f8451bfb6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
||||
2026/05/22-09:28:26.005874 7fb57dfee6c0 Recovering log #83
|
||||
2026/05/22-09:28:26.015537 7fb57dfee6c0 Delete type=3 #81
|
||||
2026/05/22-09:28:26.015651 7fb57dfee6c0 Delete type=0 #83
|
||||
2026/05/22-09:49:57.296086 7fb567fff6c0 Level-0 table #88: started
|
||||
2026/05/22-09:49:57.296112 7fb567fff6c0 Level-0 table #88: 0 bytes OK
|
||||
2026/05/22-09:49:57.302010 7fb567fff6c0 Delete type=0 #86
|
||||
2026/05/22-09:49:57.319148 7fb567fff6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
2026/05/03-20:39:13.226386 7f8452bfd6c0 Recovering log #63
|
||||
2026/05/03-20:39:13.322551 7f8452bfd6c0 Delete type=3 #61
|
||||
2026/05/03-20:39:13.322644 7f8452bfd6c0 Delete type=0 #63
|
||||
2026/05/03-21:07:35.303136 7f8451bfb6c0 Level-0 table #68: started
|
||||
2026/05/03-21:07:35.303190 7f8451bfb6c0 Level-0 table #68: 0 bytes OK
|
||||
2026/05/03-21:07:35.343678 7f8451bfb6c0 Delete type=0 #66
|
||||
2026/05/03-21:07:35.450352 7f8451bfb6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
|
||||
2026/05/09-23:56:26.228807 7fe7211fe6c0 Recovering log #79
|
||||
2026/05/09-23:56:26.239813 7fe7211fe6c0 Delete type=3 #77
|
||||
2026/05/09-23:56:26.239859 7fe7211fe6c0 Delete type=0 #79
|
||||
2026/05/09-23:58:32.093072 7fe6d37fe6c0 Level-0 table #84: started
|
||||
2026/05/09-23:58:32.093102 7fe6d37fe6c0 Level-0 table #84: 0 bytes OK
|
||||
2026/05/09-23:58:32.100189 7fe6d37fe6c0 Delete type=0 #82
|
||||
2026/05/09-23:58:32.106644 7fe6d37fe6c0 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-000056
|
||||
MANIFEST-000072
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
2026/05/03-21:07:42.063619 7f84523fc6c0 Recovering log #54
|
||||
2026/05/03-21:07:42.117857 7f84523fc6c0 Delete type=3 #52
|
||||
2026/05/03-21:07:42.117936 7f84523fc6c0 Delete type=0 #54
|
||||
2026/05/03-21:51:13.495113 7f8451bfb6c0 Level-0 table #59: started
|
||||
2026/05/03-21:51:13.495141 7f8451bfb6c0 Level-0 table #59: 0 bytes OK
|
||||
2026/05/03-21:51:13.501454 7f8451bfb6c0 Delete type=0 #57
|
||||
2026/05/03-21:51:13.509034 7f8451bfb6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
|
||||
2026/05/22-09:28:26.020644 7fb57d7ed6c0 Recovering log #70
|
||||
2026/05/22-09:28:26.031504 7fb57d7ed6c0 Delete type=3 #68
|
||||
2026/05/22-09:28:26.031624 7fb57d7ed6c0 Delete type=0 #70
|
||||
2026/05/22-09:49:57.312571 7fb567fff6c0 Level-0 table #75: started
|
||||
2026/05/22-09:49:57.312612 7fb567fff6c0 Level-0 table #75: 0 bytes OK
|
||||
2026/05/22-09:49:57.318950 7fb567fff6c0 Delete type=0 #73
|
||||
2026/05/22-09:49:57.319188 7fb567fff6c0 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/03-20:39:13.341074 7f84533fe6c0 Recovering log #50
|
||||
2026/05/03-20:39:13.422540 7f84533fe6c0 Delete type=3 #48
|
||||
2026/05/03-20:39:13.422627 7f84533fe6c0 Delete type=0 #50
|
||||
2026/05/03-21:07:35.413322 7f8451bfb6c0 Level-0 table #55: started
|
||||
2026/05/03-21:07:35.413362 7f8451bfb6c0 Level-0 table #55: 0 bytes OK
|
||||
2026/05/03-21:07:35.450232 7f8451bfb6c0 Delete type=0 #53
|
||||
2026/05/03-21:07:35.450384 7f8451bfb6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
|
||||
2026/05/09-23:56:26.242643 7fe7219ff6c0 Recovering log #66
|
||||
2026/05/09-23:56:26.252924 7fe7219ff6c0 Delete type=3 #64
|
||||
2026/05/09-23:56:26.252971 7fe7219ff6c0 Delete type=0 #66
|
||||
2026/05/09-23:58:32.087004 7fe6d37fe6c0 Level-0 table #71: started
|
||||
2026/05/09-23:58:32.087037 7fe6d37fe6c0 Level-0 table #71: 0 bytes OK
|
||||
2026/05/09-23:58:32.092951 7fe6d37fe6c0 Delete type=0 #69
|
||||
2026/05/09-23:58:32.106635 7fe6d37fe6c0 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-000006
|
||||
|
||||
+15
-5
@@ -1,5 +1,15 @@
|
||||
2026/05/03-21:49:37.907525 7f8d8a3ff6c0 Delete type=3 #1
|
||||
2026/05/03-21:49:37.915375 7f8d6bfff6c0 Level-0 table #5: started
|
||||
2026/05/03-21:49:37.919396 7f8d6bfff6c0 Level-0 table #5: 3056 bytes OK
|
||||
2026/05/03-21:49:37.925768 7f8d6bfff6c0 Delete type=0 #3
|
||||
2026/05/03-21:49:37.926041 7f8d6bfff6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||
2026/05/22-09:28:26.037049 7fb57dfee6c0 Recovering log #4
|
||||
2026/05/22-09:28:26.047411 7fb57dfee6c0 Delete type=3 #2
|
||||
2026/05/22-09:28:26.047498 7fb57dfee6c0 Delete type=0 #4
|
||||
2026/05/22-09:49:57.302133 7fb567fff6c0 Level-0 table #9: started
|
||||
2026/05/22-09:49:57.305585 7fb567fff6c0 Level-0 table #9: 3183 bytes OK
|
||||
2026/05/22-09:49:57.312423 7fb567fff6c0 Delete type=0 #7
|
||||
2026/05/22-09:49:57.319164 7fb567fff6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||
2026/05/22-09:49:57.319233 7fb567fff6c0 Manual compaction at level-1 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 3 : 1
|
||||
2026/05/22-09:49:57.319246 7fb567fff6c0 Compacting 1@1 + 1@2 files
|
||||
2026/05/22-09:49:57.322612 7fb567fff6c0 Generated table #10@1: 2 keys, 3183 bytes
|
||||
2026/05/22-09:49:57.322655 7fb567fff6c0 Compacted 1@1 + 1@2 files => 3183 bytes
|
||||
2026/05/22-09:49:57.328541 7fb567fff6c0 compacted to: files[ 0 0 1 0 0 0 0 ]
|
||||
2026/05/22-09:49:57.328673 7fb567fff6c0 Delete type=2 #5
|
||||
2026/05/22-09:49:57.328793 7fb567fff6c0 Delete type=2 #9
|
||||
2026/05/22-09:49:57.351951 7fb567fff6c0 Manual compaction at level-1 from '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 3 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
2026/05/22-08:07:40.563282 7f63427ef6c0 Delete type=3 #1
|
||||
2026/05/22-08:07:40.567990 7f6323fff6c0 Level-0 table #5: started
|
||||
2026/05/22-08:07:40.571414 7f6323fff6c0 Level-0 table #5: 3056 bytes OK
|
||||
2026/05/22-08:07:40.577623 7f6323fff6c0 Delete type=0 #3
|
||||
2026/05/22-08:07:40.577857 7f6323fff6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
|
||||
Binary file not shown.
@@ -121,11 +121,16 @@
|
||||
.dnc-employe-sheet .sheet-header.compact label {
|
||||
gap: 0.25rem;
|
||||
}
|
||||
.dnc-employe-sheet .sheet-header.compact .hp-field {
|
||||
grid-column: span 2;
|
||||
}
|
||||
.dnc-employe-sheet .sheet-header.compact input[type="number"] {
|
||||
max-width: 4.75rem;
|
||||
}
|
||||
.dnc-employe-sheet .sheet-header.compact .counter-field input[type="number"] {
|
||||
max-width: 4rem;
|
||||
.dnc-employe-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.value"],
|
||||
.dnc-employe-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.max"] {
|
||||
width: 5.25rem;
|
||||
max-width: 5.25rem;
|
||||
}
|
||||
.dnc-pnj-sheet .sheet-header.compact .identity-grid {
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
@@ -134,13 +139,17 @@
|
||||
.dnc-pnj-sheet .sheet-header.compact label {
|
||||
gap: 0.25rem;
|
||||
}
|
||||
.dnc-pnj-sheet .sheet-header.compact .hp-field {
|
||||
grid-column: span 2;
|
||||
}
|
||||
.dnc-pnj-sheet .sheet-header.compact input[type="number"] {
|
||||
width: 4.5rem;
|
||||
max-width: 4.5rem;
|
||||
}
|
||||
.dnc-pnj-sheet .sheet-header.compact .counter-field input[type="number"] {
|
||||
width: 3.75rem;
|
||||
max-width: 3.75rem;
|
||||
.dnc-pnj-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.value"],
|
||||
.dnc-pnj-sheet .sheet-header.compact .counter-field input[name="system.sante.pv.max"] {
|
||||
width: 5.25rem;
|
||||
max-width: 5.25rem;
|
||||
}
|
||||
.dnc-sheet label {
|
||||
display: flex;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -28,7 +28,7 @@
|
||||
<button type="button" data-action="rollHitDice" aria-label="Lancer le de de vie" title="Lancer le de de vie"><i class="fa-solid fa-dice-d20"></i></button>
|
||||
</div>
|
||||
</label>
|
||||
<label class="with-controls">
|
||||
<label class="with-controls hp-field" style="grid-column: span 2;">
|
||||
<span>PV</span>
|
||||
<div class="counter-field">
|
||||
<button type="button" data-action="adjustCounter" data-path="system.sante.pv.value" data-delta="-1">-</button>
|
||||
@@ -93,7 +93,8 @@
|
||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||
</div>
|
||||
{{#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 class="item-actions">
|
||||
{{#if this.canRoll}}
|
||||
@@ -138,7 +139,8 @@
|
||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||
</div>
|
||||
{{#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 class="item-actions">
|
||||
{{#if this.canRoll}}
|
||||
@@ -234,7 +236,8 @@
|
||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||
</div>
|
||||
{{#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 class="item-actions">
|
||||
{{#if this.canRoll}}
|
||||
@@ -278,7 +281,8 @@
|
||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||
</div>
|
||||
{{#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 class="item-actions">
|
||||
{{#if this.canRoll}}
|
||||
@@ -395,7 +399,8 @@
|
||||
{{#if this.protectionLabel}}<span class="item-meta">{{this.protectionLabel}}</span>{{/if}}
|
||||
</div>
|
||||
{{#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 class="item-actions">
|
||||
{{#if this.canRoll}}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<button type="button" data-action="rollHitDice" aria-label="Lancer le de de vie" title="Lancer le de de vie"><i class="fa-solid fa-dice-d20"></i></button>
|
||||
</div>
|
||||
</label>
|
||||
<label class="with-controls">
|
||||
<label class="with-controls hp-field" style="grid-column: span 2;">
|
||||
<span>PV</span>
|
||||
<div class="counter-field">
|
||||
<button type="button" data-action="adjustCounter" data-path="system.sante.pv.value" data-delta="-1">-</button>
|
||||
@@ -122,7 +122,8 @@
|
||||
{{#if this.usageLabel}}<span class="item-meta">{{this.usageLabel}}</span>{{/if}}
|
||||
</div>
|
||||
{{#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 class="item-actions">
|
||||
{{#if this.canRoll}}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
<div class="chat-pill-row">
|
||||
{{#if modeLabel}}<span class="chat-pill">{{modeLabel}}</span>{{/if}}
|
||||
<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}}
|
||||
</div>
|
||||
<p class="chat-formula">{{formula}}</p>
|
||||
@@ -22,7 +23,7 @@
|
||||
<p class="roll-values">{{#each rollDieLabels}}<span>{{this}}</span>{{/each}}</p>
|
||||
</div>
|
||||
{{/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">
|
||||
<label class="chat-control">
|
||||
<span class="chat-keyline-label">Cible</span>
|
||||
@@ -45,4 +46,11 @@
|
||||
</button>
|
||||
</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>
|
||||
|
||||
@@ -28,7 +28,20 @@
|
||||
<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"}}
|
||||
</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>
|
||||
{{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}}
|
||||
<ul class="chat-details chat-details-ornate">
|
||||
{{#each details}}
|
||||
|
||||
@@ -21,6 +21,14 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
{{#if protectionStored}}<p class="chat-note">{{localize "DNC.Chat.StoredProtection"}} : <strong>{{protectionStored}}</strong>.</p>{{/if}}
|
||||
{{#if isAmmunition}}
|
||||
{{#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>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<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>
|
||||
<label>
|
||||
<span>{{localize "DNC.UI.Mode"}}</span>
|
||||
|
||||
@@ -18,10 +18,25 @@
|
||||
<span>Caracteristique</span>
|
||||
<p>{{weaponCharacteristicLabel}}</p>
|
||||
</div>
|
||||
<label>
|
||||
<span>Degats usage die (Δ)</span>
|
||||
<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>
|
||||
<span>Portee</span>
|
||||
<input type="text" name="system.portee" value="{{system.portee}}">
|
||||
|
||||
Reference in New Issue
Block a user