diff --git a/assets/icons/aventurier.webp b/assets/icons/aventurier.webp new file mode 100644 index 0000000..04c36a8 Binary files /dev/null and b/assets/icons/aventurier.webp differ diff --git a/assets/icons/combattant.webp b/assets/icons/combattant.webp new file mode 100644 index 0000000..378b56f Binary files /dev/null and b/assets/icons/combattant.webp differ diff --git a/assets/icons/erudit.webp b/assets/icons/erudit.webp new file mode 100644 index 0000000..9527607 Binary files /dev/null and b/assets/icons/erudit.webp differ diff --git a/assets/icons/gentleman.webp b/assets/icons/gentleman.webp new file mode 100644 index 0000000..8313126 Binary files /dev/null and b/assets/icons/gentleman.webp differ diff --git a/assets/icons/profil.webp b/assets/icons/profil.webp new file mode 100644 index 0000000..0de53c4 Binary files /dev/null and b/assets/icons/profil.webp differ diff --git a/assets/icons/roublard.webp b/assets/icons/roublard.webp new file mode 100644 index 0000000..c820e57 Binary files /dev/null and b/assets/icons/roublard.webp differ diff --git a/modules/heritiers-actor-sheet.js b/modules/heritiers-actor-sheet.js index d508b10..2ba8f28 100644 --- a/modules/heritiers-actor-sheet.js +++ b/modules/heritiers-actor-sheet.js @@ -40,6 +40,7 @@ export class HeritiersActorSheet extends ActorSheet { skills: this.actor.getSkills(), utileSkills :this.actor.organizeUtileSkills(), futileSkills :this.actor.organizeFutileSkills(), + contacts: this.actor.organizeContacts(), armes: duplicate(this.actor.getWeapons()), monnaies: duplicate(this.actor.getMonnaies()), fee: duplicate(this.actor.getFee() || {} ), @@ -50,9 +51,13 @@ export class HeritiersActorSheet extends ActorSheet { atouts: duplicate(this.actor.getAtouts()), capacites: duplicate(this.actor.getCapacites()), desavantages: duplicate(this.actor.getDesavantages()), + profils: duplicate(this.actor.getProfils()), pvMalus: this.actor.getPvMalus(), initiative: this.actor.getFlag("world", "last-initiative") || -1, description: await TextEditor.enrichHTML(this.object.system.biodata.description, {async: true}), + revesetranges: await TextEditor.enrichHTML(this.object.system.biodata.revesetranges, {async: true}), + secretsdecouverts: await TextEditor.enrichHTML(this.object.system.biodata.secretsdecouverts, {async: true}), + questions: await TextEditor.enrichHTML(this.object.system.biodata.questions, {async: true}), habitat: await TextEditor.enrichHTML(this.object.system.biodata.habitat, {async: true}), options: this.options, owner: this.document.isOwner, diff --git a/modules/heritiers-actor.js b/modules/heritiers-actor.js index a6334eb..0649b05 100644 --- a/modules/heritiers-actor.js +++ b/modules/heritiers-actor.js @@ -104,7 +104,7 @@ export class HeritiersActor extends Actor { /* ----------------------- --------------------- */ getEquipments() { - return this.items.filter(item => item.type == "equipement") + return this.items.filter(item => item.type == "equipement" || item.type == "accessoire") } getAvantages() { return this.items.filter(item => item.type == "avantage") @@ -133,6 +133,9 @@ export class HeritiersActor extends Actor { getFee() { return this.items.find(item => item.type == "fee") } + getProfils() { + return this.items.filter(item => item.type == "profil") + } /* -------------------------------------------- */ getSkills() { let comp = [] @@ -145,6 +148,18 @@ export class HeritiersActor extends Actor { return HeritiersUtility.sortByName(comp) } + /* -------------------------------------------- */ + prepareUtileSkill(item) { + let specList = [] + if (item.system.categorie == "utile") { + for (let spec of item.system.specialites) { + specList.push(spec.name) + } + } + item.nbSpec = specList.length + item.specList = specList.toString() + } + /* -------------------------------------------- */ organizeUtileSkills() { let comp = {} @@ -154,12 +169,25 @@ export class HeritiersActor extends Actor { for (let item of this.items) { if (item.type == "competence") { if (item.system.categorie == "utile") { + this.prepareUtileSkill(item) comp[item.system.profil].push(item) } } } return comp } + /* -------------------------------------------- */ + organizeContacts( ) { + let contactList = {} + for (let item of this.items) { + if (item.type == "contact") { + let c = contactList[item.system.contacttype] || { label: game.system.lesheritiers.config.contactType[item.system.contacttype], list: [] } + c.list.push( item ) + contactList[item.system.contacttype] = c + } + } + return contactList + } /* -------------------------------------------- */ organizeFutileSkills() { @@ -463,15 +491,18 @@ export class HeritiersActor extends Actor { rollData.tricherie = this.getTricherie() rollData.heritage = this.getHeritages() rollData.useTricherie = false + rollData.useSpecialite = false rollData.useHeritage = false rollData.pvMalus = this.getPvMalus() if (compId) { rollData.competence = duplicate(this.items.get(compId) || {}) + this.prepareUtileSkill(rollData.competence) rollData.actionImg = rollData.competence?.img } if (compName) { rollData.competence = duplicate(this.items.find(item => item.name.toLowerCase() == compName.toLowerCase()) || {}) + this.prepareUtileSkill(rollData.competence) rollData.actionImg = rollData.competence?.img } return rollData diff --git a/modules/heritiers-config.js b/modules/heritiers-config.js index 484ba1b..fc72f30 100644 --- a/modules/heritiers-config.js +++ b/modules/heritiers-config.js @@ -16,6 +16,13 @@ export const HERITIERS_CONFIG = { "utile": "Utile", "futile": "Futile" }, + + contactType: { + contact: "Contact", + allie: "Allié", + ennemi: "Ennemi", + interet: "Personne d'interêt" + }, competenceProfil : { "aventurier": "Aventurier", diff --git a/modules/heritiers-item.js b/modules/heritiers-item.js index fbd4a96..cc4e3a9 100644 --- a/modules/heritiers-item.js +++ b/modules/heritiers-item.js @@ -15,8 +15,8 @@ export const defaultItemImg = { arme: "systems/fvtt-les-heritiers/assets/icons/weapon.webp", accessoire: "systems/fvtt-les-heritiers/assets/icons/item.webp", protection: "systems/fvtt-les-heritiers/assets/icons/armor.webp", - fee: "systems/fvtt-les-heritiers/assets/icons/faery_type.webp" - + fee: "systems/fvtt-les-heritiers/assets/icons/faery_type.webp", + profil: "systems/fvtt-les-heritiers/assets/icons/profil.webp" } /** diff --git a/modules/heritiers-roll-dialog.js b/modules/heritiers-roll-dialog.js index 4a4241a..2c1d034 100644 --- a/modules/heritiers-roll-dialog.js +++ b/modules/heritiers-roll-dialog.js @@ -90,6 +90,9 @@ export class HeritiersRollDialog extends Dialog { html.find('#useTricherie').change((event) => { this.rollData.useTricherie = event.currentTarget.checked }) + html.find('#useSpecialite').change((event) => { + this.rollData.useSpecialite = event.currentTarget.checked + }) html.find('#useHeritage').change((event) => { this.rollData.useHeritage = event.currentTarget.checked }) diff --git a/modules/heritiers-utility.js b/modules/heritiers-utility.js index c718dda..68c7f13 100644 --- a/modules/heritiers-utility.js +++ b/modules/heritiers-utility.js @@ -345,7 +345,8 @@ export class HeritiersUtility { //console.log("BEFORE COMP", rollData) if (rollData.competence) { let compmod = (rollData.competence.system.niveau == 0) ? -3 : 0 - rollData.diceFormula += `+${rollData.carac.value}+${rollData.competence.system.niveau}+${rollData.bonusMalusContext}+${compmod}` + let specBonus = (rollData.useSpecialite) ? 1 : 0 + rollData.diceFormula += `+${rollData.carac.value}+${rollData.competence.system.niveau}+${specBonus}+${rollData.bonusMalusContext}+${compmod}` } else { rollData.diceFormula += `+${rollData.carac.value}+${rollData.bonusMalusContext}` } diff --git a/styles/simple.css b/styles/simple.css index 4744480..d420659 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1426,6 +1426,10 @@ ul, li { max-width: 14rem; min-width: 14rem; } +.item-field-label-long2-img { + max-width: 16rem; + min-width: 16rem; +} .item-field-label-long3 { padding-top: 6px; flex-grow:1; diff --git a/system.json b/system.json index 42f4133..437ce07 100644 --- a/system.json +++ b/system.json @@ -1,7 +1,7 @@ { "id": "fvtt-les-heritiers", "description": "Les Héritiers pour FoundryVTT", - "version": "10.0.16", + "version": "10.0.18", "authors": [ { "name": "Uberwald/LeRatierBretonnien", @@ -19,7 +19,7 @@ "gridUnits": "m", "license": "LICENSE.txt", "manifest": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/raw/branch/master/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.16.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-les-heritiers/archive/fvtt-les-heritiers-10.0.18.zip", "languages": [ { "lang": "fr", diff --git a/template.json b/template.json index 1cc4291..6fddebf 100644 --- a/template.json +++ b/template.json @@ -9,13 +9,20 @@ "biodata": { "name": "", "activite":"", - "profilmajeur": "", - "profilmineur": "", + "nomhumain": "", + "activites": "", "fortune": 0, "traitscaracteres": "", + "tailledemasquee": "", "taillemasquee": "", "poidsmasquee": "", + "poidsdemasquee": "", "apparencemasquee": "", + "apparencedemasquee": "", + "titrefamille": "", + "langues": "", + "factionfeerique": "", + "typetaille": "", "age": 0, "poids": "", "taille": "", @@ -23,6 +30,9 @@ "sexe": "", "yeux": "", "description": "", + "revesetranges": "", + "secretsdecouverts": "", + "questions": "", "habitat": "", "notes": "", "statut": "", @@ -233,15 +243,17 @@ "competence", "arme", "protection", + "equipement", "accessoire", "contact", "profil" ], "profil": { + "profiltype": "majeur", "description": "" }, "contact": { - "feetype": 0, + "contacttype": "", "description": "" }, "fee": { diff --git a/templates/actor-sheet.html b/templates/actor-sheet.html index 9804c0b..b497e83 100644 --- a/templates/actor-sheet.html +++ b/templates/actor-sheet.html @@ -62,10 +62,12 @@ {{!-- Sheet Tab Navigation --}} {{!-- Sheet Body --}} @@ -92,7 +94,7 @@