1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-21 08:12:39 +00:00

Beta v1.1 Alpha 2

This commit is contained in:
Jacorb90 2020-08-25 23:32:27 -04:00
parent f9ef592716
commit da103d78f8
2 changed files with 93 additions and 34 deletions

View file

@ -81,6 +81,11 @@
<li>Add the framework for the first two row 4 layers</li>
<li>Balanced up to the second row 4 reset</li>
</ul>
<h3>Beta v1.1 Alpha 2</h3>
<ul>
<li>Implemented some new milestones</li>
<li>Balanced up to 5 Hindrance Spirit & 5 Quirks</li>
</ul>
</div>
<div v-if="player.tab=='credits'" class="col right">
<button class="back" onclick="showTab('tree')"></button><br><br><br><br><br>
@ -169,21 +174,21 @@
You have <h2 v-bind:class="{ [layer+'_txt']: true }">{{formatWhole(player[layer].points)}}</h2> {{LAYER_RES[layer]}}<span v-if="Object.keys(LAYER_EFFS).includes(layer)">, {{getLayerEffDesc(layer)}}</span>
<br><br>
<div v-if="layer=='b'">
<table><tr><td v-bind:class="{ milestone: player.b.best.lt(8), milestoneDone: player.b.best.gte(8) }">8 Boosters<br>Keep Prestige Upgrades on reset</td></tr><tr><td v-bind:class="{ milestone: player.b.best.lt(15), milestoneDone: player.b.best.gte(15) }">15 Boosters<br>You can buy max Boosters</td></tr></table>
<table><tr><td v-bind:class="{ milestone: player.b.best.lt(8)&&player.h.best.lt(1)&&player.q.best.lt(1), milestoneDone: player.b.best.gte(8)||player.h.best.gte(1)||player.q.best.gte(1) }">8 Boosters<br>Keep Prestige Upgrades on reset</td></tr><tr><td v-bind:class="{ milestone: player.b.best.lt(15), milestoneDone: player.b.best.gte(15) }">15 Boosters<br>You can buy max Boosters</td></tr></table>
</div>
<div v-if="layer=='g'">
You have {{format(player.g.power)}} Generator Power, which multiplies Point gain by {{format(tmp.genPowEff)}}<br><br>
<table><tr><td v-bind:class="{ milestone: player.g.best.lt(8), milestoneDone: player.g.best.gte(8) }">8 Generators<br>Keep Prestige Upgrades on reset</td></tr><tr><td v-bind:class="{ milestone: player.g.best.lt(10), milestoneDone: player.g.best.gte(10) }">10 Generators<br>Gain 100% of Prestige Point gain every second</td></tr><tr><td v-bind:class="{ milestone: player.g.best.lt(15), milestoneDone: player.g.best.gte(15) }">15 Generators<br>You can buy max Generators</td></tr></table>
<table><tr><td v-bind:class="{ milestone: player.g.best.lt(8)&&player.h.best.lt(1)&&player.q.best.lt(1), milestoneDone: player.g.best.gte(8)||player.h.best.gte(1)||player.q.best.gte(1) }">8 Generators<br>Keep Prestige Upgrades on reset</td></tr><tr><td v-bind:class="{ milestone: player.g.best.lt(10), milestoneDone: player.g.best.gte(10) }">10 Generators<br>Gain 100% of Prestige Point gain every second</td></tr><tr><td v-bind:class="{ milestone: player.g.best.lt(15), milestoneDone: player.g.best.gte(15) }">15 Generators<br>You can buy max Generators</td></tr></table>
</div>
<div v-if="layer=='e'">
<table><tr><td v-bind:class="{ milestone: player.e.best.lt(2), milestoneDone: player.e.best.gte(2) }">2 enhance points<br>Keep Booster/Generator milestones on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.e.best.lt(10), milestoneDone: player.e.best.gte(10) }">10 enhance points<br>Keep Prestige Upgrades on reset</td></tr></table><br><br>
<tr><td v-bind:class="{ milestone: player.e.best.lt(10)&&player.h.best.lt(1)&&player.q.best.lt(1), milestoneDone: player.e.best.gte(10)||player.h.best.gte(1)||player.q.best.gte(1) }">10 enhance points<br>Keep Prestige Upgrades on reset</td></tr></table><br><br>
<button v-bind:class="{ upgBig: true, can: player.e.points.gte(getEnhancerCost()), locked: player.e.points.lt(getEnhancerCost()), e: true }" onclick="buyEnhancer()">Buy an Enhancer<br>Cost: {{formatWhole(getEnhancerCost())}} Enhance Points<br>Amount: {{formatWhole(player.e.enhancers)}}<br>Multiplies Prestige Point gain by {{format(tmp.enhEff)}}<br>Adds to base of Booster/Generator effects by {{format(tmp.enhEff2)}}</button>
</div>
<div v-if="layer=='t'">
You have {{format(player.t.energy)}} Time Energy, which multiplies Point gain & Prestige Point gain by {{format(tmp.timeEff)}}<br><br>
<table><tr><td v-bind:class="{ milestone: player.t.best.lt(2), milestoneDone: player.t.best.gte(2) }">2 time capsules<br>Keep Booster/Generator milestones on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.t.best.lt(3), milestoneDone: player.t.best.gte(3) }">3 time capsules<br>Keep Prestige Upgrades on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.t.best.lt(3)&&player.h.best.lt(1)&&player.q.best.lt(1), milestoneDone: player.t.best.gte(3)||player.h.best.gte(1)||player.q.best.gte(1) }">3 time capsules<br>Keep Prestige Upgrades on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.t.best.lt(4), milestoneDone: player.t.best.gte(4) }">4 time capsules<br>Keep Booster Upgrades on all row 3 resets</td></tr>
<tr><td v-bind:class="{ milestone: player.t.best.lt(5), milestoneDone: player.t.best.gte(5) }">5 time capsules<br>Automatically purchase Boosters&nbsp;&nbsp;&nbsp;<button v-if="player.t.best.gte(5)" class="smallUpg can b" onclick="toggleAuto('b')">{{player.b.auto?"ON":"OFF"}}</button></td></tr>
<tr><td v-bind:class="{ milestone: player.t.best.lt(12), milestoneDone: player.t.best.gte(12) }">12 time capsules<br>Boosters reset nothing</td></tr>
@ -193,7 +198,7 @@
<div v-if="layer=='s'">
You have {{formatWhole(getSpace())}} Space remaining for Space Buildings.<br><br>
<table><tr><td v-bind:class="{ milestone: player.s.best.lt(2), milestoneDone: player.s.best.gte(2) }">2 space energy<br>Keep Booster/Generator milestones on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.s.best.lt(3), milestoneDone: player.s.best.gte(3) }">3 space energy<br>Keep Prestige Upgrades on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.s.best.lt(3)&&player.h.best.lt(1)&&player.q.best.lt(1), milestoneDone: player.s.best.gte(3)||player.h.best.gte(1)||player.q.best.gte(1) }">3 space energy<br>Keep Prestige Upgrades on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.s.best.lt(4), milestoneDone: player.s.best.gte(4) }">4 space energy<br>Keep Generator Upgrades on all row 3 resets</td></tr>
<tr><td v-bind:class="{ milestone: player.s.best.lt(5), milestoneDone: player.s.best.gte(5) }">5 space energy<br>Automatically purchase Generators&nbsp;&nbsp;&nbsp;<button v-if="player.s.best.gte(5)" class="smallUpg can g" onclick="toggleAuto('g')">{{player.g.auto?"ON":"OFF"}}</button></td></tr>
<tr><td v-bind:class="{ milestone: player.s.best.lt(12), milestoneDone: player.s.best.gte(12) }">12 space energy<br>Generators reset nothing</td></tr>
@ -207,16 +212,22 @@
</div>
</div>
<div v-if="layer=='sb'">
<table><tr><td v-bind:class="{ milestone: player.sb.best.lt(3), milestoneDone: player.sb.best.gte(3) }">3 Super-Boosters<br>Keep Prestige Upgrades on reset</td></tr>
<table><tr><td v-bind:class="{ milestone: player.sb.best.lt(3)&&player.h.best.lt(1)&&player.q.best.lt(1), milestoneDone: player.sb.best.gte(3)||player.h.best.gte(1)||player.q.best.gte(1) }">3 Super-Boosters<br>Keep Prestige Upgrades on reset</td></tr>
<tr><td v-bind:class="{ milestone: player.sb.best.lt(4), milestoneDone: player.sb.best.gte(4) }">4 Super-Boosters<br>Keep Booster/Generator milestones on reset</td></tr></table>
</div>
<div v-if="layer=='h'">
<table><tr><td v-bind:class="{ milestone: player.h.best.lt(1), milestoneDone: player.h.best.gte(1) }">1 Hindrance Spirit<br>Keep Prestige Upgrades on all previous resets, and gain 100x more Enhance Points</td></tr>
<tr><td v-bind:class="{ milestone: player.h.best.lt(2), milestoneDone: player.h.best.gte(2) }">2 Hindrance Spirit<br>Keep all third row milestones on all fourth row resets, and start with your best-ever Space</td></tr>
<tr><td v-bind:class="{ milestone: player.h.best.lt(4), milestoneDone: player.h.best.gte(4) }">4 Hindrance Spirit<br>Keep Time, Enhance, and Space Upgrades on all fourth row resets</td></tr>
<tr><td v-bind:class="{ milestone: player.h.best.lt(5), milestoneDone: player.h.best.gte(5) }">5 Hindrance Spirit<br>Automatically purchase Extra Time Capsules&nbsp;&nbsp;&nbsp;<button v-if="player.h.best.gte(5)" class="smallUpg can t" onclick="toggleAuto('t', 'Cap')">{{player.t.autoCap?"ON":"OFF"}}</button></td></tr>
</table>
</div>
<div v-if="layer=='q'">
You have {{format(player.q.energy)}} Quirk Energy (generated by Quirk Layers), which multiplies Point & Generator Power gain by {{format(tmp.quirkEff)}}<br><br>
<table><tr><td v-bind:class="{ milestone: player.q.best.lt(1), milestoneDone: player.q.best.gte(1) }">1 Quirk<br>Keep Prestige Upgrades on all previous resets, and gain 100x more Enhance Points</td></tr>
<tr><td v-bind:class="{ milestone: player.q.best.lt(2), milestoneDone: player.q.best.gte(2) }">2 Quirks<br>You can buy max Time Capsules & Space Energy</td></tr>
<tr><td v-bind:class="{ milestone: player.q.best.lt(4), milestoneDone: player.q.best.gte(4) }">4 Quirks<br>Keep Space Buildings on all fourth row resets</td></tr>
<tr><td v-bind:class="{ milestone: player.q.best.lt(5), milestoneDone: player.q.best.gte(5) }">5 Quirks<br>Automatically purchase Enhancers&nbsp;&nbsp;&nbsp;<button v-if="player.q.best.gte(5)" class="smallUpg can e" onclick="toggleAuto('e')">{{player.e.auto?"ON":"OFF"}}</button></td></tr>
</table><br><br>
<button v-bind:class="{ upgBig: true, can: player.q.points.gte(getQuirkLayerCost()), locked: player.q.points.lt(getQuirkLayerCost()), q: true }" onclick="buyQuirkLayer()">Increment your Quirk Layer<br>Cost: {{formatWhole(getQuirkLayerCost())}} Quirks<br>Layers: {{formatWhole(player.q.layers)}}</button>
</div>

View file

@ -36,6 +36,7 @@ function getStartPlayer() {
},
e: {
unl: false,
auto: false,
order: 0,
points: new Decimal(0),
best: new Decimal(0),
@ -44,6 +45,8 @@ function getStartPlayer() {
},
t: {
unl: false,
auto: false,
autoCap: false,
order: 0,
points: new Decimal(0),
best: new Decimal(0),
@ -53,6 +56,7 @@ function getStartPlayer() {
},
s: {
unl: false,
auto: false,
order: 0,
points: new Decimal(0),
best: new Decimal(0),
@ -114,7 +118,7 @@ const LAYER_RES = {
t: "time capsules",
s: "space energy",
sb: "super-boosters",
h: "hindrace spirit",
h: "hindrance spirit",
q: "quirks",
}
@ -181,7 +185,7 @@ const LAYER_EFFS = {
limit: Decimal.pow(2, player.t.points.plus(player.t.extCapsules.plus(tmp.freeExtCap))).sub(1).times(100).times(getTimeEnergyLimitMult()),
}},
sb: function() { return Decimal.pow(1.5, player.sb.points.times(getSuperBoosterPow())) },
h: function() { return player.h.points.plus(1).times(player.points.times(player.h.points).plus(1).log10().plus(1).log10().plus(1)).log10().times(5).sqrt() },
h: function() { return player.h.points.plus(1).times(player.points.times(player.h.points).plus(1).log10().plus(1).log10().plus(1)).log10().times(5).root(player.q.upgrades.includes(12)?1.25:2) },
}
const LAYER_UPGS = {
@ -652,8 +656,20 @@ const LAYER_UPGS = {
cols: 0,
},
q: {
rows: 0,
cols: 0,
rows: 1,
cols: 2,
11: {
desc: "Quirks & Hindrance Spirit boost Point, Prestige Point, and Enhance Point gain.",
cost: new Decimal(1),
unl: function() { return player.q.unl&&player.q.layers.gt(0) },
currently: function() { return player.q.points.plus(1).times(player.h.points.plus(1)).pow(0.75) },
effDisp: function(x) { return format(x)+"x" },
},
12: {
desc: "The Quirk Energy and Hindrance Spirit effects use better formulas.",
cost: new Decimal(5),
unl: function() { return player.q.upgrades.includes(11)&&player.h.best.gte(3) },
},
},
}
@ -794,10 +810,14 @@ function checkForVars() {
if (player.g.auto===undefined) player.g.auto = false
if (player.e === undefined) player.e = getStartPlayer().e
if (player.e.order === undefined) player.e.order = 0
if (player.e.auto===undefined) player.e.auto = false
if (player.t === undefined) player.t = getStartPlayer().t
if (player.t.auto===undefined) player.t.auto = false
if (player.t.autoCap===undefined) player.t.autoCap = false
if (player.s === undefined) player.s = getStartPlayer().s
if (player.s.buildings[4] === undefined) player.s.buildings[4] = new Decimal(0);
if (player.s.buildings[5] === undefined) player.s.buildings[5] = new Decimal(0);
if (player.s.auto === undefined) player.s.auto = false
if (player.sb === undefined) player.sb = getStartPlayer().sb
if (player.timePlayed === undefined) player.timePlayed = 0
if (player.hasNaN === undefined) player.hasNaN = false
@ -890,6 +910,12 @@ function canBuyMax(layer) {
case "g":
return player.g.best.gte(15)
break;
case "t":
return player.q.best.gte(2)
break;
case "s":
return player.q.best.gte(2)
break;
}
return false;
}
@ -931,6 +957,7 @@ function getLayerGainMult(layer) {
if (player.e.upgrades.includes(34)) mult = mult.times(1e40)
if (player.t.unl) mult = mult.times(tmp.timeEff)
if (player.s.unl && tmp.spaceBuildEff) mult = mult.times(tmp.spaceBuildEff[1])
if (player.q.upgrades.includes(11)) mult = mult.times(LAYER_UPGS.q[11].currently())
break;
case "b":
if (player.b.upgrades.includes(23)) mult = mult.div(LAYER_UPGS.b[23].currently())
@ -944,6 +971,7 @@ function getLayerGainMult(layer) {
if (player.e.upgrades.includes(24)) mult = mult.times(LAYER_UPGS.e[24].currently())
if (player.h.best.gte(1)) mult = mult.times(100)
if (player.q.best.gte(1)) mult = mult.times(100)
if (player.q.upgrades.includes(11)) mult = mult.times(LAYER_UPGS.q[11].currently())
break;
}
return mult
@ -1051,34 +1079,34 @@ function rowReset(row, layer) {
case 3:
player.t.points = new Decimal(0);
player.t.order = 0
player.t.best = new Decimal(0);
player.t.upgrades = [];
if (player.h.best.lt(2)) player.t.best = new Decimal(0);
if (player.h.best.lt(4)) player.t.upgrades = [];
player.t.extCapsules = new Decimal(0);
player.e.order = 0
player.e.points = new Decimal(0);
player.e.best = new Decimal(0);
if (player.h.best.lt(2)) player.e.best = new Decimal(0);
player.e.enhancers = new Decimal(0);
player.e.upgrades = [];
if (player.h.best.lt(4)) player.e.upgrades = [];
player.s = {
unl: player.s.unl,
order: 0,
points: new Decimal(0),
best: new Decimal(0),
spent: new Decimal(0),
buildings: {
best: player.h.best.gte(2) ? player.s.best : new Decimal(0),
spent: player.q.best.gte(4) ? player.s.spent : new Decimal(0),
buildings: player.q.best.gte(4) ? player.s.buildings : ({
1: new Decimal(0),
2: new Decimal(0),
3: new Decimal(0),
4: new Decimal(0),
5: new Decimal(0)
},
upgrades: [],
}),
upgrades: player.h.best.gte(2) ? player.s.upgrades : [],
}
player.sb = {
unl: player.sb.unl,
order: 0,
points: new Decimal(0),
best: new Decimal(0),
best: player.h.best.gte(2) ? player.sb.best : new Decimal(0),
upgrades: [],
}
player.q.time = new Decimal(0);
@ -1144,6 +1172,7 @@ function getPointGen() {
if (player.t.unl) gain = gain.times(tmp.timeEff)
if (player.s.unl && tmp.spaceBuildEff) gain = gain.times(tmp.spaceBuildEff[1])
if (player.q.unl && tmp.quirkEff) gain = gain.times(tmp.quirkEff)
if (player.q.upgrades.includes(11)) gain = gain.times(LAYER_UPGS.q[11].currently())
return gain
}
@ -1217,13 +1246,6 @@ function resetRow(row) {
resizeCanvas();
}
function getEnhancerCost() {
let e = player.e.enhancers
if (e.gte(25)) e = e.pow(2).div(25)
let cost = Decimal.pow(2, e.pow(1.5))
return cost.floor()
}
function getEnhancerPow() {
let pow = new Decimal(1)
if (player.e.upgrades.includes(25)) pow = pow.times(LAYER_UPGS.e[25].currently())
@ -1243,6 +1265,13 @@ function getEnhancerEff2() {
return eff;
}
function getEnhancerCost() {
let e = player.e.enhancers
if (e.gte(25)) e = e.pow(2).div(25)
let cost = Decimal.pow(2, e.pow(1.5))
return cost.floor()
}
function buyEnhancer() {
let cost = getEnhancerCost()
if (player.e.points.lt(cost)) return
@ -1250,6 +1279,14 @@ function buyEnhancer() {
player.e.enhancers = player.e.enhancers.plus(1)
}
function maxEnhancers() {
let target = player.e.points.max(1).log(2).root(1.5)
if (target.gte(25)) target = target.times(25).sqrt()
target = target.plus(1).floor()
if (target.lte(player.e.enhancers)) return
player.e.enhancers = player.e.enhancers.max(target)
}
function getFreeExtCapsules() {
let amt = new Decimal(0)
if (player.t.upgrades.includes(12)) amt = amt.plus(1)
@ -1301,6 +1338,14 @@ function buyExtCapsule() {
player.t.extCapsules = player.t.extCapsules.plus(1)
}
function maxExtTimeCapsules() {
let target = player.b.points.div(10).sub(1).root(1.2).div(0.4)
if (target.gte(25)) target = target.times(25).sqrt()
target = target.plus(1).floor()
if (target.lte(player.t.extCapsules)) return
player.t.extCapsules = player.t.extCapsules.max(target)
}
function getSpace() {
let baseSpace = player.s.best.pow(1.1).times(3).floor()
if (player.s.upgrades.includes(13)) baseSpace = baseSpace.plus(2);
@ -1410,9 +1455,9 @@ function getSpaceBuildingsUnl() {
return x;
}
function toggleAuto(layer) {
if (player[layer].auto===undefined) return;
player[layer].auto = !player[layer].auto
function toggleAuto(layer, end="") {
if (player[layer]["auto"+end]===undefined) return;
player[layer]["auto"+end] = !player[layer]["auto"+end]
}
function getSuperBoosterPow() {
@ -1433,6 +1478,7 @@ function getQuirkEnergyGainExp() {
function getQuirkEnergyEff() {
let eff = player.q.energy.plus(1).pow(2)
if (player.q.upgrades.includes(12)) eff = eff.pow(player.q.energy.plus(1).log10().plus(1).log10().plus(1))
return eff;
}
@ -1454,15 +1500,17 @@ function gameLoop(diff) {
let data = tmp.layerEffs.t
player.t.energy = player.t.energy.plus(data.gain.times(diff)).min(data.limit)
}
if (player.b.auto&&player.t.best.gte(5)) doReset("b")
if (player.g.auto&&player.s.best.gte(5)) doReset("g")
if (player.q.unl) {
player.q.time = player.q.time.plus(diff)
let exp = getQuirkEnergyGainExp()
if (exp.gte(0)) player.q.energy = player.q.energy.plus(player.q.time.pow(exp).times(diff))
}
if (player.b.auto&&player.t.best.gte(5)) doReset("b")
if (player.g.auto&&player.s.best.gte(5)) doReset("g")
if (player.e.auto&&player.q.best.gte(5)) maxEnhancers()
if (player.t.autoCap&&player.h.best.gte(5)) maxExtTimeCapsules()
if (player.hasNaN&&!NaNalert) {
alert("We have detected a corruption in your save. Please visit https://discord.gg/wwQfgPa for help.")
clearInterval(interval);