Export de personnage en pdf
Première version d'export de personnage pdf
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
|
||||
import { Grammar } from "./grammar.js";
|
||||
import { RdDInitiative } from "./initiative.mjs";
|
||||
import { RdDItem } from "./item.js";
|
||||
import { CATEGORIES_COMPETENCES, SANS_COMPETENCE } from "./item/base-items.js";
|
||||
import { CATEGORIES_COMPETENCE_COMBAT, CATEGORIES_COMPETENCES, SANS_COMPETENCE } from "./item/base-items.js";
|
||||
import { Misc } from "./misc.js";
|
||||
|
||||
const competenceTroncs = [["Esquive", "Dague", "Corps à corps"],
|
||||
@@ -46,6 +47,30 @@ export class RdDItemCompetence extends RdDItem {
|
||||
|
||||
static get defaultIcon() { return "systems/foundryvtt-reve-de-dragon/icons/competence_defaut.webp" }
|
||||
|
||||
isNiveauBase() {
|
||||
return this.system.niveau == this.system.base && this.system.xp == 0
|
||||
}
|
||||
|
||||
getBaseInit() {
|
||||
const carac = this.getInitCarac()
|
||||
if (carac == undefined) {
|
||||
return undefined
|
||||
}
|
||||
return RdDInitiative.ajustementInitiative(carac.value, this.system.niveau)
|
||||
}
|
||||
|
||||
getInitCarac() {
|
||||
if (!this.actor) {
|
||||
return undefined
|
||||
}
|
||||
switch (this.system.categorie) {
|
||||
case CATEGORIES_COMPETENCES.melee.key: return this.actor.system.carac.melee
|
||||
case CATEGORIES_COMPETENCES.tir.key: return this.actor.system.carac.tir
|
||||
case CATEGORIES_COMPETENCES.lancer.key: return this.actor.system.carac.lancer
|
||||
case CATEGORIES_COMPETENCES.draconic.key: return this.actor.system.carac.reve
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getLabelCategorie(category) {
|
||||
return CATEGORIES_COMPETENCES[category].label;
|
||||
|
||||
Reference in New Issue
Block a user