The previous solution used a flag, but it didn't persist across preparation cycles.
This solution checks this.effects.applicationPhase directly.
If phase is 'initial' or 'final', it means effects are already being applied,
so we skip the super.prepareEmbeddedDocuments() call to avoid the
'phase has already completed' error.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
The previous commit accidentally created a duplicate prepareBaseData() method.
This commit removes the duplicate and keeps only the version with proper
initialization of wound data and combatStatus.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Move wound data initialization to prepareBaseData() (before effects are applied)
- Initialize combatStatus in prepareBaseData() to prevent undefined errors
- Add protection against recursive effect application in prepareEmbeddedDocuments()
- This prevents the 'ActiveEffect application phase has already completed' error
The error occurred because modify data in prepareDerivedData() (like combatStatus)
could trigger observers that try to re-apply effects during the same cycle.
By initializing all required data in prepareBaseData() and protecting
prepareEmbeddedDocuments() from recursive calls, we ensure effects are
applied exactly once per preparation cycle.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
The previous commit accidentally removed the {{/if}} that closes the
{{#if system.identity.relations}} block at line 102, causing a
Handlebars parse error: 'Expecting OPEN_INVERSE_CHAIN, INVERSE, OPEN_ENDBLOCK, got EOF'
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Fixed grid-2 to grid-2col CSS class usage
- Replaced improper <p><a> tags with <div><a> in item lists (actor-weapons, actor-defenses, group-items, group-vehicles)
- Fixed typos: smarttlk -> smarttl, compétence -> Compétence
- Fixed duplicate class attributes
- Standardized HTML comments to Handlebars comments ({{!-- --}})
- Added missing localizations for Character and Skills headers
- Removed orphan {{/if}} tag in character-id.hbs
- Created npc-skill-category.hbs partial to eliminate 150+ lines of duplicated skill category code in actor-npc-sheet.hbs
- Created item-list.hbs partial for reusable item list display
- Fixed html.find(...).forEach error in roll.mjs by ensuring jQuery object
- Added .history/ to .gitignore
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- 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>
- Change all dice rolls in fight.mjs from d6 to d10
- Implement success counting system (dice >= difficulty) as per Vermine2047 rules
- Add d10 success class to dice that meet or exceed difficulty
- Display success count in confrontation UI
- Update chat message handler to count successes instead of summing dice
- Add comprehensive JSDoc documentation to performTest method
- Add missing French translations for fight tool terms
This corrects a critical inconsistency where fight.mjs was using d6
while the official Vermine2047 rules and the rest of the system (roll.mjs)
use d10 with success counting.
Compatibility: FoundryVTT v11-v14
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Fix constructor in rollDialog.mjs (spread operator for options)
- Remove all console.log statements from production code
- Add comprehensive JSDoc comments for all public APIs
- Convert French comments to English for consistency
- Use parseInt with radix parameter (10) throughout
- Replace let with const where appropriate
- Use Set for O(1) lookups in group-link.mjs methods
- Use spread operators for array cloning
- Optimize removeActorFromAllGroups with Set lookups
- Improve registerHooks with better comments and Set usage
- Simplify roll-message.hbs template logic
- Fix duplicate VERMINE key in lang/fr.json
- Add missing error translations
- Add .eslintrc.js with FoundryVTT-compatible linting config
Compatibility: FoundryVTT v11-v14
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Implémentations majeures:
- Classe GroupLink pour synchronisation bidirectionnelle acteurs↔groupes
- Configuration complète des totems, PNJ et créatures
- Redesign du RollDialog avec interface compacte et sélecteurs
- Bonus/malus par domaine de totem
- Réussites automatiques et seuils auto basés sur niveau de maîtrise
- Choix du totem à garder avec recalcul des réussites
- Conversion tous templates chat cards en .hbs
- Fiches PNJ et Créature avec sélecteurs pour tous les niveaux
- Documentation technique (ARCHITECTURE.md) et utilisateur (GUIDE_UTILISATEUR.md)
- Mise à jour system.json pour compatibilité v14
- Tous les TODOs du README.md complétés
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>