diff --git a/module/actor-creature-sheet.js b/module/actor-creature-sheet.js index 80582eb1..fbced05f 100644 --- a/module/actor-creature-sheet.js +++ b/module/actor-creature-sheet.js @@ -4,7 +4,6 @@ * @extends {ActorSheet} */ -import { HtmlUtility } from "./html-utility.js"; import { RdDUtility } from "./rdd-utility.js"; import { RdDActorSheet } from "./actor-sheet.js"; import { RdDCarac } from "./rdd-carac.js"; @@ -24,34 +23,11 @@ export class RdDActorCreatureSheet extends RdDActorSheet { }); } - - /* -------------------------------------------- */ - async getData() { - let formData = await super.getData() - //console.log("Creature : ", formData, formData.system) - formData.calc = { - caracTotal: RdDCarac.computeTotal(formData.system.carac), - resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures), - encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(), - surEncombrementMessage: this.actor.getMessageSurEncombrement() - } - - RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); - this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); - formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs); - - console.log("Creature : ", this.objetVersConteneur, formData); - - return formData; - } - /* -------------------------------------------- */ /** @override */ activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); - // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; diff --git a/module/actor-entite-sheet.js b/module/actor-entite-sheet.js index bdc6e636..4ab81798 100644 --- a/module/actor-entite-sheet.js +++ b/module/actor-entite-sheet.js @@ -1,14 +1,8 @@ -/** - * Extend the basic ActorSheet with some very simple modifications - * @extends {ActorSheet} - */ - +import { RdDActorSheet } from "./actor-sheet.js"; import { HtmlUtility } from "./html-utility.js"; -import { Misc } from "./misc.js"; import { RdDUtility } from "./rdd-utility.js"; -/* -------------------------------------------- */ -export class RdDActorEntiteSheet extends ActorSheet { +export class RdDActorEntiteSheet extends RdDActorSheet { /** @override */ static get defaultOptions() { @@ -22,64 +16,14 @@ export class RdDActorEntiteSheet extends ActorSheet { }); } - - /* -------------------------------------------- */ - async getData() { - let formData = { - title: this.title, - id: this.actor.id, - type: this.actor.type, - img: this.actor.img, - name: this.actor.name, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - system: foundry.utils.deepClone(this.actor.system), - effects: this.actor.effects.map(e => foundry.utils.deepClone(e)), - // items: items, - limited: this.actor.limited, - options: this.options, - owner: this.actor.isOwner, - description: await TextEditor.enrichHTML(this.object.system.description, {async: true}), - notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}), - }; - - formData.options.isGM = game.user.isGM; - RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); - - - return formData; - } - /* -------------------------------------------- */ /** @override */ activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); - // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; - // Update Inventory Item - html.find('.item-edit').click(event => { - const li = $(event.currentTarget).parents(".item"); - const item = this.actor.getEmbeddedDocument('Item', li.data("itemId")); - item.sheet.render(true); - }); - - // Delete Inventory Item - html.find('.item-delete').click(event => { - const li = $(event.currentTarget).parents(".item"); - this.actor.deleteEmbeddedDocuments('Item', [li.data("itemId")]); - li.slideUp(200, () => this.render(false)); - }); - - // Roll Carac - html.find('.carac-label a').click(async event => { - let caracName = event.currentTarget.attributes.name.value; - this.actor.rollCarac( caracName.toLowerCase() ); - }); - // On competence change html.find('.creature-carac').change(async event => { let compName = event.currentTarget.attributes.compname.value; @@ -93,53 +37,6 @@ export class RdDActorEntiteSheet extends ActorSheet { let compName = event.currentTarget.attributes.compname.value; this.actor.updateCreatureCompetence( compName, "dommages", parseInt(event.target.value) ); } ); - - // Roll Skill - html.find('.competence-label a').click(async event => { - let compName = event.currentTarget.text; - this.actor.rollCompetence( compName ); - }); - - html.find('.endurance-plus').click(event => { - this.actor.santeIncDec("endurance", 1); - this.render(true); - }); - html.find('.endurance-moins').click(event => { - this.actor.santeIncDec("endurance", -1); - this.render(true); - }); - - html.find('.encaisser-direct').click(event => { - this.actor.encaisser(); - }); - - html.find('.remise-a-neuf').click(event => { - if (game.user.isGM) { - this.actor.remiseANeuf(); - } - }); - } - - - /* -------------------------------------------- */ - - /** @override */ - setPosition(options = {}) { - const position = super.setPosition(options); - const sheetHeader = this.element.find(".sheet-header"); - const sheetTabs = this.element.find(".sheet-tabs"); - const sheetBody = this.element.find(".sheet-body"); - const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight; - sheetBody.css("height", bodyHeight); - return position; } - - /* -------------------------------------------- */ - - /** @override */ - _updateObject(event, formData) { - // Update the Actor - return this.actor.update(formData); - } } diff --git a/module/actor-sheet.js b/module/actor-sheet.js index 1142e670..9aed24be 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -37,7 +37,7 @@ export class RdDActorSheet extends ActorSheet { /* -------------------------------------------- */ async getData() { this.timerRecherche = undefined; - + let formData = { title: this.title, id: this.actor.id, @@ -51,72 +51,70 @@ export class RdDActorSheet extends ActorSheet { limited: this.actor.limited, options: this.options, owner: this.actor.isOwner, - biographie: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}), - notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}), + description: await TextEditor.enrichHTML(this.object.system.description, {async: true}), + biographie: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}), + notes: await TextEditor.enrichHTML(this.object.system.notes, {async: true}), notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}), + calc: { + encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(), + prixTotalEquipement: this.actor.computePrixTotalEquipement(), + surprise: RdDBonus.find(this.actor.getSurprise(false)).descr, + resumeBlessures: this.actor.computeResumeBlessure(this.actor.system.blessures), + caracTotal: RdDCarac.computeTotal(this.actor.system.carac, this.actor.system.beaute), + surEncombrementMessage: this.actor.getMessageSurEncombrement(), + }, } + formData.options.isGM = game.user.isGM; + RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); - - formData.options.isGM = game.user.isGM; - - if (formData.type == 'creature') return formData; // Shortcut - - formData.byCateg = Misc.classify(formData.competences, it => it.system.categorie) - - formData.calc = { - comptageArchetype: RdDItemCompetence.computeResumeArchetype(formData.competences), - competenceXPTotal: RdDItemCompetence.computeTotalXP(formData.competences), - caracTotal: RdDCarac.computeTotal(formData.system.carac, formData.system.beaute), - // Mise à jour de l'encombrement total et du prix de l'équipement - encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(), - prixTotalEquipement: this.actor.computePrixTotalEquipement(), - surprise: RdDBonus.find(this.actor.getSurprise(false)).descr, - fatigue: RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max), - resumeBlessures: this.actor.computeResumeBlessure(formData.system.blessures), - surEncombrementMessage: this.actor.getMessageSurEncombrement() - }; - - formData.competences.forEach(item => { - item.system.isVisible = this.options.recherche - ? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text) - : (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item)); - RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value); - }); - Object.values(formData.system.carac).forEach(c => { - RdDCarac.levelUp(c); - }); - - - // toujours avoir une liste d'armes (pour mettre esquive et corps à corps) - formData.combat = duplicate(formData.armes ?? []); - RdDItemArme.computeNiveauArmes(formData.combat, formData.competences); - RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac); - formData.esquives = this.actor.getCompetences("Esquive"); - formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac); - - this.armesList = formData.combat; - - // Common data - formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions; - formData.difficultesLibres = CONFIG.RDD.difficultesLibres; - - formData.hautreve = { - isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve), - rencontres: duplicate(formData.system.reve.rencontre.list), - cacheTMR: this.actor.isTMRCache() - } - this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs); - formData.subacteurs = { - vehicules: this.actor.listeVehicules(), - montures: this.actor.listeMontures(), - suivants: this.actor.listeSuivants() - } - if (this.actor.getBestDraconic().system.niveau > -11 && !this.actor.isHautRevant()) { - ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve! -
Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`); + if (formData.type == 'personnage') { + formData.byCateg = Misc.classify(formData.competences, it => it.system.categorie) + formData.calc.comptageArchetype = RdDItemCompetence.computeResumeArchetype(formData.competences); + formData.calc.competenceXPTotal= RdDItemCompetence.computeTotalXP(formData.competences); + formData.calc.fatigue= RdDUtility.calculFatigueHtml(formData.system.sante.fatigue.value, formData.system.sante.endurance.max); + + formData.competences.forEach(item => { + item.system.isVisible = this.options.recherche + ? RdDItemCompetence.nomContientTexte(item, this.options.recherche.text) + : (!this.options.showCompNiveauBase || !RdDItemCompetence.isNiveauBase(item)); + RdDItemCompetence.levelUp(item, formData.system.compteurs.experience.value); + }); + + Object.values(formData.system.carac).forEach(c => { + RdDCarac.levelUp(c); + }); + + // toujours avoir une liste d'armes (pour mettre esquive et corps à corps) + formData.combat = duplicate(formData.armes ?? []); + RdDItemArme.computeNiveauArmes(formData.combat, formData.competences); + RdDItemArme.ajoutCorpsACorps(formData.combat, formData.competences, formData.system.carac); + formData.esquives = this.actor.getCompetences("Esquive"); + formData.combat = RdDCombatManager.listActionsArmes(formData.combat, formData.competences, formData.system.carac); + + this.armesList = formData.combat; + + // Common data + formData.ajustementsConditions = CONFIG.RDD.ajustementsConditions; + formData.difficultesLibres = CONFIG.RDD.difficultesLibres; + + formData.hautreve = { + isDemiReve: this.actor.getEffect(STATUSES.StatusDemiReve), + rencontres: duplicate(formData.system.reve.rencontre.list), + cacheTMR: this.actor.isTMRCache() + } + + formData.subacteurs = { + vehicules: this.actor.listeVehicules(), + montures: this.actor.listeMontures(), + suivants: this.actor.listeSuivants() + } + if (this.actor.getBestDraconic().system.niveau > -11 && !this.actor.isHautRevant()) { + ui.notifications.error(`${this.actor.name} a des compétences draconiques, mais pas le don de Haut-Rêve! +
Ajoutez-lui la tête "Don de Haut-Rêve" pour lui permettre d'utiliser ses compétences et d'accéder aux terres médianes du rêve`); + } } return formData; } @@ -156,7 +154,6 @@ export class RdDActorSheet extends ActorSheet { activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); HtmlUtility._showControlWhen($(".appliquerFatigue"), ReglesOptionelles.isUsing("appliquer-fatigue")); // Everything below here is only needed if the sheet is editable @@ -168,7 +165,6 @@ export class RdDActorSheet extends ActorSheet { }); html.find('.item-edit').click(async event => { const item = RdDSheetUtility.getItem(event, this.actor) - console.log("ITEM :", item) item.sheet.render(true) }) html.find('.display-label a').click(async event => { @@ -497,7 +493,7 @@ export class RdDActorSheet extends ActorSheet { html.find('.moral-heureux').click(async event => { this.actor.jetDeMoral('heureuse'); }); - html.find('#ethylisme-test').click(async event => { + html.find('.ethylisme-test').click(async event => { this.actor.jetEthylisme(); }); @@ -570,7 +566,10 @@ export class RdDActorSheet extends ActorSheet { const sheetHeader = this.element.find(".sheet-header"); const sheetTabs = this.element.find(".sheet-tabs"); const sheetBody = this.element.find(".sheet-body"); - const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight; + let bodyHeight = position.height - sheetHeader[0].clientHeight; + if (sheetTabs.length>0) { + bodyHeight -= sheetTabs[0].clientHeight; + } sheetBody.css("height", bodyHeight); return position; } diff --git a/module/actor-vehicule-sheet.js b/module/actor-vehicule-sheet.js index b2305320..aa7df7c3 100644 --- a/module/actor-vehicule-sheet.js +++ b/module/actor-vehicule-sheet.js @@ -1,15 +1,9 @@ -/** - * Extend the basic ActorSheet with some very simple modifications - * @extends {ActorSheet} - */ - import { RdDUtility } from "./rdd-utility.js"; -import { HtmlUtility } from "./html-utility.js"; -import { Misc } from "./misc.js"; import { RdDSheetUtility } from "./rdd-sheet-utility.js"; +import { RdDActorSheet } from "./actor-sheet.js"; /* -------------------------------------------- */ -export class RdDActorVehiculeSheet extends ActorSheet { +export class RdDActorVehiculeSheet extends RdDActorSheet { /** @override */ static get defaultOptions() { @@ -25,142 +19,5 @@ export class RdDActorVehiculeSheet extends ActorSheet { }); } - /* -------------------------------------------- */ - async getData() { - let formData = { - title: this.title, - id: this.actor.id, - type: this.actor.type, - img: this.actor.img, - name: this.actor.name, - editable: this.isEditable, - cssClass: this.isEditable ? "editable" : "locked", - system: foundry.utils.deepClone(this.actor.system), - effects: this.actor.effects.map(e => foundry.utils.deepClone(e)), - limited: this.actor.limited, - options: this.options, - owner: this.actor.isOwner, - description: await TextEditor.enrichHTML(this.object.system.biographie, {async: true}), - notesmj: await TextEditor.enrichHTML(this.object.system.notesmj, {async: true}), - }; - RdDUtility.filterItemsPerTypeForSheet(formData, this.actor.itemTypes); - this.objetVersConteneur = RdDUtility.buildArbreDeConteneurs(formData.conteneurs, formData.objets); - formData.conteneurs = RdDUtility.conteneursRacine(formData.conteneurs); - - formData.options.isGM = game.user.isGM; - - formData.calc = { - encTotal: await this.actor.computeEncombrementTotalEtMalusArmure(), - surEncombrementMessage: this.actor.getMessageSurEncombrement() - } - - console.log("DATA", formData); - - return formData; - } - - async computeMalusArmure() { - // pas de malus armure - } - /* -------------------------------------------- */ - async _onDropItem(event, dragData) { - const destItemId = $(event.target)?.closest('.item').attr('data-item-id'); - const dropParams = RdDSheetUtility.prepareItemDropParameters(destItemId, this.actor.id, dragData, this.objetVersConteneur); - const callSuper = await this.actor.processDropItem(dropParams); - if (callSuper) { - await super._onDropItem(event, dragData) - } - } - - /* -------------------------------------------- */ - async createItem(name, type) { - await this.actor.createEmbeddedDocuments('Item', [{ name: name, type: type }], { renderSheet: true }); - } - - /* -------------------------------------------- */ - async monnaieIncDec(id, value) { - let monnaie = this.getMonnaie(id); - if (monnaie) { - const quantite = Math.max(0, monnaie.system.quantite + value); - await this.updateEmbeddedDocuments('Item', [{ _id: monnaie.id, 'data.quantite': quantite }]); - } - } - - /* -------------------------------------------- */ - /** @override */ - activateListeners(html) { - super.activateListeners(html); - - HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); - - // Everything below here is only needed if the sheet is editable - if (!this.options.editable) return; - - // Update Inventory Item - html.find('.item-edit').click(async event => { - const item = RdDSheetUtility.getItem(event, this.actor); - item.sheet.render(true); - }); - // Delete Inventory Item - html.find('.item-delete').click(async event => { - const li = RdDSheetUtility.getEventElement(event); - const item = this.actor.getObjet(li.data("item-id")); - RdDUtility.confirmerSuppressionItem(this, item, li); - }); - html.find('.item-vendre').click(async event => { - const item = RdDSheetUtility.getItem(event, this.actor); - item?.proposerVente(); - }); - html.find('.item-montrer').click(async event => { - const item = RdDSheetUtility.getItem(event, this.actor); - item?.postItem(); - }); - - html.find('.item-action').click(async event => { - const item = RdDSheetUtility.getItem(event, this.actor); - this.actor.actionItem(item); - }); - - html.find('.creer-un-objet').click(async event => { - RdDUtility.selectObjetType(this); - }); - html.find('.nettoyer-conteneurs').click(async event => { - this.actor.nettoyerConteneurs(); - }); - - html.find('.monnaie-plus').click(async event => { - this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), 1); - }); - html.find('.monnaie-moins').click(async event => { - this.actor.monnaieIncDec(RdDSheetUtility.getItemId(event), -1); - }); - - // Display info about queue - html.find('.conteneur-name a').click((event) => { - RdDUtility.toggleAfficheContenu(RdDSheetUtility.getItemId(event)); - this.render(true); - }); - - } - - /* -------------------------------------------- */ - /** @override */ - setPosition(options = {}) { - const position = super.setPosition(options); - const sheetHeader = this.element.find(".sheet-header"); - const sheetTabs = this.element.find(".sheet-tabs"); - const sheetBody = this.element.find(".sheet-body"); - const bodyHeight = position.height - sheetHeader[0].clientHeight - sheetTabs[0].clientHeight; - sheetBody.css("height", bodyHeight); - return position; - } - - - /* -------------------------------------------- */ - /** @override */ - _updateObject(event, formData) { - // Update the Actor - return this.actor.update(formData); - } } diff --git a/module/actor.js b/module/actor.js index 47d9f374..bcd34914 100644 --- a/module/actor.js +++ b/module/actor.js @@ -179,7 +179,6 @@ export class RdDActor extends Actor { this.computeIsHautRevant(); await this.cleanupConteneurs(); await this.computeEncombrementTotalEtMalusArmure(); - this.computePrixTotalEquipement(); this.computeEtatGeneral(); // Sanity check await this.checkMonnaiePresence(); @@ -1359,14 +1358,15 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async computeMalusArmure() { - const newMalusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe) + if (this.isPersonnage()) { + const malusArmure = this.filterItems(it => it.type == 'armure' && it.system.equipe) .map(it => it.system.malus ?? 0) .reduce(Misc.sum(), 0); - // Mise à jour éventuelle du malus armure - if (this.system.attributs?.malusarmure?.value != newMalusArmure) { - await this.updateAttributeValue("malusarmure", newMalusArmure); + // Mise à jour éventuelle du malus armure + if (this.system.attributs?.malusarmure?.value != malusArmure) { + await this.updateAttributeValue("malusarmure", malusArmure); + } } - return newMalusArmure; } /* -------------------------------------------- */ @@ -2557,11 +2557,13 @@ export class RdDActor extends Actor { if (rollData.competence.system.iscombat) { if (rollData.competence.system.ispossession) { RdDPossession.onAttaquePossession(this, rollData.competence) - } else { + return + } + else if (RdDCombat.getTarget()) { const arme = RdDItemCompetenceCreature.toActionArme(rollData.competence) RdDCombat.createUsingTarget(this)?.attaque(competence, arme) + return } - return } // Fake competence pour créature RdDItemCompetenceCreature.setRollDataCreature(rollData) @@ -3270,7 +3272,6 @@ export class RdDActor extends Actor { let update = { _id: item.id, "system.equipe": isEquipe }; await this.updateEmbeddedDocuments('Item', [update]); this.computeEncombrementTotalEtMalusArmure(); // Mise à jour encombrement - this.computePrixTotalEquipement(); // Mis à jour du prix total de l'équipement if (isEquipe) this.verifierForceMin(item); } diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index 834c0d7f..ffeb129d 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -534,9 +534,7 @@ export class RdDCalendrier extends Application { async activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); - - await this.updateDisplay(); + this.updateDisplay(); html.find('.calendar-btn').click(ev => this.onCalendarButton(ev)); diff --git a/module/rdd-carac.js b/module/rdd-carac.js index daff7567..252094bc 100644 --- a/module/rdd-carac.js +++ b/module/rdd-carac.js @@ -62,7 +62,7 @@ export class RdDCarac { static computeTotal(carac, beaute = undefined) { - const total = Object.values(carac).filter(c => !c.derivee) + const total = Object.values(carac ?? {}).filter(c => !c.derivee) .map(it => parseInt(it.value)) .reduce(Misc.sum(), 0); const beauteSuperieur10 = Math.max((beaute ?? 10) - 10, 0); diff --git a/module/rdd-sheet-utility.js b/module/rdd-sheet-utility.js index 9f52b7b6..15dc98e0 100644 --- a/module/rdd-sheet-utility.js +++ b/module/rdd-sheet-utility.js @@ -1,5 +1,4 @@ import { DialogSplitItem } from "./dialog-split-item.js"; -import { Misc } from "./misc.js"; export class RdDSheetUtility { diff --git a/module/rdd-utility.js b/module/rdd-utility.js index 997e5c33..1d3632dc 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -112,14 +112,28 @@ export class RdDUtility { static async preloadHandlebarsTemplates() { const templatePaths = [ //Character Sheets + 'systems/foundryvtt-reve-de-dragon/templates/actor-creation-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-creature-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-entite-sheet.html', 'systems/foundryvtt-reve-de-dragon/templates/actor-vehicule-sheet.html', // sous-parties de feuilles de personnages + 'systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/competence.html', - 'systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html', - 'systems/foundryvtt-reve-de-dragon/templates/actor/effects.html', + 'systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/combat.html', 'systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html', diff --git a/styles/simple.css b/styles/simple.css index 40fae084..816b58cf 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -93,7 +93,7 @@ .sheet nav.sheet-tabs { font-family: "CaslonAntique"; } /* For nav and title */ -.window-app input, .foundryvtt-reve-de-dragon .item-form, .sheet header.sheet-header .flex-group-center.flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle { +.window-app input, .foundryvtt-reve-de-dragon .item-form, .sheet header.sheet-header .flex-compteurs, .sheet header.sheet-header .flex-group-center.flex-fatigue, select, button, .item-checkbox, #sidebar, #players, #navigation #nav-toggle { font-family: "CaslonAntique"; /* For sheet parts */ } @@ -332,9 +332,9 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) { } .button-img { vertical-align: baseline; - width: 8%; - height: 8%; - max-height: 48px; + width: 32px; + height: 32px; + max-height: 36px; border-width: 0; border: 1px solid rgba(0, 0, 0, 0); } @@ -409,10 +409,11 @@ input:is(.blessure-premiers_soins, .blessure-soins_complets) { flex-wrap: nowrap; justify-content: stretch; } -.rdd.sheet .window-content .sheet-body .carac-list .caracteristique.vehicle { +.rdd.sheet .window-content .sheet-body .carac-list .caracteristique.streched { flex-wrap: nowrap; justify-content: stretch; flex-basis: 7.5em; + width: max-content; } .rdd.sheet .window-content .sheet-body .carac-list .caracteristique > .carac-label { @@ -638,7 +639,14 @@ section.sheet-body{padding: 0.25rem 0.5rem;} margin: 0.5rem 0 0.5rem 0.5rem; padding: 0; } - +.sheet header.sheet-header h1 { + flex: 3; +} +.sheet header.sheet-header img.button-img{ + height: 48px; + padding: 1px; + margin: 1px; +} .sheet nav.sheet-tabs { font-size: 0.65rem; font-weight: bold; @@ -680,9 +688,13 @@ section.sheet-body:after { clear: both; } -.sheet header.sheet-header .flex-compteurs {text-align: right;} +.sheet header.sheet-header .flex-compteurs { text-align: right; max-width: max-content;} .sheet header.sheet-header .resource-content {width: 2rem;} +li label.compteur { + display: inline-block; + flex-direction: row; +} .compteur span { display: inline-block; text-align: left; diff --git a/template.json b/template.json index aac793e0..2f567bc6 100644 --- a/template.json +++ b/template.json @@ -238,7 +238,7 @@ } } }, - "common": { + "personnage": { "carac": { "taille": { "type": "number", @@ -574,7 +574,7 @@ } }, "personnage": { - "templates": [ "background", "common", "subacteurs" ] + "templates": [ "personnage", "background", "subacteurs" ] }, "creature": { "templates": [ "creature", "description" ] diff --git a/templates/actor-creature-sheet.html b/templates/actor-creature-sheet.html index 5c431c70..e2381427 100644 --- a/templates/actor-creature-sheet.html +++ b/templates/actor-creature-sheet.html @@ -2,33 +2,33 @@ {{!-- Sheet Header --}}
-
-

-
-
-
+ +

+
Encaisser des dommages - Remise à neuf + {{#if @root.options.isGM}} + Remise à neuf + {{/if}}
-
-
- {{calc.resumeBlessures}} +
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-creature.html"}} +
+ + {{calc.resumeBlessures}} + ‐ Etat Général : {{system.compteurs.etat.value}} + + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
-
- {{>"systems/foundryvtt-reve-de-dragon/templates/actor/effects.html"}} -
-
+
{{!-- Sheet Tab Navigation --}} @@ -36,91 +36,21 @@ {{!-- Sheet Body --}}
- {{!-- Carac Tab --}} + {{!-- Carac & compétences --}}
+
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}} +
-
    - {{#each system.carac as |carac key|}} -
  1. - {{#if (eq key 'taille')}} - {{carac.label}} - {{else}} - {{carac.label}} - {{/if}} - -
  2. - {{/each}} -
  3. - Total Caractéristiques - {{calc.caracTotal}} -
  4. -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-creature.html"}}
-
-
    - {{#each system.attributs as |attr key|}} -
  1. - {{attr.label}} - -
  2. - {{/each}} -
  3. - Vie - - / - - -
  4. -
  5. - Endurance - - / - - -
  6. -
  7. - Etat Général - -
  8. -
-
-
-
- - {{!-- Compétences Tab --}} -
-
-
    - {{#each competences as |comp key|}} -
  1. - - - {{comp.name}} - - - - -
    - - -
    -
  2. - {{/each}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html"}}
-
- {{!-- blessures Tab --}} -
- {{!-- Liste de blessures --}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/blessures.html"}}
diff --git a/templates/actor-entite-sheet.html b/templates/actor-entite-sheet.html index 98175932..f2af78d4 100644 --- a/templates/actor-entite-sheet.html +++ b/templates/actor-entite-sheet.html @@ -2,138 +2,48 @@ {{!-- Sheet Header --}}
-
+

-
-
-
+
Encaisser des dommages - Remise à neuf + {{#if @root.options.isGM}} + Remise à neuf + {{/if}}
+
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs-entitee.html"}} +
- {{!-- Sheet Tab Navigation --}} - - {{!-- Sheet Body --}}
{{!-- Carac Tab --}} -
- +
+
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}} +
-
    - {{#each system.carac as |carac key|}} -
  1. - {{#if (eq key 'taille')}} - {{carac.label}} - {{else}} - {{carac.label}} - {{/if}} - -
  2. - {{/each}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-entitee.html"}}
- -
- -
    -
  1. - Catégorie : - -
  2. -
  3. - Type d'entité : - -
  4. - {{#each system.attributs as |attr key|}} -
  5. - {{attr.label}} : - -
  6. - {{/each}} -
  7. - Endurance : - / - -
  8. -
+
+
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-creature.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/comp-possession.html"}} +
-
- - {{!-- Compétences Tab --}} -
-
-
-
    - {{#each competences as |comp key|}} -
  1. - - {{comp.name}} - - - -
    - - -
    -
  2. - {{/each}} -
-
-
-
    - {{#each possessions as |possession key|}} -
  1. - - {{possession.name}} -
    - - -
    -
  2. - {{/each}} -
-
-
-
- - {{!-- Biography Tab --}} -
{{editor description target="system.description" button=true owner=owner editable=true}}
{{>"systems/foundryvtt-reve-de-dragon/templates/actor/editor-notes-mj.html"}} +
diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 2ccf71e7..6b729301 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -8,70 +8,11 @@

- -
-
- Appel à la chance - Encaisser des dommages - Se reposer - {{#if system.attributs.hautrevant.value}} - Montée dans les Terres Médianes ! - Montée accélérée dans les Terres Médianes ! - Regarder les Terres Médianes - {{/if}} - Remise à neuf -
-
- Malus de fatigue : {{calc.fatigue.malus}} - {{{calc.fatigue.html}}} - - {{calc.resumeBlessures}} -
-
- {{system.compteurs.etat.label}}: {{system.compteurs.etat.value}} - {{system.compteurs.surenc.label}}: {{system.compteurs.surenc.value}} -
-
- {{>"systems/foundryvtt-reve-de-dragon/templates/actor/effects.html"}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-compteurs.html"}} +
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-buttons.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-etat.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/header-effects.html"}}
@@ -86,129 +27,27 @@ Haut-Rêve Équipement Description - - - {{!-- Sheet Body --}} -
- + + + {{!-- Sheet Body --}} +
+ {{!-- Carac Tab --}}
- - - {{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}} - + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}}
-
    - {{#each system.carac as |carac key|}} - {{#if carac.isLevelUp}} -
  • - {{else}} -
  • - {{/if}} - {{#if (eq key 'taille')}} - {{carac.label}} - -
  • - {{/each}} -
  • - Total Caractéristiques - {{calc.caracTotal}} -
  • -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-main.html"}} + {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-total.html"}}
-
    -
  • - Beauté : - -
  • - {{#each system.attributs as |attr key|}} - {{#unless (eq key 'hautrevant')}} -
  • - {{attr.label}} : - {{#if (eq key 'protection')}} - - {{else}} - - {{/if}} -
  • - {{/unless}} - {{/each}} -
-
    -
  • - Chance actuelle - -
  • - {{#each system.compteurs as |compteur key|}} - {{#if (eq compteur.label 'Chance')}} - {{else if (eq compteur.label 'Experience')}} - {{else if compteur.isInput}} -
  • - {{compteur.label}} - {{#if (eq compteur.label 'Ethylisme')}} - - {{else}} - - {{/if}} - - {{#if compteur.isStress}} - Transformer - {{else if (eq compteur.label 'Ethylisme')}} - Boire - {{else if (eq compteur.label 'Moral')}} - Jet de moral situation malheureuse - Jet de moral situation neutre - Jet de moral situation heureuse - {{else}} - - {{/if}} - -
  • - {{/if}} - {{/each}} -
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/carac-derivee.html"}}
- + {{!-- Compétences Tab --}}
@@ -230,18 +69,18 @@
- {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.generale) categorie="Compétences générales"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.particuliere) categorie="Compétences Particulières"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.specialisee) categorie="Compétences Spécialisées"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.generale) categorie="Compétences générales"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.particuliere) categorie="Compétences Particulières"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.specialisee) categorie="Compétences Spécialisées"}}
- {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.melee) categorie="Compétences de Mêlée"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.tir) categorie="Compétences de Tir"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.lancer) categorie="Compétences de Lancer"}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.connaissance) categorie="Connaissances"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.melee) categorie="Compétences de Mêlée"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.tir) categorie="Compétences de Tir"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.lancer) categorie="Compétences de Lancer"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.connaissance) categorie="Connaissances"}} {{#if (or system.attributs.hautrevant.value options.vueDetaillee)}} - {{> "systems/foundryvtt-reve-de-dragon/templates/actor/categorie-competences.html" competences=(filtreTriCompetences byCateg.draconic) categorie="Draconic"}} + {{> "systems/foundryvtt-reve-de-dragon/templates/actor/competence-categorie.html" competences=(filtreTriCompetences byCateg.draconic) categorie="Draconic"}} {{/if}} {{> "systems/foundryvtt-reve-de-dragon/templates/actor/xp-competences.html"}}
diff --git a/templates/actor-vehicule-sheet.html b/templates/actor-vehicule-sheet.html index 1adada6c..54b94948 100644 --- a/templates/actor-vehicule-sheet.html +++ b/templates/actor-vehicule-sheet.html @@ -22,48 +22,51 @@ {{!-- Carac Tab --}}
+
+ {{>"systems/foundryvtt-reve-de-dragon/templates/actor/vue-detaillee.html"}} +
    -
  1. +
  2. Catégorie - {{#select system.categorie}} {{>"systems/foundryvtt-reve-de-dragon/templates/enum-categorie-vehicule.html"}} {{/select}}
  3. -
  4. +
  5. Résistance - + / - +
  6. -
  7. +
  8. Structure - + / - +
  9. -
  10. +
  11. Vitesse - +
  12. -
  13. - Bonus - +
  14. + Bonus rames +
  15. -
  16. +
  17. Manoeuvrabilité - +
  18. -
  19. +
  20. Equipage - +
  21. -
  22. +
  23. Capacité d'Encombrement - +
diff --git a/templates/actor/carac-creature.html b/templates/actor/carac-creature.html new file mode 100644 index 00000000..34905034 --- /dev/null +++ b/templates/actor/carac-creature.html @@ -0,0 +1,8 @@ +
    + {{#each system.attributs as |attr key|}} +
  1. + {{attr.label}} + +
  2. + {{/each}} +
diff --git a/templates/actor/carac-derivee.html b/templates/actor/carac-derivee.html new file mode 100644 index 00000000..430a674d --- /dev/null +++ b/templates/actor/carac-derivee.html @@ -0,0 +1,55 @@ +
    +
  • + Beauté : + +
  • + {{#each system.attributs as |attr key|}} + {{#unless (eq key 'hautrevant')}} +
  • + {{attr.label}} : + {{#if (eq key 'protection')}} + + {{else}} + + {{/if}} +
  • + {{/unless}} + {{/each}} +
+
    +
  • + Chance actuelle + +
  • + {{#each system.compteurs as |compteur key|}} + {{#if (eq compteur.label 'Chance')}} + {{else if (eq compteur.label 'Experience')}} + {{else if compteur.isInput}} +
  • + {{compteur.label}} + {{#if (eq compteur.label 'Ethylisme')}} + + {{else}} + + {{/if}} + + {{#if compteur.isStress}} + Transformer + {{else if (eq compteur.label 'Moral')}} + Jet de moral situation malheureuse + Jet de moral situation neutre + Jet de moral situation heureuse + {{else}} + + {{/if}} + +
  • + {{/if}} + {{/each}} +
diff --git a/templates/actor/carac-entitee.html b/templates/actor/carac-entitee.html new file mode 100644 index 00000000..53bde06d --- /dev/null +++ b/templates/actor/carac-entitee.html @@ -0,0 +1,28 @@ +{{log 'entitee.system' system}} +
    +
  1. + Catégorie : + +
  2. +
  3. + Type d'entité : + +
  4. + {{#each system.attributs as |attr key|}} +
  5. + {{attr.label}} : + +
  6. + {{/each}} +
\ No newline at end of file diff --git a/templates/actor/carac-main.html b/templates/actor/carac-main.html new file mode 100644 index 00000000..d3fb3aaa --- /dev/null +++ b/templates/actor/carac-main.html @@ -0,0 +1,41 @@ +
    + {{#each system.carac as |carac key|}} + {{#if carac.isLevelUp}} +
  • + {{else}} +
  • + {{/if}} + {{#if (eq key 'taille')}} + {{carac.label}} + +
  • + {{/each}} +
diff --git a/templates/actor/carac-total.html b/templates/actor/carac-total.html new file mode 100644 index 00000000..b560bead --- /dev/null +++ b/templates/actor/carac-total.html @@ -0,0 +1,6 @@ +
    +
  • + Total Caractéristiques + {{calc.caracTotal}} +
  • +
diff --git a/templates/actor/comp-creature.html b/templates/actor/comp-creature.html new file mode 100644 index 00000000..c33df660 --- /dev/null +++ b/templates/actor/comp-creature.html @@ -0,0 +1,26 @@ +
    + {{#each competences as |comp key|}} +
  1. + + + {{comp.name}} + + + + + + {{#if @root.options.vueDetaillee}} +
    + + +
    + {{/if}} +
  2. + {{/each}} +
diff --git a/templates/actor/comp-possession.html b/templates/actor/comp-possession.html new file mode 100644 index 00000000..0464b1df --- /dev/null +++ b/templates/actor/comp-possession.html @@ -0,0 +1,16 @@ +{{#if possessions}} +
+
    + {{#each possessions as |possession key|}} +
  1. + + {{possession.name}} +
    + + +
    +
  2. + {{/each}} +
+
+{{/if}} diff --git a/templates/actor/categorie-competences.html b/templates/actor/competence-categorie.html similarity index 100% rename from templates/actor/categorie-competences.html rename to templates/actor/competence-categorie.html diff --git a/templates/actor/competence.html b/templates/actor/competence.html index f460ef6a..85e6ab21 100644 --- a/templates/actor/competence.html +++ b/templates/actor/competence.html @@ -2,7 +2,7 @@
  • - {{name}} + {{name}} {{#if system.isLevelUp}} diff --git a/templates/actor/effects.html b/templates/actor/effects.html deleted file mode 100644 index 67a93101..00000000 --- a/templates/actor/effects.html +++ /dev/null @@ -1,13 +0,0 @@ -{{#if calc.surprise}}{{calc.surprise}}! {{/if}} -{{#if effects}} -{{#each effects as |effect key|}} - - {{localize effect.label}} - -{{/each}} -{{#if options.isGM}} -(enlever tout) -{{/if}} -{{else}} -Aucun effet actif -{{/if}} diff --git a/templates/actor/header-buttons.html b/templates/actor/header-buttons.html new file mode 100644 index 00000000..6574f54c --- /dev/null +++ b/templates/actor/header-buttons.html @@ -0,0 +1,28 @@ +
    + + Appel à la chance + + + Encaisser des dommages + + + Boire + + + Se reposer + + {{#if system.attributs.hautrevant.value}} + + Montée dans les Terres Médianes ! + + Montée accélérée dans les Terres Médianes ! + + Regarder les Terres Médianes + + {{/if}} + {{#if @root.options.isGM}} + + Remise à neuf + + {{/if}} +
    diff --git a/templates/actor/header-compteurs-creature.html b/templates/actor/header-compteurs-creature.html new file mode 100644 index 00000000..3c10a471 --- /dev/null +++ b/templates/actor/header-compteurs-creature.html @@ -0,0 +1,24 @@ +
      +
    • + +
    • +
    • + +
    • +
    diff --git a/templates/actor/header-compteurs-entitee.html b/templates/actor/header-compteurs-entitee.html new file mode 100644 index 00000000..a94bf680 --- /dev/null +++ b/templates/actor/header-compteurs-entitee.html @@ -0,0 +1,13 @@ +{{#if (eq system.definition.typeentite 'incarne')}} +
  • + +
  • +{{/if}} diff --git a/templates/actor/header-compteurs.html b/templates/actor/header-compteurs.html new file mode 100644 index 00000000..dbf6750b --- /dev/null +++ b/templates/actor/header-compteurs.html @@ -0,0 +1,39 @@ +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    diff --git a/templates/actor/header-effects.html b/templates/actor/header-effects.html new file mode 100644 index 00000000..b7c8288f --- /dev/null +++ b/templates/actor/header-effects.html @@ -0,0 +1,17 @@ +
    + {{#if calc.surprise}}{{calc.surprise}}! {{/if}} + {{#if effects}} + + {{#each effects as |effect key|}} + + {{localize effect.label}} + + {{/each}} + + {{#if options.isGM}} + (enlever tout) + {{/if}} + {{else}} + Aucun effet actif + {{/if}} +
    diff --git a/templates/actor/header-etat.html b/templates/actor/header-etat.html new file mode 100644 index 00000000..24dec49b --- /dev/null +++ b/templates/actor/header-etat.html @@ -0,0 +1,10 @@ +
    + Malus de fatigue : {{calc.fatigue.malus}} + {{{calc.fatigue.html}}} + + {{calc.resumeBlessures}} +
    +
    + {{system.compteurs.etat.label}}: {{system.compteurs.etat.value}} + {{system.compteurs.surenc.label}}: {{system.compteurs.surenc.value}} +
    diff --git a/templates/actor/vue-detaillee.html b/templates/actor/vue-detaillee.html new file mode 100644 index 00000000..e4b5ca05 --- /dev/null +++ b/templates/actor/vue-detaillee.html @@ -0,0 +1,4 @@ + + + {{#if options.vueDetaillee}}Vue simplifiée{{else}}Vue détaillée{{/if}} +