Skip to content

Commit

Permalink
Added check for whether item is equipped
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed May 17, 2024
1 parent d0bd5a0 commit e589b09
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,17 @@ export function checkAndHandleSpecialCase(item, _total, diff, _situation) {
switch (slug) {
case "aeon-stone-pearly-white-spindle":
game.settings.get(MODULE_ID, "automate-item.aeon-pearly-white");
if (item.system.usage.value !== "worn") {
break;
}
const health = Math.min(
Math.floor(diff / 60),
actor.system.attributes.hp.max - actor.system.attributes.hp.value
);
if (health > 0) {
const DamageRoll = CONFIG.Dice.rolls.find((r) => r.name === "DamageRoll");
const DamageRoll = CONFIG.Dice.rolls.find(
(r) => r.name === "DamageRoll"
);
new DamageRoll(`{${health}}[Healing]`).toMessage({
flavor: item.name,
speaker: ChatMessage.getSpeaker(),
Expand Down

0 comments on commit e589b09

Please sign in to comment.