Skip to content

Commit

Permalink
improve AC override checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Muttley committed Oct 7, 2023
1 parent 91e2bf7 commit 991fef1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions system/src/documents/ActorSD.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -865,10 +865,11 @@ export default class ActorSD extends Actor {
let newArmorClass = baseArmorClass;
let armorMasteryBonus = 0;

if (Number.isInteger(this.system.attributes.ac.override)) {
const acOverride = this.system.attributes.ac?.override ?? null;
if (Number.isInteger(acOverride)) {
// AC is being overridden by an effect so we just use that value
// and ignore everything else
newArmorClass = this.system.attributes.ac.override;
newArmorClass = acOverride;
}
else {
const equippedArmor = this.items.filter(
Expand Down
8 changes: 4 additions & 4 deletions system/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
"shared_details": {
"alignment": "neutral",
"attributes": {
"ac": {
"value": 10
},
"hp": {
"max": 0,
"value": 0
Expand Down Expand Up @@ -45,9 +48,6 @@
"attributes": {
"hp": {
"hd": 0
},
"ac": {
"value": 10
}
},
"darkAdapted": true,
Expand Down Expand Up @@ -370,7 +370,7 @@
},
"Talent": {
"templates": ["common"],
"level": 1,
"level": 0,
"talentClass": "level"
},
"Wand": {
Expand Down

0 comments on commit 991fef1

Please sign in to comment.