Fixed bugs with effects
they were not providing advantage or conditional benefits
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { pick } from 'lodash';
|
import { pick } from 'lodash';
|
||||||
|
|
||||||
export default function aggregateEffect({node, linkedNode, link}){
|
export default function aggregateEffect({ node, linkedNode, link }) {
|
||||||
if (link.data !== 'effect') return;
|
if (link.data !== 'effect') return;
|
||||||
// store the effect aggregator, its presence indicates that the variable is
|
// store the effect aggregator, its presence indicates that the variable is
|
||||||
// targeted by effects
|
// targeted by effects
|
||||||
@@ -38,6 +38,7 @@ export default function aggregateEffect({node, linkedNode, link}){
|
|||||||
operation: linkedNode.data.operation,
|
operation: linkedNode.data.operation,
|
||||||
amount: effectAmount,
|
amount: effectAmount,
|
||||||
type: linkedNode.data.type,
|
type: linkedNode.data.type,
|
||||||
|
text: linkedNode.data.text,
|
||||||
// ancestors: linkedNode.data.ancestors,
|
// ancestors: linkedNode.data.ancestors,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,14 +46,13 @@ export default function aggregateEffect({node, linkedNode, link}){
|
|||||||
const aggregator = node.data.effectAggregator;
|
const aggregator = node.data.effectAggregator;
|
||||||
// Get the result of the effect
|
// Get the result of the effect
|
||||||
const result = linkedNode.data.amount?.value;
|
const result = linkedNode.data.amount?.value;
|
||||||
// Skip aggregating if the result is not resolved completely
|
|
||||||
if (typeof result === 'string' || result === undefined) return;
|
|
||||||
// Aggregate the effect based on its operation
|
// Aggregate the effect based on its operation
|
||||||
switch(linkedNode.data.operation){
|
switch (linkedNode.data.operation) {
|
||||||
case 'base':
|
case 'base':
|
||||||
// Take the largest base value
|
// Take the largest base value
|
||||||
if (Number.isFinite(result)){
|
if (Number.isFinite(result)) {
|
||||||
if(Number.isFinite(aggregator.base)){
|
if (Number.isFinite(aggregator.base)) {
|
||||||
aggregator.base = Math.max(aggregator.base, result);
|
aggregator.base = Math.max(aggregator.base, result);
|
||||||
} else {
|
} else {
|
||||||
aggregator.base = result;
|
aggregator.base = result;
|
||||||
|
|||||||
@@ -24,14 +24,6 @@
|
|||||||
>
|
>
|
||||||
<v-icon>mdi-help</v-icon>
|
<v-icon>mdi-help</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-switch
|
|
||||||
v-if="tab === 0"
|
|
||||||
:input-value="showPropertyHelp"
|
|
||||||
append-icon="mdi-help"
|
|
||||||
hide-details
|
|
||||||
flat
|
|
||||||
@change="propertyHelpChanged"
|
|
||||||
/>
|
|
||||||
<text-field
|
<text-field
|
||||||
v-if="tab === 2"
|
v-if="tab === 2"
|
||||||
prepend-inner-icon="mdi-magnify"
|
prepend-inner-icon="mdi-magnify"
|
||||||
|
|||||||
Reference in New Issue
Block a user