2 Commits

Author SHA1 Message Date
uberwald 0b88e53d77 Gestion degats à deux mains, suppression bonus degats inutiles
Release Creation / build (release) Successful in 1m58s
2026-06-01 08:26:01 +02:00
uberwald 2c73108f63 SUpression bonus degats, gestion armes à 2mains 2026-05-31 23:23:55 +02:00
26 changed files with 89 additions and 72 deletions
-1
View File
@@ -104,7 +104,6 @@
"DNC.Dialog.InitiativeIntro": "<strong>{actorName}</strong> lance l'initiative.",
"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.",
+9 -1
View File
@@ -225,9 +225,17 @@
.chat-targeting {
position: relative;
z-index: 1;
display: grid;
display: flex;
gap: @spacing-sm;
margin-top: @spacing-sm;
flex-wrap: wrap;
align-items: end;
.chat-action-button {
padding: 0.35rem 0.65rem;
min-height: 1.75rem;
font-size: 0.82rem;
}
}
.chat-control {
@@ -202,16 +202,18 @@ export class DonjonEtCieRollDialog {
static async createDamage(actor, item) {
const damageContext = DonjonEtCieUtility.getMartialDamageContext(actor, item);
const isMeleeTwoHanded = item.type === "arme" && item.system?.categorie === "melee" && Number(item.system?.mains ?? 1) > 1;
const defaultMode = isMeleeTwoHanded ? "avantage" : "normal";
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,
damageFormula: damageContext.effectiveFormula || item.system.degats,
damageBase: damageContext.baseFormula || item.system.degats,
damageCapped: damageContext.capped,
martialDvLabel: damageContext.martialDvSides ? `d${damageContext.martialDvSides}` : damageContext.martialDvFormula
martialDvLabel: damageContext.martialDvSides ? `d${damageContext.martialDvSides}` : damageContext.martialDvFormula,
defaultMode
}
);
+13 -5
View File
@@ -372,11 +372,15 @@ export class DonjonEtCieRolls {
}
if (!isUsageDie && !item.system.degats) return null;
// Arme à 2 mains de corps à corps : avantage automatique
const isMeleeTwoHanded = item.type === "arme" && item.system?.categorie === "melee" && Number(item.system?.mains ?? 1) > 1;
if (isMeleeTwoHanded && mode === "normal") {
mode = "avantage";
}
const damageContext = DonjonEtCieUtility.getMartialDamageContext(actor, item);
const actorBonus = Number(actor?.system?.combat?.degatsBonus ?? 0);
const totalBonus = actorBonus;
const effectiveDamage = damageContext.effectiveFormula || (isUsageDie ? `1d${degatsDelta}` : item.system.degats);
const formula = totalBonus ? `${effectiveDamage} + ${totalBonus}` : effectiveDamage;
const formula = effectiveDamage;
const result = await this.#resolveFormulaRoll(formula, {}, { mode, favorable: "high" });
const targets = DonjonEtCieUtility.getSceneDamageTargets();
const rollDieLabels = result.rolls.map((roll) => {
@@ -396,7 +400,6 @@ export class DonjonEtCieRolls {
keptDieLabel,
values: result.values,
total: result.kept,
bonus: totalBonus,
baseDamage: baseDamageDisplay,
effectiveDamage,
damageCapped: damageContext.capped,
@@ -414,7 +417,6 @@ export class DonjonEtCieRolls {
baseDamage: baseDamageDisplay,
effectiveDamage,
damageCapped: damageContext.capped,
bonus: totalBonus,
values: result.values,
mode: result.mode
};
@@ -427,6 +429,12 @@ export class DonjonEtCieRolls {
return null;
}
// Arme à 2 mains de corps à corps : avantage automatique
const isMeleeTwoHanded = item.type === "arme" && item.system?.categorie === "melee" && Number(item.system?.mains ?? 1) > 1;
if (isMeleeTwoHanded && mode === "normal") {
mode = "avantage";
}
const resolved = await this.#resolveFormulaRoll(`1d${before}`, {}, { mode, favorable: "high" });
const result = resolved.kept;
const degraded = result <= 3;
+3 -3
View File
@@ -76,8 +76,8 @@ export class DonjonEtCieUtility {
const scene = canvas?.scene ?? game.scenes?.current;
const tokens = scene?.tokens?.contents ?? [];
const selectedTokens = canvas?.tokens?.controlled ?? [];
const selectedTokenUuid = selectedTokens.length === 1 ? selectedTokens[0]?.uuid : null;
const targetedTokens = game.user?.targets ?? [];
const targetedTokenUuid = targetedTokens[0]?.uuid ?? null;
return tokens
.map((token) => {
@@ -93,7 +93,7 @@ export class DonjonEtCieUtility {
tokenUuid: token.uuid,
actorUuid: actor.uuid,
label,
isSelected: token.uuid === selectedTokenUuid
isSelected: token.uuid === targetedTokenUuid
};
})
.filter(Boolean)
-1
View File
@@ -50,7 +50,6 @@ export default class EmployeDataModel extends foundry.abstract.TypeDataModel {
}),
combat: new fields.SchemaField({
initiativeBonus: new fields.NumberField({ initial: 0, integer: true }),
degatsBonus: new fields.NumberField({ initial: 0, integer: true }),
attaquesCorpsACorps: new fields.NumberField({ initial: 1, integer: true }),
attaquesDistance: new fields.NumberField({ initial: 1, integer: true })
}),
+1 -1
View File
@@ -1 +1 @@
MANIFEST-000165
MANIFEST-000169
+7 -7
View File
@@ -1,7 +1,7 @@
2026/05/28-20:45:21.096499 7f3977fff6c0 Recovering log #163
2026/05/28-20:45:21.107112 7f3977fff6c0 Delete type=3 #161
2026/05/28-20:45:21.107149 7f3977fff6c0 Delete type=0 #163
2026/05/28-20:46:40.064748 7f39767fc6c0 Level-0 table #168: started
2026/05/28-20:46:40.064805 7f39767fc6c0 Level-0 table #168: 0 bytes OK
2026/05/28-20:46:40.070966 7f39767fc6c0 Delete type=0 #166
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)
2026/06/01-08:00:33.882857 7f52c53fc6c0 Recovering log #167
2026/06/01-08:00:33.938200 7f52c53fc6c0 Delete type=3 #165
2026/06/01-08:00:33.938259 7f52c53fc6c0 Delete type=0 #167
2026/06/01-08:25:27.517975 7f52c4bfb6c0 Level-0 table #172: started
2026/06/01-08:25:27.518020 7f52c4bfb6c0 Level-0 table #172: 0 bytes OK
2026/06/01-08:25:27.527546 7f52c4bfb6c0 Delete type=0 #170
2026/06/01-08:25:27.538006 7f52c4bfb6c0 Manual compaction at level-0 from '!folders!K9aiFu0dE6UYiXBd' @ 72057594037927935 : 1 .. '!items!zyqLzmpbHxK3jt5q' @ 0 : 0; will stop at (end)
+7 -7
View File
@@ -1,7 +1,7 @@
2026/05/27-07:43:05.019282 7f3ebcffe6c0 Recovering log #160
2026/05/27-07:43:05.053650 7f3ebcffe6c0 Delete type=0 #160
2026/05/27-07:43:05.053700 7f3ebcffe6c0 Delete type=3 #159
2026/05/27-12:02:21.293983 7f3e6effd6c0 Level-0 table #164: started
2026/05/27-12:02:21.294005 7f3e6effd6c0 Level-0 table #164: 0 bytes OK
2026/05/27-12:02:21.299943 7f3e6effd6c0 Delete type=0 #162
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)
2026/05/28-20:45:21.096499 7f3977fff6c0 Recovering log #163
2026/05/28-20:45:21.107112 7f3977fff6c0 Delete type=3 #161
2026/05/28-20:45:21.107149 7f3977fff6c0 Delete type=0 #163
2026/05/28-20:46:40.064748 7f39767fc6c0 Level-0 table #168: started
2026/05/28-20:46:40.064805 7f39767fc6c0 Level-0 table #168: 0 bytes OK
2026/05/28-20:46:40.070966 7f39767fc6c0 Delete type=0 #166
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 -1
View File
@@ -1 +1 @@
MANIFEST-000152
MANIFEST-000156
+7 -7
View File
@@ -1,7 +1,7 @@
2026/05/28-20:45:21.112773 7f3976ffd6c0 Recovering log #150
2026/05/28-20:45:21.122136 7f3976ffd6c0 Delete type=3 #148
2026/05/28-20:45:21.122181 7f3976ffd6c0 Delete type=0 #150
2026/05/28-20:46:40.081166 7f39767fc6c0 Level-0 table #155: started
2026/05/28-20:46:40.081191 7f39767fc6c0 Level-0 table #155: 0 bytes OK
2026/05/28-20:46:40.087200 7f39767fc6c0 Delete type=0 #153
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)
2026/06/01-08:00:33.958934 7f52c6bff6c0 Recovering log #154
2026/06/01-08:00:34.023819 7f52c6bff6c0 Delete type=3 #152
2026/06/01-08:00:34.023899 7f52c6bff6c0 Delete type=0 #154
2026/06/01-08:25:27.615107 7f52c4bfb6c0 Level-0 table #159: started
2026/06/01-08:25:27.615150 7f52c4bfb6c0 Level-0 table #159: 0 bytes OK
2026/06/01-08:25:27.624874 7f52c4bfb6c0 Delete type=0 #157
2026/06/01-08:25:27.643263 7f52c4bfb6c0 Manual compaction at level-0 from '!tables!PPsxQgHwLCQ2gjSW' @ 72057594037927935 : 1 .. '!tables.results!wJZXUo4q5b5vE3Dy.zFTPLMc9zOl5hISV' @ 0 : 0; will stop at (end)
+7 -7
View File
@@ -1,7 +1,7 @@
2026/05/27-07:43:05.067367 7f3e6ffff6c0 Recovering log #147
2026/05/27-07:43:05.105287 7f3e6ffff6c0 Delete type=0 #147
2026/05/27-07:43:05.105329 7f3e6ffff6c0 Delete type=3 #146
2026/05/27-12:02:21.300011 7f3e6effd6c0 Level-0 table #151: started
2026/05/27-12:02:21.300030 7f3e6effd6c0 Level-0 table #151: 0 bytes OK
2026/05/27-12:02:21.306452 7f3e6effd6c0 Delete type=0 #149
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)
2026/05/28-20:45:21.112773 7f3976ffd6c0 Recovering log #150
2026/05/28-20:45:21.122136 7f3976ffd6c0 Delete type=3 #148
2026/05/28-20:45:21.122181 7f3976ffd6c0 Delete type=0 #150
2026/05/28-20:46:40.081166 7f39767fc6c0 Level-0 table #155: started
2026/05/28-20:46:40.081191 7f39767fc6c0 Level-0 table #155: 0 bytes OK
2026/05/28-20:46:40.087200 7f39767fc6c0 Delete type=0 #153
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 -1
View File
@@ -1 +1 @@
MANIFEST-000087
MANIFEST-000091
+8 -8
View File
@@ -1,8 +1,8 @@
2026/05/28-20:45:21.125760 7f39777fe6c0 Recovering log #85
2026/05/28-20:45:21.135844 7f39777fe6c0 Delete type=3 #83
2026/05/28-20:45:21.135894 7f39777fe6c0 Delete type=0 #85
2026/05/28-20:46:40.071060 7f39767fc6c0 Level-0 table #90: started
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)
2026/06/01-08:00:34.033489 7f52c5bfd6c0 Recovering log #89
2026/06/01-08:00:34.082405 7f52c5bfd6c0 Delete type=3 #87
2026/06/01-08:00:34.082456 7f52c5bfd6c0 Delete type=0 #89
2026/06/01-08:25:27.527672 7f52c4bfb6c0 Level-0 table #94: started
2026/06/01-08:25:27.527708 7f52c4bfb6c0 Level-0 table #94: 0 bytes OK
2026/06/01-08:25:27.537856 7f52c4bfb6c0 Delete type=0 #92
2026/06/01-08:25:27.538199 7f52c4bfb6c0 Manual compaction at level-0 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
2026/06/01-08:25:27.566799 7f52c4bfb6c0 Manual compaction at level-1 from '!journal!69Da9YvF9BfOV7oK' @ 72057594037927935 : 1 .. '!journal.pages!69Da9YvF9BfOV7oK.XM0eLkgKXPyskV65' @ 0 : 0; will stop at (end)
+8 -8
View File
@@ -1,8 +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)
2026/05/28-20:45:21.125760 7f39777fe6c0 Recovering log #85
2026/05/28-20:45:21.135844 7f39777fe6c0 Delete type=3 #83
2026/05/28-20:45:21.135894 7f39777fe6c0 Delete type=0 #85
2026/05/28-20:46:40.071060 7f39767fc6c0 Level-0 table #90: started
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)
+8 -1
View File
@@ -879,9 +879,16 @@
.chat-targeting {
position: relative;
z-index: 1;
display: grid;
display: flex;
gap: 0.4rem;
margin-top: 0.4rem;
flex-wrap: wrap;
align-items: end;
}
.chat-targeting .chat-action-button {
padding: 0.35rem 0.65rem;
min-height: 1.75rem;
font-size: 0.82rem;
}
.chat-control {
display: grid;
File diff suppressed because one or more lines are too long
-4
View File
@@ -46,10 +46,6 @@
<span>Attaques distance</span>
<input type="number" name="system.combat.attaquesDistance" value="{{system.combat.attaquesDistance}}">
</label>
<label>
<span>Bonus degats</span>
<input type="number" name="system.combat.degatsBonus" value="{{system.combat.degatsBonus}}">
</label>
</div>
</header>
+1 -2
View File
@@ -14,7 +14,6 @@
{{#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>
{{#if rollDieLabels.[1]}}
@@ -23,7 +22,7 @@
<p class="roll-values">{{#each rollDieLabels}}<span>{{this}}</span>{{/each}}</p>
</div>
{{/if}}
<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>
<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}}</p>
<div class="chat-targeting">
<label class="chat-control">
<span class="chat-keyline-label">Cible</span>
+3 -4
View File
@@ -3,13 +3,12 @@
{{#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>
<select name="mode">
<option value="normal">{{localize "DNC.UI.ModeNormal"}}</option>
<option value="avantage">{{localize "DNC.UI.ModeAdvantage"}}</option>
<option value="desavantage">{{localize "DNC.UI.ModeDisadvantage"}}</option>
<option value="normal" {{#if (eq defaultMode "normal")}}selected{{/if}}>{{localize "DNC.UI.ModeNormal"}}</option>
<option value="avantage" {{#if (eq defaultMode "avantage")}}selected{{/if}}>{{localize "DNC.UI.ModeAdvantage"}}</option>
<option value="desavantage" {{#if (eq defaultMode "desavantage")}}selected{{/if}}>{{localize "DNC.UI.ModeDisadvantage"}}</option>
</select>
</label>
</div>