mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +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",
|
"unequip": "Unequip",
|
||||||
"useItem": "Use Item"
|
"useItem": "Use Item"
|
||||||
},
|
},
|
||||||
"defaultHopeDice": "Default Hope Dice",
|
|
||||||
"defaultFearDice": "Default Fear Dice",
|
|
||||||
"defaultAdvantageDice": "Default Advantage Dice",
|
|
||||||
"defaultDisadvantageDice": "Default Disadvantage Dice",
|
|
||||||
"disadvantageSources": {
|
"disadvantageSources": {
|
||||||
"label": "Disadvantage Sources",
|
"label": "Disadvantage Sources",
|
||||||
"hint": "Add single words or short text as reminders and hints of what a character has disadvantage on."
|
"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"
|
"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": {
|
"Environment": {
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"description": {
|
"description": {
|
||||||
|
|
|
||||||
|
|
@ -176,11 +176,11 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
|
|
||||||
this.config.roll.advantage = this.config.roll.advantage === advantage ? 0 : advantage;
|
this.config.roll.advantage = this.config.roll.advantage === advantage ? 0 : advantage;
|
||||||
|
|
||||||
if (this.config.roll.advantage === 1 && 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.defaultAdvantageDice);
|
const faces = Number.parseInt(this.config.data.rules.roll.advantageFaces);
|
||||||
this.roll.advantageFaces = Number.isNaN(faces) ? this.roll.advantageFaces : faces;
|
this.roll.advantageFaces = Number.isNaN(faces) ? this.roll.advantageFaces : faces;
|
||||||
} else if (this.config.roll.advantage === -1 && 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.defaultDisadvantageDice);
|
const faces = Number.parseInt(this.config.data.rules.roll.disadvantageFaces);
|
||||||
this.roll.advantageFaces = Number.isNaN(faces) ? this.roll.advantageFaces : faces;
|
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({
|
burden: new fields.SchemaField({
|
||||||
ignore: new fields.BooleanField({ label: 'DAGGERHEART.ACTORS.Character.burden.ignore.label' })
|
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',
|
label: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.label',
|
||||||
hint: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.hint'
|
hint: 'DAGGERHEART.ACTORS.Character.roll.guaranteedCritical.hint'
|
||||||
}),
|
}),
|
||||||
defaultAdvantageDice: new fields.NumberField({
|
hope: new fields.NumberField({
|
||||||
nullable: true,
|
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
min: 0,
|
||||||
initial: null,
|
max: 5,
|
||||||
label: 'DAGGERHEART.ACTORS.Character.defaultAdvantageDice'
|
initial: 4,
|
||||||
|
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.hope.label',
|
||||||
|
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.hope.hint'
|
||||||
}),
|
}),
|
||||||
defaultDisadvantageDice: new fields.NumberField({
|
fear: new fields.NumberField({
|
||||||
nullable: true,
|
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
min: 0,
|
||||||
initial: null,
|
max: 5,
|
||||||
label: 'DAGGERHEART.ACTORS.Character.defaultDisadvantageDice'
|
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,
|
integer: true,
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 5,
|
max: 5,
|
||||||
initial: 0,
|
initial: 0,
|
||||||
})
|
})
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -765,7 +767,7 @@ export default class DhCharacter extends DhCreature {
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'comboStrikes':
|
case 'comboStrikes':
|
||||||
this.rules.comboDieIndex += 1;
|
this.rules.roll.comboDie += 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -824,6 +826,13 @@ export default class DhCharacter extends DhCreature {
|
||||||
isReversed: true
|
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}` : ''}`;
|
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({
|
roll: new fields.SchemaField({
|
||||||
defaultAdvantageDice: new fields.NumberField({
|
advantage: new fields.NumberField({
|
||||||
nullable: true,
|
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
min: 0,
|
||||||
initial: null,
|
max: 5,
|
||||||
label: 'DAGGERHEART.ACTORS.Character.defaultAdvantageDice'
|
initial: 1,
|
||||||
|
label: 'DAGGERHEART.ACTORS.Creature.rules.roll.advantage.label',
|
||||||
|
hint: 'DAGGERHEART.ACTORS.Creature.rules.roll.advantage.hint'
|
||||||
}),
|
}),
|
||||||
defaultDisadvantageDice: new fields.NumberField({
|
disadvantage: new fields.NumberField({
|
||||||
nullable: true,
|
|
||||||
required: true,
|
required: true,
|
||||||
integer: true,
|
integer: true,
|
||||||
choices: CONFIG.DH.GENERAL.dieFaces,
|
min: 0,
|
||||||
initial: null,
|
max: 5,
|
||||||
label: 'DAGGERHEART.ACTORS.Character.defaultDisadvantageDice'
|
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.rallyChoices = this.setRallyChoices();
|
||||||
this.guaranteedCritical = options.guaranteedCritical;
|
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;
|
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({
|
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[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
|
||||||
this.terms[2] = new game.system.api.dice.diceTypes.FearDie({
|
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": [
|
"changes": [
|
||||||
{
|
{
|
||||||
"key": "system.rules.dualityRoll.defaultHopeDice",
|
"key": "system.rules.roll.hope",
|
||||||
"value": "d8",
|
"value": 2,
|
||||||
"priority": null,
|
"priority": null,
|
||||||
"type": "override"
|
"type": "override"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -320,8 +320,8 @@
|
||||||
},
|
},
|
||||||
"changes": [
|
"changes": [
|
||||||
{
|
{
|
||||||
"key": "system.rules.dualityRoll.defaultFearDice",
|
"key": "system.rules.roll.fear",
|
||||||
"value": "d20",
|
"value": 5,
|
||||||
"priority": null,
|
"priority": null,
|
||||||
"type": "override"
|
"type": "override"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -192,9 +192,9 @@
|
||||||
},
|
},
|
||||||
"changes": [
|
"changes": [
|
||||||
{
|
{
|
||||||
"key": "system.rules.dualityRoll.defaultHopeDice",
|
"key": "system.rules.roll.hope",
|
||||||
"mode": 5,
|
"mode": 5,
|
||||||
"value": "d10",
|
"value": 3,
|
||||||
"priority": null
|
"priority": null
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue