ActiveEffects: Add complete ActiveEffects management system
- New: modules/mournblade-cyd2-effects.js with utility methods for creating, applying, and managing effects - New: templates/partial-active-effects.hbs for displaying actor effects - New: templates/partial-item-effects.hbs for displaying item effects - Update: modules/mournblade-cyd2-config.js with effect configuration (types, attribute keys, categories) - Update: templates/actor-sheet.hbs and creature-sheet.hbs with Effects tab - Update: templates/partial-item-nav.hbs with conditional Effects tab - Update: templates/item-talent-sheet.hbs with Effects tab content - Update: base-actor-sheet.mjs with effect action handlers (create, edit, delete, toggle) - Update: base-item-sheet.mjs with effect action handlers and context - Update: modules/mournblade-cyd2-main.js to import and expose MournbladeCYD2Effects - Update: lang/fr.json with effect-related translations Features: - Support for creating permanent and temporary effects - Support for attribute modifications (ADR, PUI, CLA, PRE, TRE, etc.) - Support for health, soul, combat, and adversity modifications - Support for status effects - Support for runes (pronounced and traced) effects - Toggle to enable/disable effects - Duration tracking (rounds, turns, seconds, combat, scene) - Display of all active modifications summary Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
{{!-- Partial pour l'affichage des ActiveEffects --}}
|
||||
|
||||
<div class="sheet-box color-bg-archetype">
|
||||
<ul class="item-list alternate-list">
|
||||
|
||||
{{!-- En-tête --}}
|
||||
<li class="item flexrow list-item items-title-bg">
|
||||
<span class="item-name-label-header">
|
||||
<h3><label class="items-title-text">Effets Actifs</label></h3>
|
||||
</span>
|
||||
<div class="item-filler"> </div>
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control" data-action="createEffect" title="Ajouter un effet">
|
||||
<i class="fas fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
{{!-- Affiche un message si aucun effet --}}
|
||||
{{#if (not actor.effects.length)}}
|
||||
<li class="item flexrow">
|
||||
<span class="item-name-label competence-name" style="color: #888; font-style: italic;">Aucun effet actif</span>
|
||||
</li>
|
||||
{{/if}}
|
||||
|
||||
{{!-- Liste des effets --}}
|
||||
{{#each actor.effects as |effect|}}
|
||||
<li class="item flexrow" data-effect-id="{{effect.id}}" {{#if effect.disabled}}style="opacity: 0.6;"{{/if}}>
|
||||
{{!-- Icône de l'effet --}}
|
||||
<img class="item-name-img" src="{{effect.icon}}" onerror="this.src='systems/fvtt-mournblade-cyd-2-0/assets/icons/effect.webp'" />
|
||||
|
||||
{{!-- Nom et description de l'effet --}}
|
||||
<div class="flexcol item-name-label">
|
||||
<span class="item-name-label competence-name">
|
||||
{{effect.name}}
|
||||
{{#if effect.disabled}}<i class="fas fa-ban" style="color: #ff5555; margin-left: 5px;" title="Désactivé"></i>{{/if}}
|
||||
</span>
|
||||
|
||||
{{!-- Affichage compact des modifications --}}
|
||||
{{#if effect.changes.length}}
|
||||
<span class="predilection-text" style="font-size: 0.85em; color: #aaa;">
|
||||
{{#each effect.changes as |change index|}}
|
||||
{{#if (eq change.mode 0)}}(+{{/if}}{{#if (eq change.mode 1)}}(*{{/if}}{{#if (eq change.mode 2)}}={{/if}}{{change.value}}{{#if (eq change.mode 0)}}){{/if}}{{#if (eq change.mode 1)}}){{/if}}
|
||||
{{#unless (eq index (subtract effect.changes.length 1))}}, {{/unless}}
|
||||
{{/each}}
|
||||
{{#each effect.statuses as |status|}}
|
||||
{{#if (and (ne status "") (not (eq index 0)))}}, {{/if}}
|
||||
<i class="fas fa-exclamation-triangle" style="color: #ffaa00;" title="{{status}}"></i>
|
||||
{{/each}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{!-- Affichage de la durée --}}
|
||||
{{#if effect.duration.type}}
|
||||
<span class="item-field-label-short" style="font-size: 0.85em;">
|
||||
{{#if (eq effect.duration.type "rounds")}}🔄{{/if}}
|
||||
{{#if (eq effect.duration.type "turns")}}🎭{{/if}}
|
||||
{{#if (eq effect.duration.type "seconds")}}⏱️{{/if}}
|
||||
{{#if (eq effect.duration.type "combat")}}⚔️{{/if}}
|
||||
{{#if (eq effect.duration.type "scene")}}📜{{/if}}
|
||||
{{effect.duration.value}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
||||
{{!-- Contrôles --}}
|
||||
<div class="item-controls item-controls-fixed">
|
||||
<a class="item-control" data-action="editEffect" data-effect-id="{{effect.id}}" title="Éditer">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a class="item-control" data-action="toggleEffect" data-effect-id="{{effect.id}}" title="{{#if effect.disabled}}Activer{{else}}Désactiver{{/if}}">
|
||||
<i class="fas fa-{{#if effect.disabled}}check{{else}}times{{/if}}"></i>
|
||||
</a>
|
||||
<a class="item-control" data-action="deleteEffect" data-effect-id="{{effect.id}}" title="Supprimer">
|
||||
<i class="fas fa-trash"></i>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{{!-- Affichage détaillé des effets actifs --}}
|
||||
{{#if actor.effects.length}}
|
||||
<div class="sheet-box color-bg-archetype effect-summary">
|
||||
<h4 class="section-title">Résumé des modifications</h4>
|
||||
<div class="effect-modifications">
|
||||
{{#each actor.effects as |effect|}}
|
||||
{{#if (not effect.disabled)}}
|
||||
{{#if effect.changes.length}}
|
||||
<div class="effect-category">
|
||||
<strong>{{effect.name}}:</strong>
|
||||
{{#each effect.changes as |change|}}
|
||||
<span class="effect-modification">
|
||||
{{change.key}}:
|
||||
{{#if (eq change.mode 0)}}+{{/if}}
|
||||
{{#if (eq change.mode 1)}}*{{/if}}
|
||||
{{#if (eq change.mode 2)}}={{/if}}
|
||||
{{change.value}}
|
||||
{{#if (eq change.mode 0)}}{{/if}}
|
||||
{{#if (eq change.mode 1)}}{{/if}}
|
||||
</span>{{#unless @last}}, {{/unless}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
Reference in New Issue
Block a user