diff --git a/module/actor.js b/module/actor.js index 205fa89e..b2354b38 100644 --- a/module/actor.js +++ b/module/actor.js @@ -271,10 +271,11 @@ export class RdDActor extends RdDBaseActor { } getDraconicOuPossession() { - const possessions = this.items.filter(it => it.type == 'competencecreature' && it.system.ispossession) - .sort(Misc.descending(it => it.system.niveau)); - if (possessions.length > 0) { - return duplicate(possessions[0]); + const possession = this.items.filter(it => it.type == TYPES.competencecreature && it.system.categorie == 'possession') + .sort(Misc.descending(it => it.system.niveau)) + .find(it=>true); + if (possession) { + return duplicate(possession); } const draconics = [...this.getDraconicList().filter(it => it.system.niveau >= 0), POSSESSION_SANS_DRACONIC] @@ -960,9 +961,9 @@ export class RdDActor extends RdDBaseActor { /* -------------------------------------------- */ async updateCompetence(idOrName, compValue) { - let competence = this.getCompetence(idOrName); + const competence = this.getCompetence(idOrName); if (competence) { - let toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie); + const toNiveau = compValue ?? RdDItemCompetence.getNiveauBase(competence.system.categorie, competence.getCategories()); this.notifyCompetencesTronc(competence, toNiveau); const fromNiveau = competence.system.niveau; await this.updateEmbeddedDocuments('Item', [{ _id: competence.id, 'system.niveau': toNiveau }]); @@ -2307,7 +2308,7 @@ export class RdDActor extends RdDBaseActor { RdDPossession.onAttaquePossession(target, this, rollData.competence) } else { - const arme = RdDItemCompetenceCreature.armeNaturelle(rollData.competence) + const arme = RdDItemCompetenceCreature.armeCreature(rollData.competence) RdDCombat.rddCombatTarget(target, this).attaque(competence, arme) } }); @@ -3054,7 +3055,7 @@ export class RdDActor extends RdDBaseActor { const competence = this.getCompetence(arme.system.competence) - if (competence.system.ispossession) { + if (competence.isCompetencePossession()) { return RdDPossession.onAttaquePossession(target, this, competence); } RdDCombat.rddCombatTarget(target, this).attaque(competence, arme); diff --git a/module/actor/base-actor-sheet.js b/module/actor/base-actor-sheet.js index 201f845f..6411a415 100644 --- a/module/actor/base-actor-sheet.js +++ b/module/actor/base-actor-sheet.js @@ -3,7 +3,8 @@ import { Misc } from "../misc.js"; import { DialogSplitItem } from "../dialog-split-item.js"; import { RdDSheetUtility } from "../rdd-sheet-utility.js"; import { Monnaie } from "../item-monnaie.js"; -import { RdDItem } from "../item.js"; +import { RdDItem, TYPES } from "../item.js"; +import { RdDItemCompetenceCreature } from "../item-competencecreature.js"; /* -------------------------------------------- */ /** @@ -53,6 +54,8 @@ export class RdDBaseActorSheet extends ActorSheet { this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.inventaires); this._appliquerRechercheObjets(formData.conteneurs, formData.inventaires); formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs); + formData.competences.filter(it => it.type == TYPES.competencecreature) + .forEach(it => it.isdommages = RdDItemCompetenceCreature.isDommages(it)) return formData; } @@ -125,27 +128,27 @@ export class RdDBaseActorSheet extends ActorSheet { .map(t => Misc.arrayOrEmpty(itemTypes[t])) .reduce((a, b) => a.concat(b), []) .sort(Misc.ascending(it => it.name)); - } - - /* -------------------------------------------- */ /** @override */ - activateListeners(html) { - super.activateListeners(html); - this.html = html; - - this.html.find('.conteneur-name a').click(async event => { - RdDUtility.toggleAfficheContenu(this.getItemId(event)); - this.render(true); - }); - this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true)) - this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat()); - this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat()); - this.html.find('.recherche') - .each((index, field) => { - this._rechercheSelectArea(field); - }) - .keyup(async event => this._rechercherKeyup(event)) - .change(async event => this._rechercherKeyup(event)); - this.html.find('.recherche').prop( "disabled", false ); + } + + /* -------------------------------------------- */ /** @override */ + activateListeners(html) { + super.activateListeners(html); + this.html = html; + + this.html.find('.conteneur-name a').click(async event => { + RdDUtility.toggleAfficheContenu(this.getItemId(event)); + this.render(true); + }); + this.html.find('.item-edit').click(async event => this.getItem(event)?.sheet.render(true)) + this.html.find('.item-montrer').click(async event => this.getItem(event)?.postItemToChat()); + this.html.find('.actor-montrer').click(async event => this.actor.postActorToChat()); + this.html.find('.recherche') + .each((index, field) => { + this._rechercheSelectArea(field); + }) + .keyup(async event => this._rechercherKeyup(event)) + .change(async event => this._rechercherKeyup(event)); + this.html.find('.recherche').prop("disabled", false); // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; diff --git a/module/item-arme.js b/module/item-arme.js index a564e018..b8c59dad 100644 --- a/module/item-arme.js +++ b/module/item-arme.js @@ -1,4 +1,5 @@ import { RdDItemCompetenceCreature } from "./item-competencecreature.js" +import { TYPES } from "./item.js"; import { RdDCombatManager } from "./rdd-combat.js"; const nomCategorieParade = { @@ -19,7 +20,7 @@ const nomCategorieParade = { export class RdDItemArme extends Item { static isArme(item) { - return (item.type == 'competencecreature' && item.system.iscombat) || item.type == 'arme'; + return RdDItemCompetenceCreature.getCategorieAttaque(item) || item.type == 'arme'; } /* -------------------------------------------- */ @@ -27,7 +28,7 @@ export class RdDItemArme extends Item { switch (arme ? arme.type : '') { case 'arme': return arme; case 'competencecreature': - return RdDItemCompetenceCreature.armeNaturelle(arme); + return RdDItemCompetenceCreature.armeCreature(arme); } return RdDItemArme.mainsNues(); } diff --git a/module/item-competence.js b/module/item-competence.js index be1039ca..98a2e8eb 100644 --- a/module/item-competence.js +++ b/module/item-competence.js @@ -23,7 +23,7 @@ const limitesArchetypes = [ ]; /* -------------------------------------------- */ -const categorieCompetences = { +const categoriesCompetences = { "generale": { base: -4, label: "Générales" }, "particuliere": { base: -8, label: "Particulières" }, "specialisee": { base: -11, label: "Spécialisées" }, @@ -49,16 +49,16 @@ const competence_xp_cumul = _buildCumulXP(); export class RdDItemCompetence extends Item { /* -------------------------------------------- */ - static getCategorieCompetences() { - return categorieCompetences; - } - /* -------------------------------------------- */ - static getNiveauBase(category) { - return categorieCompetences[category].base; + static getCategories() { + return categoriesCompetences; } /* -------------------------------------------- */ static getLabelCategorie(category) { - return categorieCompetences[category].label; + return categoriesCompetences[category].label; + } + /* -------------------------------------------- */ + static getNiveauBase(category, categories = categoriesCompetences) { + return categories[category]?.base ?? 0; } /* -------------------------------------------- */ @@ -192,7 +192,7 @@ export class RdDItemCompetence extends Item { /* -------------------------------------------- */ static isNiveauBase(item) { - return Number(item.system.niveau) == RdDItemCompetence.getNiveauBase(item.system.categorie); + return Number(item.system.niveau) == RdDItemCompetence.getNiveauBase(item.system.categorie, item.getCategories()); } /* -------------------------------------------- */ diff --git a/module/item-competencecreature.js b/module/item-competencecreature.js index e4311271..426a7aab 100644 --- a/module/item-competencecreature.js +++ b/module/item-competencecreature.js @@ -1,51 +1,97 @@ +import { RdDItem, TYPES } from "./item.js"; import { RdDCombatManager } from "./rdd-combat.js"; +const categories = { + "generale": { base: 0, label: "Générale" }, + "naturelle": { base: 0, label: "Arme naturelle" }, + "melee": { base: 0, label: "Mêlée" }, + "parade": { base: 0, label: "Parade" }, + "tir": { base: 0, label: "Tir" }, + "lancer": { base: 0, label: "Lancer" }, + "possession": { base: 0, label: "Possession" }, +} + /* -------------------------------------------- */ export class RdDItemCompetenceCreature extends Item { - /* -------------------------------------------- */ - static setRollDataCreature(rollData) { - rollData.competence = rollData.competence - rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.system.carac_value } } - rollData.competence.system.defaut_carac = "carac_creature" - rollData.competence.system.categorie = "creature" - rollData.selectedCarac = rollData.carac.carac_creature - if (rollData.competence.system.iscombat) { - rollData.arme = RdDItemCompetenceCreature.armeNaturelle(rollData.competence); - } + static getCategories() { + return categories; } /* -------------------------------------------- */ - static armeNaturelle(competencecreature) { - if (RdDItemCompetenceCreature.isCompetenceAttaque(competencecreature)) { - // si c'est un Item compétence: cloner pour ne pas modifier lma compétence - let arme = (competencecreature instanceof Item) ? competencecreature.clone(): competencecreature; - mergeObject(arme.system, + static setRollDataCreature(rollData) { + rollData.carac = { "carac_creature": { label: rollData.competence.name, value: rollData.competence.system.carac_value } } + rollData.competence.system.defaut_carac = "carac_creature" + rollData.selectedCarac = rollData.carac.carac_creature + rollData.arme = RdDItemCompetenceCreature.armeCreature(rollData.competence); + } + + /* -------------------------------------------- */ + static armeCreature(item) { + const categorieAttaque = RdDItemCompetenceCreature.getCategorieAttaque(item) + if (categorieAttaque != undefined) { + // si c'est un Item compétence: cloner pour ne pas modifier la compétence + let arme = item.clone(); + mergeObject(arme, { - competence: arme.name, - initiative: RdDCombatManager.calculInitiative(competencecreature.system.niveau, competencecreature.system.carac_value), - niveau: competencecreature.system.niveau, - equipe: true, - resistance: 100, - dommagesReels: arme.system.dommages, - penetration: 0, - force: 0, - rapide: true, - cac: competencecreature.system.isnaturelle ? "naturelle" : "", - action: 'attaque' + action: item.isCompetencePossession() ? 'possession' : 'attaque', + system: { + competence: arme.name, + cac: categorieAttaque == "naturelle" ? "naturelle" : "", + niveau: item.system.niveau, + initiative: RdDCombatManager.calculInitiative(item.system.niveau, item.system.carac_value), + equipe: true, + resistance: 100, + dommagesReels: arme.system.dommages, + penetration: 0, + force: 0, + rapide: true, + } }); return arme; } - console.error("RdDItemCompetenceCreature.toActionArme(", competencecreature, ") : impossible de transformer l'Item en arme"); return undefined; } /* -------------------------------------------- */ - static isCompetenceAttaque(item) { - return item.type == 'competencecreature' && item.system.iscombat; + static getCategorieAttaque(item) { + if (item.type == TYPES.competencecreature) { + switch (item.system.categorie) { + case "melee": + case "tir": + case "lancer": + case "naturelle": + case "possession": + return item.system.categorie + } + } + return undefined } - + static isDommages(item) { + if (item.type == TYPES.competencecreature) { + switch (item.system.categorie) { + case "melee": + case "tir": + case "lancer": + case "naturelle": + return true + } + } + return false + } + static isParade(item) { + if (item.type == TYPES.competencecreature) { + switch (item.system.categorie) { + case "melee": + case "naturelle": + case "parade": + return true + } + } + return false + } + /* -------------------------------------------- */ static isCompetenceParade(item) { return item.type == 'competencecreature' && item.system.categorie_parade !== ""; diff --git a/module/item-sheet.js b/module/item-sheet.js index 75c95920..3a190dd2 100644 --- a/module/item-sheet.js +++ b/module/item-sheet.js @@ -11,6 +11,8 @@ import { RdDSheetUtility } from "./rdd-sheet-utility.js"; import { SystemCompendiums } from "./settings/system-compendiums.js"; import { Misc } from "./misc.js"; import { RdDTimestamp } from "./time/rdd-timestamp.js"; +import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; +import { TYPES } from "./item.js"; /** * Extend the basic ItemSheet for RdD specific items @@ -98,9 +100,13 @@ export class RdDItemSheet extends ItemSheet { isComestible: this.item.getUtilisationCuisine(), options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable) } + if (this.item.type == TYPES.competencecreature) { + formData.isparade = RdDItemCompetenceCreature.isParade(this.item) + formData.isdommages = RdDItemCompetenceCreature.isDommages(this.item) + } const competences = await SystemCompendiums.getCompetences('personnage'); - formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences() + formData.categories = this.item.getCategories() if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') { formData.caracList = duplicate(game.system.model.Actor.personnage.carac) formData.caracList["reve-actuel"] = duplicate(game.system.model.Actor.personnage.reve.reve) @@ -249,7 +255,8 @@ export class RdDItemSheet extends ItemSheet { event.preventDefault(); if (this.item.isCompetence()) { - let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value); + const categorie = event.currentTarget.value; + const level = RdDItemCompetence.getNiveauBase(categorie, this.item.getCategories()); this.item.system.base = level; this.html.find('[name="system.base"]').val(level); } diff --git a/module/item.js b/module/item.js index 46ba302c..48dd6576 100644 --- a/module/item.js +++ b/module/item.js @@ -6,6 +6,8 @@ import { RdDTimestamp } from "./time/rdd-timestamp.js"; import { RdDUtility } from "./rdd-utility.js"; import { SystemCompendiums } from "./settings/system-compendiums.js"; import { RdDRaretes } from "./item/raretes.js"; +import { RdDItemCompetence } from "./item-competence.js"; +import { RdDItemCompetenceCreature } from "./item-competencecreature.js"; export const TYPES = { competence: 'competence', @@ -218,6 +220,7 @@ export class RdDItem extends Item { isService() { return this.type == TYPES.service; } isCompetence() { return typesObjetsCompetence.includes(this.type) } + isCompetencePossession() { return TYPES.competencecreature == this.type && this.system.categorie == "possession" } isTemporel() { return typesObjetsTemporels.includes(this.type) } isOeuvre() { return typesObjetsOeuvres.includes(this.type) } isDraconique() { return RdDItem.getItemTypesDraconiques().includes(this.type) } @@ -234,6 +237,13 @@ export class RdDItem extends Item { isPresentDansMilieux(milieux) { return this.getEnvironnements(milieux).length > 0 } + getCategories() { + switch (this.type) { + case TYPES.competence: return RdDItemCompetence.getCategories() + case TYPES.competencecreature: return RdDItemCompetenceCreature.getCategories() + } + return {} + } getEnvironnements(milieux = undefined) { const environnements = this.isInventaire() ? this.system.environnement : undefined; diff --git a/module/migrations.js b/module/migrations.js index 5d5a3ecf..38216c07 100644 --- a/module/migrations.js +++ b/module/migrations.js @@ -2,7 +2,7 @@ import { RdDBaseActor } from "./actor/base-actor.js"; import { LOG_HEAD, SYSTEM_RDD } from "./constants.js"; import { Grammar } from "./grammar.js"; import { Monnaie } from "./item-monnaie.js"; -import { RdDItem } from "./item.js"; +import { RdDItem, TYPES } from "./item.js"; import { RdDTimestamp } from "./time/rdd-timestamp.js"; import { RdDRaretes } from "./item/raretes.js"; @@ -13,7 +13,7 @@ class Migration { async applyItemsUpdates(computeUpdates) { await game.actors.forEach(async (actor) => { - const actorItemUpdates = computeUpdates(actor.items); + const actorItemUpdates = computeUpdates(actor.items).filter(it => it != undefined); if (actorItemUpdates.length > 0) { console.log( this.code, @@ -24,7 +24,7 @@ class Migration { } }); - const itemUpdates = computeUpdates(game.items); + const itemUpdates = computeUpdates(game.items).filter(it => it != undefined); if (itemUpdates.length > 0) { console.log(this.code, "Applying updates on items", itemUpdates); await Item.updateDocuments(itemUpdates); @@ -65,7 +65,6 @@ class _1_5_34_migrationPngWebp { } } - class _10_0_16_MigrationSortsReserve extends Migration { get code() { return "creation-item-sort-reserve"; } get version() { return "10.0.16"; } @@ -370,6 +369,7 @@ class _10_4_6_ServicesEnCommerces extends Migration { return itemToCreate; } } + class _10_5_0_UpdatePeriodicite extends Migration { get code() { return "migration-periodicite-poisons-maladies"; } get version() { return "10.5.0"; } @@ -458,6 +458,43 @@ class _10_7_0_MigrationBlessures extends Migration { } } +class _10_7_19_CategorieCompetenceCreature extends Migration { + get code() { return "categorie-competence-creature"; } + get version() { return "10.7.19"; } + + async migrate() { + await this.applyItemsUpdates(items => items + .filter(it => TYPES.competencecreature == it.type) + .map(it => this.migrateCompetenceCreature(it)) + ); + } + + migrateCompetenceCreature(it) { + const categorie = this.getCategorie(it) + if (categorie == it.system.categorie) { + return undefined + } + return { _id: it.id, 'system.categorie': categorie } + } + + getCategorie(it) { + if (it.system.ispossession) { + return 'possession' + } + switch (it.system.categorie) { + case "melee": + if (it.system.isnaturelle) { + return 'naturelle' + } + return 'melee' + case "particuliere": case "specialisee": case "connaissance": + return "generale" + default: + return it.system.categorie + } + } +} + export class Migrations { static getMigrations() { return [ @@ -474,6 +511,7 @@ export class Migrations { new _10_4_6_ServicesEnCommerces(), new _10_5_0_UpdatePeriodicite(), new _10_7_0_MigrationBlessures(), + new _10_7_19_CategorieCompetenceCreature(), ]; } @@ -490,7 +528,7 @@ export class Migrations { migrate() { const currentVersion = game.settings.get(SYSTEM_RDD, "systemMigrationVersion"); if (isNewerVersion(game.system.version, currentVersion)) { - //if (true) { /* comment previous and uncomment here to test before upgrade */ + // if (true) { /* comment previous and uncomment here to test before upgrade */ const migrations = Migrations.getMigrations().filter(m => isNewerVersion(m.version, currentVersion)); if (migrations.length > 0) { migrations.sort((a, b) => this.compareVersions(a, b)); diff --git a/module/rdd-combat.js b/module/rdd-combat.js index b3beda45..e6d4bfe7 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -87,7 +87,7 @@ export class RdDCombatManager extends Combat { let rollFormula = formula ?? RdDCombatManager.formuleInitiative(2, 10, 0, 0); if (!formula) { if (combatant.actor.type == 'creature' || combatant.actor.type == 'entite') { - const competence = combatant.actor.items.find(it => it.system.iscombat) + const competence = combatant.actor.items.find(it => RdDItemCompetenceCreature.getCategorieAttaque(it)) if (competence) { rollFormula = RdDCombatManager.formuleInitiative(2, competence.system.carac_value, competence.system.niveau, 0); } @@ -230,15 +230,15 @@ export class RdDCombatManager extends Combat { } static listActionsCreature(competences) { - return competences.filter(it => RdDItemCompetenceCreature.isCompetenceAttaque(it)) - .map(it => RdDItemCompetenceCreature.armeNaturelle(it)); + return competences.map(it => RdDItemCompetenceCreature.armeCreature(it)) + .filter(it => it != undefined); } static listActionsPossessions(actor) { return RdDCombatManager._indexActions(actor.getPossessions().map(p => { return { name: p.name, - action: 'conjurer', + action: 'possession', system: { competence: p.name, possessionid: p.system.possessionid, @@ -255,7 +255,7 @@ export class RdDCombatManager extends Combat { return actions; } if (actor.isCreatureEntite()) { - actions = actions.concat(RdDCombatManager.listActionsCreature(actor.itemTypes['competencecreature'])); + actions = RdDCombatManager.listActionsCreature(actor.itemTypes['competencecreature']); } else if (actor.isPersonnage()) { // Recupération des items 'arme' const armes = actor.itemTypes['arme'].filter(it => RdDItemArme.isArmeUtilisable(it)) @@ -263,7 +263,7 @@ export class RdDCombatManager extends Combat { .concat(RdDItemArme.mainsNues()); const competences = actor.itemTypes['competence']; - actions = actions.concat(RdDCombatManager.listActionsArmes(armes, competences, actor.system.carac)); + actions = RdDCombatManager.listActionsArmes(armes, competences, actor.system.carac); if (actor.system.attributs.hautrevant.value) { actions.push({ name: "Draconic", action: 'haut-reve', system: { initOnly: true, competence: "Draconic" } }); @@ -351,7 +351,7 @@ export class RdDCombatManager extends Combat { } else if (combatant.actor.getSurprise() == "demi") { initOffset = 0; initInfo = "Demi Surprise" - } else if (action.action == 'conjurer') { + } else if (action.action == 'possession') { initOffset = 10; caracForInit = combatant.actor.getReveActuel(); initInfo = "Possession" @@ -790,7 +790,7 @@ export class RdDCombat { passeArme: randomID(16), mortalite: arme?.system.mortalite, coupsNonMortels: false, - competence: competence, + competence: competence.clone(), surprise: this.attacker.getSurprise(true), surpriseDefenseur: this.defender.getSurprise(true), targetToken: Targets.extractTokenData(this.target), @@ -1045,7 +1045,7 @@ export class RdDCombat { passeArme: attackerRoll.passeArme, diffLibre: attackerRoll.diffLibre, attackerRoll: attackerRoll, - competence: this.defender.getCompetence(competenceParade), + competence: this.defender.getCompetence(competenceParade).clone(), arme: armeParade, surprise: this.defender.getSurprise(true), needParadeSignificative: ReglesOptionelles.isUsing('categorieParade') && RdDItemArme.needParadeSignificative(attackerRoll.arme, armeParade), @@ -1126,7 +1126,7 @@ export class RdDCombat { passeArme: attackerRoll.passeArme, diffLibre: attackerRoll.diffLibre, attackerRoll: attackerRoll, - competence: competence, + competence: competence.clone(), surprise: this.defender.getSurprise(true), surpriseDefenseur: this.defender.getSurprise(true), carac: this.defender.system.carac, diff --git a/module/rdd-empoignade.js b/module/rdd-empoignade.js index 4bb9f43b..3e46fd0e 100644 --- a/module/rdd-empoignade.js +++ b/module/rdd-empoignade.js @@ -70,7 +70,7 @@ export class RdDEmpoignade { let rollData = { mode: mode, isEmpoignade: true, - competence: attacker.getCompetence("Corps à corps"), + competence: attacker.getCompetence("Corps à corps").clone(), selectedCarac: attacker.system.carac.melee, empoignade: empoignade, attackerId: attacker.id, diff --git a/module/rdd-possession.js b/module/rdd-possession.js index a0e73204..ed028d41 100644 --- a/module/rdd-possession.js +++ b/module/rdd-possession.js @@ -39,7 +39,7 @@ export class RdDPossession { let rollData = { mode: "possession", isECNIDefender: false, - competence: competence, + competence: competence.clone(), possession: possession, attacker: attacker, defender: defender, @@ -127,7 +127,7 @@ export class RdDPossession { const dialog = await RdDRoll.create(defender, rollData, { html: 'systems/foundryvtt-reve-de-dragon/templates/dialog-roll-defense-possession.html' }, { - name: 'conjurer', + name: 'possession', label: 'Conjurer une Possession', callbacks: [ { action: async (r) => await RdDPossession.$onRollConjuration(r) } diff --git a/module/rdd-token-hud.js b/module/rdd-token-hud.js index 12dcaf4d..c5e5972a 100644 --- a/module/rdd-token-hud.js +++ b/module/rdd-token-hud.js @@ -75,7 +75,7 @@ export class RdDTokenHud { (event) => { const actionIndex = event.currentTarget.attributes['data-action-index']?.value; const action = hudData.actions[actionIndex]; - if (action.action == 'conjurer') { + if (action.action == 'possession') { const possession = combatant.actor.getPossession(action.system.possessionid); combatant.actor.conjurerPossession(possession); } diff --git a/module/rdd-utility.js b/module/rdd-utility.js index c64a4330..e69b9790 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -182,7 +182,7 @@ export class RdDUtility { 'systems/foundryvtt-reve-de-dragon/templates/enum-caracteristiques.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-base-competence.html', 'systems/foundryvtt-reve-de-dragon/templates/enum-aspect-tarot.html', - 'systems/foundryvtt-reve-de-dragon/templates/enum-categorie-competence.html', + 'systems/foundryvtt-reve-de-dragon/templates/enum-categories.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-categorie-potion.html', diff --git a/template.json b/template.json index 2c7bf2e6..7b4e0b49 100644 --- a/template.json +++ b/template.json @@ -586,11 +586,11 @@ }, "competencecreature": { "templates": ["description"], - "categorie_parade": "", + "carac_value": 0, "niveau": 0, "default_diffLibre": 0, "categorie": "", - "carac_value": 0, + "categorie_parade": "", "iscombat": false, "isnaturelle": true, "ispossession": false, diff --git a/templates/actor/comp-creature.html b/templates/actor/comp-creature.html index e80eb270..9c20c119 100644 --- a/templates/actor/comp-creature.html +++ b/templates/actor/comp-creature.html @@ -9,18 +9,24 @@ - - - {{#if @root.options.vueDetaillee}} -
- - -
- {{/if}} + + + {{#if @root.options.vueDetaillee}} +
+ + +
+ {{/if}} {{/each}} diff --git a/templates/enum-categorie-competencecreature.html b/templates/enum-categorie-competencecreature.html new file mode 100644 index 00000000..4a581f1c --- /dev/null +++ b/templates/enum-categorie-competencecreature.html @@ -0,0 +1,3 @@ +{{#each @root.categoriesCompetencesCreature as |categorie key|}} + +{{/each}} diff --git a/templates/enum-categorie-competence.html b/templates/enum-categories.html similarity index 53% rename from templates/enum-categorie-competence.html rename to templates/enum-categories.html index f66af4e0..88fd41d8 100644 --- a/templates/enum-categorie-competence.html +++ b/templates/enum-categories.html @@ -1,3 +1,3 @@ -{{#each @root.categorieCompetences as |categorie key|}} +{{#each @root.categories as |categorie key|}} {{/each}} diff --git a/templates/item-competence-sheet.html b/templates/item-competence-sheet.html index d0287462..8f8ec804 100644 --- a/templates/item-competence-sheet.html +++ b/templates/item-competence-sheet.html @@ -18,7 +18,7 @@ diff --git a/templates/item-competencecreature-sheet.html b/templates/item-competencecreature-sheet.html index a3c627e7..94c67834 100644 --- a/templates/item-competencecreature-sheet.html +++ b/templates/item-competencecreature-sheet.html @@ -6,50 +6,38 @@
- +
- +
-
- - -
- {{#unless system.ispossession}} -
- - -
- {{#if system.iscombat}} -
- - -
+ {{#if isdommages}}
- {{/if}} + {{/if}} + {{#if isparade}}
- +
- {{/unless}} + {{/if}} {{>"systems/foundryvtt-reve-de-dragon/templates/partial-item-description.html"}}