From 6cf0880ad37628a818928a71f8de43e489aae771 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Tue, 19 May 2026 10:52:03 +0200 Subject: [PATCH] Enhance spell damage and messages content --- css/fvtt-lethal-fantasy.css | 28 ++++++++++++++--- lethal-fantasy.mjs | 10 ++++-- module/utils.mjs | 5 +-- .../lf-equipment/{000601.log => 000605.log} | 0 packs-system/lf-equipment/CURRENT | 2 +- packs-system/lf-equipment/LOG | 16 +++++----- packs-system/lf-equipment/LOG.old | 16 +++++----- .../{MANIFEST-000599 => MANIFEST-000603} | Bin 178 -> 178 bytes .../lf-gifts/{000598.log => 000602.log} | 0 packs-system/lf-gifts/CURRENT | 2 +- packs-system/lf-gifts/LOG | 16 +++++----- packs-system/lf-gifts/LOG.old | 16 +++++----- .../{MANIFEST-000596 => MANIFEST-000600} | Bin 247 -> 247 bytes .../lf-skills/{000603.log => 000607.log} | 0 packs-system/lf-skills/CURRENT | 2 +- packs-system/lf-skills/LOG | 16 +++++----- packs-system/lf-skills/LOG.old | 16 +++++----- .../{MANIFEST-000601 => MANIFEST-000605} | Bin 178 -> 178 bytes .../{000298.log => 000302.log} | 0 packs-system/lf-spells-miracles/CURRENT | 2 +- packs-system/lf-spells-miracles/LOG | 16 +++++----- packs-system/lf-spells-miracles/LOG.old | 16 +++++----- .../{MANIFEST-000296 => MANIFEST-000300} | Bin 177 -> 177 bytes .../{000597.log => 000601.log} | 0 packs-system/lf-vulnerabilities/CURRENT | 2 +- packs-system/lf-vulnerabilities/LOG | 16 +++++----- packs-system/lf-vulnerabilities/LOG.old | 16 +++++----- .../{MANIFEST-000595 => MANIFEST-000599} | Bin 176 -> 176 bytes styles/chat.less | 29 +++++++++++++++--- 29 files changed, 145 insertions(+), 97 deletions(-) rename packs-system/lf-equipment/{000601.log => 000605.log} (100%) rename packs-system/lf-equipment/{MANIFEST-000599 => MANIFEST-000603} (71%) rename packs-system/lf-gifts/{000598.log => 000602.log} (100%) rename packs-system/lf-gifts/{MANIFEST-000596 => MANIFEST-000600} (77%) rename packs-system/lf-skills/{000603.log => 000607.log} (100%) rename packs-system/lf-skills/{MANIFEST-000601 => MANIFEST-000605} (71%) rename packs-system/lf-spells-miracles/{000298.log => 000302.log} (100%) rename packs-system/lf-spells-miracles/{MANIFEST-000296 => MANIFEST-000300} (72%) rename packs-system/lf-vulnerabilities/{000597.log => 000601.log} (100%) rename packs-system/lf-vulnerabilities/{MANIFEST-000595 => MANIFEST-000599} (72%) diff --git a/css/fvtt-lethal-fantasy.css b/css/fvtt-lethal-fantasy.css index da5516d..939b6a3 100644 --- a/css/fvtt-lethal-fantasy.css +++ b/css/fvtt-lethal-fantasy.css @@ -2027,9 +2027,12 @@ i.lethalfantasy { background: #4a4940 !important; color: #ffffff !important; } +.lethalfantasy .grit-luck-dialog { + color: var(--color-text-dark-primary, #191813); +} .lethalfantasy .grit-luck-dialog .combat-status { padding: 12px; - background: linear-gradient(to bottom, rgba(42, 41, 32, 0.8) 0%, rgba(26, 25, 16, 0.9) 100%); + background: linear-gradient(to bottom, rgba(42, 41, 32, 0.88) 0%, rgba(26, 25, 16, 0.95) 100%); border: 1px solid rgba(212, 175, 55, 0.5); border-radius: 6px; margin-bottom: 16px; @@ -2049,11 +2052,25 @@ i.lethalfantasy { margin-top: 8px; } .lethalfantasy .grit-luck-dialog .offer-text { - color: #f0e6d2; + color: var(--color-text-dark-primary, #191813); font-size: calc(var(--font-size-standard) * 1); text-align: center; font-weight: 600; + margin: 0 0 8px 0; +} +.lethalfantasy .grit-luck-dialog .shield-warning { + color: #7a4000; + background: rgba(255, 160, 0, 0.12); + border: 1px solid rgba(255, 160, 0, 0.4); + border-radius: 5px; + font-size: calc(var(--font-size-standard) * 0.88); + padding: 6px 10px; margin: 0; + text-align: center; +} +.lethalfantasy .grit-luck-dialog .shield-warning i { + color: #c07000; + margin-right: 5px; } .lethalfantasy .attack-result { padding: 16px; @@ -2145,16 +2162,19 @@ i.lethalfantasy { } .lethalfantasy .attack-result .attack-result-damage { display: flex; - gap: 8px; + flex-wrap: wrap; + gap: 6px; justify-content: center; } .lethalfantasy .attack-result .attack-result-damage .roll-damage-btn { - padding: 10px 16px; + padding: 8px 10px; background: linear-gradient(to bottom, #8b0000 0%, #660000 100%); border: 1px solid #ff0000; border-radius: 6px; color: #f0e6d2; font-weight: 600; + font-size: calc(var(--font-size-standard) * 0.9); + white-space: nowrap; cursor: pointer; transition: all 0.2s ease; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); diff --git a/lethal-fantasy.mjs b/lethal-fantasy.mjs index 9e08ba2..8549006 100644 --- a/lethal-fantasy.mjs +++ b/lethal-fantasy.mjs @@ -230,9 +230,15 @@ Hooks.on("renderChatMessageHTML", (message, html, data) => { const weaponName = message.rolls[0]?.rollName || "weapon" const attackRoll = message.rolls[0]?.rollTotal || 0 const defenderName = combatant.name - const attackWeaponId = message.rolls[0]?.rollTarget?.weapon?.id || message.rolls[0]?.rollTarget?.weapon?._id const attackRollType = message.rolls[0]?.type - const attackRollKey = message.rolls[0]?.rollTarget?.rollKey + const rollTargetData = message.rolls[0]?.rollTarget + // For spell/miracle attacks, rollTarget IS the spell item (serialised as its data object). + // For weapon attacks, rollTarget is a plain skill+weapon object and weapon.id is the weapon. + const isSpellMiracleAttack = attackRollType === "spell-attack" || attackRollType === "miracle-attack" + const attackWeaponId = isSpellMiracleAttack + ? (rollTargetData?._id || rollTargetData?.id) + : (rollTargetData?.weapon?.id || rollTargetData?.weapon?._id) + const attackRollKey = rollTargetData?.rollKey console.log(`[LF] request-defense-btn | attackRollType=${attackRollType} defender=${defenderName} defenderType=${combatant.actor?.type}`) const attackD30result = message.rolls[0]?.options?.D30result || null const attackD30message = message.rolls[0]?.options?.D30message || null diff --git a/module/utils.mjs b/module/utils.mjs index eb2bcc9..d61f975 100644 --- a/module/utils.mjs +++ b/module/utils.mjs @@ -324,7 +324,7 @@ export default class LethalFantasyUtils {

Attack roll: ${attackRoll}

- + @@ -711,6 +711,7 @@ export default class LethalFantasyUtils { ${totalBonus > 0 ? `

Bonus already added: +${totalBonus}

` : ''}

You are losing! Spend Grit or Luck to add 1D6 to your defense?

+

If you intend to use a shield, you must spend Grit or Luck first — the shield roll comes after.

` @@ -861,7 +862,7 @@ export default class LethalFantasyUtils { ` } else if (data.attackRollType === "spell-attack" || data.attackRollType === "miracle-attack") { const attacker = game.actors.get(data.attackerId) - const spell = attacker?.items.get(data.attackWeaponId) + const spell = attacker?.items.get(data.attackWeaponId || data.attackRollKey) const tiers = [ { formula: spell?.system?.damageDice, label: "Standard" }, { formula: spell?.system?.damageDiceOverpowered, label: "Overpowered" }, diff --git a/packs-system/lf-equipment/000601.log b/packs-system/lf-equipment/000605.log similarity index 100% rename from packs-system/lf-equipment/000601.log rename to packs-system/lf-equipment/000605.log diff --git a/packs-system/lf-equipment/CURRENT b/packs-system/lf-equipment/CURRENT index 4569ef0..5882c5f 100644 --- a/packs-system/lf-equipment/CURRENT +++ b/packs-system/lf-equipment/CURRENT @@ -1 +1 @@ -MANIFEST-000599 +MANIFEST-000603 diff --git a/packs-system/lf-equipment/LOG b/packs-system/lf-equipment/LOG index 1f3ea5c..47bb3e7 100644 --- a/packs-system/lf-equipment/LOG +++ b/packs-system/lf-equipment/LOG @@ -1,8 +1,8 @@ -2026/05/18-17:40:11.769288 7f5a477fe6c0 Recovering log #597 -2026/05/18-17:40:11.780605 7f5a477fe6c0 Delete type=3 #595 -2026/05/18-17:40:11.780699 7f5a477fe6c0 Delete type=0 #597 -2026/05/18-20:25:54.228818 7f5a467fc6c0 Level-0 table #602: started -2026/05/18-20:25:54.230037 7f5a467fc6c0 Level-0 table #602: 0 bytes OK -2026/05/18-20:25:54.236369 7f5a467fc6c0 Delete type=0 #600 -2026/05/18-20:25:54.251050 7f5a467fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) -2026/05/18-20:25:54.251106 7f5a467fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) +2026/05/19-10:50:35.862031 7f5a477fe6c0 Recovering log #601 +2026/05/19-10:50:35.923479 7f5a477fe6c0 Delete type=3 #599 +2026/05/19-10:50:35.923537 7f5a477fe6c0 Delete type=0 #601 +2026/05/19-10:51:28.990207 7f5a467fc6c0 Level-0 table #606: started +2026/05/19-10:51:28.990237 7f5a467fc6c0 Level-0 table #606: 0 bytes OK +2026/05/19-10:51:28.997402 7f5a467fc6c0 Delete type=0 #604 +2026/05/19-10:51:28.997604 7f5a467fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) +2026/05/19-10:51:28.997650 7f5a467fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-equipment/LOG.old b/packs-system/lf-equipment/LOG.old index ce9cf9c..1f3ea5c 100644 --- a/packs-system/lf-equipment/LOG.old +++ b/packs-system/lf-equipment/LOG.old @@ -1,8 +1,8 @@ -2026/05/18-07:32:52.671725 7f5a94bff6c0 Recovering log #593 -2026/05/18-07:32:52.684619 7f5a94bff6c0 Delete type=3 #591 -2026/05/18-07:32:52.684760 7f5a94bff6c0 Delete type=0 #593 -2026/05/18-07:58:12.225439 7f5a467fc6c0 Level-0 table #598: started -2026/05/18-07:58:12.225593 7f5a467fc6c0 Level-0 table #598: 0 bytes OK -2026/05/18-07:58:12.232817 7f5a467fc6c0 Delete type=0 #596 -2026/05/18-07:58:12.252837 7f5a467fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) -2026/05/18-07:58:12.252955 7f5a467fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) +2026/05/18-17:40:11.769288 7f5a477fe6c0 Recovering log #597 +2026/05/18-17:40:11.780605 7f5a477fe6c0 Delete type=3 #595 +2026/05/18-17:40:11.780699 7f5a477fe6c0 Delete type=0 #597 +2026/05/18-20:25:54.228818 7f5a467fc6c0 Level-0 table #602: started +2026/05/18-20:25:54.230037 7f5a467fc6c0 Level-0 table #602: 0 bytes OK +2026/05/18-20:25:54.236369 7f5a467fc6c0 Delete type=0 #600 +2026/05/18-20:25:54.251050 7f5a467fc6c0 Manual compaction at level-0 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) +2026/05/18-20:25:54.251106 7f5a467fc6c0 Manual compaction at level-1 from '!folders!ATr9wZhg5uTVTksM' @ 72057594037927935 : 1 .. '!items!zw9RQocTdz3HRjZK' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-equipment/MANIFEST-000599 b/packs-system/lf-equipment/MANIFEST-000603 similarity index 71% rename from packs-system/lf-equipment/MANIFEST-000599 rename to packs-system/lf-equipment/MANIFEST-000603 index 8dd20da43faaeccb18df99a848dfe08a03756948..49b34982f852a3d2544ad67323b0fa296f1fa5e4 100644 GIT binary patch delta 43 tcmdnQxQTH>pUP_)bz5!*My5L~oD9r&Sy<+AUebS53KF>s61fi&0RRwv3wrpNiCczxCVaWWtGsg8V9)<7@2Oea56C8Vqw|MSQdNwG)UwYNaPMk1OP_p4H*Cc delta 43 tcmey)_?>aWWfgtDiZ|R0j7(QqI2o9)v9RoB3`*I@4HCHq61f2q0RS;I3-tg1 diff --git a/packs-system/lf-skills/000603.log b/packs-system/lf-skills/000607.log similarity index 100% rename from packs-system/lf-skills/000603.log rename to packs-system/lf-skills/000607.log diff --git a/packs-system/lf-skills/CURRENT b/packs-system/lf-skills/CURRENT index 4a4c8ce..7139744 100644 --- a/packs-system/lf-skills/CURRENT +++ b/packs-system/lf-skills/CURRENT @@ -1 +1 @@ -MANIFEST-000601 +MANIFEST-000605 diff --git a/packs-system/lf-skills/LOG b/packs-system/lf-skills/LOG index 23ee6e0..409b56c 100644 --- a/packs-system/lf-skills/LOG +++ b/packs-system/lf-skills/LOG @@ -1,8 +1,8 @@ -2026/05/18-17:40:11.749971 7f5a46ffd6c0 Recovering log #599 -2026/05/18-17:40:11.761423 7f5a46ffd6c0 Delete type=3 #597 -2026/05/18-17:40:11.761520 7f5a46ffd6c0 Delete type=0 #599 -2026/05/18-20:25:54.219239 7f5a467fc6c0 Level-0 table #604: started -2026/05/18-20:25:54.219522 7f5a467fc6c0 Level-0 table #604: 0 bytes OK -2026/05/18-20:25:54.228610 7f5a467fc6c0 Delete type=0 #602 -2026/05/18-20:25:54.251028 7f5a467fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) -2026/05/18-20:25:54.251085 7f5a467fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) +2026/05/19-10:50:35.772455 7f5a46ffd6c0 Recovering log #603 +2026/05/19-10:50:35.837426 7f5a46ffd6c0 Delete type=3 #601 +2026/05/19-10:50:35.837512 7f5a46ffd6c0 Delete type=0 #603 +2026/05/19-10:51:28.969686 7f5a467fc6c0 Level-0 table #608: started +2026/05/19-10:51:28.969769 7f5a467fc6c0 Level-0 table #608: 0 bytes OK +2026/05/19-10:51:28.976467 7f5a467fc6c0 Delete type=0 #606 +2026/05/19-10:51:28.997558 7f5a467fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) +2026/05/19-10:51:28.997616 7f5a467fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-skills/LOG.old b/packs-system/lf-skills/LOG.old index b19bc74..23ee6e0 100644 --- a/packs-system/lf-skills/LOG.old +++ b/packs-system/lf-skills/LOG.old @@ -1,8 +1,8 @@ -2026/05/18-07:32:52.650924 7f5a47fff6c0 Recovering log #595 -2026/05/18-07:32:52.662191 7f5a47fff6c0 Delete type=3 #593 -2026/05/18-07:32:52.662331 7f5a47fff6c0 Delete type=0 #595 -2026/05/18-07:58:12.218060 7f5a467fc6c0 Level-0 table #600: started -2026/05/18-07:58:12.218402 7f5a467fc6c0 Level-0 table #600: 0 bytes OK -2026/05/18-07:58:12.225237 7f5a467fc6c0 Delete type=0 #598 -2026/05/18-07:58:12.244392 7f5a467fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) -2026/05/18-07:58:12.252899 7f5a467fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) +2026/05/18-17:40:11.749971 7f5a46ffd6c0 Recovering log #599 +2026/05/18-17:40:11.761423 7f5a46ffd6c0 Delete type=3 #597 +2026/05/18-17:40:11.761520 7f5a46ffd6c0 Delete type=0 #599 +2026/05/18-20:25:54.219239 7f5a467fc6c0 Level-0 table #604: started +2026/05/18-20:25:54.219522 7f5a467fc6c0 Level-0 table #604: 0 bytes OK +2026/05/18-20:25:54.228610 7f5a467fc6c0 Delete type=0 #602 +2026/05/18-20:25:54.251028 7f5a467fc6c0 Manual compaction at level-0 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) +2026/05/18-20:25:54.251085 7f5a467fc6c0 Manual compaction at level-1 from '!folders!7j8H7DbmBb9Uza2X' @ 72057594037927935 : 1 .. '!items!zt8s7564ep1La4XQ' @ 0 : 0; will stop at (end) diff --git a/packs-system/lf-skills/MANIFEST-000601 b/packs-system/lf-skills/MANIFEST-000605 similarity index 71% rename from packs-system/lf-skills/MANIFEST-000601 rename to packs-system/lf-skills/MANIFEST-000605 index f6cfaf002412ae32c79588e55f5f93303c5cb75d..7058802ba9a8b009876ccee464a71fa07bfc5446 100644 GIT binary patch delta 43 tcmdnQxQTH>pUTSpNfR@Z4+(=My6XVoD9sjSy&#j{<`7n2@<&t61fW!0RR