Update modifiers syntax

This commit is contained in:
thepaperpilot 2022-07-26 15:37:50 -05:00
parent bc420e092e
commit 4577ac05fe
3 changed files with 6 additions and 68 deletions

View file

@ -368,8 +368,11 @@ const layer = createLayer(id, () => {
gainResource: points,
roundUpCost: true,
gainModifier: createSequentialModifier(
createExponentialModifier(2, "Because I felt like it"),
createAdditiveModifier(1, "Nice modifier")
createExponentialModifier(() => ({
exponent: 2,
description: "Because I felt like it"
})),
createAdditiveModifier(() => ({ addend: 1, description: "Nice modifier" }))
) as WithRequired<Modifier, "description" | "revert">
}));

View file

@ -112,7 +112,7 @@ const layer = createLayer(id, () => {
scaling: createPolynomialScaling(10, 0.5),
baseResource: main.points,
gainResource: points,
modifyGainAmount: createMultiplicativeModifier(c.otherThingy)
modifyGainAmount: createMultiplicativeModifier(() => ({ multiplier: c.otherThingy }))
}));
const treeNode = createLayerTreeNode(() => ({

View file

@ -1,65 +0,0 @@
/**
* @module
* @hidden
*/
import { main } from "data/projEntry";
import { createCumulativeConversion, createPolynomialScaling } from "features/conversion";
import { jsx } from "features/feature";
import { createReset } from "features/reset";
import MainDisplay from "features/resources/MainDisplay.vue";
import { createResource } from "features/resources/resource";
import { addTooltip } from "features/tooltips/tooltip";
import { createResourceTooltip } from "features/trees/tree";
import { BaseLayer, createLayer } from "game/layers";
import type { DecimalSource } from "util/bignum";
import { render } from "util/vue";
import { createLayerTreeNode, createResetButton } from "../common";
const id = "p";
const layer = createLayer(id, function (this: BaseLayer) {
const name = "Prestige";
const color = "#4BDC13";
const points = createResource<DecimalSource>(0, "prestige points");
const conversion = createCumulativeConversion(() => ({
scaling: createPolynomialScaling(10, 0.5),
baseResource: main.points,
gainResource: points,
roundUpCost: true
}));
const reset = createReset(() => ({
thingsToReset: (): Record<string, unknown>[] => [layer]
}));
const treeNode = createLayerTreeNode(() => ({
layerID: id,
color,
reset
}));
addTooltip(treeNode, {
display: createResourceTooltip(points),
pinnable: true
});
const resetButton = createResetButton(() => ({
conversion,
tree: main.tree,
treeNode
}));
return {
name,
color,
points,
display: jsx(() => (
<>
<MainDisplay resource={points} color={color} />
{render(resetButton)}
</>
)),
treeNode
};
});
export default layer;