From a889943efc169237d33ce3eb5ddc6ae736dc2569 Mon Sep 17 00:00:00 2001 From: jalensailin Date: Sat, 8 Jun 2024 01:54:17 -0400 Subject: [PATCH] replace mergeObject with foundry.utils.mergeObject --- module/actor/actor-sheet.js | 2 +- module/actor/actor.js | 13 +++++-------- module/item/item-sheet.js | 2 +- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 891b65a..ea67fdf 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -14,7 +14,7 @@ import { export default class DeltaGreenActorSheet extends ActorSheet { /** @override */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { classes: ["deltagreen", "sheet", "actor"], template: "systems/deltagreen/templates/actor/actor-sheet.html", width: 700, diff --git a/module/actor/actor.js b/module/actor/actor.js index e0b3942..f6f22de 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -74,15 +74,13 @@ export default class DeltaGreenActor extends Actor { system.wp.max = system.statistics.pow.value; - try{ + try { system.health.max = Math.ceil( (system.statistics.con.value + system.statistics.str.value) / 2, ); - } - catch(ex){ + } catch (ex) { system.health.max = 10; } - system.skills.ritual = { label: "Ritual", @@ -229,10 +227,9 @@ export default class DeltaGreenActor extends Actor { system.sanity.adaptations.helplessness.isAdapted = false; } - if(system.sanity.value <= system.sanity.currentBreakingPoint){ + if (system.sanity.value <= system.sanity.currentBreakingPoint) { system.sanity.breakingPointHit = true; - } - else{ + } else { system.sanity.breakingPointHit = false; } @@ -277,7 +274,7 @@ export default class DeltaGreenActor extends Actor { static async create(data, options = {}) { data.prototypeToken = data.prototypeToken || {}; if (data.type === "agent") { - mergeObject( + foundry.utils.mergeObject( data.prototypeToken, { actorLink: true, // this will make the 'Link Actor Data' option for a token is checked by default. So changes to the token sheet will reflect to the actor sheet. diff --git a/module/item/item-sheet.js b/module/item/item-sheet.js index 84d0207..e2fbeb9 100644 --- a/module/item/item-sheet.js +++ b/module/item/item-sheet.js @@ -7,7 +7,7 @@ export default class DeltaGreenItemSheet extends ItemSheet { /** @override */ static get defaultOptions() { - return mergeObject(super.defaultOptions, { + return foundry.utils.mergeObject(super.defaultOptions, { classes: ["deltagreen", "sheet", "item"], width: 520, height: 600,