1
0
Fork 0
mirror of https://github.com/Acamaeda/The-Modding-Tree.git synced 2024-11-28 02:51:55 +00:00

v1.0 Beta 1

This commit is contained in:
Jacorb90 2020-09-08 22:10:25 -04:00
parent ef5b292d61
commit a3e2b1f9e4
5 changed files with 198 additions and 25 deletions

View file

@ -15,7 +15,12 @@
<div class="vl"></div>
<div v-if="player.tab=='changelog'" class="col right">
<button class="back" onclick="showTab('tree')"></button><br><br>
<h3>Beta v1.2 Alpha 14</h3>
<h3>v1.0 Beta 1</h3>
<ul>
<li>Implemented the Super-Prestige layer (unfinished)</li>
<li>Balanced up to 1e18,000,000 Points & 10 Super-Prestige Points</li>
</ul><br>
<h3>Beta v1.2</h3>
<ul>
<li>Balanced up to 1e15,000,000 Points</li>
</ul><br>
@ -290,6 +295,7 @@
3: Cast spell 3
</span><br>
<span v-if="player.ba.unl">A: Balance reset</span><br>
<span v-if="player.sp.unl">Shift+P: Super-Prestige reset</span><br>
</div>
<div v-if="player.tab=='options'" class="col right">
<button class="back" onclick="showTab('tree')"></button><br><br><br><br><br>
@ -363,6 +369,14 @@
</table><table>
<td id="m" v-if="layerUnl('m')"><button onclick="showTab('m')" v-bind:tooltip="((player.h.points.gte(tmp.layerReqs.m)||player.m.unl)&&layerUnl('m')) ? (formatWhole(player.m.points)+' magic') : ('Reach '+format(tmp.layerReqs.m)+' hindrance spirit to unlock')" v-bind:class="{ treeNode: true, m: true, locked: (player.h.points.lt(tmp.layerReqs.m)&&!player.m.unl), can: (player.h.points.gte(tmp.layerReqs.m)||player.m.unl) }">M</button></td>
<td id="ba" v-if="layerUnl('ba')"><button onclick="showTab('ba')" v-bind:tooltip="((player.q.points.gte(tmp.layerReqs.ba)||player.ba.unl)&&layerUnl('ba')) ? (formatWhole(player.ba.points)+' balance energy') : ('Reach '+format(tmp.layerReqs.ba)+' quirks to unlock')" v-bind:class="{ treeNode: true, ba: true, locked: (player.q.points.lt(tmp.layerReqs.ba)&&!player.ba.unl), can: (player.q.points.gte(tmp.layerReqs.ba)||player.ba.unl) }">BA</button></td>
</table><table>
<tr>
<td><button class="treeNode hidden"></button></td>
</tr>
</table><table>
<tr>
<td id="sp"><button onclick="showTab('sp')" v-bind:tooltip="(player.p.points.gte(tmp.layerReqs.sp)||player.sp.unl) ? (formatWhole(player.sp.points)+' super-prestige points') : ('Reach '+format(tmp.layerReqs.sp)+' prestige points to unlock')" v-bind:class="{ treeNode: true, sp: true, locked: (player.p.points.lt(tmp.layerReqs.sp)&&!player.sp.unl), can: (player.p.points.gte(tmp.layerReqs.sp)||player.sp.unl) }">SP</button></td>
</tr>
</table>
<canvas id="treeCanvas" class="canvas"></canvas>
</div>
@ -462,9 +476,9 @@
</div>
<div v-if="layer=='m'">
<br>
Note: Activating a Spell costs Magic.<br><br>
<span v-if="player.sp.total.lt(2)">Note: Activating a Spell costs Magic.</span><br><br>
<div class="upgRow">
<div v-for="id in 3">
<div v-for="id in tmp.spellsUnl">
<button v-bind:class="{ upg: true, bought: spellActive(id), can: ((player.m.points.gte(player.m.toCast[id]))&&player.m.unl&&!spellActive(id)), locked: (!(player.m.points.gte(player.m.toCast[id])||spellActive(id))), m: true }" v-on:click="activateSpell(id)"><h3>{{SPELL_NAMES[id]}}</h3><br>Time Left: {{formatTime(player.m.spellTimes[id])}}<br>Effect: {{getSpellDesc(id)}}</button><br><br>
<div v-if="player.m.upgrades.includes(41)">
<input v-model="player.m.toCast[id]" v-on:change="updateToCast(id)"></input><br><br>
@ -494,6 +508,14 @@
<tr><td v-if="milestoneShown(player.ba.best.gte(8))" v-bind:class="{ milestone: player.ba.best.lt(8), milestoneDone: player.ba.best.gte(8) }">8 Balance Energy<br>You can buy max Hyper-Boosters & Subspace Energy, and Hyper-Boosters/Subspace Energy reset nothing</td></tr>
</table>
</div>
<div v-if="layer=='sp'">
<table>
<tr><td v-if="milestoneShown(player.sp.total.gte(1))" v-bind:class="{ milestone: player.sp.total.lt(1), milestoneDone: player.sp.total.gte(1) }">1 Total Super-Prestige Point<br>Upgrades of Rows 1-5 and Hindrances are kept on all resets</td></tr>
<tr><td v-if="milestoneShown(player.sp.total.gte(2), true)" v-bind:class="{ milestone: player.sp.total.lt(2), milestoneDone: player.sp.total.gte(2) }">2 Total Super-Prestige Points<br>Keep Magic Milestones on reset, Spells do not cost Magic, and Magic Upgrade 13's effect can be auto-set to your current Magic&nbsp;&nbsp;&nbsp;<button v-if="player.sp.total.gte(2)" class="smallUpg can m" onclick="toggleAuto('m', 'Ins')">{{player.m.autoIns?"ON":"OFF"}}</button></td></tr>
<tr><td v-if="milestoneShown(player.sp.total.gte(5))" v-bind:class="{ milestone: player.sp.total.lt(5), milestoneDone: player.sp.total.gte(5) }">5 Total Super-Prestige Point<br>Keep Balance Milestones on reset</td></tr>
<tr><td v-if="milestoneShown(player.sp.total.gte(10))" v-bind:class="{ milestone: player.sp.total.lt(10), milestoneDone: player.sp.total.gte(10) }">10 Total Super-Prestige Point<br>Gain 100% of Magic & Balance Power gain every second</td></tr>
</table>
</div>
<br><br><br>
<button v-if="LAYER_TYPE[layer]=='normal'" v-bind:class="{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.layerReqs[layer]), can: tmp.layerAmt[layer].gte(tmp.layerReqs[layer]) }" v-on:click="doReset(layer)">+{{formatWhole(tmp.resetGain[layer])}} {{LAYER_RES[layer]}}<br>Next at {{ (LAYER_RES_CEIL.includes(layer) ? formatWhole(tmp.nextAt[layer]) : format(tmp.nextAt[layer])) }} {{ LAYER_AMT_NAMES[layer] }}</button>
<button v-if="LAYER_TYPE[layer]=='static'" v-bind:class="{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.nextAt[layer]), can: tmp.layerAmt[layer].gte(tmp.nextAt[layer]) }" v-on:click="doReset(layer)">+{{formatWhole(tmp.resetGain[layer])}} {{LAYER_RES[layer]}}<br>Req: {{(LAYER_RES_CEIL.includes(layer) ? formatWhole(tmp.nextAt[layer]) : format(tmp.nextAt[layer]))}} {{ LAYER_AMT_NAMES[layer] }}</button>

View file

@ -54,6 +54,10 @@ function drawTree() {
drawTreeBranch("q", "ba")
drawTreeBranch("ss", "ba")
}
if (layerUnl('sp')) {
drawTreeBranch("m", "sp")
drawTreeBranch("ba", "sp")
}
needCanvasUpdate = false;
}

View file

@ -15,7 +15,7 @@ function getStartPlayer() {
msDisplay: "always",
offlineProd: true,
versionType: "beta",
version: 1.2,
version: 1.3,
timePlayed: 0,
hasNaN: false,
points: new Decimal(10),
@ -132,23 +132,27 @@ function getStartPlayer() {
m: {
unl: false,
auto: false,
autoIns: false,
points: new Decimal(0),
best: new Decimal(0),
spellTimes: {
1: 0,
2: 0,
3: 0,
4: 0,
},
hexes: new Decimal(0),
toCast: {
1: "1",
2: "1",
3: "1",
4: "1",
},
casted: {
1: new Decimal(1),
2: new Decimal(1),
3: new Decimal(1),
4: new Decimal(1),
},
upgrades: [],
},
@ -161,10 +165,17 @@ function getStartPlayer() {
negativity: new Decimal(0),
upgrades: [],
},
sp: {
unl: false,
points: new Decimal(0),
best: new Decimal(0),
total: new Decimal(0),
upgrades: [],
},
}
}
const LAYERS = ["p", "b", "g", "e", "t", "s", "sb", "sg", "h", "q", "hb", "ss", "m", "ba"]
const LAYERS = ["p", "b", "g", "e", "t", "s", "sb", "sg", "h", "q", "hb", "ss", "m", "ba", "sp"]
const LAYER_REQS = {
p: new Decimal(10),
@ -181,6 +192,7 @@ const LAYER_REQS = {
ss: new Decimal(36),
m: new Decimal(1e80),
ba: new Decimal(1e130),
sp: new Decimal("1e8500000"),
}
const LAYER_RES = {
@ -198,6 +210,7 @@ const LAYER_RES = {
ss: "subspace energy",
m: "magic",
ba: "balance energy",
sp: "super-prestige points",
}
const LAYER_RES_CEIL = ["sb", "sg", "hb", "ss"]
@ -217,6 +230,7 @@ const LAYER_TYPE = {
ss: "static",
m: "normal",
ba: "normal",
sp: "normal",
}
const LAYER_EXP = {
@ -234,6 +248,7 @@ const LAYER_EXP = {
ss: new Decimal(1.1),
m: new Decimal(0.01),
ba: new Decimal(0.00667),
sp: new Decimal(2e-7),
}
const LAYER_BASE = {
@ -262,7 +277,8 @@ const LAYER_ROW = {
ss: 3,
m: 4,
ba: 4,
future_layer: 5,
sp: 5,
future_layer: 6,
}
const ROW_LAYERS = [
@ -271,6 +287,7 @@ const ROW_LAYERS = [
["e","t","s","sb","sg"],
["h","q","hb","ss"],
["m","ba"],
["sp"],
["future_layer"],
]
@ -279,6 +296,7 @@ const ORDER_UP = [
[],
["e","t","s","sb"],
["hb","ss"],
["sp"],
[],
]
@ -339,6 +357,7 @@ const LAYER_UPGS = {
currently: function() {
let ret = player.points.plus(1).log10().pow(0.75).plus(1)
if (player.g.upgrades.includes(15)) ret = ret.pow(LAYER_UPGS.g[15].currently())
if (player.sp.upgrades.includes(11)) ret = ret.pow(100)
return ret;
},
effDisp: function(x) { return format(x)+"x" },
@ -363,6 +382,7 @@ const LAYER_UPGS = {
let ret = player.points.plus(1).log10().cbrt().plus(1)
if (player.g.upgrades.includes(23)) ret = ret.pow(LAYER_UPGS.g[23].currently())
if (player.p.upgrades.includes(33)) ret = ret.pow(1.25)
if (player.sp.upgrades.includes(11)) ret = ret.pow(100)
return ret;
},
effDisp: function(x) { return format(x)+"x" },
@ -374,6 +394,7 @@ const LAYER_UPGS = {
currently: function() {
let ret = player.p.points.plus(1).log10().plus(1).pow(player.p.points.plus(1).log10().div(200).plus(1)).pow(player.p.upgrades.includes(32) ? LAYER_UPGS.p[32].currently() : 1)
if (ret.gte("1e1000")) ret = ret.log10().times("1e997")
if (player.sp.upgrades.includes(11)) ret = ret.pow(100)
return ret;
},
effDisp: function(x) { return format(x)+"x" },
@ -1332,6 +1353,34 @@ const LAYER_UPGS = {
effDisp: function(x) { return format(x)+"x" },
},
},
sp: {
rows: 1,
cols: 4,
11: {
desc: "The Prestige Upgrade 3, 6, & 7 effects are raised to the power of 100.",
cost: new Decimal(1),
unl: function() { return player.sp.unl },
},
12: {
desc: "Total Super-Prestige Points boost Magic & Balance Power gain.",
cost: new Decimal(2),
unl: function() { return player.sp.upgrades.includes(11) },
currently: function() { return player.sp.total.plus(1).pow(2.5) },
effDisp: function(x) { return format(x)+"x" },
},
13: {
desc: "Unlock a new Spell.",
cost: new Decimal(3),
unl: function() { return player.sp.upgrades.includes(12) },
},
14: {
desc: "Your Best Super-Prestige Points boost Hex & Balance Energy gain.",
cost: new Decimal(8),
unl: function() { return player.sp.upgrades.includes(13) },
currently: function() { return player.sp.best.plus(1).pow(1.9) },
effDisp: function(x) { return format(x)+"x" },
},
},
}
const TAB_REQS = {
@ -1354,6 +1403,7 @@ const TAB_REQS = {
ss: function() { return (player.ss.unl||player.s.points.gte(tmp.layerReqs.ss))&&layerUnl('ss') },
m: function() { return (player.m.unl||player.h.points.gte(tmp.layerReqs.m))&&layerUnl('m') },
ba: function() { return (player.ba.unl||player.q.points.gte(tmp.layerReqs.ba))&&layerUnl('ba') },
sp: function() { return (player.sp.unl||player.p.points.gte(tmp.layerReqs.sp))&&layerUnl('sp') },
}
const LAYER_AMT_NAMES = {
@ -1371,6 +1421,7 @@ const LAYER_AMT_NAMES = {
ss: "space energy",
m: "hindrance spirit",
ba: "quirks",
sp: "prestige points",
}
function getLayerAmt(layer) {
@ -1400,6 +1451,9 @@ function getLayerAmt(layer) {
case "ba":
return player.q.points;
break;
case "sp":
return player.p.points;
break;
}
return amt
}
@ -1547,8 +1601,15 @@ function checkForVars() {
if (player.m.auto === undefined) player.m.auto = false
if (player.m.toCast === undefined) player.m.toCast = start.m.toCast
if (player.m.casted === undefined) player.m.casted = start.m.casted
if (player.m.autoIns === undefined) {
player.m.autoIns = false
player.m.spellTimes[4] = 0
player.m.toCast[4] = "1"
player.m.casted[4] = new Decimal(1)
}
if (player.ba === undefined) player.ba = start.ba
if (player.offlineProd === undefined) player.offlineProd = true
if (player.sp === undefined) player.sp = start.sp
}
function convertToDecimal() {
@ -1591,12 +1652,15 @@ function convertToDecimal() {
player.m.points = new Decimal(player.m.points)
player.m.best = new Decimal(player.m.best)
player.m.hexes = new Decimal(player.m.hexes)
for (let i=1;i<=3;i++) player.m.casted[i] = new Decimal(player.m.casted[i])
for (let i=1;i<=4;i++) player.m.casted[i] = new Decimal(player.m.casted[i])
player.ba.points = new Decimal(player.ba.points)
player.ba.best = new Decimal(player.ba.best)
player.ba.power = new Decimal(player.ba.power)
player.ba.positivity = new Decimal(player.ba.positivity)
player.ba.negativity = new Decimal(player.ba.negativity)
player.sp.points = new Decimal(player.sp.points)
player.sp.best = new Decimal(player.sp.best)
player.sp.total = new Decimal(player.sp.total)
}
function toggleOpt(name) {
@ -1759,6 +1823,12 @@ function getLayerGainMult(layer) {
if (player.ba.unl) mult = mult.times(tmp.balEff)
if (player.m.unl) mult = mult.times(tmp.hexEff)
break;
case "m":
if (player.sp.upgrades.includes(12)) mult = mult.times(LAYER_UPGS.sp[12].currently())
break;
case "ba":
if (player.sp.upgrades.includes(12)) mult = mult.times(LAYER_UPGS.sp[12].currently())
break;
}
return mult
}
@ -1849,6 +1919,9 @@ function layerUnl(layer) {
case "ba":
return player.q.unl&&player.ss.unl
break;
case "sp":
return player.m.unl&&player.ba.unl
break;
}
}
@ -1862,7 +1935,7 @@ function rowReset(row, layer) {
case 1:
player.points = new Decimal(10);
player.p.points = new Decimal(0);
if (LAYER_ROW[layer]>=3 && player.h.best.gte(10)) player.p.upgrades = prev.p.upgrades;
if ((LAYER_ROW[layer]>=3 && player.h.best.gte(10))||player.sp.total.gte(1)) player.p.upgrades = prev.p.upgrades;
else if ((player.h.best.lt(1)&&player.q.best.lt(1))||LAYER_ROW[layer]>=3) {
if (layer=="b"||layer=="g") {
if (player[layer].best.lt(8)) player.p.upgrades = [];
@ -1877,11 +1950,11 @@ function rowReset(row, layer) {
case 2:
player.b.points = new Decimal(0);
player.b.best = player.m.best.gte(1)?player.b.best:new Decimal(0);
if (!player.t.best.gte(4)) player.b.upgrades = [];
if (!player.t.best.gte(4)&&!player.sp.total.gte(1)) player.b.upgrades = [];
player.g.points = new Decimal(0);
player.g.power = new Decimal(0);
player.g.best = player.m.best.gte(1)?player.g.best:new Decimal(0);
if (!player.s.best.gte(4)) player.g.upgrades = [];
if (!player.s.best.gte(4)&&!player.sp.total.gte(1)) player.g.upgrades = [];
player.t.energy = new Decimal(0);
if (layer=="t"||layer=="e"||layer=="s") {
if (player[layer].best.gte(2)) {
@ -1897,13 +1970,13 @@ function rowReset(row, layer) {
player.t.points = new Decimal(0);
player.t.order = 0
if (player.h.best.lt(2)&&player.m.best.lt(1)) player.t.best = new Decimal(0);
if (player.h.best.lt(4)) player.t.upgrades = [];
if (player.h.best.lt(4)&&!player.sp.total.gte(1)) player.t.upgrades = [];
player.t.extCapsules = new Decimal(0);
player.e.order = 0
player.e.points = new Decimal(0);
if (player.h.best.lt(2)&&player.m.best.lt(1)) player.e.best = new Decimal(0);
player.e.enhancers = new Decimal(0);
if (player.h.best.lt(4)) player.e.upgrades = [];
if (player.h.best.lt(4)&&!player.sp.total.gte(1)) player.e.upgrades = [];
player.s = {
unl: player.s.unl,
order: 0,
@ -1917,7 +1990,7 @@ function rowReset(row, layer) {
4: new Decimal(0),
5: new Decimal(0)
}),
upgrades: player.h.best.gte(4) ? player.s.upgrades : [],
upgrades: (player.h.best.gte(4)||player.sp.total.gte(1)) ? player.s.upgrades : [],
auto: player.s.auto,
autoBuild: player.s.autoBuild,
}
@ -1927,7 +2000,7 @@ function rowReset(row, layer) {
order: 0,
points: new Decimal(0),
best: (player.h.best.gte(2)||player.m.best.gte(1)) ? player.sb.best : new Decimal(0),
upgrades: player.h.best.gte(10) ? player.sb.upgrades : [],
upgrades: (player.h.best.gte(10)||player.sp.total.gte(1)) ? player.sb.upgrades : [],
}
player.sg = {
unl: player.sg.unl,
@ -1948,7 +2021,7 @@ function rowReset(row, layer) {
points: new Decimal(0),
best: (player.ba.best.gte(1)||player.m.best.gte(1))?player.h.best:new Decimal(0),
active: 0,
challs: player.m.best.gte(2)?player.h.challs:[],
challs: (player.m.best.gte(2)||player.sp.total.gte(1))?player.h.challs:[],
upgrades: [],
}
player.q = {
@ -1959,7 +2032,7 @@ function rowReset(row, layer) {
layers: new Decimal(0),
energy: new Decimal(0),
time: new Decimal(0),
upgrades: player.ba.best.gte(2)?player.q.upgrades:[],
upgrades: (player.ba.best.gte(2)||player.sp.total.gte(1))?player.q.upgrades:[],
}
player.hb = {
unl: player.hb.unl,
@ -1967,7 +2040,7 @@ function rowReset(row, layer) {
order: player.hb.order,
points: new Decimal(0),
best: (player.ba.best.gte(1)||player.m.best.gte(1))?player.hb.best:new Decimal(0),
upgrades: player.ba.best.gte(5)?player.hb.upgrades:[],
upgrades: (player.ba.best.gte(5)||player.sp.total.gte(1))?player.hb.upgrades:[],
}
player.ss = {
unl: player.ss.unl,
@ -1976,12 +2049,44 @@ function rowReset(row, layer) {
points: new Decimal(0),
best: (player.ba.best.gte(1)||player.m.best.gte(1))?player.ss.best:new Decimal(0),
subspace: new Decimal(0),
upgrades: player.ba.best.gte(5)?player.ss.upgrades:[],
upgrades: (player.ba.best.gte(5)||player.sp.total.gte(1))?player.ss.upgrades:[],
}
break;
case 5:
player.m = start.m
player.ba = start.ba
player.m = {
unl: player.m.unl,
auto: player.m.auto,
autoIns: player.m.autoIns,
points: new Decimal(0),
best: player.sp.total.gte(2) ? player.m.best : new Decimal(0),
spellTimes: {
1: 0,
2: 0,
3: 0,
4: 0,
},
hexes: new Decimal(0),
toCast: player.m.toCast,
casted: {
1: new Decimal(1),
2: new Decimal(1),
3: new Decimal(1),
4: new Decimal(1),
},
upgrades: player.sp.total.gte(1) ? player.m.upgrades : [],
}
player.ba = {
unl: player.ba.unl,
points: new Decimal(0),
best: player.sp.total.gte(5) ? player.ba.best : new Decimal(0),
power: new Decimal(0),
positivity: new Decimal(0),
negativity: new Decimal(0),
upgrades: player.sp.total.gte(1) ? player.ba.upgrades : [],
}
break;
case 6:
player.sp = start.sp
break;
}
}
@ -1993,7 +2098,11 @@ function doReset(layer, force=false) {
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)
} else player[layer].points = player[layer].points.plus(gain)
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)
if (!player[layer].unl) {
@ -2015,6 +2124,7 @@ function doReset(layer, force=false) {
else for (let x=row;x>=1;x--) rowReset(x, layer)
updateTemp()
updateTemp()
}
function buyUpg(layer, id) {
@ -2294,6 +2404,7 @@ function getSpaceBuildingCostMod() {
let mod = new Decimal(1)
if (player.s.upgrades.includes(24)&&!(tmp.hcActive?tmp.hcActive[12]:true)) mod = mod.times(0.5)
if (player.s.upgrades.includes(42)) mod = mod.times(0.6)
if (spellActive(4)) mod = mod.times(Decimal.sub(1, tmp.spellEffs[4].sub(1)))
return mod;
}
@ -2792,22 +2903,31 @@ function getNegGainMult() {
return mult;
}
function getBalPowGainMult() {
let mult = new Decimal(1)
if (player.sp.upgrades.includes(14)) mult = mult.times(LAYER_UPGS.sp[14].currently())
return mult;
}
const SPELL_NAMES = {
1: "Booster Launch",
2: "Time Warp",
3: "Quirk Amplification",
4: "Spacial Compression",
}
const SPELL_DESCS = {
1: "Boosters are X% stronger",
2: "Time Capsules are X% stronger",
3: "Quirk Layers are X% more efficient",
4: "Space Buildings cost scale X% slower",
}
const SPELL_BASE = {
1: 1.25,
2: 1.1,
3: 1.04,
4: 1.01,
}
function getSpellPower(x) {
@ -2823,6 +2943,7 @@ function getSpellEff(x) {
let base = SPELL_BASE[x]
let power = getSpellPower(x)
let eff = Decimal.pow(base, power)
if (x==4) eff = Decimal.sub(2, Decimal.div(base, power.log2().plus(1)))
return eff
}
@ -2842,17 +2963,19 @@ function getSpellTime() {
function spellActive(x) {
if (!player.m.unl) return false
if (!tmp.spellEffs) return false
if (tmp.spellsUnl<x) return false
return player.m.spellTimes[x]>0
}
function activateSpell(x, force=false) {
if (tmp.spellsUnl<x) return;
let toCast = setToCast(player.m.toCast[x])
if (!force) {
if (!player.m.unl) return
if (spellActive(x)) return
if (player.m.points.lt(toCast)) return
}
player.m.points = player.m.points.sub(toCast)
if (player.sp.total.lt(2)) player.m.points = player.m.points.sub(toCast)
player.m.casted[x] = toCast
player.m.spellTimes[x] = getSpellTime()
if (!force) player.m.hexes = player.m.hexes.plus(getHexGain())
@ -2861,6 +2984,7 @@ function activateSpell(x, force=false) {
function getHexGain() {
let gain = new Decimal(1)
if (player.m.upgrades.includes(14)) gain = gain.times(LAYER_UPGS.m[14].currently())
if (player.sp.upgrades.includes(14)) gain = gain.times(LAYER_UPGS.sp[14].currently())
return gain.floor()
}
@ -2937,7 +3061,7 @@ function gameLoop(diff) {
if (player.q.best.gte(15)) player.e.points = player.e.points.plus(tmp.resetGain.e.times(diff)).max(0)
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(diff)).max(0)
player.ba.power = player.ba.power.plus(tmp.layerEffs.ba.power.times(tmp.balEff2).times(getBalPowGainMult()).times(diff)).max(0)
player.ba.positivity = player.ba.positivity.plus(tmp.layerEffs.ba.pos.times(getPosGainMult()).times(diff)).max(0)
player.ba.negativity = player.ba.negativity.plus(tmp.layerEffs.ba.neg.times(getNegGainMult()).times(diff)).max(0)
}
@ -2947,6 +3071,10 @@ function gameLoop(diff) {
player.q.points = player.q.points.plus(tmp.resetGain.q.times(diff)).max(0)
}
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)
}
if (player.b.auto&&player.t.best.gte(5)) doReset("b")
if (player.g.auto&&player.s.best.gte(5)) doReset("g")
@ -2960,7 +3088,11 @@ function gameLoop(diff) {
if (player.q.auto&&player.ba.best.gte(3)) maxQuirkLayers()
if (player.hb.auto&&player.m.best.gte(4)) doReset("hb")
if (player.ss.auto&&player.m.best.gte(4)) doReset("ss")
if (player.m.auto&&player.m.best.gte(1000)) for (let i=1;i<=3;i++) activateSpell(i)
if (player.m.autoIns&&player.sp.total.gte(2)) for (let i=1;i<=tmp.spellsUnl;i++) {
player.m.casted[i] = player.m.points
player.m.toCast[i] = player.m.points
}
if (player.m.auto&&player.m.best.gte(1000)) for (let i=1;i<=tmp.spellsUnl;i++) activateSpell(i)
if (player.hasNaN&&!NaNalert) {
alert("We have detected a corruption in your save. Please visit https://discord.gg/wwQfgPa for help.")
@ -3029,6 +3161,9 @@ document.onkeydown = function(e) {
case "3":
if (player.ba.unl) activateSpell(3)
break;
case "P":
if (player.sp.unl) doReset("sp")
break;
}
} else if (player[key].unl) doReset(key)
}

View file

@ -57,9 +57,11 @@ function updateTemp() {
tmp.balEff = getBalancePowerEff()
tmp.balEff2 = getBalanceTypesEff()
tmp.baExp = getBalanceEnergyExp()
tmp.hexEff = getHexEff()
tmp.spellsUnl = player.sp.upgrades.includes(13)?4:3
if (!tmp.spellEffs) tmp.spellEffs = {}
for (let i=1;i<=3;i++) tmp.spellEffs[i] = getSpellEff(i)
for (let i=1;i<=4;i++) tmp.spellEffs[i] = getSpellEff(i)
tmp.sGenPowEff = getSGenPowEff()
}

View file

@ -265,6 +265,16 @@ h1, h2 {
text-shadow: 0px 0px 10px #409c6e;
}
.sp {
background-color: #439ea3;
color: black;
}
.sp_txt {
color: #439ea3;
text-shadow: 0px 0px 10px #439ea3;
}
#optionWheel {
position: absolute;
top: 0px;