Buffs no longer have the "applied" field, it was redundant
Because children of actions are always inactive in the new engine, buffs that are children of actions are inactive while buffs elsewhere on the character sheet are active, making it redundant to keep the extra field
This commit is contained in:
@@ -19,7 +19,6 @@ export default function computeInactiveStatus(node){
|
||||
function isActive(prop){
|
||||
if (prop.disabled) return false;
|
||||
switch (prop.type){
|
||||
case 'buff': return !!prop.applied;
|
||||
case 'item': return !!prop.equipped;
|
||||
case 'spell': return !!prop.prepared || !!prop.alwaysPrepared;
|
||||
case 'note': return false;
|
||||
|
||||
@@ -21,8 +21,9 @@ function discoverInlineCalculationFields(prop, schemas){
|
||||
prop._computationDetails.inlineCalculations.push(inlineCalcObj);
|
||||
// Extract the calculations and store them on the property
|
||||
let string = inlineCalcObj.text;
|
||||
// If there is no text, delete the whole field
|
||||
if (!string){
|
||||
delete inlineCalcObj.hash;
|
||||
unset(prop, calcKey);
|
||||
return;
|
||||
}
|
||||
const inlineCalcHash = cyrb53(inlineCalcObj.text);
|
||||
|
||||
@@ -8,12 +8,6 @@ export default function(){
|
||||
const byAncestor = (propId, note) => assertDeactivatedByAncestor(computation, propId, note);
|
||||
const active = (propId, note) => assertActive(computation, propId, note);
|
||||
|
||||
// Buffs
|
||||
bySelf('buffNotAppliedId');
|
||||
byAncestor('buffNotAppliedChildId');
|
||||
active('buffAppliedId');
|
||||
active('buffAppliedChildId');
|
||||
|
||||
// Items
|
||||
active('itemUnequippedId', 'Unequipped items should be active');
|
||||
byAncestor('itemUnequippedChildId', 'Children of unequipped items should be inactive');
|
||||
@@ -53,28 +47,6 @@ function assertActive(computation, propId, note){
|
||||
}
|
||||
|
||||
var testProperties = [
|
||||
// Buffs
|
||||
clean({
|
||||
_id: 'buffNotAppliedId',
|
||||
type: 'buff',
|
||||
ancestors: [{id: 'charId'}],
|
||||
}),
|
||||
clean({
|
||||
_id: 'buffNotAppliedChildId',
|
||||
type: 'folder',
|
||||
ancestors: [{id: 'charId'}, {id: 'buffNotAppliedId'}],
|
||||
}),
|
||||
clean({
|
||||
_id: 'buffAppliedId',
|
||||
type: 'buff',
|
||||
applied: true,
|
||||
ancestors: [{id: 'charId'}],
|
||||
}),
|
||||
clean({
|
||||
_id: 'buffAppliedChildId',
|
||||
type: 'folder',
|
||||
ancestors: [{id: 'charId'}, {id: 'buffAppliedId'}],
|
||||
}),
|
||||
// Items
|
||||
clean({
|
||||
_id: 'itemUnequippedId',
|
||||
|
||||
Reference in New Issue
Block a user