Gestion des signes draconiques #455

Closed
vincent.vandeme wants to merge 233 commits from v1.4-signes-draconiques into master
5 changed files with 18 additions and 10 deletions
Showing only changes of commit ceb73b9944 - Show all commits

View File

@ -55,29 +55,34 @@ const competence_xp_cumul = _buildCumulXP();
export class RdDItemCompetence extends Item {
/* -------------------------------------------- */
static actorCompendium(actorType) {
return compendiumCompetences[actorType];
}
/* -------------------------------------------- */
static getCategorieCompetences() {
return categorieCompetences;
}
/* -------------------------------------------- */
static getNiveauBase(category) {
return categorieCompetences[category].level;
return categorieCompetences[category].base;
}
/* -------------------------------------------- */
static getLabelCategorie(category) {
return categorieCompetences[category].label;
}
/* -------------------------------------------- */
static getEsquive(competences) {
return { name: 'Esquive', niveau: RdDItemCompetence.findCompetence(competences, 'Esquive')?.data.niveau ?? -6 };
}
/* -------------------------------------------- */
static isCompetenceArme(competence) {
switch (competence.data.categorie) {
switch (competence.data.data.categorie) {
case 'melee':
return competence.name != 'Esquive';
return competence.data.name != 'Esquive';
case 'tir':
case 'lancer':
return true;
@ -169,11 +174,13 @@ export class RdDItemCompetence extends Item {
return economie;
}
/* -------------------------------------------- */
static levelUp(itemData) {
itemData.data.xpNext = RdDItemCompetence.getCompetenceNextXp(itemData.data.niveau);
itemData.data.isLevelUp = itemData.data.xp >= itemData.data.xpNext;
}
/* -------------------------------------------- */
static isVisible(itemData) {
return Number(itemData.data.niveau) != RdDItemCompetence.getNiveauBase(itemData.data.categorie);
}

View File

@ -65,8 +65,9 @@ export class RdDItemSheet extends ItemSheet {
formData.caracList = duplicate(game.system.model.Actor.personnage.carac);
formData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences' );
}
if (formData.type == 'arme') {
if (formData.type == 'arme') {
formData.competences = await RdDUtility.loadCompendium( 'foundryvtt-reve-de-dragon.competences', it => RdDItemCompetence.isCompetenceArme(it));
console.log(formData.competences);
}
if ( formData.type == 'recettealchimique' ) {
RdDAlchimie.processManipulation(formData.item, this.actor && this.actor.id );

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label>Compétence associée</label>
<select name="data.competence" id="competence" data-dtype="String">
{{#select item.data.competence}}
{{#select data.competence}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-competence.html"}}
{{/select}}
</select>

View File

@ -17,7 +17,7 @@
<div class="form-group">
<label>Catégorie </label>
<select name="data.categorie" id="categorie" data-dtype="String">
{{#select item.data.categorie}}
{{#select data.categorie}}
{{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-competence.html"}}
{{/select}}
</select>
@ -33,7 +33,7 @@
<div class="form-group">
<label for="base">Niveau de base </label>
<select name="data.base" id="base" data-dtype="Number">
{{#select item.data.base}}
{{#select data.base}}
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-base.html"}}
{{/select}}
</select>
@ -41,7 +41,7 @@
<div class="form-group">
<label for="defaut_carac">Caractéristique par défaut </label>
<select name="data.defaut_carac" id="defaut_carac" data-dtype="String">
{{#select item.data.defaut_carac}}
{{#select data.defaut_carac}}
{{>"systems/foundryvtt-reve-de-dragon/templates/competence-carac-defaut.html"}}
{{/select}}
</select>

View File

@ -11,7 +11,7 @@
<div class="form-group">
<label>Draconic </label>
<select name="data.draconic" id="draconic" data-dtype="String">
{{#select item.data.draconic}}
{{#select data.draconic}}
{{>"systems/foundryvtt-reve-de-dragon/templates/sort-draconic.html"}}
{{/select}}
</select>
@ -19,7 +19,7 @@
<div class="form-group">
<label for="xp">Case TMR </label>
<select name="data.caseTMR" id="caseTMR" data-dtype="String">
{{#select item.data.caseTMR}}
{{#select data.caseTMR}}
{{>"systems/foundryvtt-reve-de-dragon/templates/sort-tmr.html"}}
<option value="special">Case spéciale TMR (saisie ci-dessous)</option>
{{/select}}