mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Feature/416 reaction roll query (#445)
* Create files * before fixing damage roll on main * g * Player query for Roll All Save * Exec Save message as GM for players * Fix DsN bug
This commit is contained in:
parent
2fbbf98f88
commit
2be4ee8857
11 changed files with 91 additions and 38 deletions
|
|
@ -1,5 +1,4 @@
|
|||
import { emitAsGM, GMUpdateEvent } from '../systemRegistration/socket.mjs';
|
||||
import DamageReductionDialog from '../applications/dialogs/damageReductionDialog.mjs';
|
||||
import { LevelOptionType } from '../data/levelTier.mjs';
|
||||
import DHFeature from '../data/item/feature.mjs';
|
||||
import { damageKeyToNumber } from '../helpers/utils.mjs';
|
||||
|
|
@ -483,10 +482,14 @@ export default class DhpActor extends Actor {
|
|||
this.#canReduceDamage(hpDamage.value, hpDamage.damageTypes)
|
||||
) {
|
||||
const armorStackResult = await this.owner.query('armorStack', {
|
||||
actorId: this.uuid,
|
||||
damage: hpDamage.value,
|
||||
type: [...hpDamage.damageTypes]
|
||||
});
|
||||
actorId: this.uuid,
|
||||
damage: hpDamage.value,
|
||||
type: [...hpDamage.damageTypes]
|
||||
},
|
||||
{
|
||||
timeout: 30000
|
||||
}
|
||||
);
|
||||
if (armorStackResult) {
|
||||
const { modifiedDamage, armorSpent, stressSpent } = armorStackResult;
|
||||
updates.find(u => u.key === 'hitPoints').value = modifiedDamage;
|
||||
|
|
@ -638,7 +641,3 @@ export default class DhpActor extends Actor {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const registerDHActorHooks = () => {
|
||||
CONFIG.queries.armorStack = DamageReductionDialog.armorStackQuery;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ export default class DHToken extends TokenDocument {
|
|||
for (const [name, field] of Object.entries(schema.fields)) {
|
||||
const p = _path.concat([name]);
|
||||
if (field instanceof foundry.data.fields.NumberField) attributes.value.push(p);
|
||||
if (field instanceof foundry.data.fields.BooleanField && field.options.isAttributeChoice) attributes.value.push(p);
|
||||
if (field instanceof foundry.data.fields.StringField) attributes.value.push(p);
|
||||
if (field instanceof foundry.data.fields.ArrayField) attributes.value.push(p);
|
||||
const isSchema = field instanceof foundry.data.fields.SchemaField;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue