mirror of
https://github.com/thepaperpilot/Advent-Incremental.git
synced 2025-02-16 09:31:43 +00:00
Add optional gain multiplier to limit format
This commit is contained in:
parent
2b5f435176
commit
5da85eacce
3 changed files with 12 additions and 41 deletions
|
@ -153,16 +153,6 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
progress: () => Decimal.div(oreProgress.value, maxOreProgress)
|
||||
}));
|
||||
|
||||
const metalGain = createSequentialModifier(() => [
|
||||
createAdditiveModifier(() => ({
|
||||
addend: computedAutoSmeltSpeed,
|
||||
enabled: autoSmeltEnabled
|
||||
})),
|
||||
createMultiplicativeModifier(() => ({
|
||||
multiplier: computedOrePurity
|
||||
}))
|
||||
]);
|
||||
const computedMetalGain = computed(() => metalGain.apply(0));
|
||||
const oreGain = createSequentialModifier(() => [
|
||||
createAdditiveModifier(() => ({
|
||||
addend: computedOreAmount
|
||||
|
@ -429,14 +419,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
{autoSmeltEnabled.value && Decimal.gte(industrialCrucible.amount.value, 1)
|
||||
? `+${formatLimit(
|
||||
[
|
||||
[computedMetalGain.value, "smelting speed"],
|
||||
[Decimal.times(computedOreGain.value, computedOrePurity.value), "ore gain"],
|
||||
[
|
||||
Decimal.div(coal.computedCoalGain.value, coalCost).times(computedOrePurity.value),
|
||||
"coal gain"
|
||||
]
|
||||
[computedAutoSmeltSpeed.value, "smelting speed"],
|
||||
[computedOreGain.value, "ore gain"],
|
||||
[Decimal.div(coal.computedCoalGain.value, coalCost), "coal gain"]
|
||||
],
|
||||
"/s"
|
||||
"/s",
|
||||
computedOrePurity.value
|
||||
)}`
|
||||
: undefined}
|
||||
</>
|
||||
|
|
|
@ -698,29 +698,12 @@ const layer = createLayer(id, function (this: BaseLayer) {
|
|||
Decimal.gt(computedAutoCuttingAmount.value, 0)
|
||||
? `+${format(ema.value)}/s average<br/>equilibrium: +${formatLimit(
|
||||
[
|
||||
[
|
||||
Decimal.mul(
|
||||
logGain.apply(1),
|
||||
computedAutoCuttingAmount.value
|
||||
),
|
||||
"cutting speed"
|
||||
],
|
||||
[
|
||||
Decimal.mul(
|
||||
logGain.apply(1),
|
||||
computedAutoPlantingAmount.value
|
||||
),
|
||||
"planting speed"
|
||||
],
|
||||
[
|
||||
Decimal.mul(
|
||||
logGain.apply(1),
|
||||
Decimal.mul(computedTotalTrees.value, 20)
|
||||
),
|
||||
"forest cap"
|
||||
]
|
||||
[computedAutoCuttingAmount.value, "cutting speed"],
|
||||
[computedAutoPlantingAmount.value, "planting speed"],
|
||||
[Decimal.mul(computedTotalTrees.value, 20), "forest cap"]
|
||||
],
|
||||
"/s"
|
||||
"/s",
|
||||
logGain.apply(1)
|
||||
)}`
|
||||
: undefined
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ export function invertOOM(x: DecimalSource): Decimal {
|
|||
return x;
|
||||
}
|
||||
|
||||
export function formatLimit(list: [DecimalSource, string][], unit: string): string {
|
||||
export function formatLimit(list: [DecimalSource, string][], unit: string, gainMultiplier: DecimalSource = Decimal.dOne): string {
|
||||
let num = list[0][0];
|
||||
let str = list[0][1];
|
||||
for (let i = 1; i < list.length; i++) {
|
||||
|
@ -205,7 +205,7 @@ export function formatLimit(list: [DecimalSource, string][], unit: string): stri
|
|||
str = list[i][1];
|
||||
}
|
||||
}
|
||||
return format(num) + unit + ", limited by " + str;
|
||||
return format(Decimal.times(num, gainMultiplier)) + unit + ", limited by " + str;
|
||||
}
|
||||
|
||||
export function formatGain(gain: DecimalSource) {
|
||||
|
|
Loading…
Add table
Reference in a new issue