getProtection(): replace threshold sum<4 with hasRealArmor check.
Old logic broke when two sub-4 items (e.g. shield 2 + light armor 3)
summed >=4 and lost the base+4 bonus — causing protection to decrease
when equipping them together.
actor-sheet.hbs: remove defenseTotal from top-right combat card.
This value excluded Mêlée skill, making it always wrong vs
the per-weapon defense shown in the combat tab.
- 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>
- computeRichesse() ne prenait en compte que prixsc, maintenant il calcule aussi prixca et prixpo
- Conversion : prixca * 10 + prixpo * 100 (selon le lore)
- Cohérent avec computeValeurEquipement()
Fichier modifié : mournblade-cyd2-actor.js
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>