Commit Graph

64 Commits

Author SHA1 Message Date
uberwald 9b77a0c552 Fix apv2, WIP 2026-06-06 10:21:24 +02:00
uberwald dfc9b823a4 fix(hooks): remove auto editMode flag setting to prevent phase errors
The createActor hook was causing 'ActiveEffect application phase already
completed' errors because setFlag() triggers actor updates which call
prepareData() -> prepareEmbeddedDocuments() -> applyActiveEffects().

Even with setTimeout delays, the error persisted. The cleanest solution is
to remove the auto-setting entirely. Users can enable edit mode manually
via the checkbox in the character sheet (which is preserved).

This prevents the error on:
- Character sheet profile editing
- Creature sheet creation
- Group sheet profile editing

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 23:23:11 +02:00
uberwald 02aabbea36 fix(hooks): delay editMode flag setting to avoid phase error on createActor
The createActor hook was calling actor.setFlag() immediately, which triggered
updateActor -> prepareData -> prepareEmbeddedDocuments() -> applyActiveEffects().

Since the actor had already gone through data preparation during creation,
the effects had already been applied, causing the 'phase already completed' error.

Solution: Use setTimeout(..., 0) to defer the flag setting until after the
current preparation cycle is complete.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 23:20:40 +02:00
uberwald 3db03f5159 fix(templates): complete revision of actor templates to remove duplicates and fix inconsistencies
- 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>
2026-06-04 22:58:46 +02:00
uberwald 30d6f71fc7 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>
2026-06-04 22:22:52 +02:00
uberwald f9f07cbc7e fix: migrate combat system from d6 to d10 to match official rules
- 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>
2026-06-04 16:48:57 +02:00
uberwald 386d80639c code review: fix critical issues and improve code quality
- 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>
2026-06-04 13:33:58 +02:00
uberwald 716c1b49ae Finalisation complète du système Vermine2047 pour FoundryVTT v14
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>
2026-06-04 11:46:40 +02:00
Erwan Lemaire c35e93975b pifpouf 2025-05-02 13:19:49 +02:00
Erwan Lemaire d380efeed5 reprise du projet 2025-04-17 14:55:41 +02:00
rwanoux dc621f2223 début des messages d'items 2024-11-26 12:48:27 +01:00
rwanoux 299fbcd50d essai de fix du bug des hooks sur messages, suppression des tours 2024-11-22 18:17:10 +01:00
rwanoux c5c41a2920 modif template items 2024-11-22 10:55:07 +01:00
rwanoux a4c07715a0 ajout des valeurs de combatStatus en config et sur perso 2024-11-22 10:53:30 +01:00
rwanoux 80277f822f ajout du handicap de rareté 2024-11-20 12:08:03 +01:00
rwanoux c0432d1efb traits+debut combat 2024-11-18 16:17:30 +01:00
rwanoux e721c706eb popopopo 2024-11-15 22:05:29 +01:00
rwanoux f4a56aa6b0 fixes v12 2024-06-24 08:41:59 +02:00
rwanoux ced19853cf verif si carac dans rolldialog 2024-05-13 18:44:37 +02:00
rwanoux 83c3f1df0b tellement de trucs 2024-05-13 18:27:54 +02:00
rwanoux 9cee590267 fixe des dés 3d 2024-04-28 23:50:39 +02:00
rwanoux 368b7f284a ajout config des traits + commentaires 2024-04-28 23:31:47 +02:00
rwanoux 067771d8b9 filtrage des chat events selon gm ou user 2024-04-28 23:30:02 +02:00
rwanoux 0fada335f4 reroll OK 2024-04-28 16:35:48 +02:00
rwanoux 74e11d439c plein de truc 2024-04-21 16:51:13 +02:00
rwanoux 0fe0d530b1 first commit after clone 2024-04-17 11:51:59 +02:00
François-Xavier Guillois f483a219c1 v0.1.13 2023-09-07 17:53:00 +02:00
François-Xavier Guillois 55c3d09490 v0.1.9 2023-09-06 17:18:58 +02:00
François-Xavier Guillois 25b4179cd3 actor default images + template sort 2023-09-06 08:55:46 +02:00
François-Xavier Guillois c376055bf3 refactoring 1 2023-09-05 18:47:36 +02:00
François-Xavier Guillois 3ceac1194e v0.1.7 2023-09-05 16:07:04 +02:00
François-Xavier Guillois 848366e05c basis of wound system 2023-09-05 15:04:06 +02:00
François-Xavier Guillois 983f856187 v0.1.6 2023-09-05 12:06:22 +02:00
François-Xavier Guillois e1238a1ad1 v0.1.5 2023-09-04 11:17:46 +02:00
François-Xavier Guillois 5600e37991 npc sheet 2023-09-04 09:44:41 +02:00
François-Xavier Guillois 6f244ca1ef v0.1.4 2023-09-04 08:27:30 +02:00
François-Xavier Guillois 7677c79582 v0.1.3 2023-09-03 16:02:30 +02:00
François-Xavier Guillois ac445bfe40 picker members 2023-09-01 21:43:22 +02:00
François-Xavier Guillois e11525564a actor picker 1 2023-09-01 19:59:44 +02:00
François-Xavier Guillois 39c984156b group header 2023-09-01 09:49:46 +02:00
François-Xavier Guillois ff6be3989e totem picker done 2023-08-31 19:18:37 +02:00
François-Xavier Guillois 987bb9fd6e application choose totem 2023-08-30 22:48:31 +02:00
François-Xavier Guillois f605cd14d6 gestion de l'age 2023-08-30 10:33:26 +02:00
François-Xavier Guillois 18bce98162 attribute fix 2023-08-29 18:36:03 +02:00
François-Xavier Guillois ef111392c2 roll dialog box 2023-08-29 17:19:11 +02:00
François-Xavier Guillois 9f760deee0 difficultés 2023-08-25 16:15:04 +02:00
François-Xavier Guillois c57c355066 attitudes 2023-08-25 15:35:43 +02:00
François-Xavier Guillois 641d2a892a v.0.0.16 2023-08-25 10:36:25 +02:00
François-Xavier Guillois 7aeef29e34 skill levels 2023-08-24 18:21:33 +02:00
François-Xavier Guillois e5396b6991 vehicules pour la feuille de groupe - v0.0.14 2023-06-06 16:02:39 +02:00