mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-02-16 09:31:43 +00:00
Implemented Mary lv1-3
This commit is contained in:
parent
69b79eec16
commit
9d0df469e5
4 changed files with 17 additions and 5 deletions
|
@ -451,6 +451,9 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
if (Decimal.gte(v, 200)) v = Decimal.pow(v, 2).div(200);
|
||||
if (Decimal.gte(v, 2e6)) v = Decimal.pow(v, 2).div(2e6);
|
||||
v = Decimal.pow(0.95, paper.books.heatedPlantersBook.amount.value).times(v);
|
||||
if (management.elfTraining.heatedPlantersElfTraining.milestones[0].earned.value) {
|
||||
v = Decimal.pow(0.95, paper.books.heatedPlantersBook.amount.value).times(v);
|
||||
}
|
||||
return Decimal.add(v, 1).pow(2.5).times(10);
|
||||
},
|
||||
display: {
|
||||
|
|
|
@ -28,6 +28,7 @@ import { computed, ComputedRef, ref, Ref, unref, watchEffect } from "vue";
|
|||
import boxes from "./boxes";
|
||||
import cloth from "./cloth";
|
||||
import coal from "./coal";
|
||||
import management from "./management";
|
||||
import paper from "./paper";
|
||||
import plastic from "./plastic";
|
||||
import trees from "./trees";
|
||||
|
@ -430,6 +431,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
onAutoPurchase?: VoidFunction;
|
||||
onPurchase?: VoidFunction; // Will get overriden by the custom onpurchase, but that's fine
|
||||
canBuy?: Computable<boolean>;
|
||||
buyMax?: Computable<boolean>;
|
||||
} & Partial<ClickableOptions>
|
||||
) {
|
||||
const buyProgress = persistent<DecimalSource>(0);
|
||||
|
@ -439,6 +441,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
const computedAutoBuyCooldown = computed(() => options.cooldownModifier.apply(10));
|
||||
|
||||
const isActive = convertComputable(options.canBuy ?? true);
|
||||
const buyMax = convertComputable(options.buyMax ?? false);
|
||||
|
||||
function update(diff: number) {
|
||||
if (upgrade.bought.value && unref(isActive)) {
|
||||
|
@ -447,7 +450,7 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
amountOfTimesDone.value += diff / cooldown.toNumber();
|
||||
(isArray(options.buyable) ? options.buyable : [options.buyable]).forEach(
|
||||
buyable => {
|
||||
while (Decimal.gte(buyProgress.value, cooldown)) {
|
||||
while (buyMax ? true : Decimal.gte(buyProgress.value, cooldown)) {
|
||||
if (
|
||||
options.customCost == undefined
|
||||
? unref(buyable.canPurchase)
|
||||
|
@ -558,7 +561,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
description:
|
||||
"Mary will automatically purchase heated planters you can afford, without actually spending any coal.",
|
||||
buyable: coal.heatedPlanters,
|
||||
cooldownModifier: heatedPlanterCooldown
|
||||
cooldownModifier: heatedPlanterCooldown,
|
||||
buyMax: management.elfTraining.heatedPlanterElfTraining.milestones[2].earned
|
||||
});
|
||||
const fertilizerElf = createElf({
|
||||
name: "Noel",
|
||||
|
|
|
@ -385,14 +385,14 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Mary Level 1",
|
||||
effectDisplay: "Heated planters are less expensive."
|
||||
effectDisplay: `"Tillamook Burn Country" affects "Heated Planters" twice.`
|
||||
},
|
||||
shouldEarn: () => heatedPlanterElfTraining.level.value >= 1
|
||||
})),
|
||||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Mary Level 2",
|
||||
effectDisplay: "Double tree planting speed"
|
||||
effectDisplay: "Double automatic tree planting speed"
|
||||
},
|
||||
visibility: () => showIf(heatedPlanterElfMilestones[0].earned.value),
|
||||
shouldEarn: () => heatedPlanterElfTraining.level.value >= 2
|
||||
|
@ -435,7 +435,7 @@ const layer = createLayer(id, () => {
|
|||
createMilestone(() => ({
|
||||
display: {
|
||||
requirement: "Noel Level 2",
|
||||
effectDisplay: `"The Garden Tree's Handbook" affects Fertilized Soil twice`
|
||||
effectDisplay: `"The Garden Tree's Handbook" affects "Fertilized Soil" twice`
|
||||
},
|
||||
visibility: () => showIf(fertilizerElfMilestones[0].earned.value),
|
||||
shouldEarn: () => heatedPlanterElfTraining.level.value >= 2
|
||||
|
|
|
@ -376,6 +376,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
multiplier: 2,
|
||||
description: "Ivy Level 1",
|
||||
enabled: management.elfTraining.planterElfTraining.milestones[0].earned
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: 2,
|
||||
description: "Mary Level 2",
|
||||
enabled: management.elfTraining.planterElfTraining.milestones[1].earned
|
||||
}))
|
||||
]) as WithRequired<Modifier, "description" | "revert">;
|
||||
const computedAutoPlantingAmount = computed(() => autoPlantingAmount.apply(0));
|
||||
|
|
Loading…
Add table
Reference in a new issue