From e7faf7937b7854923b5416a024178c8caff312d2 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 31 Jul 2022 19:48:23 +0200 Subject: [PATCH] Manage complex skills --- modules/crucible-actor.js | 4 ++++ modules/crucible-utility.js | 6 ++++++ templates/chat-generic-result.html | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/modules/crucible-actor.js b/modules/crucible-actor.js index c31a8ea..15a2fc3 100644 --- a/modules/crucible-actor.js +++ b/modules/crucible-actor.js @@ -472,6 +472,10 @@ export class CrucibleActor extends Actor { rollSkill(skillId) { let skill = this.data.items.get(skillId) if (skill) { + if (skill.data.islore && skill.data.level == 0) { + ui.notifications.warn("You can't use Lore Skills with a SL of 0.") + return + } skill = duplicate(skill) let abilityKey = skill.data.ability let rollData = this.getCommonRollData(abilityKey) diff --git a/modules/crucible-utility.js b/modules/crucible-utility.js index b94ff4c..bcd7b72 100644 --- a/modules/crucible-utility.js +++ b/modules/crucible-utility.js @@ -272,8 +272,14 @@ export class CrucibleUtility { level += feat.data.sl rollData.featSL = feat.data.sl } + diceFormula += "+" + String(level) + "d8cs>=5" + if (rollData.skill.data.skilltype == "complex" && rollData.skill.data.level == 0) { + rollData.complexSkillDisadvantage = true + rollData.rollAdvantage = "roll-disadvantage" + } } + if(rollData.advantage == "advantage1") { diceFormula += "+ 1d10cs>=5" } diff --git a/templates/chat-generic-result.html b/templates/chat-generic-result.html index 0b54a61..62c5b5d 100644 --- a/templates/chat-generic-result.html +++ b/templates/chat-generic-result.html @@ -48,6 +48,10 @@
  • Roll with Disadvantage !
  • {{/if}} + {{#if complexSkillDisadvantage}} +
  • Roll with Disadvantage because of Complex Skill at SL 0 !
  • + {{/if}} + {{#if (ne featDieName "none")}}
  • Feature Die : d10 ({{featDieName}})
  • {{/if}}