From 1fb80f6abe39d04a90ed746f69abce895f818297 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnier Date: Fri, 3 Apr 2026 16:22:51 +0200 Subject: [PATCH] =?UTF-8?q?Rework=20fiches,=20jets=20de=20d=C3=A9s=20et=20?= =?UTF-8?q?CSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../templates/actor-sheet_20260403081216.hbs | 789 ++++++++++++++++++ .../templates/actor-sheet_20260403094215.hbs | 789 ++++++++++++++++++ less/actor-styles.less | 24 + less/simple-converted.less | 448 ++++++---- .../mournblade-cyd2-roll-dialog.mjs | 62 +- .../applications/sheets/base-actor-sheet.mjs | 2 +- modules/mournblade-cyd2-actor-sheet.js | 211 ----- modules/mournblade-cyd2-actor.js | 30 +- modules/mournblade-cyd2-config.js | 6 +- modules/mournblade-cyd2-creature-sheet.js | 26 - modules/mournblade-cyd2-item-sheet.js | 228 ----- modules/mournblade-cyd2-main.js | 43 +- modules/mournblade-cyd2-roll-dialog.js | 142 ---- modules/mournblade-cyd2-utility.js | 49 +- styles/mournblade-cyd2.css | 445 ++++++---- templates/actor-sheet.hbs | 8 +- templates/chat-degats-result.hbs | 123 ++- templates/chat-generic-result.hbs | 434 +++++++--- templates/creature-sheet.hbs | 8 +- templates/post-item.hbs | 59 +- templates/roll-dialog-generic.hbs | 481 ++++++----- 21 files changed, 3091 insertions(+), 1316 deletions(-) create mode 100644 .history/templates/actor-sheet_20260403081216.hbs create mode 100644 .history/templates/actor-sheet_20260403094215.hbs delete mode 100644 modules/mournblade-cyd2-actor-sheet.js delete mode 100644 modules/mournblade-cyd2-creature-sheet.js delete mode 100644 modules/mournblade-cyd2-item-sheet.js delete mode 100644 modules/mournblade-cyd2-roll-dialog.js diff --git a/.history/templates/actor-sheet_20260403081216.hbs b/.history/templates/actor-sheet_20260403081216.hbs new file mode 100644 index 0000000..6cf6e18 --- /dev/null +++ b/.history/templates/actor-sheet_20260403081216.hbs @@ -0,0 +1,789 @@ +
+ + {{!-- Sheet Header --}} +
+ + {{!-- Bannière : image + nom + bouton --}} +
+ +

+ +
+ + {{!-- Cartes de statistiques --}} +
+ + {{!-- LOI --}} +
+
⚖ Loi
+
+
+ + +
+
+ + +
+
Aspect : {{system.balance.aspect}}
+
+
+ + {{!-- CHAOS --}} +
+
☯ Chaos
+
+
+ + +
+
+ + +
+
Marge : {{system.balance.marge}}
+
+
+ + {{!-- BONNE AVENTURE --}} +
+
★ Bonne Aventure
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ + {{!-- VIGUEUR --}} +
+
♥ Vigueur ({{system.sante.vigueur}})
+
+
+ + +
+
+
+ + {{!-- ÂME --}} +
+
✦ Âme (Seuil {{system.ame.seuilpouvoir}})
+
+
+ + +
+
+ + +
+
+
+ +
+ +
+ + {{!-- Sheet Tab Navigation --}} +
+ +
+ + {{!-- Sheet Body --}} +
+ + {{!-- Main Tab --}} +
+ +
+ +
+ +
+
    + {{#each system.attributs as |attr key|}} +
  • + + {{attr.label}} + +
  • + {{/each}} + +
  • + + Vitesse + +
  • + +
+
+ +
+ +

Adversités

+
+ {{#each system.adversite as |adv key|}} +
+
{{upperFirst key}}
+ +
{{adv}}
+
+ + + +
+
+ {{/each}} +
+ +
+ Malus jets + −{{adversiteTotal}} +
+ + {{#if isGM}} +
+
+ + +
+
+ + +
+
+ {{/if}} +
+
+ +
+
    +
  • + +

    +
    + + + +
     
    +
    + +
    +
  • + {{#each talents as |talent key|}} +
  • + + {{talent.name}} + {{talent.system.resumebonus}} + +
     
    +
    + + +
    +
  • + {{/each}} +
+
+
+
+ + + {{!-- Competences Tab --}} +
+ +
+
+
    +
  • + +

    +
    + + + +
     
    +
  • + {{#each skills as |skill key|}} +
  • + + +
    + + {{skill.name}} + + + {{#each skill.system.predilections as |pred key|}} + {{#if (and pred.acquise (not pred.used))}} + {{pred.name}}, + {{/if}} + {{/each}} + +
    + + + + {{#if (ne skill.system.attribut1 "none")}} + + {{/if}} + {{#if (ne skill.system.attribut2 "none")}} + + {{/if}} + {{#if (ne skill.system.attribut3 "none")}} + + {{/if}} + +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+ +
+ + {{!-- Dons/Pactes Tab --}} +
+ +
+ +
+
    +
  • + +

    +
    + + + +
     
    +
    + +
    +
  • + {{#each dons as |don key|}} +
  • + + {{don.name}} + {{don.system.allegeance}} +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+
    +
  • + +

    +
    + + + +
     
    +
    + +
    +
  • + {{#each pactes as |pacte key|}} +
  • + + {{pacte.name}} + {{pacte.system.allegeance}} +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+
    +
  • + +

    +
    + + + + + + +
     
    +
    + +
    +
  • + {{#each runes as |rune key|}} +
  • + + {{rune.name}} + {{rune.system.formule}} + {{rune.system.seuil}} +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+
    +
  • + +

    +
    + + + +
     
    +
    + +
    +
  • + {{#each tendances as |tendance key|}} +
  • + + {{tendance.name}} + {{tendance.system.allegeance}} +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+
    +
  • + +

    +
    +
     
    +
    + +
    +
  • + {{#each traitsChaotiques as |trait key|}} +
  • + + {{trait.name}} +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+
    +
  • + +

    +
    +
     
    +
    + +
    +
  • + {{#each traitsEspeces as |trait key|}} +
  • + + {{trait.name}} +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+ +
+ + {{!-- Equipement Tab --}} +
+ +
    +
  • + + + + + + + +
  • +
  • + + + + + +
  • +
+ +
+ +
+
    +
  • + +

    +
    + + + + + + + + + +
     
    +
    + +
    +
  • + {{#each armes as |arme key|}} +
  • + + {{arme.name}} + + + {{#if arme.system.equipped}} + + {{else}} + + {{/if}} + + + {{#if arme.system.isdefense}} + + {{else}} + + {{/if}} + + + {{#if arme.system.equipped}} + + {{else}} + + {{/if}} + + +
     
    + +
  • + {{/each}} +
+
+ +
+ +
+
+
+ + + {{!-- Equipement Tab --}} +
+ +
+ +
+
+

+ +

+
+ +
+
    +
  • + +

    +
    + + + + +
     
    +
    + +
    +
  • + {{#each monnaies as |monnaie key|}} +
  • + + {{monnaie.name}} + {{monnaie.system.quantite}} + - + + + +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+
+

+ +

+
+ +
+
    +
  • + +

    +
    + + + + + +
     
    +
    + +
    +
  • + {{#each equipements as |equipement key|}} +
  • + + {{equipement.name}} + {{equipement.system.quantite}} + - + + + +
     
    +
    + + +
    +
  • + {{/each}} +
+
+ +
+ +
+ + + {{!-- Biography Tab --}} +
+ +
+
    + {{#each historiques as |historique key|}} +
  • + + + +
    + + +
    +
  • + {{/each}} + {{#each profils as |profil key|}} +
  • + + + +
    + + +
    +
  • + {{/each}} +
+
+ + +
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
+
+ +
+
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
    +
    + + +

    Description

    +
    +
    + {{editor description target="system.biodata.description" button=true owner=owner editable=editable}} +
    + +
    + +
    +
    \ No newline at end of file diff --git a/.history/templates/actor-sheet_20260403094215.hbs b/.history/templates/actor-sheet_20260403094215.hbs new file mode 100644 index 0000000..092c48b --- /dev/null +++ b/.history/templates/actor-sheet_20260403094215.hbs @@ -0,0 +1,789 @@ +
    + + {{!-- Sheet Header --}} +
    + + {{!-- Bannière : image + nom + bouton --}} +
    + +

    + +
    + + {{!-- Cartes de statistiques --}} +
    + + {{!-- LOI --}} +
    +
    ⚖ Loi
    +
    +
    + + +
    +
    + + +
    +
    Aspect : {{system.balance.aspect}}
    +
    +
    + + {{!-- CHAOS --}} +
    +
    ☯ Chaos
    +
    +
    + + +
    +
    + + +
    +
    Marge : {{system.balance.marge}}
    +
    +
    + + {{!-- BONNE AVENTURE --}} +
    +
    ★ Bonne Aventure
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + + {{!-- VIGUEUR --}} +
    +
    ♥ Vigueur ({{system.sante.vigueur}})
    +
    +
    + + +
    +
    +
    + + {{!-- ÂME --}} +
    +
    ✦ Âme (Seuil {{system.ame.seuilpouvoir}})
    +
    +
    + + +
    +
    + + +
    +
    +
    + +
    + +
    + + {{!-- Sheet Tab Navigation --}} +
    + +
    + + {{!-- Sheet Body --}} +
    + + {{!-- Main Tab --}} +
    + +
    + +
    + +
    +
      + {{#each system.attributs as |attr key|}} +
    • + + {{attr.label}} + +
    • + {{/each}} + +
    • + + Vitesse + +
    • + +
    +
    + +
    + +

    Adversités

    +
    + {{#each system.adversite as |adv key|}} +
    +
    {{upperFirst key}}
    + +
    {{adv}}
    +
    + + + +
    +
    + {{/each}} +
    + +
    + Malus jets + −{{adversiteTotal}} +
    + + {{#if isGM}} +
    +
    + + +
    +
    + + +
    +
    + {{/if}} +
    +
    + +
    +
      +
    • + +

      +
      + + + +
       
      +
      + +
      +
    • + {{#each talents as |talent key|}} +
    • + + {{talent.name}} + {{talent.system.resumebonus}} + +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    +
    +
    + + + {{!-- Competences Tab --}} +
    + +
    +
    +
      +
    • + +

      +
      + + + +
       
      +
    • + {{#each skills as |skill key|}} +
    • + + +
      + + {{skill.name}} + + + {{#each skill.system.predilections as |pred key|}} + {{#if (and pred.acquise (not pred.used))}} + {{pred.name}}, + {{/if}} + {{/each}} + +
      + + + + {{#if (ne skill.system.attribut1 "none")}} + + {{/if}} + {{#if (ne skill.system.attribut2 "none")}} + + {{/if}} + {{#if (ne skill.system.attribut3 "none")}} + + {{/if}} + +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    + +
    + + {{!-- Dons/Pactes Tab --}} +
    + +
    + +
    +
      +
    • + +

      +
      + + + +
       
      +
      + +
      +
    • + {{#each dons as |don key|}} +
    • + + {{don.name}} + {{don.system.allegeance}} +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    +
      +
    • + +

      +
      + + + +
       
      +
      + +
      +
    • + {{#each pactes as |pacte key|}} +
    • + + {{pacte.name}} + {{pacte.system.allegeance}} +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    +
      +
    • + +

      +
      + + + + + + +
       
      +
      + +
      +
    • + {{#each runes as |rune key|}} +
    • + + {{rune.name}} + {{rune.system.formule}} + {{rune.system.seuil}} +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    +
      +
    • + +

      +
      + + + +
       
      +
      + +
      +
    • + {{#each tendances as |tendance key|}} +
    • + + {{tendance.name}} + {{tendance.system.allegeance}} +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    +
      +
    • + +

      +
      +
       
      +
      + +
      +
    • + {{#each traitsChaotiques as |trait key|}} +
    • + + {{trait.name}} +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    +
      +
    • + +

      +
      +
       
      +
      + +
      +
    • + {{#each traitsEspeces as |trait key|}} +
    • + + {{trait.name}} +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    + +
    + + {{!-- Equipement Tab --}} +
    + +
      +
    • + + + + + + + +
    • +
    • + + + + + +
    • +
    + +
    + +
    +
      +
    • + +

      +
      + + + + + + + + + +
       
      +
      + +
      +
    • + {{#each armes as |arme key|}} +
    • + + {{arme.name}} + + + {{#if arme.system.equipped}} + + {{else}} + + {{/if}} + + + {{#if arme.system.isdefense}} + + {{else}} + + {{/if}} + + + {{#if arme.system.equipped}} + + {{else}} + + {{/if}} + + +
       
      + +
    • + {{/each}} +
    +
    + +
    + +
    +
    +
    + + + {{!-- Equipement Tab --}} +
    + +
    + +
    +
    +

    + +

    +
    + +
    +
      +
    • + +

      +
      + + + + +
       
      +
      + +
      +
    • + {{#each monnaies as |monnaie key|}} +
    • + + {{monnaie.name}} + {{monnaie.system.quantite}} + - + + + +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    +
    +

    + +

    +
    + +
    +
      +
    • + +

      +
      + + + + + +
       
      +
      + +
      +
    • + {{#each equipements as |equipement key|}} +
    • + + {{equipement.name}} + {{equipement.system.quantite}} + - + + + +
       
      +
      + + +
      +
    • + {{/each}} +
    +
    + +
    + +
    + + + {{!-- Biography Tab --}} +
    + +
    +
      + {{#each historiques as |historique key|}} +
    • + + + +
      + + +
      +
    • + {{/each}} + {{#each profils as |profil key|}} +
    • + + + +
      + + +
      +
    • + {{/each}} +
    +
    + + +
    +
    +
      +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    +
    +
    +
      +
    • + + +
    • +
    • + + +
    • +
    +
    + +
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
    +
    + + +

    Description

    +
    +
    + {{editor description target="system.biodata.description" button=true owner=owner editable=editable}} +
    + +
    + +
    +
    \ No newline at end of file diff --git a/less/actor-styles.less b/less/actor-styles.less index ff19fd7..c081587 100644 --- a/less/actor-styles.less +++ b/less/actor-styles.less @@ -356,6 +356,30 @@ } } + // ── Éditeurs ProseMirror dans les onglets ────────────────────────── + // Le texte global du sheet-body hérite d'une couleur claire (#efe6d8) + // mais le fond de l'éditeur est blanc/beige clair → illisible. + // On force couleur sombre + fond clair sur le contenu éditable. + .tab prose-mirror, + .tab .editor prose-mirror { + .editor-content { + color: #2a1a0a !important; + background: rgba(255, 250, 240, 0.92); + border-radius: 3px; + padding: 0.4rem 0.5rem; + min-height: 6rem; + + p, ul, ol, li, h1, h2, h3, h4 { + color: #2a1a0a !important; + } + } + + // Fond et couleur quand actif (mode édition) + &:not(.inactive) .editor-content { + background: rgba(255, 252, 245, 0.98); + } + } + // Listes compactes dans les sections .compact-list { list-style: none; diff --git a/less/simple-converted.less b/less/simple-converted.less index a80fa98..262f6ae 100644 --- a/less/simple-converted.less +++ b/less/simple-converted.less @@ -25,7 +25,7 @@ --tab-header-font-size: 1.0rem; --tab-header-font-weight: 700; --tab-header-color: #403f3e; - --tab-header-color-active: #4a0404; + --tab-header-color-active: #2a1400; --font-primary: CentaurMT; --font-secondary: CentaurMT; @@ -1313,7 +1313,8 @@ text-shadow: 0px 1px 0px #4d3534; position: relative; max-height: 1.8rem; - width: 3.5rem; + width: 5rem; + white-space: nowrap; margin-left: 4px; } @@ -1332,7 +1333,8 @@ text-shadow: 0px 1px 0px #4d3534; position: relative; max-height: 1.8rem; - width: 3.5rem; + width: 5rem; + white-space: nowrap; margin-left: 4px; } @@ -1629,50 +1631,50 @@ margin-right: 6px; } /* ==================== Roll Dialog V2 Styles ==================== */ -.application.mournblade-roll-dialog .window-content { +.application.mournblade-cyd2-roll-dialog .window-content { padding: 0; } -.window-app.mournblade-roll-dialog .window-content { +.window-app.mournblade-cyd2-roll-dialog .window-content { margin: 0; padding: 0; } -.mournblade-roll-dialog { +.mournblade-cyd2-roll-dialog { background: url("../assets/ui/pc_sheet_bg.webp"); background-repeat: repeat; font-family: CentaurMT; } -.mournblade-roll-dialog * { +.mournblade-cyd2-roll-dialog * { color: #2a2a2a; } /* Header */ -.mournblade-roll-dialog .dialog-header { +.mournblade-cyd2-roll-dialog .dialog-header { display: flex; align-items: center; gap: 10px; padding: 8px; - background: linear-gradient(135deg, #4a0404 0%, #6d0808 100%); - border-bottom: 3px solid #8b0000; + background: linear-gradient(135deg, #2a1400 0%, #4a2200 100%); + border-bottom: 3px solid #8b4513; margin-bottom: 0; } -.mournblade-roll-dialog .dialog-header .actor-icon { +.mournblade-cyd2-roll-dialog .dialog-header .actor-icon { width: 48px; height: 48px; border-radius: 4px; - border: 2px solid #8b0000; + border: 2px solid #8b4513; object-fit: cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); } -.mournblade-roll-dialog .dialog-header .dialog-title { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title { flex: 1; } -.mournblade-roll-dialog .dialog-header .dialog-title h3 { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title h3 { margin: 0; font-size: 1.1rem; color: #f5f5f5; @@ -1681,82 +1683,84 @@ font-weight: bold; } -.mournblade-roll-dialog .dialog-header .dialog-title .competence-name { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title .competence-name { font-size: 0.85rem; - color: #ffcccb; + color: #f0d0a0; margin-top: 2px; text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8); } -.mournblade-roll-dialog .dialog-header .dialog-title .competence-name .attribut-info { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title .competence-name .attribut-info { color: #ffd700; font-weight: bold; font-size: 0.9em; } /* Content */ -.mournblade-roll-dialog .dialog-content { - padding: 8px; - max-height: 650px; +.mournblade-cyd2-roll-dialog .dialog-content { + padding: 6px 8px; + max-height: 600px; overflow-y: auto; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar { +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar { width: 8px; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-track { +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 4px; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-thumb { - background: rgba(139, 0, 0, 0.6); +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar-thumb { + background: rgba(139, 69, 19, 0.6); border-radius: 4px; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-thumb:hover { - background: rgba(139, 0, 0, 0.8); +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar-thumb:hover { + background: rgba(139, 69, 19, 0.8); } /* Form Groups */ -.mournblade-roll-dialog .form-group { - margin-bottom: 8px; +.mournblade-cyd2-roll-dialog .form-group { + margin-bottom: 6px; } -.mournblade-roll-dialog .form-group label { - display: block; +.mournblade-cyd2-roll-dialog .form-group label { + flex-shrink: 0; + white-space: nowrap; font-weight: bold; color: #1a1a1a; text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5); - margin-bottom: 3px; font-size: 0.9rem; + margin-bottom: 0; } -.mournblade-roll-dialog .form-group input, -.mournblade-roll-dialog .form-group select { - width: 100%; - padding: 5px 8px; +.mournblade-cyd2-roll-dialog .form-group input, +.mournblade-cyd2-roll-dialog .form-group select { + flex: 1; + min-width: 60px; + padding: 4px 6px; background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(100, 100, 100, 0.5); border-radius: 3px; color: #1a1a1a; - font-size: 0.95rem; + font-size: 0.9rem; font-weight: 500; font-family: CentaurMT; } -.mournblade-roll-dialog .form-group input:focus, -.mournblade-roll-dialog .form-group select:focus { +.mournblade-cyd2-roll-dialog .form-group input:focus, +.mournblade-cyd2-roll-dialog .form-group select:focus { outline: none; - border-color: #8b0000; - box-shadow: 0 0 5px rgba(139, 0, 0, 0.6); + border-color: #8b4513; + box-shadow: 0 0 5px rgba(139, 69, 19, 0.6); background: #ffffff; } -.mournblade-roll-dialog .form-group input:disabled, -.mournblade-roll-dialog .form-group select:disabled { +.mournblade-cyd2-roll-dialog .form-group input:disabled, +.mournblade-cyd2-roll-dialog .form-group select:disabled { opacity: 0.7; cursor: not-allowed; background: rgba(200, 200, 200, 0.9); @@ -1764,23 +1768,23 @@ } /* Grids */ -.mournblade-roll-dialog .modifiers-grid { +.mournblade-cyd2-roll-dialog .modifiers-grid { display: grid; grid-template-columns: repeat(2, 1fr); - gap: 8px; - margin-bottom: 10px; + gap: 6px; + margin-bottom: 8px; } /* Sections spéciales */ -.mournblade-roll-dialog .attributes-section { - background: rgba(139, 0, 0, 0.1); +.mournblade-cyd2-roll-dialog .attributes-section { + background: rgba(139, 69, 19, 0.1); padding: 8px; border-radius: 4px; - border: 1px solid rgba(139, 0, 0, 0.3); + border: 1px solid rgba(139, 69, 19, 0.3); margin-bottom: 10px; } -.mournblade-roll-dialog .rune-section { +.mournblade-cyd2-roll-dialog .rune-section { background: rgba(75, 0, 130, 0.1); padding: 8px; border-radius: 4px; @@ -1788,37 +1792,37 @@ margin-bottom: 10px; } -.mournblade-roll-dialog .weapon-section { +.mournblade-cyd2-roll-dialog .weapon-section { background: rgba(184, 134, 11, 0.1); - padding: 8px; + padding: 6px 8px; border-radius: 4px; border: 1px solid rgba(184, 134, 11, 0.3); - margin-bottom: 10px; -} - -.mournblade-roll-dialog .weapon-info { - display: flex; - justify-content: space-between; - align-items: center; - padding: 5px 8px; - background: rgba(184, 134, 11, 0.15); - border-radius: 3px; margin-bottom: 8px; } -.mournblade-roll-dialog .weapon-info .weapon-label { +.mournblade-cyd2-roll-dialog .weapon-info { + display: flex; + justify-content: space-between; + align-items: center; + padding: 4px 6px; + background: rgba(184, 134, 11, 0.15); + border-radius: 3px; + margin-bottom: 6px; +} + +.mournblade-cyd2-roll-dialog .weapon-info .weapon-label { font-weight: bold; font-size: 0.9rem; color: #1a1a1a; } -.mournblade-roll-dialog .weapon-info .weapon-bonus { +.mournblade-cyd2-roll-dialog .weapon-info .weapon-bonus { font-size: 0.85rem; - color: #8b0000; + color: #8b4513; font-weight: bold; } -.mournblade-roll-dialog .defense-info { +.mournblade-cyd2-roll-dialog .defense-info { display: flex; justify-content: space-between; align-items: center; @@ -1828,79 +1832,88 @@ margin-bottom: 8px; } -.mournblade-roll-dialog .defense-info .defense-label { +.mournblade-cyd2-roll-dialog .defense-info .defense-label { font-size: 0.85rem; color: #1a1a1a; font-weight: bold; } -.mournblade-roll-dialog .defense-info .defense-value { +.mournblade-cyd2-roll-dialog .defense-info .defense-value { font-size: 1rem; color: #006400; font-weight: bold; } /* Combat modifiers */ -.mournblade-roll-dialog .combat-modifiers, -.mournblade-roll-dialog .ranged-combat-section { - background: rgba(139, 0, 0, 0.1); - padding: 8px; +.mournblade-cyd2-roll-dialog .combat-modifiers, +.mournblade-cyd2-roll-dialog .ranged-combat-section { + background: rgba(139, 69, 19, 0.1); + padding: 6px 8px; border-radius: 4px; - border: 1px solid rgba(139, 0, 0, 0.3); - margin-bottom: 10px; + border: 1px solid rgba(139, 69, 19, 0.3); + margin-bottom: 8px; } -.mournblade-roll-dialog .combat-modifiers h4, -.mournblade-roll-dialog .ranged-combat-section h4 { - margin: 0 0 8px 0; +.mournblade-cyd2-roll-dialog .combat-modifiers h4, +.mournblade-cyd2-roll-dialog .ranged-combat-section h4 { + margin: 0 0 6px 0; color: #2a2a2a; text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); - font-size: 0.95rem; + font-size: 0.9rem; font-weight: bold; } -.mournblade-roll-dialog .modifiers-columns { +.mournblade-cyd2-roll-dialog .modifiers-columns { display: grid; grid-template-columns: repeat(2, 1fr); - gap: 5px 10px; + gap: 3px 8px; + margin-bottom: 6px; } -.mournblade-roll-dialog .checkbox-label { +.mournblade-cyd2-roll-dialog .checkbox-label { display: flex; align-items: center; - gap: 6px; - padding: 4px 6px; + gap: 5px; + padding: 3px 4px; cursor: pointer; border-radius: 3px; transition: background 0.2s ease; } -.mournblade-roll-dialog .checkbox-label:hover { +.mournblade-cyd2-roll-dialog .checkbox-label:hover { background: rgba(255, 255, 255, 0.15); } -.mournblade-roll-dialog .checkbox-label input[type="checkbox"] { +.mournblade-cyd2-roll-dialog .checkbox-label input[type="checkbox"] { width: auto; margin: 0; + flex-shrink: 0; cursor: pointer; - accent-color: #8b0000; + accent-color: #8b4513; } -.mournblade-roll-dialog .checkbox-label span { +.mournblade-cyd2-roll-dialog .checkbox-label span { color: #1a1a1a; - font-size: 0.85rem; + font-size: 0.82rem; user-select: none; text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5); + line-height: 1.2; } -.mournblade-roll-dialog .checkbox-label.highlight { +.mournblade-cyd2-roll-dialog .checkbox-label.highlight { background: rgba(255, 215, 0, 0.15); border: 1px solid rgba(255, 215, 0, 0.4); font-weight: bold; } -.mournblade-roll-dialog .info-message { +/* Ranged combat: 1-column grid for selects (long labels) */ +.mournblade-cyd2-roll-dialog .ranged-combat-section .modifiers-grid { + grid-template-columns: 1fr; + gap: 4px; +} + +.mournblade-cyd2-roll-dialog .info-message { padding: 6px 10px; background: rgba(33, 150, 243, 0.1); border-left: 3px solid rgba(33, 150, 243, 0.6); @@ -1912,7 +1925,7 @@ /* Malus section */ -.mournblade-roll-dialog .malus-section { +.mournblade-cyd2-roll-dialog .malus-section { background: rgba(100, 100, 100, 0.1); padding: 8px; border-radius: 4px; @@ -1920,13 +1933,13 @@ margin-bottom: 10px; } -.mournblade-roll-dialog .malus-grid { +.mournblade-cyd2-roll-dialog .malus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; } -.mournblade-roll-dialog .malus-item { +.mournblade-cyd2-roll-dialog .malus-item { display: flex; justify-content: space-between; align-items: center; @@ -1935,20 +1948,20 @@ border-radius: 3px; } -.mournblade-roll-dialog .malus-item .malus-label { +.mournblade-cyd2-roll-dialog .malus-item .malus-label { font-size: 0.85rem; color: #2a2a2a; font-weight: 500; } -.mournblade-roll-dialog .malus-item .malus-value { +.mournblade-cyd2-roll-dialog .malus-item .malus-value { font-size: 0.95rem; - color: #8b0000; + color: #8b4513; font-weight: bold; } /* Registered modifiers */ -.mournblade-roll-dialog .registered-modifiers { +.mournblade-cyd2-roll-dialog .registered-modifiers { background: rgba(75, 0, 130, 0.1); padding: 8px; border-radius: 4px; @@ -1956,7 +1969,7 @@ margin-bottom: 10px; } -.mournblade-roll-dialog .registered-modifiers h4 { +.mournblade-cyd2-roll-dialog .registered-modifiers h4 { margin: 0 0 6px 0; color: #2a2a2a; text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); @@ -1964,30 +1977,32 @@ font-weight: bold; } -.mournblade-roll-dialog .registered-modifiers h4 i { +.mournblade-cyd2-roll-dialog .registered-modifiers h4 i { margin-right: 6px; color: #4b0082; } -.mournblade-roll-dialog .modifier-item { +.mournblade-cyd2-roll-dialog .modifier-item { margin-bottom: 4px; } /* Special option */ -.mournblade-roll-dialog .special-option { +.mournblade-cyd2-roll-dialog .special-option { margin-top: 10px; } /* Dialog buttons */ -.mournblade-roll-dialog .dialog-buttons { +.mournblade-cyd2-roll-dialog .dialog-buttons, +.mournblade-cyd2-roll-dialog .form-footer { display: flex; gap: 10px; - padding: 10px; - border-top: 2px solid rgba(139, 0, 0, 0.3); + padding: 10px 12px 14px !important; + border-top: 2px solid rgba(139, 69, 19, 0.3); background: rgba(0, 0, 0, 0.05); } -.mournblade-roll-dialog .dialog-buttons button { +.mournblade-cyd2-roll-dialog .dialog-buttons button, +.mournblade-cyd2-roll-dialog .form-footer button { flex: 1; padding: 8px 14px; border: none; @@ -2000,33 +2015,46 @@ text-transform: uppercase; } -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld10"], -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld20"] { - background: linear-gradient(135deg, #8b0000 0%, #6d0808 100%); - color: #f5f5f5; +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld10"], +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld20"], +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld10"], +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld20"] { + background: rgba(100, 100, 100, 0.3) !important; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); } -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld10"]:hover, -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld20"]:hover { - background: linear-gradient(135deg, #a00000 0%, #8b0000 100%); - transform: translateY(-2px); - box-shadow: 0 4px 8px rgba(139, 0, 0, 0.5); +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld10"]:hover, +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld20"]:hover, +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld10"]:hover, +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld20"]:hover { + background: rgba(100, 100, 100, 0.5) !important; + transform: translateY(-1px); } -.mournblade-roll-dialog .dialog-buttons button[data-action="cancel"] { +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="cancel"], +.mournblade-cyd2-roll-dialog .form-footer button[data-action="cancel"] { background: rgba(100, 100, 100, 0.3); color: #2a2a2a; } -.mournblade-roll-dialog .dialog-buttons button[data-action="cancel"]:hover { +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="cancel"]:hover, +.mournblade-cyd2-roll-dialog .form-footer button[data-action="cancel"]:hover { background: rgba(100, 100, 100, 0.5); } +/* Affichage d'une valeur non-éditable dans le dialog */ +.mournblade-cyd2-roll-dialog .field-value { + display: inline-block; + font-weight: bold; + color: #8b4513; + font-size: 0.95rem; + padding: 0 4px; +} + /* ==================== Sheet Mode Toggle Button ==================== */ .sheet-mode-toggle { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); - border: 1px solid #8b0000; + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); + border: 1px solid #8b4513; border-radius: 3px; color: #f5f5f5; padding: 2px 4px; @@ -2041,7 +2069,7 @@ flex-shrink: 0; &:hover { - background: linear-gradient(135deg, #a00000 0%, #5a0505 100%); + background: linear-gradient(135deg, #a06010 0%, #4a2200 100%); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); } @@ -2054,15 +2082,15 @@ /* ==================== Chat Message Styles ==================== */ .mournblade-chat-result { - background: linear-gradient(135deg, rgba(74, 4, 4, 0.2) 0%, rgba(139, 0, 0, 0.15) 100%); - border: 2px solid #8b0000; + background: linear-gradient(135deg, rgba(42, 20, 0, 0.2) 0%, rgba(139, 69, 19, 0.15) 100%); + border: 2px solid #8b4513; border-radius: 4px; overflow: hidden; font-family: CentaurMT, serif; .chat-result-header { - background: linear-gradient(135deg, #4a0404 0%, #2a0202 100%); - border-bottom: 2px solid #8b0000; + background: linear-gradient(135deg, #2a1400 0%, #2a0202 100%); + border-bottom: 2px solid #8b4513; padding: 8px; display: flex; align-items: center; @@ -2072,7 +2100,7 @@ width: 48px; height: 48px; border-radius: 4px; - border: 1px solid #8b0000; + border: 1px solid #8b4513; object-fit: cover; flex-shrink: 0; } @@ -2103,7 +2131,7 @@ .result-main { background: rgba(255, 250, 240, 0.9); padding: 4px 8px; - border-bottom: 1px solid rgba(139, 0, 0, 0.3); + border-bottom: 1px solid rgba(139, 69, 19, 0.3); .result-display { display: flex; @@ -2120,10 +2148,10 @@ background: rgba(255, 255, 255, 0.7); padding: 4px 6px; border-radius: 4px; - border: 1px solid rgba(139, 0, 0, 0.2); + border: 1px solid rgba(139, 69, 19, 0.2); i { - color: #8b0000; + color: #8b4513; font-size: 1rem; display: block; margin-bottom: 2px; @@ -2138,7 +2166,7 @@ .total-value, .difficulty-value { font-size: 1.5rem; - color: #8b0000; + color: #8b4513; text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); font-weight: bold; line-height: 1.2; @@ -2147,12 +2175,31 @@ .total-label, .difficulty-label { font-size: 0.75rem; - color: #4a0404; + color: #2a1400; text-transform: uppercase; font-weight: bold; line-height: 1.1; } } + + .d20-impair { + flex: 2; + background: rgba(180, 60, 0, 0.12); + border-color: rgba(180, 60, 0, 0.4); + + i { + color: #b03000; + display: inline; + margin-right: 4px; + } + + .dice-value { + display: inline; + font-size: 0.85rem; + color: #b03000; + font-weight: bold; + } + } } .result-badge-container { @@ -2186,7 +2233,7 @@ } &.failure { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); color: white; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); } @@ -2219,7 +2266,7 @@ &.bonus { background: rgba(255, 200, 200, 0.6); - border: 1px solid rgba(139, 0, 0, 0.5); + border: 1px solid rgba(139, 69, 19, 0.5); } &.malus { @@ -2248,13 +2295,13 @@ .result-effects { padding: 8px; background: rgba(255, 230, 230, 0.4); - border-top: 1px solid rgba(139, 0, 0, 0.3); + border-top: 1px solid rgba(139, 69, 19, 0.3); .effect-item { padding: 5px 8px; margin-bottom: 5px; background: rgba(255, 255, 255, 0.7); - border-left: 3px solid #8b0000; + border-left: 3px solid #8b4513; border-radius: 3px; color: #000000; font-size: 0.85rem; @@ -2266,7 +2313,7 @@ i { margin-right: 6px; - color: #8b0000; + color: #8b4513; } &:last-child { @@ -2311,8 +2358,8 @@ } .chat-card-button { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); - border: 1px solid #8b0000; + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); + border: 1px solid #8b4513; border-radius: 3px; color: #f5f5f5; padding: 6px 12px; @@ -2327,7 +2374,7 @@ } &:hover { - background: linear-gradient(135deg, #a00000 0%, #5a0505 100%); + background: linear-gradient(135deg, #a06010 0%, #4a2200 100%); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); } @@ -2343,12 +2390,119 @@ } } +/* Tag non-létaux dans les messages de dégâts */ +.mournblade-chat-result .non-lethal-tag { + font-size: 0.8rem; + color: #888; + font-style: italic; + margin-left: 4px; +} + + /* -------------------------------------------- */ -/* Welcome Message Styling */ +.mournblade-post-item { + background: linear-gradient(135deg, rgba(42, 20, 0, 0.15) 0%, rgba(139, 69, 19, 0.1) 100%); + border: 2px solid #8b4513; + border-radius: 6px; + overflow: hidden; + font-family: CentaurMT, serif; + margin: 4px 0; + + .post-item-header { + background: linear-gradient(135deg, #2a1400 0%, #3a1800 100%); + border-bottom: 2px solid #8b4513; + padding: 8px 10px; + display: flex; + align-items: center; + gap: 10px; + + .post-item-img { + width: 44px; + height: 44px; + border-radius: 4px; + border: 1px solid #8b4513; + object-fit: cover; + flex-shrink: 0; + } + + .post-item-title { + flex: 1; + + .post-item-name { + margin: 0 0 2px 0; + color: #ffd700; + font-size: 1.1rem; + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9); + line-height: 1.2; + } + + .post-item-type { + font-size: 0.75rem; + color: #f5e6d3; + font-style: italic; + opacity: 0.8; + text-transform: capitalize; + } + } + } + + .post-item-stats { + display: flex; + flex-wrap: wrap; + gap: 4px; + padding: 6px 8px; + background: rgba(139, 69, 19, 0.08); + border-bottom: 1px solid rgba(139, 69, 19, 0.3); + + .post-stat { + display: flex; + align-items: center; + gap: 4px; + background: rgba(255, 255, 255, 0.7); + border: 1px solid rgba(139, 69, 19, 0.4); + border-radius: 3px; + padding: 2px 6px; + font-size: 0.8rem; + + &.post-stat-full { + flex: 1 1 100%; + } + + .stat-label { + color: #8b4513; + font-weight: bold; + font-size: 0.75rem; + } + + .stat-value { + color: #2a1400; + font-size: 0.8rem; + } + } + } + + .post-item-description { + padding: 8px 10px; + color: #2a1400; + font-size: 0.9rem; + line-height: 1.4; + background: rgba(245, 230, 211, 0.85); + + p { + margin: 4px 0; + } + + em, i { + color: #5a2d00; + } + } +} + + /* -------------------------------------------- */ .mournblade-welcome-message { - background: linear-gradient(135deg, rgba(139, 0, 0, 0.15) 0%, rgba(74, 4, 4, 0.2) 100%); - border: 2px solid #8b0000; + background: linear-gradient(135deg, rgba(139, 69, 19, 0.15) 0%, rgba(42, 20, 0, 0.2) 100%); + border: 2px solid #8b4513; border-radius: 8px; padding: 0; margin: 8px 0; @@ -2357,7 +2511,7 @@ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); .welcome-header { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); padding: 10px; text-align: center; border-bottom: 2px solid #ffd700; @@ -2400,7 +2554,7 @@ margin-bottom: 10px; padding: 8px; background: rgba(255, 255, 255, 0.6); - border-left: 4px solid #8b0000; + border-left: 4px solid #8b4513; border-radius: 4px; &:last-child { @@ -2410,7 +2564,7 @@ .section-icon { flex-shrink: 0; font-size: 1.3rem; - color: #8b0000; + color: #8b4513; width: 28px; text-align: center; } @@ -2421,7 +2575,7 @@ strong { display: block; - color: #8b0000; + color: #8b4513; font-size: 1rem; margin-bottom: 2px; line-height: 1.2; @@ -2436,7 +2590,7 @@ .welcome-link { display: inline-block; margin-top: 4px; - color: #8b0000; + color: #8b4513; font-weight: 600; text-decoration: none; transition: all 0.2s; @@ -2447,8 +2601,8 @@ } &:hover { - color: #a00000; - text-shadow: 0 0 4px rgba(139, 0, 0, 0.3); + color: #a06010; + text-shadow: 0 0 4px rgba(139, 69, 19, 0.3); transform: translateX(2px); } } @@ -2457,7 +2611,7 @@ } .welcome-footer { - background: linear-gradient(135deg, #4a0404 0%, #8b0000 100%); + background: linear-gradient(135deg, #2a1400 0%, #8b4513 100%); padding: 8px; text-align: center; color: #ffd700; diff --git a/modules/applications/mournblade-cyd2-roll-dialog.mjs b/modules/applications/mournblade-cyd2-roll-dialog.mjs index 100571a..e706ff5 100644 --- a/modules/applications/mournblade-cyd2-roll-dialog.mjs +++ b/modules/applications/mournblade-cyd2-roll-dialog.mjs @@ -28,7 +28,7 @@ export class MournbladeCYD2RollDialog { return foundry.applications.api.DialogV2.wait({ window: { title: "Test de Capacité", icon: "fa-solid fa-dice-d20" }, classes: ["mournblade-cyd2-roll-dialog"], - position: { width: 360 }, + position: { width: 470 }, modal: false, content, buttons: [ @@ -38,8 +38,8 @@ export class MournbladeCYD2RollDialog { icon: "fa-solid fa-dice-d10", default: true, callback: (event, button, dialog) => { - MournbladeCYD2RollDialog._updateRollDataFromForm(rollData, button.form.elements, actor); - rollData.mainDice = "1d10"; + MournbladeCYD2RollDialog._updateRollDataFromForm(rollData, button.form, actor); + rollData.mainDice = "d10"; MournbladeCYD2Utility.rollMournbladeCYD2(rollData); } }, @@ -48,8 +48,8 @@ export class MournbladeCYD2RollDialog { label: "Lancer 1d20", icon: "fa-solid fa-dice-d20", callback: (event, button, dialog) => { - MournbladeCYD2RollDialog._updateRollDataFromForm(rollData, button.form.elements, actor); - rollData.mainDice = "1d20"; + MournbladeCYD2RollDialog._updateRollDataFromForm(rollData, button.form, actor); + rollData.mainDice = "d20"; MournbladeCYD2Utility.rollMournbladeCYD2(rollData); } }, @@ -63,19 +63,47 @@ export class MournbladeCYD2RollDialog { } /* -------------------------------------------- */ - static _updateRollDataFromForm(rollData, elements, actor) { - if (elements.modificateur) rollData.modificateur = Number(elements.modificateur.value); - if (elements.difficulte) rollData.difficulte = Number(elements.difficulte.value); - if (elements.attrKey) rollData.attrKey = String(elements.attrKey.value); - if (elements.attrKey2) rollData.attrKey2 = String(elements.attrKey2.value); - if (elements["select-maitrise"]) rollData.maitriseId = String(elements["select-maitrise"].value); - if (elements["competence-talents"]) { - const sel = elements["competence-talents"]; + static _updateRollDataFromForm(rollData, form, actor) { + const el = form.elements; + const getVal = (name) => el[name]?.value; + const getChecked = (name) => { + const e = form.querySelector(`#${name}`); + return e ? e.checked : false; + }; + + if (el.modificateur) rollData.modificateur = Number(getVal("modificateur")); + if (el["bonus-malus-context"]) rollData.bonusMalusContext = Number(getVal("bonus-malus-context")); + if (el.difficulte) rollData.difficulte = Number(getVal("difficulte")); + if (el.attrKey) rollData.attrKey = String(getVal("attrKey")); + if (el.attrKey2) rollData.attrKey2 = String(getVal("attrKey2")); + if (el["select-maitrise"]) rollData.maitriseId = String(getVal("select-maitrise")); + if (el["competence-talents"]) { + const sel = el["competence-talents"]; rollData.selectedTalents = Array.from(sel.selectedOptions).map(o => o.value); } - if (elements["taille-cible"]) rollData.tailleCible = String(elements["taille-cible"].value); - if (elements["tireur-deplacement"]) rollData.tireurDeplacement = String(elements["tireur-deplacement"].value); - if (elements["cible-couvert"]) rollData.cibleCouvert = String(elements["cible-couvert"].value); - if (elements["distance-tir"]) rollData.distanceTir = String(elements["distance-tir"].value); + if (el["taille-cible"]) rollData.tailleCible = String(getVal("taille-cible")); + if (el["tireur-deplacement"]) rollData.tireurDeplacement = String(getVal("tireur-deplacement")); + if (el["cible-couvert"]) rollData.cibleCouvert = String(getVal("cible-couvert")); + if (el["distance-tir"]) rollData.distanceTir = String(getVal("distance-tir")); + if (el["soutiens"]) rollData.soutiens = Number(getVal("soutiens")); + if (el["runemode"]) rollData.runemode = String(getVal("runemode")); + if (el["runeame"]) rollData.runeame = Number(getVal("runeame")); + + rollData.defenseurAuSol = getChecked("defenseur-au-sol"); + rollData.defenseurAveugle = getChecked("defenseur-aveugle"); + rollData.defenseurDeDos = getChecked("defenseur-de-dos"); + rollData.defenseurRestreint = getChecked("defenseur-restreint"); + rollData.defenseurImmobilise = getChecked("defenseur-immobilise"); + rollData.attaquantsMultiples = getChecked("attaquants-multiple"); + rollData.ambidextre1 = getChecked("ambidextre-1"); + rollData.ambidextre2 = getChecked("ambidextre-2"); + rollData.feinte = getChecked("feinte"); + rollData.attaqueCharge = getChecked("attaque-charge"); + rollData.chargeCavalerie = getChecked("charge-cavalerie"); + rollData.contenir = getChecked("contenir"); + rollData.attaqueDesarme = getChecked("attaque-desarme"); + rollData.cibleDeplace = getChecked("tireur-cible-deplace"); + rollData.cibleCaC = getChecked("cible-cac"); + rollData.cibleconsciente = getChecked("cibleconsciente"); } } diff --git a/modules/applications/sheets/base-actor-sheet.mjs b/modules/applications/sheets/base-actor-sheet.mjs index 656b57d..888e7ff 100644 --- a/modules/applications/sheets/base-actor-sheet.mjs +++ b/modules/applications/sheets/base-actor-sheet.mjs @@ -113,7 +113,7 @@ export default class MournbladeCYD2ActorSheetV2 extends HandlebarsApplicationMix const dataType = target.dataset.dtype; const value = dataType === "Number" ? Number(target.value) : target.value; const item = this.document.items.get(itemId); - if (item) await item.update({ [itemField]: value }); + if (item) await item.update({ [`system.${itemField}`]: value }); }); }); diff --git a/modules/mournblade-cyd2-actor-sheet.js b/modules/mournblade-cyd2-actor-sheet.js deleted file mode 100644 index 296bd32..0000000 --- a/modules/mournblade-cyd2-actor-sheet.js +++ /dev/null @@ -1,211 +0,0 @@ -/** - * Extend the basic ActorSheet with some very simple modifications - * @extends {ActorSheet} - */ - -import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js"; -import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js"; - -/* -------------------------------------------- */ -export class MournbladeCYD2ActorSheet extends foundry.appv1.sheets.ActorSheet { - - /** @override */ - static get defaultOptions() { - - return foundry.utils.mergeObject(super.defaultOptions, { - classes: ["fvtt-mournblade-cyd-2-0", "sheet", "actor"], - template: "systems/fvtt-mournblade-cyd-2-0/templates/actor-sheet.hbs", - width: 640, - height: 720, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }], - dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], - editScore: false - }) - } - - /* -------------------------------------------- */ - async getData() { - const objectData = foundry.utils.duplicate(this.object) - - let formData = { - title: this.title, - id: objectData.id, - type: objectData.type, - img: objectData.img, - name: objectData.name, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - system: objectData.system, - effects: this.object.effects.map(e => foundry.utils.deepClone(e.data)), - limited: this.object.limited, - skills: this.actor.getSkills(), - armes: foundry.utils.duplicate(this.actor.getWeapons()), - monnaies: foundry.utils.duplicate(this.actor.getMonnaies()), - protections: foundry.utils.duplicate(this.actor.getArmors()), - historiques: foundry.utils.duplicate(this.actor.getHistoriques() || []), - talents: foundry.utils.duplicate(this.actor.getTalents() || []), - dons: foundry.utils.duplicate(this.actor.getDons() || []), - pactes: foundry.utils.duplicate(this.actor.getPactes() || []), - tendances: foundry.utils.duplicate(this.actor.getTendances() || []), - runes: foundry.utils.duplicate(this.actor.getRunes() || []), - traitsChaotiques: foundry.utils.duplicate(this.actor.getTraitsChaotiques() || []), - traitsEspeces: foundry.utils.duplicate(this.actor.getTraitsEspeces() || []), - aspect: this.actor.getAspect(), - marge: this.actor.getMarge(), - profils: foundry.utils.duplicate(this.actor.getProfils() || []), - combat: this.actor.getCombatValues(), - equipements: foundry.utils.duplicate(this.actor.getEquipments()), - richesse: this.actor.computeRichesse(), - coupDevastateur: this.actor.items.find(it => it.type == "talent" && it.name.toLowerCase() == "coup devastateur" && !it.system.used), - valeurEquipement: this.actor.computeValeurEquipement(), - nbCombativite: this.actor.system.sante.nbcombativite, - combativiteList: MournbladeCYD2Utility.getCombativiteList(this.actor.system.sante.nbcombativite), - nbAme: this.actor.system.ame.nbame, - ameMax: this.actor.getAmeMax(), - ameList: MournbladeCYD2Utility.getAmeList(this.actor.system.ame.nbame, this.actor.getAmeMax()), - ameMaxList: MournbladeCYD2Utility.getAmeMaxList(this.actor.system.ame.nbame), - initiative: this.actor.getFlag("world", "last-initiative") || -1, - description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.description, { async: true }), - habitat: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.biodata.habitat, { async: true }), - options: this.options, - owner: this.document.isOwner, - editScore: this.options.editScore, - isGM: game.user.isGM, - config: game.system.mournbladecyd2.config - } - this.formData = formData; - - console.log("PC : ", formData, this.object); - return formData; - } - - /* -------------------------------------------- */ - /** @override */ - activateListeners(html) { - super.activateListeners(html); - - // Everything below here is only needed if the sheet is editable - if (!this.options.editable) return; - - // Update Inventory Item - html.find('.item-edit').click(ev => { - const li = $(ev.currentTarget).parents(".item") - let itemId = li.data("item-id") - const item = this.actor.items.get(itemId) - item.sheet.render(true) - }) - // Delete Inventory Item - html.find('.item-delete').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - MournbladeCYD2Utility.confirmDelete(this, li); - }) - html.find('.edit-item-data').change(ev => { - const li = $(ev.currentTarget).parents(".item") - let itemId = li.data("item-id") - let itemType = li.data("item-type") - let itemField = $(ev.currentTarget).data("item-field") - let dataType = $(ev.currentTarget).data("dtype") - let value = ev.currentTarget.value - this.actor.editItemField(itemId, itemType, itemField, dataType, value) - }) - - html.find('.adversite-modify').click(event => { - const li = $(event.currentTarget).parents(".item") - let adv = li.data("adversite") - let value = Number($(event.currentTarget).data("adversite-value")) - this.actor.incDecAdversite(adv, value) - }) - - html.find('.quantity-modify').click(event => { - const li = $(event.currentTarget).parents(".item") - const value = Number($(event.currentTarget).data("quantite-value")) - this.actor.incDecQuantity(li.data("item-id"), value); - }) - - html.find('.roll-initiative').click((event) => { - this.actor.rollAttribut("adr", true) - }) - - html.find('.roll-attribut').click((event) => { - const li = $(event.currentTarget).parents(".item") - let attrKey = li.data("attr-key") - this.actor.rollAttribut(attrKey, false) - }) - html.find('.roll-competence').click((event) => { - const li = $(event.currentTarget).parents(".item") - let attrKey = $(event.currentTarget).data("attr-key") - let compId = li.data("item-id") - this.actor.rollCompetence(attrKey, compId) - }) - html.find('.roll-arme-offensif').click((event) => { - const li = $(event.currentTarget).parents(".item") - let armeId = li.data("item-id") - this.actor.rollArmeOffensif(armeId) - }) - - html.find('.roll-assommer').click((event) => { - this.actor.rollAssommer() - }) - html.find('.roll-coup-bas').click((event) => { - this.actor.rollCoupBas() - }) - html.find('.roll-immobiliser').click((event) => { - this.actor.rollImmobiliser() - }) - html.find('.roll-repousser').click((event) => { - this.actor.rollRepousser() - }) - html.find('.roll-desengager').click((event) => { - this.actor.rollDesengager() - }) - - html.find('.roll-arme-degats').click((event) => { - const li = $(event.currentTarget).parents(".item") - let armeId = li.data("item-id") - this.actor.rollArmeDegats(armeId) - }) - - html.find('.item-add').click((event) => { - const itemType = $(event.currentTarget).data("type") - this.actor.createEmbeddedDocuments('Item', [{ name: `Nouveau ${itemType}`, type: itemType }], { renderSheet: true }) - }) - - html.find('.lock-unlock-sheet').click((event) => { - this.options.editScore = !this.options.editScore; - this.render(true); - }); - html.find('.item-equip').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - this.actor.equipItem(li.data("item-id")); - this.render(true); - }); - - } - - /* -------------------------------------------- */ - /** @override */ - setPosition(options = {}) { - const position = super.setPosition(options); - const sheetBody = this.element.find(".sheet-body"); - const bodyHeight = position.height - 192; - sheetBody.css("height", bodyHeight); - return position; - } - - /* -------------------------------------------- */ - async _onDropItem(event, dragData) { - let data = event.dataTransfer.getData('text/plain') - let dataItem = JSON.parse(data) - let item = fromUuidSync(dataItem.uuid) - if (item.pack) { - item = await MournbladeCYD2Utility.searchItem(item) - } - let autoresult = MournbladeCYD2Automation.processAutomations("on-drop", item, this.actor) - if (autoresult.isValid) { - super._onDropItem(event, dragData) - } else { - ui.notifications.warn(autoresult.warningMessage) - } - } - -} diff --git a/modules/mournblade-cyd2-actor.js b/modules/mournblade-cyd2-actor.js index 78247ca..ea2be2e 100644 --- a/modules/mournblade-cyd2-actor.js +++ b/modules/mournblade-cyd2-actor.js @@ -774,7 +774,7 @@ export class MournbladeCYD2Actor extends Actor { /* -------------------------------------------- */ async rollAttribut(attrKey, isInit = false) { let rollData = this.getCommonRollData(attrKey) - rollData.multiplier = (isInit) ? 1 : 2 + rollData.multiplier = 1 // 1d10 + attr (optionally + attr2 if chosen in dialog) rollData.isInit = isInit await MournbladeCYD2RollDialog.create(this, rollData) } @@ -842,6 +842,33 @@ export class MournbladeCYD2Actor extends Actor { await MournbladeCYD2RollDialog.create(this, rollData) } + /* -------------------------------------------- */ + subPointsAme(runeMode, value) { + let ame = foundry.utils.duplicate(this.system.ame) + if (runeMode == "prononcer") { + ame.etat += value + ame.etat = Math.min(ame.etat, ame.nbame) + } else { + ame.max = (ame.max || 0) + value + } + this.update({ 'system.ame': ame }) + } + + /* -------------------------------------------- */ + async rollRune(runeId) { + let comp = this.items.find(item => item.type == "competence" && item.name.toLowerCase() == "savoir : runes") + if (!comp) { + ui.notifications.warn("La compétence « Savoir : Runes » n'a pas été trouvée sur ce personnage.") + return + } + let rollData = this.getCommonRollData("cla", comp.id) + rollData.rune = foundry.utils.duplicate(this.items.get(runeId) || {}) + rollData.difficulte = rollData.rune?.system?.seuil || 0 + rollData.runemode = "prononcer" + rollData.runeame = 1 + await MournbladeCYD2RollDialog.create(this, rollData) + } + /* -------------------------------------------- */ async rollArmeDegats(armeId, targetVigueur = undefined, rollDataInput = undefined) { let arme = this.items.get(armeId) @@ -886,6 +913,7 @@ export class MournbladeCYD2Actor extends Actor { //console.log(roll) let rollData = { arme: arme, + diceResult: roll.dice[0]?.total ?? roll.total, finalResult: roll.total, formula: roll.formula, alias: this.name, diff --git a/modules/mournblade-cyd2-config.js b/modules/mournblade-cyd2-config.js index e62a721..9ac6f93 100644 --- a/modules/mournblade-cyd2-config.js +++ b/modules/mournblade-cyd2-config.js @@ -52,9 +52,9 @@ export const MOURNBLADECYD2_CONFIG = { { key: "30", label: "Pure Folie (30)" } ], optionsDistanceTir: [ - { key: "porteecourte", label: "Courte ({protectionDefenseur}+5)" }, - { key: "porteemoyenne", label: "Moyenne ({protectionDefenseur}+9)" }, - { key: "porteelongue", label: "Longue ({protectionDefenseur}+14)" } + { key: "porteecourte", label: "Courte (base +5)" }, + { key: "porteemoyenne", label: "Moyenne (base +9)" }, + { key: "porteelongue", label: "Longue (base +14)" } ], optionsBonusMalus: [ { key: "-10", label: "-10" }, diff --git a/modules/mournblade-cyd2-creature-sheet.js b/modules/mournblade-cyd2-creature-sheet.js deleted file mode 100644 index e3fcd2d..0000000 --- a/modules/mournblade-cyd2-creature-sheet.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Extend the basic ActorSheet with some very simple modifications - * @extends {ActorSheet} - */ - - import { MournbladeCYD2ActorSheet } from "./mournblade-cyd2-actor-sheet.js"; -import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js"; -import { MournbladeCYD2Automation } from "./mournblade-cyd2-automation.js"; - -/* -------------------------------------------- */ -export class MournbladeCYD2CreatureSheet extends MournbladeCYD2ActorSheet { - - /** @override */ - static get defaultOptions() { - - return foundry.utils.mergeObject(super.defaultOptions, { - classes: ["fvtt-mournblade-cyd-2-0", "sheet", "actor"], - template: "systems/fvtt-mournblade-cyd-2-0/templates/creature-sheet.hbs", - width: 640, - height: 720, - tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "stats" }], - dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }], - editScore: false - }) - } -} diff --git a/modules/mournblade-cyd2-item-sheet.js b/modules/mournblade-cyd2-item-sheet.js deleted file mode 100644 index b60967b..0000000 --- a/modules/mournblade-cyd2-item-sheet.js +++ /dev/null @@ -1,228 +0,0 @@ -import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js"; - -/** - * Extend the basic ItemSheet with some very simple modifications - * @extends {ItemSheet} - */ -export class MournbladeCYD2ItemSheet extends foundry.appv1.sheets.ItemSheet { - - /** @override */ - static get defaultOptions() { - - return foundry.utils.mergeObject(super.defaultOptions, { - classes: ["fvtt-mournblade-cyd-2-0", "sheet", "item"], - template: "systems/fvtt-mournblade-cyd-2-0/templates/item-sheet.hbs", - dragDrop: [{ dragSelector: null, dropSelector: null }], - width: 620, - height: 550, - tabs: [{navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "description"}] - }); - } - - /* -------------------------------------------- */ - _getHeaderButtons() { - let buttons = super._getHeaderButtons(); - // Add "Post to chat" button - // We previously restricted this to GM and editable items only. If you ever find this comment because it broke something: eh, sorry! - buttons.unshift( - { - class: "post", - icon: "fas fa-comment", - onclick: ev => { } - }) - return buttons - } - - /* -------------------------------------------- */ - /** @override */ - setPosition(options = {}) { - const position = super.setPosition(options); - const sheetBody = this.element.find(".sheet-body"); - const bodyHeight = position.height - 192; - sheetBody.css("height", bodyHeight); - if (this.item.type.includes('weapon')) { - position.width = 640; - } - return position; - } - - /* -------------------------------------------- */ - async getData() { - const objectData = foundry.utils.duplicate(this.object) - let formData = { - title: this.title, - id: this.id, - type: objectData.type, - img: objectData.img, - name: objectData.name, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - attributs: MournbladeCYD2Utility.getAttributs(), - system: objectData.system, - limited: this.object.limited, - options: this.options, - owner: this.document.isOwner, - description: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.description, {async: true}), - mr: (this.object.type == 'specialisation'), - isGM: game.user.isGM, - config: game.system.mournbladecyd2.config - } - - if ( objectData.type == "don") { - formData.sacrifice = await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.object.system.sacrifice, {async: true}) - } - //this.options.editable = !(this.object.origin == "embeddedItem"); - console.log("ITEM DATA", formData, this); - return formData; - } - - - /* -------------------------------------------- */ - _getHeaderButtons() { - let buttons = super._getHeaderButtons(); - buttons.unshift({ - class: "post", - icon: "fas fa-comment", - onclick: ev => this.postItem() - }); - return buttons - } - - /* -------------------------------------------- */ - postItem() { - let chatData = foundry.utils.duplicate(MournbladeCYD2Utility.data(this.item)); - if (this.actor) { - chatData.actor = { id: this.actor.id }; - } - // Don't post any image for the item (which would leave a large gap) if the default image is used - if (chatData.img.includes("/blank.png")) { - chatData.img = null; - } - // JSON object for easy creation - chatData.jsondata = JSON.stringify( - { - compendium: "postedItem", - payload: chatData, - }); - - renderTemplate('systems/fvtt-mournblade-cyd-2-0/templates/post-item.hbs', chatData).then(html => { - let chatOptions = MournbladeCYD2Utility.chatDataSetup(html); - ChatMessage.create(chatOptions) - }); - } - - /* -------------------------------------------- */ - /** @override */ - activateListeners(html) { - super.activateListeners(html); - - // Everything below here is only needed if the sheet is editable - if (!this.options.editable) return; - - - // Update Inventory Item - html.find('.item-edit').click(ev => { - const li = $(ev.currentTarget).parents(".item") - const item = this.object.options.actor.getOwnedItem(li.data("item-id")) - item.sheet.render(true); - }); - - html.find('.delete-subitem').click(ev => { - this.deleteSubitem(ev); - }) - html.find('.edit-predilection').change(ev => { - const li = $(ev.currentTarget).parents(".prediction-item") - let index = li.data("prediction-index") - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred[index].name = ev.currentTarget.value - pred[index].id = pred[index].id || randomID(16) - this.object.update( { 'system.predilections': pred }) - }) - html.find('.edit-predilection-description').change(ev => { - const li = $(ev.currentTarget).parents(".prediction-item") - let index = li.data("prediction-index") - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred[index].description = ev.currentTarget.value - pred[index].id = pred[index].id || randomID(16) - this.object.update( { 'system.predilections': pred }) - }) - html.find('.predilection-acquise').change(ev => { - const li = $(ev.currentTarget).parents(".prediction-item") - let index = li.data("prediction-index") - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred[index].acquise = ev.currentTarget.checked - pred[index].id = pred[index].id || randomID(16) - this.object.update( { 'system.predilections': pred }) - }) - html.find('.predilection-maitrise').change(ev => { - const li = $(ev.currentTarget).parents(".prediction-item") - let index = li.data("prediction-index") - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred[index].maitrise = ev.currentTarget.checked - pred[index].id = pred[index].id || randomID(16) - this.object.update( { 'system.predilections': pred }) - }) - html.find('.predilection-used').change(ev => { - const li = $(ev.currentTarget).parents(".prediction-item") - let index = li.data("prediction-index") - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred[index].used = ev.currentTarget.checked - pred[index].id = pred[index].id || randomID(16) - this.object.update( { 'system.predilections': pred }) - }) - - html.find('#add-predilection').click(ev => { - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred.push( { name: "Nouvelle prédilection", id: randomID(16), used: false }) - this.object.update( { 'system.predilections': pred }) - }) - html.find('.delete-prediction').click(ev => { - const li = $(ev.currentTarget).parents(".prediction-item") - let index = li.data("prediction-index") - let pred = foundry.utils.duplicate(this.object.system.predilections) - pred.splice(index,1) - this.object.update( { 'system.predilections': pred }) - }) - - html.find('#add-automation').click(ev => { - let autom = foundry.utils.duplicate(this.object.system.automations) - autom.push( { eventtype: "on-drop", name: "Automatisation 1", bonusname: "vigueur", bonus: 0, competence: "", minLevel: 0, baCost: 0, id: randomID(16) }) - this.object.update( { 'system.automations': autom }) - }) - html.find('.delete-automation').click(ev => { - const li = $(ev.currentTarget).parents(".automation-item") - let index = li.data("automation-index") - let autom = foundry.utils.duplicate(this.object.system.automations) - autom.splice(index,1) - this.object.update( { 'system.automations': autom }) - }) - html.find('.automation-edit-field').change(ev => { - let index = $(ev.currentTarget).data("automation-index") - let field = $(ev.currentTarget).data("automation-field") - let auto = foundry.utils.duplicate(this.object.system.automations) - auto[index][field] = ev.currentTarget.value - auto[index].id = auto[index].id || randomID(16) - this.object.update( { 'system.automations': auto }) - }) - - // Update Inventory Item - html.find('.item-delete').click(ev => { - const li = $(ev.currentTarget).parents(".item"); - let itemId = li.data("item-id"); - let itemType = li.data("item-type"); - }); - - } - - /* -------------------------------------------- */ - get template() { - let type = this.item.type; - return `systems/fvtt-mournblade-cyd-2-0/templates/item-${type}-sheet.hbs`; - } - - /* -------------------------------------------- */ - /** @override */ - _updateObject(event, formData) { - return this.object.update(formData); - } -} diff --git a/modules/mournblade-cyd2-main.js b/modules/mournblade-cyd2-main.js index 920a1c2..590a6d3 100644 --- a/modules/mournblade-cyd2-main.js +++ b/modules/mournblade-cyd2-main.js @@ -111,12 +111,43 @@ function welcomeMessage() { ChatMessage.create({ user: game.user.id, whisper: [game.user.id], - content: `
    - Bienvenue dans Mournblade CYD 2.0 ! -

    Les livres de Mournblade sont nécessaires pour jouer : https://www.titam-france.fr ainsi que le supplément de conversion de règle pour le CYD 2.0

    -

    Mournblade est un jeu de rôle publié par Titam France/Sombres projets, tous les droits leur appartiennent.

    -

    Système développé par LeRatierBretonnien, support sur le Discord FR de Foundry.

    - ` }); + content: `
    +
    +
    +

    Mournblade CYD 2.0

    +
    Système FoundryVTT — Bienvenue !
    +
    +
    +
    +
    +
    + Livres nécessaires +

    Les livres de Mournblade sont nécessaires pour jouer. Supplément de conversion CYD 2.0 requis.

    + titam-france.fr +
    +
    +
    +
    +
    + Droits +

    Mournblade est un jeu publié par Titam France / Sombres Projets, tous les droits leur appartiennent.

    +
    +
    +
    +
    +
    + Support +

    Système développé par LeRatierBretonnien.

    + Discord FR Foundry +
    +
    +
    + +
    ` + }); } /* -------------------------------------------- */ diff --git a/modules/mournblade-cyd2-roll-dialog.js b/modules/mournblade-cyd2-roll-dialog.js deleted file mode 100644 index 10015c5..0000000 --- a/modules/mournblade-cyd2-roll-dialog.js +++ /dev/null @@ -1,142 +0,0 @@ -import { MournbladeCYD2Utility } from "./mournblade-cyd2-utility.js"; - -export class MournbladeCYD2RollDialog extends Dialog { - - /* -------------------------------------------- */ - static async create(actor, rollData ) { - - let options = { classes: ["MournbladeCYD2Dialog"], width: 320, height: 'fit-content', 'z-index': 99999 }; - let html = await foundry.applications.handlebars.renderTemplate('systems/fvtt-mournblade-cyd-2-0/templates/roll-dialog-generic.hbs', rollData); - - return new MournbladeCYD2RollDialog(actor, rollData, html, options ); - } - - /* -------------------------------------------- */ - constructor(actor, rollData, html, options, close = undefined) { - let conf = { - title: "Test de Capacité", - content: html, - buttons: { - rolld10: { - icon: '', - label: "Lancer 1d10", - callback: () => { this.roll("d10") } - }, - rolld20: { - icon: '', - label: "Lancer 1d20", - callback: () => { this.roll("d20") } - }, - cancel: { - icon: '', - label: "Annuler", - callback: () => { this.close() } - } }, - close: close - } - - super(conf, options); - - this.actor = actor - this.rollData = rollData - } - - /* -------------------------------------------- */ - roll ( dice) { - this.rollData.mainDice = dice - MournbladeCYD2Utility.rollMournbladeCYD2( this.rollData ) - } - - - /* -------------------------------------------- */ - activateListeners(html) { - super.activateListeners(html); - - var dialog = this; - function onLoad() { - } - $(function () { onLoad(); }); - - html.find('#modificateur').change(async (event) => { - this.rollData.modificateur = Number(event.currentTarget.value) - }) - html.find('#difficulte').change( (event) => { - console.log("Difficulte: " + event.currentTarget.value) - this.rollData.difficulte = Number(event.currentTarget.value) - }) - html.find('#attrKey').change(async (event) => { - this.rollData.attrKey = String(event.currentTarget.value) - }) - html.find('#attrKey2').change(async (event) => { - this.rollData.attrKey2 = String(event.currentTarget.value) - }) - html.find('#select-maitrise').change(async (event) => { - this.rollData.maitriseId = String(event.currentTarget.value) - }) - html.find('#competence-talents').change((event) => { - this.rollData.selectedTalents = $('#competence-talents').val() - }) - html.find('#taille-cible').change((event) => { - this.rollData.tailleCible = String(event.currentTarget.value) - }) - html.find('#tireur-deplacement').change((event) => { - this.rollData.tireurDeplacement = String(event.currentTarget.value) - }) - html.find('#cible-couvert').change((event) => { - this.rollData.cibleCouvert = String(event.currentTarget.value) - }) - html.find('#distance-tir').change((event) => { - this.rollData.distanceTir = String(event.currentTarget.value) - }) - html.find('#bonus-malus-context').change((event) => { - this.rollData.bonusMalusContext = Number(event.currentTarget.value) - }) - html.find('#defenseur-au-sol').change((event) => { - this.rollData.defenseurAuSol = event.currentTarget.checked - }) - html.find('#ambidextre-1').change((event) => { - this.rollData.ambidextre1 = event.currentTarget.checked - }) - html.find('#ambidextre-2').change((event) => { - this.rollData.ambidextre2 = event.currentTarget.checked - }) - html.find('#attaque-monte').change((event) => { - this.rollData.attqueMonte = event.currentTarget.checked - }) - html.find('#defenseur-aveugle').change((event) => { - this.rollData.defenseurAveugle = event.currentTarget.checked - }) - html.find('#defenseur-de-dos').change((event) => { - this.rollData.defenseurDeDos = event.currentTarget.checked - }) - html.find('#defenseur-restreint').change((event) => { - this.rollData.defenseurRestreint = event.currentTarget.checked - }) - html.find('#defenseur-immobilise').change((event) => { - this.rollData.defenseurImmobilise = event.currentTarget.checked - }) - html.find('#attaque-charge').change((event) => { - this.rollData.attaqueCharge = event.currentTarget.checked - }) - html.find('#charge-cavalerie').change((event) => { - this.rollData.chargeCavalerie = event.currentTarget.checked - }) - html.find('#attaquants-multiple').change((event) => { - this.rollData.attaquantsMultiples = event.currentTarget.checked - }) - html.find('#soutiens').change((event) => { - this.rollData.soutiens = Number(event.currentTarget.value) - }) - html.find('#feinte').change((event) => { - this.rollData.feinte = event.currentTarget.checked - }) - html.find('#contenir').change((event) => { - this.rollData.contenir = event.currentTarget.checked - }) - html.find('#attaque-desarme').change((event) => { - this.rollData.attaqueDesarme = event.currentTarget.checked - }) - - - } -} \ No newline at end of file diff --git a/modules/mournblade-cyd2-utility.js b/modules/mournblade-cyd2-utility.js index d3ae838..86e9188 100644 --- a/modules/mournblade-cyd2-utility.js +++ b/modules/mournblade-cyd2-utility.js @@ -46,6 +46,11 @@ export class MournbladeCYD2Utility { Handlebars.registerHelper('mul', function (a, b) { return parseInt(a) * parseInt(b); }) + Handlebars.registerHelper('select', function(value, options) { + const html = options.fn(this); + const escaped = String(value).replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + return html.replace(new RegExp(`value="${escaped}"`, 'g'), `value="${value}" selected="selected"`); + }) game.settings.register("fvtt-mournblade-cyd-2-0", "mournblade-cyd2-pause-logo", { name: "Logo de pause", @@ -63,6 +68,7 @@ export class MournbladeCYD2Utility { // Initialise les listes de sélection dès le hook init (avant le rendu des fiches) game.system.mournbladecyd2.config.listeNiveauSkill = this.createDirectOptionList(0, 10) game.system.mournbladecyd2.config.listeNiveauCreature = this.createDirectOptionList(0, 35) + game.system.mournbladecyd2.config.pointsAmeOptions = this.createDirectOptionList(1, 20) } @@ -151,7 +157,7 @@ export class MournbladeCYD2Utility { static async chatListeners(html) { $(html).on("click", '.predilection-reroll', async event => { - let predIdx = $(event.currentTarget).data("predilection-index") + let predIdx = event.currentTarget.dataset.predilectionIndex let messageId = MournbladeCYD2Utility.findChatMessageId(event.currentTarget) let message = game.messages.get(messageId) let rollData = message.getFlag("world", "mournblade-cyd2-roll") @@ -345,7 +351,7 @@ export class MournbladeCYD2Utility { if (rollData.mainDice.includes("d20")) { let diceValue = rollData.roll.terms[0].results[0].result if (diceValue % 2 == 1) { - //console.log("PAIR/IMP2", diceValue) + rollData.isD20Impair = true rollData.finalResult -= rollData.roll.terms[0].results[0].result // Substract value if (diceValue == 1 || diceValue == 11) { rollData.isDramatique = true @@ -425,7 +431,8 @@ export class MournbladeCYD2Utility { } else if (rollData.attr2) { rollData.diceFormula += `+${rollData.attr.value}+${rollData.attr2.value}+${rollData.modificateur}+${rollData.bonusMalusContext}` } else { - rollData.diceFormula += `+${rollData.attr.value}*${rollData.multiplier}+${rollData.modificateur}+${rollData.bonusMalusContext}` + const attrPart = rollData.multiplier > 1 ? `${rollData.attr.value}*${rollData.multiplier}` : `${rollData.attr.value}` + rollData.diceFormula += `+${attrPart}+${rollData.modificateur}+${rollData.bonusMalusContext}` } // Bonus arme naturelle en défense @@ -491,6 +498,21 @@ export class MournbladeCYD2Utility { rollData.finalResult = myRoll.total this.computeResult(rollData) + + // Rune post-roll: calculate duration and apply soul cost + if (rollData.rune) { + rollData.runeduree = Math.ceil(rollData.runeame / 3) + if (rollData.runemode == "inscrire") { + rollData.runeduree *= 2 + } + let subAme = rollData.runeame + if (!rollData.isSuccess && !rollData.isDramatique) { + subAme = Math.ceil(rollData.runeame / 2) + } + rollData.runeAmeCout = subAme + actor.subPointsAme(rollData.runemode, subAme) + } + if (rollData.isInit) { actor.setFlag("world", "last-initiative", rollData.finalResult) } @@ -779,7 +801,8 @@ export class MournbladeCYD2Utility { /* -------------------------------------------- */ static applyBonneAventureRoll(li, changed, addedBonus) { - let msgId = $(li).data("message-id") + const el = li instanceof HTMLElement ? li : li[0]; + let msgId = el.dataset.messageId ?? el.closest("[data-message-id]")?.dataset.messageId let msg = game.messages.get(msgId) if (msg) { let rollData = msg.getFlag("world", "mournblade-cyd2-roll") @@ -798,7 +821,8 @@ export class MournbladeCYD2Utility { /* -------------------------------------------- */ static applyEclatRoll(li, changed, addedBonus) { - let msgId = $(li).data("message-id") + const el = li instanceof HTMLElement ? li : li[0]; + let msgId = el.dataset.messageId ?? el.closest("[data-message-id]")?.dataset.messageId let msg = game.messages.get(msgId) if (msg) { let rollData = msg.getFlag("world", "mournblade-cyd2-roll") @@ -817,14 +841,19 @@ export class MournbladeCYD2Utility { /* -------------------------------------------- */ static chatRollMenu(html, options) { - let canApply = li => canvas.tokens.controlled.length && li.find(".mournblade-cyd2-roll").length + let canApply = li => { + const el = li instanceof HTMLElement ? li : li[0]; + return canvas.tokens.controlled.length && el.querySelector(".mournblade-cyd2-roll"); + } let getActor = function (li) { - let message = game.messages.get($(li).attr("data-message-id")) + const el = li instanceof HTMLElement ? li : li[0]; + let message = game.messages.get(el.dataset.messageId) let rollData = message.getFlag("world", "mournblade-cyd2-roll") return MournbladeCYD2Utility.getActorFromRollData(rollData) } let getRollData = function (li) { - let message = game.messages.get($(li).attr("data-message-id")) + const el = li instanceof HTMLElement ? li : li[0]; + let message = game.messages.get(el.dataset.messageId) return message.getFlag("world", "mournblade-cyd2-roll") } let canApplyBA = function (li) { @@ -884,7 +913,7 @@ export class MournbladeCYD2Utility { /* -------------------------------------------- */ static async confirmDelete(actorSheet, li) { - let itemId = li.data("item-id"); + let itemId = li.dataset?.itemId ?? li.dataset?.["item-id"]; let msgTxt = "

    Etes vous certain de vouloir supprimer cet item ?"; let buttons = { delete: { @@ -892,7 +921,7 @@ export class MournbladeCYD2Utility { label: "Oui !", callback: () => { actorSheet.actor.deleteEmbeddedDocuments("Item", [itemId]); - li.slideUp(200, () => actorSheet.render(false)); + actorSheet.render(false); } }, cancel: { diff --git a/styles/mournblade-cyd2.css b/styles/mournblade-cyd2.css index a6c8130..23aa3c4 100644 --- a/styles/mournblade-cyd2.css +++ b/styles/mournblade-cyd2.css @@ -21,7 +21,7 @@ --tab-header-font-size: 1rem; --tab-header-font-weight: 700; --tab-header-color: #403f3e; - --tab-header-color-active: #4a0404; + --tab-header-color-active: #2a1400; --font-primary: CentaurMT; --font-secondary: CentaurMT; --actor-input-font-size: 0.9rem; @@ -1105,7 +1105,8 @@ li { text-shadow: 0px 1px 0px #4d3534; position: relative; max-height: 1.8rem; - width: 3.5rem; + width: 5rem; + white-space: nowrap; margin-left: 4px; } .button-sheet-roll-offline { @@ -1123,7 +1124,8 @@ li { text-shadow: 0px 1px 0px #4d3534; position: relative; max-height: 1.8rem; - width: 3.5rem; + width: 5rem; + white-space: nowrap; margin-left: 4px; } .button-sheet-roll-large { @@ -1379,43 +1381,43 @@ li { margin-right: 6px; } /* ==================== Roll Dialog V2 Styles ==================== */ -.application.mournblade-roll-dialog .window-content { +.application.mournblade-cyd2-roll-dialog .window-content { padding: 0; } -.window-app.mournblade-roll-dialog .window-content { +.window-app.mournblade-cyd2-roll-dialog .window-content { margin: 0; padding: 0; } -.mournblade-roll-dialog { +.mournblade-cyd2-roll-dialog { background: url("../assets/ui/pc_sheet_bg.webp"); background-repeat: repeat; font-family: CentaurMT; } -.mournblade-roll-dialog * { +.mournblade-cyd2-roll-dialog * { color: #2a2a2a; } /* Header */ -.mournblade-roll-dialog .dialog-header { +.mournblade-cyd2-roll-dialog .dialog-header { display: flex; align-items: center; gap: 10px; padding: 8px; - background: linear-gradient(135deg, #4a0404 0%, #6d0808 100%); - border-bottom: 3px solid #8b0000; + background: linear-gradient(135deg, #2a1400 0%, #4a2200 100%); + border-bottom: 3px solid #8b4513; margin-bottom: 0; } -.mournblade-roll-dialog .dialog-header .actor-icon { +.mournblade-cyd2-roll-dialog .dialog-header .actor-icon { width: 48px; height: 48px; border-radius: 4px; - border: 2px solid #8b0000; + border: 2px solid #8b4513; object-fit: cover; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); } -.mournblade-roll-dialog .dialog-header .dialog-title { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title { flex: 1; } -.mournblade-roll-dialog .dialog-header .dialog-title h3 { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title h3 { margin: 0; font-size: 1.1rem; color: #f5f5f5; @@ -1423,124 +1425,126 @@ li { font-family: Charlemagne; font-weight: bold; } -.mournblade-roll-dialog .dialog-header .dialog-title .competence-name { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title .competence-name { font-size: 0.85rem; - color: #ffcccb; + color: #f0d0a0; margin-top: 2px; text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8); } -.mournblade-roll-dialog .dialog-header .dialog-title .competence-name .attribut-info { +.mournblade-cyd2-roll-dialog .dialog-header .dialog-title .competence-name .attribut-info { color: #ffd700; font-weight: bold; font-size: 0.9em; } /* Content */ -.mournblade-roll-dialog .dialog-content { - padding: 8px; - max-height: 650px; +.mournblade-cyd2-roll-dialog .dialog-content { + padding: 6px 8px; + max-height: 600px; overflow-y: auto; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar { +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar { width: 8px; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-track { +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.1); border-radius: 4px; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-thumb { - background: rgba(139, 0, 0, 0.6); +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar-thumb { + background: rgba(139, 69, 19, 0.6); border-radius: 4px; } -.mournblade-roll-dialog .dialog-content::-webkit-scrollbar-thumb:hover { - background: rgba(139, 0, 0, 0.8); +.mournblade-cyd2-roll-dialog .dialog-content::-webkit-scrollbar-thumb:hover { + background: rgba(139, 69, 19, 0.8); } /* Form Groups */ -.mournblade-roll-dialog .form-group { - margin-bottom: 8px; +.mournblade-cyd2-roll-dialog .form-group { + margin-bottom: 6px; } -.mournblade-roll-dialog .form-group label { - display: block; +.mournblade-cyd2-roll-dialog .form-group label { + flex-shrink: 0; + white-space: nowrap; font-weight: bold; color: #1a1a1a; text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5); - margin-bottom: 3px; font-size: 0.9rem; + margin-bottom: 0; } -.mournblade-roll-dialog .form-group input, -.mournblade-roll-dialog .form-group select { - width: 100%; - padding: 5px 8px; +.mournblade-cyd2-roll-dialog .form-group input, +.mournblade-cyd2-roll-dialog .form-group select { + flex: 1; + min-width: 60px; + padding: 4px 6px; background: rgba(255, 255, 255, 0.95); border: 1px solid rgba(100, 100, 100, 0.5); border-radius: 3px; color: #1a1a1a; - font-size: 0.95rem; + font-size: 0.9rem; font-weight: 500; font-family: CentaurMT; } -.mournblade-roll-dialog .form-group input:focus, -.mournblade-roll-dialog .form-group select:focus { +.mournblade-cyd2-roll-dialog .form-group input:focus, +.mournblade-cyd2-roll-dialog .form-group select:focus { outline: none; - border-color: #8b0000; - box-shadow: 0 0 5px rgba(139, 0, 0, 0.6); + border-color: #8b4513; + box-shadow: 0 0 5px rgba(139, 69, 19, 0.6); background: #ffffff; } -.mournblade-roll-dialog .form-group input:disabled, -.mournblade-roll-dialog .form-group select:disabled { +.mournblade-cyd2-roll-dialog .form-group input:disabled, +.mournblade-cyd2-roll-dialog .form-group select:disabled { opacity: 0.7; cursor: not-allowed; background: rgba(200, 200, 200, 0.9); color: #555; } /* Grids */ -.mournblade-roll-dialog .modifiers-grid { +.mournblade-cyd2-roll-dialog .modifiers-grid { display: grid; grid-template-columns: repeat(2, 1fr); - gap: 8px; - margin-bottom: 10px; + gap: 6px; + margin-bottom: 8px; } /* Sections spéciales */ -.mournblade-roll-dialog .attributes-section { - background: rgba(139, 0, 0, 0.1); +.mournblade-cyd2-roll-dialog .attributes-section { + background: rgba(139, 69, 19, 0.1); padding: 8px; border-radius: 4px; - border: 1px solid rgba(139, 0, 0, 0.3); + border: 1px solid rgba(139, 69, 19, 0.3); margin-bottom: 10px; } -.mournblade-roll-dialog .rune-section { +.mournblade-cyd2-roll-dialog .rune-section { background: rgba(75, 0, 130, 0.1); padding: 8px; border-radius: 4px; border: 1px solid rgba(75, 0, 130, 0.3); margin-bottom: 10px; } -.mournblade-roll-dialog .weapon-section { +.mournblade-cyd2-roll-dialog .weapon-section { background: rgba(184, 134, 11, 0.1); - padding: 8px; + padding: 6px 8px; border-radius: 4px; border: 1px solid rgba(184, 134, 11, 0.3); - margin-bottom: 10px; + margin-bottom: 8px; } -.mournblade-roll-dialog .weapon-info { +.mournblade-cyd2-roll-dialog .weapon-info { display: flex; justify-content: space-between; align-items: center; - padding: 5px 8px; + padding: 4px 6px; background: rgba(184, 134, 11, 0.15); border-radius: 3px; - margin-bottom: 8px; + margin-bottom: 6px; } -.mournblade-roll-dialog .weapon-info .weapon-label { +.mournblade-cyd2-roll-dialog .weapon-info .weapon-label { font-weight: bold; font-size: 0.9rem; color: #1a1a1a; } -.mournblade-roll-dialog .weapon-info .weapon-bonus { +.mournblade-cyd2-roll-dialog .weapon-info .weapon-bonus { font-size: 0.85rem; - color: #8b0000; + color: #8b4513; font-weight: bold; } -.mournblade-roll-dialog .defense-info { +.mournblade-cyd2-roll-dialog .defense-info { display: flex; justify-content: space-between; align-items: center; @@ -1549,68 +1553,76 @@ li { border-radius: 3px; margin-bottom: 8px; } -.mournblade-roll-dialog .defense-info .defense-label { +.mournblade-cyd2-roll-dialog .defense-info .defense-label { font-size: 0.85rem; color: #1a1a1a; font-weight: bold; } -.mournblade-roll-dialog .defense-info .defense-value { +.mournblade-cyd2-roll-dialog .defense-info .defense-value { font-size: 1rem; color: #006400; font-weight: bold; } /* Combat modifiers */ -.mournblade-roll-dialog .combat-modifiers, -.mournblade-roll-dialog .ranged-combat-section { - background: rgba(139, 0, 0, 0.1); - padding: 8px; +.mournblade-cyd2-roll-dialog .combat-modifiers, +.mournblade-cyd2-roll-dialog .ranged-combat-section { + background: rgba(139, 69, 19, 0.1); + padding: 6px 8px; border-radius: 4px; - border: 1px solid rgba(139, 0, 0, 0.3); - margin-bottom: 10px; + border: 1px solid rgba(139, 69, 19, 0.3); + margin-bottom: 8px; } -.mournblade-roll-dialog .combat-modifiers h4, -.mournblade-roll-dialog .ranged-combat-section h4 { - margin: 0 0 8px 0; +.mournblade-cyd2-roll-dialog .combat-modifiers h4, +.mournblade-cyd2-roll-dialog .ranged-combat-section h4 { + margin: 0 0 6px 0; color: #2a2a2a; text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); - font-size: 0.95rem; + font-size: 0.9rem; font-weight: bold; } -.mournblade-roll-dialog .modifiers-columns { +.mournblade-cyd2-roll-dialog .modifiers-columns { display: grid; grid-template-columns: repeat(2, 1fr); - gap: 5px 10px; + gap: 3px 8px; + margin-bottom: 6px; } -.mournblade-roll-dialog .checkbox-label { +.mournblade-cyd2-roll-dialog .checkbox-label { display: flex; align-items: center; - gap: 6px; - padding: 4px 6px; + gap: 5px; + padding: 3px 4px; cursor: pointer; border-radius: 3px; transition: background 0.2s ease; } -.mournblade-roll-dialog .checkbox-label:hover { +.mournblade-cyd2-roll-dialog .checkbox-label:hover { background: rgba(255, 255, 255, 0.15); } -.mournblade-roll-dialog .checkbox-label input[type="checkbox"] { +.mournblade-cyd2-roll-dialog .checkbox-label input[type="checkbox"] { width: auto; margin: 0; + flex-shrink: 0; cursor: pointer; - accent-color: #8b0000; + accent-color: #8b4513; } -.mournblade-roll-dialog .checkbox-label span { +.mournblade-cyd2-roll-dialog .checkbox-label span { color: #1a1a1a; - font-size: 0.85rem; + font-size: 0.82rem; user-select: none; text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.5); + line-height: 1.2; } -.mournblade-roll-dialog .checkbox-label.highlight { +.mournblade-cyd2-roll-dialog .checkbox-label.highlight { background: rgba(255, 215, 0, 0.15); border: 1px solid rgba(255, 215, 0, 0.4); font-weight: bold; } -.mournblade-roll-dialog .info-message { +/* Ranged combat: 1-column grid for selects (long labels) */ +.mournblade-cyd2-roll-dialog .ranged-combat-section .modifiers-grid { + grid-template-columns: 1fr; + gap: 4px; +} +.mournblade-cyd2-roll-dialog .info-message { padding: 6px 10px; background: rgba(33, 150, 243, 0.1); border-left: 3px solid rgba(33, 150, 243, 0.6); @@ -1620,19 +1632,19 @@ li { margin-bottom: 8px; } /* Malus section */ -.mournblade-roll-dialog .malus-section { +.mournblade-cyd2-roll-dialog .malus-section { background: rgba(100, 100, 100, 0.1); padding: 8px; border-radius: 4px; border: 1px solid rgba(100, 100, 100, 0.3); margin-bottom: 10px; } -.mournblade-roll-dialog .malus-grid { +.mournblade-cyd2-roll-dialog .malus-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; } -.mournblade-roll-dialog .malus-item { +.mournblade-cyd2-roll-dialog .malus-item { display: flex; justify-content: space-between; align-items: center; @@ -1640,51 +1652,53 @@ li { background: rgba(0, 0, 0, 0.05); border-radius: 3px; } -.mournblade-roll-dialog .malus-item .malus-label { +.mournblade-cyd2-roll-dialog .malus-item .malus-label { font-size: 0.85rem; color: #2a2a2a; font-weight: 500; } -.mournblade-roll-dialog .malus-item .malus-value { +.mournblade-cyd2-roll-dialog .malus-item .malus-value { font-size: 0.95rem; - color: #8b0000; + color: #8b4513; font-weight: bold; } /* Registered modifiers */ -.mournblade-roll-dialog .registered-modifiers { +.mournblade-cyd2-roll-dialog .registered-modifiers { background: rgba(75, 0, 130, 0.1); padding: 8px; border-radius: 4px; border: 1px solid rgba(75, 0, 130, 0.3); margin-bottom: 10px; } -.mournblade-roll-dialog .registered-modifiers h4 { +.mournblade-cyd2-roll-dialog .registered-modifiers h4 { margin: 0 0 6px 0; color: #2a2a2a; text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); font-size: 0.9rem; font-weight: bold; } -.mournblade-roll-dialog .registered-modifiers h4 i { +.mournblade-cyd2-roll-dialog .registered-modifiers h4 i { margin-right: 6px; color: #4b0082; } -.mournblade-roll-dialog .modifier-item { +.mournblade-cyd2-roll-dialog .modifier-item { margin-bottom: 4px; } /* Special option */ -.mournblade-roll-dialog .special-option { +.mournblade-cyd2-roll-dialog .special-option { margin-top: 10px; } /* Dialog buttons */ -.mournblade-roll-dialog .dialog-buttons { +.mournblade-cyd2-roll-dialog .dialog-buttons, +.mournblade-cyd2-roll-dialog .form-footer { display: flex; gap: 10px; - padding: 10px; - border-top: 2px solid rgba(139, 0, 0, 0.3); + padding: 10px 12px 14px !important; + border-top: 2px solid rgba(139, 69, 19, 0.3); background: rgba(0, 0, 0, 0.05); } -.mournblade-roll-dialog .dialog-buttons button { +.mournblade-cyd2-roll-dialog .dialog-buttons button, +.mournblade-cyd2-roll-dialog .form-footer button { flex: 1; padding: 8px 14px; border: none; @@ -1696,29 +1710,41 @@ li { font-family: Charlemagne; text-transform: uppercase; } -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld10"], -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld20"] { - background: linear-gradient(135deg, #8b0000 0%, #6d0808 100%); - color: #f5f5f5; +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld10"], +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld20"], +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld10"], +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld20"] { + background: rgba(100, 100, 100, 0.3) !important; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); } -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld10"]:hover, -.mournblade-roll-dialog .dialog-buttons button[data-action="rolld20"]:hover { - background: linear-gradient(135deg, #a00000 0%, #8b0000 100%); - transform: translateY(-2px); - box-shadow: 0 4px 8px rgba(139, 0, 0, 0.5); +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld10"]:hover, +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="rolld20"]:hover, +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld10"]:hover, +.mournblade-cyd2-roll-dialog .form-footer button[data-action="rolld20"]:hover { + background: rgba(100, 100, 100, 0.5) !important; + transform: translateY(-1px); } -.mournblade-roll-dialog .dialog-buttons button[data-action="cancel"] { +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="cancel"], +.mournblade-cyd2-roll-dialog .form-footer button[data-action="cancel"] { background: rgba(100, 100, 100, 0.3); color: #2a2a2a; } -.mournblade-roll-dialog .dialog-buttons button[data-action="cancel"]:hover { +.mournblade-cyd2-roll-dialog .dialog-buttons button[data-action="cancel"]:hover, +.mournblade-cyd2-roll-dialog .form-footer button[data-action="cancel"]:hover { background: rgba(100, 100, 100, 0.5); } +/* Affichage d'une valeur non-éditable dans le dialog */ +.mournblade-cyd2-roll-dialog .field-value { + display: inline-block; + font-weight: bold; + color: #8b4513; + font-size: 0.95rem; + padding: 0 4px; +} /* ==================== Sheet Mode Toggle Button ==================== */ .sheet-mode-toggle { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); - border: 1px solid #8b0000; + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); + border: 1px solid #8b4513; border-radius: 3px; color: #f5f5f5; padding: 2px 4px; @@ -1733,7 +1759,7 @@ li { flex-shrink: 0; } .sheet-mode-toggle:hover { - background: linear-gradient(135deg, #a00000 0%, #5a0505 100%); + background: linear-gradient(135deg, #a06010 0%, #4a2200 100%); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); } @@ -1743,15 +1769,15 @@ li { } /* ==================== Chat Message Styles ==================== */ .mournblade-chat-result { - background: linear-gradient(135deg, rgba(74, 4, 4, 0.2) 0%, rgba(139, 0, 0, 0.15) 100%); - border: 2px solid #8b0000; + background: linear-gradient(135deg, rgba(42, 20, 0, 0.2) 0%, rgba(139, 69, 19, 0.15) 100%); + border: 2px solid #8b4513; border-radius: 4px; overflow: hidden; font-family: CentaurMT, serif; } .mournblade-chat-result .chat-result-header { - background: linear-gradient(135deg, #4a0404 0%, #2a0202 100%); - border-bottom: 2px solid #8b0000; + background: linear-gradient(135deg, #2a1400 0%, #2a0202 100%); + border-bottom: 2px solid #8b4513; padding: 8px; display: flex; align-items: center; @@ -1761,7 +1787,7 @@ li { width: 48px; height: 48px; border-radius: 4px; - border: 1px solid #8b0000; + border: 1px solid #8b4513; object-fit: cover; flex-shrink: 0; } @@ -1786,7 +1812,7 @@ li { .mournblade-chat-result .result-main { background: rgba(255, 250, 240, 0.9); padding: 4px 8px; - border-bottom: 1px solid rgba(139, 0, 0, 0.3); + border-bottom: 1px solid rgba(139, 69, 19, 0.3); } .mournblade-chat-result .result-main .result-display { display: flex; @@ -1803,12 +1829,12 @@ li { background: rgba(255, 255, 255, 0.7); padding: 4px 6px; border-radius: 4px; - border: 1px solid rgba(139, 0, 0, 0.2); + border: 1px solid rgba(139, 69, 19, 0.2); } .mournblade-chat-result .result-main .result-display .dice-result i, .mournblade-chat-result .result-main .result-display .total-result i, .mournblade-chat-result .result-main .result-display .difficulty i { - color: #8b0000; + color: #8b4513; font-size: 1rem; display: block; margin-bottom: 2px; @@ -1829,7 +1855,7 @@ li { .mournblade-chat-result .result-main .result-display .total-result .difficulty-value, .mournblade-chat-result .result-main .result-display .difficulty .difficulty-value { font-size: 1.5rem; - color: #8b0000; + color: #8b4513; text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8); font-weight: bold; line-height: 1.2; @@ -1841,11 +1867,27 @@ li { .mournblade-chat-result .result-main .result-display .total-result .difficulty-label, .mournblade-chat-result .result-main .result-display .difficulty .difficulty-label { font-size: 0.75rem; - color: #4a0404; + color: #2a1400; text-transform: uppercase; font-weight: bold; line-height: 1.1; } +.mournblade-chat-result .result-main .result-display .d20-impair { + flex: 2; + background: rgba(180, 60, 0, 0.12); + border-color: rgba(180, 60, 0, 0.4); +} +.mournblade-chat-result .result-main .result-display .d20-impair i { + color: #b03000; + display: inline; + margin-right: 4px; +} +.mournblade-chat-result .result-main .result-display .d20-impair .dice-value { + display: inline; + font-size: 0.85rem; + color: #b03000; + font-weight: bold; +} .mournblade-chat-result .result-main .result-badge-container { display: flex; justify-content: center; @@ -1874,7 +1916,7 @@ li { text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); } .mournblade-chat-result .result-main .result-badge-container .result-badge.failure { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); color: white; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); } @@ -1902,7 +1944,7 @@ li { } .mournblade-chat-result .result-details .details-section .detail-row.bonus { background: rgba(255, 200, 200, 0.6); - border: 1px solid rgba(139, 0, 0, 0.5); + border: 1px solid rgba(139, 69, 19, 0.5); } .mournblade-chat-result .result-details .details-section .detail-row.malus { background: rgba(255, 180, 180, 0.6); @@ -1923,13 +1965,13 @@ li { .mournblade-chat-result .result-effects { padding: 8px; background: rgba(255, 230, 230, 0.4); - border-top: 1px solid rgba(139, 0, 0, 0.3); + border-top: 1px solid rgba(139, 69, 19, 0.3); } .mournblade-chat-result .result-effects .effect-item { padding: 5px 8px; margin-bottom: 5px; background: rgba(255, 255, 255, 0.7); - border-left: 3px solid #8b0000; + border-left: 3px solid #8b4513; border-radius: 3px; color: #000000; font-size: 0.85rem; @@ -1940,7 +1982,7 @@ li { } .mournblade-chat-result .result-effects .effect-item i { margin-right: 6px; - color: #8b0000; + color: #8b4513; } .mournblade-chat-result .result-effects .effect-item:last-child { margin-bottom: 0; @@ -1975,8 +2017,8 @@ li { width: 100%; } .mournblade-chat-result .chat-card-button { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); - border: 1px solid #8b0000; + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); + border: 1px solid #8b4513; border-radius: 3px; color: #f5f5f5; padding: 6px 12px; @@ -1990,7 +2032,7 @@ li { margin-right: 4px; } .mournblade-chat-result .chat-card-button:hover { - background: linear-gradient(135deg, #a00000 0%, #5a0505 100%); + background: linear-gradient(135deg, #a06010 0%, #4a2200 100%); transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); } @@ -2001,12 +2043,103 @@ li { .mournblade-chat-result .chat-card-button.predilection-reroll:hover { background: linear-gradient(135deg, #5b1092 0%, #3d005d 100%); } +/* Tag non-létaux dans les messages de dégâts */ +.mournblade-chat-result .non-lethal-tag { + font-size: 0.8rem; + color: #888; + font-style: italic; + margin-left: 4px; +} /* -------------------------------------------- */ -/* Welcome Message Styling */ +.mournblade-post-item { + background: linear-gradient(135deg, rgba(42, 20, 0, 0.15) 0%, rgba(139, 69, 19, 0.1) 100%); + border: 2px solid #8b4513; + border-radius: 6px; + overflow: hidden; + font-family: CentaurMT, serif; + margin: 4px 0; +} +.mournblade-post-item .post-item-header { + background: linear-gradient(135deg, #2a1400 0%, #3a1800 100%); + border-bottom: 2px solid #8b4513; + padding: 8px 10px; + display: flex; + align-items: center; + gap: 10px; +} +.mournblade-post-item .post-item-header .post-item-img { + width: 44px; + height: 44px; + border-radius: 4px; + border: 1px solid #8b4513; + object-fit: cover; + flex-shrink: 0; +} +.mournblade-post-item .post-item-header .post-item-title { + flex: 1; +} +.mournblade-post-item .post-item-header .post-item-title .post-item-name { + margin: 0 0 2px 0; + color: #ffd700; + font-size: 1.1rem; + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9); + line-height: 1.2; +} +.mournblade-post-item .post-item-header .post-item-title .post-item-type { + font-size: 0.75rem; + color: #f5e6d3; + font-style: italic; + opacity: 0.8; + text-transform: capitalize; +} +.mournblade-post-item .post-item-stats { + display: flex; + flex-wrap: wrap; + gap: 4px; + padding: 6px 8px; + background: rgba(139, 69, 19, 0.08); + border-bottom: 1px solid rgba(139, 69, 19, 0.3); +} +.mournblade-post-item .post-item-stats .post-stat { + display: flex; + align-items: center; + gap: 4px; + background: rgba(255, 255, 255, 0.7); + border: 1px solid rgba(139, 69, 19, 0.4); + border-radius: 3px; + padding: 2px 6px; + font-size: 0.8rem; +} +.mournblade-post-item .post-item-stats .post-stat.post-stat-full { + flex: 1 1 100%; +} +.mournblade-post-item .post-item-stats .post-stat .stat-label { + color: #8b4513; + font-weight: bold; + font-size: 0.75rem; +} +.mournblade-post-item .post-item-stats .post-stat .stat-value { + color: #2a1400; + font-size: 0.8rem; +} +.mournblade-post-item .post-item-description { + padding: 8px 10px; + color: #2a1400; + font-size: 0.9rem; + line-height: 1.4; + background: rgba(245, 230, 211, 0.85); +} +.mournblade-post-item .post-item-description p { + margin: 4px 0; +} +.mournblade-post-item .post-item-description em, +.mournblade-post-item .post-item-description i { + color: #5a2d00; +} /* -------------------------------------------- */ .mournblade-welcome-message { - background: linear-gradient(135deg, rgba(139, 0, 0, 0.15) 0%, rgba(74, 4, 4, 0.2) 100%); - border: 2px solid #8b0000; + background: linear-gradient(135deg, rgba(139, 69, 19, 0.15) 0%, rgba(42, 20, 0, 0.2) 100%); + border: 2px solid #8b4513; border-radius: 8px; padding: 0; margin: 8px 0; @@ -2015,7 +2148,7 @@ li { box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); } .mournblade-welcome-message .welcome-header { - background: linear-gradient(135deg, #8b0000 0%, #4a0404 100%); + background: linear-gradient(135deg, #8b4513 0%, #2a1400 100%); padding: 10px; text-align: center; border-bottom: 2px solid #ffd700; @@ -2054,7 +2187,7 @@ li { margin-bottom: 10px; padding: 8px; background: rgba(255, 255, 255, 0.6); - border-left: 4px solid #8b0000; + border-left: 4px solid #8b4513; border-radius: 4px; } .mournblade-welcome-message .welcome-content .welcome-section:last-child { @@ -2063,7 +2196,7 @@ li { .mournblade-welcome-message .welcome-content .welcome-section .section-icon { flex-shrink: 0; font-size: 1.3rem; - color: #8b0000; + color: #8b4513; width: 28px; text-align: center; } @@ -2073,7 +2206,7 @@ li { } .mournblade-welcome-message .welcome-content .welcome-section .section-text strong { display: block; - color: #8b0000; + color: #8b4513; font-size: 1rem; margin-bottom: 2px; line-height: 1.2; @@ -2086,7 +2219,7 @@ li { .mournblade-welcome-message .welcome-content .welcome-section .section-text .welcome-link { display: inline-block; margin-top: 4px; - color: #8b0000; + color: #8b4513; font-weight: 600; text-decoration: none; transition: all 0.2s; @@ -2096,12 +2229,12 @@ li { margin-right: 4px; } .mournblade-welcome-message .welcome-content .welcome-section .section-text .welcome-link:hover { - color: #a00000; - text-shadow: 0 0 4px rgba(139, 0, 0, 0.3); + color: #a06010; + text-shadow: 0 0 4px rgba(139, 69, 19, 0.3); transform: translateX(2px); } .mournblade-welcome-message .welcome-footer { - background: linear-gradient(135deg, #4a0404 0%, #8b0000 100%); + background: linear-gradient(135deg, #2a1400 0%, #8b4513 100%); padding: 8px; text-align: center; color: #ffd700; @@ -2710,6 +2843,36 @@ li { .fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .sheet-box { height: auto; } +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content { + color: #2a1a0a !important; + background: rgba(255, 250, 240, 0.92); + border-radius: 3px; + padding: 0.4rem 0.5rem; + min-height: 6rem; +} +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content p, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content p, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content ul, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content ul, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content ol, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content ol, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content li, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content li, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content h1, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content h1, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content h2, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content h2, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content h3, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content h3, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror .editor-content h4, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror .editor-content h4 { + color: #2a1a0a !important; +} +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab prose-mirror:not(.inactive) .editor-content, +.fvtt-mournblade-cyd-2-0.actor .sheet-body .tab .editor prose-mirror:not(.inactive) .editor-content { + background: rgba(255, 252, 245, 0.98); +} .fvtt-mournblade-cyd-2-0.actor .sheet-body .compact-list { list-style: none; margin: 0; diff --git a/templates/actor-sheet.hbs b/templates/actor-sheet.hbs index 6cf6e18..517cc94 100644 --- a/templates/actor-sheet.hbs +++ b/templates/actor-sheet.hbs @@ -362,7 +362,7 @@

    - + @@ -375,7 +375,7 @@ {{#each runes as |rune key|}}
  • - {{rune.name}} + {{rune.name}} {{rune.system.formule}} {{rune.system.seuil}}
     
    @@ -779,8 +779,8 @@

    Description

    -
    - {{editor description target="system.biodata.description" button=true owner=owner editable=editable}} +
    + {{formInput systemFields.biodata.fields.description enriched=enrichedDescription value=system.biodata.description name="system.biodata.description" toggled=true}}
    diff --git a/templates/chat-degats-result.hbs b/templates/chat-degats-result.hbs index 4b68017..17ad9ec 100644 --- a/templates/chat-degats-result.hbs +++ b/templates/chat-degats-result.hbs @@ -1,33 +1,96 @@ -
    - {{#if actorImg}} - {{alias}} - {{/if}} -

    {{alias}}

    -
    +
    -
    - -{{#if actionImg}} -
    - {{name}} -
    -{{/if}} - -
    - -
    -
      -
    • - Arme : {{arme.name}} (+{{arme.system.totalDegats}}) -
    • -
    • Formule : {{formula}}
    • -
    • Dégats : {{finalResult}}
    • - {{#if targetVigueur}} -
    • Vigueur de la cible : {{targetVigueur}}
    • -
    • - Etats de Combativité supplémentaires perdus (auto) : - {{nbEtatPerdus}} -
    • + {{!-- Header avec acteur --}} +
      + {{#if actorImg}} + {{alias}} {{/if}} -
    +
    +

    {{alias}}

    + {{#if arme}} +
    + + Dégâts — {{arme.name}} + {{#if arme.system.nonletaux}}(Non létaux){{/if}} +
    + {{/if}} +
    +
    + + {{!-- Résultat des dégâts --}} +
    +
    +
    + + {{diceResult}} +
    +
    + Dégâts + {{finalResult}} +
    + {{#if targetVigueur}} +
    + SV + {{targetVigueur}} +
    + {{/if}} +
    + + {{!-- Badge résultat dégâts --}} + {{#if targetVigueur}} +
    + {{#if (eq nbEtatPerdus 0)}} +
    + Armure tient +
    + {{else if (eq nbEtatPerdus 1)}} +
    + +1 état supplémentaire +
    + {{else}} +
    + +{{nbEtatPerdus}} états supplémentaires +
    + {{/if}} +
    + {{/if}} +
    + + {{!-- Détails des dégâts --}} +
    +
    + Arme : + {{arme.name}} (+{{arme.system.totalDegats}}) +
    +
    + Formule : + {{formula}} +
    + {{#if targetVigueur}} +
    + SV cible : + {{targetVigueur}} +
    +
    + États supplémentaires perdus : + {{nbEtatPerdus}} +
    + {{/if}} +
    + + {{!-- Info : dégâts auto-appliqués si cible sélectionnée --}} +
    + {{#if defenderTokenId}} +
    + + Combativité appliquée automatiquement à la cible. +
    + {{else}} +
    + + Aucune cible sélectionnée — appliquez les dégâts manuellement. +
    + {{/if}} +
    +
    diff --git a/templates/chat-generic-result.hbs b/templates/chat-generic-result.hbs index 6218b90..2b593f1 100644 --- a/templates/chat-generic-result.hbs +++ b/templates/chat-generic-result.hbs @@ -1,138 +1,304 @@ -
    - {{#if actorImg}} - {{alias}} - {{/if}} -

    {{alias}}

    -
    +
    -
    - -{{#if actionImg}} -
    - {{name}} -
    -{{/if}} - -
    - -
    -
      -
    • - Attribut : {{attr.label}} ({{attr.value}}) -
    • - {{#if attr2}} -
    • Attribut : {{attr2.label}} ({{attr2.value}})
    • - {{/if}} {{#if competence}} -
    • - Compétence : {{competence.name}} - ({{competence.system.niveau}}) -
    • - {{/if}} {{#if selectedMaitrise}} -
    • Maitrise : {{selectedMaitrise.name}}
    • - {{/if}} {{#if arme}} -
    • - Arme : {{arme.name}} (+{{arme.system.bonusmaniementoff}}) -
    • + {{!-- Header avec acteur --}} +
      + {{#if actorImg}} + {{alias}} {{/if}} - -
    • Formule : {{diceFormula}}
    • -
    • Résultat du dé : {{diceResult}}
    • - - {{#if bonusRoll}} -
    • {{textBonus}} : +{{bonusRoll.total}}
    • - {{/if}} - -
    • Total : {{finalResult}}
    • - - {{#if attaqueCharge}} -
    • - Vous avez chargé : vos adversaires bénéficient de +3 pour vous attaquer -
    • - {{/if}} {{#if difficulte}} -
    • SD : {{difficulte}}
    • - - {{#if isSuccess}} -
    • Succés...
    • - {{#if attaqueDesarme}} -
    • Vous désarmez votre adversaire ! Son arme tombe hors de sa portée.
    • - {{/if}} {{else}} -
    • Echec...
    • - {{/if}} {{/if}} {{#if isHeroique}} -
    • Héroïque !!!
    • - {{#if attaqueDesarme}} -
    • - ... Et en plus vous récupérez l'arme de votre adversaire dans votre main - (si vous le souhaitez) !. -
    • - {{/if}} {{/if}} {{#if isDramatique}} -
    • Dramatique !!!
    • - {{/if}} {{#if isInit}} -
    • Initiative stockée !
    • - {{/if}} {{#if isSuccess}} {{#if immobiliser}} {{#if isHeroique}} -
    • - Votre cible est immobilisée, et vous pouvez faire une action complexe. -
    • - {{else}} -
    • Votre cible est immobilisée.
    • - {{/if}} {{/if}} {{#if desengager}} {{#if isSuccess}} -
    • Vous vous désengagez de votre adversaire.
    • - {{else}} -
    • - Vous ne parvenez pas à vous désengager de votre adversaire, il a un bonus - de +3 pour vous attaquer -
    • - {{/if}} {{/if}} {{#if repousser}} {{#if isHeroique}} -
    • Votre cible est repoussée de 3 mètres et tombe au sol.
    • - {{else}} -
    • Votre cible tombe au sol.
    • - {{/if}} {{/if}} {{#if assomer}} {{#if isHeroique}} -
    • Votre cible est assomée pour [[/r 1d10+10]] minutes.
    • - {{else}} -
    • Votre cible est assomée pour [[/r 1d10]] minutes.
    • - {{/if}} {{/if}} {{#if coupBas}} -
    • - La cible a reçu 2 adversités bleues et a perdu 1 niveau de combativité - (auto). -
    • - {{#if isHeroique}} -
    • Et votre cible perd sa prochaine action complexe.
    • - {{/if}} {{/if}} {{#if arme}} {{#if contenir}} {{#if isHeroique}} -
    • - Aucun dégât, mais tous les adversaires dont le Seuil de Défense + 10 est - atteint ou dépassé par le résultat de la manœuvre ne peuvent déclarer - d’attaque contre le personnage lors de leur prochaine action complexe (à - ce tour de jeu ou au suivant). -
    • - {{else}} -
    • - Aucun dégât, mais la cible de cette manœuvre ne peut pas déclarer - d’attaque contre vous lors de sa prochaine action complexe (à ce tour de - jeu ou au suivant). -
    • - {{/if}} {{else}} {{#if (eq nbCombativitePerdu "vaincu")}} -
    • Votre adversaire est vaincu !
    • - {{else}} -
    • - Votre adversaire a perdu {{nbCombativitePerdu}} Etat de Combativité (auto) -
    • - {{#if (not arme.system.onlevelonly)}} - - {{#if coupDevastateur}} - - {{/if}} {{/if}} {{/if}} {{/if}} {{/if}} {{/if}} {{#each predilections as - |pred key|}} -
    • - {{#if (and (and pred.acquise (not pred.maitrise)) (not pred.used))}} - +
      +

      {{alias}}

      + {{#if competence}} +
      + + {{competence.name}} + {{#if rune}}• {{rune.name}}{{else if arme}}• {{arme.name}}{{/if}} +
      + {{else if attr}} +
      + + {{attr.label}}{{#if attr2}} / {{attr2.label}}{{/if}} +
      {{/if}} -
    • - {{/each}} -
    +
    +
    + + {{!-- Résultat principal --}} +
    +
    +
    + + {{diceResult}} +
    + {{#if isD20Impair}} +
    + + D20 impair → valeur dé : 0 +
    + {{/if}} +
    + Total + {{finalResult}} +
    + {{#if difficulte}} +
    + SD + {{difficulte}} +
    + {{/if}} +
    + + {{!-- Badge de résultat --}} + {{#if difficulte}} +
    + {{#if isHeroique}} +
    + HÉROÏQUE ! +
    + {{else if isDramatique}} +
    + DRAMATIQUE ! +
    + {{else if isSuccess}} +
    + Succès +
    + {{else}} +
    + Échec +
    + {{/if}} +
    + {{/if}} +
    + + {{!-- Détails du jet --}} +
    +
    + Formule : + {{diceFormula}} +
    + {{#if attr}} +
    + {{attr.label}} : + {{attr.value}} +
    + {{/if}} + {{#if attr2}} +
    + {{attr2.label}} : + {{attr2.value}} +
    + {{/if}} + {{#if competence}} +
    + {{competence.name}} : + {{competence.system.niveau}} +
    + {{/if}} + {{#if selectedMaitrise}} +
    + Maîtrise : + {{selectedMaitrise.name}} +
    + {{/if}} + {{#if arme}} +
    + Arme : + {{arme.name}} (+{{arme.system.bonusmaniementoff}}) +
    + {{/if}} + {{#if rune}} +
    + Rune : + {{rune.name}}{{#if rune.system.formule}} — {{rune.system.formule}}{{/if}} +
    +
    + Mode : + {{runemode}} +
    +
    + Pouvoir / Durée : + {{runeame}} pts → {{runeduree}} action(s) complexe(s) +
    +
    + Coût en Âme : + {{runeAmeCout}} pts +
    + {{/if}} + {{#if bonusRoll}} +
    + {{textBonus}} : + +{{bonusRoll.total}} +
    + {{/if}} +
    + + {{!-- Effets et conséquences --}} + {{#if rune}} +
    + {{#if isSuccess}} + {{#if isHeroique}} +
    + + La rune {{rune.name}} est activée avec une puissance héroïque — la résistance est impossible ! +
    + {{else}} +
    + + La rune {{rune.name}} est activée avec succès. +
    + {{/if}} + {{else}} + {{#if isDramatique}} +
    + + Échec dramatique : la rune échoue — les forces du chaos se déchaînent ! +
    + {{else}} +
    + + Échec simple : la rune n'a aucun effet. +
    + {{/if}} + {{/if}} +
    + {{else}} + {{!-- Effets et conséquences --}} + {{#if isSuccess}} +
    + {{#if attaqueCharge}} +
    + + Vous avez chargé : vos adversaires bénéficient de +3 pour vous attaquer. +
    + {{/if}} + + {{#if attaqueDesarme}} +
    + {{#if isHeroique}} + + Vous désarmez votre adversaire et récupérez son arme (si vous le souhaitez) ! + {{else}} + + Vous désarmez votre adversaire ! Son arme tombe hors de sa portée. + {{/if}} +
    + {{/if}} + + {{#if immobiliser}} +
    + {{#if isHeroique}} + + Votre cible est immobilisée — vous pouvez faire une action complexe. + {{else}} + + Votre cible est immobilisée. + {{/if}} +
    + {{/if}} + + {{#if repousser}} +
    + {{#if isHeroique}} + + Votre cible est repoussée de 3 mètres et tombe au sol. + {{else}} + + Votre cible tombe au sol. + {{/if}} +
    + {{/if}} + + {{#if assomer}} +
    + {{#if isHeroique}} + + Votre cible est assommée pour [[/r 1d10+10]] minutes. + {{else}} + + Votre cible est assommée pour [[/r 1d10]] minutes. + {{/if}} +
    + {{/if}} + + {{#if coupBas}} +
    + + La cible reçoit 2 adversités bleues et perd 1 niveau de combativité (auto). + {{#if isHeroique}} +
    Votre cible perd aussi sa prochaine action complexe. + {{/if}} +
    + {{/if}} + + {{#if arme}} + {{#if contenir}} +
    + {{#if isHeroique}} + + Tous les adversaires dont le SD+10 est atteint ne peuvent pas déclarer d'attaque lors de leur prochaine action complexe. + {{else}} + + La cible ne peut pas vous attaquer lors de sa prochaine action complexe. + {{/if}} +
    + {{else}} + {{#if (eq nbCombativitePerdu "vaincu")}} +
    + + Votre adversaire est vaincu ! +
    + {{else}} +
    + + Votre adversaire a perdu {{nbCombativitePerdu}} état(s) de combativité (auto). +
    + {{#if (not arme.system.onlevelonly)}} +
    + + {{#if coupDevastateur}} + + {{/if}} +
    + {{/if}} + {{/if}} + {{/if}} + {{/if}} +
    + {{else}} + {{!-- Conséquences d'un échec --}} + {{#if desengager}} +
    +
    + + Vous ne parvenez pas à vous désengager — malus de -5 à votre défense ce tour et le suivant. +
    +
    + {{/if}} + {{#if isInit}} +
    +
    + + Initiative stockée ! +
    +
    + {{/if}} + {{/if}} + {{/if}} + + {{!-- Prédilections (boutons de relance) --}} + {{#each predilections as |pred key|}} + {{#if (and (and pred.acquise (not pred.maitrise)) (not pred.used))}} +
    + +
    + {{/if}} + {{/each}} +
  • diff --git a/templates/creature-sheet.hbs b/templates/creature-sheet.hbs index 3fc9b84..378553d 100644 --- a/templates/creature-sheet.hbs +++ b/templates/creature-sheet.hbs @@ -347,14 +347,14 @@
    Description
    -
    - {{editor description target="system.biodata.description" button=true owner=owner editable=editable}} +
    + {{formInput systemFields.biodata.fields.description enriched=enrichedDescription value=system.biodata.description name="system.biodata.description" toggled=true}}
    Habitat
    -
    - {{editor habitat target="system.biodata.habitat" button=true owner=owner editable=editable}} +
    + {{formInput systemFields.biodata.fields.habitat enriched=enrichedHabitat value=system.biodata.habitat name="system.biodata.habitat" toggled=true}}
    diff --git a/templates/post-item.hbs b/templates/post-item.hbs index 8ce0f51..27df3d8 100644 --- a/templates/post-item.hbs +++ b/templates/post-item.hbs @@ -1,8 +1,55 @@ -
    -

    {{name}}

    - {{#if img}} - +
    + + {{!-- Header --}} +
    + {{#if img}} + + {{/if}} +
    +

    {{name}}

    + {{type}} +
    +
    + + {{!-- Statistiques selon le type --}} + {{#if (eq type "arme")}} +
    + {{#if system.typearme}}
    Type{{system.typearme}}
    {{/if}} + {{#if system.degats}}
    Dégâts{{system.degats}}
    {{/if}} + {{#if system.bonusmaniementoff}}
    Bonus off.+{{system.bonusmaniementoff}}
    {{/if}} + {{#if system.seuildefense}}
    Seuil def.{{system.seuildefense}}
    {{/if}} +
    {{/if}} -

    Description :

    -

    {{{system.description}}}

    + + {{#if (eq type "protection")}} +
    + {{#if system.protection}}
    Protection{{system.protection}}
    {{/if}} + {{#if system.adversitepoids}}
    Adv. poids{{system.adversitepoids}}
    {{/if}} +
    + {{/if}} + + {{#if (eq type "competence")}} +
    + {{#if system.niveau}}
    Niveau{{system.niveau}}
    {{/if}} + {{#if (ne system.attribut1 "none")}}
    Attribut 1{{upper system.attribut1}}
    {{/if}} + {{#if (ne system.attribut2 "none")}}
    Attribut 2{{upper system.attribut2}}
    {{/if}} +
    + {{/if}} + + {{#if (eq type "rune")}} +
    + {{#if system.formule}}
    Formule{{system.formule}}
    {{/if}} + {{#if system.seuil}}
    Seuil{{system.seuil}}
    {{/if}} + {{#if system.prononcee}}
    Prononcée{{system.prononcee}}
    {{/if}} + {{#if system.tracee}}
    Tracée{{system.tracee}}
    {{/if}} +
    + {{/if}} + + {{!-- Description --}} + {{#if system.description}} +
    + {{{system.description}}} +
    + {{/if}} +
    diff --git a/templates/roll-dialog-generic.hbs b/templates/roll-dialog-generic.hbs index 8da11f4..eb9f190 100644 --- a/templates/roll-dialog-generic.hbs +++ b/templates/roll-dialog-generic.hbs @@ -1,240 +1,311 @@ -
    -
    - {{#if img}} - - {{/if}} -

    {{title}}

    -
    - -
    - -
    - {{#if (eq attrKey "tochoose")}} - Attribut - - {{else}} - {{attr.label}} - {{attr.value}} - {{/if}} -
    - - {{#if nbAdversites}} -
    - Malus d'adversités - - {{nbAdversites}} -
    - {{/if}} - +{{!-- Header --}} +
    + {{name}} +
    +

    {{name}}

    {{#if competence}} -
    - {{competence.name}} - {{competence.system.niveau}} +
    + {{competence.name}} + {{#if arme}}— {{arme.name}}{{/if}} + {{#if (and attr (ne attrKey "tochoose"))}} + ({{attr.label}} : {{attr.value}}) + {{/if}}
    - {{#if maitrises}} -
    - Utiliser une maîtrise - -
    - {{/if}} {{else}} -
    - Second Attribut - -
    + {{#if (and attr (ne attrKey "tochoose"))}} +
    + {{attr.label}} : {{attr.value}} +
    + {{/if}} {{/if}} +
    +
    - {{#if (count talents)}} -
    - Talents - + {{selectOptions attributs selected=attrKey}} + +
    + {{/if}} + + {{!-- Second attribut (hors compétence) --}} + {{#if (not competence)}} +
    + + +
    + {{/if}} + + {{!-- Malus d'adversités (CYD 2.0) --}} + {{#if nbAdversites}} +
    +
    +
    + Malus d'adversités + - {{nbAdversites}} +
    +
    +
    + {{/if}} + + {{!-- Compétence + Maîtrises --}} + {{#if competence}} +
    + + {{competence.system.niveau}} +
    + {{#if maitrises}} +
    + + +
    + {{/if}} + {{/if}} + + {{!-- Talents --}} + {{#if (count talents)}} +
    + +
    - {{/if}} + {{/if}} - {{#if conditionsCommunes}} -
    - En surplomb, défenseur au sol (+3)? - + {{!-- Conditions communes (hors arme) --}} + {{#if conditionsCommunes}} +
    +

    Avantages Tactiques

    +
    + + + +
    -
    - Défenseur aveuglé (+10)? - -
    -
    - Défenseur de dos (+5)? - -
    -
    - Défenseur immobilisé (+5)? - -
    - {{/if}} +
    + {{/if}} - {{#if (or immobiliser repousser)}} -
    - Cible consciente? + {{!-- Manœuvres spéciales (immobiliser / repousser) --}} + {{#if (or immobiliser repousser)}} +
    +
    - {{/if}} + Cible consciente + +
    + {{/if}} - {{#if arme}} + {{!-- Rune --}} + {{#if rune}} +
    +
    + + {{rune.name}}{{#if rune.system.formule}} — {{rune.system.formule}}{{/if}} +
    +
    + + +
    +
    + + +
    +
    + {{/if}} + + {{!-- Section arme --}} + {{#if arme}} +
    +
    + {{arme.name}} + +{{arme.system.bonusmaniementoff}} +
    + + {{!-- Arme de mêlée --}} {{#if arme.system.isMelee}} {{#if bonusArmeNaturelle}} -
    - Arme naturelle/fortune en défense - {{bonusArmeNaturelle}} +
    + + {{bonusArmeNaturelle}}
    {{/if}} -
    - En surplomb, défenseur au sol (+3)? - + +

    Modificateurs de Combat

    +
    + + + {{#if hasAmbidextre}} + + + {{/if}} + {{#if hasFeinte}} + + {{/if}} + + + + + + + + {{#if isMonte}} + + {{/if}}
    -
    - Attaquants multiples (après le premier) (+3)? - -
    - {{#if hasAmbidextre}} -
    - Première attaque avec deux armes (-3)? - -
    -
    - Seconde attaque avec deux armes (-6)? - -
    - {{/if}} - {{#if hasFeinte}} -
    - Feinte (cout : 1 BA) ? - -
    - {{/if}} -
    - Soutiens - {{selectOptions config.optionsSoutiens selected=soutiens valueAttr="key" nameAttr="key" labelAttr="label"}}
    -
    - Défenseur aveuglé (+10)? - -
    -
    - Défenseur de dos (+5)? - -
    -
    - Défenseur dans espace restreint (+3)? - -
    -
    - Défenseur immobilisé (+5)? - -
    -
    - Charge ? - -
    -
    - Contenir? - -
    -
    - Désarmer (SD+10)? - -
    - {{#if isMonte}} -
    - Charge de cavalerie? - -
    - {{/if}} - {{else}} -
    - Tireur en déplacement ? - -
    -
    - Couvert de la cible ? - -
    -
    - Cible se déplace vite (SD+3)? - -
    -
    - Cible corps à corps (SD+3)? - -
    -
    - Taille de la cible ? - -
    {{/if}} - {{/if}} -
    - Bonus/Malus - + Cible se déplace vite (SD+3) + + +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    + {{/if}} + + {{!-- SD de l'adversaire (mêlée) --}} + {{#if (and armeDefense (not arme.system.isDistance))}} +
    + {{#if desengager}}C. Offensive adversaire{{else}}C. Défensive adversaire{{/if}} + {{difficulte}} +
    + {{/if}} +
    + {{/if}} + + {{!-- Bonus / Malus contextuel et Difficulté --}} +
    +
    + +
    - {{#if (or armeDefense arme.system.isDistance)}} - - {{#if arme.system.isDistance}} -
    - SD de distance - -
    - {{else}} -
    - {{#if desengager}} - C. Offensive adversaire - {{else}} - C. Défensive adversaire - {{/if}} - {{difficulte}} -
    - {{/if}} - - {{else}} - - {{#if isInit}} - - {{else}} -
    - Difficulté : - {{selectOptions config.optionsDifficulte selected=difficulte valueAttr="key" nameAttr="key" labelAttr="label"}}
    - {{/if}} + {{/unless}} {{/if}} -
    - \ No newline at end of file +
    +