Merge branch 'main' into day-24-packing

This commit is contained in:
thepaperpilot 2022-12-24 09:10:21 -06:00
commit 5720fb02e6
7 changed files with 48 additions and 31 deletions

View file

@ -13,6 +13,7 @@
v-if="layerKeys.includes(tab)" v-if="layerKeys.includes(tab)"
v-bind="gatherLayerProps(layers[tab]!)" v-bind="gatherLayerProps(layers[tab]!)"
:index="index" :index="index"
@set-minimized="value => (layers[tab]!.minimized.value = value)"
/> />
<component :is="tab" :index="index" v-else /> <component :is="tab" :index="index" v-else />
</div> </div>

View file

@ -2,7 +2,11 @@
<div class="layer-container" :style="{ '--layer-color': unref(color) }"> <div class="layer-container" :style="{ '--layer-color': unref(color) }">
<button v-if="showGoBack" class="goBack" @click="goBack"></button> <button v-if="showGoBack" class="goBack" @click="goBack"></button>
<button class="layer-tab minimized" v-if="unref(minimized)" @click="setMinimized(false)"> <button
class="layer-tab minimized"
v-if="unref(minimized)"
@click="$emit('setMinimized', false)"
>
<component v-if="minimizedComponent" :is="minimizedComponent" /> <component v-if="minimizedComponent" :is="minimizedComponent" />
<div v-else>{{ unref(name) }}</div> <div v-else>{{ unref(name) }}</div>
</button> </button>
@ -12,7 +16,9 @@
</Context> </Context>
</div> </div>
<button v-if="unref(minimizable)" class="minimize" @click="setMinimized(true)"></button> <button v-if="unref(minimizable)" class="minimize" @click="$emit('setMinimized', true)">
</button>
</div> </div>
</template> </template>
@ -40,7 +46,7 @@ export default defineComponent({
}, },
minimizedDisplay: processedPropType<CoercableComponent>(Object, String, Function), minimizedDisplay: processedPropType<CoercableComponent>(Object, String, Function),
minimized: { minimized: {
type: Object as PropType<Persistent<boolean>>, type: Object as PropType<Ref<boolean>>,
required: true required: true
}, },
name: { name: {
@ -54,6 +60,7 @@ export default defineComponent({
required: true required: true
} }
}, },
emits: ["setMinimized"],
setup(props) { setup(props) {
const { display, index, minimized, minimizedDisplay } = toRefs(props); const { display, index, minimized, minimizedDisplay } = toRefs(props);
@ -67,10 +74,6 @@ export default defineComponent({
player.tabs.splice(unref(props.index), 1); player.tabs.splice(unref(props.index), 1);
} }
function setMinimized(min: boolean) {
minimized.value = min;
}
function updateNodes(nodes: Record<string, FeatureNode | undefined>) { function updateNodes(nodes: Record<string, FeatureNode | undefined>) {
props.nodes.value = nodes; props.nodes.value = nodes;
} }
@ -81,8 +84,7 @@ export default defineComponent({
showGoBack, showGoBack,
updateNodes, updateNodes,
unref, unref,
goBack, goBack
setMinimized
}; };
} }
}); });

View file

@ -998,7 +998,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
showIf( showIf(
management.elfTraining.fertilizerElfTraining.milestones[4].earned.value || management.elfTraining.fertilizerElfTraining.milestones[4].earned.value ||
letters.masteryEffectActive.value letters.masteryEffectActive.value
) ),
buyMax: metal.masteryEffectActive
}); });
const managementElves2 = [metalElf]; const managementElves2 = [metalElf];

View file

@ -307,7 +307,7 @@ const factory = createLayer(id, () => {
)} )}
</div> </div>
<div> <div>
{routing.metaMilestones[5].earned.value ? ( {routing.metaMilestones[4].earned.value ? (
<Tooltip display="Polyfill" direction={Direction.Down}> <Tooltip display="Polyfill" direction={Direction.Down}>
<button class="control-btn material-icons" onClick={polyfill}> <button class="control-btn material-icons" onClick={polyfill}>
format_color_fill format_color_fill
@ -2380,8 +2380,14 @@ const factory = createLayer(id, () => {
Object.values(factoryBuyables2) Object.values(factoryBuyables2)
)} )}
<Spacer /> <Spacer />
<div style="width: 600px">
Every upgrade purchased below increases the price of the other
upgrades
</div>
<Spacer /> <Spacer />
{renderGrid(...(upgrades as VueFeature[][]))} {renderGrid(...upgrades.slice(0, 3))}
<Spacer />
{renderGrid(...upgrades.slice(3))}
</> </>
)) ))
})), })),

View file

@ -771,7 +771,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Decoration effect: Decoration effect:
<br /> <br />
The lesser of ore mining amount x speed and auto smelting speed is The lesser of ore mining amount x speed and auto smelting speed is
increased to match the greater increased to match the greater, and Twinkle buys max
</div> </div>
<Spacer /> <Spacer />
</> </>
@ -865,7 +865,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
</div> </div>
)), )),
mastery, mastery,
mastered mastered,
masteryEffectActive
}; };
}); });

View file

@ -44,6 +44,7 @@ import { ElfBuyable } from "./elves";
import toys from "./toys"; import toys from "./toys";
import factory from "./factory"; import factory from "./factory";
import reindeer from "./reindeer"; import reindeer from "./reindeer";
import routing from "./routing";
import packing from "./packing" import packing from "./packing"
const id = "oil"; const id = "oil";
@ -1002,7 +1003,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
description: "350 toys", description: "350 toys",
enabled: toys.milestones.milestone4.earned enabled: toys.milestones.milestone4.earned
})), })),
reindeer.reindeer.donner.modifier reindeer.reindeer.donner.modifier,
createMultiplicativeModifier(() => ({
multiplier: 4,
description: "600,000 Cities Solved",
enabled: routing.metaMilestones[5].earned
}))
]) as WithRequired<Modifier, "description" | "revert">; ]) as WithRequired<Modifier, "description" | "revert">;
const computedOilSpeed = computed(() => oilSpeed.apply(0)); const computedOilSpeed = computed(() => oilSpeed.apply(0));

View file

@ -439,7 +439,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
} }
} }
return links; return links;
} },
visibility: () => showIf(Decimal.lt(citiesCompleted.value, 50))
})); }));
const checkCityProgressBar = createBar(() => ({ const checkCityProgressBar = createBar(() => ({
@ -554,7 +555,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
const milestone5 = createMilestone(() => ({ const milestone5 = createMilestone(() => ({
display: { display: {
requirement: "5 Cities Solved", requirement: "5 Cities Solved",
effectDisplay: "Remove 1 city from the map" effectDisplay: "Remove 1 house from the map"
}, },
shouldEarn() { shouldEarn() {
return Decimal.gte(citiesCompleted.value, 5); return Decimal.gte(citiesCompleted.value, 5);
@ -714,7 +715,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
display: { display: {
requirement: "5000 Cities Solved", requirement: "5000 Cities Solved",
effectDisplay: effectDisplay:
"Elves can learn past level 5 and gain 0.1 base city solved per second for each level elves learnt" "Elves can learn past level 5 and gain 0.5 base city solved per second for each level elves learnt"
}, },
shouldEarn() { shouldEarn() {
return Decimal.gte(citiesCompleted.value, 5000); return Decimal.gte(citiesCompleted.value, 5000);
@ -749,7 +750,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
display: { display: {
requirement: "300,000 Cities Solved", requirement: "300,000 Cities Solved",
effectDisplay: effectDisplay:
"Multiply the amount of factory input resources by the amount of their corresponding warehouses appeared in the factory, plus 1" "Multiply the amount of factory input resources by the amount of their corresponding warehouses appeared in the factory, plus 1. Also unlocks a button to fill your factory with warehouses."
}, },
shouldEarn() { shouldEarn() {
return Decimal.gte(citiesCompleted.value, 300000); return Decimal.gte(citiesCompleted.value, 300000);
@ -759,8 +760,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
5: createMilestone(() => ({ 5: createMilestone(() => ({
display: { display: {
requirement: "600,000 Cities Solved", requirement: "600,000 Cities Solved",
effectDisplay: effectDisplay: "Quadruple oil gain"
"Unlocks a button to let you fill the remaining empty spaces in the factory with warehouses, useful for the previous milestone"
}, },
shouldEarn() { shouldEarn() {
return Decimal.gte(citiesCompleted.value, 600000); return Decimal.gte(citiesCompleted.value, 600000);
@ -775,7 +775,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
Increases base city solving speed by{" "} Increases base city solving speed by{" "}
<Fraction> <Fraction>
<div>factory tick rate</div> <div>factory tick rate</div>
<div>1000</div> <div>100</div>
</Fraction> </Fraction>
</> </>
)) ))
@ -859,14 +859,14 @@ const layer = createLayer(id, function (this: BaseLayer) {
const computedAutoProcessing = computed(() => autoProcessing.apply(1)); const computedAutoProcessing = computed(() => autoProcessing.apply(1));
const metaSolvingSpeed = createSequentialModifier(() => [ const metaSolvingSpeed = createSequentialModifier(() => [
createAdditiveModifier(() => ({ createAdditiveModifier(() => ({
addend: () => Decimal.div(management.totalElfLevels.value, 10), addend: () => Decimal.div(management.totalElfLevels.value, 2),
description: "5000 Cities Solved", description: "5000 Cities Solved",
enabled: metaMilestones[1].earned enabled: metaMilestones[1].earned
})), })),
createAdditiveModifier(() => ({ createAdditiveModifier(() => ({
addend: () => Decimal.div(factory.computedTickRate.value, 1000), addend: () => Decimal.div(factory.computedTickRate.value, 100),
description: "1,000,000 Cities Solved", description: "1,000,000 Cities Solved",
enabled: metaMilestones[1].earned enabled: metaMilestones[6].earned
})), })),
...Object.values(metaBuyables).map(x => ...Object.values(metaBuyables).map(x =>
createMultiplicativeModifier(() => ({ createMultiplicativeModifier(() => ({
@ -876,7 +876,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
})) }))
) )
]) as WithRequired<Modifier, "description">; ]) as WithRequired<Modifier, "description">;
const computedMetaSolvingSpeed = computed(() => metaSolvingSpeed.apply(20)); const computedMetaSolvingSpeed = computed(() => metaSolvingSpeed.apply(50));
const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [ const [generalTab, generalTabCollapsed] = createCollapsibleModifierSections(() => [
{ {
@ -927,7 +927,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
{ {
title: "Post-Inflation Solving Speed", title: "Post-Inflation Solving Speed",
modifier: metaSolvingSpeed, modifier: metaSolvingSpeed,
base: 20, base: 50,
unit: "/s", unit: "/s",
visible: () => Decimal.gt(citiesCompleted.value, 50) visible: () => Decimal.gt(citiesCompleted.value, 50)
} }
@ -1138,7 +1138,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
</> </>
) : ( ) : (
<> <>
{Decimal.lt(citiesCompleted.value, 50) ? ( {Decimal.lt(citiesCompleted.value, citiesGoal) ? (
<> <>
You're solving {formatWhole(computedMetaSolvingSpeed.value)} cities You're solving {formatWhole(computedMetaSolvingSpeed.value)} cities
per second per second
@ -1147,11 +1147,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
</> </>
) : ( ) : (
<> <>
You've solved all of cities on Earth! You've solved all cities on Earth!
<br /> <br />
<strike style="font-size: smaller"> <span style="text-decoration: line-through; font-size: smaller">
(and proved the travelling salesman problem to be O(1)) (and proved the travelling salesman problem to be O(1))
</strike> </span>
</> </>
)} )}
<Spacer /> <Spacer />