mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-03-14 01:51:40 +00:00
Add hardcap to workshop
This commit is contained in:
parent
36f78951b5
commit
f81c469373
2 changed files with 16 additions and 6 deletions
|
@ -8,6 +8,7 @@ import { main } from "data/projEntry";
|
|||
import { createBar } from "features/bars/bar";
|
||||
import { createClickable } from "features/clickables/clickable";
|
||||
import {
|
||||
addHardcap,
|
||||
addSoftcap,
|
||||
createIndependentConversion,
|
||||
createPolynomialScaling
|
||||
|
@ -42,10 +43,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
const foundationProgress = createResource<DecimalSource>(0, "foundation progress");
|
||||
|
||||
const foundationConversion = createIndependentConversion(() => ({
|
||||
scaling: addSoftcap(
|
||||
addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1 / 1e10),
|
||||
1e20,
|
||||
3e8
|
||||
scaling: addHardcap(
|
||||
addSoftcap(addSoftcap(createPolynomialScaling(250, 1.5), 5387, 1 / 1e10), 1e20, 3e8),
|
||||
computed(() =>
|
||||
management.elfTraining.expandersElfTraining.milestones[2].earned.value ? 1000 : 100
|
||||
)
|
||||
),
|
||||
baseResource: trees.logs,
|
||||
gainResource: noPersist(foundationProgress),
|
||||
|
|
|
@ -8,9 +8,9 @@ import {
|
|||
} from "features/feature";
|
||||
import { BaseLayer, createLayer, GenericLayer, layers } from "game/layers";
|
||||
import { persistent } from "game/persistence";
|
||||
import type { PlayerData } from "game/player";
|
||||
import type { LayerData, PlayerData } from "game/player";
|
||||
import player from "game/player";
|
||||
import { format, formatTime } from "util/bignum";
|
||||
import Decimal, { format, formatTime } from "util/bignum";
|
||||
import { Computable, convertComputable, ProcessedComputable } from "util/computed";
|
||||
import { createLazyProxy } from "util/proxies";
|
||||
import { renderRow, VueFeature } from "util/vue";
|
||||
|
@ -469,6 +469,14 @@ export function fixOldSave(
|
|||
if (!["0.0", "0.1", "0.2", "0.3", "0.4"].includes(oldVersion ?? "")) {
|
||||
return;
|
||||
}
|
||||
if ((player.layers?.workshop as LayerData<typeof workshop> | undefined)?.foundationProgress) {
|
||||
(player.layers?.workshop as LayerData<typeof workshop> | undefined)!.foundationProgress =
|
||||
Decimal.min(
|
||||
(player.layers!.workshop as LayerData<typeof workshop> | undefined)!
|
||||
.foundationProgress!,
|
||||
1000
|
||||
);
|
||||
}
|
||||
/*player.offlineProd = false;
|
||||
delete player.layers?.management;
|
||||
if ((player.layers?.main as LayerData<typeof main> | undefined)?.days?.[11]) {
|
||||
|
|
Loading…
Add table
Reference in a new issue