Ajout arme morsure au chafouin
retravail sur les competences; - standardiser les noms de fichiers de templates - méthodes classify pour construire une multimap par type - méthodes pour charger les entrées du compendium - méthodes spécifiques au compétences déplacées
This commit is contained in:
parent
4dbab303f3
commit
a338bb144e
@ -7,6 +7,7 @@ import { RdDUtility } from "./rdd-utility.js";
|
|||||||
import { HtmlUtility } from "./html-utility.js";
|
import { HtmlUtility } from "./html-utility.js";
|
||||||
import { RdDItem } from "./item.js";
|
import { RdDItem } from "./item.js";
|
||||||
import { RdDItemArme } from "./item-arme.js";
|
import { RdDItemArme } from "./item-arme.js";
|
||||||
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
export class RdDActorSheet extends ActorSheet {
|
export class RdDActorSheet extends ActorSheet {
|
||||||
@ -22,7 +23,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
tabs: [{ navSelector: ".sheet-tabs", contentSelector: ".sheet-body", initial: "carac" }],
|
||||||
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
dragDrop: [{ dragSelector: ".item-list .item", dropSelector: null }],
|
||||||
editCaracComp: false,
|
editCaracComp: false,
|
||||||
montrerCompetencesNiveauBase: false,
|
showCompNiveauBase: false,
|
||||||
montrerArchetype: false
|
montrerArchetype: false
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -33,44 +34,32 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
if ( data.actor.type == 'creature' || data.actor.type == 'humanoide') return data; // Shortcut
|
if ( data.actor.type == 'creature' || data.actor.type == 'humanoide') return data; // Shortcut
|
||||||
|
|
||||||
data.data.editCaracComp = this.options.editCaracComp;
|
data.data.editCaracComp = this.options.editCaracComp;
|
||||||
data.data.montrerCompetencesNiveauBase = this.options.montrerCompetencesNiveauBase;
|
data.data.showCompNiveauBase = this.options.showCompNiveauBase;
|
||||||
data.data.montrerArchetype = this.options.montrerArchetype;
|
data.data.montrerArchetype = this.options.montrerArchetype;
|
||||||
|
|
||||||
let compCategorieNiveau = RdDUtility.getLevelCategory(); // recup catégorie
|
|
||||||
data.itemsByType = RdDItem.buildItemsClassification(data.items);
|
data.itemsByType = RdDItem.buildItemsClassification(data.items);
|
||||||
|
|
||||||
// Competence per category
|
// Competence per category
|
||||||
data.competenceByCategory = {};
|
|
||||||
let competenceXPTotal = 0;
|
let competenceXPTotal = 0;
|
||||||
if (data.itemsByType.competence) {
|
data.competenceByCategory = RdDItem.classify(
|
||||||
for (const item of data.itemsByType.competence) {
|
data.itemsByType.competence,
|
||||||
|
item => item.data.categorie,
|
||||||
|
item => {
|
||||||
this.actor.checkCompetenceXP(item.name); // Petite vérification experience
|
this.actor.checkCompetenceXP(item.name); // Petite vérification experience
|
||||||
//console.log("Push...", item, item.data.categorie);
|
item.data.showCompetence = !data.data.showCompNiveauBase || (Number(item.data.niveau) != Number(RdDUtility.getLevelCategory(item.data.categorie)));
|
||||||
let list = data.competenceByCategory[item.data.categorie];
|
// Ignorer les compétences 'troncs' à ce stade
|
||||||
if (!list) {
|
competenceXPTotal += RdDItemCompetence.isTronc(item.name) ? 0 : RdDItemCompetence.computeCompetenceXPCost(item);
|
||||||
list = [];
|
return item;
|
||||||
data.competenceByCategory[item.data.categorie] = list;
|
});
|
||||||
}
|
competenceXPTotal += RdDItemCompetence.computeCompetenceTroncXP(data.itemsByType.competence);
|
||||||
if (!RdDUtility.isTronc( item.name ) ) // Ignorer les compétences 'troncs' à ce stade
|
|
||||||
competenceXPTotal += RdDUtility.computeCompetenceXPCost(item);
|
|
||||||
item.data.afficherCompetence = true;
|
|
||||||
if ( data.data.montrerCompetencesNiveauBase && (Number(item.data.niveau) == Number(compCategorieNiveau[item.data.categorie]) ) ) {
|
|
||||||
item.data.afficherCompetence = false;
|
|
||||||
}
|
|
||||||
list.push(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.competenceByCategory = duplicate(data.competenceByCategory); // Sauvegarde locale
|
|
||||||
competenceXPTotal += RdDUtility.computeCompetenceTroncXP(data.itemsByType.competence);
|
|
||||||
data.data.competenceXPTotal = competenceXPTotal;
|
data.data.competenceXPTotal = competenceXPTotal;
|
||||||
//console.log("XP competence : ", competenceXPTotal);
|
|
||||||
|
|
||||||
// Compute current carac sum
|
// Compute current carac sum
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
for (let caracName in data.data.carac) {
|
for (let caracName in data.data.carac) {
|
||||||
let carac = data.data.carac[caracName];
|
let currentCarac = data.data.carac[caracName];
|
||||||
if (!carac.derivee) {
|
if (!currentCarac.derivee) {
|
||||||
sum += parseInt(carac.value);
|
sum += parseInt(currentCarac.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
data.data.caracSum = sum;
|
data.data.caracSum = sum;
|
||||||
@ -138,7 +127,6 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onDrop(event) {
|
async _onDrop(event) {
|
||||||
await RdDUtility.processItemDropEvent(this, event);
|
await RdDUtility.processItemDropEvent(this, event);
|
||||||
@ -431,7 +419,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
html.find('#show-hide-competences').click((event) => {
|
html.find('#show-hide-competences').click((event) => {
|
||||||
this.options.montrerCompetencesNiveauBase = !this.options.montrerCompetencesNiveauBase;
|
this.options.showCompNiveauBase = !this.options.showCompNiveauBase;
|
||||||
this.render(true);
|
this.render(true);
|
||||||
});
|
});
|
||||||
html.find('#show-hide-archetype').click((event) => {
|
html.find('#show-hide-archetype').click((event) => {
|
||||||
|
@ -46,13 +46,13 @@ export class RdDActor extends Actor {
|
|||||||
}
|
}
|
||||||
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
|
// If the created actor has items (only applicable to duplicated actors) bypass the new actor creation logic
|
||||||
if (data.items) {
|
if (data.items) {
|
||||||
|
let actor = super.create(data, options);
|
||||||
if (data.type == "personnage") {
|
if (data.type == "personnage") {
|
||||||
await RdDActor.checkMonnaiePresence( data.items );
|
await actor.checkMonnaiePresence( data.items );
|
||||||
}
|
}
|
||||||
return super.create(data, options);
|
return actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
data.items = [];
|
|
||||||
let compendiumName = "";
|
let compendiumName = "";
|
||||||
if (data.type == "personnage") {
|
if (data.type == "personnage") {
|
||||||
compendiumName = "foundryvtt-reve-de-dragon.competences";
|
compendiumName = "foundryvtt-reve-de-dragon.competences";
|
||||||
@ -61,16 +61,7 @@ export class RdDActor extends Actor {
|
|||||||
} else if (data.type == "entite") {
|
} else if (data.type == "entite") {
|
||||||
compendiumName = "foundryvtt-reve-de-dragon.competences-entites";
|
compendiumName = "foundryvtt-reve-de-dragon.competences-entites";
|
||||||
}
|
}
|
||||||
let competences = [];
|
data.items = RdDUtility.loadCompendium(compendiumName);
|
||||||
const pack = game.packs.get(compendiumName);
|
|
||||||
await pack.getIndex().then(index => competences = index);
|
|
||||||
for (let comp of competences)
|
|
||||||
{
|
|
||||||
let compItem = undefined;
|
|
||||||
await pack.getEntity(comp._id).then(skill => compItem = skill);
|
|
||||||
data.items.push(compItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ajout monnaie
|
// Ajout monnaie
|
||||||
if (data.type == "personnage" ) {
|
if (data.type == "personnage" ) {
|
||||||
await RdDActor.ajouterMonnaie( data.items );
|
await RdDActor.ajouterMonnaie( data.items );
|
||||||
@ -207,12 +198,12 @@ export class RdDActor extends Actor {
|
|||||||
return this.data.data.compteurs?.surenc?.value ?? 0;
|
return this.data.data.compteurs?.surenc?.value ?? 0;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getCompetenceList() {
|
loadCompendiumNames() {
|
||||||
return this.data.items.filter( (item) => item.type == 'competence');
|
return this.data.items.filter( (item) => item.type == 'competence');
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getCompetence(compName) {
|
getCompetence(compName) {
|
||||||
return RdDUtility.findCompetence(this.data.items, compName);
|
return RdDItemCompetence.findCompetence(this.data.items, compName);
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getTache( id ) {
|
getTache( id ) {
|
||||||
@ -1413,9 +1404,9 @@ export class RdDActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async checkCompetenceXP( compName ) {
|
async checkCompetenceXP( compName ) {
|
||||||
let competence = RdDUtility.findCompetence( this.data.items, compName);
|
let competence = RdDItemCompetence.findCompetence( this.data.items, compName);
|
||||||
if ( competence && competence.data.xp > 0) {
|
if ( competence && competence.data.xp > 0) {
|
||||||
let xpNeeded = RdDUtility.getCompetenceNextXp( competence.data.niveau );
|
let xpNeeded = RdDItemCompetence.getCompetenceNextXp( competence.data.niveau );
|
||||||
if ( competence.data.xp >= xpNeeded ) {
|
if ( competence.data.xp >= xpNeeded ) {
|
||||||
competence.data.xp -= xpNeeded;
|
competence.data.xp -= xpNeeded;
|
||||||
competence.data.niveau += 1;
|
competence.data.niveau += 1;
|
||||||
@ -1937,7 +1928,7 @@ export class RdDActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async ajouteNombreAstral( data ) {
|
async ajouteNombreAstral( data ) {
|
||||||
// Gestion expérience (si existante)
|
// Gestion expérience (si existante)
|
||||||
data.competence = RdDUtility.findCompetence( this.data.items, "astrologie");
|
data.competence = RdDItemCompetence.findCompetence( this.data.items, "astrologie");
|
||||||
data.selectedCarac = this.data.data.carac["vue"];
|
data.selectedCarac = this.data.data.carac["vue"];
|
||||||
this._appliquerAjoutExperience( data );
|
this._appliquerAjoutExperience( data );
|
||||||
|
|
||||||
|
@ -1,17 +1,37 @@
|
|||||||
|
|
||||||
|
const competenceTroncs = [["Esquive", "Dague", "Corps à corps"],
|
||||||
|
["Epée à 1 main", "Epée à 2 mains", "Hache à 1 main", "Hache à 2 mains", "Lance", "Masse à 1 main", "Masse à 2 mains"]];
|
||||||
|
|
||||||
|
const competence_xp_par_niveau = [5, 5, 5, 10, 10, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 30, 30, 40, 40, 60, 60, 100, 100, 100, 100, 100, 100, 100, 100, 100];
|
||||||
|
|
||||||
export class RdDItemCompetence extends Item {
|
export class RdDItemCompetence extends Item {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static isCompetenceMelee(name) {
|
static isCompetenceArme(competence) {
|
||||||
return name.toLowerCase().match(/(epée|épée|hache|fleau|fléau|masse|lance|hast|dague|bouclier)/);
|
switch (competence.data.categorie) {
|
||||||
|
case 'melee':
|
||||||
|
return competence.name.toLowerCase() != 'esquive';
|
||||||
|
case 'tir':
|
||||||
|
case 'lancer':
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
static isArmeUneMain(competence) {
|
static isArmeUneMain(competence) {
|
||||||
return competence && competence.name.toLowerCase().includes("1 main");
|
return competence?.name.toLowerCase().includes("1 main");
|
||||||
|
}
|
||||||
|
static isArme2Main(competence) {
|
||||||
|
return competence?.name.toLowerCase().includes("2 main");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
static isMalusEncombrementTotal(competence) {
|
static isMalusEncombrementTotal(competence) {
|
||||||
return competence && competence.name.toLowerCase().match(/(natation|acrobatie)/);
|
return competence?.name.toLowerCase().match(/(natation|acrobatie)/);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
static setRollDataCreature(rollData) {
|
static setRollDataCreature(rollData) {
|
||||||
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } };
|
rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.data.carac_value } };
|
||||||
rollData.competence = duplicate(rollData.competence);
|
rollData.competence = duplicate(rollData.competence);
|
||||||
@ -19,4 +39,65 @@ export class RdDItemCompetence extends Item {
|
|||||||
rollData.competence.data.categorie = "creature";
|
rollData.competence.data.categorie = "creature";
|
||||||
rollData.selectedCarac = rollData.carac.carac_creature
|
rollData.selectedCarac = rollData.carac.carac_creature
|
||||||
}
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static isTronc(compName) {
|
||||||
|
for (let troncList of competenceTroncs) {
|
||||||
|
for (let troncName of troncList) {
|
||||||
|
if (troncName == compName)
|
||||||
|
return troncList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static computeCompetenceXPCost(competence) {
|
||||||
|
let minLevel = competence.data.base;
|
||||||
|
if (minLevel == competence.data.niveau) return 0;
|
||||||
|
if (competence.data.niveau < -10) return 0;
|
||||||
|
|
||||||
|
let xp = 0;
|
||||||
|
for (let i = minLevel + 1; i <= competence.data.niveau; i++) {
|
||||||
|
xp += competence_xp_par_niveau[i + 10];
|
||||||
|
//console.log(i, i+10, competence_xp_par_niveau[i+10]);
|
||||||
|
}
|
||||||
|
if (competence.data.categorie == 'draconic') {
|
||||||
|
xp += competence.data.xp_sort;
|
||||||
|
}
|
||||||
|
return xp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static computeCompetenceTroncXP(competences) {
|
||||||
|
let xp = 0;
|
||||||
|
for (let troncList of competenceTroncs) {
|
||||||
|
let minNiveau = 0;
|
||||||
|
for (let troncName of troncList) {
|
||||||
|
let comp = RdDItemCompetence.findCompetence(competences, troncName);
|
||||||
|
if (comp) {
|
||||||
|
minNiveau = Math.min(comp.data.niveau, minNiveau);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
minNiveau = Math.max(minNiveau, 0); // Clamp à 0, pour le tronc commun
|
||||||
|
let minNiveauXP = competence_xp_par_niveau[minNiveau + 10];
|
||||||
|
xp += minNiveauXP;
|
||||||
|
for (let troncName of troncList) {
|
||||||
|
let comp = RdDItemCompetence.findCompetence(competences, troncName);
|
||||||
|
if (comp) {
|
||||||
|
xp += competence_xp_par_niveau[comp.data.niveau + 10] - minNiveauXP;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return xp;
|
||||||
|
}
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static findCompetence(list, name) {
|
||||||
|
name = name.toLowerCase();
|
||||||
|
return list.find(item => item.name.toLowerCase() == name && (item.type == "competence" || item.type == "competencecreature"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static getCompetenceNextXp(niveau) {
|
||||||
|
return competence_xp_par_niveau[niveau + 10];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -2,6 +2,7 @@ import { RdDItemSort } from "./item-sort.js";
|
|||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "./rdd-utility.js";
|
||||||
import { RdDItem } from "./item-rdd.js";
|
import { RdDItem } from "./item-rdd.js";
|
||||||
import { RdDAlchimie } from "./rdd-alchimie.js";
|
import { RdDAlchimie } from "./rdd-alchimie.js";
|
||||||
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extend the basic ItemSheet with some very simple modifications
|
* Extend the basic ItemSheet with some very simple modifications
|
||||||
@ -47,10 +48,13 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async getData() {
|
async getData() {
|
||||||
let data = super.getData();
|
let data = super.getData();
|
||||||
|
data.categorieCompetences = RdDUtility.getCategorieCompetences();
|
||||||
if ( data.item.type == 'tache' || data.item.type == 'livre' || data.item.type == 'meditation') {
|
if ( data.item.type == 'tache' || data.item.type == 'livre' || data.item.type == 'meditation') {
|
||||||
data.caracList = duplicate(game.system.model.Actor.personnage.carac);
|
data.caracList = duplicate(game.system.model.Actor.personnage.carac);
|
||||||
data.competenceList = await RdDUtility.getCompetenceList( 'foundryvtt-reve-de-dragon.competences' );
|
data.competences = await RdDUtility.loadCompendiumNames( 'foundryvtt-reve-de-dragon.competences' );
|
||||||
|
}
|
||||||
|
if (data.item.type == 'arme') {
|
||||||
|
data.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
|
||||||
}
|
}
|
||||||
if ( data.item.type == 'recettealchimique' ) {
|
if ( data.item.type == 'recettealchimique' ) {
|
||||||
RdDAlchimie.processManipulation(data.item, this.actor && this.actor._id );
|
RdDAlchimie.processManipulation(data.item, this.actor && this.actor._id );
|
||||||
@ -101,8 +105,7 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
async _onClickSelectCategorie(event) {
|
async _onClickSelectCategorie(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const category = event.currentTarget.value;
|
let level = RdDUtility.getLevelCategory(event.currentTarget.value);
|
||||||
let level = CONFIG.RDD.level_category[category];
|
|
||||||
this.object.data.data.base = level;
|
this.object.data.data.base = level;
|
||||||
$("#base").val( level );
|
$("#base").val( level );
|
||||||
}
|
}
|
||||||
|
@ -4,15 +4,25 @@ export class RdDItem {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static buildItemsClassification(items) {
|
static buildItemsClassification(items) {
|
||||||
let itemsByType = {};
|
return RdDItem.classify(items, it => it.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
static classify(items, classifier = it => it.type, transform = it => it) {
|
||||||
|
let itemsBy = {};
|
||||||
|
RdDItem.classifyInto(itemsBy, items, classifier, transform);
|
||||||
|
return itemsBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
static classifyInto(itemsBy, items, classifier = it => it.type, transform = it => it) {
|
||||||
for (const item of items) {
|
for (const item of items) {
|
||||||
let list = itemsByType[item.type];
|
const classification = classifier(item);
|
||||||
|
let list = itemsBy[classification];
|
||||||
if (!list) {
|
if (!list) {
|
||||||
list = [];
|
list = [];
|
||||||
itemsByType[item.type] = list;
|
itemsBy[classification] = list;
|
||||||
}
|
}
|
||||||
list.push(item);
|
list.push(transform(item));
|
||||||
}
|
|
||||||
return itemsByType;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
import { Misc } from "./misc.js";
|
import { Misc } from "./misc.js";
|
||||||
import { RdDCalendrier } from "./rdd-calendrier.js";
|
import { RdDCalendrier } from "./rdd-calendrier.js";
|
||||||
import { RdDUtility } from "./rdd-utility.js";
|
import { RdDUtility } from "./rdd-utility.js";
|
||||||
@ -15,7 +16,7 @@ export class RdDAstrologieJoueur extends Dialog {
|
|||||||
dates: game.system.rdd.calendrier.getJoursSuivants( 10 ),
|
dates: game.system.rdd.calendrier.getJoursSuivants( 10 ),
|
||||||
etat: actor.getEtatGeneral(),
|
etat: actor.getEtatGeneral(),
|
||||||
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
ajustementsConditions: CONFIG.RDD.ajustementsConditions,
|
||||||
astrologie: RdDUtility.findCompetence( actor.data.items, 'Astrologie')
|
astrologie: RdDItemCompetence.findCompetence( actor.data.items, 'Astrologie')
|
||||||
}
|
}
|
||||||
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
|
const html = await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/dialog-astrologie-joueur.html', data);
|
||||||
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
|
let options = { classes: ["rdddialog"], width: 600, height: 500, 'z-index': 99999 };
|
||||||
|
@ -22,6 +22,7 @@ import { RdDTokenHud } from "./rdd-token-hud.js";
|
|||||||
import { RdDCommands } from "./rdd-commands.js";
|
import { RdDCommands } from "./rdd-commands.js";
|
||||||
import { RdDCombat } from "./rdd-combat.js";
|
import { RdDCombat } from "./rdd-combat.js";
|
||||||
import { ChatUtility } from "./chat-utility.js";
|
import { ChatUtility } from "./chat-utility.js";
|
||||||
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* Foundry VTT Initialization */
|
/* Foundry VTT Initialization */
|
||||||
@ -65,7 +66,7 @@ const _patch_initiative = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let compName = ( armeCombat == undefined ) ? "Corps à corps" : armeCombat.data.competence;
|
let compName = ( armeCombat == undefined ) ? "Corps à corps" : armeCombat.data.competence;
|
||||||
competence = RdDUtility.findCompetence( c.actor.data.items, compName );
|
competence = RdDItemCompetence.findCompetence( c.actor.data.items, compName );
|
||||||
rollFormula = RdDUtility.calculInitiative(competence.data.niveau, c.actor.data.data.carac[competence.data.defaut_carac].value);
|
rollFormula = RdDUtility.calculInitiative(competence.data.niveau, c.actor.data.data.carac[competence.data.defaut_carac].value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -190,7 +191,6 @@ Hooks.once("init", async function() {
|
|||||||
CONFIG.Actor.entityClass = RdDActor;
|
CONFIG.Actor.entityClass = RdDActor;
|
||||||
CONFIG.RDD = {
|
CONFIG.RDD = {
|
||||||
resolutionTable : RdDResolutionTable.resolutionTable,
|
resolutionTable : RdDResolutionTable.resolutionTable,
|
||||||
level_category : RdDUtility.getLevelCategory(),
|
|
||||||
carac_array : RdDUtility.getCaracArray(),
|
carac_array : RdDUtility.getCaracArray(),
|
||||||
ajustementsConditions : RdDUtility.getAjustementsConditions(),
|
ajustementsConditions : RdDUtility.getAjustementsConditions(),
|
||||||
difficultesLibres : RdDUtility.getDifficultesLibres()
|
difficultesLibres : RdDUtility.getDifficultesLibres()
|
||||||
|
@ -6,42 +6,22 @@ import { RdDCombat } from "./rdd-combat.js";
|
|||||||
import { RdDRollResolutionTable } from "./rdd-roll-resolution-table.js";
|
import { RdDRollResolutionTable } from "./rdd-roll-resolution-table.js";
|
||||||
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
import { RdDItemCompetenceCreature } from "./item-competencecreature.js";
|
||||||
import { RdDItemArme } from "./item-arme.js";
|
import { RdDItemArme } from "./item-arme.js";
|
||||||
|
import { RdDItemCompetence } from "./item-competence.js";
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const level_category = {
|
const categorieCompetences = {
|
||||||
"generale": "-4",
|
"generale": { level: "-4", label: "Générales" },
|
||||||
"particuliere": "-8",
|
"particuliere": { level: "-8", label: "Particulières" },
|
||||||
"specialisee": "-11",
|
"specialisee": { level: "-11", label: "Spécialisées" },
|
||||||
"connaissance": "-11",
|
"connaissance": { level: "-11", label: "Connaissances" },
|
||||||
"draconic": "-11",
|
"draconic": { level: "-11", label: "Draconics" },
|
||||||
"melee": "-6",
|
"melee": { level: "-6", label: "Mêlée" },
|
||||||
"tir": "-8",
|
"tir": { level: "-8", label: "Tir" },
|
||||||
"lancer": "-8"
|
"lancer": { level: "-8", label: "Lancer" }
|
||||||
}
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
const label_category = {
|
|
||||||
"generale": "Générales",
|
|
||||||
"particuliere": "Particulières",
|
|
||||||
"specialisee": "Spécialisées",
|
|
||||||
"connaissance": "Connaissances",
|
|
||||||
"draconic": "Draconics",
|
|
||||||
"melee": "Mêlée",
|
|
||||||
"tir": "Tir",
|
|
||||||
"lancer": "Lancer"
|
|
||||||
}
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
const competenceTroncs = [ ["Esquive", "Dague", "Corps à corps"],
|
|
||||||
["Epée à 1 main", "Epée à 2 mains", "Hache à 1 main", "Hache à 2 mains", "Lance", "Masse à 1 main", "Masse à 2 mains"] ];
|
|
||||||
const competence_xp = {
|
|
||||||
"-11" : [ 5, 10, 15, 25, 35, 45, 55, 70, 85, 100, 115, 135, 155, 175 ],
|
|
||||||
"-8" : [ 10, 20, 30, 40, 55, 70, 85, 100, 120, 140,160],
|
|
||||||
"-6" : [ 10, 20, 35, 50, 65, 80, 100, 120, 140],
|
|
||||||
"-4" : [ 15, 30, 45, 60, 80, 100, 120]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
// This table starts at 0 -> niveau -10
|
// This table starts at 0 -> niveau -10
|
||||||
const competence_xp_par_niveau = [ 5, 5, 5, 10, 10, 10, 10, 15, 15, 15, 15, 20, 20, 20, 20, 30, 30, 40, 40, 60, 60, 100, 100, 100, 100, 100, 100, 100, 100, 100];
|
|
||||||
const carac_array = ["taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"];
|
const carac_array = ["taille", "apparence", "constitution", "force", "agilite", "dexterite", "vue", "ouie", "odoratgout", "volonte", "intellect", "empathie", "reve", "chance", "melee", "tir", "lancer", "derobee"];
|
||||||
const difficultesLibres = [0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10];
|
const difficultesLibres = [0, -1, -2, -3, -4, -5, -6, -7, -8, -9, -10];
|
||||||
const ajustementsConditions = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10];
|
const ajustementsConditions = [-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, +1, +2, +3, +4, +5, +6, +7, +8, +9, +10];
|
||||||
@ -68,8 +48,7 @@ function _buildAllSegmentsFatigue(max) {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
function _cumulSegmentsFatigue(matrix) {
|
function _cumulSegmentsFatigue(matrix) {
|
||||||
let cumulMatrix = [];
|
let cumulMatrix = [];
|
||||||
for (let line of matrix)
|
for (let line of matrix) {
|
||||||
{
|
|
||||||
let cumul = duplicate(line);
|
let cumul = duplicate(line);
|
||||||
|
|
||||||
for (let i = 1; i < 12; i++) {
|
for (let i = 1; i < 12; i++) {
|
||||||
@ -87,20 +66,24 @@ const cumulFatigueMatrix = _cumulSegmentsFatigue(fatigueMatrix);
|
|||||||
const fatigueMalus = [0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7]; // Provides the malus for each segment of fatigue
|
const fatigueMalus = [0, 0, 0, -1, -1, -1, -2, -3, -4, -5, -6, -7]; // Provides the malus for each segment of fatigue
|
||||||
const fatigueLineSize = [3, 6, 7, 8, 9, 10, 11, 12];
|
const fatigueLineSize = [3, 6, 7, 8, 9, 10, 11, 12];
|
||||||
const fatigueLineMalus = [0, -1, -2, -3, -4, -5, -6, -7];
|
const fatigueLineMalus = [0, -1, -2, -3, -4, -5, -6, -7];
|
||||||
const fatigueMarche = { "aise": { "4":1, "6":2, "8":3, "10":4, "12":6 },
|
const fatigueMarche = {
|
||||||
|
"aise": { "4": 1, "6": 2, "8": 3, "10": 4, "12": 6 },
|
||||||
"malaise": { "4": 2, "6": 3, "8": 4, "10": 6 },
|
"malaise": { "4": 2, "6": 3, "8": 4, "10": 6 },
|
||||||
"difficile": { "4": 3, "6": 4, "8": 6 },
|
"difficile": { "4": 3, "6": 4, "8": 6 },
|
||||||
"tresdifficile": { "4":4, "6":6 } }
|
"tresdifficile": { "4": 4, "6": 6 }
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/* Static tables for commands /table */
|
/* Static tables for commands /table */
|
||||||
const table2func = { "rdd": { descr: "rdd: Ouvre la table de résolution", func: RdDRollResolutionTable.open },
|
const table2func = {
|
||||||
|
"rdd": { descr: "rdd: Ouvre la table de résolution", func: RdDRollResolutionTable.open },
|
||||||
"queues": { descr: "queues: Tire une queue de Dragon", func: RdDRollTables.getQueue },
|
"queues": { descr: "queues: Tire une queue de Dragon", func: RdDRollTables.getQueue },
|
||||||
"ombre": { descr: "ombre: Tire une Ombre de Dragon", func: RdDRollTables.getOmbre },
|
"ombre": { descr: "ombre: Tire une Ombre de Dragon", func: RdDRollTables.getOmbre },
|
||||||
"tetehr": { descr: "tetehr: Tire une Tête de Dragon pour Hauts Revants", fund: RdDRollTables.getTeteHR },
|
"tetehr": { descr: "tetehr: Tire une Tête de Dragon pour Hauts Revants", fund: RdDRollTables.getTeteHR },
|
||||||
"tete": { descr: "tete: Tire une Tête de Dragon", func: RdDRollTables.getTete },
|
"tete": { descr: "tete: Tire une Tête de Dragon", func: RdDRollTables.getTete },
|
||||||
"souffle": { descr: "souffle: Tire un Souffle de Dragon", func: RdDRollTables.getSouffle },
|
"souffle": { descr: "souffle: Tire un Souffle de Dragon", func: RdDRollTables.getSouffle },
|
||||||
"tarot" : { descr: "tarot: Tire une carte de Tarot Dracnique", func: RdDRollTables.getTarot} };
|
"tarot": { descr: "tarot: Tire une carte de Tarot Dracnique", func: RdDRollTables.getTarot }
|
||||||
|
};
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
const definitionsBlessures = [
|
const definitionsBlessures = [
|
||||||
@ -168,14 +151,14 @@ export class RdDUtility {
|
|||||||
'systems/foundryvtt-reve-de-dragon/templates/item-ombre-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item-ombre-sheet.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item-monnaie-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item-monnaie-sheet.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/item-meditation-sheet.html',
|
'systems/foundryvtt-reve-de-dragon/templates/item-meditation-sheet.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/competence-categorie.html',
|
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html',
|
'systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/competence-base.html',
|
'systems/foundryvtt-reve-de-dragon/templates/competence-base.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-competence.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie_parade.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html',
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html',
|
||||||
|
'systems/foundryvtt-reve-de-dragon/templates/enum-competence.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html',
|
'systems/foundryvtt-reve-de-dragon/templates/enum-rarete.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/arme-competence.html',
|
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/sort-draconic.html',
|
'systems/foundryvtt-reve-de-dragon/templates/sort-draconic.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/sort-tmr.html',
|
'systems/foundryvtt-reve-de-dragon/templates/sort-tmr.html',
|
||||||
'systems/foundryvtt-reve-de-dragon/templates/niveau-ethylisme.html',
|
'systems/foundryvtt-reve-de-dragon/templates/niveau-ethylisme.html',
|
||||||
@ -344,141 +327,46 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static buildResolutionTable( ) {
|
static getCategorieCompetences() {
|
||||||
let tableRes = []
|
return categorieCompetences;
|
||||||
for (var j=0; j<=21; j++) {
|
|
||||||
let subtab = [];
|
|
||||||
for (var i=-10; i<=22; i++) {
|
|
||||||
var m = (i + 10) * 0.5;
|
|
||||||
var v;
|
|
||||||
if (i == -9) {
|
|
||||||
v = Math.floor(j / 2);
|
|
||||||
} else if (i == -10) {
|
|
||||||
v = Math.floor(j / 4);
|
|
||||||
} else {
|
|
||||||
if (j % 2 == 0) {
|
|
||||||
var v = Math.ceil(j * m);
|
|
||||||
} else {
|
|
||||||
var v = Math.floor(j * m);
|
|
||||||
}
|
}
|
||||||
|
static getLevelCategory(category) {
|
||||||
|
return categorieCompetences[category].level;
|
||||||
}
|
}
|
||||||
if (v < 1) v = 1;
|
static getLabelCategory(category) {
|
||||||
let specResults
|
return categorieCompetences[category].label;
|
||||||
if ( v > 100 )
|
|
||||||
specResults = { part: Math.ceil(v / 5), epart: 1000, etotal: 1000 };
|
|
||||||
else
|
|
||||||
specResults = specialResults[Math.ceil(v / 5 )];
|
|
||||||
let tabIndex = i+10;
|
|
||||||
subtab[tabIndex] = { niveau: i, score: v, part: specResults.part, epart: specResults.epart, etotal: specResults.etotal }
|
|
||||||
}
|
}
|
||||||
tableRes[j] = subtab;
|
static getCaracArray() {
|
||||||
}
|
|
||||||
return tableRes;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static getLevelCategory( )
|
|
||||||
{
|
|
||||||
return level_category;
|
|
||||||
}
|
|
||||||
static getLabelCategory( )
|
|
||||||
{
|
|
||||||
return label_category;
|
|
||||||
}
|
|
||||||
static getCaracArray()
|
|
||||||
{
|
|
||||||
return carac_array;
|
return carac_array;
|
||||||
}
|
}
|
||||||
static getDifficultesLibres()
|
static getDifficultesLibres() {
|
||||||
{
|
|
||||||
return difficultesLibres;
|
return difficultesLibres;
|
||||||
}
|
}
|
||||||
static getAjustementsConditions()
|
static getAjustementsConditions() {
|
||||||
{
|
|
||||||
return ajustementsConditions;
|
return ajustementsConditions;
|
||||||
}
|
}
|
||||||
static getAjustementsEncaissement()
|
static getAjustementsEncaissement() {
|
||||||
{
|
|
||||||
return ajustementsEncaissement;
|
return ajustementsEncaissement;
|
||||||
}
|
}
|
||||||
|
|
||||||
static getDefinitionsBlessures() {
|
static getDefinitionsBlessures() {
|
||||||
return definitionsBlessures;
|
return definitionsBlessures;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
|
||||||
static isTronc( compName )
|
|
||||||
{
|
|
||||||
for (let troncList of competenceTroncs) {
|
|
||||||
for (let troncName of troncList) {
|
|
||||||
if ( troncName == compName)
|
|
||||||
return troncList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getCaracNextXp(value) {
|
static getCaracNextXp(value) {
|
||||||
return carac_xp_par_valeur[value - XP_CARAC_OFFSET];
|
return carac_xp_par_valeur[value - XP_CARAC_OFFSET];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static getCompetenceNextXp( niveau ) {
|
|
||||||
return competence_xp_par_niveau[niveau+10];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static computeCompetenceXPCost( competence )
|
|
||||||
{
|
|
||||||
let minLevel = competence.data.base;
|
|
||||||
if ( minLevel == competence.data.niveau) return 0;
|
|
||||||
if ( competence.data.niveau < -10) return 0;
|
|
||||||
|
|
||||||
let xp = 0;
|
|
||||||
for (let i=minLevel+1; i<=competence.data.niveau; i++) {
|
|
||||||
xp += competence_xp_par_niveau[i+10];
|
|
||||||
//console.log(i, i+10, competence_xp_par_niveau[i+10]);
|
|
||||||
}
|
|
||||||
if (competence.data.categorie == 'draconic') {
|
|
||||||
xp+= competence.data.xp_sort;
|
|
||||||
}
|
|
||||||
return xp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static computeCompetenceTroncXP( competenceList )
|
|
||||||
{
|
|
||||||
let xp = 0;
|
|
||||||
for (let troncList of competenceTroncs) {
|
|
||||||
let minNiveau = 0;
|
|
||||||
for (let troncName of troncList) {
|
|
||||||
let comp = RdDUtility.findCompetence( competenceList, troncName);
|
|
||||||
if (comp) {
|
|
||||||
minNiveau = Math.min(comp.data.niveau, minNiveau);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
minNiveau = Math.max(minNiveau, 0); // Clamp à 0, pour le tronc commun
|
|
||||||
let minNiveauXP = competence_xp_par_niveau[minNiveau+10];
|
|
||||||
xp += minNiveauXP;
|
|
||||||
for (let troncName of troncList) {
|
|
||||||
let comp = RdDUtility.findCompetence( competenceList, troncName);
|
|
||||||
if (comp){
|
|
||||||
xp += competence_xp_par_niveau[comp.data.niveau+10] - minNiveauXP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return xp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/** Retourne une liste triée d'armes avec le split arme1 main / arme 2 main */
|
/** Retourne une liste triée d'armes avec le split arme1 main / arme 2 main */
|
||||||
static _finalizeArmeList( armes, competenceList, carac ) {
|
static _finalizeArmeList(armes, competences, carac) {
|
||||||
// Gestion des armes 1/2 mains
|
// Gestion des armes 1/2 mains
|
||||||
let armesEquipe = [];
|
let armesEquipe = [];
|
||||||
for (const arme of armes) {
|
for (const arme of armes) {
|
||||||
if (arme.data.equipe) {
|
if (arme.data.equipe) {
|
||||||
armesEquipe.push(arme);
|
armesEquipe.push(arme);
|
||||||
let comp = competenceList.find(c => c.name == arme.data.competence);
|
let comp = competences.find(c => c.name == arme.data.competence);
|
||||||
arme.data.initiative = RdDUtility.calculInitiative(arme.data.niveau, carac[comp.data.defaut_carac].value);
|
arme.data.initiative = RdDUtility.calculInitiative(arme.data.niveau, carac[comp.data.defaut_carac].value);
|
||||||
// Dupliquer les armes pouvant être à 1 main et 2 mains en patchant la compétence
|
// Dupliquer les armes pouvant être à 1 main et 2 mains en patchant la compétence
|
||||||
if (arme.data.unemain && !arme.data.deuxmains) {
|
if (arme.data.unemain && !arme.data.deuxmains) {
|
||||||
@ -491,7 +379,7 @@ export class RdDUtility {
|
|||||||
arme2main.data.mainInfo = "(2m)";
|
arme2main.data.mainInfo = "(2m)";
|
||||||
arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK
|
arme2main.data.dommages = arme2main.data.dommages.split("/")[1]; // Existence temporaire uniquement dans la liste des armes, donc OK
|
||||||
arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace !
|
arme2main.data.competence = arme2main.data.competence.replace(" 1 main", " 2 mains"); // Replace !
|
||||||
let comp = competenceList.find(c => c.name == arme2main.data.competence);
|
let comp = competences.find(c => c.name == arme2main.data.competence);
|
||||||
arme2main.data.niveau = comp.data.niveau;
|
arme2main.data.niveau = comp.data.niveau;
|
||||||
arme2main.data.initiative = RdDUtility.calculInitiative(arme2main.data.niveau, carac[comp.data.defaut_carac].value);
|
arme2main.data.initiative = RdDUtility.calculInitiative(arme2main.data.niveau, carac[comp.data.defaut_carac].value);
|
||||||
armesEquipe.push(arme2main);
|
armesEquipe.push(arme2main);
|
||||||
@ -514,8 +402,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static computeCarac( data)
|
static computeCarac(data) {
|
||||||
{
|
|
||||||
data.carac.force.value = Math.min(data.carac.force.value, parseInt(data.carac.taille.value) + 4);
|
data.carac.force.value = Math.min(data.carac.force.value, parseInt(data.carac.taille.value) + 4);
|
||||||
|
|
||||||
data.carac.derobee.value = Math.floor(parseInt(((21 - data.carac.taille.value)) + parseInt(data.carac.agilite.value)) / 2);
|
data.carac.derobee.value = Math.floor(parseInt(((21 - data.carac.taille.value)) + parseInt(data.carac.agilite.value)) / 2);
|
||||||
@ -572,8 +459,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static calculMalusFatigue(fatigue, maxEnd)
|
static calculMalusFatigue(fatigue, maxEnd) {
|
||||||
{
|
|
||||||
maxEnd = Math.max(maxEnd, 1);
|
maxEnd = Math.max(maxEnd, 1);
|
||||||
maxEnd = Math.min(maxEnd, cumulFatigueMatrix.length);
|
maxEnd = Math.min(maxEnd, cumulFatigueMatrix.length);
|
||||||
let segments = cumulFatigueMatrix[maxEnd];
|
let segments = cumulFatigueMatrix[maxEnd];
|
||||||
@ -627,8 +513,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getLocalisation( )
|
static getLocalisation() {
|
||||||
{
|
|
||||||
// TODO: bouger dans une RollTable du compendium et chercher dans les RoolTable puis compendium pour permettre le changement?
|
// TODO: bouger dans une RollTable du compendium et chercher dans les RoolTable puis compendium pour permettre le changement?
|
||||||
let result = new Roll("1d20").roll().total;
|
let result = new Roll("1d20").roll().total;
|
||||||
let txt = ""
|
let txt = ""
|
||||||
@ -666,8 +551,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static currentFatigueMalus( value, max)
|
static currentFatigueMalus(value, max) {
|
||||||
{
|
|
||||||
max = Math.max(1, Math.min(max, 60));
|
max = Math.max(1, Math.min(max, 60));
|
||||||
value = Math.min(max * 2, Math.max(0, value));
|
value = Math.min(max * 2, Math.max(0, value));
|
||||||
|
|
||||||
@ -683,20 +567,29 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static findCompetence(compList, compName)
|
static async loadCompendiumNames(compendium) {
|
||||||
{
|
|
||||||
compName = compName.toLowerCase();
|
|
||||||
return compList.find(item => item.name.toLowerCase() == compName && (item.type =="competence" || item.type == "competencecreature"))
|
|
||||||
}
|
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
|
||||||
static async getCompetenceList( compendium ) {
|
|
||||||
const pack = game.packs.get(compendium);
|
const pack = game.packs.get(compendium);
|
||||||
let competences;
|
let competences;
|
||||||
await pack.getIndex().then(index => competences = index);
|
await pack.getIndex().then(index => competences = index);
|
||||||
return competences;
|
return competences;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async loadCompendium(compendium, filter = item => true) {
|
||||||
|
let compendiumItems = await RdDUtility.loadCompendiumNames(compendium);
|
||||||
|
|
||||||
|
const pack = game.packs.get(compendium);
|
||||||
|
let list = [];
|
||||||
|
for (let compendiumItem of compendiumItems) {
|
||||||
|
await pack.getEntity(compendiumItem._id).then(it => {
|
||||||
|
const item = it.data;
|
||||||
|
if (filter(item)) {
|
||||||
|
list.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async responseNombreAstral(data) {
|
static async responseNombreAstral(data) {
|
||||||
let actor = game.actors.get(data.id);
|
let actor = game.actors.get(data.id);
|
||||||
@ -704,8 +597,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static performSocketMesssage( sockmsg )
|
static performSocketMesssage(sockmsg) {
|
||||||
{
|
|
||||||
console.log(">>>>> MSG RECV", sockmsg);
|
console.log(">>>>> MSG RECV", sockmsg);
|
||||||
switch (sockmsg.msg) {
|
switch (sockmsg.msg) {
|
||||||
case "msg_encaisser":
|
case "msg_encaisser":
|
||||||
@ -754,7 +646,7 @@ export class RdDUtility {
|
|||||||
} else {
|
} else {
|
||||||
let initOffset = 0;
|
let initOffset = 0;
|
||||||
let caracForInit = 0;
|
let caracForInit = 0;
|
||||||
let competence = RdDUtility.findCompetence( combatant.actor.data.items, arme.data.competence);
|
let competence = RdDItemCompetence.findCompetence(combatant.actor.data.items, arme.data.competence);
|
||||||
|
|
||||||
if (actor.data.type == 'creature' || actor.data.type == 'entite') {
|
if (actor.data.type == 'creature' || actor.data.type == 'entite') {
|
||||||
caracForInit = competence.data.carac_value;
|
caracForInit = competence.data.carac_value;
|
||||||
@ -813,7 +705,8 @@ export class RdDUtility {
|
|||||||
menuItems.push({
|
menuItems.push({
|
||||||
name: arme.data.competence,
|
name: arme.data.competence,
|
||||||
icon: "<i class='fas fa-dice-d6'></i>",
|
icon: "<i class='fas fa-dice-d6'></i>",
|
||||||
callback: target => { RdDUtility.rollInitiativeCompetence( combatantId, arme ) } } );
|
callback: target => { RdDUtility.rollInitiativeCompetence(combatantId, arme) }
|
||||||
|
});
|
||||||
}
|
}
|
||||||
new ContextMenu(html, ".directory-list", menuItems).render();
|
new ContextMenu(html, ".directory-list", menuItems).render();
|
||||||
}
|
}
|
||||||
@ -845,8 +738,7 @@ export class RdDUtility {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static async chatListeners( html )
|
static async chatListeners(html) {
|
||||||
{
|
|
||||||
RdDCombat.registerChatCallbacks(html);
|
RdDCombat.registerChatCallbacks(html);
|
||||||
|
|
||||||
// Gestion spécifique message passeurs
|
// Gestion spécifique message passeurs
|
||||||
@ -883,7 +775,8 @@ export class RdDUtility {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static createMonnaie(name, valeur_deniers, img = "", enc = 0.01) {
|
static createMonnaie(name, valeur_deniers, img = "", enc = 0.01) {
|
||||||
let piece = { name: name, type: 'monnaie', img: img, _id: randomID(16),
|
let piece = {
|
||||||
|
name: name, type: 'monnaie', img: img, _id: randomID(16),
|
||||||
data: {
|
data: {
|
||||||
quantite: 0,
|
quantite: 0,
|
||||||
valeur_deniers: valeur_deniers,
|
valeur_deniers: valeur_deniers,
|
||||||
|
File diff suppressed because one or more lines are too long
@ -191,8 +191,8 @@
|
|||||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if data.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer"
|
src="systems/foundryvtt-reve-de-dragon/icons/{{#if data.editCaracComp}}unlocked.svg{{else}}locked.svg{{/if}}" alt="blocker/débloquer"
|
||||||
>{{#if data.editCaracComp}}Vérouiller{{else}}Dévérouiller{{/if}}</a></span>
|
>{{#if data.editCaracComp}}Vérouiller{{else}}Dévérouiller{{/if}}</a></span>
|
||||||
<span><a id="show-hide-competences"><img class="small-button-container"
|
<span><a id="show-hide-competences"><img class="small-button-container"
|
||||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if data.montrerCompetencesNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout"
|
src="systems/foundryvtt-reve-de-dragon/icons/{{#if data.showCompNiveauBase}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer tout"
|
||||||
>{{#if data.montrerCompetencesNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a></span>
|
>{{#if data.showCompNiveauBase}}Montrer tout{{else}}Filtrer{{/if}}</a></span>
|
||||||
<span><a id="show-hide-archetype"><img class="small-button-container"
|
<span><a id="show-hide-archetype"><img class="small-button-container"
|
||||||
src="systems/foundryvtt-reve-de-dragon/icons/{{#if data.montrerArchetype}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer l'archétype"
|
src="systems/foundryvtt-reve-de-dragon/icons/{{#if data.montrerArchetype}}no-filter.svg{{else}}filter.svg{{/if}}" alt="filter/montrer l'archétype"
|
||||||
>{{#if data.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}</a></span>
|
>{{#if data.montrerArchetype}}Masquer l'archétype{{else}}Voir l'archétype{{/if}}</a></span>
|
||||||
@ -204,7 +204,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.generale as |comp key|}}
|
{{#each data.competenceByCategory.generale as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -227,7 +227,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.particuliere as |comp key|}}
|
{{#each data.competenceByCategory.particuliere as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -249,7 +249,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.specialisee as |comp key|}}
|
{{#each data.competenceByCategory.specialisee as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -270,11 +270,11 @@
|
|||||||
|
|
||||||
<div class="flex-group-left flexcol competence-column">
|
<div class="flex-group-left flexcol competence-column">
|
||||||
<header class="competence-header flexrow">
|
<header class="competence-header flexrow">
|
||||||
<span class="competence-title">Compétences De Mêlée</span>
|
<span class="competence-title">Compétences de Mêlée</span>
|
||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.melee as |comp key|}}
|
{{#each data.competenceByCategory.melee as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -293,11 +293,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<header class="competence-header flexrow">
|
<header class="competence-header flexrow">
|
||||||
<span class="competence-title">Compétences De Tir</span>
|
<span class="competence-title">Compétences de Tir</span>
|
||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.tir as |comp key|}}
|
{{#each data.competenceByCategory.tir as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -316,11 +316,11 @@
|
|||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<header class="competence-header flexrow">
|
<header class="competence-header flexrow">
|
||||||
<span class="competence-title">Compétences De Lancer</span>
|
<span class="competence-title">Compétences de Lancer</span>
|
||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.lancer as |comp key|}}
|
{{#each data.competenceByCategory.lancer as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -343,7 +343,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.connaissance as |comp key|}}
|
{{#each data.competenceByCategory.connaissance as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
@ -366,7 +366,7 @@
|
|||||||
</header>
|
</header>
|
||||||
<ul class="item-list alterne-list">
|
<ul class="item-list alterne-list">
|
||||||
{{#each data.competenceByCategory.draconic as |comp key|}}
|
{{#each data.competenceByCategory.draconic as |comp key|}}
|
||||||
{{#if data.afficherCompetence}}
|
{{#if data.showCompetence}}
|
||||||
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
<li class="item flexrow list-item" data-item-id="{{comp._id}}">
|
||||||
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
<img class="sheet-competence-img" src="{{comp.img}}"/>
|
||||||
<span class="competence-label"><a>{{comp.name}}</a></span>
|
<span class="competence-label"><a>{{comp.name}}</a></span>
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
<option value="Dague">Dague</option>
|
|
||||||
<option value="Epée à 1 main">Epée à 1 main</option>
|
|
||||||
<option value="Epée à 2 mains">Epée à 2 mains</option>
|
|
||||||
<option value="Hache à 1 main">Hache à 1 main</option>
|
|
||||||
<option value="Hache à 2 mains">Hache à 2 mains</option>
|
|
||||||
<option value="Masse à 1 main">Masse à 1 main</option>
|
|
||||||
<option value="Masse à 2 mains">Masse à 2 mains</option>
|
|
||||||
<option value="Fléau">Fléau</option>
|
|
||||||
<option value="Lance">Lance</option>
|
|
||||||
<option value="Arme d'hast">Arme d'hast</option>
|
|
||||||
<option value="Bouclier">Bouclier</option>
|
|
||||||
<option value="Arbalète">Arbalète</option>
|
|
||||||
<option value="Arc">Arc</option>
|
|
||||||
<option value="Fronde">Fronde</option>
|
|
||||||
<option value="Dague de jet">Dague de jet</option>
|
|
||||||
<option value="Javelot">Javelot</option>
|
|
||||||
<option value="Fouet">Fouet</option>
|
|
@ -1,8 +0,0 @@
|
|||||||
<option value="generale">Générale</option>
|
|
||||||
<option value="particuliere">Particulières</option>
|
|
||||||
<option value="specialisee">Spécialisées</option>
|
|
||||||
<option value="connaissance">Connaissances</option>
|
|
||||||
<option value="tir">Tir</option>
|
|
||||||
<option value="lancer">Lancer</option>
|
|
||||||
<option value="melee">Mêlée</option>
|
|
||||||
<option value="draconic">Draconic</option>
|
|
3
templates/enum-categorie-competence.html
Normal file
3
templates/enum-categorie-competence.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{{#each @root.categorieCompetences as |categorie key|}}
|
||||||
|
<option value="{{@key}}">{{categorie.label}}</option>
|
||||||
|
{{/each}}
|
3
templates/enum-competence.html
Normal file
3
templates/enum-competence.html
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{{#each @root.competences as |competence key|}}
|
||||||
|
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||||
|
{{/each}}
|
@ -12,7 +12,7 @@
|
|||||||
<label for="categorie">Compétence associée</label>
|
<label for="categorie">Compétence associée</label>
|
||||||
<select name="data.competence" id="competence" data-dtype="String">
|
<select name="data.competence" id="competence" data-dtype="String">
|
||||||
{{#select item.data.competence}}
|
{{#select item.data.competence}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/arme-competence.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<label>Catégorie parade </label>
|
<label>Catégorie parade </label>
|
||||||
<select name="data.categorie_parade" id="categorie_parade" data-dtype="String">
|
<select name="data.categorie_parade" id="categorie_parade" data-dtype="String">
|
||||||
{{#select data.categorie_parade}}
|
{{#select data.categorie_parade}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie_parade.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<label for="categorie">Catégorie </label>
|
<label for="categorie">Catégorie </label>
|
||||||
<select name="data.categorie" id="categorie" data-dtype="String">
|
<select name="data.categorie" id="categorie" data-dtype="String">
|
||||||
{{#select item.data.categorie}}
|
{{#select item.data.categorie}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-categorie.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-competence.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<label>Catégorie parade </label>
|
<label>Catégorie parade </label>
|
||||||
<select name="data.categorie_parade" id="categorie_parade" data-dtype="String">
|
<select name="data.categorie_parade" id="categorie_parade" data-dtype="String">
|
||||||
{{#select data.categorie_parade}}
|
{{#select data.categorie_parade}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie_parade.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-parade.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<label>Catégorie</label>
|
<label>Catégorie</label>
|
||||||
<select name="data.categorie" id="categorie" data-dtype="String">
|
<select name="data.categorie" id="categorie" data-dtype="String">
|
||||||
{{#select data.categorie}}
|
{{#select data.categorie}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
<label>Catégorie</label>
|
<label>Catégorie</label>
|
||||||
<select name="data.categorie" id="categorie" data-dtype="String">
|
<select name="data.categorie" id="categorie" data-dtype="String">
|
||||||
{{#select data.categorie}}
|
{{#select data.categorie}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<label for="xp">Compétence</label>
|
<label for="xp">Compétence</label>
|
||||||
<select name="data.competence" id="competenceselect" data-dtype="String">
|
<select name="data.competence" id="competenceselect" data-dtype="String">
|
||||||
{{#select item.data.competence}}
|
{{#select item.data.competence}}
|
||||||
{{#each competenceList as |competence key|}}
|
{{#each competences as |competence key|}}
|
||||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<label for="xp">Compétence</label>
|
<label for="xp">Compétence</label>
|
||||||
<select name="data.competence" id="competenceselect" data-dtype="String">
|
<select name="data.competence" id="competenceselect" data-dtype="String">
|
||||||
{{#select item.data.competence}}
|
{{#select item.data.competence}}
|
||||||
{{#each competenceList as |competence key|}}
|
{{#each competences as |competence key|}}
|
||||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
<label>Catégorie</label>
|
<label>Catégorie</label>
|
||||||
<select name="data.categorie" id="categorie" data-dtype="String">
|
<select name="data.categorie" id="categorie" data-dtype="String">
|
||||||
{{#select data.categorie}}
|
{{#select data.categorie}}
|
||||||
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie.html"}}
|
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-ingredient.html"}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<label for="xp">Compétence</label>
|
<label for="xp">Compétence</label>
|
||||||
<select name="data.competence" id="competenceselect" data-dtype="String">
|
<select name="data.competence" id="competenceselect" data-dtype="String">
|
||||||
{{#select item.data.competence}}
|
{{#select item.data.competence}}
|
||||||
{{#each competenceList as |competence key|}}
|
{{#each competences as |competence key|}}
|
||||||
<option value="{{competence.name}}">{{competence.name}}</option>
|
<option value="{{competence.name}}">{{competence.name}}</option>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
|
Loading…
Reference in New Issue
Block a user