From 825ea2f2edc657c19e91822eb57477e8acea4fb6 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Sat, 24 Dec 2022 16:42:30 +0700 Subject: [PATCH 1/3] Fix inflation --- src/data/layers/routing.tsx | 294 +++++++++++++++++------------ src/data/layers/styles/routing.css | 21 ++- 2 files changed, 197 insertions(+), 118 deletions(-) diff --git a/src/data/layers/routing.tsx b/src/data/layers/routing.tsx index 8729561..7977130 100644 --- a/src/data/layers/routing.tsx +++ b/src/data/layers/routing.tsx @@ -21,7 +21,7 @@ import { createMultiplicativeModifier, createSequentialModifier } from "game/modifiers"; -import { persistent } from "game/persistence"; +import { DefaultValue, persistent } from "game/persistence"; import Decimal, { DecimalSource, format, formatWhole } from "util/bignum"; import { Direction } from "util/common"; import { render, renderRow } from "util/vue"; @@ -65,7 +65,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const citiesGoal = 10; - const citiesCompleted = createResource(0, "countries solved"); + const citiesCompleted = createResource(0, "cities solved"); const currentCity = persistent([]); const routeIndex = persistent(0); const checkRouteProgress = persistent(0); @@ -143,35 +143,37 @@ const layer = createLayer(id, function (this: BaseLayer) { function stringifyRoute(route: number[]) { return route .map(h => (city.types.house.title as (node: BoardNode) => string)(city.nodes.value[h])) - .join("->"); + .join(" > "); } function generateCity() { - const numHouses = new Decimal(computedHouses.value).clampMin(3).toNumber(); - const min = computedMinWeight.value; - const max = milestone6.earned.value ? min : computedMaxWeight.value; - const diff = Decimal.sub(max, min); - const city: number[][] = []; - for (let i = 0; i < numHouses; i++) { - const house: number[] = []; - for (let j = 0; j < numHouses; j++) { - if (i === j) { - house.push(0); - } else if (j < i) { - house.push(city[j][i]); - } else { - house.push(Decimal.times(diff, Math.random()).add(min).floor().toNumber()); + if (Decimal.lte(citiesCompleted.value, 50)) { + const numHouses = new Decimal(computedHouses.value).clampMin(3).toNumber(); + const min = computedMinWeight.value; + const max = milestone6.earned.value ? min : computedMaxWeight.value; + const diff = Decimal.sub(max, min); + const city: number[][] = []; + for (let i = 0; i < numHouses; i++) { + const house: number[] = []; + for (let j = 0; j < numHouses; j++) { + if (i === j) { + house.push(0); + } else if (j < i) { + house.push(city[j][i]); + } else { + house.push(Decimal.times(diff, Math.random()).add(min).floor().toNumber()); + } } + city.push(house); } - city.push(house); + currentCity.value = city; + routeIndex.value = 0; + redundanciesRemoved.value = Decimal.gte(citiesCompleted.value, 7) + ? Decimal.factorial(currentCity.value.length).div(2).toNumber() + : 0; + routesToSkip.value = []; + getNextRoute(); } - currentCity.value = city; - routeIndex.value = 0; - redundanciesRemoved.value = Decimal.gte(citiesCompleted.value, 7) - ? Decimal.factorial(currentCity.value.length).div(2).toNumber() - : 0; - routesToSkip.value = []; - getNextRoute(); } function getNextRoute() { @@ -342,12 +344,13 @@ const layer = createLayer(id, function (this: BaseLayer) { }, width: "600px", height: "600px", - style: { - background: "var(--raised-background)", - borderRadius: "var(--border-radius) var(--border-radius) 0 0", - boxShadow: "0 2px 10px rgb(0 0 0 / 50%)" - }, state: computed(() => { + if (Decimal.gte(citiesCompleted.value, 20)) + return { + nodes: [], + selectedNode: null, + selectedAction: null + }; const nodes: BoardNode[] = []; const city = currentCity.value; const rows = Math.ceil(Math.sqrt(city.length)); @@ -373,6 +376,7 @@ const layer = createLayer(id, function (this: BaseLayer) { }; }), links() { + if (Decimal.gte(citiesCompleted.value, 20)) return []; const links: BoardNodeLink[] = []; const route = currentRoute.value; if (route == null) { @@ -432,6 +436,44 @@ const layer = createLayer(id, function (this: BaseLayer) { } })); + const checkCityProgressBar = createBar(() => ({ + direction: Direction.Right, + width: 597, + height: 24, + style: { + borderRadius: "var(--border-radius) var(--border-radius) 0 0", + background: "var(--raised-background)", + marginBottom: "-24px" + }, + borderStyle: { + borderRadius: "var(--border-radius) var(--border-radius) 0 0", + borderColor: "transparent", + marginBottom: "unset" + }, + fillStyle: { + background: "black", + marginBottom: "unset" + }, + progress() { + return Decimal.div( + routeIndex.value, + typeof currentRoutes.value == "number" + ? Math.floor(currentRoutes.value) + : currentRoutes.value.length + ); + }, + display: jsx(() => ( + <> + {formatWhole(Math.floor(routeIndex.value))} /{" "} + {formatWhole( + typeof currentRoutes.value == "number" + ? Math.floor(currentRoutes.value) + : currentRoutes.value.length + )} + + )) + })); + const checkRouteProgressBar = createBar(() => ({ direction: Direction.Right, width: 597, @@ -443,7 +485,7 @@ const layer = createLayer(id, function (this: BaseLayer) { }, borderStyle: { borderRadius: "0 0 var(--border-radius) var(--border-radius)", - borderColor: "var(--outline)", + borderColor: "transparent", marginTop: "unset" }, fillStyle: { @@ -455,7 +497,8 @@ const layer = createLayer(id, function (this: BaseLayer) { }, display: jsx(() => ( <> - {Math.floor(checkRouteProgress.value)}/{currentRouteDuration.value} + {formatWhole(Math.floor(checkRouteProgress.value))} /{" "} + {formatWhole(currentRouteDuration.value)} )) })); @@ -505,7 +548,7 @@ const layer = createLayer(id, function (this: BaseLayer) { const milestone5 = createMilestone(() => ({ display: { requirement: "5 Countries Solved", - effectDisplay: "Remove 1 city" + effectDisplay: "Remove 1 city from the map" }, shouldEarn() { return Decimal.gte(citiesCompleted.value, 5); @@ -616,46 +659,61 @@ const layer = createLayer(id, function (this: BaseLayer) { })) ]); const computedAutoProcessing = computed(() => autoProcessing.apply(1)); + const metaSolvingSpeed = createSequentialModifier(() => []); + const computedMetaSolvingSpeed = computed(() => metaSolvingSpeed.apply(20)); const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ { title: "Cities/country", modifier: houses, - base: 3 + base: 3, + visible: () => Decimal.lte(citiesCompleted.value, 50) }, { title: () => (milestone6.earned.value ? "Weight" : "Minimum Weight"), modifier: minWeight, - base: 2 + base: 2, + visible: () => Decimal.lte(citiesCompleted.value, 50) }, { title: "Maximum Weight", modifier: maxWeight, base: 10, - visible: () => !milestone6.earned.value + visible: () => !milestone6.earned.value && Decimal.lte(citiesCompleted.value, 50) }, { title: "Manual Processing Amount", modifier: manualBoost, - base: 1 + base: 1, + visible: () => Decimal.lte(citiesCompleted.value, 50) }, { title: "Manual Processing Cooldown", modifier: manualCooldown, base: 1, - unit: "s" + unit: "s", + visible: () => Decimal.lte(citiesCompleted.value, 50) }, { title: "Remove Redundant Route Cooldown", modifier: redundantCooldown, base: 10, - unit: "s" + unit: "s", + visible: () => Decimal.lte(citiesCompleted.value, 50) }, { title: "Auto Processing Speed", modifier: autoProcessing, base: 1, - unit: "/s" + unit: "/s", + visible: () => Decimal.lte(citiesCompleted.value, 50) + }, + { + title: "Post-Inflation Solving Speed", + modifier: metaSolvingSpeed, + base: 20, + unit: "/s", + visible: () => Decimal.gt(citiesCompleted.value, 50) } ]); const showModifiersModal = ref(false); @@ -674,54 +732,60 @@ const layer = createLayer(id, function (this: BaseLayer) { if (Decimal.lt(main.day.value, day)) { return; } + if (Decimal.lte(citiesCompleted[DefaultValue], 50)) { + if (Decimal.gte(newCityProgress.value, 10)) { + newCityProgress.value = 10; + } else { + newCityProgress.value = Decimal.add(newCityProgress.value, diff); + if (getNewCity.isHolding.value) { + getNewCity.onClick(); + } + } - if (Decimal.gte(newCityProgress.value, 10)) { - newCityProgress.value = 10; + if (Decimal.gte(boostProgress.value, computedManualCooldown.value)) { + boostProgress.value = computedManualCooldown.value; + } else { + boostProgress.value = Decimal.add(boostProgress.value, diff); + if (boost.isHolding.value) { + boost.onClick(); + } + } + + if (Decimal.gte(redundantProgress.value, computedRedundantCooldown.value)) { + redundantProgress.value = computedRedundantCooldown.value; + } else { + redundantProgress.value = Decimal.add(redundantProgress.value, diff); + if (removeRedundantRoute.isHolding.value) { + removeRedundantRoute.onClick(); + } + } + + checkRouteProgress.value = Decimal.times(diff, computedAutoProcessing.value) + .add(checkRouteProgress.value) + .toNumber(); + if (checkRouteProgress.value > currentRouteDuration.value) { + const overflow = checkRouteProgress.value - currentRouteDuration.value; + routeIndex.value++; + if (milestone6.earned.value && currentRoute.value != null) { + const length = + typeof currentRoute.value === "number" + ? currentRoute.value + : currentRoute.value.length; + const extraRoutes = Decimal.div( + overflow, + Decimal.times(length, computedMinWeight.value) + ) + .floor() + .toNumber(); + routeIndex.value += extraRoutes; + } + getNextRoute(); + } } else { - newCityProgress.value = Decimal.add(newCityProgress.value, diff); - if (getNewCity.isHolding.value) { - getNewCity.onClick(); - } - } - - if (Decimal.gte(boostProgress.value, computedManualCooldown.value)) { - boostProgress.value = computedManualCooldown.value; - } else { - boostProgress.value = Decimal.add(boostProgress.value, diff); - if (boost.isHolding.value) { - boost.onClick(); - } - } - - if (Decimal.gte(redundantProgress.value, computedRedundantCooldown.value)) { - redundantProgress.value = computedRedundantCooldown.value; - } else { - redundantProgress.value = Decimal.add(redundantProgress.value, diff); - if (removeRedundantRoute.isHolding.value) { - removeRedundantRoute.onClick(); - } - } - - checkRouteProgress.value = Decimal.times(diff, computedAutoProcessing.value) - .add(checkRouteProgress.value) - .toNumber(); - if (checkRouteProgress.value > currentRouteDuration.value) { - const overflow = checkRouteProgress.value - currentRouteDuration.value; - routeIndex.value++; - if (milestone6.earned.value && currentRoute.value != null) { - const length = - typeof currentRoute.value === "number" - ? currentRoute.value - : currentRoute.value.length; - const extraRoutes = Decimal.div( - overflow, - Decimal.times(length, computedMinWeight.value) - ) - .floor() - .toNumber(); - routeIndex.value += extraRoutes; - } - getNextRoute(); + citiesCompleted.value = Decimal.add( + citiesCompleted.value, + computedMetaSolvingSpeed.value + ); } }); @@ -757,16 +821,7 @@ const layer = createLayer(id, function (this: BaseLayer) { return ""; } if (typeof currentRoutes.value === "number") { - return ( -
- {routeIndex.value > 0 ? ( -
{formatWhole(routeIndex.value)} already checked
- ) : null} -
- {formatWhole(currentRoutes.value - routeIndex.value)} routes left to check -
-
- ); + return
 
; } if (typeof currentRoutes.value === "number") { console.error("Something went horribly wrong"); @@ -774,22 +829,17 @@ const layer = createLayer(id, function (this: BaseLayer) { } const routes = currentRoutes.value.slice(); let showPrevious = false; - let showNext = 0; - if (routes.length > 6) { - routes.splice(0, routeIndex.value); + if (routes.length > 25) { + routes.splice(0, Math.max(routeIndex.value - 12, 0)); showPrevious = true; - if (routes.length > 6) { - showNext = routes.length - 5; - routes.splice(5); + if (routes.length > 25) { + routes.splice(25); } } return (
- {showPrevious && routeIndex.value > 0 ? ( -
{formatWhole(routeIndex.value)} already checked
- ) : null} {routes.map((route, i) => { - const index = i + (showPrevious ? routeIndex.value : 0); + const index = i + (showPrevious ? Math.max(routeIndex.value - 12, 0) : 0); return (
{stringifyRoute(route)}
); })} - - {showNext > 0 ?
+ {formatWhole(showNext)} more
: null}
); } @@ -849,19 +900,28 @@ const layer = createLayer(id, function (this: BaseLayer) { {render(modifiersModal)} - {renderRow(boost, removeRedundantRoute)} - {render(city)} - {render(checkRouteProgressBar)} - -

Checking Routes...

- {displayRoutes()} - - {milestonesDisplay()} + {Decimal.lte(citiesCompleted.value, 50) ? ( + <> + {renderRow(boost, removeRedundantRoute)} + {render(checkCityProgressBar)} + {displayRoutes()} + {render(city)} + {render(checkRouteProgressBar)} + + {milestonesDisplay()} + + ) : ( + <> + You're solving {formatWhole(computedMetaSolvingSpeed.value)} cities per + second + + )} )), minimizedDisplay: jsx(() => (
- {name} {format(citiesCompleted.value)} countries solved + {name}{" "} + {formatWhole(citiesCompleted.value)} countries solved
)) }; diff --git a/src/data/layers/styles/routing.css b/src/data/layers/styles/routing.css index bf7b2a3..bed7ec7 100644 --- a/src/data/layers/styles/routing.css +++ b/src/data/layers/styles/routing.css @@ -1,3 +1,15 @@ +.routes-list { + width: 600px; + height: 573px; + margin-bottom: -604px; + margin-top: -4px; + padding-top: 35px; + pointer-events: none; + border-radius: var(--border-radius); + background: var(--raised-background); + box-shadow: 0 2px 10px rgb(0 0 0 / 50%); +} + .routes-list .checked { color: var(--bought); } @@ -7,7 +19,7 @@ } .routes-list .redundant:not(.checked):not(.processing) { - opacity: 0.5; + color: var(--accent1); } .routes-list .skipped { @@ -16,5 +28,12 @@ } .routes-list > * { + position: relative; + --opacity: 1; flex: 1 1 33%; + opacity: var(--opacity); + transition: all 0s; +} +.routes-list + div { + position: relative; } From 5f08ae7412d0ac5166a68347f838fd9f952df517 Mon Sep 17 00:00:00 2001 From: ducdat0507 <62660527+ducdat0507@users.noreply.github.com> Date: Sat, 24 Dec 2022 19:58:36 +0700 Subject: [PATCH 2/3] Extend routing --- src/data/layers/cloth.tsx | 13 +- src/data/layers/dyes.tsx | 22 ++- src/data/layers/factory.tsx | 51 +++++- src/data/layers/management.tsx | 17 +- src/data/layers/metal.tsx | 11 ++ src/data/layers/plastic.tsx | 22 ++- src/data/layers/routing.tsx | 301 +++++++++++++++++++++++++++++---- src/data/layers/trees.tsx | 13 +- src/data/projEntry.tsx | 11 +- src/data/projInfo.json | 2 +- 10 files changed, 407 insertions(+), 56 deletions(-) diff --git a/src/data/layers/cloth.tsx b/src/data/layers/cloth.tsx index 7ef24dc..f219c1f 100644 --- a/src/data/layers/cloth.tsx +++ b/src/data/layers/cloth.tsx @@ -33,11 +33,13 @@ import { computed, ref, unref } from "vue"; import boxes from "./boxes"; import dyes from "./dyes"; import { ElfBuyable } from "./elves"; +import factory from "./factory"; import management from "./management"; import metal from "./metal"; import paper from "./paper"; import plastic from "./plastic"; import reindeer from "./reindeer"; +import routing from "./routing"; import trees from "./trees"; import workshop from "./workshop"; @@ -544,7 +546,16 @@ const layer = createLayer(id, function (this: BaseLayer) { description: "Yellow Dye", enabled: dyes.masteryEffectActive })), - reindeer.reindeer.cupid.modifier + reindeer.reindeer.cupid.modifier, + createMultiplicativeModifier(() => ({ + multiplier: () => + Object.values(factory.components).reduce( + (x, y) => y + (x.type == "cloth" ? 1 : 0), + 1 + ) as number, + description: "300,000 Cities Solved", + enabled: routing.metaMilestones[4].earned + })) ]) as WithRequired; const computedSpinningAmount = computed(() => spinningAmount.apply(1)); const spinningCooldown = createSequentialModifier(() => []); diff --git a/src/data/layers/dyes.tsx b/src/data/layers/dyes.tsx index f646216..babf8ed 100644 --- a/src/data/layers/dyes.tsx +++ b/src/data/layers/dyes.tsx @@ -38,6 +38,7 @@ import trees from "./trees"; import toys from "./toys"; import factory from "./factory"; import reindeer from "./reindeer"; +import routing from "./routing"; interface Dye { name: string; @@ -58,7 +59,15 @@ type DyeUpg = | "blueDyeUpg2" | "coalUpg"; -export type enumColor = "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "black" | "white"; +export type enumColor = + | "red" + | "green" + | "blue" + | "yellow" + | "purple" + | "orange" + | "black" + | "white"; const id = "dyes"; const day = 11; @@ -203,6 +212,17 @@ const layer = createLayer(id, function (this: BaseLayer) { })) ); modifiers.push(reindeer.reindeer.rudolph.modifier); + modifiers.push( + createMultiplicativeModifier(() => ({ + multiplier: () => + Object.values(factory.components).reduce( + (x, y) => y + (x.type == "dye" ? 1 : 0), + 1 + ) as number, + description: "300,000 Cities Solved", + enabled: routing.metaMilestones[4].earned + })) + ); return modifiers; }) as WithRequired; const computedToGenerate = computed(() => toGenerate.apply(0)); diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index b6e8db7..f74428c 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -90,6 +90,7 @@ import toys from "./toys"; import trees from "./trees"; import workshop from "./workshop"; import ribbon from "./ribbon"; +import routing from "./routing"; const id = "factory"; @@ -235,6 +236,11 @@ const factory = createLayer(id, () => { multiplier: 1.5, description: "Carry ticks in boxes", enabled: () => upgrades[2][3].bought.value + })), + createMultiplicativeModifier(() => ({ + multiplier: () => Decimal.max(routing.citiesCompleted.value, 1).log10().sub(3).max(1), + description: "25,000 Cities Solved", + enabled: routing.metaMilestones[2].earned })) ]); const computedTickRate = computed(() => tickRate.apply(1)); @@ -301,6 +307,15 @@ const factory = createLayer(id, () => { )}
+ {routing.metaMilestones[5].earned.value ? ( + + + + ) : ( + "" + )}