Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 09f2349bab | |||
| d8eb23289e | |||
| 820a7d61cf |
+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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -393,6 +393,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 +404,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 +419,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 = {};
|
||||
|
||||
@@ -1 +1 @@
|
||||
MANIFEST-000069
|
||||
MANIFEST-000077
|
||||
|
||||
+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/09-23:26:00.662378 7fe6d3fff6c0 Recovering log #75
|
||||
2026/05/09-23:26:00.714642 7fe6d3fff6c0 Delete type=3 #73
|
||||
2026/05/09-23:26:00.714705 7fe6d3fff6c0 Delete type=0 #75
|
||||
2026/05/09-23:32:35.906147 7fe6d37fe6c0 Level-0 table #80: started
|
||||
2026/05/09-23:32:35.906185 7fe6d37fe6c0 Level-0 table #80: 0 bytes OK
|
||||
2026/05/09-23:32:35.912511 7fe6d37fe6c0 Delete type=0 #78
|
||||
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)
|
||||
|
||||
@@ -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:24:27.244461 7fe6d3fff6c0 Recovering log #71
|
||||
2026/05/09-23:24:27.261516 7fe6d3fff6c0 Delete type=3 #69
|
||||
2026/05/09-23:24:27.261564 7fe6d3fff6c0 Delete type=0 #71
|
||||
2026/05/09-23:25:01.848661 7fe6d37fe6c0 Level-0 table #76: started
|
||||
2026/05/09-23:25:01.848715 7fe6d37fe6c0 Level-0 table #76: 0 bytes OK
|
||||
2026/05/09-23:25:01.854909 7fe6d37fe6c0 Delete type=0 #74
|
||||
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)
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
MANIFEST-000056
|
||||
MANIFEST-000064
|
||||
|
||||
@@ -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/09-23:26:00.734399 7fe7211fe6c0 Recovering log #62
|
||||
2026/05/09-23:26:00.785619 7fe7211fe6c0 Delete type=3 #60
|
||||
2026/05/09-23:26:00.785680 7fe7211fe6c0 Delete type=0 #62
|
||||
2026/05/09-23:32:35.893861 7fe6d37fe6c0 Level-0 table #67: started
|
||||
2026/05/09-23:32:35.893901 7fe6d37fe6c0 Level-0 table #67: 0 bytes OK
|
||||
2026/05/09-23:32:35.899905 7fe6d37fe6c0 Delete type=0 #65
|
||||
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)
|
||||
|
||||
@@ -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:24:27.266509 7fe7211fe6c0 Recovering log #58
|
||||
2026/05/09-23:24:27.282592 7fe7211fe6c0 Delete type=3 #56
|
||||
2026/05/09-23:24:27.282660 7fe7211fe6c0 Delete type=0 #58
|
||||
2026/05/09-23:25:01.864644 7fe6d37fe6c0 Level-0 table #63: started
|
||||
2026/05/09-23:25:01.864678 7fe6d37fe6c0 Level-0 table #63: 0 bytes OK
|
||||
2026/05/09-23:25:01.871922 7fe6d37fe6c0 Delete type=0 #61
|
||||
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)
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
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/09-23:29:14.636398 7f54217ed6c0 Delete type=3 #1
|
||||
2026/05/09-23:29:14.638741 7f5403fff6c0 Level-0 table #5: started
|
||||
2026/05/09-23:29:14.666649 7f5403fff6c0 Level-0 table #5: 3056 bytes OK
|
||||
2026/05/09-23:29:14.731617 7f5403fff6c0 Delete type=0 #3
|
||||
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)
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user