From 1b655a9c0e01d43a0bc004b577eb4fad45bd91a1 Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Tue, 19 Sep 2023 15:46:02 +0200 Subject: [PATCH] MDL/ADRL fixes + MR fixes --- modules/pegasus-actor.js | 1 + modules/pegasus-roll-dialog.js | 7 ++ modules/pegasus-utility.js | 15 ++-- styles/simple.css | 9 ++ system.json | 4 +- templates/roll-dialog-generic.html | 130 +++++++++++++++-------------- 6 files changed, 98 insertions(+), 68 deletions(-) diff --git a/modules/pegasus-actor.js b/modules/pegasus-actor.js index fb146f0..e170770 100644 --- a/modules/pegasus-actor.js +++ b/modules/pegasus-actor.js @@ -2254,6 +2254,7 @@ export class PegasusActor extends Actor { } rollData.hindranceDices = this.computeCurrentHindrances(statKey) + rollData.minHindranceDices = rollData.hindranceDices this.processSizeBonus(rollData) this.addEffects(rollData, isInit, isPower, subKey == "power-dmg") diff --git a/modules/pegasus-roll-dialog.js b/modules/pegasus-roll-dialog.js index 2b80788..ed02bba 100644 --- a/modules/pegasus-roll-dialog.js +++ b/modules/pegasus-roll-dialog.js @@ -296,6 +296,13 @@ export class PegasusRollDialog extends Dialog { PegasusUtility.removeFromDicePool(this.rollData, idx) this.refreshDialog() }) + html.find('.pool-remove-hindrance-dice').click(async (event) => { + if (this.rollData.hindranceDices > this.rollData.minHindranceDices) { + this.rollData.hindranceDices--; + } + this.refreshDialog() + }) + } diff --git a/modules/pegasus-utility.js b/modules/pegasus-utility.js index 1277a50..9e0531f 100644 --- a/modules/pegasus-utility.js +++ b/modules/pegasus-utility.js @@ -165,7 +165,8 @@ export class PegasusUtility { static getDiceList() { return [{ key: "d4", level: 1, img: "systems/fvtt-pegasus-rpg/images/dice/d4.webp" }, { key: "d6", level: 2, img: "systems/fvtt-pegasus-rpg/images/dice/d6.webp" }, { key: "d8", level: 3, img: "systems/fvtt-pegasus-rpg/images/dice/d8.webp" }, { key: "d10", level: 4, img: "systems/fvtt-pegasus-rpg/images/dice/d10.webp" }, - { key: "d12", level: 5, img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" }] + { key: "d12", level: 5, img: "systems/fvtt-pegasus-rpg/images/dice/d12.webp" }, + { key: "hindrance", level: 0, img: "systems/fvtt-pegasus-rpg/images/dice/hindrance-dice.png"}] } /* -------------------------------------------- */ @@ -283,11 +284,15 @@ export class PegasusUtility { /* -------------------------------------------- */ static addDicePool(rollData, diceKey, level) { - let newDice = { - name: "dice-click", key: diceKey, level: level, - img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` + if (diceKey == "hindrance") { + rollData.hindranceDices +=1 + } else { + let newDice = { + name: "dice-click", key: diceKey, level: level, + img: `systems/fvtt-pegasus-rpg/images/dice/${diceKey}.webp` + } + rollData.dicePool.push(newDice) } - rollData.dicePool.push(newDice) } /*-------------------------------------------- */ diff --git a/styles/simple.css b/styles/simple.css index 40bb21a..f5aed57 100644 --- a/styles/simple.css +++ b/styles/simple.css @@ -1536,4 +1536,13 @@ Focus FOC: #ff0084 max-width: 48px; max-height: 48px; flex-grow: 0; +} +.dice-pool-image-add { + border: 0; + margin-left: 4px; + min-width: 32px; + min-height: 32px; + max-width: 32px; + max-height: 32px; + flex-grow: 0; } \ No newline at end of file diff --git a/system.json b/system.json index 7f7482c..8a78c74 100644 --- a/system.json +++ b/system.json @@ -252,7 +252,7 @@ ], "title": "Pegasus RPG", "url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg", - "version": "11.0.21", - "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.21.zip", + "version": "11.0.22", + "download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.22.zip", "background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp" } \ No newline at end of file diff --git a/templates/roll-dialog-generic.html b/templates/roll-dialog-generic.html index 9aea318..96568c7 100644 --- a/templates/roll-dialog-generic.html +++ b/templates/roll-dialog-generic.html @@ -26,7 +26,7 @@ {{#if statVehicle}}
- {{upper statVehicle.label}} : + {{upper statVehicle.label}} : - {{#select selectedSpec}} - - {{#each specList as |spec idx|}} - - {{/each}} - {{/select}} - -   -
-
- Spec Dice : - -   -
- {{/if}} + {{#if specList}} +
+ Spec : + +   +
+
+ Spec Dice : + +   +
+ {{/if}} {{/if}} - +

Current pool

{{#each dicePool as |dice idx|}} - dices + dices {{/each}}
- {{#if noBonusDice}} -
- No bonus dice due to effect ! -
- {{else}} -
- {{#each diceList as |dice idx|}} - dices - {{/each}} -
- {{/if}} - - {{#if hindranceDices}}

Hindrance Dice

{{#for 1 hindranceDices 1}} - dices {{/for}}
+ + {{#if noBonusDice}} +
+ No bonus dice due to effect ! +
+ {{else}} +
+ {{#each diceList as |dice idx|}} + dices + {{/each}} +
{{/if}} +
Modifiers : @@ -129,21 +128,30 @@ - - - - {{/select}} - +
@@ -154,14 +162,14 @@ {{else}} {{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}} {{/if}} - + {{#if isInit}} - {{#each TICs as |tic index|}} -
- TIC {{add index 1}}: - -
- {{/each}} + {{#each TICs as |tic index|}} +
+ TIC {{add index 1}}: + +
+ {{/each}} {{/if}}