mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +02:00
Moved default hope/fear/advantage/disadvantage under system/rules/roll and changed them to be dice indexs
This commit is contained in:
parent
7af3f07a26
commit
b50f011361
8 changed files with 79 additions and 62 deletions
14
lang/en.json
14
lang/en.json
|
|
@ -237,10 +237,6 @@
|
|||
"unequip": "Unequip",
|
||||
"useItem": "Use Item"
|
||||
},
|
||||
"defaultHopeDice": "Default Hope Dice",
|
||||
"defaultFearDice": "Default Fear Dice",
|
||||
"defaultAdvantageDice": "Default Advantage Dice",
|
||||
"defaultDisadvantageDice": "Default Disadvantage Dice",
|
||||
"disadvantageSources": {
|
||||
"label": "Disadvantage Sources",
|
||||
"hint": "Add single words or short text as reminders and hints of what a character has disadvantage on."
|
||||
|
|
@ -306,6 +302,16 @@
|
|||
},
|
||||
"noPartner": "No Partner selected"
|
||||
},
|
||||
"Creature": {
|
||||
"rules": {
|
||||
"roll": {
|
||||
"hope": { "label": "Default Hope Dice Index", "hint": "Index for the default hope dice. 0=d4, 1=d6, 2=d8, 3=d10, 4=d12, 5=d20" },
|
||||
"fear": { "label": "Default Fear Dice Index", "hint": "Index for the default fear dice. 0=d4, 1=d6, 2=d8, 3=d10, 4=d12, 5=d20" },
|
||||
"advantage": { "label": "Default Advantage Dice Index", "hint": "Index for the default advantage dice. 0=d4, 1=d6, 2=d8, 3=d10, 4=d12, 5=d20" },
|
||||
"disadvantage": { "label": "Default Disadvantage Dice Index", "hint": "Index for the default disadvantage dice. 0=d4, 1=d6, 2=d8, 3=d10, 4=d12, 5=d20" }
|
||||
}
|
||||
}
|
||||
},
|
||||
"Environment": {
|
||||
"FIELDS": {
|
||||
"description": {
|
||||
|
|
|
|||
|
|
@ -176,11 +176,11 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
|
||||
this.config.roll.advantage = this.config.roll.advantage === advantage ? 0 : advantage;
|
||||
|
||||
if (this.config.roll.advantage === 1 && this.config.data.rules.roll.defaultAdvantageDice) {
|
||||
const faces = Number.parseInt(this.config.data.rules.roll.defaultAdvantageDice);
|
||||
if (this.config.roll.advantage === 1 && this.config.data.rules.roll.advantageFaces) {
|
||||
const faces = Number.parseInt(this.config.data.rules.roll.advantageFaces);
|
||||
this.roll.advantageFaces = Number.isNaN(faces) ? this.roll.advantageFaces : faces;
|
||||
} else if (this.config.roll.advantage === -1 && this.config.data.rules.roll.defaultDisadvantageDice) {
|
||||
const faces = Number.parseInt(this.config.data.rules.roll.defaultDisadvantageDice);
|
||||
} else if (this.config.roll.advantage === -1 && this.config.data.rules.roll.disadvantageFaces) {
|
||||
const faces = Number.parseInt(this.config.data.rules.roll.disadvantageFaces);
|
||||
this.roll.advantageFaces = Number.isNaN(faces) ? this.roll.advantageFaces : faces;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -261,24 +261,6 @@ export default class DhCharacter extends DhCreature {
|
|||
})
|
||||
}
|
||||
}),
|
||||
dualityRoll: new fields.SchemaField({
|
||||
defaultHopeDice: new fields.NumberField({
|
||||
nullable: false,
|
||||
required: true,
|
||||
integer: true,
|
||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
||||
initial: 12,
|
||||
label: 'DAGGERHEART.ACTORS.Character.defaultHopeDice'
|
||||
}),
|
||||
defaultFearDice: new fields.NumberField({
|
||||
nullable: false,
|
||||
required: true,
|
||||
integer: true,
|
||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
||||
initial: 12,
|
||||
label: 'DAGGERHEART.ACTORS.Character.defaultFearDice'
|
||||
})
|
||||
}),
|
||||
burden: new fields.SchemaField({
|
||||
ignore: new fields.BooleanField({ label: 'DAGGERHEART.ACTORS.Character.burden.ignore.label' })
|
||||
}),
|
||||
|
|
@ -287,29 +269,49 @@ export default class DhCharacter extends DhCreature {
|
|||
label: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.hint'
|
||||
}),
|
||||
defaultAdvantageDice: new fields.NumberField({
|
||||
nullable: true,
|
||||
hope: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
||||
initial: null,
|
||||
label: 'DAGGERHEART.ACTORS.Character.defaultAdvantageDice'
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 4,
|
||||
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.hope.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.hope.hint'
|
||||
}),
|
||||
defaultDisadvantageDice: new fields.NumberField({
|
||||
nullable: true,
|
||||
fear: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
||||
initial: null,
|
||||
label: 'DAGGERHEART.ACTORS.Character.defaultDisadvantageDice'
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 4,
|
||||
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.fear.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.fear.hint'
|
||||
}),
|
||||
advantage: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 1,
|
||||
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.advantage.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.advantage.hint'
|
||||
}),
|
||||
comboDieIndex: new fields.NumberField({
|
||||
disadvantage: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 1,
|
||||
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.hint'
|
||||
}),
|
||||
comboDie: new fields.NumberField({
|
||||
integer: true,
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 0,
|
||||
})
|
||||
}),
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
@ -765,7 +767,7 @@ export default class DhCharacter extends DhCreature {
|
|||
});
|
||||
break;
|
||||
case 'comboStrikes':
|
||||
this.rules.comboDieIndex += 1;
|
||||
this.rules.roll.comboDie += 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -824,6 +826,13 @@ export default class DhCharacter extends DhCreature {
|
|||
isReversed: true
|
||||
};
|
||||
|
||||
/* Add convience <dice>Faces properties for all dice */
|
||||
const { hope, fear, advantage, disadvantage } = this.rules.roll;
|
||||
const dice = { hope, fear, advantage, disadvantage };
|
||||
for (const dieKey of Object.keys(dice)) {
|
||||
this.rules.roll[`${dieKey}Faces`] = CONFIG.DH.GENERAL.dieFaces[dice[dieKey]];
|
||||
}
|
||||
|
||||
this.attack.damage.parts.hitPoints.value.custom.formula = `@prof${this.basicAttackDamageDice}${this.rules.attack.damage.bonus ? ` + ${this.rules.attack.damage.bonus}` : ''}`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,21 +63,23 @@ export default class DhCompanion extends DhCreature {
|
|||
})
|
||||
}),
|
||||
roll: new fields.SchemaField({
|
||||
defaultAdvantageDice: new fields.NumberField({
|
||||
nullable: true,
|
||||
advantage: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
||||
initial: null,
|
||||
label: 'DAGGERHEART.ACTORS.Character.defaultAdvantageDice'
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 1,
|
||||
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.advantage.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.advantage.hint'
|
||||
}),
|
||||
defaultDisadvantageDice: new fields.NumberField({
|
||||
nullable: true,
|
||||
disadvantage: new fields.NumberField({
|
||||
required: true,
|
||||
integer: true,
|
||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
||||
initial: null,
|
||||
label: 'DAGGERHEART.ACTORS.Character.defaultDisadvantageDice'
|
||||
min: 0,
|
||||
max: 5,
|
||||
initial: 1,
|
||||
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.label',
|
||||
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.disadvantage.hint'
|
||||
}),
|
||||
})
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export default class DualityRoll extends D20Roll {
|
|||
this.rallyChoices = this.setRallyChoices();
|
||||
this.guaranteedCritical = options.guaranteedCritical;
|
||||
|
||||
const advantageFaces = data.rules?.roll?.defaultAdvantageDice ? Number.parseInt(data.rules.roll.defaultAdvantageDice) : 6
|
||||
const advantageFaces = data.rules?.roll?.advantageFaces ? Number.parseInt(data.rules.roll.advantageFaces) : 6
|
||||
this.advantageFaces = Number.isNaN(advantageFaces) ? 6 : advantageFaces;
|
||||
}
|
||||
|
||||
|
|
@ -137,11 +137,11 @@ export default class DualityRoll extends D20Roll {
|
|||
}
|
||||
|
||||
this.terms[0] = new game.system.api.dice.diceTypes.HopeDie({
|
||||
faces: this.data.rules.dualityRoll?.defaultHopeDice ?? 12
|
||||
faces: this.data.rules.roll?.hopeFaces ?? 12
|
||||
});
|
||||
this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
|
||||
this.terms[2] = new game.system.api.dice.diceTypes.FearDie({
|
||||
faces: this.data.rules.dualityRoll?.defaultFearDice ?? 12
|
||||
faces: this.data.rules.roll?.fearFaces ?? 12
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -357,8 +357,8 @@
|
|||
},
|
||||
"changes": [
|
||||
{
|
||||
"key": "system.rules.dualityRoll.defaultHopeDice",
|
||||
"value": "d8",
|
||||
"key": "system.rules.roll.hope",
|
||||
"value": 2,
|
||||
"priority": null,
|
||||
"type": "override"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,8 +320,8 @@
|
|||
},
|
||||
"changes": [
|
||||
{
|
||||
"key": "system.rules.dualityRoll.defaultFearDice",
|
||||
"value": "d20",
|
||||
"key": "system.rules.roll.fear",
|
||||
"value": 5,
|
||||
"priority": null,
|
||||
"type": "override"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,9 +192,9 @@
|
|||
},
|
||||
"changes": [
|
||||
{
|
||||
"key": "system.rules.dualityRoll.defaultHopeDice",
|
||||
"key": "system.rules.roll.hope",
|
||||
"mode": 5,
|
||||
"value": "d10",
|
||||
"value": 3,
|
||||
"priority": null
|
||||
}
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue