refacto: harmonisation du système avec les règles Hamalron JDR

Corrections majeures :
- HamalronTirageTarot extends Roll (évaluation des jets fonctionnelle)
- Correction du nom de classe Langue (HamalronFaction -> HamalronLangue)
- Création du template tab-navigation.hbs manquant
- Type acteur 'character' -> 'personnage' dans _preCreate

Types d'items corrigés (anglais -> français) :
- weapon -> arme, armor -> armure, equipment -> equipement
- Suppression des types inexistants (deal, malefica, ritual, perk)

Modèles :
- cost -> cout (armure, equipement)
- Tarot : default -> initial
- Sortilege : LOCALIZATION_PREFIXES corrigé
- Constantes CHOICE_ADVANTAGES_DISADVANTAGES et ATTACK_MODIFIERS ajoutées
- ATTACK_MODIFIERS supprimé (plus utilisé)

Templates alignés sur les modèles réels :
- enemy-trait : suppression champs manquants (trauma, stats, domain...)
- personnage-equipement : champs alignés sur arme/armure/equipement
- personnage-sortileges : suppression domain/level/rituals
- enemy-main : suppression stats et flavorText
- base-actor : suppression mortality, toChat limité aux tarots

Jets de compétence :
- Égalité = réussite (>= au lieu de >, conforme aux règles p.155)
- Comparaison robuste des cartes de succès (via String())

Le Mat :
- Les autres joueurs peuvent renouveler leur main (règle p.151)

findTarotItem : recherche dans game.items puis compendiums
await manquants ajoutés sur saveDeckState()
AGENTS.md créé
This commit is contained in:
2026-07-10 18:52:20 +02:00
parent 4bc381f2e6
commit 68b3079da8
25 changed files with 257 additions and 570 deletions
@@ -33,7 +33,6 @@ export default class HamalronActorSheet extends HandlebarsApplicationMixin(found
toggleSheet: HamalronActorSheet.#onToggleSheet,
edit: HamalronActorSheet.#onItemEdit,
delete: HamalronActorSheet.#onItemDelete,
updateCheckboxArray: HamalronActorSheet.#onUpdateCheckboxArray,
toChat: HamalronActorSheet.#toChat,
},
@@ -69,7 +68,6 @@ export default class HamalronActorSheet extends HandlebarsApplicationMixin(found
actor: this.document,
system: this.document.system,
source: this.document.toObject(),
enrichedBackstory: await foundry.applications.ux.TextEditor.implementation.enrichHTML(this.document.system.backstory, { async: true }),
isEditMode: this.isEditMode,
isPlayMode: this.isPlayMode,
isEditable: this.isEditable,
@@ -187,44 +185,19 @@ export default class HamalronActorSheet extends HandlebarsApplicationMixin(found
return fp.browse()
}
static #onUpdateCheckboxArray(event, target) {
console.log("Update checkbox array", event, target)
let arrayName = target.dataset.name
let arrayIdx = Number(target.dataset.index)
let dataPath = `system.mortality.${arrayName}`
let tab = foundry.utils.duplicate(this.document.system.mortality[arrayName])
tab[arrayIdx] = target.checked
this.actor.update({ [dataPath]: tab })
}
static async #toChat(event, target) {
const itemUuid = target.getAttribute("data-item-uuid")
const item = fromUuidSync(itemUuid)
if (!item) return
let content = ""
if (item.type === "perk") {
content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-hamalron/templates/chat-perk.hbs", item.toObject())
}
if (item.type === "malefica") {
content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-hamalron/templates/chat-malefica.hbs", item.toObject())
}
if (item.type === "ritual") {
content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-hamalron/templates/chat-ritual.hbs", item.toObject())
}
if (item.type === "species-trait") {
content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-hamalron/templates/chat-trait.hbs", item.toObject())
}
if (item.type === "tarot") {
content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-hamalron/templates/chat-tarot.hbs", item.toObject())
}
const chatData = {
if (item.type !== "tarot") return
const content = await foundry.applications.handlebars.renderTemplate("systems/fvtt-hamalron/templates/chat-tarot.hbs", item.toObject())
const actor = this.actor || this.document?.parent
ChatMessage.create({
user: game.user.id,
speaker: ChatMessage.getSpeaker({ actor: this.actor }),
content: content,
speaker: ChatMessage.getSpeaker({ actor }),
content,
type: CONST.CHAT_MESSAGE_TYPES.OTHER,
}
ChatMessage.create(chatData, { renderSheet: false })
}, { renderSheet: false })
}
/**