Implement emerald relic

This commit is contained in:
thepaperpilot 2023-05-12 16:15:42 -05:00
parent 563fcd7e59
commit 0aef78024d
4 changed files with 27 additions and 15 deletions

View file

@ -266,8 +266,8 @@ export const passives = {
gravelRelic: { gravelRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>
empowered empowered
? "+2% plane's resource gain per repeatable purchase" ? "+2% plane's resource gain per repeatable purchase (diminishing)"
: "+1% plane's resource gain per repeatable purchase" : "+1% plane's resource gain per repeatable purchase (diminishing)"
}, },
woodRelic: { woodRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>
@ -304,8 +304,8 @@ export const passives = {
emeraldRelic: { emeraldRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>
empowered empowered
? "Creating portals costs a third the energy" ? "Creating portals costs 20x less energy"
: "Creating portals costs half the energy" : "Creating portals costs 10x less energy"
}, },
platinumRelic: { platinumRelic: {
description: (empowered: boolean) => description: (empowered: boolean) =>

View file

@ -399,7 +399,7 @@ export const empowerer = {
actionDistance: Math.PI / 4, actionDistance: Math.PI / 4,
actions: [ actions: [
deselectAllAction, deselectAllAction,
getIncreaseConnectionsAction(x => x.add(3).pow_base(1000), 16), getIncreaseConnectionsAction(x => x.add(3).pow_base(1000), 24),
togglePoweredAction togglePoweredAction
], ],
canAccept: canAcceptTool, canAccept: canAcceptTool,

View file

@ -1078,9 +1078,12 @@ export function createPlane(
})), })),
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: () => multiplier: () =>
((isEmpowered("diamond") ? 2 : 1) * Decimal.add(
upgrades.filter(u => u.bought.value).length) / 1,
10, ((isEmpowered("diamond") ? 2 : 1) *
upgrades.filter(u => u.bought.value).length) /
10
),
description: () => description: () =>
(isEmpowered("diamond") ? "Empowered " : "") + tools.diamond.name, (isEmpowered("diamond") ? "Empowered " : "") + tools.diamond.name,
enabled: () => main.toolNodes.value.diamond != null enabled: () => main.toolNodes.value.diamond != null
@ -1104,7 +1107,8 @@ export function createPlane(
100 100
) )
.times(isEmpowered("gravelRelic") ? 2 : 1) .times(isEmpowered("gravelRelic") ? 2 : 1)
.add(1), .add(1)
.pow(0.75),
description: () => (isEmpowered("gravelRelic") ? "Empowered " : "") + relics.gravel, description: () => (isEmpowered("gravelRelic") ? "Empowered " : "") + relics.gravel,
enabled: () => main.toolNodes.value.gravelRelic != null enabled: () => main.toolNodes.value.gravelRelic != null
})) }))

View file

@ -634,18 +634,25 @@ export const main = createLayer("main", function (this: BaseLayer) {
); );
return Decimal.add(n, 1).times(n).div(2).add(9).pow10(); return Decimal.add(n, 1).times(n).div(2).add(9).pow10();
}); });
const portalCostModifier = createSequentialModifier(() => const portalCostModifier = createSequentialModifier(() => [
(Object.keys(influences) as Influences[]).map(influence => ...(Object.keys(influences) as Influences[]).map(influence =>
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
multiplier: influences[influence].cost, multiplier: influences[influence].cost,
description: influences[influence].display, description: influences[influence].display,
enabled: () => enabled: () =>
( (
portalGenerator.value?.state as unknown as PortalGeneratorState | undefined portalGenerator.value?.state as unknown as PortalGeneratorState | undefined
)?.influences.includes(influence) ?? false )?.influences.includes(influence) ?? false,
smallerIsBetter: true
})) }))
) ),
); createMultiplicativeModifier(() => ({
multiplier: () => (isEmpowered("emeraldRelic") ? 0.05 : 0.1),
description: () => (isEmpowered("emeraldRelic") ? "Empowered " : "") + relics.emerald,
enabled: () => toolNodes.value.emeraldRelic != null,
smallerIsBetter: true
}))
]);
const computedPortalCost = computed(() => portalCostModifier.apply(basePortalCost.value)); const computedPortalCost = computed(() => portalCostModifier.apply(basePortalCost.value));
const [energyTab, energyTabCollapsed] = createCollapsibleModifierSections(() => [ const [energyTab, energyTabCollapsed] = createCollapsibleModifierSections(() => [
@ -670,7 +677,8 @@ export const main = createLayer("main", function (this: BaseLayer) {
(portalGenerator.value?.state as unknown as PortalGeneratorState | undefined) (portalGenerator.value?.state as unknown as PortalGeneratorState | undefined)
?.tier ?? "dirt" ?.tier ?? "dirt"
)}-tier Base Cost`, )}-tier Base Cost`,
visible: () => portalGenerator.value != null visible: () => portalGenerator.value != null,
smallerIsBetter: true
}, },
{ {
title: "Bonus Connections", title: "Bonus Connections",