diff --git a/modules/crucible-actor.js b/modules/crucible-actor.js index eeee0bf..6fc853e 100644 --- a/modules/crucible-actor.js +++ b/modules/crucible-actor.js @@ -325,10 +325,6 @@ export class CrucibleActor extends Actor { /* -------------------------------------------- */ syncRoll(rollData) { - let linkedRollId = CrucibleUtility.getDefenseState(this.id); - if (linkedRollId) { - rollData.linkedRollId = linkedRollId; - } this.lastRollId = rollData.rollId; CrucibleUtility.saveRollData(rollData); } @@ -412,17 +408,16 @@ export class CrucibleActor extends Actor { let rollData = this.getCommonRollData(abilityKey) rollData.mode = "skill" rollData.skill = skill - CrucibleUtility.rollCrucible(rollData) + + this.startRoll(rollData) } } /* -------------------------------------------- */ async startRoll(rollData) { - this.syncRoll(rollData); - //console.log("ROLL DATA", rollData) + this.syncRoll(rollData) let rollDialog = await CrucibleRollDialog.create(this, rollData) - console.log(rollDialog) - rollDialog.render(true); + rollDialog.render(true) } } diff --git a/modules/crucible-roll-dialog.js b/modules/crucible-roll-dialog.js index ee1c8bb..3decec0 100644 --- a/modules/crucible-roll-dialog.js +++ b/modules/crucible-roll-dialog.js @@ -5,7 +5,7 @@ export class CrucibleRollDialog extends Dialog { /* -------------------------------------------- */ static async create(actor, rollData) { - let options = { classes: ["CrucibleDialog"], width: 620, height: 480, 'z-index': 99999 }; + let options = { classes: ["CrucibleDialog"], width: 420, height: 280, 'z-index': 99999 }; let html = await renderTemplate('systems/fvtt-crucible-rpg/templates/roll-dialog-generic.html', rollData); return new CrucibleRollDialog(actor, rollData, html, options); @@ -14,7 +14,7 @@ export class CrucibleRollDialog extends Dialog { /* -------------------------------------------- */ constructor(actor, rollData, html, options, close = undefined) { let conf = { - title: (rollData.mode == "skill") ? "Skill" : "Roll", + title: (rollData.mode == "skill") ? "Skill" : "Attribute", content: html, buttons: { roll: { @@ -58,50 +58,17 @@ export class CrucibleRollDialog extends Dialog { } $(function () { onLoad(); }); - html.find('#statDicesLevel').change((event) => { - this.rollData.statDicesLevel = Number(event.currentTarget.value) - }); - html.find('#specDicesLevel').change(async (event) => { - this.rollData.specDicesLevel = Number(event.currentTarget.value) - CrucibleUtility.updateSpecDicePool(this.rollData) - this.refreshDialog() - }); - html.find('.effect-clicked').change(async (event) => { - let toggled = event.currentTarget.checked - let effectIdx = $(event.currentTarget).data("effect-idx") - this.manageEffects(effectIdx, toggled) - this.refreshDialog() - }); - html.find('.armor-clicked').change((event) => { - let toggled = event.currentTarget.checked - let armorIdx = $(event.currentTarget).data("armor-idx") - this.manageArmors(armorIdx, toggled) - this.refreshDialog() - }); - html.find('.weapon-clicked').change((event) => { - let toggled = event.currentTarget.checked - let weaponIdx = $(event.currentTarget).data("weapon-idx") - this.manageWeapons(weaponIdx, toggled) - this.refreshDialog() - }); - html.find('.equip-clicked').change((event) => { - let toggled = event.currentTarget.checked - let equipIdx = $(event.currentTarget).data("equip-idx") - this.manageEquip(equipIdx, toggled) - }) - - html.find('.pool-add-dice').click(async (event) => { - let diceKey = $(event.currentTarget).data("dice-key") - let diceLevel = $(event.currentTarget).data("dice-level") - CrucibleUtility.addDicePool(this.rollData, diceKey, diceLevel) + html.find('#none-clicked').change((event) => { + this.rollData.advantage = "none" this.refreshDialog() }) - html.find('.pool-remove-dice').click(async (event) => { - let idx = $(event.currentTarget).data("dice-idx") - CrucibleUtility.removeFromDicePool(this.rollData, idx) + html.find('#advantage-clicked').change((event) => { + this.rollData.advantage = "advantage" + this.refreshDialog() + }) + html.find('#disadvantage-clicked').change((event) => { + this.rollData.advantage = "disadvantage" this.refreshDialog() }) - - } } \ No newline at end of file diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index 2dd34c1..efff04c 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -86,6 +86,7 @@ export class CrucibleUtility { const templatePaths = [ 'systems/fvtt-crucible-rpg/templates/editor-notes-gm.html', + 'systems/fvtt-crucible-rpg/templates/partial-roll-select.html', 'systems/fvtt-crucible-rpg/templates/partial-actor-ability-block.html', 'systems/fvtt-crucible-rpg/templates/partial-actor-status.html', 'systems/fvtt-crucible-rpg/templates/partial-options-abilities.html', @@ -266,7 +267,12 @@ export class CrucibleUtility { if (rollData.skill) { diceFormula += "+" + String(rollData.skill.data.level) + "d8cs>=5" } - + if(rollData.advantage == "advantage") { + diceFormula += "+ 1d10cs>=5" + } + if(rollData.advantage == "disadvantage") { + diceFormula += "- 1d10cs>=5" + } // Performs roll let myRoll = rollData.roll if (!myRoll) { // New rolls only of no rerolls @@ -370,6 +376,7 @@ export class CrucibleUtility { let rollData = { rollId: randomID(16), rollMode: game.settings.get("core", "rollMode"), + advantage: "none" } CrucibleUtility.updateWithTarget(rollData) return rollData diff --git a/packs/feats.db b/packs/feats.db new file mode 100644 index 0000000..e69de29 diff --git a/packs/poisons.db b/packs/poisons.db new file mode 100644 index 0000000..e69de29 diff --git a/system.json b/system.json index 24785be..84267c3 100644 --- a/system.json +++ b/system.json @@ -140,6 +140,26 @@ "tags": [ "skill" ] + }, + { + "entity": "Item", + "label": "Feats", + "name": "feats", + "path": "./packs/feats.db", + "system": "fvtt-crucible-rpg", + "tags": [ + "feat" + ] + }, + { + "entity": "Item", + "label": "Poisons", + "name": "poisons", + "path": "./packs/poisons.db", + "system": "fvtt-crucible-rpg", + "tags": [ + "poison" + ] } ], "primaryTokenAttribute": "secondary.health", @@ -151,8 +171,8 @@ "templateVersion": 8, "title": "Crucible RPG", "manifest": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/raw/master/system.json", - "download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v0.1.9.zip", + "download": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg/archive/fvtt-crucible-rpg-v0.1.10.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg", - "version": "0.1.9", + "version": "0.1.10", "background" : "./images/ui/crucible_welcome_page.webp" } diff --git a/template.json b/template.json index ea99d86..e80114c 100644 --- a/template.json +++ b/template.json @@ -100,7 +100,10 @@ } }, "Item": { - "types": [ "race", "skill", "armor", "shield", "equipment", "weapon", "money" , "feat", "spell", "condition"], + "types": [ "race", "skill", "armor", "shield", "equipment", "weapon", "money" , "feat", "spell", "condition", "poison"], + "poison": { + "description": "" + }, "condition": { "description": "" }, diff --git a/templates/item-poison-sheet.html b/templates/item-poison-sheet.html new file mode 100644 index 0000000..1410353 --- /dev/null +++ b/templates/item-poison-sheet.html @@ -0,0 +1,28 @@ +
+
+ +
+

+
+
+ {{> systems/fvtt-crucible-rpg/templates/partial-item-nav.html}} + + {{!-- Sheet Body --}} +
+ +
+ + +
+ {{editor content=data.description target="data.description" button=true owner=owner editable=editable}} +
+
+ +
+
    +
+ +
+ +
+
\ No newline at end of file diff --git a/templates/partial-roll-select.html b/templates/partial-roll-select.html new file mode 100644 index 0000000..92731e3 --- /dev/null +++ b/templates/partial-roll-select.html @@ -0,0 +1,18 @@ + + diff --git a/templates/roll-dialog-generic.html b/templates/roll-dialog-generic.html index 60539ab..0df21a6 100644 --- a/templates/roll-dialog-generic.html +++ b/templates/roll-dialog-generic.html @@ -10,86 +10,22 @@
- {{#if isGeneric}} - - {{else}}
- Stat Dice : - -  + {{statMod}} + Ability : + {{ability.value}}d6
- {{#if specList}} -
- Spec : - -   -
- {{/if}} - + {{#if skill}}
- Spec Dice : - -   + Skill : + {{skill.name}} - {{skill.data.value}}d8
{{/if}} - - -
- -

Current pool

-
-
- {{#each dicePool as |dice idx|}} - - {{/each}} -
-
- -
- {{#each diceList as |dice idx|}} - - {{/each}} -
-
- {{> systems/fvtt-pegasus-rpg/templates/partial-roll-select-effects.html}} + {{> systems/fvtt-crucible-rpg/templates/partial-roll-select.html}}