Implemented dye mastery effect

This commit is contained in:
thepaperpilot 2022-12-19 22:43:14 -06:00
parent 969b555043
commit 40b40dc9dd
4 changed files with 63 additions and 11 deletions

View file

@ -444,6 +444,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
multiplier: 2,
description: "Carry cloth in boxes",
enabled: boxes.row3Upgrades.clothUpgrade.bought
})),
createMultiplicativeModifier(() => ({
multiplier: dyes.boosts.yellow2,
description: "Yellow Dye",
enabled: dyes.masteryEffectActive
}))
]);
const computedSheepGain = computed(() => sheepGain.apply(1));
@ -484,6 +489,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
multiplier: 2,
description: "Carry cloth in boxes",
enabled: boxes.row3Upgrades.clothUpgrade.bought
})),
createMultiplicativeModifier(() => ({
multiplier: dyes.boosts.yellow2,
description: "Yellow Dye",
enabled: dyes.masteryEffectActive
}))
]);
const computedShearingAmount = computed(() => shearingAmount.apply(1));
@ -524,6 +534,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
multiplier: 2,
description: "Carry cloth in boxes",
enabled: boxes.row3Upgrades.clothUpgrade.bought
})),
createMultiplicativeModifier(() => ({
multiplier: dyes.boosts.yellow2,
description: "Yellow Dye",
enabled: dyes.masteryEffectActive
}))
]);
const computedSpinningAmount = computed(() => spinningAmount.apply(1));

View file

@ -63,6 +63,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
const name = "Dyes";
const color = "#D4D4F4";
const masteryEffectActive = computed(
() => mastered.value || main.currentlyMastering.value?.name === name
);
function createDye(
options: {
name: string;
@ -413,6 +417,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
boosts.red1.value
)} effective Oil Pumps (does not impact coal consumption)`
)
},
{
visible: masteryEffectActive,
desc: computed(() => `x${format(boosts.red2.value)} drill power`)
}
],
dyesToReset: []
@ -437,6 +445,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
{
visible: true,
desc: computed(() => `x${format(boosts.yellow1.value)} Paper \& Plastic gain`)
},
{
visible: masteryEffectActive,
desc: computed(() => `x${format(boosts.yellow2.value)} cloth actions`)
}
],
dyesToReset: []
@ -465,8 +477,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
() =>
`+${formatWhole(
boosts.blue1.value
)} forest size (after all other modifiers).`
)} forest size (after all other modifiers)`
)
},
{
visible: masteryEffectActive,
desc: computed(() => `/${format(boosts.blue2.value)} plastic buyables cost`)
}
],
dyesToReset: []
@ -610,8 +626,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
upgrades.blueDyeUpg2.bought.value ? 1.5 : 1
)
),
red2: computed(() =>
Decimal.pow(
Decimal.add(dyes.red.amount.value, 1).log2().plus(1),
upgrades.blueDyeUpg2.bought.value ? 1.5 : 1
)
),
yellow1: computed(() => Decimal.add(dyes.yellow.amount.value, 1).log2().plus(1)),
yellow2: computed(() => Decimal.add(dyes.yellow.amount.value, 1).log2().plus(1).times(3)),
blue1: computed(() => Decimal.add(dyes.blue.amount.value, 1).log2().sqrt().times(5e6)),
blue2: computed(() => Decimal.add(dyes.blue.amount.value, 1).log2().plus(1).pow(2)),
orange1: computed(() =>
Decimal.pow(2, Decimal.add(dyes.orange.amount.value, 1).log2().sqrt())
@ -861,9 +885,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
}
};
const mastered = persistent<boolean>(false);
const masteryEffectActive = computed(
() => mastered.value || main.currentlyMastering.value?.name === name
);
return {
name,
@ -881,6 +902,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
<>
{render(trackerDisplay)}
<Spacer />
{masteryEffectActive.value ? (
<>
<div class="decoration-effect ribbon">
Decoration effect:
<br />
Each primary dye gains a second effect
</div>
<Spacer />
</>
) : null}
<div style="width: 620px">
{renderRow(dyes.red.display, dyes.yellow.display, dyes.blue.display)}
{renderRow(dyes.red.buyable, dyes.yellow.buyable, dyes.blue.buyable)}
@ -898,7 +929,8 @@ const layer = createLayer(id, function (this: BaseLayer) {
</>
)),
mastery,
mastered
mastered,
masteryEffectActive
};
});

View file

@ -878,6 +878,11 @@ const layer = createLayer(id, function (this: BaseLayer) {
multiplier: () => coalEffectiveness.value,
description: "Effectiveness",
enabled: () => Decimal.lt(coalEffectiveness.value, 1)
})),
createMultiplicativeModifier(() => ({
multiplier: dyes.boosts.red2,
description: "Red Dye",
enabled: dyes.masteryEffectActive
}))
]);
const computedDrillPower = computed(() => drillPower.apply(0));

View file

@ -211,10 +211,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
cost() {
let v = passivePaper.amount.value;
v = Decimal.pow(0.95, paper.books.plasticBook.totalAmount.value).times(v);
return Decimal.pow(1.3, v).times(100);
return Decimal.pow(1.3, v).times(100).div(dyes.boosts.blue2.value);
},
inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 100).log(1.3);
let v = Decimal.times(x, dyes.boosts.blue2.value).div(100).log(1.3);
v = v.div(Decimal.pow(0.95, paper.books.plasticBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},
@ -244,10 +244,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
cost() {
let v = passiveBoxes.amount.value;
v = Decimal.pow(0.95, paper.books.plasticBook.totalAmount.value).times(v);
return Decimal.pow(1.3, v).times(100);
return Decimal.pow(1.3, v).times(100).div(dyes.boosts.blue2.value);
},
inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 100).log(1.3);
let v = Decimal.times(x, dyes.boosts.blue2.value).div(100).log(1.3);
v = v.div(Decimal.pow(0.95, paper.books.plasticBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},
@ -277,10 +277,10 @@ const layer = createLayer(id, function (this: BaseLayer) {
cost() {
let v = clothGains.amount.value;
v = Decimal.pow(0.95, paper.books.plasticBook.totalAmount.value).times(v);
return Decimal.pow(1.3, v).times(100);
return Decimal.pow(1.3, v).times(100).div(dyes.boosts.blue2.value);
},
inverseCost(x: DecimalSource) {
let v = Decimal.div(x, 100).log(1.3);
let v = Decimal.times(x, dyes.boosts.blue2.value).div(100).log(1.3);
v = v.div(Decimal.pow(0.95, paper.books.plasticBook.totalAmount.value));
return Decimal.isNaN(v) ? Decimal.dZero : v.floor().max(0);
},