mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-08 13:48:11 +02:00
Roll All Save button + Merge Attack & Roll Chat message
This commit is contained in:
parent
19cc10a3c9
commit
9f3c587d83
18 changed files with 355 additions and 113 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue