Commit Graph

16 Commits

Author SHA1 Message Date
uberwald cb4b255b35 Fix: Remove remaining static method from inside init() function
The getItemValueSC static method was still incorrectly placed inside the
init() method, causing 'Unexpected strict mode reserved word' error at line 103.
This moves it to the class level with calculateItemValueSC.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 21:36:14 +02:00
uberwald 116ac66a8a Fix: Move static methods outside of init() function to class level
The static methods calculateItemValueSC and getItemValueSC were incorrectly
placed inside the init() method, causing a SyntaxError in strict mode.
This moves them to the class level where they belong.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 21:16:52 +02:00
uberwald 4c33607b2b Refactor: Eliminate code duplication for currency conversion and item pricing
- Add static calculateItemValueSC() and getItemValueSC() helpers to MournbladeCYD2Utility
  to centralize currency conversion logic (1 PO = 100 SC, 1 PA = 10 SC)
- Refactor computeRichesse() and computeValeurEquipement() in Actor to use shared helpers
- Add localizeAllegiance Handlebars helper to display allegiance values localized
  (tous->Tous, chaos->Chaos, loi->Loi, betes->Bêtes, elementaires->Élémentaires)
- Add joinPredilections helper to fix comma display after single Predilection
- Create BaseItemWithPriceDataModel base class for items with pricing fields
  (prixpo, prixca, prixsc, rarete, quantite, equipped)
- Update arme, equipement, protection, monnaie models to extend base class
- Update actor-sheet and creature-sheet templates to use new helpers
- Update partial-item-prix.hbs to display total item value in SC
- Add item-base-sheet.hbs template for future item sheet inheritance

Fixes:
- Allegiance values now display properly localized in Dons & Pactes tabs
- Predilections no longer show trailing comma with single entry
- Equipment value totals now update correctly when items are added/modified
- Currency conversion logic centralized and consistent across the system

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 20:52:46 +02:00
uberwald 59fa8c72ff Fix: Correction des taux de conversion monétaire selon le lore Mournblade
- Ancienne conversion : 1 PO = 400 SC, 1 PA = 20 SC (incorrect)
- Nouvelle conversion : 1 PO = 100 SC, 1 PA = 10 SC (selon le lore)

Selon le lore des Jeunes Royaumes :
- 1 Sou d'Argent (SA) = 10 Pièces de Bronze (PB)
- 1 Pièce d'Or (PO) = 10 Sous d'Argent = 100 Pièces de Bronze

Correspondance dans le code :
- SC = Pièces de Bronze (PB)
- PA/CA = Sous d'Argent (SA)
- PO = Pièces d'Or (PO)

Fichiers modifiés :
- mournblade-cyd2-utility.js : Helper calculateItemValueSC et computeMonnaieDetails
- mournblade-cyd2-actor.js : computeValeurEquipement()

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 19:12:17 +02:00
uberwald 14763cc5b3 Fix: Add missing Handlebars subtract helper
- Added subtract helper: parseInt(a) - parseInt(b)
- Helper is used in partial-active-effects.hbs and partial-item-effects.hbs
- Registered in MournbladeCYD2Utility.init() alongside other helpers
- Added test verification for subtract helper registration

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:48:55 +02:00
uberwald d0423b2017 Fix: Add missing Handlebars partials to preload function
- Added partial-active-effects.hbs and partial-item-effects.hbs to preloadHandlebarsTemplates()
- These partials were used in sheets but not preloaded, causing render errors
- Fixed lang/fr.json formatting (added closing brace and newline)
- Added test script to validate template loading
- Added CORRECTIONS.md documentation

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-07 00:26:07 +02:00
uberwald 56b58565d1 Derniers fix de sécurité et assimilé 2026-04-04 09:40:30 +02:00
uberwald 1fb80f6abe Rework fiches, jets de dés et CSS 2026-04-03 16:22:51 +02:00
uberwald 9754bbc3a8 Update CSS/Look & feel 2026-04-03 00:39:39 +02:00
uberwald 9fd13b2615 DAtaModels + Appv2 migration : OK 2026-04-02 22:14:30 +02:00
uberwald a37ad2cc82 DAtaModels + Appv2 migration : OK 2026-04-02 21:33:56 +02:00
uberwald a39d214f1b Ame/Ame max 2025-10-26 13:47:59 +01:00
uberwald 40e11aca1b Ame/Ame max 2025-10-26 11:41:18 +01:00
uberwald 2dc7665a25 Ame/Ame max 2025-10-26 08:49:38 +01:00
uberwald cddc4ce48a New logo 2025-10-26 00:50:45 +02:00
uberwald 7107516a28 Initial import 2025-10-26 00:31:32 +02:00