mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2024-11-21 16:13:57 +00:00
Merge branch 'main' into day-21-reindeer
This commit is contained in:
commit
d9c13ae6a0
9 changed files with 285 additions and 139 deletions
|
@ -36,6 +36,7 @@ import oil from "./oil";
|
|||
import paper from "./paper";
|
||||
import trees from "./trees";
|
||||
import toys from "./toys";
|
||||
import factory from "./factory";
|
||||
import reindeer from "./reindeer";
|
||||
|
||||
interface Dye {
|
||||
|
@ -57,7 +58,7 @@ type DyeUpg =
|
|||
| "blueDyeUpg2"
|
||||
| "coalUpg";
|
||||
|
||||
export type enumColor = "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "black";
|
||||
export type enumColor = "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "black" | "white";
|
||||
|
||||
const id = "dyes";
|
||||
const day = 11;
|
||||
|
@ -216,6 +217,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
case "yellow":
|
||||
case "blue":
|
||||
case "black":
|
||||
case "white":
|
||||
dyeBook = paper.books.primaryDyeBook;
|
||||
break;
|
||||
case "orange":
|
||||
|
@ -522,6 +524,31 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
dyesToReset: [],
|
||||
visibility: () => showIf(toys.milestones.milestone2.earned.value)
|
||||
}),
|
||||
white: createDye({
|
||||
name: "White Dye",
|
||||
color: "white",
|
||||
key: "q",
|
||||
costs: () => [
|
||||
{
|
||||
base: "1e60",
|
||||
root: 5,
|
||||
res: trees.logs
|
||||
},
|
||||
{
|
||||
base: computed(() => (upgrades.yellowDyeUpg2.bought.value ? "1e17" : "2e17")),
|
||||
root: 2,
|
||||
res: oil.oil
|
||||
}
|
||||
],
|
||||
listedBoosts: [
|
||||
{
|
||||
visible: true,
|
||||
desc: computed(() => `*${format(boosts.white1.value)} plastic gain.`)
|
||||
}
|
||||
],
|
||||
dyesToReset: [],
|
||||
visibility: () => showIf(factory.upgrades[2][2].bought.value)
|
||||
}),
|
||||
orange: createDye({
|
||||
name: "Orange Dye",
|
||||
color: "orange",
|
||||
|
@ -704,6 +731,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
Decimal.pow(2, Decimal.add(dyes.black.amount.value, 1).log2().sqrt())
|
||||
.pow(upgrades.coalUpg.bought.value ? 1.2 : 1)
|
||||
.pow(management.elfTraining.clothElfTraining.milestones[3].earned.value ? 1.1 : 1)
|
||||
),
|
||||
white1: computed(() =>
|
||||
Decimal.pow(2, Decimal.add(dyes.white.amount.value, 1).log2().sqrt())
|
||||
.pow(upgrades.coalUpg.bought.value ? 1.2 : 1)
|
||||
.pow(management.elfTraining.clothElfTraining.milestones[3].earned.value ? 1.1 : 1)
|
||||
)
|
||||
};
|
||||
|
||||
|
@ -728,6 +760,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
modifier: dyes.black.toGenerate,
|
||||
base: 0
|
||||
},
|
||||
{
|
||||
title: "White Dye Creation",
|
||||
modifier: dyes.white.toGenerate,
|
||||
base: 0
|
||||
},
|
||||
{
|
||||
title: "Orange Dye Creation",
|
||||
modifier: dyes.orange.toGenerate,
|
||||
|
@ -958,8 +995,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
</>
|
||||
) : null}
|
||||
<div style="width: 620px">
|
||||
{renderRow(dyes.black.display)}
|
||||
{renderRow(dyes.black.buyable)}
|
||||
{renderRow(dyes.black.display, dyes.white.display)}
|
||||
{renderRow(dyes.black.buyable, dyes.white.buyable)}
|
||||
<Spacer />
|
||||
{renderRow(dyes.red.display, dyes.yellow.display, dyes.blue.display)}
|
||||
{renderRow(dyes.red.buyable, dyes.yellow.buyable, dyes.blue.buyable)}
|
||||
|
|
|
@ -18,17 +18,18 @@ import { createResource, Resource } from "features/resources/resource";
|
|||
import { createTab } from "features/tabs/tab";
|
||||
import { createTabFamily } from "features/tabs/tabFamily";
|
||||
import Tooltip from "features/tooltips/Tooltip.vue";
|
||||
import { createUpgrade } from "features/upgrades/upgrade";
|
||||
import { globalBus } from "game/events";
|
||||
import { createLayer } from "game/layers";
|
||||
import { createUpgrade, GenericUpgrade } from "features/upgrades/upgrade";
|
||||
import {
|
||||
createAdditiveModifier,
|
||||
createMultiplicativeModifier,
|
||||
createSequentialModifier
|
||||
createSequentialModifier,
|
||||
Modifier
|
||||
} from "game/modifiers";
|
||||
import { noPersist, Persistent, persistent, State } from "game/persistence";
|
||||
import Decimal, { DecimalSource, format, formatWhole } from "util/bignum";
|
||||
import { Direction } from "util/common";
|
||||
import { Direction, WithRequired } from "util/common";
|
||||
import { ProcessedComputable } from "util/computed";
|
||||
import { render, renderGrid, renderRow, VueFeature } from "util/vue";
|
||||
import { computed, ComputedRef, reactive, ref, unref, watchEffect } from "vue";
|
||||
|
@ -38,22 +39,23 @@ import _metal from "../symbols/metal.png";
|
|||
import _plastic from "../symbols/plastic.png";
|
||||
import boxes from "./boxes";
|
||||
import coal from "./coal";
|
||||
import dyes from "./dyes";
|
||||
import _bear from "./factory-components/bear.svg";
|
||||
import _bearMaker from "./factory-components/bearmaker.svg";
|
||||
import _stuffing from "./factory-components/stuffing.svg";
|
||||
import _console from "./factory-components/console.svg";
|
||||
import _circuitBoard from "./factory-components/circuit.svg";
|
||||
import _stuffingMaker from "./factory-components/stuffingmaker.svg";
|
||||
import _consoleMaker from "./factory-components/consolemaker.svg";
|
||||
import _circuitBoardMaker from "./factory-components/circuitmaker.svg";
|
||||
import _block from "./factory-components/block.svg";
|
||||
import _blockMaker from "./factory-components/blockmaker.svg";
|
||||
import _bucket from "./factory-components/bucket.svg";
|
||||
import _bucketMaker from "./factory-components/bucketmaker.svg";
|
||||
import _bucketShovel from "./factory-components/bucketshovel.svg";
|
||||
import _bucketShovelMaker from "./factory-components/bucketshovelmaker.svg";
|
||||
import _button from "./factory-components/button.svg";
|
||||
import _buttonMaker from "./factory-components/buttonmaker.svg";
|
||||
import _circuitBoard from "./factory-components/circuit.svg";
|
||||
import _circuitBoardMaker from "./factory-components/circuitmaker.svg";
|
||||
import _clothes from "./factory-components/clothes.svg";
|
||||
import _clothesMaker from "./factory-components/clothesmaker.svg";
|
||||
import _console from "./factory-components/console.svg";
|
||||
import _consoleMaker from "./factory-components/consolemaker.svg";
|
||||
import _conveyor from "./factory-components/conveyor.png";
|
||||
import _cursor from "./factory-components/cursor.svg";
|
||||
import _delete from "./factory-components/delete.svg";
|
||||
|
@ -63,10 +65,10 @@ import _rotateLeft from "./factory-components/rotateLeft.svg";
|
|||
import _rotateRight from "./factory-components/rotateRight.svg";
|
||||
import _plankMaker from "./factory-components/sawmill.svg";
|
||||
import _shed from "./factory-components/shed.svg";
|
||||
import _button from "./factory-components/button.svg";
|
||||
import _shovel from "./factory-components/shovel.svg";
|
||||
import _shovelMaker from "./factory-components/shovelmaker.svg";
|
||||
import _buttonMaker from "./factory-components/buttonmaker.svg";
|
||||
import _stuffing from "./factory-components/stuffing.svg";
|
||||
import _stuffingMaker from "./factory-components/stuffingmaker.svg";
|
||||
import _thread from "./factory-components/thread.svg";
|
||||
import _threadMaker from "./factory-components/threadmaker.svg";
|
||||
import _truck from "./factory-components/truck.svg";
|
||||
|
@ -74,16 +76,15 @@ import _truckMaker from "./factory-components/truckmaker.svg";
|
|||
import _wheel from "./factory-components/wheel.svg";
|
||||
import _wheelMaker from "./factory-components/wheelmaker.svg";
|
||||
import Factory from "./Factory.vue";
|
||||
import metal from "./metal";
|
||||
import oil from "./oil";
|
||||
import paper from "./paper";
|
||||
import plastic from "./plastic";
|
||||
import "./styles/factory.css";
|
||||
import Toy from "./Toy.vue";
|
||||
import toys from "./toys";
|
||||
import trees from "./trees";
|
||||
import workshop from "./workshop";
|
||||
import paper from "./paper";
|
||||
import metal from "./metal";
|
||||
import dyes from "./dyes";
|
||||
import plastic from "./plastic";
|
||||
|
||||
const id = "factory";
|
||||
|
||||
|
@ -92,7 +93,7 @@ const advancedDay = 19;
|
|||
const presentsDay = 20;
|
||||
|
||||
const toyGoal = 750;
|
||||
const advancedToyGoal = 2000;
|
||||
const advancedToyGoal = 1500;
|
||||
|
||||
// 20x20 block size
|
||||
// TODO: unhardcode stuff
|
||||
|
@ -100,13 +101,6 @@ const advancedToyGoal = 2000;
|
|||
function roundDownTo(num: number, multiple: number) {
|
||||
return Math.floor((num + multiple / 2) / multiple) * multiple;
|
||||
}
|
||||
function getRelativeCoords(e: MouseEvent) {
|
||||
const rect = (e.target as HTMLElement).getBoundingClientRect();
|
||||
return {
|
||||
x: e.clientX - rect.left,
|
||||
y: e.clientY - rect.top
|
||||
};
|
||||
}
|
||||
function rotateDir(dir: Direction, relative = Direction.Right) {
|
||||
const directions = [Direction.Up, Direction.Right, Direction.Down, Direction.Left];
|
||||
let index = directions.indexOf(dir);
|
||||
|
@ -145,6 +139,15 @@ const factory = createLayer(id, () => {
|
|||
const bucketAndShovels = createResource<DecimalSource>(0, "shovel and pails");
|
||||
const consoles = createResource<DecimalSource>(0, "consoles");
|
||||
|
||||
function getRelativeCoords(e: MouseEvent) {
|
||||
const rect = (e.target as HTMLElement).getBoundingClientRect();
|
||||
const offset = computedFactorySize.value % 2 === 0 ? -blockSize / 2 : 0;
|
||||
return {
|
||||
x: e.clientX - rect.left + offset,
|
||||
y: e.clientY - rect.top + offset
|
||||
};
|
||||
}
|
||||
|
||||
const energy = createSequentialModifier(() => [
|
||||
createAdditiveModifier(() => ({
|
||||
addend: () => Decimal.add(1, coal.coal.value).log10(),
|
||||
|
@ -162,10 +165,15 @@ const factory = createLayer(id, () => {
|
|||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 1.4,
|
||||
description: "2000 toys",
|
||||
description: "1500 toys",
|
||||
enabled: toys.milestones.milestone6.earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 1.4,
|
||||
description: "6000 toys",
|
||||
enabled: toys.milestones.milestone6.earned
|
||||
}))
|
||||
]);
|
||||
]) as WithRequired<Modifier, "revert" | "description">;
|
||||
const computedEnergy = computed(() => energy.apply(0));
|
||||
const energyConsumption = computed(() =>
|
||||
Object.values(components.value)
|
||||
|
@ -189,6 +197,23 @@ const factory = createLayer(id, () => {
|
|||
multiplier: energyEfficiency,
|
||||
description: "Energy Consumption",
|
||||
enabled: () => Decimal.gt(energyConsumption.value, computedEnergy.value)
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: Decimal.add(paper.paper.value, 1).log10().div(100).add(1),
|
||||
description: "News Ticker",
|
||||
enabled: () => upgrades[0][1].bought.value
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: Decimal.lt(energyEfficiency.value, 1)
|
||||
? 1
|
||||
: Decimal.sub(2, Decimal.div(energyConsumption.value, computedEnergy.value)),
|
||||
description: "Brighter work rooms",
|
||||
enabled: () => upgrades[2][1].bought.value
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 1.5,
|
||||
description: "Carry ticks in boxes",
|
||||
enabled: () => upgrades[2][3].bought.value
|
||||
}))
|
||||
]);
|
||||
const computedTickRate = computed(() => tickRate.apply(1));
|
||||
|
@ -351,7 +376,7 @@ const factory = createLayer(id, () => {
|
|||
tick: 1,
|
||||
outputs: {
|
||||
dye: {
|
||||
amount: 1
|
||||
amount: computed(() => (upgrades[1][1].bought.value ? 4 : 1))
|
||||
}
|
||||
}
|
||||
} as FactoryComponentDeclaration,
|
||||
|
@ -381,7 +406,7 @@ const factory = createLayer(id, () => {
|
|||
tick: 1,
|
||||
outputs: {
|
||||
plastic: {
|
||||
amount: 1
|
||||
amount: computed(() => (upgrades[1][2].bought.value ? 4 : 1))
|
||||
}
|
||||
}
|
||||
} as FactoryComponentDeclaration,
|
||||
|
@ -395,12 +420,12 @@ const factory = createLayer(id, () => {
|
|||
tick: 1,
|
||||
inputs: {
|
||||
wood: {
|
||||
amount: 1
|
||||
amount: computed(() => (upgrades[0][0].bought.value ? 2 : 1))
|
||||
}
|
||||
},
|
||||
outputs: {
|
||||
plank: {
|
||||
amount: 1
|
||||
amount: computed(() => (upgrades[0][0].bought.value ? 2 : 1))
|
||||
}
|
||||
}
|
||||
} as FactoryComponentDeclaration,
|
||||
|
@ -522,7 +547,7 @@ const factory = createLayer(id, () => {
|
|||
}
|
||||
},
|
||||
outputs: {
|
||||
shovel: {
|
||||
bucket: {
|
||||
amount: 1
|
||||
}
|
||||
},
|
||||
|
@ -566,7 +591,7 @@ const factory = createLayer(id, () => {
|
|||
},
|
||||
outputs: {
|
||||
block: {
|
||||
amount: 1,
|
||||
amount: computed(() => (upgrades[1][0].bought.value ? 3 : 1)),
|
||||
resource: toys.woodenBlocks
|
||||
}
|
||||
}
|
||||
|
@ -645,7 +670,7 @@ const factory = createLayer(id, () => {
|
|||
},
|
||||
outputs: {
|
||||
bear: {
|
||||
amount: 1,
|
||||
amount: computed(() => (upgrades[1][3].bought.value ? 2 : 1)),
|
||||
resource: bears
|
||||
}
|
||||
},
|
||||
|
@ -697,7 +722,7 @@ const factory = createLayer(id, () => {
|
|||
},
|
||||
outputs: {
|
||||
console: {
|
||||
amount: 1,
|
||||
amount: computed(() => (upgrades[1][3].bought.value ? 3 : 1)),
|
||||
resource: consoles
|
||||
}
|
||||
},
|
||||
|
@ -1005,7 +1030,7 @@ const factory = createLayer(id, () => {
|
|||
const oilFuel = createBuyable(() => ({
|
||||
resource: oil.oil,
|
||||
cost() {
|
||||
return Decimal.pow(10, this.amount.value).times(1e24);
|
||||
return Decimal.pow(10, this.amount.value).times(1e23);
|
||||
},
|
||||
display: {
|
||||
title: "Oil Fuel",
|
||||
|
@ -1033,73 +1058,128 @@ const factory = createLayer(id, () => {
|
|||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})) as GenericBuyable;
|
||||
const factoryBuyables = { expandFactory, oilFuel, carryToys };
|
||||
const upgrades = [[createUpgrade(() => ({
|
||||
resource: trees.logs,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1e80),
|
||||
display: {
|
||||
title: "Sawmill Efficiency",
|
||||
description: "Metal increases sawmill consumption and production by *log(metal)/10"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: paper.paper,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1e94),
|
||||
display: {
|
||||
title: "News Ticker",
|
||||
description: "Paper boosts tick speed" // formula: *1+log(x)/100
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: toys.trucks,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1000),
|
||||
display: {
|
||||
title: "Haul wood in trucks",
|
||||
description: "Trucks multiply wood gain"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: metal.metal,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1e55),
|
||||
display: {
|
||||
title: "Diamond-tipped drills",
|
||||
description: "Drill power ^1.2"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
}))],
|
||||
[createUpgrade(() => ({
|
||||
resource: toys.woodenBlocks,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1000),
|
||||
display: {
|
||||
title: "Larger wood pieces",
|
||||
description: "Wooden block producers produce 3x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: dyes.dyes.red.amount,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1e17),
|
||||
display: {
|
||||
title: "Colorful clothes",
|
||||
description: "Dye producers produce 4x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: plastic.plastic,
|
||||
cost: () =>Decimal.pow(10, upgradeAmount.value).mul(1e17),
|
||||
display: {
|
||||
title: "Improved plastic producers",
|
||||
description: "Plastic producers produce 4x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
}))],
|
||||
]
|
||||
const upgrades = [
|
||||
[
|
||||
createUpgrade(() => ({
|
||||
resource: trees.logs,
|
||||
cost: () => Decimal.pow(5, upgradeAmount.value).mul(1e75),
|
||||
display: {
|
||||
title: "Sawmill Efficiency",
|
||||
description:
|
||||
"Double sawmill consumption and production and metal supplier efficiency"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: paper.paper,
|
||||
cost: () => Decimal.pow(5, upgradeAmount.value).mul(1e90),
|
||||
display: {
|
||||
title: "News Ticker",
|
||||
description: "Paper boosts tick speed"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: toys.trucks,
|
||||
cost: () => Decimal.pow(1.2, upgradeAmount.value).mul(1000),
|
||||
display: {
|
||||
title: "Haul wood in trucks",
|
||||
description: "Trucks multiply wood gain"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: metal.metal,
|
||||
cost: () => Decimal.pow(3, upgradeAmount.value).mul(1e53),
|
||||
display: {
|
||||
title: "Diamond-tipped drills",
|
||||
description: "Drill power ^1.2"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
}))
|
||||
],
|
||||
[
|
||||
createUpgrade(() => ({
|
||||
resource: toys.woodenBlocks,
|
||||
cost: () => Decimal.pow(1.2, upgradeAmount.value).mul(2000),
|
||||
display: {
|
||||
title: "Larger wood pieces",
|
||||
description: "Wooden block producers produce 3x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: dyes.dyes.red.amount,
|
||||
cost: () => Decimal.pow(1.5, upgradeAmount.value).mul(4e16),
|
||||
display: {
|
||||
title: "Colorful clothes",
|
||||
description: "Dye producers produce 4x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: plastic.plastic,
|
||||
cost: () => Decimal.pow(2, upgradeAmount.value).mul(1e17),
|
||||
display: {
|
||||
title: "Improved plastic producers",
|
||||
description: "Plastic producers produce 4x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: oil.oil,
|
||||
cost: () => Decimal.pow(1.5, upgradeAmount.value).mul(1e22),
|
||||
display: {
|
||||
title: "Capitalism",
|
||||
description: "Console production is tripled"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
}))
|
||||
],
|
||||
[
|
||||
createUpgrade(() => ({
|
||||
resource: coal.coal,
|
||||
cost: () => Decimal.pow(5, upgradeAmount.value).mul(1e130),
|
||||
display: {
|
||||
title: "Brighter work rooms",
|
||||
description: "Unused electricity makes ticks faster"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: dyes.dyes.blue.amount,
|
||||
cost: () => Decimal.pow(1.4, upgradeAmount.value).mul(1e15),
|
||||
display: {
|
||||
title: "Colorful teddy bears",
|
||||
description: "Teddy bears produce 2x as much"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: dyes.dyes.black.amount,
|
||||
cost: () => Decimal.pow(1.5, upgradeAmount.value).mul(1e6),
|
||||
display: {
|
||||
title: "New Colors",
|
||||
description: "Unlock white dye"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
})),
|
||||
createUpgrade(() => ({
|
||||
resource: boxes.boxes,
|
||||
cost: () => Decimal.pow(3, upgradeAmount.value).mul(1e80),
|
||||
display: {
|
||||
title: "Carry ticks in boxes",
|
||||
description: "Tick speed x1.5"
|
||||
},
|
||||
visible: () => showIf(main.days[advancedDay - 1].opened.value)
|
||||
}))
|
||||
]
|
||||
];
|
||||
|
||||
// pixi
|
||||
const upgradeAmount = computed(() => upgrades.flat().filter(u => u.bought.value).length) as ComputedRef<number>
|
||||
const upgradeAmount = computed(
|
||||
() => upgrades.flat().filter(u => u.bought.value).length
|
||||
) as ComputedRef<number>;
|
||||
// load every sprite here so pixi doesn't complain about loading multiple times
|
||||
const assetsLoading = Promise.all([
|
||||
Assets.load(Object.values(FACTORY_COMPONENTS).map(x => x.imageSrc)),
|
||||
|
@ -1166,8 +1246,6 @@ const factory = createLayer(id, () => {
|
|||
}
|
||||
}
|
||||
|
||||
updateGraphics();
|
||||
|
||||
loaded = true;
|
||||
watchEffect(updateGraphics);
|
||||
});
|
||||
|
@ -1358,10 +1436,13 @@ const factory = createLayer(id, () => {
|
|||
// if X is being moved, then we don't need to adjust x
|
||||
// however it needs to be aligned if Y is being moved
|
||||
// vice-versa
|
||||
const factorySizeOffset = computedFactorySize.value % 2 === 0 ? blockSize / 2 : 0;
|
||||
sprite.x =
|
||||
(x + xInc * 0.3 + (xInc == 0 ? Math.random() * 0.4 - 0.2 : 0)) * blockSize;
|
||||
(x + xInc * 0.3 + (xInc == 0 ? Math.random() * 0.4 - 0.2 : 0)) * blockSize +
|
||||
factorySizeOffset;
|
||||
sprite.y =
|
||||
(y + yInc * 0.3 + (yInc == 0 ? Math.random() * 0.4 - 0.2 : 0)) * blockSize;
|
||||
(y + yInc * 0.3 + (yInc == 0 ? Math.random() * 0.4 - 0.2 : 0)) * blockSize +
|
||||
factorySizeOffset;
|
||||
sprite.anchor.set(0.5);
|
||||
sprite.width = blockSize / 2.5;
|
||||
sprite.height = blockSize / 2.5;
|
||||
|
@ -1499,19 +1580,20 @@ const factory = createLayer(id, () => {
|
|||
|
||||
graphicContainer.removeChild(hoverSprite);
|
||||
if (isMouseHoverShown.value && compSelected.value !== "cursor") {
|
||||
// Offset half a block if factory size is even
|
||||
const factorySizeOffset = computedFactorySize.value % 2 === 0 ? blockSize / 2 : 0;
|
||||
const { tx, ty } = spriteContainer.localTransform;
|
||||
const x =
|
||||
roundDownTo(mouseCoords.x - tx, blockSize) + factorySizeOffset + tx - blockSize / 2;
|
||||
const y =
|
||||
roundDownTo(mouseCoords.y - ty, blockSize) + factorySizeOffset + ty - blockSize / 2;
|
||||
graphicContainer.lineStyle(4, 0x808080, 1);
|
||||
graphicContainer.drawRect(
|
||||
roundDownTo(mouseCoords.x - tx, blockSize) + tx - blockSize / 2,
|
||||
roundDownTo(mouseCoords.y - ty, blockSize) + ty - blockSize / 2,
|
||||
blockSize,
|
||||
blockSize
|
||||
);
|
||||
graphicContainer.drawRect(x, y, blockSize, blockSize);
|
||||
const factoryBaseData = FACTORY_COMPONENTS[compSelected.value];
|
||||
const sheet = Assets.get(factoryBaseData.imageSrc);
|
||||
hoverSprite = new Sprite(sheet);
|
||||
hoverSprite.x = roundDownTo(mouseCoords.x - tx, blockSize) + tx - blockSize / 2;
|
||||
hoverSprite.y = roundDownTo(mouseCoords.y - ty, blockSize) + ty - blockSize / 2;
|
||||
hoverSprite.x = x;
|
||||
hoverSprite.y = y;
|
||||
hoverSprite.width = blockSize;
|
||||
hoverSprite.height = blockSize;
|
||||
hoverSprite.alpha = 0.5;
|
||||
|
@ -1679,7 +1761,6 @@ const factory = createLayer(id, () => {
|
|||
const hovered = ref(false);
|
||||
const componentsList = jsx(() => {
|
||||
return (
|
||||
|
||||
<div class={{ "comp-container": true, hovered: hovered.value }}>
|
||||
<div class="comp-list">
|
||||
<div
|
||||
|
@ -1761,22 +1842,24 @@ const factory = createLayer(id, () => {
|
|||
);
|
||||
}
|
||||
|
||||
const hoveredComponent = jsx(() =>
|
||||
compHovered.value !== undefined ? (
|
||||
const hoveredComponent = jsx(() => {
|
||||
if (compHovered.value == null) {
|
||||
return "";
|
||||
}
|
||||
const factorySizeOffset = computedFactorySize.value % 2 === 0 ? blockSize / 2 : 0;
|
||||
const x = mouseCoords.x + factorySizeOffset;
|
||||
const y = mouseCoords.y + factorySizeOffset;
|
||||
const onRight =
|
||||
x + (document.getElementById("factory-info")?.clientWidth ?? 0) > app.view.width - 30;
|
||||
const onTop =
|
||||
y + (document.getElementById("factory-info")?.clientHeight ?? 0) > app.view.height - 30;
|
||||
return (
|
||||
<div
|
||||
class="info-container"
|
||||
id="factory-info"
|
||||
style={{
|
||||
...(mouseCoords.x +
|
||||
(document.getElementById("factory-info")?.clientWidth ?? 0) >
|
||||
app.view.width - 30
|
||||
? { right: app.view.width - mouseCoords.x + "px" }
|
||||
: { left: mouseCoords.x + 148 + "px" }),
|
||||
...(mouseCoords.y +
|
||||
(document.getElementById("factory-info")?.clientHeight ?? 0) >
|
||||
app.view.height - 30
|
||||
? { bottom: app.view.height - mouseCoords.y + "px" }
|
||||
: { top: mouseCoords.y + "px" })
|
||||
...(onRight ? { right: app.view.width - x + "px" } : { left: x + 148 + "px" }),
|
||||
...(onTop ? { bottom: app.view.height - y + "px" } : { top: y + "px" })
|
||||
}}
|
||||
>
|
||||
<h3>{FACTORY_COMPONENTS[compHovered.value.type].name}</h3>
|
||||
|
@ -1799,10 +1882,8 @@ const factory = createLayer(id, () => {
|
|||
</>
|
||||
) : undefined}
|
||||
</div>
|
||||
) : (
|
||||
""
|
||||
)
|
||||
);
|
||||
);
|
||||
});
|
||||
|
||||
const tabs = createTabFamily(
|
||||
{
|
||||
|
@ -1865,7 +1946,7 @@ const factory = createLayer(id, () => {
|
|||
<Spacer />
|
||||
{renderRow(...Object.values(factoryBuyables))}
|
||||
<Spacer />
|
||||
{renderGrid(...upgrades as VueFeature[][])}
|
||||
{renderGrid(...(upgrades as VueFeature[][]))}
|
||||
</>
|
||||
))
|
||||
})),
|
||||
|
|
|
@ -25,6 +25,7 @@ import {
|
|||
createSequentialModifier,
|
||||
createAdditiveModifier,
|
||||
createMultiplicativeModifier,
|
||||
createExponentialModifier,
|
||||
Modifier
|
||||
} from "game/modifiers";
|
||||
import { main } from "data/projEntry";
|
||||
|
@ -41,6 +42,7 @@ import workshop from "./workshop";
|
|||
import { WithRequired } from "util/common";
|
||||
import { ElfBuyable } from "./elves";
|
||||
import toys from "./toys";
|
||||
import factory from "./factory";
|
||||
import reindeer from "./reindeer";
|
||||
|
||||
const id = "oil";
|
||||
|
@ -890,6 +892,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: dyes.boosts.red2,
|
||||
description: "Red Dye",
|
||||
enabled: dyes.masteryEffectActive
|
||||
})),
|
||||
createExponentialModifier(() => ({
|
||||
exponent: 1.2,
|
||||
description: "Diamond-tipped drills",
|
||||
enabled: factory.upgrades[0][3].bought
|
||||
}))
|
||||
]);
|
||||
const computedDrillPower = computed(() => drillPower.apply(0));
|
||||
|
|
|
@ -381,6 +381,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: "350 toys",
|
||||
enabled: toys.milestones.milestone4.earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () => dyes.boosts.white1.value,
|
||||
description: "White Dye Boost"
|
||||
})),
|
||||
reindeer.reindeer.blitzen.modifier
|
||||
]);
|
||||
const computedPlasticGain = computed(() => plasticGain.apply(0));
|
||||
|
|
|
@ -42,7 +42,7 @@ const layer = createLayer(id, () => {
|
|||
);
|
||||
const currentDyeType = computed(
|
||||
() =>
|
||||
Object.values(dyes.dyes).filter(d => d !== dyes.dyes.black)[
|
||||
Object.values(dyes.dyes).filter(d => d !== dyes.dyes.black && d !== dyes.dyes.white)[
|
||||
new Decimal(ribbon.value).toNumber() % 6
|
||||
]
|
||||
);
|
||||
|
|
|
@ -288,6 +288,15 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
visibility: () =>
|
||||
showIf(milestone6.earned.value && main.days[factory.advancedDay - 1].opened.value)
|
||||
})) as GenericMilestone;
|
||||
const milestone8 = createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "6000 toys",
|
||||
effectDisplay: "Running out of energy? Let's increase the limit! Multiply energy capacity by 1.4"
|
||||
},
|
||||
shouldEarn: () => Decimal.gte(toySum.value, 6000),
|
||||
visibility: () =>
|
||||
showIf(milestone6.earned.value && main.days[factory.advancedDay - 1].opened.value)
|
||||
})) as GenericMilestone;
|
||||
const milestones = {
|
||||
milestone1,
|
||||
milestone2,
|
||||
|
@ -295,7 +304,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
milestone4,
|
||||
milestone5,
|
||||
milestone6,
|
||||
milestone7
|
||||
milestone7,
|
||||
milestone8
|
||||
};
|
||||
const { collapseMilestones, display: milestonesDisplay } =
|
||||
createCollapsibleMilestones(milestones);
|
||||
|
|
|
@ -39,6 +39,7 @@ import paper from "./paper";
|
|||
import workshop from "./workshop";
|
||||
import wrappingPaper from "./wrapping-paper";
|
||||
import toys from "./toys";
|
||||
import factory from "./factory";
|
||||
import reindeer from "./reindeer";
|
||||
const id = "trees";
|
||||
const day = 1;
|
||||
|
@ -552,6 +553,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: "3000 Toys",
|
||||
enabled: toys.milestones.milestone7.earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: () => Decimal.add(toys.trucks.value, 1),
|
||||
description: "Haul wood in trucks",
|
||||
enabled: factory.upgrades[0][2].bought
|
||||
})),
|
||||
reindeer.reindeer.dasher.modifier,
|
||||
createExponentialModifier(() => ({
|
||||
exponent: 1.2,
|
||||
|
|
|
@ -24,11 +24,12 @@ import {
|
|||
createAdditiveModifier,
|
||||
createExponentialModifier,
|
||||
createMultiplicativeModifier,
|
||||
createSequentialModifier
|
||||
createSequentialModifier,
|
||||
Modifier
|
||||
} from "game/modifiers";
|
||||
import { noPersist, persistent } from "game/persistence";
|
||||
import Decimal, { DecimalSource, formatWhole } from "util/bignum";
|
||||
import { Direction } from "util/common";
|
||||
import { Direction, WithRequired } from "util/common";
|
||||
import { render } from "util/vue";
|
||||
import { computed, ref, unref, watchEffect } from "vue";
|
||||
import elves from "./elves";
|
||||
|
@ -63,7 +64,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description: "Expand Factory",
|
||||
enabled: () => Decimal.gt(factory.factoryBuyables.expandFactory.amount.value, 0)
|
||||
}))
|
||||
]);
|
||||
]) as WithRequired<Modifier, "revert" | "description">;
|
||||
const computedMaxFoundation = computed(() => maxFoundation.apply(100));
|
||||
|
||||
const foundationConversion = createIndependentConversion(() => ({
|
||||
|
|
|
@ -465,7 +465,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
createDay(() => ({
|
||||
day: 20,
|
||||
shouldNotify: false,
|
||||
layer: "factory", // "presents"
|
||||
layer: null, // "presents"
|
||||
symbol: wrappingPaperSymbol,
|
||||
story: "",
|
||||
completedStory: "",
|
||||
|
|
Loading…
Reference in a new issue