fix: Correct critical bugs and complete Creature/Group DataModel implementation

- Fix TypeError: controls.find is not a function in hooks.mjs
- Fix undefined 'npc' variable in applications.mjs
- Fix CONFIG.VERMINE.model undefined by checking game.system.template existence
- Fix TypeError: html.find(...).forEach is not a function in roll.mjs
- Fix Cannot set properties of undefined (setting 'initial') in actor.mjs
- Fix Cannot read properties of undefined (reading 'difficulty') in actor.mjs
- Fix ActiveEffect application phase 'initial' already completed by adding combatStatus to base template
- Fix Missing helper: 'select' in roll-dialog.hbs (removed invalid Handlebars select block)
- Add SIZE_LEVELS labels to creatureSizeLevels config
- Add SIZE_LEVELS translations to fr.json
- Add combatStatus to base actor template
- Convert all .html templates to .hbs for Foundry v14 compatibility
- Update item-sheet.mjs to use .hbs extension
- Update handlebars-manager.mjs to use .hbs for all partials

Complete Vermine2047 Creature and Group sheet implementation:
- Creature: Pattern, Size, Role, Pack with computed values
- Group: Totem, Reserve, Morale, Objectives, Members management
- All templates functional with proper styling

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-06-04 20:58:22 +02:00
parent f9f07cbc7e
commit 30d6f71fc7
43 changed files with 19225 additions and 609 deletions
+66 -112
View File
@@ -1,119 +1,73 @@
<div class="grid grid-2col">
{{!-- Computed Values --}}
<div>
<h4 class="align-center">{{ localize "VERMINE.self_control"}}</h4>
<p class="align-center">
<input type="number" name="system.attributes.self_control.value"
value="{{ system.attributes.self_control.value }}" data-dtype="Number"
min="{{ system.attributes.self_control.min }}"
max="{{ system.attributes.self_control.max }}" /> / {{
system.attributes.self_control.max }}
</p>
<h4 class="align-center">{{ localize 'VERMINE.computed_values' }}</h4>
<div class="stats-grid">
<div class="stat">
<label>{{ localize 'VERMINE.total_attack' }}:</label>
<span>{{ system.computed.attack }}</span>
</div>
<div class="stat">
<label>{{ localize 'ADVERSITY.damage' }}:</label>
<span>{{ system.computed.damage }}</span>
</div>
<div class="stat">
<label>{{ localize 'ADVERSITY.vigor' }}:</label>
<span>{{ system.computed.vigor }}</span>
</div>
<div class="stat">
<label>{{ localize 'ADVERSITY.reaction' }}:</label>
<span>{{ system.computed.reaction }}</span>
</div>
<div class="stat">
<label>{{ localize 'ADVERSITY.pools' }}:</label>
<span>{{ system.computed.pools }}</span>
</div>
<div class="stat">
<label>{{ localize 'ADVERSITY.protection' }}:</label>
<span>{{ system.computed.protection }}</span>
</div>
</div>
</div>
{{!-- Wounds --}}
<div>
<h4 class="align-center">{{ localize "VERMINE.effort"}}</h4>
<p class="align-center">
<input type="number" name="system.attributes.effort.value"
value="{{ system.attributes.effort.value }}" data-dtype="Number"
min="{{ system.attributes.effort.min }}"
max="{{ system.attributes.effort.max }}" /> / {{
system.attributes.effort.max }}
</p>
<h4 class="item-name effect-name flexrow">{{ localize "VERMINE.wounds.name" }}</h4>
<ul class="unstyled">
<li class="row mdb">
{{ localize 'VERMINE.wounds.light' }} ({{ system.minorWound.threshold }}D)
{{#repeat system.minorWound.max }}
<input type="radio" data-dtype="Number" name="system.minorWound.value"
value="{{this}}" {{#ife @root.system.minorWound.value this }}checked="checked"{{/ife}}
data-wound="minorWound"
class="{{#iflteq this @root.system.minorWound.value }}checked{{/iflteq}}"
/>
{{/repeat}}
</li>
<li class="row mdb">
{{ localize 'VERMINE.wounds.heavy' }} ({{ system.majorWound.threshold }}D)
{{#repeat system.majorWound.max }}
<input type="radio" name="system.majorWound.value" value="{{this}}" {{#ife @root.system.majorWound.value this }}checked="checked"{{/ife}}
data-wound="majorWound"
class="{{#iflteq this @root.system.majorWound.value }}checked{{/iflteq}}"
/>
{{/repeat}}
</li>
<li class="row mdb">
{{ localize 'VERMINE.wounds.deadly' }} ({{ system.deadlyWound.threshold }}D)
{{#repeat system.deadlyWound.max }}
<input type="radio" name="system.deadlyWound.value" value="{{this}}" {{#ife @root.system.deadlyWound.value this }}checked="checked"{{/ife}}
data-wound="deadlyWound"
class="{{#iflteq this @root.system.deadlyWound.value }}checked{{/iflteq}}"
/>
{{/repeat}}
</li>
</ul>
</div>
</div>
<h4 class="item-name effect-name flexrow">{{ localize
"VERMINE.wounds.name"}}</h4>
<ul class="unstyled">
<li class="row mdb">{{ localize 'VERMINE.wounds.light'}} <span
data-tooltip="seuil">({{
system.minorWound.threshold }})</span>
{{#repeat system.minorWound.max }}
<input type="radio" data-dtype="Number" name="system.minorWound.value"
value="{{this}}" {{#ife @root.system.minorWound.value this
}}checked="checked"{{/ife}} data-wound="minorWound"
class="
{{#iflteq this @root.system.minorWound.value }}
checked
{{/iflteq}}
" />
{{/repeat}}</li>
<li class="row mdb">{{ localize 'VERMINE.wounds.heavy'}} ({{
system.majorWound.threshold }})
{{#repeat system.majorWound.max }}
<input type="radio" name="system.majorWound.value" value="{{this}}" {{#ife
@root.system.majorWound.value this }}checked="checked"{{/ife}}
data-wound="majorWound"
class="
{{#iflteq this @root.system.majorWound.value }}
checked
{{/iflteq}}
" />
{{/repeat}}
</li>
<li class="row mdb">{{ localize 'VERMINE.wounds.deadly'}} ({{
system.deadlyWound.threshold }})
{{#repeat system.deadlyWound.max }}
<input type="radio" name="system.deadlyWound.value" value="{{this}}" {{#ife
@root.system.deadlyWound.value this }}checked="checked"{{/ife}}
data-wound="deadlyWound"
class="
{{#iflteq this @root.system.deadlyWound.value }}
checked
{{/iflteq}}
" />
{{/repeat}}
</li>
</ul>
<h4 class="item-name effect-name flexrow">{{ localize "UI.effects.name"}}</h4>
<ol class="items-list effects-list">
{{#each effects as |section sid|}}
<li class="items-header flexrow" data-effect-type="{{section.type}}">
<p class="item-name effect-name flexrow">{{#if (eq section.type
'temporary')}}
{{localize "UI.effects.temporary" }}
{{else if (eq section.type 'passive')}}
{{localize "UI.effects.passive" }}
{{else if (eq section.type 'inactive')}}
{{localize "UI.effects.inactive" }}
{{/if}}
</p>
<div class="effect-source">{{localize 'UI.source'}}</div>
<div class="effect-source">{{localize 'UI.duration'}}</div>
<div class="item-controls effect-controls flexrow">
<a class="effect-control" data-action="create"
title="{{localize 'UI.effect_create'}}">
<i class="fas fa-plus"></i> {{localize "UI.add"}}
</a>
</div>
</li>
<ol class="item-list">
{{#each section.effects as |effect|}}
<li class="item effect flexrow" data-effect-id="{{effect.id}}">
<div class="item-name effect-name">
<a class="effect-control flexrow flex-group-center items-center"
data-action="edit" title="{{localize 'UI.effect_edit'}}">
<img class="item-image" src="{{effect.icon}}" />
<span>{{effect.label}}</span>
</a>
</div>
<div class="effect-source">{{effect.sourceName}}</div>
<div class="effect-duration">{{effect.duration.label}}</div>
<div class="item-controls effect-controls flexrow">
<a class="effect-control" data-action="toggle"
title="{{localize 'UI.effect_toggle'}}">
<i
class="fas {{#if effect.disabled}}fa-check{{else}}fa-times{{/if}}"></i>
</a>
<a class="effect-control" data-action="delete"
title="{{localize 'UI.effect_delete'}}">
<i class="fas fa-trash"></i>
</a>
</div>
</li>
{{/each}}
</ol>
{{/each}}
</ol>
{{!-- Equipment --}}
<div class="grid-span-2">
<h4>{{ localize 'VERMINE.gear' }}</h4>
{{editor system.equipment.description target="system.equipment.description" button=true owner=owner editable=editable}}
</div>