Manage complex skills

This commit is contained in:
sladecraven 2022-07-31 19:48:23 +02:00
parent 1143fa0d57
commit e7faf7937b
3 changed files with 14 additions and 0 deletions

View File

@ -472,6 +472,10 @@ export class CrucibleActor extends Actor {
rollSkill(skillId) { rollSkill(skillId) {
let skill = this.data.items.get(skillId) let skill = this.data.items.get(skillId)
if (skill) { 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) skill = duplicate(skill)
let abilityKey = skill.data.ability let abilityKey = skill.data.ability
let rollData = this.getCommonRollData(abilityKey) let rollData = this.getCommonRollData(abilityKey)

View File

@ -272,8 +272,14 @@ export class CrucibleUtility {
level += feat.data.sl level += feat.data.sl
rollData.featSL = feat.data.sl rollData.featSL = feat.data.sl
} }
diceFormula += "+" + String(level) + "d8cs>=5" 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") { if(rollData.advantage == "advantage1") {
diceFormula += "+ 1d10cs>=5" diceFormula += "+ 1d10cs>=5"
} }

View File

@ -48,6 +48,10 @@
<li>Roll with Disadvantage !</li> <li>Roll with Disadvantage !</li>
{{/if}} {{/if}}
{{#if complexSkillDisadvantage}}
<li>Roll with Disadvantage because of Complex Skill at SL 0 !</li>
{{/if}}
{{#if (ne featDieName "none")}} {{#if (ne featDieName "none")}}
<li>Feature Die : d10 ({{featDieName}})</li> <li>Feature Die : d10 ({{featDieName}})</li>
{{/if}} {{/if}}