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>
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>
- 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>
- 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>
- 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>