Moved action system to new tree format

This commit is contained in:
Thaum Rystra
2023-09-28 14:49:32 +02:00
parent e6963ec865
commit 3bd2806bc6
15 changed files with 25 additions and 26 deletions

View File

@@ -13,8 +13,8 @@ export default function computeInactiveStatus(node: TreeNode<CreatureProperty>):
if (!childrenActive(prop)) {
// Mark children as inactive due to ancestor
walkDown(node.children, child => {
child.node.inactive = true;
child.node.deactivatedByAncestor = true;
child.doc.inactive = true;
child.doc.deactivatedByAncestor = true;
});
}
}
@@ -23,9 +23,8 @@ function isActive(prop: CreatureProperty): boolean {
if (prop.disabled) return false;
if (isSpell(prop)) {
return !!prop.prepared || !!prop.alwaysPrepared;
} else {
return true;
}
return true;
}
function childrenActive(prop): boolean {