Implemented berylium relic and some balance tweaking

I can't stop these planes from accelerating insanely towards the end!
This commit is contained in:
thepaperpilot 2023-05-12 18:42:37 -05:00
parent 12a68c02fa
commit 4f0cf58e70
2 changed files with 46 additions and 20 deletions

View file

@ -299,7 +299,7 @@ export const passives = {
}, },
goldRelic: { goldRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>
empowered ? "Each treasure quadruples XP gain" : "Each treasure doubles XP gain" empowered ? "Each treasure gives +20% XP gain" : "Each treasure gives +10% XP gain"
}, },
emeraldRelic: { emeraldRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>
@ -317,7 +317,9 @@ export const passives = {
}, },
beryliumRelic: { beryliumRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>
empowered ? "log(energy) boosts planar speed" : "log(energy)/10 boosts planar speed" empowered
? "log(energy)^0.5 boosts planar speed"
: "log(energy)^0.25 boosts planar speed"
}, },
unobtainiumRelic: { unobtainiumRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>

View file

@ -33,7 +33,12 @@ import Formula, {
calculateMaxAffordable, calculateMaxAffordable,
unrefFormulaSource unrefFormulaSource
} from "game/formulas/formulas"; } from "game/formulas/formulas";
import { FormulaSource, GenericFormula, InvertibleIntegralFormula } from "game/formulas/types"; import {
FormulaSource,
GenericFormula,
InvertibleFormula,
InvertibleIntegralFormula
} from "game/formulas/types";
import { BaseLayer, GenericLayer, createLayer } from "game/layers"; import { BaseLayer, GenericLayer, createLayer } from "game/layers";
import { import {
Modifier, Modifier,
@ -341,7 +346,7 @@ export function createPlane(
let effect: ComputedRef<string>; let effect: ComputedRef<string>;
let modifier: WithRequired<Modifier, "description" | "invert">; let modifier: WithRequired<Modifier, "description" | "invert">;
let previewModifier: WithRequired<Modifier, "invert">; let previewModifier: WithRequired<Modifier, "invert">;
let cost: GenericFormula; let cost: InvertibleFormula;
const costInput = Formula.variable( const costInput = Formula.variable(
computed(() => repeatable.amount.value) computed(() => repeatable.amount.value)
).times(2); ).times(2);
@ -349,7 +354,7 @@ export function createPlane(
case "add": { case "add": {
const addend = Decimal.add(initialCost, 10).times(random() + 0.5); const addend = Decimal.add(initialCost, 10).times(random() + 0.5);
description = `Gain ${format(addend)} ${resource.displayName}/s`; description = `Gain ${format(addend)} ${resource.displayName}/s`;
cost = costInput.add(1).times(initialCost); cost = costInput.add(1).times(1.5).times(initialCost);
costFormula = costFormula.add( costFormula = costFormula.add(
computed(() => computed(() =>
Decimal.sub(n.value, currentN).add(1).times(5).times(addend) Decimal.sub(n.value, currentN).add(1).times(5).times(addend)
@ -369,7 +374,10 @@ export function createPlane(
})); }));
previewModifier = createAdditiveModifier(() => ({ previewModifier = createAdditiveModifier(() => ({
addend: () => addend: () =>
Decimal.add(unref(repeatable.totalAmount), 1).times(addend) Decimal.add(
unref(repeatable.totalAmount),
repeatable.amountToIncrease.value
).times(addend)
})); }));
break; break;
} }
@ -378,7 +386,9 @@ export function createPlane(
description = `Multiply previous ${ description = `Multiply previous ${
resource.displayName resource.displayName
} gain by x${format(multiplier)}.`; } gain by x${format(multiplier)}.`;
cost = costInput.pow_base(multiplier).times(initialCost); cost = costInput
.pow_base(Decimal.times(multiplier, 1.5))
.times(initialCost);
costFormula = costFormula.add( costFormula = costFormula.add(
computed(() => computed(() =>
Decimal.sub(n.value, currentN) Decimal.sub(n.value, currentN)
@ -404,9 +414,10 @@ export function createPlane(
})); }));
previewModifier = createMultiplicativeModifier(() => ({ previewModifier = createMultiplicativeModifier(() => ({
multiplier: () => multiplier: () =>
Decimal.add(unref(repeatable.totalAmount), 1).pow_base( Decimal.add(
multiplier unref(repeatable.totalAmount),
) repeatable.amountToIncrease.value
).pow_base(multiplier)
})); }));
break; break;
} }
@ -453,8 +464,11 @@ export function createPlane(
feature: repeatable, feature: repeatable,
canClick: () => unref(repeatable.canClick), canClick: () => unref(repeatable.canClick),
modifier, modifier,
cost, cost: computed(() =>
previewModifier calculateCost(cost, repeatable.amountToIncrease.value)
),
previewModifier,
showETA: () => !repeatable.maxed.value
}); });
repeatables.push(repeatable); repeatables.push(repeatable);
} }
@ -471,8 +485,7 @@ export function createPlane(
computed(() => computed(() =>
Decimal.sub(n.value, currentN) Decimal.sub(n.value, currentN)
.add(1) .add(1)
.pow_base(5) .pow10()
.pow(effectExponent)
.times(cachedGain[currentN - 1]) .times(cachedGain[currentN - 1])
) )
); );
@ -497,7 +510,7 @@ export function createPlane(
} }
})); }));
cachedGain[n.value] = costFormula.evaluate(); cachedGain[n.value] = costFormula.evaluate();
n.value += 2; n.value += 4;
const clickableVisibility = visibility; const clickableVisibility = visibility;
const title = getPowerName(random); const title = getPowerName(random);
const formula = Formula.variable(prestigeResource).pow(effectExponent).add(1); const formula = Formula.variable(prestigeResource).pow(effectExponent).add(1);
@ -629,14 +642,13 @@ export function createPlane(
computed(() => computed(() =>
Decimal.sub(n.value, currentN) Decimal.sub(n.value, currentN)
.add(1) .add(1)
.sqrt()
.times(3) .times(3)
.pow(effectExponent) .pow(effectExponent)
.times(cachedGain[currentN - 1]) .times(cachedGain[currentN - 1])
) )
); );
cachedGain[n.value] = costFormula.evaluate(); cachedGain[n.value] = costFormula.evaluate();
n.value += 2; n.value += 3;
const barColor = getColor([0.18, 0.2, 0.25], random); const barColor = getColor([0.18, 0.2, 0.25], random);
const bar = createBar(() => ({ const bar = createBar(() => ({
direction: Direction.Right, direction: Direction.Right,
@ -665,10 +677,12 @@ export function createPlane(
) { ) {
let totalDiff = Decimal.times(computedPlanarSpeedModifier.value, diff); let totalDiff = Decimal.times(computedPlanarSpeedModifier.value, diff);
if (main.toolNodes.value.goldRelic != null) { if (main.toolNodes.value.goldRelic != null) {
totalDiff = Decimal.pow( totalDiff = Decimal.times(
isEmpowered("goldRelic") ? 4 : 2, isEmpowered("goldRelic") ? 0.2 : 0.1,
earnedTreasures.value.length earnedTreasures.value.length
).times(totalDiff); )
.add(1)
.times(totalDiff);
} }
xp.value = Decimal.add(totalDiff, xp.value); xp.value = Decimal.add(totalDiff, xp.value);
} }
@ -1153,6 +1167,16 @@ export function createPlane(
).add(1), ).add(1),
description: () => (isEmpowered("coalRelic") ? "Empowered " : "") + relics.coal, description: () => (isEmpowered("coalRelic") ? "Empowered " : "") + relics.coal,
enabled: () => main.toolNodes.value.coalRelic != null enabled: () => main.toolNodes.value.coalRelic != null
})),
createMultiplicativeModifier(() => ({
multiplier: () =>
Decimal.add(main.energy.value, 1)
.log10()
.add(1)
.pow(isEmpowered("beryliumRelic") ? 0.5 : 0.25),
description: () =>
(isEmpowered("beryliumRelic") ? "Empowered " : "") + relics.berylium,
enabled: () => main.toolNodes.value.beryliumRelic != null
})) }))
]); ]);
const computedPlanarSpeedModifier = computed(() => planarSpeedModifier.apply(1)); const computedPlanarSpeedModifier = computed(() => planarSpeedModifier.apply(1));