mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
Renamed groupAttack.nr to groupAttack.numAttackers
This commit is contained in:
parent
393363a7ee
commit
f42fa2668b
4 changed files with 8 additions and 8 deletions
|
|
@ -78,9 +78,9 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
|
||||||
this.config.selectedMessageMode = data.selectedMessageMode;
|
this.config.selectedMessageMode = data.selectedMessageMode;
|
||||||
|
|
||||||
if (data.damageOptions) {
|
if (data.damageOptions) {
|
||||||
const groupAttackNr = data.damageOptions.groupAttack?.nr;
|
const numAttackers = data.damageOptions.groupAttack?.numAttackers;
|
||||||
if (typeof groupAttackNr !== 'number' || groupAttackNr % 1 !== 0) {
|
if (typeof numAttackers !== 'number' || numAttackers % 1 !== 0) {
|
||||||
data.damageOptions.groupAttack.nr = null;
|
data.damageOptions.groupAttack.numAttackers = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
foundry.utils.mergeObject(this.config.damageOptions, data.damageOptions);
|
foundry.utils.mergeObject(this.config.damageOptions, data.damageOptions);
|
||||||
|
|
@ -98,7 +98,7 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
|
||||||
const range = this.config.damageOptions.groupAttack.range;
|
const range = this.config.damageOptions.groupAttack.range;
|
||||||
const groupAttackTokens = game.system.api.fields.ActionFields.DamageField.getGroupAttackTokens(actorId, range);
|
const groupAttackTokens = game.system.api.fields.ActionFields.DamageField.getGroupAttackTokens(actorId, range);
|
||||||
|
|
||||||
this.config.damageOptions.groupAttack.nr = groupAttackTokens.length;
|
this.config.damageOptions.groupAttack.numAttackers = groupAttackTokens.length;
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -294,7 +294,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
config.damageOptions = {
|
config.damageOptions = {
|
||||||
groupAttack: this.damage.groupAttack
|
groupAttack: this.damage.groupAttack
|
||||||
? {
|
? {
|
||||||
nr: Math.max(groupAttackTokens.length, 1),
|
numAttackers: Math.max(groupAttackTokens.length, 1),
|
||||||
range: this.damage.groupAttack
|
range: this.damage.groupAttack
|
||||||
}
|
}
|
||||||
: null
|
: null
|
||||||
|
|
|
||||||
|
|
@ -170,11 +170,11 @@ export default class DamageRoll extends DHRoll {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.damageOptions.groupAttack?.nr > 1 && isHitpointPart) {
|
if (config.damageOptions.groupAttack?.numAttackers > 1 && isHitpointPart) {
|
||||||
const damageTypes = [foundry.dice.terms.Die, foundry.dice.terms.NumericTerm];
|
const damageTypes = [foundry.dice.terms.Die, foundry.dice.terms.NumericTerm];
|
||||||
for (const term of part.roll.terms) {
|
for (const term of part.roll.terms) {
|
||||||
if (damageTypes.some(type => term instanceof type)) {
|
if (damageTypes.some(type => term instanceof type)) {
|
||||||
term.number *= config.damageOptions.groupAttack.nr;
|
term.number *= config.damageOptions.groupAttack.numAttackers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@
|
||||||
<legend>{{localize "DAGGERHEART.ACTIONS.Settings.groupAttack.label"}}</legend>
|
<legend>{{localize "DAGGERHEART.ACTIONS.Settings.groupAttack.label"}}</legend>
|
||||||
|
|
||||||
<div class="group-attack-inner-container">
|
<div class="group-attack-inner-container">
|
||||||
<input type="text" data-dtype="Number" name="damageOptions.groupAttack.nr" value="{{damageOptions.groupAttack.nr}}" />
|
<input type="text" data-dtype="Number" name="damageOptions.groupAttack.numAttackers" value="{{damageOptions.groupAttack.numAttackers}}" />
|
||||||
|
|
||||||
<div class="group-attack-tools">
|
<div class="group-attack-tools">
|
||||||
<select name="damageOptions.groupAttack.range">
|
<select name="damageOptions.groupAttack.range">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue