Skip to content

Commit

Permalink
Allow item alterations of hardness to use non-integer values (#14499)
Browse files Browse the repository at this point in the history
  • Loading branch information
DocSchlock authored Jul 20, 2024
1 parent 9d3e9f3 commit 7df8d9b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class ItemAlteration extends foundry.abstract.DataModel<RuleElementPF2e, ItemAlt
const system = data.item.system;
const value = data.alteration.value;
const newValue = AELikeRuleElement.getNewValue(this.mode, system.hardness, value);
system.hardness = Math.max(newValue, 0);
system.hardness = Math.max(Math.trunc(newValue), 0);
this.#adjustCreatureShieldData(data.item);
}
return;
Expand Down
2 changes: 1 addition & 1 deletion src/module/rules/rule-element/item-alteration/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const ITEM_ALTERATION_VALIDATORS = {
required: true,
choices: ["add", "downgrade", "multiply", "override", "remove", "subtract", "upgrade"],
}),
value: new fields.NumberField({ required: true, integer: true, nullable: false, positive: true } as const),
value: new fields.NumberField({ required: true, nullable: false, min: -20, max: 20 } as const),
}),
"hp-max": new ItemAlterationValidator({
itemType: new fields.StringField({ required: true, choices: Array.from(PHYSICAL_ITEM_TYPES) }),
Expand Down

0 comments on commit 7df8d9b

Please sign in to comment.