Roll All Save button + Merge Attack & Roll Chat message

This commit is contained in:
Dapoolp 2025-07-01 16:40:20 +02:00
parent 19cc10a3c9
commit 9f3c587d83
18 changed files with 355 additions and 113 deletions

View file

@ -1,6 +1,7 @@
import DamageSelectionDialog from '../applications/damageSelectionDialog.mjs';
import { GMUpdateEvent, socketEvent } from '../helpers/socket.mjs';
import DamageReductionDialog from '../applications/damageReductionDialog.mjs';
import Resources from '../applications/resources.mjs';
export default class DhpActor extends Actor {
async _preCreate(data, options, user) {
@ -414,6 +415,9 @@ export default class DhpActor extends Actor {
let updates = { actor: { target: this, resources: {} }, armor: { target: this.system.armor, resources: {} } };
resources.forEach(r => {
switch (r.type) {
case 'fear':
ui.resources.updateFear(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.Fear) + r.value);
break;
case 'armorStack':
updates.armor.resources['system.marks.value'] = Math.max(
Math.min(this.system.armor.system.marks.value + r.value, this.system.armorScore),
@ -429,7 +433,6 @@ export default class DhpActor extends Actor {
}
});
Object.values(updates).forEach(async u => {
console.log(updates, u)
if (Object.keys(u.resources).length > 0) {
if (game.user.isGM) {
await u.target.update(u.resources);