feat: tirage MJ, hotbarDrop, blessures incapacitantes
1. Tirage MJ dans le dialogue de compétence : - Bouton tirer une carte dans la section difficulté - Pioche dans le deck, affiche la carte tirée - Calcule la difficulté sous tension 2. Drag & drop vers barre de raccourcis : - Acteurs → ouvre la feuille - Compétences → lance le jet de compétence - Sorts → ouvre le dialogue de lancement - Armes → lance le jet d'arme 3. Blessures incapacitantes (règle p.159) : - Champs blessureIncapacitante / malusBlessure - Dialogue proposant la blessure quand Épée diminue - Malus -2 appliqué aux jets de compétence - Bannière dans la feuille (mode jeu) - Bouton guérison
This commit is contained in:
@@ -20,6 +20,7 @@ export default class HamalronPersonnageSheet extends HamalronActorSheet {
|
||||
createSortilege: HamalronPersonnageSheet.#onCreateSortilege,
|
||||
openRecovery: HamalronPersonnageSheet.#onOpenRecovery,
|
||||
modifyResistance: HamalronPersonnageSheet.#onModifyResistance,
|
||||
removeWound: HamalronPersonnageSheet.#onRemoveWound,
|
||||
discardCard: HamalronPersonnageSheet.#onDiscardCard,
|
||||
rollCompetence: HamalronPersonnageSheet.#onRollCompetence,
|
||||
castSortilege: HamalronPersonnageSheet.#onCastSortilege,
|
||||
@@ -195,9 +196,46 @@ export default class HamalronPersonnageSheet extends HamalronActorSheet {
|
||||
}
|
||||
|
||||
const newValue = Math.max(0, Math.min(resistance.max, resistance.value + delta))
|
||||
|
||||
// Blessure incapacitante pour Épée (règle p.159)
|
||||
if (symbole === "epee" && delta < 0 && newValue < resistance.value && !this.document.system.blessureIncapacitante) {
|
||||
const choice = await foundry.applications.api.DialogV2.wait({
|
||||
window: { title: game.i18n.localize("HAMALRON.Wound.Title") },
|
||||
content: `<p>${game.i18n.localize("HAMALRON.Wound.Question")}</p>`,
|
||||
buttons: [
|
||||
{ action: "wound", label: game.i18n.localize("HAMALRON.Wound.Take"), default: true, callback: () => "wound" },
|
||||
{ action: "resist", label: game.i18n.localize("HAMALRON.Wound.Resist"), callback: () => "resist" },
|
||||
],
|
||||
rejectClose: false,
|
||||
})
|
||||
if (choice === "wound") {
|
||||
await this.document.update({
|
||||
"system.blessureIncapacitante": true,
|
||||
"system.malusBlessure": -2,
|
||||
})
|
||||
ui.notifications.info(game.i18n.localize("HAMALRON.Wound.Active"))
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
await this.document.update({ [`system.resistances.${symbole}.value`]: newValue })
|
||||
}
|
||||
|
||||
static async #onRemoveWound(event, target) {
|
||||
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||
window: { title: game.i18n.localize("HAMALRON.Wound.Remove") },
|
||||
content: `<p>${game.i18n.localize("HAMALRON.Wound.RemoveConfirm")}</p>`,
|
||||
rejectClose: false,
|
||||
modal: true,
|
||||
})
|
||||
if (!confirmed) return
|
||||
await this.document.update({
|
||||
"system.blessureIncapacitante": false,
|
||||
"system.malusBlessure": 0,
|
||||
})
|
||||
ui.notifications.info(game.i18n.localize("HAMALRON.Wound.Healed"))
|
||||
}
|
||||
|
||||
static async #onDiscardCard(event, target) {
|
||||
const itemId = $(event.target).data("item-id")
|
||||
const item = this.document.items.get(itemId)
|
||||
|
||||
Reference in New Issue
Block a user