From 4d5963e65d1aefa3dfc6fd325a9546f8b96a061b Mon Sep 17 00:00:00 2001 From: Aarex Tiaokhiao Date: Wed, 9 Sep 2020 18:14:05 -0400 Subject: [PATCH] Build 7 --- index.html | 170 ++++++++++++++++++++++++++++------------------------- js/game.js | 73 ++++++++++++----------- 2 files changed, 127 insertions(+), 116 deletions(-) diff --git a/index.html b/index.html index a9725bf..de15b53 100644 --- a/index.html +++ b/index.html @@ -359,7 +359,7 @@ - + @@ -386,98 +386,119 @@


You have

{{formatWhole(player[layer].points)}}

{{LAYER_RES[layer]}}, {{getLayerEffDesc(layer)}}

+ + +

+ Your best {{LAYER_RES[layer]}} is {{formatWhole(player[layer].best)}}
+ You have made a total of {{formatWhole(player[layer].total)}} {{LAYER_RES[layer]}}
-


-

8 Boosters


Keep Prestige Upgrades on reset

15 Boosters


You can buy max Boosters
+ + + +

8 Boosters


Keep Prestige Upgrades on reset

15 Boosters


You can buy max Boosters
- You have {{format(player.g.power)}} Generator Power, which multiplies Point gain by {{format(tmp.genPowEff)}}

- - -

8 Generators


Keep Prestige Upgrades on reset

10 Generators


Gain 100% of Prestige Point gain every second

15 Generators


You can buy max Generators
+ + + + +

8 Generators


Keep Prestige Upgrades on reset

10 Generators


Gain 100% of Prestige Point gain every second

15 Generators


You can buy max Generators


+ You have {{format(player.g.power)}} Generator Power, which multiplies Point gain by {{format(tmp.genPowEff)}}
- -

2 enhance points


Keep Booster/Generator milestones on reset

10 enhance points


Keep Prestige Upgrades on reset


+ + + +

2 enhance points


Keep Booster/Generator milestones on reset

10 enhance points


Keep Prestige Upgrades on reset


- You have {{format(player.t.energy)}} Time Energy, which multiplies Point gain & Prestige Point gain by {{format(tmp.timeEff)}}

- - - - - +

2 time capsules


Keep Booster/Generator milestones on reset

3 time capsules


Keep Prestige Upgrades on reset

4 time capsules


Keep Booster Upgrades on all row 3 resets

5 time capsules


Automatically purchase Boosters   

12 time capsules


Boosters reset nothing
+ + + + +

2 time capsules


Keep Booster/Generator milestones on reset

3 time capsules


Keep Prestige Upgrades on reset

4 time capsules


Keep Booster Upgrades on all row 3 resets

5 time capsules


Automatically purchase Boosters   

12 time capsules


Boosters reset nothing


+ You have {{format(player.t.energy)}} Time Energy, which multiplies Point gain & Prestige Point gain by {{format(tmp.timeEff)}}
+ You have {{ format(player.b.points) }} Boosters

- You have {{formatWhole(getSpace())}} Space remaining for Space Buildings.

- - - - - +

2 space energy


Keep Booster/Generator milestones on reset

3 space energy


Keep Prestige Upgrades on reset

4 space energy


Keep Generator Upgrades on all row 3 resets

5 space energy


Automatically purchase Generators   

12 space energy


Generators reset nothing
+ + + + +

2 space energy


Keep Booster/Generator milestones on reset

3 space energy


Keep Prestige Upgrades on reset

4 space energy


Keep Generator Upgrades on all row 3 resets

5 space energy


Automatically purchase Generators   

12 space energy


Generators reset nothing


+ You have {{formatWhole(getSpace())}} Space remaining for Space Buildings.
You have {{ format(player.g.power) }} Generator Power


-
-

-
- +
+

+
+
- -

3 Super-Boosters


Keep Prestige Upgrades on reset

4 Super-Boosters


Keep Booster/Generator milestones on reset
+ +

3 Super-Boosters


Keep Prestige Upgrades on reset

4 Super-Boosters


Keep Booster/Generator milestones on reset
- You have {{format(player.sg.power)}} Super-Generator Power, which multiplies the Generator base by {{format(tmp.sGenPowEff)}}

- - -

1 Super-Generator


You can buy max Super-Generators, and Super-Generators reset nothing

2 Super-Generators


Automatically purchase Super-Generators   
+

1 Super-Generator


You can buy max Super-Generators, and Super-Generators reset nothing +

2 Super-Generators


Automatically purchase Super-Generators    +

+ You have {{format(player.sg.power)}} Super-Generator Power, which multiplies the Generator base by {{format(tmp.sGenPowEff)}}
- - - - - - - - +

1 Hindrance Spirit


Keep Prestige Upgrades on all previous resets, and gain 100x more Enhance Points

2 Hindrance Spirit


Keep all third row milestones on all fourth row resets, and start with your best-ever Space

4 Hindrance Spirit


Keep Time, Enhance, and Space Upgrades on all fourth row resets

5 Hindrance Spirit


Automatically purchase Extra Time Capsules   

10 Hindrance Spirit


Keep Prestige & Super-Booster Upgrades on all fourth row resets

15 Hindrance Spirit


Automatically purchase Super-Boosters   

25 Hindrance Spirit


Time resets reset nothing

2,500 Hindrance Spirit


Super-Boosters reset nothing
+ + + + + + +

1 Hindrance Spirit


Keep Prestige Upgrades on all previous resets, and gain 100x more Enhance Points

2 Hindrance Spirit


Keep all third row milestones on all fourth row resets, and start with your best-ever Space

4 Hindrance Spirit


Keep Time, Enhance, and Space Upgrades on all fourth row resets

5 Hindrance Spirit


Automatically purchase Extra Time Capsules   

10 Hindrance Spirit


Keep Prestige & Super-Booster Upgrades on all fourth row resets

15 Hindrance Spirit


Automatically purchase Super-Boosters   

25 Hindrance Spirit


Time resets reset nothing

2,500 Hindrance Spirit


Super-Boosters reset nothing
- You have {{format(player.q.energy)}} Quirk Energy (generated by Quirk Layers), which multiplies Point & Generator Power gain by {{format(tmp.quirkEff)}}

- - - - - - - - +

1 Quirk


Keep Prestige Upgrades on all previous resets, and gain 100x more Enhance Points

2 Quirks


You can buy max Time Capsules & Space Energy

4 Quirks


Keep Space Buildings on all fourth row resets

5 Quirks


Automatically purchase Enhancers   

10 Quirks


Automatically purchase Time Capsules & Space Energy
 

15 Quirks


Gain 100% of Enhance Point gain every second

25 Quirks


Space resets reset nothing

2,500 Quirks


You can destroy individual Space Buildings
+ + + + + + +

1 Quirk


Keep Prestige Upgrades on all previous resets, and gain 100x more Enhance Points

2 Quirks


You can buy max Time Capsules & Space Energy

4 Quirks


Keep Space Buildings on all fourth row resets

5 Quirks


Automatically purchase Enhancers   

10 Quirks


Automatically purchase Time Capsules & Space Energy
 

15 Quirks


Gain 100% of Enhance Point gain every second

25 Quirks


Space resets reset nothing

2,500 Quirks


You can destroy individual Space Buildings


+ You have {{format(player.q.energy)}} Quirk Energy (generated by Quirk Layers), which multiplies Point & Generator Power gain by {{format(tmp.quirkEff)}}
- +

1 Hyper-Booster


You can buy max Super-Boosters

1 Hyper-Booster


You can buy max Super-Boosters
- You have {{format(player.ss.subspace)}} Subspace, which provides you with {{formatWhole(tmp.ssEff1)}} extra Space, makes all Space Buildings {{format(tmp.ssEff2)}}x cheaper, and makes all Space Buildings {{format(tmp.ssEff3.sub(1).times(100))}}% stronger

- -

1 Subspace Energy


Automatically purchase Space Buildings   
+

1 Subspace Energy


Automatically purchase Space Buildings    +

+ You have {{format(player.ss.subspace)}} Subspace, which provides you with {{formatWhole(tmp.ssEff1)}} extra Space, makes all Space Buildings {{format(tmp.ssEff2)}}x cheaper, and makes all Space Buildings {{format(tmp.ssEff3.sub(1).times(100))}}% stronger
-
- Note: Activating a Spell costs Magic.

+ + + + + + + +

1 Magic


Keep row 4 milestones on all resets

2 Magic


Keep Hindrance completions on all resets

3 Magic


Gain 100% of Hindrance Spirit & Quirk gain every second

4 Magic


Automatically purchase Hyper-Boosters & Subspace      

1,000 Magic


Automatically cast Spells   

2.5e9 Magic


Gain 100% of Hex gain every second, and Spells last 10x longer


+ Note: Activating a Spell costs Magic.


@@ -486,40 +507,28 @@
- You have {{formatWhole(player.m.hexes)}} Hexes, which are multiplying Hindrance Spirit & Quirk gain by {{format(tmp.hexEff)}}

- - - - - - - -

1 Magic


Keep row 4 milestones on all resets

2 Magic


Keep Hindrance completions on all resets

3 Magic


Gain 100% of Hindrance Spirit & Quirk gain every second

4 Magic


Automatically purchase Hyper-Boosters & Subspace      

1,000 Magic


Automatically cast Spells   

2.5e9 Magic


Gain 100% of Hex gain every second, and Spells last 10x longer
+ You have {{formatWhole(player.m.hexes)}} Hexes, which are multiplying Hindrance Spirit & Quirk gain by {{format(tmp.hexEff)}
-
You have {{format(player.ba.power)}} Balance Power, which is multiplying Hindrance Spirit & Quirk gain by {{format(tmp.balEff)}}
- You have {{format(player.ba.positivity)}} Positivity and {{format(player.ba.negativity)}} Negativity, which are multiplying Balance Power gain by {{format(tmp.balEff2)}}

- - - - - -

1 Balance Energy


Keep row 4 milestones on all resets

2 Balance Energy


Keep Quirk Upgrades on all resets

3 Balance Energy


Automatically purchase Quirk Layers   

5 Balance Energy


Keep Hyper-Booster & Subspace Upgrades on all resets

8 Balance Energy


You can buy max Hyper-Boosters & Subspace Energy, and Hyper-Boosters/Subspace Energy reset nothing
+

1 Balance Energy


Keep row 4 milestones on all resets +

2 Balance Energy


Keep Quirk Upgrades on all resets +

3 Balance Energy


Automatically purchase Quirk Layers    +

5 Balance Energy


Keep Hyper-Booster & Subspace Upgrades on all resets +

8 Balance Energy


You can buy max Hyper-Boosters & Subspace Energy, and Hyper-Boosters/Subspace Energy reset nothing +

+ You have {{format(player.ba.power)}} Balance Power, which is multiplying Hindrance Spirit & Quirk gain by {{format(tmp.balEff)}}
+ You have {{format(player.ba.positivity)}} Positivity and {{format(player.ba.negativity)}} Negativity, which are multiplying Balance Power gain by {{format(tmp.balEff2)}}
- You have made a total of {{formatWhole(player.sp.total)}} super-prestige points

- - - - + + + +

1 total Super-Prestige Point


Upgrades of Rows 1-5 and Hindrances are kept on all resets

2 total Super-Prestige Points


Keep Magic Milestones on reset, Spells do not cost Magic, and Magic Upgrade 13's effect can be auto-set to your current Magic   

5 total Super-Prestige Points


Keep Balance Milestones on reset

10 total Super-Prestige Points


Gain 100% of Magic & Balance Power gain every second

1 total Super-Prestige Point


Upgrades of Rows 1-5 and Hindrances are kept on all resets

2 total Super-Prestige Points


Keep Magic Milestones on reset, Spells do not cost Magic, and Magic Upgrade 13's effect can be auto-set to your current Magic   

5 total Super-Prestige Points


Keep Balance Milestones on reset

10 total Super-Prestige Points


Gain 100% of Magic & Balance Power gain every second
-


- - -


+

@@ -527,7 +536,6 @@
-

diff --git a/js/game.js b/js/game.js index e54e659..f60d5b4 100644 --- a/js/game.js +++ b/js/game.js @@ -2133,19 +2133,24 @@ function rowReset(row, layer) { } } +function addPoints(layer, gain) { + player[layer].points = player[layer].points.plus(gain).max(0) + player[layer].best = player[layer].best.max(player[layer].points) + if (player[layer].total) player[layer].total = player[layer].total.plus(gain) +} + +function generatePoints(layer, diff) { + addPoints(layer, tmp.resetGain[layer].times(diff)) +} + function doReset(layer, force=false) { if (!force) { if (tmp.layerAmt[layer].lt(tmp.layerReqs[layer])) return; let gain = tmp.resetGain[layer] if (LAYER_TYPE[layer]=="static") { if (tmp.layerAmt[layer].lt(tmp.nextAt[layer])) return; - player[layer].points = player[layer].points.plus(canBuyMax(layer)?gain:1) - if (player[layer].total) player[layer].total = player[layer].total.plus(canBuyMax(layer)?gain:1) - } else { - player[layer].points = player[layer].points.plus(gain) - if (player[layer].total) player[layer].total = player[layer].total.plus(gain) - } - player[layer].best = player[layer].best.max(player[layer].points) + addPoints(layer, canBuyMax(layer)?gain:1) + } else addPoints(layer, gain) if (!player[layer].unl) { player[layer].unl = true; @@ -2157,11 +2162,12 @@ function doReset(layer, force=false) { tmp.layerAmt[layer] = new Decimal(0) // quick fix } - + if ((layer=="b"&&player.t.best.gte(12))||(layer=="g"&&player.s.best.gte(12))) return; if ((layer=="t"&&player.h.best.gte(25))||(layer=="s"&&player.q.best.gte(25))||(layer=="sb"&&player.h.best.gte(2500))||(layer=="sg"&&player.sg.best.gte(1))) return; if ((layer=="hb"&&player.ba.best.gte(8))||(layer=="ss"&&player.ba.best.gte(8))) return; let row = LAYER_ROW[layer] + if (!force && row>=3) completeHindrance() if (row==0) rowReset(0, layer) else for (let x=row;x>=1;x--) rowReset(x, layer) @@ -2827,10 +2833,7 @@ function HCActive(x) { function startHindrance(x) { if (!player.h.unl) return if (player.h.active==x) { - if (player.points.gte(H_CHALLS[x].goal) && !player.h.challs.includes(x)) { - if (x==62) needCanvasUpdate = true; - player.h.challs.push(x); - } + completeHindrance(x) player.h.active = 0 } else { player.h.active = x @@ -2838,6 +2841,17 @@ function startHindrance(x) { doReset("h", true) } +function completeHindrance() { + var x = player.h.active + if (x == 0) return + if (!player.points.gte(H_CHALLS[x].goal)) return + if (!player.h.challs.includes(x)) { + if (x==62) needCanvasUpdate = true + player.h.challs.push(x); + } + player.h.active = 0 +} + function adjustMSDisp() { let displays = ["always", "automation", "incomplete", "never"]; player.msDisplay = displays[(displays.indexOf(player.msDisplay)+1)%4] @@ -3078,20 +3092,16 @@ function addToSGBase() { } function gameLoop(diff) { - diff = new Decimal(diff) - if (isNaN(diff.toNumber())) diff = new Decimal(0); - player.h.time += diff.toNumber() + if (isNaN(diff)) diff = 0 + player.timePlayed += diff + player.h.time += diff if (tmp.hcActive ? tmp.hcActive[42] : true) { - if (player.h.time>=10) diff = new Decimal(0) - else diff = diff.div(Decimal.div(10, Decimal.sub(10, player.h.time+1)).pow(1000)) + if (player.h.time>=10) diff = 0 + else diff = Decimal.div(diff, Decimal.div(10, Decimal.sub(10, player.h.time + 1)).pow(1000)) } - player.timePlayed += diff.toNumber() if (player.p.upgrades.includes(11)) player.points = player.points.plus(tmp.pointGen.times(diff)).max(0) if (player.g.unl) player.g.power = player.g.power.plus(tmp.layerEffs.g.times(diff)).max(0) - if (player.g.best.gte(10)) { - player.p.points = player.p.points.plus(tmp.resetGain.p.times(diff)).max(0) - player.p.best = player.p.best.max(player.p.points) - } + if (player.g.best.gte(10)) generatePoints("p", diff) if (player.t.unl) { let data = tmp.layerEffs.t player.t.energy = player.t.energy.plus(data.gain.times(diff)).min(data.limit).max(0) @@ -3103,10 +3113,7 @@ function gameLoop(diff) { let exp = getQuirkEnergyGainExp() if (exp.gte(0)) player.q.energy = player.q.energy.plus(player.q.time.pow(exp).times(mult).times(diff)).max(0) } - if (player.q.best.gte(15)) { - player.e.points = player.e.points.plus(tmp.resetGain.e.times(diff)).max(0) - player.e.best = player.e.best.max(player.e.points) - } + if (player.q.best.gte(15)) generatePoints("e", diff) if (player.ss.unl) player.ss.subspace = player.ss.subspace.plus(tmp.layerEffs.ss.times(diff)).max(0) if (player.ba.unl) { player.ba.power = player.ba.power.plus(tmp.layerEffs.ba.power.times(tmp.balEff2).times(getBalPowGainMult()).times(diff)).max(0) @@ -3115,17 +3122,13 @@ function gameLoop(diff) { } if (player.m.unl) for (let i=1;i<=3;i++) player.m.spellTimes[i] = Decimal.sub(player.m.spellTimes[i], diff).max(0).toNumber() if (player.m.best.gte(3)) { - player.h.points = player.h.points.plus(tmp.resetGain.h.times(diff)).max(0) - player.q.points = player.q.points.plus(tmp.resetGain.q.times(diff)).max(0) - player.h.best = player.h.best.max(player.h.points) - player.q.best = player.q.best.max(player.q.points) + generatePoints("h", diff) + generatePoints("q", diff) } if (player.m.best.gte(2.5e9)) player.m.hexes = player.m.hexes.plus(getHexGain().times(diff)).max(0) if (player.sp.total.gte(10)) { - player.m.points = player.m.points.plus(tmp.resetGain.m.times(diff)).max(0) - player.ba.points = player.ba.points.plus(tmp.resetGain.ba.times(diff)).max(0) - player.m.best = player.m.best.max(player.m.points) - player.ba.best = player.ba.best.max(player.ba.points) + generatePoints("m", diff) + generatePoints("ba", diff) } if (player.b.auto&&player.t.best.gte(5)) doReset("b") @@ -3178,7 +3181,7 @@ var interval = setInterval(function() { player.time = Date.now() if (needCanvasUpdate) resizeCanvas(); updateTemp(); - gameLoop(new Decimal(diff)) + gameLoop(diff) }, 50) document.onkeydown = function(e) {