diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index 55f1ee1..8128117 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -271,17 +271,22 @@ export class CrucibleUtility { let actor = game.actors.get(rollData.actorId) + // stat => 0 let diceFormula = String(rollData.ability.value) + "d6cs>=5" + + // skill => 2 + // feat => 4 + // bonus => 6 if (rollData.skill) { let level = rollData.skill.data.level if (level == 0 && rollData.skill.data.isfeatdie ) { rollData.hasSLBonus = true level += 2 if (level > 7) { level = 7} - rollData.skill.data.skilldice = __skillLevel2Dice[level] } - + rollData.skill.data.skilldice = __skillLevel2Dice[level] diceFormula += "+" + String(rollData.skill.data.skilldice) + "cs>=5" + if (rollData.skill.data.skilltype == "complex" && rollData.skill.data.level == 0) { rollData.complexSkillDisadvantage = true rollData.rollAdvantage = "roll-disadvantage" @@ -290,32 +295,49 @@ export class CrucibleUtility { if (rollData.skill.data.level > 0 && rollData.skill.data.isfeatdie) { rollData.hasFeatDie = true diceFormula += "+ 1d10cs>=5" + } else { + diceFormula += `+ 0d10cs>=5` } if (rollData.skill.data.bonusdice != "none") { rollData.hasBonusDice = rollData.skill.data.bonusdice diceFormula += `+ ${rollData.hasBonusDice}cs>=5` + } else { + diceFormula += `+ 0d6cs>=5` } + } else { + diceFormula += `+ 0d8cs=>5 + 0d10cs>=5 + 0d6cs>=5` } + // advantage => 8 + let advFormula = "+ 0d8cs>=5" if(rollData.advantage == "advantage1") { - diceFormula += "+ 1d10cs>=5" + advFormula = "+ 1d8cs>=5" } if(rollData.advantage == "advantage2") { - diceFormula += "+ 2d10cs>=5" + advFormula = "+ 2d8cs>=5" } + diceFormula += advFormula + + // disadvantage => 10 + let disFormula = "- 0d8cs>=5" if(rollData.disadvantage == "disadvantage1") { - diceFormula += "- 1d10cs>=5" + disFormula = "- 1d8cs>=5" } if(rollData.disadvantage == "disadvantage2") { - diceFormula += "- 2d10cs>=5" + disFormula = "- 2d8cs>=5" } + diceFormula += disFormula + + // armor => 12 let skillArmorPenalty = 0 for (let armor of rollData.armors) { skillArmorPenalty += armor.data.skillpenalty } - if (skillArmorPenalty > 0 ) { + if (rollData.skill && rollData.skill.data.armorpenalty && skillArmorPenalty > 0 ) { rollData.skillArmorPenalty = skillArmorPenalty - diceFormula += `- ${skillArmorPenalty}d10cs>=5` + diceFormula += `- ${skillArmorPenalty}d8cs>=5` + } else { + diceFormula += `- 0d8cs>=5` } // Performs roll diff --git a/packs/skills.db b/packs/skills.db index fd7bb6e..4800a04 100644 --- a/packs/skills.db +++ b/packs/skills.db @@ -14,6 +14,7 @@ {"_id":"Y4o571K5DQseDaGT","name":"Swim","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Swim.webp","data":{"ability":"str","armorpenalty":true,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Kick you feet and don't forget to breathe!

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"ZfIwXZwaBKaVoYbG","name":"Athletics","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Athletics.png","data":{"ability":"agi","armorpenalty":true,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Your ability to run, jump, and climb; a measure of your physical coordination.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"cc74gHSQK4hRR8Vj","name":"Brawn","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Brawn.png","data":{"ability":"str","armorpenalty":false,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

A combination of your Size and Strength.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} +{"name":"Axe (Copy)","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/icon_skill.webp","data":{"ability":"agi","armorpenalty":false,"isproficient":true,"isweaponskill":true,"isfeatdie":false,"islore":false,"skilltype":"complex","isinnate":false,"bonusdice":"none","background":0,"basic":0,"class":0,"exp":0,"explevel":0,"description":"","level":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{"core":{"sourceId":"Item.Cnw8keaxD1SI3vun"}},"_id":"fJjXMpUILcN983XV"} {"_id":"fegRI4Vsyr0Us1Ga","name":"Research","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Research.webp","data":{"ability":"int","armorpenalty":false,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Give me a moment to look that up....

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"i8eeE2I9vv2kHwdJ","name":"Shadow Lore","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Shadow%20Lore.webp","data":{"ability":"int","armorpenalty":true,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

You can cast Shadow Lore spells.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"lfB80K2lFSzQH442","name":"Intuition","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Intuition.png","data":{"ability":"wit","armorpenalty":false,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

I see what you did there.  I think you're up to something....

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} @@ -23,4 +24,3 @@ {"_id":"s2AAQviLttcHul3X","name":"Charm","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Charm.png","data":{"ability":"cha","armorpenalty":false,"bonusdice":"none","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Getting someone to do what you want because they want to do it.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"xlYUHAUSfQrsjQoi","name":"Survival","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Survival.webp","data":{"ability":"wit","armorpenalty":false,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Help me set this snare and we'll eat like kings in the morning.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} {"_id":"yAhtkgqf7pKyjJTA","name":"Poison Use","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/skills/Poison%20Use.webp","data":{"ability":"dex","armorpenalty":false,"bonusdice":"","level":0,"background":0,"basic":0,"class":0,"exp":0,"description":"

Let me apply this to my blade.

"},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{}} -{"name":"Axe (Copy)","type":"skill","img":"systems/fvtt-crucible-rpg/images/icons/icon_skill.webp","data":{"ability":"agi","armorpenalty":false,"isproficient":true,"isweaponskill":true,"isfeatdie":false,"islore":false,"skilltype":"complex","isinnate":false,"bonusdice":"none","background":0,"basic":0,"class":0,"exp":0,"explevel":0,"description":"","level":2},"effects":[],"folder":null,"sort":0,"permission":{"default":0,"Up3b6rNa3VKAFQC3":3},"flags":{"core":{"sourceId":"Item.Cnw8keaxD1SI3vun"}},"_id":"fJjXMpUILcN983XV"} diff --git a/system.json b/system.json index d819894..019980d 100644 --- a/system.json +++ b/system.json @@ -213,6 +213,6 @@ "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.17.zip", "url": "https://www.uberwald.me/gitea/public/fvtt-crucible-rpg", - "version": "0.1.17", + "version": "0.1.18", "background" : "./images/ui/crucible_welcome_page.webp" } diff --git a/templates/chat-generic-result.html b/templates/chat-generic-result.html index 68554a1..061dffd 100644 --- a/templates/chat-generic-result.html +++ b/templates/chat-generic-result.html @@ -19,27 +19,50 @@