diff --git a/src/lang/en.json b/src/lang/en.json index 475a4aa1..21f2e4bf 100644 --- a/src/lang/en.json +++ b/src/lang/en.json @@ -613,6 +613,8 @@ "DL.SettingInitMessageHint": "Show if player chooses Fast or Slow turn in Chat Log.", "DL.SettingInitRandomize": "Initiative Randomize", "DL.SettingInitRandomizeHint": "Makes your initiative more random and adds a d6 to your initiative value.", + "DL.SettingOptinalRuleLevelDependentBane":"Character level dependent horrifying bane", + "DL.SettingOptinalRuleLevelDependentBaneHint":"Creatures lose their frightening or horrifying traits for characters of a certain level or higher, according to the creature’s difficulty.", "DL.SettingLockAncestrHint": "Remove players access to change modifers, Speed, Insanity, Corruption and Health.", "DL.SettingLockAncestry": "Lock fields on Ancestry", "DL.SettingReplaceIcons": "Replace default icons", diff --git a/src/module/actor/actor.js b/src/module/actor/actor.js index 1b94c19f..6584441d 100644 --- a/src/module/actor/actor.js +++ b/src/module/actor/actor.js @@ -423,14 +423,14 @@ export class DemonlordActor extends Actor { (attacker.system.bonuses.attack.boons.weapon || 0) const horrifyingBane = game.settings.get('demonlord', 'horrifyingBane') - + const ignoreLevelDependentBane = (game.settings.get('demonlord', 'optinalRuleLevelDependentBane') && ((attacker.system?.level >=3 && attacker.system?.level <=6 && defender?.system?.difficulty <= 25) || (attacker.system?.level >=7 && defender?.system?.difficulty <= 50))) ? false : true // The defender banes apply only if the defender is one target if (defendersTokens.length === 1) boons -= (defender?.system.bonuses.defense.boons[defenseAttribute] || 0) + (defender?.system.bonuses.defense.boons.all || 0) + (defender?.system.bonuses.defense.boons.weapon || 0) + - (horrifyingBane && !attacker.system.horrifying && !attacker.system.frightening && defender?.system.horrifying && 1 || 0) + (horrifyingBane && ignoreLevelDependentBane && !attacker.system.horrifying && !attacker.system.frightening && defender?.system.horrifying && 1 || 0) // Check if requirements met if (item.system.wear && parseInt(item.system.requirement?.minvalue) > attacker.getAttribute(item.system.requirement?.attribute)?.value) @@ -604,12 +604,13 @@ export class DemonlordActor extends Actor { parseInt(talentData.action?.boonsbanes || 0) const horrifyingBane = game.settings.get('demonlord', 'horrifyingBane') + const ignoreLevelDependentBane = (game.settings.get('demonlord', 'optinalRuleLevelDependentBane') && ((this.system?.level >=3 && this.system?.level <=6 && target?.actor?.system?.difficulty <= 25) || (this.system?.level >=7 && target?.actor?.system?.difficulty <= 50))) ? false : true if (targets.length === 1) boons -= ( (target?.actor?.system.bonuses.defense.boons[defenseAttribute] || 0) + (target?.actor?.system.bonuses.defense.boons.all || 0) + - (horrifyingBane && !this.system.horrifying && !this.system.frightening && target?.actor?.system.horrifying && 1 || 0)) + (horrifyingBane && ignoreLevelDependentBane && !this.system.horrifying && !this.system.frightening && target?.actor?.system.horrifying && 1 || 0)) const boonsReroll = parseInt(this.system.bonuses.rerollBoon1Dice) attackRoll = new Roll(this.rollFormula(modifiers, boons, boonsReroll), this.system) @@ -690,13 +691,14 @@ export class DemonlordActor extends Actor { (this.system.bonuses.attack.boons.spell || 0) const horrifyingBane = game.settings.get('demonlord', 'horrifyingBane') + const ignoreLevelDependentBane = (game.settings.get('demonlord', 'optinalRuleLevelDependentBane') && ((this.system?.level >=3 && this.system?.level <=6 && target?.actor?.system?.difficulty <= 25) || (this.system?.level >=7 && target?.actor?.system?.difficulty <= 50))) ? false : true if (targets.length > 0) boons -= (target?.actor?.system.bonuses.defense.boons[defenseAttribute] || 0) + (target?.actor?.system.bonuses.defense.boons.all || 0) + (target?.actor?.system.bonuses.defense.boons.spell || 0) + - (horrifyingBane && !this.system.horrifying && !this.system.frightening && target?.actor?.system.horrifying && 1 || 0) + (horrifyingBane && ignoreLevelDependentBane && !this.system.horrifying && !this.system.frightening && target?.actor?.system.horrifying && 1 || 0) const modifiers = [parseInt(inputModifier) || 0, this.getAttribute(attackAttribute).modifier || 0] const boonsReroll = parseInt(this.system.bonuses.rerollBoon1Dice) @@ -808,12 +810,13 @@ export class DemonlordActor extends Actor { parseInt(itemData.action?.boonsbanes || 0) const horrifyingBane = game.settings.get('demonlord', 'horrifyingBane') + const ignoreLevelDependentBane = (game.settings.get('demonlord', 'optinalRuleLevelDependentBane') && ((this.system?.level >=3 && this.system?.level <=6 && target?.actor?.system?.difficulty <= 25) || (this.system?.level >=7 && target?.actor?.system?.difficulty <= 50))) ? false : true if (targets.length === 1) boons -= ( (target?.actor?.system.bonuses.defense.boons[defenseAttribute] || 0) + (target?.actor?.system.bonuses.defense.boons.all || 0) + - (horrifyingBane && !this.system.horrifying && !this.system.frightening && target?.actor?.system.horrifying && 1 || 0)) + (horrifyingBane && ignoreLevelDependentBane && !this.system.horrifying && !this.system.frightening && target?.actor?.system.horrifying && 1 || 0)) const boonsReroll = parseInt(this.system.bonuses.rerollBoon1Dice) attackRoll = new Roll(this.rollFormula(modifiers, boons, boonsReroll), this.system) diff --git a/src/module/settings.js b/src/module/settings.js index 3b59daf1..1294348c 100644 --- a/src/module/settings.js +++ b/src/module/settings.js @@ -85,7 +85,9 @@ export class OptionalRulesSettings extends FormApplication { h: game.i18n.localize('DL.SettingOptionalRuleInitiativeGroup'), }, optinalRuleRollInitEachRound: game.settings.get('demonlord', 'optinalRuleRollInitEachRound'), - optinalRuleExceedsByFive: game.settings.get('demonlord', 'optinalRuleExceedsByFive') + optinalRuleExceedsByFive: game.settings.get('demonlord', 'optinalRuleExceedsByFive'), + horrifyingBane: game.settings.get("demonlord", "horrifyingBane"), + optinalRuleLevelDependentBane: game.settings.get('demonlord', 'optinalRuleLevelDependentBane') } } @@ -188,6 +190,15 @@ export const registerSettings = function () { config: false, }) + game.settings.register('demonlord', 'optinalRuleLevelDependentBane', { + name: game.i18n.localize('DL.SettingOptinalRuleLevelDependentBane'), + hint: game.i18n.localize('DL.SettingOptinalRuleLevelDependentBaneHint'), + default: false, + scope: 'world', + type: Boolean, + config: false, + }) + game.settings.register('demonlord', 'optionalRuleDieRollsMode', { name: game.i18n.localize('DL.SettingOptionalRuleDieRollsMode'), scope: 'world', @@ -372,7 +383,7 @@ export const registerSettings = function () { default: true, scope: 'world', type: Boolean, - config: true, + config: false, }) game.settings.register("demonlord", "concentrationEffect", { name: game.i18n.localize('DL.SettingConcentrationEffect'), diff --git a/src/templates/setting/optionalrules.hbs b/src/templates/setting/optionalrules.hbs index d9acc477..12056297 100644 --- a/src/templates/setting/optionalrules.hbs +++ b/src/templates/setting/optionalrules.hbs @@ -22,9 +22,23 @@ +
+

{{localize "DL.SettingOptinalRuleExceedsByFiveHint"}}

+
+
+
+ + +

{{localize "DL.SettingHorrifyingBaneHint"}}

+
+
+ + +

{{localize "DL.SettingOptinalRuleLevelDependentBaneHint"}}

+ https://somniacdelusions.wordpress.com/2019/04/17/sotdl-house-rules