The same math done two different ways is giving different results
Summary: See details.
From Power Cards in the Spirit Island Analytics space. You don't need to understand the details of data structure; the key is in how _minus
is trying to subtract 1 two different ways.
+$qtyProp
Power Cards -> _instances -> _filter(Thresholds -> $qtyProp -> _isNonEmpty) ->
""
Case A: [[Thresholds -> $qtyProp -> +$val
_if(Gives Elements -> _resolveTags -> _contains($qtyProp._self ->Associated Threshold Item), $val -> _minus(1), $val)
]]
Case B: [[Thresholds -> $qtyProp ->_minus(_if(Gives Elements -> _resolveTags -> _contains($qtyProp._self ->Associated Threshold Item), 1, 0))
]]
""
The initial +$qtyProp
is binding a Property such as Qty Moon
or Qty Fire
. The number being displayed is the value of that Property on all Power Cards where it's non-empty, minus 1 if the Power Card has the corresponding element in its Gives Elements tagset.
Case A works: it binds the base number to $val
, then checks whether the Power Card's Gives Elements
property contains the Thing associated with the Qty property. If so, it resolves to $val - 1
, otherwise $val
.
Case B does not work. It gets the base number, then uses _minus
to subtract either 1 or 0 depending on the exact same _if
condition... but in practice it always subtracts 0, leaving the value unchanged.