diff --git a/images/ui/D12_Black.png b/images/ui/D12_Black.png deleted file mode 100644 index f4ab136..0000000 Binary files a/images/ui/D12_Black.png and /dev/null differ diff --git a/images/ui/D12_Black.webp b/images/ui/D12_Black.webp deleted file mode 100644 index 39e2b92..0000000 Binary files a/images/ui/D12_Black.webp and /dev/null differ diff --git a/images/ui/D12_White.png b/images/ui/D12_White.png deleted file mode 100644 index 7f10632..0000000 Binary files a/images/ui/D12_White.png and /dev/null differ diff --git a/images/ui/D12_White.webp b/images/ui/D12_White.webp deleted file mode 100644 index 9d4cea0..0000000 Binary files a/images/ui/D12_White.webp and /dev/null differ diff --git a/images/ui/logo.png b/images/ui/logo.png deleted file mode 100644 index 26172aa..0000000 Binary files a/images/ui/logo.png and /dev/null differ diff --git a/images/ui/logo.webp b/images/ui/logo.webp deleted file mode 100644 index 2600f53..0000000 Binary files a/images/ui/logo.webp and /dev/null differ diff --git a/modules/malefices-actor-sheet.js b/modules/malefices-actor-sheet.js index 908ba0a..8af579a 100644 --- a/modules/malefices-actor-sheet.js +++ b/modules/malefices-actor-sheet.js @@ -38,7 +38,7 @@ export class MaleficesActorSheet extends ActorSheet { armes: duplicate(this.actor.getArmes()), equipements: duplicate(this.actor.getEquipements()), subActors: duplicate(this.actor.getSubActors()), - encCurrent: this.actor.encCurrent, + phyMalus: this.actor.getPhysiqueMalus(), options: this.options, owner: this.document.isOwner, editScore: this.options.editScore, diff --git a/modules/malefices-actor.js b/modules/malefices-actor.js index ec81f09..ba5fa98 100644 --- a/modules/malefices-actor.js +++ b/modules/malefices-actor.js @@ -268,6 +268,12 @@ export class MaleficesActor extends Actor { return `systems/fvtt-malefices/images/icons/${attrKey}.webp` } + /* -------------------------------------------- */ + incDecDestin( value) { + let newValue = this.system.pointdestin + value + this.update( {'system.pointdestin': newValue}) + } + /* -------------------------------------------- */ getCommonRollData() { @@ -277,6 +283,8 @@ export class MaleficesActor extends Actor { rollData.actorId = this.id rollData.img = this.img rollData.phyMalus = this.getPhysiqueMalus() + rollData.destin = this.system.pointdestin + rollData.isReroll = false console.log("ROLLDATA", rollData) diff --git a/modules/malefices-config.js b/modules/malefices-config.js index 3c7cabd..1f98bf8 100644 --- a/modules/malefices-config.js +++ b/modules/malefices-config.js @@ -1,6 +1,12 @@ export const MALEFICES_CONFIG = { + tarotType: { + "majeur": "Arcane Majeur", + "mineur": "Arcane Mineur", + "metier": "Arcane de Métier", + }, + armeTypes : { "fusilchasse": "Fusil de Chasse", "fusilguerre": "Fusil de Guerre", diff --git a/modules/malefices-item-sheet.js b/modules/malefices-item-sheet.js index 1e3b42d..af71b3b 100644 --- a/modules/malefices-item-sheet.js +++ b/modules/malefices-item-sheet.js @@ -63,6 +63,7 @@ export class MaleficesItemSheet extends ItemSheet { options: this.options, owner: this.document.isOwner, description: await TextEditor.enrichHTML(this.object.system.description, { async: true }), + notes: await TextEditor.enrichHTML(this.object.system.notes, { async: true }), isGM: game.user.isGM } diff --git a/modules/malefices-utility.js b/modules/malefices-utility.js index da4e624..a15e790 100644 --- a/modules/malefices-utility.js +++ b/modules/malefices-utility.js @@ -116,37 +116,29 @@ export class MaleficesUtility { } /* -------------------------------------------- */ - static isArmorLight(armor) { - if (armor && (armor.system.armortype.includes("light") || armor.system.armortype.includes("clothes"))) { - return true + static getActorFromRollData(rollData) { + let actor = game.actors.get(rollData.actorId) + if (rollData.tokenId) { + let token = canvas.tokens.placeables.find(t => t.id == rollData.tokenId) + if (token) { + actor = token.actor + } } - return false + return actor } /* -------------------------------------------- */ static async chatListeners(html) { - html.on("click", '.view-item-from-chat', event => { - game.system.Malefices.creator.openItemView(event) + html.on("click", '.roll-destin', event => { + let messageId = MaleficesUtility.findChatMessageId(event.currentTarget) + let message = game.messages.get(messageId) + let rollData = message.getFlag("world", "rolldata") + let actor = this.getActorFromRollData(rollData) + actor.incDecDestin(-1) + rollData.isReroll = true + this.rollMalefices(rollData) }) - html.on("click", '.roll-defense-melee', event => { - let rollId = $(event.currentTarget).data("roll-id") - let rollData = MaleficesUtility.getRollData(rollId) - rollData.defenseWeaponId = $(event.currentTarget).data("defense-weapon-id") - let actor = game.canvas.tokens.get(rollData.defenderTokenId).actor - if (actor && (game.user.isGM || actor.isOwner)) { - actor.rollDefenseMelee(rollData) - } - }) - html.on("click", '.roll-defense-ranged', event => { - let rollId = $(event.currentTarget).data("roll-id") - let rollData = MaleficesUtility.getRollData(rollId) - let defender = game.canvas.tokens.get(rollData.defenderTokenId).actor - if (defender && (game.user.isGM || defender.isOwner)) { - defender.rollDefenseRanged(rollData) - } - }) - } /* -------------------------------------------- */ @@ -418,7 +410,7 @@ export class MaleficesUtility { } /* -------------------------------------------- */ - static getArmorPenalty( item ) { + static getArmorPenalty(item) { if (item && (item.type == "shield" || item.type == "armor")) { return __armorPenalties[item.system.category] } @@ -470,59 +462,38 @@ export class MaleficesUtility { } } - /* -------------------------------------------- */ - static updateSkill(skill) { - skill.system.level = skill.system.background + skill.system.basic + skill.system.class + skill.system.explevel - if (skill.system.level > 7) { skill.system.level = 7 } - skill.system.skilldice = __skillLevel2Dice[skill.system.level] - } - - /* -------------------------------------------- */ - static getDiceFromCover(cover) { - if (cover == "cover50") return 1 - return 0 - } - /* -------------------------------------------- */ - static getDiceFromSituational(cover) { - if (cover == "prone") return 1 - if (cover == "dodge") return 1 - if (cover == "moving") return 1 - if (cover == "engaged") return 1 - return 0 - } - /* -------------------------------------------- */ static async rollMalefices(rollData) { let actor = game.actors.get(rollData.actorId) - + // Build the dice formula let diceFormula = "1d20" rollData.target = rollData.attr.value + rollData.bonusMalusPerso + rollData.bonusMalusSituation + rollData.bonusMalusDef + if (rollData.attr.abbrev == "physique") { + rollData.target += rollData.phyMalus + } rollData.diceFormula = diceFormula // Performs roll console.log("Roll formula", diceFormula) - let myRoll = rollData.roll - if (!myRoll) { // New rolls only of no rerolls - myRoll = new Roll(diceFormula).roll({ async: false }) - await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) - } + let myRoll = new Roll(diceFormula).roll({ async: false }) + await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode")) rollData.roll = myRoll rollData.isSuccess = false - if (myRoll.total <= rollData.target ) { + if (myRoll.total <= rollData.target) { rollData.isSuccess = true } - if (myRoll.total == 1 ) { + if (myRoll.total == 1) { rollData.isSuccess = true rollData.isCritical = true } - if (myRoll.total == 20 ) { + if (myRoll.total == 20) { rollData.isSuccess = false - rollData.isFumble = true + rollData.isFumble = true } - if (myRoll.total <= Math.floor(rollData.target/3) ) { + if (myRoll.total <= Math.floor(rollData.target / 3)) { rollData.isPart = true } @@ -531,7 +502,7 @@ export class MaleficesUtility { }) msg.setFlag("world", "rolldata", rollData) if (rollData.mode == "initiative") { - actor.setFlag("world", "initiative", myRoll.total) + actor.setFlag("world", "initiative", myRoll.total) } console.log("Rolldata result", rollData) diff --git a/styles/simple.css b/styles/simple.css index 5b879e3..5b2be68 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1229,7 +1229,7 @@ ul, li { } .items-title-bg { margin-top: 6px; - background: black; + background-color:#252525; color: white; } .items-title-text { diff --git a/system.json b/system.json index 78e4f87..1be01b5 100644 --- a/system.json +++ b/system.json @@ -37,7 +37,7 @@ ], "title": "Maléfices, le Jeu de Rôle", "url": "https://www.uberwald.me/gitea/public/fvtt-malefices", - "version": "10.0.1", - "download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.1.zip", + "version": "10.0.2", + "download": "https://www.uberwald.me/gitea/public/fvtt-malefices/archive/fvtt-malefices-v10.0.2.zip", "background": "systems/fvtt-malefices/images/ui/malefice_welcome_page.webp" } \ No newline at end of file diff --git a/template.json b/template.json index e825dd1..d90d994 100644 --- a/template.json +++ b/template.json @@ -97,13 +97,18 @@ "Item": { "types": [ "arme", - "equipement" + "equipement", + "tarot" ], "templates": { }, "equipement" : { "description": "" }, + "tarot" : { + "tarottype": "", + "description": "" + }, "arme" : { "armetype": 0, "dommagenormale": 0, diff --git a/templates/actors/actor-sheet.hbs b/templates/actors/actor-sheet.hbs index 358bfad..ae3983d 100644 --- a/templates/actors/actor-sheet.hbs +++ b/templates/actors/actor-sheet.hbs @@ -15,6 +15,7 @@ + {{!-- Sheet Tab Navigation --}} @@ -30,6 +31,7 @@ {{!-- Skills Tab --}}