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:
+25
-13
@@ -1,19 +1,6 @@
|
||||
|
||||
import { SYSTEM } from "./config/system.mjs"
|
||||
|
||||
export default class HamalronUtils {
|
||||
|
||||
static registerSettings() {
|
||||
game.settings.register("fvtt-hamalron", "settings-era", {
|
||||
name: game.i18n.localize("HAMALRON.Settings.era"),
|
||||
hint: game.i18n.localize("HAMALRON.Settings.eraHint"),
|
||||
default: "jazz",
|
||||
scope: "world",
|
||||
type: String,
|
||||
choices: SYSTEM.AVAILABLE_SETTINGS,
|
||||
config: true,
|
||||
onChange: _ => window.location.reload()
|
||||
});
|
||||
}
|
||||
|
||||
static async loadCompendiumData(compendium) {
|
||||
@@ -26,6 +13,31 @@ export default class HamalronUtils {
|
||||
return compendiumData.filter(filter)
|
||||
}
|
||||
|
||||
static async findTarotItem(cardData) {
|
||||
if (!cardData) return null
|
||||
let item = game.items.get(cardData.id)
|
||||
if (item) return item
|
||||
item = game.items.find(i =>
|
||||
i.type === "tarot" &&
|
||||
i.name === cardData.name &&
|
||||
i.system.symbole === cardData.symbole &&
|
||||
String(i.system.valeur) === String(cardData.valeur)
|
||||
)
|
||||
if (item) return item
|
||||
for (const pack of game.packs) {
|
||||
if (pack.documentName !== "Item") continue
|
||||
const index = pack.index.find(e =>
|
||||
e.type === "tarot" &&
|
||||
e.name === cardData.name
|
||||
)
|
||||
if (index) {
|
||||
item = await pack.getDocument(index._id)
|
||||
if (item) return item
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
static registerHandlebarsHelpers() {
|
||||
|
||||
Handlebars.registerHelper('isNull', function (val) {
|
||||
|
||||
Reference in New Issue
Block a user