Files

36 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Célestopol 1922 — Système FoundryVTT
*
* Célestopol 1922 est un jeu de rôle édité par Antre-Monde Éditions.
* Ce système FoundryVTT est une implémentation indépendante et n'est pas
* affilié à Antre-Monde Éditions,
* mais a été réalisé avec l'autorisation d'Antre-Monde Éditions.
*
* @author LeRatierBretonnien
* @copyright 20252026 LeRatierBretonnien
* @license CC BY-NC-SA 4.0 https://creativecommons.org/licenses/by-nc-sa/4.0/
*/
export default class CelestopolActor extends Actor {
/** @override */
getRollData() {
// Inclure les valeurs dérivées (initiative, résistances…) calculées par prepareDerivedData
return { ...this.toObject(false).system, initiative: this.system.initiative ?? 0 }
}
/**
* Override de l'initiative : valeur déterministe (pas de dé).
* Personnage : 4 + Mobilité + Inspiration
* PNJ : Corps.res
* @override
*/
async rollInitiative() {
if (!game.combat) return null
const combatant = game.combat.combatants.find(c => c.actorId === this.id)
if (!combatant) return null
const initiative = this.system.initiative ?? 0
await combatant.update({ initiative })
return combatant
}
}