2020-08-19 02:50:24 +00:00
var player ;
2020-08-21 19:02:34 +00:00
var tmp = { } ;
2020-08-19 02:50:24 +00:00
var needCanvasUpdate = true ;
2020-08-24 02:01:14 +00:00
var NaNalert = false ;
2020-09-10 01:28:47 +00:00
var gameEnded = false ;
2020-08-19 02:50:24 +00:00
function getStartPlayer ( ) {
return {
tab : "tree" ,
time : Date . now ( ) ,
autosave : true ,
2020-09-08 23:22:22 +00:00
notify : { } ,
2020-08-27 19:12:20 +00:00
msDisplay : "always" ,
2020-09-03 21:59:23 +00:00
offlineProd : true ,
2020-09-10 01:39:08 +00:00
versionType : "real" ,
2020-09-14 19:26:10 +00:00
version : VERSION . num ,
beta : VERSION . beta ,
2020-08-23 19:36:03 +00:00
timePlayed : 0 ,
2020-09-10 01:39:08 +00:00
keepGoing : false ,
2020-08-24 02:01:14 +00:00
hasNaN : false ,
2020-08-19 02:50:24 +00:00
points : new Decimal ( 10 ) ,
p : {
unl : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
b : {
unl : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
upgrades : [ ] ,
2020-08-20 04:55:26 +00:00
auto : false ,
2020-08-19 02:50:24 +00:00
} ,
g : {
unl : false ,
points : new Decimal ( 0 ) ,
power : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
upgrades : [ ] ,
2020-08-20 04:55:26 +00:00
auto : false ,
2020-08-19 02:50:24 +00:00
} ,
e : {
unl : false ,
2020-08-26 03:32:27 +00:00
auto : false ,
2020-08-19 02:50:24 +00:00
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
enhancers : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
t : {
unl : false ,
2020-08-26 03:32:27 +00:00
auto : false ,
autoCap : false ,
2020-08-19 02:50:24 +00:00
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
energy : new Decimal ( 0 ) ,
extCapsules : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
s : {
unl : false ,
2020-08-26 03:32:27 +00:00
auto : false ,
2020-08-30 01:39:01 +00:00
autoBuild : false ,
2020-08-19 02:50:24 +00:00
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
spent : new Decimal ( 0 ) ,
buildings : {
1 : new Decimal ( 0 ) ,
2 : new Decimal ( 0 ) ,
2020-08-19 19:53:14 +00:00
3 : new Decimal ( 0 ) ,
2020-08-20 20:37:22 +00:00
4 : new Decimal ( 0 ) ,
5 : new Decimal ( 0 )
2020-08-19 02:50:24 +00:00
} ,
upgrades : [ ] ,
} ,
2020-08-22 01:16:23 +00:00
sb : {
unl : false ,
order : 0 ,
2020-08-26 14:16:23 +00:00
auto : false ,
2020-08-22 01:16:23 +00:00
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
2020-09-04 17:45:22 +00:00
sg : {
unl : false ,
auto : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
power : new Decimal ( 0 ) ,
} ,
2020-08-26 01:45:22 +00:00
h : {
unl : false ,
2020-08-29 19:45:18 +00:00
time : 0 ,
2020-08-26 01:45:22 +00:00
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
challs : [ ] ,
} ,
q : {
unl : false ,
2020-09-04 02:25:24 +00:00
auto : false ,
2020-08-26 01:45:22 +00:00
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
layers : new Decimal ( 0 ) ,
energy : new Decimal ( 0 ) ,
time : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
2020-08-29 23:43:53 +00:00
hb : {
unl : false ,
2020-09-04 02:25:24 +00:00
auto : false ,
2020-08-29 23:43:53 +00:00
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
ss : {
unl : false ,
2020-09-04 02:25:24 +00:00
auto : false ,
2020-08-29 23:43:53 +00:00
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
subspace : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
2020-09-03 21:59:23 +00:00
m : {
unl : false ,
2020-09-07 02:17:10 +00:00
auto : false ,
2020-09-09 02:10:25 +00:00
autoIns : false ,
2020-09-03 21:59:23 +00:00
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
total : new Decimal ( 0 ) ,
2020-09-03 21:59:23 +00:00
spellTimes : {
1 : 0 ,
2 : 0 ,
3 : 0 ,
2020-09-09 02:10:25 +00:00
4 : 0 ,
2020-09-03 21:59:23 +00:00
} ,
hexes : new Decimal ( 0 ) ,
2020-09-08 00:11:57 +00:00
toCast : {
1 : "1" ,
2 : "1" ,
3 : "1" ,
2020-09-09 02:10:25 +00:00
4 : "1" ,
2020-09-08 00:11:57 +00:00
} ,
casted : {
1 : new Decimal ( 1 ) ,
2 : new Decimal ( 1 ) ,
3 : new Decimal ( 1 ) ,
2020-09-09 02:10:25 +00:00
4 : new Decimal ( 1 ) ,
2020-09-08 00:11:57 +00:00
} ,
2020-09-03 21:59:23 +00:00
upgrades : [ ] ,
} ,
ba : {
unl : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
power : new Decimal ( 0 ) ,
positivity : new Decimal ( 0 ) ,
negativity : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
2020-09-11 02:15:05 +00:00
ps : {
unl : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
2020-09-09 02:10:25 +00:00
sp : {
unl : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
total : new Decimal ( 0 ) ,
upgrades : [ ] ,
} ,
2020-09-10 02:44:25 +00:00
l : {
unl : false ,
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
power : new Decimal ( 0 ) ,
boosters : { } ,
} ,
hs : {
unl : false ,
order : 0 ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
2020-09-13 02:38:32 +00:00
space : new Decimal ( 0 ) ,
spent : new Decimal ( 0 ) ,
superUpgrades : { } ,
superUpgradeCap : new Decimal ( 1 ) ,
2020-09-10 02:44:25 +00:00
} ,
2020-09-11 02:15:05 +00:00
i : {
unl : false ,
points : new Decimal ( 0 ) ,
best : new Decimal ( 0 ) ,
lifeBricks : new Decimal ( 0 ) ,
progress : 0 ,
extraBuildings : new Decimal ( 0 )
} ,
2020-08-19 02:50:24 +00:00
}
}
2020-09-11 02:15:05 +00:00
const LAYERS = [ "p" , "b" , "g" , "e" , "t" , "s" , "sb" , "sg" , "h" , "q" , "hb" , "ss" , "m" , "ba" , "ps" , "sp" , "l" , "hs" , "i" ]
2020-08-19 02:50:24 +00:00
const LAYER _REQS = {
p : new Decimal ( 10 ) ,
b : new Decimal ( 200 ) ,
g : new Decimal ( 200 ) ,
e : new Decimal ( 1e120 ) ,
t : new Decimal ( 1e120 ) ,
s : new Decimal ( 1e120 ) ,
2020-08-22 01:16:23 +00:00
sb : new Decimal ( 180 ) ,
2020-09-04 17:45:22 +00:00
sg : new Decimal ( 1000 ) ,
2020-08-26 01:45:22 +00:00
h : new Decimal ( 1e220 ) ,
q : new Decimal ( "1e512" ) ,
2020-08-29 23:43:53 +00:00
hb : new Decimal ( 12 ) ,
ss : new Decimal ( 36 ) ,
2020-09-10 13:18:18 +00:00
m : new Decimal ( 2e78 ) ,
ba : new Decimal ( 5e129 ) ,
2020-09-12 02:03:58 +00:00
ps : new Decimal ( "1e5000" ) ,
2020-09-09 02:10:25 +00:00
sp : new Decimal ( "1e8500000" ) ,
2020-09-11 02:15:05 +00:00
l : new Decimal ( 1e195 ) ,
2020-09-10 13:18:18 +00:00
hs : new Decimal ( 725 ) ,
2020-09-16 02:50:53 +00:00
i : new Decimal ( "1e285" ) ,
2020-08-19 02:50:24 +00:00
}
const LAYER _RES = {
p : "prestige points" ,
b : "boosters" ,
g : "generators" ,
e : "enhance points" ,
t : "time capsules" ,
s : "space energy" ,
2020-08-22 01:16:23 +00:00
sb : "super-boosters" ,
2020-09-04 17:45:22 +00:00
sg : "super-generators" ,
2020-08-26 03:32:27 +00:00
h : "hindrance spirit" ,
2020-08-26 01:45:22 +00:00
q : "quirks" ,
2020-08-29 23:43:53 +00:00
hb : "hyper-boosters" ,
ss : "subspace energy" ,
2020-09-03 21:59:23 +00:00
m : "magic" ,
ba : "balance energy" ,
2020-09-11 02:15:05 +00:00
ps : "phantom souls" ,
2020-09-09 02:10:25 +00:00
sp : "super-prestige points" ,
2020-09-10 02:44:25 +00:00
l : "life essence" ,
2020-09-13 02:38:32 +00:00
hs : "hyperspace energy" ,
2020-09-11 02:15:05 +00:00
i : "imperium bricks" ,
2020-08-19 02:50:24 +00:00
}
2020-09-11 02:15:05 +00:00
const LAYER _RES _CEIL = [ "sb" , "sg" , "hb" , "ss" , "hs" ]
2020-08-25 22:42:43 +00:00
2020-08-19 02:50:24 +00:00
const LAYER _TYPE = {
p : "normal" ,
b : "static" ,
g : "static" ,
e : "normal" ,
t : "static" ,
s : "static" ,
2020-08-22 01:16:23 +00:00
sb : "static" ,
2020-09-04 17:45:22 +00:00
sg : "static" ,
2020-08-26 01:45:22 +00:00
h : "normal" ,
q : "normal" ,
2020-08-29 23:43:53 +00:00
hb : "static" ,
ss : "static" ,
2020-09-03 21:59:23 +00:00
m : "normal" ,
ba : "normal" ,
2020-09-11 02:15:05 +00:00
ps : "static" ,
2020-09-09 02:10:25 +00:00
sp : "normal" ,
2020-09-10 02:44:25 +00:00
l : "normal" ,
hs : "normal" ,
2020-09-11 02:15:05 +00:00
i : "static" ,
2020-08-19 02:50:24 +00:00
}
const LAYER _EXP = {
p : new Decimal ( 0.5 ) ,
b : new Decimal ( 1.25 ) ,
g : new Decimal ( 1.25 ) ,
e : new Decimal ( 0.02 ) ,
2020-08-19 19:53:14 +00:00
t : new Decimal ( 1.85 ) ,
s : new Decimal ( 1.85 ) ,
2020-08-22 01:16:23 +00:00
sb : new Decimal ( 1.25 ) ,
2020-09-04 17:45:22 +00:00
sg : new Decimal ( 1.4 ) ,
2020-08-26 01:45:22 +00:00
h : new Decimal ( 0.015 ) ,
q : new Decimal ( 0.0075 ) ,
2020-08-30 01:39:01 +00:00
hb : new Decimal ( 2.5 ) ,
2020-08-29 23:43:53 +00:00
ss : new Decimal ( 1.1 ) ,
2020-09-03 21:59:23 +00:00
m : new Decimal ( 0.01 ) ,
ba : new Decimal ( 0.00667 ) ,
2020-09-11 23:10:57 +00:00
ps : new Decimal ( 1.2 ) ,
2020-09-09 02:10:25 +00:00
sp : new Decimal ( 2e-7 ) ,
2020-09-12 02:03:58 +00:00
l : new Decimal ( 0.012 ) ,
2020-09-13 02:38:32 +00:00
hs : new Decimal ( 40 ) ,
2020-09-16 02:50:53 +00:00
i : new Decimal ( 1 ) ,
2020-08-19 02:50:24 +00:00
}
const LAYER _BASE = {
b : new Decimal ( 5 ) ,
g : new Decimal ( 5 ) ,
t : new Decimal ( 1e15 ) ,
s : new Decimal ( 1e15 ) ,
2020-08-22 01:16:23 +00:00
sb : new Decimal ( 1.05 ) ,
2020-09-04 17:45:22 +00:00
sg : new Decimal ( 1.2 ) ,
2020-08-29 23:43:53 +00:00
hb : new Decimal ( 1.05 ) ,
ss : new Decimal ( 1.15 ) ,
2020-09-12 02:03:58 +00:00
ps : new Decimal ( "1e250" ) ,
2020-09-14 19:26:10 +00:00
i : new Decimal ( "1e20" ) ,
2020-08-19 02:50:24 +00:00
}
const LAYER _ROW = {
p : 0 ,
b : 1 ,
g : 1 ,
e : 2 ,
t : 2 ,
s : 2 ,
2020-08-22 01:16:23 +00:00
sb : 2 ,
2020-09-04 17:45:22 +00:00
sg : 2 ,
2020-08-26 01:45:22 +00:00
h : 3 ,
q : 3 ,
2020-08-29 23:43:53 +00:00
hb : 3 ,
ss : 3 ,
2020-09-03 21:59:23 +00:00
m : 4 ,
ba : 4 ,
2020-09-11 02:15:05 +00:00
ps : 4 ,
2020-09-09 02:10:25 +00:00
sp : 5 ,
2020-09-10 02:44:25 +00:00
l : 5 ,
hs : 5 ,
2020-09-11 02:15:05 +00:00
i : 5 ,
2020-09-09 02:10:25 +00:00
future _layer : 6 ,
2020-08-19 02:50:24 +00:00
}
const ROW _LAYERS = [
[ "p" ] ,
[ "b" , "g" ] ,
2020-09-04 17:45:22 +00:00
[ "e" , "t" , "s" , "sb" , "sg" ] ,
2020-08-29 23:43:53 +00:00
[ "h" , "q" , "hb" , "ss" ] ,
2020-09-11 02:15:05 +00:00
[ "m" , "ba" , "ps" ] ,
[ "sp" , "l" , "hs" , "i" ] ,
2020-08-19 02:50:24 +00:00
[ "future_layer" ] ,
]
2020-08-31 02:35:50 +00:00
const ORDER _UP = [
[ ] ,
[ ] ,
[ "e" , "t" , "s" , "sb" ] ,
[ "hb" , "ss" ] ,
[ ] ,
2020-09-10 02:44:25 +00:00
[ "l" , "hs" ] ,
2020-08-31 02:35:50 +00:00
]
2020-08-19 02:50:24 +00:00
const LAYER _EFFS = {
2020-09-14 19:26:10 +00:00
b ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 11 ] : true ) return new Decimal ( 1 ) ;
2020-09-14 19:26:10 +00:00
return Decimal . pow ( Decimal . add ( 2 , tmp . atbb ) . max ( 0 ) , player . b . points . add ( getFreeBoosters ( ) ) . times ( getBoosterPower ( ) ) ) . max ( 0 )
2020-08-26 16:26:46 +00:00
} ,
2020-09-14 19:26:10 +00:00
g ( ) { return Decimal . pow ( Decimal . add ( 2 , tmp . atgb ) . times ( tmp . sGenPowEff ) . times ( ( player . ss . upgrades . includes ( 23 ) ? LAYER _UPGS . ss [ 23 ] . currently ( ) : 1 ) ) . max ( 0 ) , player . g . points . times ( getGenPow ( ) ) ) . sub ( 1 ) . times ( getGenPowerGainMult ( ) ) . max ( 0 ) } ,
t ( ) { return {
gain : Decimal . pow ( Decimal . add ( 3 , tmp . attb ) . times ( tmp . mttb ) , player . t . points . add ( player . t . extCapsules . add ( tmp . freeExtCap ) . times ( getFreeExtPow ( ) ) ) . times ( getCapPow ( ) ) ) . sub ( 1 ) . times ( getTimeEnergyGainMult ( ) ) ,
limit : Decimal . pow ( Decimal . add ( 2 , tmp . attb ) . times ( tmp . mttb ) , player . t . points . add ( player . t . extCapsules . add ( tmp . freeExtCap ) . times ( getFreeExtPow ( ) ) ) . times ( getCapPow ( ) ) ) . sub ( 1 ) . times ( 100 ) . times ( getTimeEnergyLimitMult ( ) ) ,
2020-08-19 02:50:24 +00:00
} } ,
2020-09-14 19:26:10 +00:00
sb ( ) { return Decimal . pow ( Decimal . add ( 1.5 , addToSBBase ( ) ) , player . sb . points . times ( getSuperBoosterPow ( ) ) ) } ,
sg ( ) { return Decimal . pow ( Decimal . add ( 2 , addToSGBase ( ) ) , player . sg . points ) . sub ( 1 ) . times ( getSuperGenPowerGainMult ( ) ) . max ( 0 ) } ,
h ( ) {
let ret = player . h . points . add ( 1 ) . times ( player . points . times ( player . h . points ) . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) ) . log10 ( ) . times ( 5 ) . root ( player . q . upgrades . includes ( 12 ) ? 1.25 : 2 ) ;
2020-09-04 03:15:10 +00:00
if ( player . h . challs . includes ( 61 ) ) ret = ret . times ( 1.2 ) ;
2020-08-26 16:26:46 +00:00
if ( ret . gte ( 100 ) ) ret = ret . log10 ( ) . times ( 50 ) . min ( ret ) ;
return ret ;
} ,
2020-09-14 19:26:10 +00:00
hb ( ) {
2020-09-12 02:03:58 +00:00
return Decimal . pow ( Decimal . add ( 1.6 , addToHBBase ( ) ) , player . hb . points . add ( getExtraHyperBoosters ( ) ) . pow ( getHyperBoosterExp ( ) ) . times ( getHyperBoosterPow ( ) ) )
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
ss ( ) { return player . ss . points . pow ( 2.5 ) . times ( getSubspaceGainMult ( ) ) } ,
ba ( ) {
2020-09-07 16:33:50 +00:00
let points1 = player . ba . points
if ( points1 . gte ( 1e12 ) ) points1 = points1 . log10 ( ) . pow ( 2 ) . times ( 1e12 / 144 ) . min ( points1 )
return {
2020-09-08 22:28:40 +00:00
power : points1 . pow ( 0.2 ) . pow ( tmp . baExp ? tmp . baExp : 1 ) . pow ( player . ba . upgrades . includes ( 41 ) ? 2 : 1 ) . times ( player . ba . upgrades . includes ( 54 ) ? LAYER _UPGS . ba [ 54 ] . currently ( ) : 1 ) ,
2020-09-07 16:33:50 +00:00
pos : player . ba . points . pow ( 0.7 ) . pow ( tmp . baExp ? tmp . baExp : 1 ) ,
neg : player . ba . points . pow ( 0.65 ) . times ( 0.4 ) . pow ( tmp . baExp ? tmp . baExp : 1 ) ,
}
} ,
2020-09-14 19:26:10 +00:00
ps ( ) {
2020-09-11 02:15:05 +00:00
let x = player . ps . points
2020-09-12 02:03:58 +00:00
if ( player . ps . upgrades . includes ( 12 ) ) x = x . times ( 1.2 )
2020-09-11 02:15:05 +00:00
return {
2020-09-12 02:03:58 +00:00
exp : x . div ( 2 ) . add ( 1 ) ,
mult : x . div ( 3 ) . add ( 1 ) . sqrt ( )
2020-09-11 02:15:05 +00:00
}
} ,
2020-09-15 19:27:33 +00:00
l ( ) {
return player . l . points . times ( 5 ) . max ( 1 ) . log10 ( )
} ,
2020-08-19 02:50:24 +00:00
}
const LAYER _UPGS = {
p : {
2020-08-23 19:36:03 +00:00
rows : 3 ,
2020-08-19 02:50:24 +00:00
cols : 3 ,
11 : {
desc : "Gain 1 Point every second." ,
cost : new Decimal ( 1 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . p . unl } ,
2020-08-19 02:50:24 +00:00
} ,
12 : {
desc : "Point generation is faster based on your unspent Prestige Points." ,
cost : new Decimal ( 1 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . p . upgrades . includes ( 11 ) } ,
currently ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 32 ] : true ) return new Decimal ( 1 )
2020-09-14 19:26:10 +00:00
let ret = player . p . points . add ( 1 ) . pow ( player . g . upgrades . includes ( 24 ) ? 1.1 : ( player . g . upgrades . includes ( 14 ) ? 0.75 : 0.5 ) )
2020-09-09 22:47:26 +00:00
if ( ret . gte ( "1e20000000" ) ) ret = ret . sqrt ( ) . times ( "1e10000000" )
2020-09-16 14:25:07 +00:00
if ( IMPERIUM . collapsed ( 1 ) ) ret = ret . pow ( Decimal . sub ( 1 , tmp . i . collapse [ 1 ] ) )
2020-09-09 22:47:26 +00:00
return ret ;
2020-08-27 19:12:20 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
13 : {
desc : "Point generation is faster based on your Point amount." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . p . upgrades . includes ( 12 ) } ,
currently ( ) {
let ret = player . points . add ( 1 ) . log10 ( ) . pow ( 0.75 ) . add ( 1 )
2020-08-19 02:50:24 +00:00
if ( player . g . upgrades . includes ( 15 ) ) ret = ret . pow ( LAYER _UPGS . g [ 15 ] . currently ( ) )
2020-09-09 02:10:25 +00:00
if ( player . sp . upgrades . includes ( 11 ) ) ret = ret . pow ( 100 )
2020-09-16 14:25:07 +00:00
if ( IMPERIUM . collapsed ( 1 ) ) ret = ret . pow ( Decimal . sub ( 1 , tmp . i . collapse [ 1 ] ) )
2020-08-19 02:50:24 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
21 : {
desc : "Prestige Point gain is doubled." ,
cost : new Decimal ( 20 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . b . unl || player . g . unl ) && player . p . upgrades . includes ( 11 ) } ,
2020-08-19 02:50:24 +00:00
} ,
22 : {
desc : "Point generation is faster based on your Prestige Upgrades bought." ,
cost : new Decimal ( 75 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . b . unl || player . g . unl ) && player . p . upgrades . includes ( 12 ) } ,
2020-09-16 14:25:07 +00:00
currently ( ) {
let ret = Decimal . pow ( 1.4 , player . p . upgrades . length )
if ( IMPERIUM . collapsed ( 1 ) ) ret = ret . pow ( Decimal . sub ( 1 , tmp . i . collapse [ 1 ] ) )
return ret
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
23 : {
desc : "Prestige Point gain is boosted by your Point amount." ,
cost : new Decimal ( 5e3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . b . unl || player . g . unl ) && player . p . upgrades . includes ( 13 ) } ,
currently ( ) {
let ret = player . points . add ( 1 ) . log10 ( ) . cbrt ( ) . add ( 1 )
2020-08-19 02:50:24 +00:00
if ( player . g . upgrades . includes ( 23 ) ) ret = ret . pow ( LAYER _UPGS . g [ 23 ] . currently ( ) )
2020-08-23 19:36:03 +00:00
if ( player . p . upgrades . includes ( 33 ) ) ret = ret . pow ( 1.25 )
2020-09-09 02:10:25 +00:00
if ( player . sp . upgrades . includes ( 11 ) ) ret = ret . pow ( 100 )
2020-08-19 02:50:24 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
2020-08-23 19:36:03 +00:00
31 : {
desc : "Prestige Point gain is boosted by your Prestige Point amount." ,
cost : new Decimal ( "1e4450" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 33 ) } ,
currently ( ) {
let ret = player . p . points . add ( 1 ) . log10 ( ) . add ( 1 ) . pow ( player . p . points . add ( 1 ) . log10 ( ) . div ( 200 ) . add ( 1 ) ) . pow ( player . p . upgrades . includes ( 32 ) ? LAYER _UPGS . p [ 32 ] . currently ( ) : 1 )
2020-09-09 22:47:26 +00:00
let capStart = new Decimal ( "1e1000" )
if ( player . sp . upgrades . includes ( 32 ) ) capStart = capStart . times ( LAYER _UPGS . sp [ 32 ] . currently ( ) )
if ( ret . gte ( capStart ) ) ret = ret . log10 ( ) . times ( capStart . div ( 1e3 ) )
2020-09-09 02:10:25 +00:00
if ( player . sp . upgrades . includes ( 11 ) ) ret = ret . pow ( 100 )
2020-08-27 15:38:26 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-23 19:36:03 +00:00
} ,
32 : {
desc : "The upgrade to the left is stronger based on your Points." ,
cost : new Decimal ( "1e5140" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 33 ) } ,
currently ( ) {
let ret = player . points . add ( 1 ) . log10 ( ) . add ( 1 ) . root ( 16 ) ;
2020-09-09 22:47:26 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-23 19:36:03 +00:00
} ,
33 : {
desc : "The above upgrade is 25% stronger." ,
cost : new Decimal ( "1e5500" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 33 ) } ,
2020-08-23 19:36:03 +00:00
} ,
2020-08-19 02:50:24 +00:00
} ,
b : {
2020-08-30 16:18:34 +00:00
rows : 3 ,
2020-08-19 02:50:24 +00:00
cols : 3 ,
11 : {
desc : "Boosters boost Prestige Point gain." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . unl } ,
currently ( ) { return player . b . points . sqrt ( ) . add ( 1 ) . max ( 1.5 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
12 : {
desc : "Generators add to the Booster effect." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . unl } ,
currently ( ) { return player . g . points . add ( 1 ) . log10 ( ) . sqrt ( ) . div ( 3 ) . times ( ( player . t . upgrades . includes ( 14 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? 8.5 : 1 ) } ,
effDisp ( x ) { return "+" + format ( x ) + " to base" } ,
2020-08-19 02:50:24 +00:00
} ,
13 : {
desc : "Prestige Points add to the Booster effect." ,
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . best . gte ( 8 ) } ,
currently ( ) { return player . p . points . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 3 ) } ,
effDisp ( x ) { return "+" + format ( x ) + " to base" } ,
2020-08-19 02:50:24 +00:00
} ,
21 : {
desc : "Square the Generator Power effect." ,
cost : new Decimal ( 10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . upgrades . includes ( 11 ) && player . b . upgrades . includes ( 12 ) } ,
2020-08-19 02:50:24 +00:00
} ,
22 : {
desc : "The Generator Power effect is raised to the power of 1.2." ,
cost : new Decimal ( 15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . upgrades . includes ( 12 ) && player . b . upgrades . includes ( 13 ) } ,
2020-08-19 02:50:24 +00:00
} ,
23 : {
desc : "Boosters are cheaper based on your points." ,
cost : new Decimal ( 18 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . upgrades . includes ( 21 ) || player . b . upgrades . includes ( 22 ) } ,
2020-09-14 22:32:29 +00:00
currently ( ) { return player . points . add ( 1 ) . log10 ( ) . add ( 1 ) . pow ( 3.2 ) . pow ( tmp . s !== undefined && tmp . s . trueSbUnl >= 4 ? tmp . s . sbEff [ 4 ] : 1 ) } ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return "/" + format ( x ) } ,
2020-08-19 02:50:24 +00:00
} ,
2020-08-30 16:18:34 +00:00
31 : {
desc : "Hyper-Boosters multiply the Booster base." ,
cost : new Decimal ( 1250 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . upgrades . includes ( 14 ) } ,
currently ( ) { return Decimal . pow ( 4 , player . hb . points . pow ( 2 ) ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 16:18:34 +00:00
} ,
32 : {
2020-08-31 18:33:29 +00:00
desc : "Add free Boosters based on your Generator Power." ,
2020-09-03 21:59:23 +00:00
cost : new Decimal ( 1261 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . upgrades . includes ( 14 ) } ,
currently ( ) {
let ret = player . g . power . add ( 1 ) . log10 ( ) . sqrt ( ) . floor ( ) ;
2020-09-09 22:47:26 +00:00
if ( ret . gte ( 1e3 ) ) ret = ret . log10 ( ) . times ( 1e3 / 3 )
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return "+" + formatWhole ( x ) } ,
2020-08-30 16:18:34 +00:00
} ,
33 : {
2020-09-01 00:39:33 +00:00
desc : "Add 100 free Boosters." ,
2020-09-03 21:59:23 +00:00
cost : new Decimal ( 1269 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . upgrades . includes ( 14 ) } ,
2020-08-30 16:18:34 +00:00
} ,
2020-08-19 02:50:24 +00:00
} ,
g : {
2020-08-30 16:18:34 +00:00
rows : 3 ,
2020-08-19 02:50:24 +00:00
cols : 5 ,
11 : {
desc : "Generators boost Prestige Point gain." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . unl } ,
currently ( ) { return player . g . points . sqrt ( ) . add ( 1 ) . max ( 1.5 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
12 : {
desc : "Boosters boost Generator Power gain." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . unl } ,
currently ( ) { return player . b . points . add ( 1 ) . log10 ( ) . sqrt ( ) . div ( 3 ) . times ( ( player . t . upgrades . includes ( 14 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? 3.75 : 1 ) } ,
effDisp ( x ) { return "+" + format ( x ) + " to base" } ,
2020-08-19 02:50:24 +00:00
} ,
13 : {
desc : "Prestige Points boost Generator Power gain." ,
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . best . gte ( 8 ) } ,
currently ( ) { return player . p . points . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 3 ) } ,
effDisp ( x ) { return "+" + format ( x ) + " to base" } ,
2020-08-19 02:50:24 +00:00
} ,
14 : {
desc : "Prestige Upgrade 2 uses a better formula." ,
cost : new Decimal ( 13 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . best . gte ( 10 ) } ,
2020-08-19 02:50:24 +00:00
} ,
15 : {
desc : "Prestige Upgrade 3 is stronger based on your Generators." ,
cost : new Decimal ( 15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . upgrades . includes ( 13 ) } ,
currently ( ) {
let ret = player . g . points . sqrt ( ) . add ( 1 ) . times ( ( player . e . upgrades . includes ( 32 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? LAYER _UPGS . e [ 32 ] . currently ( ) : 1 )
2020-09-09 22:47:26 +00:00
if ( ret . gte ( 400 ) ) ret = ret . cbrt ( ) . times ( Math . pow ( 400 , 2 / 3 ) )
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return "^" + format ( x ) } ,
2020-08-19 02:50:24 +00:00
} ,
21 : {
desc : "Generator Power generates faster based on its amount." ,
cost : new Decimal ( 18 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . upgrades . includes ( 15 ) } ,
currently ( ) { return player . g . power . add ( 1 ) . log10 ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
22 : {
desc : "Generators are cheaper based on your Prestige Points." ,
cost : new Decimal ( 19 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . upgrades . includes ( 15 ) } ,
currently ( ) { return player . p . points . add ( 1 ) . pow ( 0.25 ) . pow ( player . g . upgrades . includes ( 32 ) ? 2.5 : 1 ) } ,
effDisp ( x ) { return "/" + format ( x ) } ,
2020-08-19 02:50:24 +00:00
} ,
23 : {
desc : "Prestige Upgrade 6 is stronger based on your Boosters." ,
cost : new Decimal ( 20 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . b . unl && player . g . upgrades . includes ( 15 ) } ,
currently ( ) { return player . b . points . pow ( 0.75 ) . add ( 1 ) } ,
effDisp ( x ) { return "^" + format ( x ) } ,
2020-08-19 02:50:24 +00:00
} ,
24 : {
desc : "Prestige Upgrade 2 uses an even better formula." ,
cost : new Decimal ( 22 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . upgrades . includes ( 14 ) && ( player . g . upgrades . includes ( 21 ) || player . g . upgrades . includes ( 22 ) ) } ,
2020-08-19 02:50:24 +00:00
} ,
25 : {
desc : "Prestige Points boost Generator Power gain." ,
cost : new Decimal ( 28 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . g . upgrades . includes ( 23 ) && player . g . upgrades . includes ( 24 ) } ,
currently ( ) { return player . p . points . add ( 1 ) . log10 ( ) . sqrt ( ) . add ( 1 ) . pow ( ( player . t . upgrades . includes ( 14 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? 2.75 : 1 ) . pow ( player . g . upgrades . includes ( 31 ) ? LAYER _UPGS . g [ 31 ] . currently ( ) : 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 02:50:24 +00:00
} ,
2020-08-30 16:18:34 +00:00
31 : {
2020-08-31 02:35:50 +00:00
desc : "Generator Upgrade 10 is stronger based on your Generators." ,
2020-08-30 16:18:34 +00:00
cost : new Decimal ( 950 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . upgrades . includes ( 21 ) } ,
currently ( ) { return player . g . points . add ( 1 ) . log10 ( ) . pow ( 3.6 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-30 16:18:34 +00:00
} ,
32 : {
2020-08-31 02:35:50 +00:00
desc : "Generator Upgrade 7 is 150% stronger." ,
cost : new Decimal ( 960 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . upgrades . includes ( 21 ) } ,
2020-08-30 16:18:34 +00:00
} ,
33 : {
2020-08-31 02:35:50 +00:00
desc : "Generator Power adds to the Generator base." ,
cost : new Decimal ( 1025 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . upgrades . includes ( 21 ) } ,
currently ( ) { return player . g . power . add ( 1 ) . log10 ( ) . div ( 15 ) . add ( 1 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-08-30 16:18:34 +00:00
} ,
34 : {
2020-09-01 00:39:33 +00:00
desc : "Generators are stronger based on their amount." ,
2020-09-07 16:33:50 +00:00
cost : new Decimal ( 1068 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . upgrades . includes ( 21 ) } ,
currently ( ) { return player . g . points . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . sqrt ( ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-30 16:18:34 +00:00
} ,
35 : {
2020-09-01 00:39:33 +00:00
desc : "Subspace boosts Generator Power gain." ,
2020-09-01 02:27:52 +00:00
cost : new Decimal ( 1130 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . upgrades . includes ( 21 ) } ,
currently ( ) { return player . ss . subspace . add ( 1 ) . pow ( 40 ) . pow ( player . q . upgrades . includes ( 54 ) ? 20 : 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 16:18:34 +00:00
} ,
2020-08-19 02:50:24 +00:00
} ,
e : {
2020-08-23 19:36:03 +00:00
rows : 3 ,
2020-08-20 04:55:26 +00:00
cols : 5 ,
2020-08-19 19:53:14 +00:00
11 : {
desc : "Boosters & Generators boost each other." ,
cost : new Decimal ( 40 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . unl } ,
currently ( ) {
2020-08-20 04:55:26 +00:00
let exp = 1
2020-09-14 02:41:42 +00:00
if ( player . e . upgrades . includes ( 14 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) exp = 1.5
2020-09-14 19:26:10 +00:00
return { g : player . b . points . add ( 1 ) . log10 ( ) . pow ( exp ) , b : player . g . points . add ( 1 ) . log10 ( ) . pow ( exp ) }
2020-08-20 04:55:26 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return "+" + format ( x . g ) + " to Generator base, +" + format ( x . b ) + " to Booster base" } ,
2020-08-19 19:53:14 +00:00
} ,
12 : {
desc : "Unspent Enhance Points boost Prestige Point gain." ,
cost : new Decimal ( 150 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . unl && player . e . best . gte ( 40 ) } ,
currently ( ) {
let ret = player . e . points . add ( 1 ) . pow ( ( player . e . upgrades . includes ( 15 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? 3.25 : 1.5 )
2020-08-27 15:38:26 +00:00
if ( ret . gte ( "1e1500" ) ) ret = ret . sqrt ( ) . times ( "1e750" )
return ret
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 19:53:14 +00:00
} ,
13 : {
desc : "You gain 1e10x as many Prestige Points." ,
cost : new Decimal ( 1000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 11 ) || player . e . upgrades . includes ( 12 ) } ,
2020-08-19 19:53:14 +00:00
} ,
2020-08-20 04:55:26 +00:00
14 : {
desc : "Enhance Upgrade 1 uses a better formula." ,
cost : new Decimal ( 5e7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 13 ) && ( player . t . unl || player . s . unl ) } ,
2020-08-20 04:55:26 +00:00
} ,
15 : {
desc : "Enhance Upgrade 2 uses a better formula." ,
cost : new Decimal ( 2e10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 14 ) && ( player . t . unl || player . s . unl ) && player . e . best . gte ( 1e9 ) } ,
2020-08-20 04:55:26 +00:00
} ,
2020-08-20 20:37:22 +00:00
21 : {
desc : "The Generator Power effect is raised to the power of 1.15." ,
cost : new Decimal ( 1e15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . unl && ( player . t . order == 1 || player . s . unl ) && player . e . upgrades . includes ( 14 ) } ,
2020-08-20 20:37:22 +00:00
} ,
22 : {
2020-08-21 03:33:13 +00:00
desc : "This layer behaves as if you chose it first (base req is now 1e120 points)" ,
cost : new Decimal ( 1e22 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . t . unl && player . s . unl && player . e . order == 2 ) || player . e . upgrades . includes ( 22 ) } ,
2020-08-20 20:37:22 +00:00
} ,
23 : {
2020-08-21 03:33:13 +00:00
desc : "This layer behaves as if you chose it first (base req is now 1e120 points)" ,
cost : new Decimal ( 1e40 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . t . unl && player . s . unl && player . e . order == 1 ) || player . e . upgrades . includes ( 23 ) } ,
2020-08-20 20:37:22 +00:00
} ,
24 : {
2020-08-21 19:02:34 +00:00
desc : "Prestige Points boost Enhance Point gain." ,
cost : new Decimal ( 1e65 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . unl && player . s . unl && player . e . best . gte ( 1e50 ) } ,
currently ( ) { return player . p . points . add ( 1 ) . pow ( 0.002 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-20 20:37:22 +00:00
} ,
25 : {
2020-08-21 19:02:34 +00:00
desc : "Enhancers are stronger based on your Space Energy & Time Capsules." ,
cost : new Decimal ( 7.777 e77 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . unl && player . s . unl && player . e . best . gte ( 1e60 ) } ,
currently ( ) {
let ret = player . s . points . add ( player . t . points ) . div ( 32 ) . add ( 1 ) ;
if ( ret . gte ( 2 ) ) ret = ret . log ( 2 ) . add ( 1 ) . times ( 2 ) . sqrt ( ) ;
2020-08-21 19:02:34 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-20 20:37:22 +00:00
} ,
2020-08-23 19:36:03 +00:00
31 : {
desc : "Enhancers are stronger based on your Super-Boosters." ,
cost : new Decimal ( 1e90 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 25 ) && player . sb . unl } ,
currently ( ) { return player . sb . points . pow ( 0.75 ) . div ( 4 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-23 19:36:03 +00:00
} ,
32 : {
desc : "Generator Upgrade 5 is stronger based on your Enhance Points." ,
cost : new Decimal ( 7.5 e108 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 25 ) && player . sb . unl } ,
currently ( ) {
let ret = Decimal . pow ( 10 , player . e . points . add ( 1 ) . log10 ( ) . pow ( 0.085 ) ) . div ( 10 ) . max ( 1 ) . min ( 10 ) ;
2020-08-23 19:36:03 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-23 19:36:03 +00:00
} ,
33 : {
desc : "Unlock 3 new Prestige Upgrades." ,
cost : new Decimal ( 2.5 e139 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 31 ) || player . e . upgrades . includes ( 32 ) } ,
2020-08-23 19:36:03 +00:00
} ,
34 : {
desc : "You gain 1e40x as many Prestige Points." ,
cost : new Decimal ( 1e152 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 31 ) && player . e . upgrades . includes ( 32 ) } ,
2020-08-23 19:36:03 +00:00
} ,
35 : {
desc : "Points boost Generator Power gain." ,
cost : new Decimal ( 2e189 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . e . upgrades . includes ( 33 ) || player . e . upgrades . includes ( 34 ) } ,
currently ( ) { return player . points . add ( 1 ) . pow ( 0.004 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-23 19:36:03 +00:00
} ,
2020-08-19 02:50:24 +00:00
} ,
t : {
2020-08-20 20:37:22 +00:00
rows : 3 ,
2020-08-19 19:53:14 +00:00
cols : 4 ,
11 : {
desc : "Non-extra Time Capsules boost the Booster effect." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . unl } ,
currently ( ) { return player . t . points . pow ( 0.9 ) . add ( 0.5 ) . add ( ( player . t . upgrades . includes ( 13 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? LAYER _UPGS . t [ 13 ] . currently ( ) : 0 ) } ,
effDisp ( x ) { return "+" + format ( x ) + " to base" } ,
2020-08-19 19:53:14 +00:00
} ,
12 : {
desc : "The Time Energy cap starts later based on your Boosters, and you get a free Extra Time Capsule." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . best . gte ( 2 ) && player . t . unl } ,
currently ( ) { return player . b . points . pow ( 0.95 ) . add ( 1 ) . pow ( player . q . upgrades . includes ( 43 ) ? 16 : 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 19:53:14 +00:00
} ,
13 : {
desc : "Extra Time Capsules are added to the first Time Upgrade's effect formula, but at a reduced amount." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 11 ) } ,
currently ( ) { return player . t . extCapsules . add ( tmp . freeExtCap ) . pow ( 0.95 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-08-19 19:53:14 +00:00
} ,
14 : {
2020-08-19 22:12:31 +00:00
desc : "Generator Upgrades 2 & 10 are 275% stronger, and Booster Upgrade 2 is 750% stronger." ,
2020-08-19 19:53:14 +00:00
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 12 ) || player . t . upgrades . includes ( 13 ) } ,
2020-08-19 19:53:14 +00:00
} ,
2020-08-19 22:12:31 +00:00
21 : {
2020-08-20 01:27:52 +00:00
desc : "Time Energy boosts its own production & limit, and the Time Energy effect uses a better formula." ,
2020-08-19 22:12:31 +00:00
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 14 ) } ,
currently ( ) { return player . t . energy . add ( 1 ) . log10 ( ) . pow ( 1.1 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 22:12:31 +00:00
} ,
22 : {
2020-08-20 01:27:52 +00:00
desc : "Time Energy production & limit are boosted by your Enhance Points." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 14 ) && player . e . unl } ,
currently ( ) {
let ret = player . e . points . add ( 1 ) . pow ( 0.8 / ( 1 + player . t . order ) )
2020-08-27 15:38:26 +00:00
if ( ret . gte ( "1e400" ) ) ret = ret . log10 ( ) . times ( Decimal . div ( "1e400" , 400 ) ) . min ( ret )
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 22:12:31 +00:00
} ,
23 : {
2020-08-20 01:27:52 +00:00
desc : "Time Energy production & limit are boosted by your Space Energy." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 14 ) && player . s . unl } ,
currently ( ) { return Decimal . pow ( 3 , player . s . points . pow ( 0.9 ) ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 22:12:31 +00:00
} ,
24 : {
2020-08-20 04:55:26 +00:00
desc : "Get 18 free boosters added to their effect." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 21 ) && player . t . best . gte ( 5 ) } ,
2020-08-19 22:12:31 +00:00
} ,
2020-08-20 20:37:22 +00:00
31 : {
desc : "Add 25 to the booster effect base." ,
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . t . upgrades . includes ( 22 ) && ( player . e . order == 1 || player . s . unl ) ) || ( player . t . upgrades . includes ( 23 ) && ( player . s . order == 1 || player . e . unl ) ) } ,
2020-08-20 20:37:22 +00:00
} ,
32 : {
2020-08-21 03:33:13 +00:00
desc : "This layer behaves as if you chose it first (base req is now 1e120 points)" ,
cost : new Decimal ( 12 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . s . unl && player . e . unl ) || player . t . upgrades . includes ( 32 ) } ,
2020-08-20 20:37:22 +00:00
} ,
33 : {
2020-08-21 19:02:34 +00:00
desc : "Add 40 to the booster effect base." ,
cost : new Decimal ( 16 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . unl && player . e . unl && player . t . upgrades . includes ( 32 ) } ,
2020-08-20 20:37:22 +00:00
} ,
34 : {
2020-08-22 03:59:24 +00:00
desc : "Time Energy caps later and generates faster based on your non-free Time Capsules." ,
2020-08-23 19:36:03 +00:00
cost : new Decimal ( 18 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . upgrades . includes ( 33 ) && player . sb . unl } ,
currently ( ) { return Decimal . pow ( 10 , player . t . points . pow ( 1.2 ) ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-20 20:37:22 +00:00
} ,
2020-08-19 02:50:24 +00:00
} ,
s : {
2020-09-08 16:48:48 +00:00
rows : 4 ,
2020-08-19 19:53:14 +00:00
cols : 4 ,
11 : {
desc : "Add a free level to all Space Buildings." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . unl } ,
2020-08-19 19:53:14 +00:00
} ,
12 : {
desc : "Generator Power boosts its own generation." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . best . gte ( 2 ) && player . s . unl } ,
currently ( ) { return player . g . power . add ( 1 ) . log10 ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 19:53:14 +00:00
} ,
13 : {
desc : "Space Building Levels boost Generator Power gain, and get 2 extra Space." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . upgrades . includes ( 11 ) } ,
currently ( ) { return Decimal . pow ( 20 , tmp . s !== undefined ? tmp . s . sbSum : 0 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-19 19:53:14 +00:00
} ,
14 : {
desc : "Unlock a 4th Space Building, and add a free level to all Space Buildings." ,
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . upgrades . includes ( 12 ) && player . s . upgrades . includes ( 13 ) } ,
2020-08-19 19:53:14 +00:00
} ,
2020-08-19 22:12:31 +00:00
21 : {
desc : "All Space Buildings are stronger based on your Generators." ,
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . upgrades . includes ( 14 ) } ,
currently ( ) { return player . g . points . add ( 1 ) . log10 ( ) . div ( 1.5 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-19 22:12:31 +00:00
} ,
22 : {
2020-08-20 04:55:26 +00:00
desc : "Space Buildings are stronger based on your Time Energy." ,
cost : new Decimal ( 6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . upgrades . includes ( 14 ) && player . t . unl } ,
currently ( ) { return player . t . energy . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 5 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-19 22:12:31 +00:00
} ,
23 : {
2020-08-20 04:55:26 +00:00
desc : "Space Buildings are stronger based on your Enhancers." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . upgrades . includes ( 14 ) && player . e . unl } ,
currently ( ) { return player . e . enhancers . sqrt ( ) . div ( ( player . s . order == 0 ) ? 5 : 7 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-19 22:12:31 +00:00
} ,
24 : {
2020-08-20 04:55:26 +00:00
desc : "Space Building costs scale half as fast, and you have 3 more Space." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . s . upgrades . includes ( 21 ) && ( player . t . unl || player . e . unl ) } ,
2020-08-19 22:12:31 +00:00
} ,
2020-08-20 20:37:22 +00:00
31 : {
desc : "Space Building 1 uses a better formula." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . s . upgrades . includes ( 22 ) && ( player . t . order == 0 || player . e . unl ) ) || ( player . s . upgrades . includes ( 23 ) && ( player . e . order == 0 || player . t . unl ) ) } ,
2020-08-20 20:37:22 +00:00
} ,
32 : {
desc : "Unlock a 5th Space Building." ,
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . s . upgrades . includes ( 22 ) && ( player . t . order == 1 || player . e . unl ) ) || ( player . s . upgrades . includes ( 23 ) && ( player . e . order == 1 || player . t . unl ) ) } ,
2020-08-20 20:37:22 +00:00
} ,
33 : {
2020-08-21 03:33:13 +00:00
desc : "This layer behaves as if you chose it first (base req is now 1e120 points)" ,
cost : new Decimal ( 12 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . t . unl && player . e . unl ) || player . s . upgrades . includes ( 33 ) } ,
2020-08-20 20:37:22 +00:00
} ,
34 : {
2020-08-21 03:33:13 +00:00
desc : "Space Buildings boost the Generator Power effect (before all other boosts)." ,
cost : new Decimal ( 15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . t . unl && player . e . unl && player . t . order == 0 && player . e . order == 0 && player . s . order == 0 } ,
currently ( ) { return Decimal . pow ( tmp . s !== undefined ? tmp . s . sbSum : 0 , 0.2 ) . div ( 17.5 ) } ,
effDisp ( x ) { return "Add " + format ( x ) + " to exponent" } ,
2020-08-20 20:37:22 +00:00
} ,
2020-09-08 16:48:48 +00:00
41 : {
desc : "Total Space cheapens Space Buildings." ,
cost : new Decimal ( 128 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 51 ) } ,
currently ( ) { return Decimal . pow ( "1e4000" , getSpace ( ) . add ( player . s . spent ) . sqrt ( ) ) } ,
effDisp ( x ) { return "/" + format ( x ) } ,
2020-09-08 16:48:48 +00:00
} ,
42 : {
desc : "The Space Building cost formula is 40% weaker." ,
cost : new Decimal ( 131 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 51 ) } ,
2020-09-08 16:48:48 +00:00
} ,
43 : {
desc : "Space Building 2 uses a better formula." ,
cost : new Decimal ( 133 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 51 ) } ,
2020-09-08 16:48:48 +00:00
} ,
44 : {
2020-09-08 20:47:32 +00:00
desc : "All Space Buildings are 25% stronger." ,
cost : new Decimal ( 140 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 51 ) } ,
2020-09-08 16:48:48 +00:00
} ,
2020-08-19 02:50:24 +00:00
} ,
2020-08-22 01:16:23 +00:00
sb : {
2020-08-27 19:12:20 +00:00
rows : 2 ,
2020-08-22 03:59:24 +00:00
cols : 2 ,
2020-08-22 01:16:23 +00:00
11 : {
desc : "Super-Boosters are stronger based on your Prestige Points." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sb . unl } ,
currently ( ) {
let ret = Decimal . pow ( 10 , player . p . points . add ( 1 ) . log10 ( ) . div ( 1e5 ) . sqrt ( ) ) ;
if ( ret . gte ( 2.5 ) ) ret = ret . log ( 2.5 ) . add ( 1.5 ) . min ( ret ) ;
2020-09-12 02:03:58 +00:00
if ( ret . gte ( 40 ) ) ret = ret . log ( 40 ) . times ( 40 ) ;
2020-08-23 19:36:03 +00:00
return ret . max ( 1 ) ;
2020-08-22 03:59:24 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-22 03:59:24 +00:00
} ,
12 : {
desc : "Super-Boosters are stronger based on your Generators." ,
2020-08-23 19:36:03 +00:00
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sb . upgrades . includes ( 11 ) } ,
currently ( ) { return player . g . points . div ( 10 ) . pow ( 0.04 ) . max ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-22 01:16:23 +00:00
} ,
2020-08-27 19:12:20 +00:00
21 : {
desc : "Super-Boosters add to the Booster base." ,
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
currently ( ) { return player . sb . points . pow ( 2.15 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-08-27 19:12:20 +00:00
} ,
22 : {
2020-08-29 19:45:18 +00:00
desc : "Super-Boosters add to the Super-Booster base." ,
cost : new Decimal ( 12 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
currently ( ) { return player . sb . points . add ( 1 ) . log10 ( ) . div ( 3 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-08-27 19:12:20 +00:00
} ,
2020-08-22 01:16:23 +00:00
} ,
2020-08-26 01:45:22 +00:00
q : {
2020-09-08 16:48:48 +00:00
rows : 5 ,
2020-08-29 16:43:58 +00:00
cols : 4 ,
2020-08-26 03:32:27 +00:00
11 : {
desc : "Quirks & Hindrance Spirit boost Point, Prestige Point, and Enhance Point gain." ,
cost : new Decimal ( 1 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . unl && player . q . layers . gt ( 0 ) } ,
currently ( ) { return player . q . points . add ( 1 ) . times ( player . h . points . add ( 1 ) ) . pow ( 0.75 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-26 03:32:27 +00:00
} ,
12 : {
desc : "The Quirk Energy and Hindrance Spirit effects use better formulas." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 11 ) && player . h . best . gte ( 3 ) } ,
2020-08-26 03:32:27 +00:00
} ,
2020-08-26 16:26:46 +00:00
13 : {
desc : "Quirk Layers are twice as fast." ,
cost : new Decimal ( 50 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 11 ) && player . h . challs . includes ( 11 ) } ,
2020-08-26 16:26:46 +00:00
} ,
2020-08-29 16:43:58 +00:00
14 : {
desc : "Quirk Layers are thrice as fast." ,
cost : new Decimal ( 2e10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
2020-08-29 16:43:58 +00:00
} ,
2020-08-26 19:08:00 +00:00
21 : {
desc : "Quirk Layers are faster based on your Quirks." ,
cost : new Decimal ( 160 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return ( player . q . upgrades . includes ( 12 ) || player . q . upgrades . includes ( 13 ) ) && player . h . challs . includes ( 12 ) } ,
currently ( ) { return player . q . points . add ( 1 ) . log10 ( ) . add ( 1 ) . pow ( player . m . upgrades . includes ( 42 ) ? 1.5 : 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-26 19:08:00 +00:00
} ,
22 : {
2020-08-26 20:40:54 +00:00
desc : "Quirk & Hindrance Spirit gain boost each other." ,
cost : new Decimal ( 400 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 12 ) && player . q . upgrades . includes ( 13 ) && player . h . challs . includes ( 12 ) } ,
currently ( ) { return {
q : player . h . points . div ( 10 ) . add ( 1 ) . sqrt ( ) ,
h : player . q . points . div ( 10 ) . add ( 1 ) . sqrt ( ) ,
2020-08-26 20:40:54 +00:00
} } ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x . q ) + "x to Quirk gain, " + format ( x . h ) + "x to Hindrance Spirit gain" } ,
2020-08-26 19:08:00 +00:00
} ,
23 : {
2020-08-26 22:42:19 +00:00
desc : "The Time Energy limit is 1e10x higher." ,
cost : new Decimal ( 5000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 21 ) || player . q . upgrades . includes ( 22 ) } ,
2020-08-26 19:08:00 +00:00
} ,
2020-08-29 16:43:58 +00:00
24 : {
desc : "The Time Energy limit is higher based on your Quirk Energy." ,
cost : new Decimal ( 5e10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
currently ( ) { return player . q . energy . div ( 1e6 ) . add ( 1 ) . pow ( 0.9 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-29 16:43:58 +00:00
} ,
2020-08-27 15:38:26 +00:00
31 : {
desc : "Get 1 of each Space Building for free." ,
cost : new Decimal ( 150000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 21 ) && player . q . upgrades . includes ( 22 ) } ,
2020-08-27 15:38:26 +00:00
} ,
32 : {
desc : "The Quirk Energy effect is squared." ,
cost : new Decimal ( 500000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 23 ) || player . q . upgrades . includes ( 31 ) } ,
2020-08-27 15:38:26 +00:00
} ,
33 : {
2020-08-29 16:43:58 +00:00
desc : "Time Capsules are stronger based on their amount." ,
2020-08-27 19:12:20 +00:00
cost : new Decimal ( 2e9 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . q . upgrades . includes ( 23 ) && player . q . upgrades . includes ( 31 ) } ,
currently ( ) { return player . t . points . add ( player . t . extCapsules . add ( tmp . freeExtCap ) ) . add ( 1 ) . log10 ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-27 15:38:26 +00:00
} ,
2020-08-29 16:43:58 +00:00
34 : {
desc : "Enhance Points boost Hindrance Spirit & Quirk gain." ,
cost : new Decimal ( 1e11 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
currently ( ) { return player . e . points . add ( 1 ) . log10 ( ) . cbrt ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-29 16:43:58 +00:00
} ,
2020-08-29 18:00:32 +00:00
41 : {
desc : "Space Buildings are 40% stronger." ,
cost : new Decimal ( 2.5 e13 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
2020-08-29 18:00:32 +00:00
} ,
42 : {
desc : "Enhancers are 40% stronger." ,
cost : new Decimal ( 2e14 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
2020-08-29 18:00:32 +00:00
} ,
43 : {
2020-08-29 19:45:18 +00:00
desc : "Time Upgrade 2 is 1,500% stronger." ,
cost : new Decimal ( 1e16 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
2020-08-29 18:00:32 +00:00
} ,
44 : {
2020-08-29 19:45:18 +00:00
desc : "You gain more Hindrance Spirit based on your Quirk Energy." ,
cost : new Decimal ( 4e16 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 32 ) } ,
currently ( ) { return player . q . energy . add ( 1 ) . log10 ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-29 18:00:32 +00:00
} ,
2020-09-08 16:48:48 +00:00
51 : {
desc : "Get free Quirk Layers based on your Quirk Energy." ,
cost : new Decimal ( "1e2100" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 52 ) } ,
currently ( ) { return player . q . energy . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-09-08 16:48:48 +00:00
} ,
52 : {
2020-09-08 20:47:32 +00:00
desc : "Quirk Layers are faster based on your Quirk Layers." ,
cost : new Decimal ( "1e2400" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 52 ) } ,
currently ( ) { return Decimal . pow ( 10 , player . q . layers ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-08 16:48:48 +00:00
} ,
53 : {
2020-09-08 20:47:32 +00:00
desc : "The second Enhancer effect also multiplies the Booster/Generator base." ,
cost : new Decimal ( "1e2750" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 52 ) } ,
2020-09-08 16:48:48 +00:00
} ,
54 : {
2020-09-08 22:28:40 +00:00
desc : "Generator Upgrade 15's effect is raised to the power of 20." ,
cost : new Decimal ( "1e3125" ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 52 ) } ,
2020-09-08 16:48:48 +00:00
} ,
2020-08-26 01:45:22 +00:00
} ,
2020-08-29 23:43:53 +00:00
hb : {
2020-08-30 01:39:01 +00:00
rows : 1 ,
2020-08-30 16:18:34 +00:00
cols : 4 ,
2020-08-30 01:39:01 +00:00
11 : {
desc : "Super-Boosters are stronger based on your Hyper-Boosters." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . unl } ,
currently ( ) { return player . hb . points . sqrt ( ) . div ( 4 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-30 01:39:01 +00:00
} ,
12 : {
desc : "Hyper-Boosters are stronger based on your Super-Boosters." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . unl } ,
currently ( ) { return player . sb . points . div ( 10 ) . add ( 1 ) . log10 ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-08-30 01:39:01 +00:00
} ,
2020-08-30 02:28:21 +00:00
13 : {
desc : "This layer behaves as if you chose it first." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . order > 0 || ( player . ss . upgrades . includes ( 15 ) ) || player . hb . upgrades . includes ( 13 ) || ( player . m . unl || player . ba . unl ) } ,
2020-08-30 02:28:21 +00:00
} ,
2020-08-30 16:18:34 +00:00
14 : {
desc : "Unlock 3 new Booster Upgrades." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . upgrades . includes ( 13 ) && player . ss . upgrades . includes ( 15 ) } ,
2020-08-30 16:18:34 +00:00
} ,
2020-08-29 23:43:53 +00:00
} ,
ss : {
2020-08-30 16:18:34 +00:00
rows : 2 ,
2020-08-30 02:28:21 +00:00
cols : 5 ,
2020-08-30 01:39:01 +00:00
11 : {
desc : "You get more Space based on your Subspace Energy." ,
cost : new Decimal ( 1 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . unl } ,
currently ( ) { return player . ss . points . sqrt ( ) . times ( 150 ) . floor ( ) } ,
effDisp ( x ) { return formatWhole ( x ) + " more Space" } ,
2020-08-30 01:39:01 +00:00
} ,
12 : {
desc : "You generate Subspace faster based on your Points." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . unl } ,
currently ( ) { return player . points . add ( 1 ) . log10 ( ) . div ( 1e4 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 01:39:01 +00:00
} ,
13 : {
desc : "Subspace's third effect is 50% stronger." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . unl } ,
2020-08-30 01:39:01 +00:00
} ,
14 : {
2020-08-30 02:28:21 +00:00
desc : "Super-Boosters are 8.25% cheaper." ,
2020-08-30 01:39:01 +00:00
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . unl } ,
2020-08-30 01:39:01 +00:00
} ,
2020-08-30 02:28:21 +00:00
15 : {
desc : "This layer behaves as if you chose it first." ,
cost : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . order > 0 || ( player . hb . upgrades . includes ( 13 ) ) || player . ss . upgrades . includes ( 15 ) || ( player . m . unl || player . ba . unl ) } ,
2020-08-30 02:28:21 +00:00
} ,
2020-08-30 16:18:34 +00:00
21 : {
desc : "Unlock 5 new Generator Upgrades." ,
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hb . upgrades . includes ( 13 ) && player . ss . upgrades . includes ( 15 ) } ,
2020-08-30 16:18:34 +00:00
} ,
22 : {
2020-09-01 00:39:33 +00:00
desc : "You generate Subspace faster based on its amount." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ss . upgrades . includes ( 21 ) && ( player . h . challs . includes ( 51 ) || player . h . challs . includes ( 52 ) ) } ,
currently ( ) { return player . ss . subspace . add ( 1 ) . root ( 2.25 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 16:18:34 +00:00
} ,
23 : {
2020-09-04 23:09:10 +00:00
desc : "Subspace beyond 1e20 multiplies the Generator Power base." ,
cost : new Decimal ( 6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 24 ) } ,
currently ( ) { return player . ss . subspace . sub ( 1e20 ) . max ( 0 ) . div ( 1e20 ) . add ( 1 ) . sqrt ( ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 16:18:34 +00:00
} ,
24 : {
2020-09-04 23:09:10 +00:00
desc : "Subspace Energy boosts Subspace gain." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 24 ) } ,
currently ( ) {
2020-09-14 02:41:42 +00:00
let x = player . ss . points
if ( player . ba . upgrades . includes ( 25 ) ) x = x . times ( LAYER _UPGS . ba [ 25 ] . currently ( ) )
return Decimal . pow ( 2 , x )
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 16:18:34 +00:00
} ,
25 : {
2020-09-07 02:17:10 +00:00
desc : "Subspace is generated faster based on your Quirk Layers." ,
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 24 ) } ,
currently ( ) {
2020-09-14 02:41:42 +00:00
let x = player . q . layers . sqrt ( )
if ( player . ba . upgrades . includes ( 25 ) ) x = x . times ( LAYER _UPGS . ba [ 25 ] . currently ( ) )
return Decimal . pow ( 10 , x )
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-08-30 16:18:34 +00:00
} ,
2020-08-29 23:43:53 +00:00
} ,
2020-09-03 21:59:23 +00:00
m : {
2020-09-08 00:11:57 +00:00
rows : 4 ,
2020-09-04 17:45:22 +00:00
cols : 4 ,
2020-09-04 02:25:24 +00:00
11 : {
2020-09-04 19:42:40 +00:00
desc : "Hexes boost all Spells." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . unl } ,
currently ( ) { return player . m . hexes . times ( 3 ) . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-09-04 02:25:24 +00:00
} ,
2020-09-04 03:15:10 +00:00
12 : {
desc : "Unlock 2 new Hindrances." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 11 ) } ,
2020-09-04 03:15:10 +00:00
} ,
2020-09-04 17:45:22 +00:00
13 : {
desc : "Hexes add to the Hyper-Booster base." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 11 ) } ,
currently ( ) { return player . m . hexes . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 2.5 ) } ,
effDisp ( x ) { return "+" + format ( x ) + " to base" } ,
2020-09-04 17:45:22 +00:00
} ,
14 : {
2020-09-08 00:11:57 +00:00
desc : "You get more Hexes based on your best Magic." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 20 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 12 ) } ,
currently ( ) { return player . m . best . times ( 1.2 ) . add ( 1 ) . pow ( 0.8 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-04 17:45:22 +00:00
} ,
2020-09-04 19:42:40 +00:00
21 : {
desc : "Spells 2 & 3 are stronger based on your Hindrance Spirit." ,
cost : new Decimal ( 1000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 13 ) } ,
currently ( ) { return player . h . points . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . sqrt ( ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-09-04 19:42:40 +00:00
} ,
22 : {
2020-09-04 23:09:10 +00:00
desc : "Spell 2 is 900% stronger." ,
cost : new Decimal ( 2500 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 14 ) } ,
2020-09-04 19:42:40 +00:00
} ,
23 : {
2020-09-04 23:09:10 +00:00
desc : "The Time Energy cap starts 1e500x later." ,
cost : new Decimal ( 6500 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 21 ) } ,
2020-09-04 19:42:40 +00:00
} ,
24 : {
2020-09-05 17:11:53 +00:00
desc : "Add free Quirk Layers based on your Boosters." ,
cost : new Decimal ( 80000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 22 ) } ,
currently ( ) { return player . b . points . add ( 1 ) . log10 ( ) . times ( 0.9 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-09-04 19:42:40 +00:00
} ,
2020-09-05 20:00:21 +00:00
31 : {
desc : "Unlock a new Hindrance." ,
cost : new Decimal ( 2.5 e6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 23 ) && player . sg . unl } ,
2020-09-05 20:00:21 +00:00
} ,
32 : {
desc : "Hyper-Boosters add free Space Buildings." ,
cost : new Decimal ( 5e9 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 24 ) } ,
currently ( ) { return player . hb . points . add ( 1 ) . pow ( 3 ) } ,
effDisp ( x ) { return "+" + formatWhole ( x ) } ,
2020-09-05 20:00:21 +00:00
} ,
33 : {
desc : "Hindrance Spirit adds to the Hyper-Booster base." ,
cost : new Decimal ( 2e10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 31 ) } ,
currently ( ) { return player . h . points . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 2 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-09-05 20:00:21 +00:00
} ,
34 : {
2020-09-07 02:17:10 +00:00
desc : "Add 1 free Quirk Layer." ,
cost : new Decimal ( 4e10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 32 ) } ,
2020-09-04 19:42:40 +00:00
} ,
2020-09-08 00:11:57 +00:00
41 : {
desc : "You can insert more Magic into Spells, making them stronger." ,
cost : new Decimal ( 2.5 e14 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 34 ) } ,
2020-09-08 00:11:57 +00:00
} ,
42 : {
desc : "Quirk Upgrade 5 is 50% stronger." ,
2020-09-08 20:47:32 +00:00
cost : new Decimal ( 6e14 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 34 ) } ,
2020-09-08 00:11:57 +00:00
} ,
43 : {
desc : "Spells last longer based on your Hexes." ,
2020-09-08 20:47:32 +00:00
cost : new Decimal ( 1e15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 41 ) } ,
currently ( ) { return player . m . hexes . add ( 1 ) . log10 ( ) . add ( 1 ) . sqrt ( ) . min ( 86400 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-08 00:11:57 +00:00
} ,
44 : {
desc : "Magic adds to the Time Capsule base." ,
2020-09-08 20:47:32 +00:00
cost : new Decimal ( 1.5 e15 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 41 ) } ,
currently ( ) { return player . m . points . add ( 1 ) . log10 ( ) . div ( 10 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-09-08 00:11:57 +00:00
} ,
2020-09-03 21:59:23 +00:00
} ,
ba : {
2020-09-08 16:48:48 +00:00
rows : 5 ,
2020-09-12 14:26:57 +00:00
cols : 5 ,
2020-09-04 02:25:24 +00:00
11 : {
desc : "All Balance Energy effects use better formulas." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . unl } ,
2020-09-04 02:25:24 +00:00
} ,
2020-09-04 03:15:10 +00:00
12 : {
desc : "Subspace is generated faster based on your Positivity & Negativity." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 11 ) } ,
currently ( ) { return ( tmp . balEff2 ? tmp . balEff2 : new Decimal ( 1 ) ) . max ( 1 ) . pow ( 4 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-04 03:15:10 +00:00
} ,
2020-09-04 17:45:22 +00:00
13 : {
desc : "Multiply all Quirk Layers based on your Balance Power, and the Quirk Energy effect is cubed." ,
2020-09-10 13:18:18 +00:00
cost : new Decimal ( 25 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 11 ) } ,
currently ( ) { return player . ba . power . add ( 1 ) . pow ( 1.25 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-04 17:45:22 +00:00
} ,
14 : {
desc : "The Balance Power effect uses a better formula." ,
cost : new Decimal ( 120 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 12 ) } ,
2020-09-04 17:45:22 +00:00
} ,
2020-09-04 19:42:40 +00:00
21 : {
desc : "Negativity boosts Super-Generator Power gain." ,
cost : new Decimal ( 300 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 13 ) && player . sg . unl } ,
2020-09-16 02:50:53 +00:00
currently ( ) {
let x = player . ba . negativity . add ( 1 ) . sqrt ( )
if ( x . gte ( "1e400" ) ) x = Decimal . pow ( 10 , x . log10 ( ) . times ( 20 ) . pow ( 2 / 3 ) )
return x
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-04 19:42:40 +00:00
} ,
22 : {
desc : "Balance Power boosts Positivity & Negativity gain." ,
cost : new Decimal ( 2000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 14 ) } ,
currently ( ) { return player . ba . power . add ( 1 ) . pow ( 0.15 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-04 19:42:40 +00:00
} ,
23 : {
2020-09-04 23:09:10 +00:00
desc : "Super-Generators add to their base." ,
cost : new Decimal ( 7500 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 21 ) } ,
currently ( ) { return player . sg . points . pow ( 2 ) . div ( 2 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-09-04 19:42:40 +00:00
} ,
24 : {
2020-09-04 23:09:10 +00:00
desc : "Unlock 3 new Subspace Upgrades." ,
cost : new Decimal ( 2e4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 22 ) } ,
2020-09-04 19:42:40 +00:00
} ,
2020-09-05 17:11:53 +00:00
31 : {
desc : "The Quirk Layer cost is adjusted based on your Balance Upgrades bought." ,
cost : new Decimal ( 4e5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 23 ) } ,
currently ( ) { return Decimal . div ( 0.8 , Math . pow ( player . ba . upgrades . length + 1 , 0.1 ) ) . add ( 1.2 ) } ,
effDisp ( x ) { return "2 -> " + format ( x ) } ,
2020-09-05 17:11:53 +00:00
} ,
32 : {
desc : "Enhancers are stronger based on your Positivity." ,
cost : new Decimal ( 5e5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 24 ) } ,
currently ( ) { return player . ba . positivity . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 ) . pow ( 2 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-09-05 17:11:53 +00:00
} ,
33 : {
desc : "The Balance Power effect is squared." ,
cost : new Decimal ( 1e6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 31 ) } ,
2020-09-05 17:11:53 +00:00
} ,
34 : {
desc : "The Positivity & Negativity effect uses a better formula." ,
cost : new Decimal ( 2e6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 32 ) } ,
2020-09-05 17:11:53 +00:00
} ,
2020-09-07 02:17:10 +00:00
41 : {
desc : "The first Balance Energy effect is squared." ,
cost : new Decimal ( 2e10 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 33 ) && player . ba . upgrades . includes ( 34 ) } ,
2020-09-07 02:17:10 +00:00
} ,
42 : {
2020-09-07 16:33:50 +00:00
desc : "The Space Building 1 effect is stronger based on your Space Building 1 amount." ,
cost : new Decimal ( 3e11 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 33 ) && player . ba . upgrades . includes ( 34 ) } ,
currently ( ) { return tmp . s . sb [ 1 ] . add ( 1 ) . pow ( 0.8 ) } ,
effDisp ( x ) { return "^" + format ( x ) } ,
2020-09-07 02:17:10 +00:00
} ,
43 : {
2020-09-07 16:33:50 +00:00
desc : "The post-25 Extra Time Capsule cost scaling is disabled." ,
cost : new Decimal ( 1e12 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 41 ) || player . ba . upgrades . includes ( 42 ) } ,
2020-09-07 02:17:10 +00:00
} ,
44 : {
2020-09-08 00:11:57 +00:00
desc : "Space Buildings are 50% stronger." ,
cost : new Decimal ( 2e12 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 42 ) || player . ba . upgrades . includes ( 43 ) } ,
2020-09-07 02:17:10 +00:00
} ,
2020-09-08 16:48:48 +00:00
51 : {
desc : "Unlock 4 new Space Upgrades." ,
2020-09-08 20:47:32 +00:00
cost : new Decimal ( 2e13 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 43 ) } ,
2020-09-08 16:48:48 +00:00
} ,
52 : {
desc : "Unlock 4 new Quirk Upgrades." ,
2020-09-08 20:47:32 +00:00
cost : new Decimal ( 1e14 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 51 ) } ,
2020-09-08 16:48:48 +00:00
} ,
53 : {
2020-09-08 22:28:40 +00:00
desc : "The Positivity & Negativity boost to Balance Power gain is stronger based on your Super-Generator Power." ,
2020-09-08 20:47:32 +00:00
cost : new Decimal ( 2e19 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 51 ) && player . sg . unl } ,
currently ( ) { return player . sg . power . add ( 1 ) . log10 ( ) . div ( 25 ) . add ( 1 ) . sqrt ( ) } ,
effDisp ( x ) { return "^" + format ( x ) } ,
2020-09-08 16:48:48 +00:00
} ,
54 : {
2020-09-16 02:50:53 +00:00
desc : "Balance Power boosts the first Balance Energy effect. (stronger based on your Best Balance Power)" ,
2020-09-08 22:28:40 +00:00
cost : new Decimal ( 5e25 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ba . upgrades . includes ( 53 ) } ,
currently ( ) { return player . ba . power . add ( 1 ) . times ( player . ba . best . add ( 1 ) . sqrt ( ) ) . cbrt ( ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-07 02:17:10 +00:00
} ,
2020-09-12 14:26:57 +00:00
15 : {
2020-09-13 02:38:32 +00:00
desc : "Positivity and Negativity reduce the cost scaling of Space Buildings." ,
2020-09-14 02:41:42 +00:00
cost : new Decimal ( 1e200 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 44 ) } ,
currently ( ) { return player . ba . positivity . add ( 1 ) . div ( player . ba . negativity . add ( 1 ) ) . log10 ( ) . div ( 20 ) . add ( 0.5 ) . max ( 1 ) } ,
effDisp ( x ) { return format ( Decimal . sub ( 1 , x . recip ( ) ) . times ( 100 ) ) + "%" } ,
2020-09-12 14:26:57 +00:00
} ,
25 : {
2020-09-14 02:41:42 +00:00
desc : "Balance Power boosts Subspace Upgrades 9 and 10." ,
2020-09-13 02:38:32 +00:00
cost : new Decimal ( 1e245 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 44 ) } ,
currently ( ) { return player . ba . power . add ( 1 ) . log10 ( ) . div ( 10 ) . max ( 1 ) . cbrt ( ) } ,
effDisp ( x ) { return "^" + format ( x ) } ,
2020-09-12 14:26:57 +00:00
} ,
35 : {
2020-09-14 02:41:42 +00:00
desc : "Super-Upgrades are 25% stronger." ,
2020-09-15 00:45:31 +00:00
cost : new Decimal ( 1e260 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 44 ) } ,
2020-09-12 14:26:57 +00:00
} ,
45 : {
2020-09-14 02:41:42 +00:00
desc : "Subspace reduces both Hyperspace costs." ,
2020-09-14 19:26:10 +00:00
cost : new Decimal ( "6.66e666" ) ,
unl ( ) { return player . sp . upgrades . includes ( 44 ) } ,
currently ( ) { return player . ss . subspace . add ( 1 ) . pow ( 0.02 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-12 14:26:57 +00:00
} ,
55 : {
2020-09-14 19:26:10 +00:00
desc : "Super-Prestige Points cheapen Quirk Layers." ,
cost : new Decimal ( "1e920" ) ,
unl ( ) { return player . sp . upgrades . includes ( 44 ) } ,
currently ( ) { return player . sp . points . max ( 1 ) . log10 ( ) . pow ( 0.75 ) . div ( 2 ) } ,
effDisp ( x ) { return "-" + format ( x ) + " layers" } ,
2020-09-12 14:26:57 +00:00
} ,
2020-09-03 21:59:23 +00:00
} ,
2020-09-11 02:15:05 +00:00
ps : {
rows : 2 ,
cols : 4 ,
11 : {
desc : "Hindrance Spirits reduce the requirement of Phantom Souls." ,
2020-09-12 02:03:58 +00:00
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return true } ,
currently ( ) { return player . h . points . add ( 1 ) . pow ( 0.01 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-11 02:15:05 +00:00
} ,
12 : {
2020-09-12 02:03:58 +00:00
desc : "Phantom Souls are 20% stronger." ,
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return true } ,
2020-09-11 02:15:05 +00:00
} ,
13 : {
2020-09-12 02:03:58 +00:00
desc : "Phantom Souls strengthen all Spells." ,
cost : new Decimal ( 7 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return true } ,
currently ( ) { return player . ps . points . div ( 2 ) . max ( 1 ) . log10 ( ) . div ( 10 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "%" } ,
2020-09-11 02:15:05 +00:00
} ,
14 : {
2020-09-12 02:03:58 +00:00
desc : "The Life Essence layer acts like you choose it first." ,
2020-09-14 02:41:42 +00:00
cost : new Decimal ( 8 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . l . order > 0 || player . ps . upgrades . includes ( 14 ) } ,
2020-09-11 02:15:05 +00:00
} ,
21 : {
desc : "Unlock the fifth Life Booster." ,
2020-09-14 02:41:42 +00:00
cost : new Decimal ( 5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hs . unl } ,
2020-09-11 02:15:05 +00:00
} ,
22 : {
2020-09-12 14:26:57 +00:00
desc : "Phantom Souls reduce the post-12 scaling of all row 1 - 4 layer requirements." ,
2020-09-14 19:26:10 +00:00
cost : new Decimal ( 19 ) ,
unl ( ) { return player . hs . unl } ,
currently ( ) { return player . ps . points . div ( 100 ) . add ( 1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-11 02:15:05 +00:00
} ,
23 : {
2020-09-14 19:26:10 +00:00
desc : "Unlock 4 new Super-Prestige Upgrades." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 21 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hs . unl } ,
2020-09-11 02:15:05 +00:00
} ,
24 : {
2020-09-14 02:41:42 +00:00
desc : "The Hyperspace layer acts like you choose it first." ,
2020-09-14 19:26:10 +00:00
cost : new Decimal ( 17 ) ,
unl ( ) { return ( player . hs . unl && player . hs . order > 0 ) || player . ps . upgrades . includes ( 24 ) } ,
2020-09-11 02:15:05 +00:00
} ,
} ,
2020-09-09 02:10:25 +00:00
sp : {
2020-09-14 19:26:10 +00:00
rows : 4 ,
cols : 5 ,
2020-09-09 02:10:25 +00:00
11 : {
desc : "The Prestige Upgrade 3, 6, & 7 effects are raised to the power of 100." ,
cost : new Decimal ( 1 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . unl } ,
2020-09-09 02:10:25 +00:00
} ,
12 : {
desc : "Total Super-Prestige Points boost Magic & Balance Power gain." ,
cost : new Decimal ( 2 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 11 ) } ,
currently ( ) { return player . sp . total . add ( 1 ) . pow ( 2.5 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-09 02:10:25 +00:00
} ,
13 : {
desc : "Unlock a new Spell." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 2 ) ,
unl ( ) { return player . sp . upgrades . includes ( 11 ) } ,
2020-09-09 02:10:25 +00:00
} ,
14 : {
desc : "Your Best Super-Prestige Points boost Hex & Balance Energy gain." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 3 ) ,
unl ( ) { return player . sp . upgrades . includes ( 12 ) || player . sp . upgrades . includes ( 13 ) } ,
2020-09-14 19:26:10 +00:00
currently ( ) { return player . sp . best . add ( 1 ) . pow ( 1.9 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-09 02:10:25 +00:00
} ,
2020-09-09 16:51:59 +00:00
21 : {
desc : "Super-Prestige Points add to the Super-Generator base." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 4 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 11 ) } ,
currently ( ) { return player . sp . points . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . times ( 1.5 ) } ,
effDisp ( x ) { return "+" + format ( x ) } ,
2020-09-09 16:51:59 +00:00
} ,
22 : {
desc : 'The effects of "Anti-Upgrades" & "Prestigeless" Hindrances are 24,900% stronger.' ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 6 ) ,
unl ( ) { return player . sp . upgrades . includes ( 12 ) || player . sp . upgrades . includes ( 21 ) } ,
2020-09-09 16:51:59 +00:00
} ,
23 : {
desc : "Spells are stronger based on your Total Super-Prestige Points." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 8 ) ,
unl ( ) { return player . sp . upgrades . includes ( 13 ) || player . sp . upgrades . includes ( 22 ) } ,
2020-09-14 19:26:10 +00:00
currently ( ) {
2020-09-09 18:08:53 +00:00
let sp = player . sp . total
if ( sp . gte ( 250 ) ) sp = sp . log10 ( ) . times ( 250 / Math . log10 ( 250 ) ) . min ( sp )
2020-09-14 19:26:10 +00:00
return sp . add ( 1 ) . log10 ( ) . div ( 5 ) . add ( 1 )
2020-09-09 18:08:53 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger" } ,
2020-09-09 16:51:59 +00:00
} ,
24 : {
desc : "Super-Prestige Points boost Super-Prestige Point gain." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 15 ) ,
unl ( ) { return player . sp . upgrades . includes ( 14 ) || player . sp . upgrades . includes ( 23 ) } ,
2020-09-14 19:26:10 +00:00
currently ( ) {
2020-09-10 00:40:07 +00:00
let sp = player . sp . points
if ( sp . gte ( 2e4 ) ) sp = sp . cbrt ( ) . times ( Math . pow ( 2e4 , 2 / 3 ) ) ;
2020-09-16 02:50:53 +00:00
return sp . times ( 2 ) . add ( 1 ) . sqrt ( )
2020-09-10 00:40:07 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-09 16:51:59 +00:00
} ,
2020-09-09 22:47:26 +00:00
31 : {
desc : "Super-Generators are 45% cheaper." ,
cost : new Decimal ( 1000 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 22 ) } ,
2020-09-09 22:47:26 +00:00
} ,
32 : {
desc : "Prestige Upgrade 7 softcaps later based on your Super-Prestige Points." ,
cost : new Decimal ( 4000 ) ,
2020-09-16 02:50:53 +00:00
unl ( ) { return player . sp . upgrades . includes ( 23 ) && player . sp . upgrades . includes ( 31 ) } ,
2020-09-14 19:26:10 +00:00
currently ( ) { return player . sp . points . add ( 1 ) . log10 ( ) . add ( 1 ) . pow ( 1e4 ) } ,
effDisp ( x ) { return format ( x . pow ( player . sp . upgrades . includes ( 11 ) ? 100 : 1 ) ) + "x later" } ,
2020-09-09 22:47:26 +00:00
} ,
33 : {
2020-09-10 00:40:07 +00:00
desc : "Points boost Super-Prestige Point gain." ,
cost : new Decimal ( 1e4 ) ,
2020-09-16 02:50:53 +00:00
unl ( ) { return player . sp . upgrades . includes ( 24 ) && player . sp . upgrades . includes ( 32 ) } ,
2020-09-14 19:26:10 +00:00
currently ( ) { return player . points . add ( 1 ) . log10 ( ) . pow ( 0.1 ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-09 16:51:59 +00:00
} ,
2020-09-09 22:47:26 +00:00
34 : {
2020-09-10 00:40:07 +00:00
desc : "Boosters & Generators are 25% stronger." ,
cost : new Decimal ( 1.5 e5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . sp . upgrades . includes ( 33 ) } ,
2020-09-09 22:47:26 +00:00
} ,
2020-09-11 02:15:05 +00:00
41 : {
desc : "Gain more Life Essence based on total SP." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 1e6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . l . unl } ,
currently ( ) { return player . sp . total . div ( 5e5 ) . add ( 1 ) . sqrt ( ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-11 02:15:05 +00:00
} ,
42 : {
2020-09-12 02:03:58 +00:00
desc : "Life Essence speeds up the Life Power production." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 1.5 e6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . l . unl } ,
currently ( ) {
2020-09-16 02:50:53 +00:00
if ( player . sp . upgrades . includes ( 15 ) ) return Decimal . pow ( 8 , player . l . points . max ( 1 ) . log10 ( ) . pow ( 0.4 ) )
2020-09-15 19:27:33 +00:00
return player . l . points . add ( 1 ) . log10 ( ) . add ( 1 ) . pow ( 0.75 )
2020-09-14 19:26:10 +00:00
} ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-11 02:15:05 +00:00
} ,
43 : {
2020-09-14 02:41:42 +00:00
desc : "Gain more Hyperspace Energy based on total SP." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 8e5 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hs . unl } ,
currently ( ) { return player . sp . total . div ( 7.5 e5 ) . add ( 1 ) . sqr ( ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-11 02:15:05 +00:00
} ,
44 : {
2020-09-14 02:41:42 +00:00
desc : "Unlock 5 new Balance Upgrades." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 1.5 e6 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . hs . unl } ,
} ,
15 : {
desc : "Life Essence speeds up the Life Power production more." ,
2020-09-16 02:50:53 +00:00
cost : new Decimal ( 3e16 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ps . upgrades . includes ( 23 ) } ,
} ,
25 : {
2020-09-16 02:50:53 +00:00
desc : "Super-Upgrades of Space Building 4 divides the Super-Generator requirement." ,
cost : new Decimal ( 2e17 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ps . upgrades . includes ( 23 ) } ,
2020-09-16 02:50:53 +00:00
currently ( ) { return fixValue ( tmp . hs !== undefined && tmp . hs . su [ 4 ] ) . add ( 1 ) . sqr ( ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-14 19:26:10 +00:00
} ,
35 : {
2020-09-16 02:50:53 +00:00
desc : "Super-Prestige Points strengthen all Subspace effects." ,
cost : new Decimal ( 6e17 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ps . upgrades . includes ( 23 ) } ,
2020-09-16 02:50:53 +00:00
currently ( ) { return player . sp . points . log10 ( ) . div ( 15 ) . add ( 1 ) . cbrt ( ) } ,
effDisp ( x ) { return format ( x . sub ( 1 ) . times ( 100 ) ) + "%" } ,
2020-09-14 19:26:10 +00:00
} ,
45 : {
2020-09-16 02:50:53 +00:00
desc : "Subtract the cost of Imperium Buildings by 3." ,
cost : new Decimal ( 1e22 ) ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . ps . upgrades . includes ( 23 ) } ,
} ,
2020-09-11 02:15:05 +00:00
} ,
2020-08-22 01:16:23 +00:00
}
const LAYER _AMT _NAMES = {
p : "points" ,
b : "points" ,
g : "points" ,
t : "points" ,
e : "points" ,
s : "points" ,
2020-08-26 01:45:22 +00:00
sb : "boosters" ,
2020-09-04 17:45:22 +00:00
sg : "generators" ,
2020-08-26 01:45:22 +00:00
h : "time energy" ,
q : "generator power" ,
2020-08-29 23:43:53 +00:00
hb : "super-boosters" ,
ss : "space energy" ,
2020-09-03 21:59:23 +00:00
m : "hindrance spirit" ,
ba : "quirks" ,
2020-09-11 02:15:05 +00:00
ps : "quirk energy" ,
2020-09-09 02:10:25 +00:00
sp : "prestige points" ,
2020-09-11 02:15:05 +00:00
l : "hexes" ,
2020-09-10 02:44:25 +00:00
hs : "space energy" ,
2020-09-11 02:15:05 +00:00
i : "subspace" ,
2020-08-22 01:16:23 +00:00
}
function getLayerAmt ( layer ) {
let amt = player . points
switch ( layer ) {
case "sb" :
return player . b . points ;
break ;
2020-09-04 17:45:22 +00:00
case "sg" :
return player . g . points ;
break ;
2020-08-26 01:45:22 +00:00
case "h" :
return player . t . energy ;
break ;
case "q" :
return player . g . power ;
break ;
2020-08-29 23:43:53 +00:00
case "hb" :
return player . sb . points ;
break ;
case "ss" :
return player . s . points ;
break ;
2020-09-03 21:59:23 +00:00
case "m" :
return player . h . points ;
break ;
case "ba" :
return player . q . points ;
break ;
2020-09-11 02:15:05 +00:00
case "ps" :
return player . q . energy ;
break ;
2020-09-09 02:10:25 +00:00
case "sp" :
return player . p . points ;
break ;
2020-09-10 02:44:25 +00:00
case "l" :
2020-09-11 02:15:05 +00:00
return player . m . hexes ;
2020-09-10 02:44:25 +00:00
break ;
case "hs" :
return player . s . points ;
break ;
2020-09-11 02:15:05 +00:00
case "i" :
return player . ss . subspace ;
break ;
2020-08-22 01:16:23 +00:00
}
return amt
2020-08-19 02:50:24 +00:00
}
function getLayerEffDesc ( layer ) {
if ( ! Object . keys ( LAYER _EFFS ) . includes ( layer ) ) return "???"
2020-08-21 19:02:34 +00:00
let eff = tmp . layerEffs [ layer ]
2020-08-19 02:50:24 +00:00
switch ( layer ) {
case "b" :
return "translated to a " + format ( eff ) + "x multiplier to point gain"
break ;
case "g" :
return "which are generating " + format ( eff ) + " Generator Power/sec"
break ;
case "t" :
return "which are generating " + format ( eff . gain ) + " Time Energy/sec, but with a limit of " + format ( eff . limit ) + " Time Energy"
break ;
2020-08-22 01:16:23 +00:00
case "sb" :
2020-08-23 19:36:03 +00:00
return "which are multiplying the Booster effect base by " + format ( eff )
2020-08-22 01:16:23 +00:00
break ;
2020-09-04 17:45:22 +00:00
case "sg" :
return "which are generating " + format ( eff ) + " Super-Generator Power/sec"
break ;
2020-08-26 01:45:22 +00:00
case "h" :
return "which are providing " + format ( eff ) + " free extra Time Capsules (boosted by your points)"
break ;
2020-08-29 23:43:53 +00:00
case "hb" :
return "which are multiplying the Super-Booster effect base by " + format ( eff )
break ;
case "ss" :
return "which are generating " + format ( eff ) + " Subspace/sec"
break ;
2020-09-03 21:59:23 +00:00
case "ba" :
return "which are generating " + format ( eff . power ) + " Balance Power, " + format ( eff . pos ) + " Positivity, and " + format ( eff . neg ) + " Negativity every second"
break ;
2020-09-11 02:15:05 +00:00
case "ps" :
return "which are speeding up the Life Power production by " + format ( eff . mult ) + "x and raising the Life Power amount to the power of " + format ( eff . exp )
break ;
2020-09-15 19:27:33 +00:00
case "l" :
2020-09-16 02:50:53 +00:00
return "which makes the Life Power softcap starts at " + format ( eff . pow ( tmp . layerEffs . ps . exp ) )
2020-09-15 19:27:33 +00:00
break ;
2020-08-19 02:50:24 +00:00
}
}
function save ( ) {
localStorage . setItem ( "prestige-tree" , btoa ( JSON . stringify ( player ) ) )
}
function load ( ) {
let get = localStorage . getItem ( "prestige-tree" ) ;
2020-08-19 19:53:14 +00:00
if ( get === null || get === undefined ) player = getStartPlayer ( )
2020-08-19 02:50:24 +00:00
else player = JSON . parse ( atob ( get ) )
player . tab = "tree"
2020-09-16 17:21:16 +00:00
if ( player . offlineProd ) {
2020-09-15 19:27:33 +00:00
if ( player . offTime === undefined ) player . offTime = { remain : 0 }
player . offTime . remain += ( Date . now ( ) - player . time ) / 1000
}
2020-09-01 00:39:33 +00:00
player . time = Date . now ( )
2020-08-19 02:50:24 +00:00
checkForVars ( ) ;
convertToDecimal ( ) ;
2020-08-23 19:36:03 +00:00
versionCheck ( ) ;
2020-09-14 19:26:10 +00:00
changeTheme ( ) ;
2020-09-07 14:16:04 +00:00
changeTreeQuality ( ) ;
2020-08-21 19:02:34 +00:00
updateTemp ( ) ;
2020-09-01 00:39:33 +00:00
updateTemp ( ) ;
2020-08-19 02:50:24 +00:00
loadVue ( ) ;
}
function exportSave ( ) {
let str = btoa ( JSON . stringify ( player ) )
const el = document . createElement ( "textarea" ) ;
el . value = str ;
document . body . appendChild ( el ) ;
el . select ( ) ;
el . setSelectionRange ( 0 , 99999 ) ;
document . execCommand ( "copy" ) ;
document . body . removeChild ( el ) ;
}
2020-08-23 19:36:03 +00:00
function importSave ( imported = undefined ) {
if ( imported === undefined ) imported = prompt ( "Paste your save here" )
2020-08-19 02:50:24 +00:00
try {
player = JSON . parse ( atob ( imported ) )
save ( )
window . location . reload ( )
} catch ( e ) {
return ;
}
}
2020-08-23 19:36:03 +00:00
function versionCheck ( ) {
let setVersion = true
if ( player . versionType === undefined || player . version === undefined ) {
player . versionType = "alpha"
player . version = 0
}
if ( player . versionType == "alpha" ) {
if ( player . version < 10 && player . sb . unl ) {
2020-08-24 02:01:14 +00:00
if ( confirm ( "Since the last time you played, several changes to Super-Booster effects have been made. Would you like to roll back your save to that point in the progression, in order for you to experience the new features properly?" ) ) importSave ( SAVES . PRE _SUPER _BOOSTERS )
2020-08-23 19:36:03 +00:00
setVersion = false ;
}
}
2020-08-31 02:35:50 +00:00
if ( player . versionType == "beta" ) {
if ( player . version <= 1.1 ) if ( ! ( player . hb . unl || player . ss . unl ) ) {
player . hb . order = 0
player . ss . order = 0
}
}
2020-08-23 19:36:03 +00:00
if ( setVersion ) {
2020-09-14 19:26:10 +00:00
if ( player . versionType == "real" && VERSION . num > player . version ) player . keepGoing = false
2020-08-23 19:36:03 +00:00
player . versionType = getStartPlayer ( ) . versionType
2020-09-14 19:26:10 +00:00
player . version = VERSION . num
player . beta = VERSION . beta
2020-08-23 19:36:03 +00:00
}
}
2020-08-19 02:50:24 +00:00
function checkForVars ( ) {
2020-09-03 21:59:23 +00:00
let start = getStartPlayer ( )
2020-09-10 13:18:18 +00:00
for ( var i = 0 ; i < LAYERS . length ; i ++ ) {
2020-09-14 02:41:42 +00:00
var layer = LAYERS [ i ]
if ( player [ layer ] === undefined ) player [ layer ] = start [ layer ]
else if ( player [ layer ] . total === undefined && start [ layer ] . total !== undefined ) player [ layer ] . total = Decimal . max ( player [ layer ] . points , player [ layer ] . best )
if ( LAYER _UPGS [ layer ] !== undefined && player [ layer ] . upgrades === undefined ) player [ layer ] . upgrades = [ ]
if ( LAYER _UPGS [ layer ] === undefined && player [ layer ] . upgrades !== undefined ) delete player [ layer ] . upgrades
if ( LAYER _CHALLS [ layer ] !== undefined && player [ layer ] . challs === undefined ) player [ layer ] . challs = [ ]
if ( LAYER _CHALLS [ layer ] === undefined && player [ layer ] . challs !== undefined ) delete player [ layer ] . challs
2020-09-10 13:18:18 +00:00
}
2020-08-19 02:50:24 +00:00
if ( player . autosave === undefined ) player . autosave = true ;
if ( player . p . best === undefined ) player . p . best = player . p . points
if ( player . b . best === undefined ) player . b . best = player . b . points
2020-08-20 04:55:26 +00:00
if ( player . b . auto === undefined ) player . b . auto = false
2020-08-19 02:50:24 +00:00
if ( player . g . best === undefined ) player . g . best = player . g . points
2020-08-20 04:55:26 +00:00
if ( player . g . auto === undefined ) player . g . auto = false
2020-08-19 02:50:24 +00:00
if ( player . e . order === undefined ) player . e . order = 0
2020-08-26 03:32:27 +00:00
if ( player . e . auto === undefined ) player . e . auto = false
if ( player . t . auto === undefined ) player . t . auto = false
if ( player . t . autoCap === undefined ) player . t . autoCap = false
if ( player . s . auto === undefined ) player . s . auto = false
2020-08-30 01:39:01 +00:00
if ( player . s . autoBuild === undefined ) player . s . autoBuild = false
2020-08-26 14:16:23 +00:00
if ( player . sb . auto === undefined ) player . sb . auto = false
2020-08-23 19:36:03 +00:00
if ( player . timePlayed === undefined ) player . timePlayed = 0
2020-08-24 02:01:14 +00:00
if ( player . hasNaN === undefined ) player . hasNaN = false
2020-08-26 16:26:46 +00:00
if ( player . h . active === undefined ) player . h . active = 0
2020-09-14 21:18:02 +00:00
if ( player . h . time === undefined ) player . h . time = player . timePlayed
2020-09-04 02:25:24 +00:00
if ( player . q . auto === undefined ) player . q . auto = false
2020-08-27 19:12:20 +00:00
if ( player . msDisplay === undefined ) player . msDisplay = "always"
2020-09-04 02:25:24 +00:00
if ( player . hb . auto === undefined ) player . hb . auto = false
if ( player . ss . auto === undefined ) player . ss . auto = false
2020-09-07 02:17:10 +00:00
if ( player . m . auto === undefined ) player . m . auto = false
2020-09-08 00:11:57 +00:00
if ( player . m . toCast === undefined ) player . m . toCast = start . m . toCast
if ( player . m . casted === undefined ) player . m . casted = start . m . casted
2020-09-09 02:10:25 +00:00
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 )
}
2020-09-03 21:59:23 +00:00
if ( player . offlineProd === undefined ) player . offlineProd = true
2020-09-08 23:22:22 +00:00
if ( player . notify === undefined ) player . notify = { }
2020-09-10 01:39:08 +00:00
if ( player . keepGoing === undefined ) player . keepGoing = false
2020-09-11 02:15:05 +00:00
if ( player . i . lifeBricks === undefined ) {
player . l = start . l
player . i = start . i
delete player . c
}
2020-09-13 02:38:32 +00:00
if ( player . hs . space === undefined ) {
var order = player . hs . order
player . hs = start . hs
player . hs . order = order
}
2020-08-19 02:50:24 +00:00
}
function convertToDecimal ( ) {
player . points = new Decimal ( player . points )
2020-09-10 13:18:18 +00:00
for ( var i = 0 ; i < LAYERS . length ; i ++ ) {
var data = player [ LAYERS [ i ] ]
data . points = new Decimal ( data . points )
data . best = new Decimal ( data . best )
if ( data . total !== undefined ) data . total = new Decimal ( data . total )
}
2020-08-19 02:50:24 +00:00
player . g . power = new Decimal ( player . g . power )
player . e . enhancers = new Decimal ( player . e . enhancers )
player . t . energy = new Decimal ( player . t . energy )
player . t . extCapsules = new Decimal ( player . t . extCapsules )
player . s . spent = new Decimal ( player . s . spent )
2020-09-14 02:41:42 +00:00
for ( let i = 1 ; i <= SPACE _BUILDINGS . max ; i ++ ) if ( player . s . buildings [ i ] !== undefined ) player . s . buildings [ i ] = new Decimal ( player . s . buildings [ i ] )
2020-09-04 17:45:22 +00:00
player . sg . power = new Decimal ( player . sg . power )
2020-08-26 01:45:22 +00:00
player . q . layers = new Decimal ( player . q . layers )
player . q . energy = new Decimal ( player . q . energy )
player . q . time = new Decimal ( player . q . time )
2020-08-29 23:43:53 +00:00
player . ss . subspace = new Decimal ( player . ss . subspace )
2020-09-03 21:59:23 +00:00
player . m . hexes = new Decimal ( player . m . hexes )
2020-09-10 02:44:25 +00:00
for ( let i = 1 ; i <= MAX _SPELLS ; i ++ ) if ( player . m . casted [ i ] ) player . m . casted [ i ] = new Decimal ( player . m . casted [ i ] )
2020-09-03 21:59:23 +00:00
player . ba . power = new Decimal ( player . ba . power )
player . ba . positivity = new Decimal ( player . ba . positivity )
player . ba . negativity = new Decimal ( player . ba . negativity )
2020-09-10 02:44:25 +00:00
player . l . power = new Decimal ( player . l . power )
2020-09-12 02:03:58 +00:00
for ( let i = 1 ; i <= 5 ; i ++ ) if ( player . l . boosters [ i ] ) player . l . boosters [ i ] = new Decimal ( player . l . boosters [ i ] )
2020-09-13 02:38:32 +00:00
player . hs . space = new Decimal ( player . hs . space )
player . hs . spent = new Decimal ( player . hs . spent )
2020-09-14 02:41:42 +00:00
for ( let i = 1 ; i <= SPACE _BUILDINGS . max ; i ++ ) if ( player . hs . superUpgrades [ i ] !== undefined ) player . hs . superUpgrades [ i ] = new Decimal ( player . hs . superUpgrades [ i ] )
2020-09-13 02:38:32 +00:00
player . hs . superUpgradeCap = new Decimal ( player . hs . superUpgradeCap )
2020-09-11 02:15:05 +00:00
player . i . lifeBricks = new Decimal ( player . i . lifeBricks )
player . i . extraBuildings = new Decimal ( player . i . extraBuildings )
2020-08-19 02:50:24 +00:00
}
function toggleOpt ( name ) {
player [ name ] = ! player [ name ]
2020-09-07 14:16:04 +00:00
if ( name == "hqTree" ) changeTreeQuality ( )
}
function changeTreeQuality ( ) {
var on = player . hqTree
2020-09-07 16:54:23 +00:00
document . body . style . setProperty ( '--hqProperty1' , on ? "2px solid" : "4px solid" )
document . body . style . setProperty ( '--hqProperty2a' , on ? "-4px -4px 4px rgba(0, 0, 0, 0.25) inset" : "-4px -4px 4px rgba(0, 0, 0, 0) inset" )
2020-09-14 19:26:10 +00:00
document . body . style . setProperty ( '--hqProperty2b' , on ? "0px 0px 20px var(--background)" : "" )
2020-09-07 16:54:23 +00:00
document . body . style . setProperty ( '--hqProperty3' , on ? "2px 2px 4px rgba(0, 0, 0, 0.25)" : "none" )
2020-08-19 02:50:24 +00:00
}
function exponentialFormat ( num , precision ) {
let e = num . log10 ( ) . floor ( )
let m = num . div ( Decimal . pow ( 10 , e ) )
return m . toStringWithDecimalPlaces ( 3 ) + "e" + e . toStringWithDecimalPlaces ( 0 )
}
function commaFormat ( num , precision ) {
if ( num === null || num === undefined ) return "NaN"
2020-09-14 02:41:42 +00:00
if ( num . mag < 0.001 ) return ( 0 ) . toFixed ( precision )
2020-08-19 02:50:24 +00:00
return num . toStringWithDecimalPlaces ( precision ) . replace ( /\B(?=(\d{3})+(?!\d))/g , "," )
}
2020-09-10 02:44:25 +00:00
function fixValue ( x , y = 0 ) {
2020-09-14 02:41:42 +00:00
return x || new Decimal ( y )
2020-09-10 02:44:25 +00:00
}
function sumValues ( x ) {
x = Object . values ( x )
2020-09-14 02:41:42 +00:00
if ( ! x [ 0 ] ) return new Decimal ( 0 )
2020-09-10 13:18:18 +00:00
return x . reduce ( ( a , b ) => Decimal . add ( a , b ) )
2020-09-10 02:44:25 +00:00
}
2020-08-19 02:50:24 +00:00
function format ( decimal , precision = 3 ) {
decimal = new Decimal ( decimal )
2020-08-24 02:01:14 +00:00
if ( isNaN ( decimal . sign ) || isNaN ( decimal . layer ) || isNaN ( decimal . mag ) ) {
player . hasNaN = true ;
return "NaN"
}
2020-09-14 02:41:42 +00:00
if ( decimal . sign < 0 ) return "-" + format ( decimal . neg ( ) , precision )
if ( decimal . mag == Number . POSITIVE _INFINITY ) return "Infinity"
if ( decimal . gte ( "eeee1000" ) ) {
2020-09-13 02:38:32 +00:00
var slog = decimal . slog ( )
if ( slog . gte ( 1e6 ) ) return "F" + format ( slog . floor ( ) )
else return Decimal . pow ( 10 , slog . sub ( slog . floor ( ) ) ) . toStringWithDecimalPlaces ( 3 ) + "F" + commaFormat ( slog . floor ( ) , 0 )
2020-09-14 02:41:42 +00:00
} else if ( decimal . gte ( "1e1000" ) ) return "e" + formatWhole ( decimal . log10 ( ) )
2020-08-21 03:33:13 +00:00
else if ( decimal . gte ( 1e9 ) ) return exponentialFormat ( decimal , precision )
2020-08-19 19:53:14 +00:00
else if ( decimal . gte ( 1e3 ) ) return commaFormat ( decimal , 0 )
2020-08-19 02:50:24 +00:00
else return commaFormat ( decimal , precision )
}
function formatWhole ( decimal ) {
return format ( decimal , 0 )
}
2020-08-24 02:01:14 +00:00
function formatTime ( s ) {
if ( s < 60 ) return format ( s ) + "s"
else if ( s < 3600 ) return formatWhole ( Math . floor ( s / 60 ) ) + "m " + format ( s % 60 ) + "s"
else return formatWhole ( Math . floor ( s / 3600 ) ) + "h " + formatWhole ( Math . floor ( s / 60 ) % 60 ) + "m " + format ( s % 60 ) + "s"
}
2020-09-08 23:22:22 +00:00
var onTreeTab = true
2020-08-19 02:50:24 +00:00
function showTab ( name ) {
2020-09-11 02:15:05 +00:00
if ( LAYERS . includes ( name ) && ! layerUnl ( name ) ) return
2020-09-08 23:22:22 +00:00
var toTreeTab = name == "tree"
2020-08-19 02:50:24 +00:00
player . tab = name
2020-09-08 23:22:22 +00:00
if ( toTreeTab != onTreeTab ) {
2020-09-10 01:46:36 +00:00
document . getElementById ( "treeTab" ) . className = toTreeTab ? "fullWidth" : "col left"
2020-09-08 23:22:22 +00:00
onTreeTab = toTreeTab
resizeCanvas ( )
}
delete player . notify [ name ]
}
function notifyLayer ( name ) {
2020-09-11 02:15:05 +00:00
if ( player . tab == name || ! layerUnl ( name ) ) return
2020-09-08 23:22:22 +00:00
player . notify [ name ] = 1
2020-08-19 02:50:24 +00:00
}
function canBuyMax ( layer ) {
switch ( layer ) {
case "b" :
return player . b . best . gte ( 15 )
break ;
case "g" :
return player . g . best . gte ( 15 )
break ;
2020-08-26 03:32:27 +00:00
case "t" :
return player . q . best . gte ( 2 )
break ;
case "s" :
return player . q . best . gte ( 2 )
break ;
2020-08-30 16:18:34 +00:00
case "sb" :
return player . hb . best . gte ( 1 )
break ;
2020-09-04 17:45:22 +00:00
case "sg" :
return player . sg . best . gte ( 1 )
break ;
2020-09-04 02:25:24 +00:00
case "hb" :
return player . ba . best . gte ( 8 )
break ;
case "ss" :
return player . ba . best . gte ( 8 )
break ;
2020-09-11 02:15:05 +00:00
case "ps" :
2020-09-14 19:26:10 +00:00
return player . ps . best . gte ( 5 )
2020-09-11 02:15:05 +00:00
break ;
2020-09-14 02:41:42 +00:00
case "i" :
return player . i . best . gte ( 3 )
break ;
2020-08-19 02:50:24 +00:00
}
return false ;
}
function getLayerReq ( layer ) {
let req = LAYER _REQS [ layer ]
switch ( layer ) {
case "b" :
if ( player . g . unl && ! player . b . unl ) req = req . times ( 5000 )
break ;
case "g" :
if ( player . b . unl && ! player . g . unl ) req = req . times ( 5000 )
break ;
case "e" :
2020-08-20 01:27:52 +00:00
req = req . times ( Decimal . pow ( "1e200" , Decimal . pow ( player . e . order , 2 ) ) )
2020-08-19 02:50:24 +00:00
break ;
case "t" :
2020-08-20 01:27:52 +00:00
req = req . times ( Decimal . pow ( "1e200" , Decimal . pow ( player . t . order , 2 ) ) )
2020-08-19 02:50:24 +00:00
break ;
case "s" :
2020-08-20 01:27:52 +00:00
req = req . times ( Decimal . pow ( "1e200" , Decimal . pow ( player . s . order , 2 ) ) )
2020-08-19 02:50:24 +00:00
break ;
2020-08-29 23:43:53 +00:00
case "hb" :
2020-08-30 01:39:01 +00:00
if ( player . hb . order > 0 ) req = new Decimal ( 15 )
2020-08-29 23:43:53 +00:00
break ;
case "ss" :
2020-08-30 01:39:01 +00:00
if ( player . ss . order > 0 ) req = new Decimal ( 45 )
2020-08-29 23:43:53 +00:00
break ;
2020-09-10 02:44:25 +00:00
case "l" :
2020-09-14 02:41:42 +00:00
if ( player . l . order > 0 ) req = new Decimal ( "1e345" )
2020-09-10 02:44:25 +00:00
break ;
case "hs" :
2020-09-14 19:26:10 +00:00
if ( player . hs . order > 0 ) req = new Decimal ( 910 )
2020-09-10 02:44:25 +00:00
break ;
2020-08-19 02:50:24 +00:00
}
return req
}
function getLayerGainMult ( layer ) {
let mult = new Decimal ( 1 )
switch ( layer ) {
case "p" :
if ( player . p . upgrades . includes ( 21 ) ) mult = mult . times ( 2 )
if ( player . p . upgrades . includes ( 23 ) ) mult = mult . times ( LAYER _UPGS . p [ 23 ] . currently ( ) )
2020-08-23 19:36:03 +00:00
if ( player . p . upgrades . includes ( 31 ) ) mult = mult . times ( LAYER _UPGS . p [ 31 ] . currently ( ) )
2020-08-19 02:50:24 +00:00
if ( player . b . upgrades . includes ( 11 ) ) mult = mult . times ( LAYER _UPGS . b [ 11 ] . currently ( ) )
if ( player . g . upgrades . includes ( 11 ) ) mult = mult . times ( LAYER _UPGS . g [ 11 ] . currently ( ) )
2020-08-21 19:02:34 +00:00
if ( player . e . unl ) mult = mult . times ( tmp . enhEff )
2020-09-14 02:41:42 +00:00
if ( player . e . upgrades . includes ( 12 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . e [ 12 ] . currently ( ) )
if ( player . e . upgrades . includes ( 13 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( 1e10 )
if ( player . e . upgrades . includes ( 34 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( 1e40 )
2020-08-21 19:02:34 +00:00
if ( player . t . unl ) mult = mult . times ( tmp . timeEff )
2020-09-12 02:03:58 +00:00
if ( player . s . unl && tmp . s !== undefined ) mult = mult . times ( tmp . s . sbEff [ 1 ] )
2020-08-26 03:32:27 +00:00
if ( player . q . upgrades . includes ( 11 ) ) mult = mult . times ( LAYER _UPGS . q [ 11 ] . currently ( ) )
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 62 ] : true ) mult = mult . times ( 0 )
2020-08-19 02:50:24 +00:00
break ;
case "b" :
if ( player . b . upgrades . includes ( 23 ) ) mult = mult . div ( LAYER _UPGS . b [ 23 ] . currently ( ) )
2020-09-12 02:03:58 +00:00
if ( player . s . unl && tmp . s !== undefined ) mult = mult . div ( tmp . s . sbEff [ 3 ] )
2020-08-19 02:50:24 +00:00
break ;
case "g" :
if ( player . g . upgrades . includes ( 22 ) ) mult = mult . div ( LAYER _UPGS . g [ 22 ] . currently ( ) )
2020-09-12 02:03:58 +00:00
if ( player . s . unl && tmp . s !== undefined ) mult = mult . div ( tmp . s . sbEff [ 3 ] )
2020-08-21 19:02:34 +00:00
break ;
case "e" :
2020-09-14 02:41:42 +00:00
if ( player . e . upgrades . includes ( 24 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . e [ 24 ] . currently ( ) )
2020-08-26 01:45:22 +00:00
if ( player . h . best . gte ( 1 ) ) mult = mult . times ( 100 )
if ( player . q . best . gte ( 1 ) ) mult = mult . times ( 100 )
2020-08-26 03:32:27 +00:00
if ( player . q . upgrades . includes ( 11 ) ) mult = mult . times ( LAYER _UPGS . q [ 11 ] . currently ( ) )
2020-08-19 02:50:24 +00:00
break ;
2020-08-26 20:40:54 +00:00
case "t" :
2020-09-14 02:41:42 +00:00
if ( player . h . challs . includes ( 21 ) ) mult = mult . div ( LAYER _CHALLS . h [ 21 ] . currently ( ) )
2020-08-26 20:40:54 +00:00
break ;
case "s" :
2020-09-14 02:41:42 +00:00
if ( player . h . challs . includes ( 21 ) ) mult = mult . div ( LAYER _CHALLS . h [ 21 ] . currently ( ) )
2020-08-26 20:40:54 +00:00
break ;
2020-08-30 01:39:01 +00:00
case "sb" :
2020-08-30 02:28:21 +00:00
if ( player . ss . upgrades . includes ( 14 ) ) mult = mult . div ( 1.0825 )
2020-09-11 02:15:05 +00:00
if ( player . l . unl && tmp . l !== undefined ) mult = mult . div ( tmp . l . lbEff [ 4 ] )
2020-08-30 01:39:01 +00:00
break ;
2020-09-09 22:47:26 +00:00
case "sg" :
if ( player . sp . upgrades . includes ( 31 ) ) mult = mult . div ( 1.45 )
2020-09-16 02:50:53 +00:00
if ( player . sp . upgrades . includes ( 25 ) ) mult = mult . div ( LAYER _UPGS . sp [ 25 ] . currently ( ) )
2020-09-11 02:15:05 +00:00
if ( player . l . unl && tmp . l !== undefined ) mult = mult . div ( tmp . l . lbEff [ 4 ] )
2020-09-09 22:47:26 +00:00
break ;
2020-09-12 02:03:58 +00:00
case "hb" :
if ( player . l . unl && tmp . l !== undefined ) mult = mult . div ( tmp . l . lbEff [ 4 ] )
break ;
2020-08-26 20:40:54 +00:00
case "h" :
2020-09-14 02:41:42 +00:00
if ( player . h . challs . includes ( 71 ) ) mult = mult . times ( LAYER _CHALLS . h [ 71 ] . currently ( ) )
2020-08-26 20:40:54 +00:00
if ( player . q . upgrades . includes ( 22 ) ) mult = mult . times ( LAYER _UPGS . q [ 22 ] . currently ( ) . h )
2020-08-29 16:43:58 +00:00
if ( player . q . upgrades . includes ( 34 ) ) mult = mult . times ( LAYER _UPGS . q [ 34 ] . currently ( ) )
2020-08-29 19:45:18 +00:00
if ( player . q . upgrades . includes ( 44 ) ) mult = mult . times ( LAYER _UPGS . q [ 44 ] . currently ( ) )
2020-09-03 21:59:23 +00:00
if ( player . ba . unl ) mult = mult . times ( tmp . balEff )
if ( player . m . unl ) mult = mult . times ( tmp . hexEff )
2020-08-26 20:40:54 +00:00
break ;
2020-08-26 19:08:00 +00:00
case "q" :
2020-09-14 02:41:42 +00:00
if ( player . h . challs . includes ( 12 ) ) mult = mult . times ( LAYER _CHALLS . h [ 12 ] . currently ( ) )
2020-08-26 20:40:54 +00:00
if ( player . q . upgrades . includes ( 22 ) ) mult = mult . times ( LAYER _UPGS . q [ 22 ] . currently ( ) . q )
2020-08-29 16:43:58 +00:00
if ( player . q . upgrades . includes ( 34 ) ) mult = mult . times ( LAYER _UPGS . q [ 34 ] . currently ( ) )
2020-09-03 21:59:23 +00:00
if ( player . ba . unl ) mult = mult . times ( tmp . balEff )
if ( player . m . unl ) mult = mult . times ( tmp . hexEff )
2020-08-26 19:08:00 +00:00
break ;
2020-09-09 02:10:25 +00:00
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 ;
2020-09-11 02:15:05 +00:00
case "ps" :
if ( player . ps . upgrades . includes ( 11 ) ) mult = mult . div ( LAYER _UPGS . ps [ 11 ] . currently ( ) )
2020-09-14 02:41:42 +00:00
if ( tmp . s !== undefined && tmp . s . trueSbUnl >= 7 ) mult = mult . div ( tmp . s . sbEff [ 7 ] )
2020-09-11 02:15:05 +00:00
break ;
2020-09-09 16:51:59 +00:00
case "sp" :
if ( player . sp . upgrades . includes ( 24 ) ) mult = mult . times ( LAYER _UPGS . sp [ 24 ] . currently ( ) )
2020-09-10 00:40:07 +00:00
if ( player . sp . upgrades . includes ( 33 ) ) mult = mult . times ( LAYER _UPGS . sp [ 33 ] . currently ( ) )
2020-09-09 16:51:59 +00:00
break ;
2020-09-11 02:15:05 +00:00
case "l" :
if ( player . sp . upgrades . includes ( 41 ) ) mult = mult . times ( LAYER _UPGS . sp [ 41 ] . currently ( ) )
break ;
case "hs" :
if ( player . sp . upgrades . includes ( 43 ) ) mult = mult . times ( LAYER _UPGS . sp [ 43 ] . currently ( ) )
2020-09-13 02:38:32 +00:00
if ( player . l . unl && tmp . l !== undefined && tmp . l . lbUnl >= 5 ) mult = mult . times ( tmp . l . lbEff [ 5 ] )
2020-09-11 02:15:05 +00:00
break ;
2020-08-19 02:50:24 +00:00
}
return mult
}
2020-09-13 02:38:32 +00:00
function getLayerGainExp ( layer ) {
2020-09-16 14:25:07 +00:00
let exp = new Decimal ( 1 )
let row = LAYER _ROW [ layer ] + 1
2020-09-14 02:46:26 +00:00
if ( LAYER _ROW [ layer ] < 5 ) exp = fixValue ( tmp . i && tmp . i . workEff , 1 ) . recip ( )
2020-09-16 14:25:07 +00:00
if ( IMPERIUM . collapsed ( row ) ) exp = exp . times ( Decimal . sub ( 1 , tmp . i . collapse [ row ] ) )
2020-08-26 20:40:54 +00:00
switch ( layer ) {
case "p" :
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 21 ] : true ) exp = exp . div ( 100 )
break ;
case "ps" :
if ( player . l . order > 0 ) exp = exp . div ( 2 )
2020-08-26 20:40:54 +00:00
break ;
2020-09-12 02:03:58 +00:00
case "l" :
if ( player . l . order > 0 ) exp = exp . div ( 2 )
break ;
2020-09-13 02:38:32 +00:00
case "hs" :
2020-09-14 02:41:42 +00:00
if ( player . hs . order > 0 ) exp = exp . div ( 2 )
2020-09-12 02:03:58 +00:00
break ;
2020-08-26 20:40:54 +00:00
}
return exp ;
}
2020-08-19 02:50:24 +00:00
function getResetGain ( layer ) {
2020-09-16 14:25:07 +00:00
if ( tmp . gainExp [ layer ] . eq ( 0 ) ) return new Decimal ( 0 )
2020-08-19 02:50:24 +00:00
if ( LAYER _TYPE [ layer ] == "static" ) {
2020-08-22 01:16:23 +00:00
if ( ( ! canBuyMax ( layer ) ) || tmp . layerAmt [ layer ] . lt ( tmp . layerReqs [ layer ] ) ) return new Decimal ( 1 )
2020-09-13 02:38:32 +00:00
let gain = tmp . layerAmt [ layer ] . div ( tmp . layerReqs [ layer ] ) . div ( tmp . gainMults [ layer ] ) . max ( 1 ) . log ( LAYER _BASE [ layer ] ) . times ( tmp . gainExp [ layer ] ) . pow ( Decimal . pow ( LAYER _EXP [ layer ] , - 1 ) )
if ( ( LAYER _ROW [ layer ] < 4 && layer != "hb" ) || layer == "ps" ) {
2020-09-12 14:26:57 +00:00
if ( gain . gte ( 12 ) ) {
2020-09-13 02:38:32 +00:00
if ( LAYER _ROW [ layer ] < 4 && fixValue ( tmp . scaling12b ) . gt ( 1 ) ) gain = gain . times ( tmp . scaling12b ) . add ( tmp . scaling12b . sub ( 1 ) . times ( 12 ) )
2020-09-12 14:26:57 +00:00
gain = gain . times ( 12 ) . sqrt ( )
}
if ( gain . gte ( 1225 ) ) gain = gain . times ( Decimal . pow ( 1225 , 9 ) ) . pow ( 0.1 )
}
2020-09-14 19:26:10 +00:00
return gain . floor ( ) . sub ( player [ layer ] . points ) . add ( 1 ) . max ( 1 ) ;
2020-09-13 02:38:32 +00:00
} else {
if ( tmp . layerAmt [ layer ] . lt ( tmp . layerReqs [ layer ] ) ) return new Decimal ( 0 )
let gain = tmp . layerAmt [ layer ] . div ( tmp . layerReqs [ layer ] ) . pow ( LAYER _EXP [ layer ] ) . times ( tmp . gainMults [ layer ] ) . pow ( tmp . gainExp [ layer ] )
if ( gain . gte ( "e1e7" ) ) gain = gain . sqrt ( ) . times ( "e5e6" )
return gain . floor ( ) . max ( 0 ) ;
2020-08-19 02:50:24 +00:00
}
}
function getNextAt ( layer ) {
2020-09-16 14:25:07 +00:00
if ( tmp . gainExp [ layer ] . eq ( 0 ) ) return new Decimal ( 1 / 0 )
2020-08-19 02:50:24 +00:00
if ( LAYER _TYPE [ layer ] == "static" ) {
let amt = player [ layer ] . points
2020-09-13 02:38:32 +00:00
if ( ( LAYER _ROW [ layer ] < 4 && layer != "hb" ) || layer == "ps" ) {
2020-09-12 14:26:57 +00:00
if ( amt . gte ( 1225 ) ) amt = amt . pow ( 10 ) . div ( Decimal . pow ( 1225 , 9 ) )
if ( amt . gte ( 12 ) ) {
amt = amt . pow ( 2 ) . div ( 12 )
2020-09-13 02:38:32 +00:00
if ( LAYER _ROW [ layer ] < 4 && fixValue ( tmp . scaling12b ) . gt ( 1 ) ) amt = amt . sub ( tmp . scaling12b . sub ( 1 ) . times ( 12 ) ) . div ( tmp . scaling12b )
2020-09-12 14:26:57 +00:00
}
}
2020-09-13 02:38:32 +00:00
let extraCost = Decimal . pow ( LAYER _BASE [ layer ] , amt . pow ( LAYER _EXP [ layer ] ) . div ( tmp . gainExp [ layer ] ) ) . times ( tmp . gainMults [ layer ] )
2020-08-25 22:42:43 +00:00
let cost = extraCost . times ( tmp . layerReqs [ layer ] ) . max ( tmp . layerReqs [ layer ] )
if ( LAYER _RES _CEIL . includes ( layer ) ) cost = cost . ceil ( )
return cost ;
} else {
2020-09-14 19:26:10 +00:00
let next = tmp . resetGain [ layer ] . add ( 1 )
2020-09-07 16:33:50 +00:00
if ( next . gte ( "e1e7" ) ) next = next . div ( "e5e6" ) . pow ( 2 )
2020-09-13 02:38:32 +00:00
next = next . root ( tmp . gainExp [ layer ] ) . div ( tmp . gainMults [ layer ] ) . root ( LAYER _EXP [ layer ] ) . times ( tmp . layerReqs [ layer ] ) . max ( tmp . layerReqs [ layer ] )
2020-08-25 22:42:43 +00:00
if ( LAYER _RES _CEIL . includes ( layer ) ) next = next . ceil ( )
return next ;
}
2020-08-19 02:50:24 +00:00
}
2020-09-11 02:15:05 +00:00
function nodeShown ( layer ) {
if ( layerShown ( layer ) ) return true
switch ( layer ) {
case "i" :
return player . l . unl
break ;
}
return false
}
function layerShown ( layer ) {
2020-08-19 02:50:24 +00:00
switch ( layer ) {
case "p" :
2020-09-11 14:21:08 +00:00
return true
break
2020-08-19 02:50:24 +00:00
case "b" :
2020-09-11 14:21:08 +00:00
return player . p . unl
break
2020-08-19 02:50:24 +00:00
case "g" :
2020-09-11 14:21:08 +00:00
return player . p . unl
break
2020-08-19 02:50:24 +00:00
case "e" :
2020-09-11 14:21:08 +00:00
return player . b . unl && player . g . unl
break
2020-08-19 02:50:24 +00:00
case "t" :
2020-09-11 14:21:08 +00:00
return player . b . unl
break
2020-08-19 02:50:24 +00:00
case "s" :
2020-09-11 14:21:08 +00:00
return player . g . unl
break
2020-08-22 01:16:23 +00:00
case "sb" :
2020-09-11 14:21:08 +00:00
return player . e . unl && player . t . unl && player . s . unl
break
2020-09-04 17:45:22 +00:00
case "sg" :
2020-09-11 14:21:08 +00:00
return player . h . challs . includes ( 62 )
break
2020-08-26 01:45:22 +00:00
case "h" :
2020-09-11 14:21:08 +00:00
return player . t . unl && player . sb . unl
break
2020-08-26 01:45:22 +00:00
case "q" :
2020-09-11 14:21:08 +00:00
return player . e . unl && player . sb . unl
break
2020-08-29 23:43:53 +00:00
case "hb" :
2020-09-11 14:21:08 +00:00
return player . sb . unl && player . h . unl && player . q . unl
break
2020-08-29 23:43:53 +00:00
case "ss" :
2020-09-11 14:21:08 +00:00
return player . s . unl && player . h . unl && player . q . unl
break
2020-09-09 15:20:39 +00:00
case "hg" :
2020-09-11 14:21:08 +00:00
return false
break
2020-09-03 21:59:23 +00:00
case "m" :
2020-09-11 14:21:08 +00:00
return player . h . unl && player . hb . unl
break
2020-09-03 21:59:23 +00:00
case "ba" :
2020-09-11 14:21:08 +00:00
return player . q . unl && player . ss . unl
break
2020-09-09 02:10:25 +00:00
case "sp" :
2020-09-11 14:21:08 +00:00
return player . m . unl && player . ba . unl
break
2020-09-07 02:33:31 +00:00
case "l" :
2020-09-10 02:44:25 +00:00
return player . sp . unl
2020-09-11 14:21:08 +00:00
break
2020-09-07 02:33:31 +00:00
case "ps" :
2020-09-11 02:15:05 +00:00
return player . l . unl
2020-09-11 14:21:08 +00:00
break
2020-09-07 02:33:31 +00:00
case "hs" :
2020-09-10 02:44:25 +00:00
return player . sp . unl
2020-09-11 14:21:08 +00:00
break
2020-09-07 02:33:31 +00:00
case "i" :
2020-09-11 02:15:05 +00:00
return player . ps . unl && player . hs . unl
2020-09-11 14:21:08 +00:00
break
2020-09-14 19:26:10 +00:00
/ *
2020-09-10 02:44:25 +00:00
case "mb" :
2020-09-14 19:26:10 +00:00
return player . i . unl
2020-09-11 14:21:08 +00:00
break
2020-09-10 02:44:25 +00:00
case "ge" :
2020-09-14 19:26:10 +00:00
return player . i . unl
2020-09-11 14:21:08 +00:00
break
2020-09-10 02:44:25 +00:00
case "ma" :
2020-09-14 19:26:10 +00:00
return player . i . unl
2020-09-11 14:21:08 +00:00
break
2020-09-14 19:26:10 +00:00
* /
2020-08-19 02:50:24 +00:00
}
2020-09-14 19:26:10 +00:00
return
2020-08-19 02:50:24 +00:00
}
2020-09-11 02:15:05 +00:00
function layerUnl ( layer ) {
2020-09-14 19:26:10 +00:00
return LAYERS . includes ( layer ) && ( player [ layer ] . unl || ( tmp . layerAmt [ layer ] . gte ( tmp . layerReqs [ layer ] ) && layerShown ( layer ) ) )
2020-09-11 02:15:05 +00:00
}
2020-08-19 02:50:24 +00:00
function rowReset ( row , layer ) {
switch ( row ) {
case 0 :
player . points = new Decimal ( 0 ) ;
break ;
case 1 :
2020-09-12 14:26:57 +00:00
var keepUpgrades = 0
if ( player . h . best . gte ( 1 ) || player . q . best . gte ( 1 ) ) keepUpgrades = 1
2020-09-12 14:51:34 +00:00
else if ( LAYER _ROW [ layer ] == 2 && player [ layer ] . best . gte ( layer == "e" ? 10 : 3 ) ) keepUpgrades = 1
else if ( LAYER _ROW [ layer ] == 1 && player [ layer ] . best . gte ( 8 ) ) keepUpgrades = 1
2020-09-12 14:26:57 +00:00
player . points = new Decimal ( 10 )
player . p . points = new Decimal ( 0 )
if ( ! keepUpgrades ) player . p . upgrades = [ ]
player . g . power = new Decimal ( 0 )
2020-08-19 02:50:24 +00:00
break ;
case 2 :
2020-09-11 14:21:08 +00:00
var keepMilestones = 0
2020-09-12 14:26:57 +00:00
if ( player . h . best . gte ( 2 ) || player . q . best . gte ( 2 ) ) keepMilestones = 1
2020-09-12 14:56:41 +00:00
else if ( LAYER _ROW [ layer ] == 2 && player [ layer ] . best . gte ( layer == "sb" ? 4 : 2 ) ) keepMilestones = 1
2020-09-11 14:21:08 +00:00
var keepUpgrades = 0
if ( player . sp . total . gte ( 1 ) ) keepUpgrades = 1
player . b . points = new Decimal ( 0 )
if ( ! keepMilestones ) player . b . best = new Decimal ( 0 )
if ( ! keepUpgrades && ! player . t . best . gte ( 4 ) ) player . b . upgrades = [ ]
player . g . points = new Decimal ( 0 )
player . g . power = new Decimal ( 0 )
if ( ! keepMilestones ) player . g . best = new Decimal ( 0 )
if ( ! keepUpgrades && ! player . s . best . gte ( 4 ) ) player . g . upgrades = [ ]
player . t . energy = new Decimal ( 0 )
break
2020-08-19 02:50:24 +00:00
case 3 :
player . t . points = new Decimal ( 0 ) ;
player . t . order = 0
2020-09-10 13:18:18 +00:00
if ( player . h . best . lt ( 2 ) && player . m . total . lt ( 1 ) ) player . t . best = new Decimal ( 0 ) ;
2020-09-09 02:10:25 +00:00
if ( player . h . best . lt ( 4 ) && ! player . sp . total . gte ( 1 ) ) player . t . upgrades = [ ] ;
2020-08-19 02:50:24 +00:00
player . t . extCapsules = new Decimal ( 0 ) ;
player . e . order = 0
player . e . points = new Decimal ( 0 ) ;
2020-09-10 13:18:18 +00:00
if ( player . h . best . lt ( 2 ) && player . m . total . lt ( 1 ) ) player . e . best = new Decimal ( 0 ) ;
2020-08-19 02:50:24 +00:00
player . e . enhancers = new Decimal ( 0 ) ;
2020-09-09 02:10:25 +00:00
if ( player . h . best . lt ( 4 ) && ! player . sp . total . gte ( 1 ) ) player . e . upgrades = [ ] ;
2020-08-19 02:50:24 +00:00
player . s = {
unl : player . s . unl ,
order : 0 ,
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : ( player . h . best . gte ( 2 ) || player . m . total . gte ( 1 ) ) ? player . s . best : new Decimal ( 0 ) ,
2020-09-03 21:59:23 +00:00
spent : ( player . q . best . gte ( 4 ) && ( layer == "h" || layer == "q" || layer == "ss" || layer == "hb" ) ) ? player . s . spent : new Decimal ( 0 ) ,
2020-09-10 02:44:25 +00:00
buildings : ( player . q . best . gte ( 4 ) && ( layer == "h" || layer == "q" || layer == "ss" || layer == "hb" ) ) ? player . s . buildings : ( { } ) ,
2020-09-09 02:10:25 +00:00
upgrades : ( player . h . best . gte ( 4 ) || player . sp . total . gte ( 1 ) ) ? player . s . upgrades : [ ] ,
2020-08-26 14:16:23 +00:00
auto : player . s . auto ,
2020-08-30 01:39:01 +00:00
autoBuild : player . s . autoBuild ,
2020-08-19 02:50:24 +00:00
}
2020-08-22 01:16:23 +00:00
player . sb = {
unl : player . sb . unl ,
2020-08-26 14:16:23 +00:00
auto : player . sb . auto ,
2020-08-22 01:16:23 +00:00
order : 0 ,
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : ( player . h . best . gte ( 2 ) || player . m . total . gte ( 1 ) ) ? player . sb . best : new Decimal ( 0 ) ,
2020-09-09 02:10:25 +00:00
upgrades : ( player . h . best . gte ( 10 ) || player . sp . total . gte ( 1 ) ) ? player . sb . upgrades : [ ] ,
2020-08-22 01:16:23 +00:00
}
2020-09-04 17:45:22 +00:00
player . sg = {
unl : player . sg . unl ,
auto : player . sg . auto ,
points : new Decimal ( 0 ) ,
best : player . sg . best ,
power : new Decimal ( 0 ) ,
upgrades : player . sg . upgrades ,
}
2020-08-29 19:45:18 +00:00
player . h . time = 0
2020-08-26 01:45:22 +00:00
player . q . time = new Decimal ( 0 ) ;
player . q . energy = new Decimal ( 0 ) ;
break ;
case 4 :
2020-09-03 21:59:23 +00:00
player . h = {
unl : player . h . unl ,
time : 0 ,
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : ( player . ba . best . gte ( 1 ) || player . m . total . gte ( 1 ) ) ? player . h . best : new Decimal ( 0 ) ,
challs : ( player . m . total . gte ( 2 ) || player . sp . total . gte ( 1 ) ) ? player . h . challs : [ ] ,
2020-09-03 21:59:23 +00:00
}
player . q = {
unl : player . q . unl ,
2020-09-04 02:25:24 +00:00
auto : player . q . auto ,
2020-09-03 21:59:23 +00:00
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : ( player . ba . best . gte ( 1 ) || player . m . total . gte ( 1 ) ) ? player . q . best : new Decimal ( 0 ) ,
2020-09-03 21:59:23 +00:00
layers : new Decimal ( 0 ) ,
energy : new Decimal ( 0 ) ,
time : new Decimal ( 0 ) ,
2020-09-09 02:10:25 +00:00
upgrades : ( player . ba . best . gte ( 2 ) || player . sp . total . gte ( 1 ) ) ? player . q . upgrades : [ ] ,
2020-09-03 21:59:23 +00:00
}
player . hb = {
unl : player . hb . unl ,
2020-09-04 02:25:24 +00:00
auto : player . hb . auto ,
2020-09-03 21:59:23 +00:00
order : player . hb . order ,
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : ( player . ba . best . gte ( 1 ) || player . m . total . gte ( 1 ) ) ? player . hb . best : new Decimal ( 0 ) ,
2020-09-09 02:10:25 +00:00
upgrades : ( player . ba . best . gte ( 5 ) || player . sp . total . gte ( 1 ) ) ? player . hb . upgrades : [ ] ,
2020-09-03 21:59:23 +00:00
}
player . ss = {
unl : player . ss . unl ,
2020-09-04 02:25:24 +00:00
auto : player . ss . auto ,
2020-09-03 21:59:23 +00:00
order : player . ss . order ,
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : ( player . ba . best . gte ( 1 ) || player . m . total . gte ( 1 ) ) ? player . ss . best : new Decimal ( 0 ) ,
2020-09-03 21:59:23 +00:00
subspace : new Decimal ( 0 ) ,
2020-09-09 02:10:25 +00:00
upgrades : ( player . ba . best . gte ( 5 ) || player . sp . total . gte ( 1 ) ) ? player . ss . upgrades : [ ] ,
2020-09-03 21:59:23 +00:00
}
break ;
case 5 :
2020-09-09 02:10:25 +00:00
player . m = {
unl : player . m . unl ,
auto : player . m . auto ,
autoIns : player . m . autoIns ,
points : new Decimal ( 0 ) ,
2020-09-10 13:18:18 +00:00
best : new Decimal ( 0 ) ,
total : player . sp . total . gte ( 2 ) ? player . m . total : new Decimal ( 0 ) ,
2020-09-09 02:10:25 +00:00
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 : [ ] ,
}
2020-09-11 02:15:05 +00:00
player . ps = {
unl : player . ps . unl ,
auto : player . ps . auto ,
points : new Decimal ( 0 ) ,
best : player . ps . best ,
upgrades : player . ps . upgrades ,
}
player . l . power = new Decimal ( 0 )
2020-09-09 02:10:25 +00:00
break ;
2020-09-11 02:15:05 +00:00
case 6 :
var start = getStartPlayer ( )
2020-09-09 02:10:25 +00:00
player . sp = start . sp
2020-09-10 02:44:25 +00:00
player . l = start . l
player . hs = start . hs
2020-09-11 02:15:05 +00:00
player . i = start . i
2020-08-19 02:50:24 +00:00
break ;
}
}
2020-09-09 22:14:05 +00:00
function addPoints ( layer , gain ) {
2020-09-14 19:26:10 +00:00
player [ layer ] . points = player [ layer ] . points . add ( gain ) . max ( 0 )
2020-09-09 22:14:05 +00:00
player [ layer ] . best = player [ layer ] . best . max ( player [ layer ] . points )
2020-09-14 19:26:10 +00:00
if ( player [ layer ] . total ) player [ layer ] . total = player [ layer ] . total . add ( gain )
2020-09-09 22:14:05 +00:00
}
function generatePoints ( layer , diff ) {
addPoints ( layer , tmp . resetGain [ layer ] . times ( diff ) )
}
2020-09-11 02:15:05 +00:00
var prevOnReset
2020-08-19 02:50:24 +00:00
function doReset ( layer , force = false ) {
if ( ! force ) {
2020-08-22 01:16:23 +00:00
if ( tmp . layerAmt [ layer ] . lt ( tmp . layerReqs [ layer ] ) ) return ;
2020-08-21 19:02:34 +00:00
let gain = tmp . resetGain [ layer ]
2020-08-19 02:50:24 +00:00
if ( LAYER _TYPE [ layer ] == "static" ) {
2020-08-22 01:16:23 +00:00
if ( tmp . layerAmt [ layer ] . lt ( tmp . nextAt [ layer ] ) ) return ;
2020-09-11 14:21:08 +00:00
addPoints ( layer , canBuyMax ( layer ) ? gain : 1 )
2020-09-09 22:14:05 +00:00
} else addPoints ( layer , gain )
2020-09-11 14:21:08 +00:00
2020-08-19 02:50:24 +00:00
if ( ! player [ layer ] . unl ) {
player [ layer ] . unl = true ;
needCanvasUpdate = true ;
2020-09-11 14:21:08 +00:00
2020-08-19 02:50:24 +00:00
let layers = ROW _LAYERS [ LAYER _ROW [ layer ] ]
2020-08-31 02:35:50 +00:00
for ( let i in layers ) if ( ! player [ layers [ i ] ] . unl && player [ layers [ i ] ] !== undefined ) player [ layers [ i ] ] . order += ORDER _UP [ LAYER _ROW [ layer ] ] . includes ( layer ) ? 1 : 0
2020-08-19 02:50:24 +00:00
}
2020-09-11 14:21:08 +00:00
2020-08-22 03:59:24 +00:00
tmp . layerAmt [ layer ] = new Decimal ( 0 ) // quick fix
2020-08-19 02:50:24 +00:00
}
2020-09-09 22:14:05 +00:00
2020-08-21 03:33:13 +00:00
if ( ( layer == "b" && player . t . best . gte ( 12 ) ) || ( layer == "g" && player . s . best . gte ( 12 ) ) ) return ;
2020-09-04 17:45:22 +00:00
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 ;
2020-09-04 02:25:24 +00:00
if ( ( layer == "hb" && player . ba . best . gte ( 8 ) ) || ( layer == "ss" && player . ba . best . gte ( 8 ) ) ) return ;
2020-09-12 02:03:58 +00:00
if ( layer == "ps" && player . ps . best . gte ( 5 ) ) return ;
2020-08-19 02:50:24 +00:00
let row = LAYER _ROW [ layer ]
2020-09-14 02:41:42 +00:00
var layersWithChalls = Object . keys ( LAYER _CHALLS )
for ( let y = 0 ; y < layersWithChalls . length ; y ++ ) {
var layerResetting = layersWithChalls [ y ]
if ( row >= LAYER _ROW [ layerResetting ] && ( ! force || layerResetting != layer ) ) completeChall ( layerResetting )
}
2020-09-11 02:15:05 +00:00
prevOnReset = { ... player } //Deep Copy
2020-09-14 02:41:42 +00:00
if ( row == 0 ) rowReset ( 0 , layer )
else for ( let x = row ; x >= 1 ; x -- ) rowReset ( x , layer )
2020-09-11 02:15:05 +00:00
prevOnReset = undefined
2020-08-26 19:08:00 +00:00
updateTemp ( )
2020-09-09 02:10:25 +00:00
updateTemp ( )
2020-08-19 02:50:24 +00:00
}
function buyUpg ( layer , id ) {
if ( ! player [ layer ] . unl ) return
if ( ! LAYER _UPGS [ layer ] [ id ] . unl ( ) ) return
if ( player [ layer ] . upgrades . includes ( id ) ) return
if ( player [ layer ] . points . lt ( LAYER _UPGS [ layer ] [ id ] . cost ) ) return
player [ layer ] . points = player [ layer ] . points . sub ( LAYER _UPGS [ layer ] [ id ] . cost )
player [ layer ] . upgrades . push ( id ) ;
2020-08-21 03:33:13 +00:00
if ( layer == "t" && id == 32 ) player . t . order = 0 ;
if ( layer == "e" && ( id == 22 || id == 23 ) ) {
player . e . order = 0 ;
if ( ! player . e . upgrades . includes ( 22 ) ) player . e . upgrades . push ( 22 )
if ( ! player . e . upgrades . includes ( 23 ) ) player . e . upgrades . push ( 23 )
}
if ( layer == "s" && id == 33 ) player . s . order = 0 ;
2020-08-30 02:28:21 +00:00
if ( layer == "hb" && id == 13 ) player . hb . order = 0 ;
if ( layer == "ss" && id == 15 ) player . ss . order = 0 ;
2020-09-08 00:11:57 +00:00
if ( layer == "m" && id == 43 ) for ( let i = 1 ; i <= 3 ; i ++ ) player . m . spellTimes [ i ] *= LAYER _UPGS . m [ 43 ] . currently ( ) . toNumber ( )
2020-09-12 02:03:58 +00:00
if ( layer == "ps" && id == 14 ) player . l . order = 0 ;
if ( layer == "ps" && id == 24 ) player . hs . order = 0 ;
2020-08-19 02:50:24 +00:00
}
function getPointGen ( ) {
let gain = new Decimal ( 1 )
if ( player . p . upgrades . includes ( 12 ) ) gain = gain . times ( LAYER _UPGS . p [ 12 ] . currently ( ) )
if ( player . p . upgrades . includes ( 13 ) ) gain = gain . times ( LAYER _UPGS . p [ 13 ] . currently ( ) )
if ( player . p . upgrades . includes ( 22 ) ) gain = gain . times ( LAYER _UPGS . p [ 22 ] . currently ( ) )
2020-08-21 19:02:34 +00:00
if ( player . b . unl ) gain = gain . times ( tmp . layerEffs . b )
if ( player . g . unl ) gain = gain . times ( tmp . genPowEff )
if ( player . t . unl ) gain = gain . times ( tmp . timeEff )
2020-09-12 02:03:58 +00:00
if ( player . s . unl && tmp . s !== undefined ) gain = gain . times ( tmp . s . sbEff [ 1 ] )
2020-08-26 01:45:22 +00:00
if ( player . q . unl && tmp . quirkEff ) gain = gain . times ( tmp . quirkEff )
2020-08-26 03:32:27 +00:00
if ( player . q . upgrades . includes ( 11 ) ) gain = gain . times ( LAYER _UPGS . q [ 11 ] . currently ( ) )
2020-08-27 15:38:26 +00:00
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 31 ] : true ) gain = gain . tetrate ( 0.1 )
2020-08-19 02:50:24 +00:00
return gain
}
2020-09-12 14:26:57 +00:00
function getScaling12Boosters ( ) {
let x = new Decimal ( 1 )
if ( player . ps . upgrades . includes ( 22 ) ) x = x . times ( LAYER _UPGS . ps [ 22 ] . currently ( ) )
return x
}
2020-08-19 02:50:24 +00:00
function addToBoosterBase ( ) {
let toAdd = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . b . upgrades . includes ( 12 ) ) toAdd = toAdd . add ( LAYER _UPGS . b [ 12 ] . currently ( ) )
if ( player . b . upgrades . includes ( 13 ) ) toAdd = toAdd . add ( LAYER _UPGS . b [ 13 ] . currently ( ) )
if ( player . t . upgrades . includes ( 11 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) toAdd = toAdd . add ( LAYER _UPGS . t [ 11 ] . currently ( ) )
if ( player . t . upgrades . includes ( 31 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) toAdd = toAdd . add ( 25 )
if ( player . t . upgrades . includes ( 33 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) toAdd = toAdd . add ( 40 )
if ( player . e . unl ) toAdd = toAdd . add ( tmp . enhEff2 )
if ( player . e . upgrades . includes ( 11 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) toAdd = toAdd . add ( LAYER _UPGS . e [ 11 ] . currently ( ) . b )
if ( player . s . unl && tmp . s !== undefined ) toAdd = toAdd . add ( tmp . s . sbEff [ 2 ] )
if ( player . sb . upgrades . includes ( 21 ) ) toAdd = toAdd . add ( LAYER _UPGS . sb [ 21 ] . currently ( ) )
2020-08-30 16:18:34 +00:00
if ( player . b . upgrades . includes ( 31 ) ) toAdd = toAdd . times ( LAYER _UPGS . b [ 31 ] . currently ( ) )
2020-09-08 20:47:32 +00:00
if ( player . q . upgrades . includes ( 53 ) ) toAdd = toAdd . times ( tmp . enhEff2 )
2020-08-23 19:36:03 +00:00
if ( player . sb . unl ) toAdd = toAdd . times ( tmp . layerEffs . sb )
2020-08-19 02:50:24 +00:00
return toAdd
}
2020-08-20 04:55:26 +00:00
function getFreeBoosters ( ) {
let free = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . t . upgrades . includes ( 24 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) free = free . add ( 18 )
if ( player . b . upgrades . includes ( 32 ) ) free = free . add ( LAYER _UPGS . b [ 32 ] . currently ( ) )
if ( player . b . upgrades . includes ( 33 ) ) free = free . add ( 100 )
2020-08-20 04:55:26 +00:00
return free
}
2020-09-03 21:59:23 +00:00
function getBoosterPower ( ) {
let power = new Decimal ( 1 )
if ( spellActive ( 1 ) ) power = power . times ( tmp . spellEffs [ 1 ] )
2020-09-10 00:40:07 +00:00
if ( player . sp . upgrades . includes ( 34 ) ) power = power . times ( 1.25 )
2020-09-03 21:59:23 +00:00
return power
}
2020-08-19 02:50:24 +00:00
function addToGenBase ( ) {
let toAdd = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . g . upgrades . includes ( 12 ) ) toAdd = toAdd . add ( LAYER _UPGS . g [ 12 ] . currently ( ) )
if ( player . g . upgrades . includes ( 13 ) ) toAdd = toAdd . add ( LAYER _UPGS . g [ 13 ] . currently ( ) )
if ( player . g . upgrades . includes ( 33 ) ) toAdd = toAdd . add ( LAYER _UPGS . g [ 33 ] . currently ( ) )
if ( player . e . unl ) toAdd = toAdd . add ( tmp . enhEff2 )
if ( player . e . upgrades . includes ( 11 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) toAdd = toAdd . add ( LAYER _UPGS . e [ 11 ] . currently ( ) . g )
if ( player . s . unl && tmp . s !== undefined ) toAdd = toAdd . add ( tmp . s . sbEff [ 2 ] )
2020-09-08 20:47:32 +00:00
2020-09-14 02:41:42 +00:00
if ( player . h . challs . includes ( 51 ) ) toAdd = toAdd . times ( LAYER _CHALLS . h [ 51 ] . currently ( ) )
2020-09-08 20:47:32 +00:00
if ( player . q . upgrades . includes ( 53 ) ) toAdd = toAdd . times ( tmp . enhEff2 )
2020-08-19 02:50:24 +00:00
return toAdd
}
2020-09-01 00:39:33 +00:00
function getGenPow ( ) {
let pow = new Decimal ( 1 )
if ( player . g . upgrades . includes ( 34 ) ) pow = pow . times ( LAYER _UPGS . g [ 34 ] . currently ( ) )
2020-09-10 00:40:07 +00:00
if ( player . sp . upgrades . includes ( 34 ) ) pow = pow . times ( 1.25 )
2020-09-01 00:39:33 +00:00
return pow
}
2020-08-19 02:50:24 +00:00
function getGenPowerGainMult ( ) {
let mult = new Decimal ( 1 )
if ( player . g . upgrades . includes ( 21 ) ) mult = mult . times ( LAYER _UPGS . g [ 21 ] . currently ( ) )
if ( player . g . upgrades . includes ( 25 ) ) mult = mult . times ( LAYER _UPGS . g [ 25 ] . currently ( ) )
2020-09-14 02:41:42 +00:00
if ( player . e . upgrades . includes ( 35 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . e [ 35 ] . currently ( ) )
if ( player . s . upgrades . includes ( 12 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . s [ 12 ] . currently ( ) )
if ( player . s . upgrades . includes ( 13 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . s [ 13 ] . currently ( ) )
2020-08-26 01:45:22 +00:00
if ( player . q . unl && tmp . quirkEff ) mult = mult . times ( tmp . quirkEff )
2020-09-01 00:39:33 +00:00
if ( player . g . upgrades . includes ( 35 ) ) mult = mult . times ( LAYER _UPGS . g [ 35 ] . currently ( ) )
2020-08-19 02:50:24 +00:00
return mult
}
2020-08-21 03:33:13 +00:00
function getGenPowerEffExp ( ) {
let exp = new Decimal ( 1 / 3 )
2020-09-14 19:26:10 +00:00
if ( player . s . upgrades . includes ( 34 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) exp = exp . add ( LAYER _UPGS . s [ 34 ] . currently ( ) )
2020-08-21 03:33:13 +00:00
if ( player . b . upgrades . includes ( 21 ) ) exp = exp . times ( 2 )
if ( player . b . upgrades . includes ( 22 ) ) exp = exp . times ( 1.2 )
2020-09-14 02:41:42 +00:00
if ( player . e . upgrades . includes ( 21 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) exp = exp . times ( 1.15 )
2020-08-26 16:26:46 +00:00
if ( player . h . challs . includes ( 11 ) ) exp = exp . times ( 1.25 )
2020-08-29 19:45:18 +00:00
if ( player . h . challs . includes ( 42 ) ) exp = exp . times ( 3 )
2020-08-21 03:33:13 +00:00
return exp ;
}
2020-08-19 02:50:24 +00:00
function getGenPowerEff ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 11 ] : true ) return new Decimal ( 1 )
2020-09-14 19:26:10 +00:00
let eff = player . g . power . add ( 1 ) . pow ( getGenPowerEffExp ( ) ) ;
2020-08-19 02:50:24 +00:00
return eff
}
function resetRow ( row ) {
if ( prompt ( 'Are you sure you want to reset this row? It is highly recommended that you wait until the end of your current run before doing this! Type "I WANT TO RESET THIS" to confirm' ) != "I WANT TO RESET THIS" ) return
let pre _layers = ROW _LAYERS [ row - 1 ]
let layers = ROW _LAYERS [ row ]
let post _layers = ROW _LAYERS [ row + 1 ]
rowReset ( row + 1 , post _layers [ 0 ] )
doReset ( pre _layers [ 0 ] , true )
for ( let layer in layers ) {
player [ layers [ layer ] ] . unl = false
2020-08-21 03:33:13 +00:00
if ( player [ layers [ layer ] ] . order ) player [ layers [ layer ] ] . order = 0
2020-08-19 02:50:24 +00:00
}
2020-08-21 19:02:34 +00:00
updateTemp ( ) ;
2020-08-19 02:50:24 +00:00
resizeCanvas ( ) ;
}
2020-08-21 19:02:34 +00:00
function getEnhancerPow ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 22 ] : true ) return new Decimal ( 0 ) ;
if ( tmp . challActive ? tmp . challActive . h [ 41 ] : true ) return new Decimal ( 0 ) ;
2020-08-21 19:02:34 +00:00
let pow = new Decimal ( 1 )
2020-09-14 02:41:42 +00:00
if ( player . e . upgrades . includes ( 25 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . e [ 25 ] . currently ( ) )
if ( player . e . upgrades . includes ( 31 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . e [ 31 ] . currently ( ) )
2020-08-27 15:38:26 +00:00
if ( player . h . challs . includes ( 31 ) ) pow = pow . times ( 2 )
2020-08-29 18:00:32 +00:00
if ( player . q . upgrades . includes ( 42 ) ) pow = pow . times ( 1.4 )
2020-09-05 17:11:53 +00:00
if ( player . ba . upgrades . includes ( 32 ) ) pow = pow . times ( LAYER _UPGS . ba [ 32 ] . currently ( ) )
2020-08-21 19:02:34 +00:00
return pow
}
2020-08-19 02:50:24 +00:00
function getEnhancerEff ( ) {
if ( ! player . e . unl ) return new Decimal ( 1 )
2020-08-31 18:33:29 +00:00
let e = player . e . enhancers . sub ( tmp . subbedEnh ) . times ( tmp . enhPow )
let eff ;
if ( e . gte ( 0 ) ) eff = Decimal . pow ( 25 , e . pow ( 1.1 ) )
else eff = Decimal . pow ( 1 / 25 , e . times ( - 1 ) . pow ( 1.1 ) )
2020-08-19 02:50:24 +00:00
return eff
}
function getEnhancerEff2 ( ) {
if ( ! player . e . unl ) return new Decimal ( 0 )
2020-08-31 18:33:29 +00:00
let e = player . e . enhancers . sub ( tmp . subbedEnh ) . times ( tmp . enhPow )
let eff ;
if ( e . gte ( 0 ) ) eff = e . pow ( 0.8 )
else eff = e . times ( - 1 ) . pow ( 0.8 ) . times ( - 1 )
2020-08-19 02:50:24 +00:00
return eff ;
}
2020-08-26 03:32:27 +00:00
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 ( )
}
2020-08-19 02:50:24 +00:00
function buyEnhancer ( ) {
let cost = getEnhancerCost ( )
if ( player . e . points . lt ( cost ) ) return
player . e . points = player . e . points . sub ( cost )
2020-09-14 19:26:10 +00:00
player . e . enhancers = player . e . enhancers . add ( 1 )
2020-08-19 02:50:24 +00:00
}
2020-08-26 03:32:27 +00:00
function maxEnhancers ( ) {
let target = player . e . points . max ( 1 ) . log ( 2 ) . root ( 1.5 )
if ( target . gte ( 25 ) ) target = target . times ( 25 ) . sqrt ( )
2020-09-14 19:26:10 +00:00
target = target . add ( 1 ) . floor ( )
2020-08-26 03:32:27 +00:00
if ( target . lte ( player . e . enhancers ) ) return
player . e . enhancers = player . e . enhancers . max ( target )
}
2020-08-19 19:53:14 +00:00
function getFreeExtCapsules ( ) {
let amt = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . t . upgrades . includes ( 12 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) amt = amt . add ( 1 )
if ( player . h . unl ) amt = amt . add ( tmp . layerEffs . h )
2020-08-19 19:53:14 +00:00
return amt
}
2020-08-27 19:12:20 +00:00
function getCapPow ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 41 ] : true ) return new Decimal ( 0 )
2020-08-27 19:12:20 +00:00
let pow = new Decimal ( 1 )
if ( player . q . upgrades . includes ( 33 ) ) pow = pow . times ( LAYER _UPGS . q [ 33 ] . currently ( ) )
2020-09-03 21:59:23 +00:00
if ( spellActive ( 2 ) ) pow = pow . times ( tmp . spellEffs [ 2 ] )
2020-08-27 19:12:20 +00:00
return pow
}
2020-08-26 22:42:19 +00:00
function getFreeExtPow ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 22 ] : true ) return new Decimal ( 0 )
2020-08-26 22:42:19 +00:00
let pow = new Decimal ( 1 )
return pow
}
2020-08-19 02:50:24 +00:00
function getTimeEnergyEff ( ) {
if ( ! player . t . unl ) return new Decimal ( 1 )
2020-08-19 22:12:31 +00:00
let exp = 1.2
2020-09-14 02:41:42 +00:00
if ( player . t . upgrades . includes ( 21 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) exp = 1.75
2020-09-14 19:26:10 +00:00
let eff = player . t . energy . add ( 1 ) . pow ( exp )
2020-08-19 02:50:24 +00:00
return eff ;
}
2020-08-19 22:12:31 +00:00
function getTimeEnergyGainMult ( ) {
if ( ! player . t . unl ) return new Decimal ( 1 )
let mult = new Decimal ( 1 ) ;
2020-09-14 02:41:42 +00:00
if ( player . t . upgrades . includes ( 21 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 21 ] . currently ( ) )
if ( player . t . upgrades . includes ( 22 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 22 ] . currently ( ) )
if ( player . t . upgrades . includes ( 23 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 23 ] . currently ( ) )
if ( player . t . upgrades . includes ( 34 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 34 ] . currently ( ) )
2020-08-19 22:12:31 +00:00
return mult ;
}
2020-08-19 19:53:14 +00:00
function getTimeEnergyLimitMult ( ) {
if ( ! player . t . unl ) return new Decimal ( 1 )
let mult = new Decimal ( 1 ) ;
2020-09-14 02:41:42 +00:00
if ( player . t . upgrades . includes ( 12 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 12 ] . currently ( ) )
if ( player . t . upgrades . includes ( 21 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 21 ] . currently ( ) )
if ( player . t . upgrades . includes ( 22 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 22 ] . currently ( ) )
if ( player . t . upgrades . includes ( 23 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 23 ] . currently ( ) )
if ( player . t . upgrades . includes ( 34 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mult = mult . times ( LAYER _UPGS . t [ 34 ] . currently ( ) )
2020-08-26 22:42:19 +00:00
if ( player . q . upgrades . includes ( 23 ) ) mult = mult . times ( 1e10 )
2020-08-29 16:43:58 +00:00
if ( player . q . upgrades . includes ( 24 ) ) mult = mult . times ( LAYER _UPGS . q [ 24 ] . currently ( ) )
2020-09-04 23:09:10 +00:00
if ( player . m . upgrades . includes ( 23 ) ) mult = mult . times ( "1e500" )
2020-08-19 19:53:14 +00:00
return mult ;
}
2020-08-19 02:50:24 +00:00
function getExtCapsuleCost ( ) {
2020-08-21 03:33:13 +00:00
let amt = player . t . extCapsules
2020-09-07 16:33:50 +00:00
if ( amt . gte ( 25 ) && ! player . ba . upgrades . includes ( 43 ) ) amt = amt . pow ( 2 ) . div ( 25 )
2020-09-14 19:26:10 +00:00
let cost = amt . times ( 0.4 ) . pow ( 1.2 ) . add ( 1 ) . times ( 10 )
2020-08-19 02:50:24 +00:00
return cost . floor ( )
}
function buyExtCapsule ( ) {
if ( ! player . t . unl ) return
let cost = getExtCapsuleCost ( )
if ( player . b . points . lt ( cost ) ) return
player . b . points = player . b . points . sub ( cost )
2020-09-14 19:26:10 +00:00
player . t . extCapsules = player . t . extCapsules . add ( 1 )
2020-08-19 02:50:24 +00:00
}
2020-08-26 03:32:27 +00:00
function maxExtTimeCapsules ( ) {
2020-09-14 19:26:10 +00:00
let target = player . b . points . add ( 1 ) . div ( 10 ) . sub ( 1 ) . root ( 1.2 ) . div ( 0.4 )
2020-09-07 16:33:50 +00:00
if ( target . gte ( 25 ) && ! player . ba . upgrades . includes ( 43 ) ) target = target . times ( 25 ) . sqrt ( )
2020-09-14 19:26:10 +00:00
target = target . add ( 1 ) . floor ( ) . max ( 0 )
2020-08-26 03:32:27 +00:00
player . t . extCapsules = player . t . extCapsules . max ( target )
}
2020-09-08 00:11:57 +00:00
function addToTimeBase ( ) {
let toAdd = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . m . upgrades . includes ( 44 ) ) toAdd = toAdd . add ( LAYER _UPGS . m [ 44 ] . currently ( ) )
2020-09-08 00:11:57 +00:00
return toAdd
}
2020-09-12 14:26:57 +00:00
function multiplyToTimeBase ( ) {
let x = new Decimal ( 1 )
if ( player . l . unl && tmp . l !== undefined ) x = x . times ( tmp . l . lbEff [ 3 ] )
return x
}
2020-08-19 02:50:24 +00:00
function getSpace ( ) {
let baseSpace = player . s . best . pow ( 1.1 ) . times ( 3 ) . floor ( )
2020-09-14 19:26:10 +00:00
if ( player . s . upgrades . includes ( 13 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) baseSpace = baseSpace . add ( 2 ) ;
if ( player . s . upgrades . includes ( 24 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) baseSpace = baseSpace . add ( 3 ) ;
if ( player . ss . unl ) baseSpace = baseSpace . add ( tmp . ssEff1 )
if ( player . ss . upgrades . includes ( 11 ) ) baseSpace = baseSpace . add ( LAYER _UPGS . ss [ 11 ] . currently ( ) )
2020-08-26 20:40:54 +00:00
return baseSpace . sub ( player . s . spent ) . max ( 0 )
2020-08-19 02:50:24 +00:00
}
2020-09-14 02:41:42 +00:00
let SPACE _BUILDINGS = {
max : 10 ,
1 : {
cost : new Decimal ( 1e3 ) ,
2020-09-14 19:26:10 +00:00
eff ( x ) {
2020-09-14 02:41:42 +00:00
let ret = Decimal . pow ( Decimal . add ( 1 , x . pow ( ( player . s . upgrades . includes ( 31 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? 2.75 : 1 ) ) , player . s . points . sqrt ( ) ) . times ( Decimal . mul ( 4 , x . pow ( ( player . s . upgrades . includes ( 31 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) ? 2.75 : 1 ) ) ) . max ( 1 )
if ( player . ba . upgrades . includes ( 42 ) ) ret = ret . pow ( LAYER _UPGS . ba [ 42 ] . currently ( ) )
return ret
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Space Energy boosts Point gain & Prestige Point gain (" + format ( x ) + "x)"
}
} ,
2 : {
cost : new Decimal ( 1e10 ) ,
2020-09-14 19:26:10 +00:00
eff ( x ) {
if ( player . s . upgrades . includes ( 43 ) ) {
x = Decimal . pow ( 1.0001 , x ) . times ( x . sqrt ( ) )
if ( x . gte ( "e600" ) ) x = Decimal . pow ( 10 , x . log10 ( ) . times ( 600 ) . sqrt ( ) )
return x
} else return x . sqrt ( )
} ,
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Adds to base of Booster/Generator effects by " + format ( x )
}
} ,
3 : {
cost : new Decimal ( 1e25 ) ,
2020-09-14 19:26:10 +00:00
eff ( x ) {
x = Decimal . pow ( 1e18 , x . pow ( 0.9 ) )
if ( x . gte ( "e3e9" ) ) x = Decimal . pow ( 10 , x . log10 ( ) . times ( 9e18 ) . cbrt ( ) )
return x
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Makes Boosters/Generators cheaper by " + format ( x ) + "x"
}
} ,
4 : {
cost : new Decimal ( 1e48 ) ,
2020-09-14 19:26:10 +00:00
eff ( x ) {
let ret = x . add ( 1 ) . pow ( 1.25 )
2020-09-14 02:41:42 +00:00
if ( ret . gte ( 1e6 ) ) ret = ret . log10 ( ) . times ( 1e6 / 6 )
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Booster Upgrade 6's effect is raised to the power of " + format ( x )
}
} ,
5 : {
cost : new Decimal ( 1e100 ) ,
2020-09-14 19:26:10 +00:00
eff ( x ) {
2020-09-14 02:41:42 +00:00
return x . sqrt ( ) . times ( 2 )
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Add " + format ( x ) + " free levels to all previous Space Buildings"
}
} ,
6 : {
cost : new Decimal ( "e6000000" ) ,
2020-09-14 19:26:10 +00:00
eff ( x ) {
return x . div ( 1e3 ) . add ( 1 ) . sqrt ( )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "You produce Life Power " + format ( x ) + "x faster"
}
} ,
7 : {
2020-09-14 19:26:10 +00:00
cost : new Decimal ( "e6500000" ) ,
eff ( x ) {
2020-09-16 02:50:53 +00:00
return Decimal . pow ( 1.05 , x )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Reduce the requirement of Phantom Souls by " + format ( x ) + "x"
}
} ,
8 : {
2020-09-14 19:26:10 +00:00
cost : new Decimal ( "e7000000" ) ,
eff ( x ) {
2020-09-16 02:50:53 +00:00
return x . sqrt ( ) . div ( 100 )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-14 02:41:42 +00:00
return "Gain " + format ( x ) + " free extra Quirk layers"
}
} ,
9 : {
2020-09-14 19:26:10 +00:00
cost : new Decimal ( "e8000000" ) ,
eff ( x ) {
2020-09-16 20:56:29 +00:00
return x . max ( 1 ) . log10 ( ) . div ( 3 ) . max ( 1 ) . cbrt ( )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
return "Reduce the cost scaling of Hyperspace by " + format ( Decimal . sub ( 1 , x . recip ( ) ) . times ( 100 ) ) + "%"
2020-09-14 02:41:42 +00:00
}
} ,
10 : {
2020-09-14 19:26:10 +00:00
cost : new Decimal ( "e9500000" ) ,
eff ( x ) {
return x . max ( 1 ) . log10 ( ) . div ( 5 ) . max ( 1 )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
return "Super-Upgrades are " + format ( x . sub ( 1 ) . times ( 100 ) ) + "% stronger"
2020-09-14 02:41:42 +00:00
}
} ,
}
2020-09-10 02:44:25 +00:00
2020-08-20 04:55:26 +00:00
function getSpaceBuildingCostMod ( ) {
let mod = new Decimal ( 1 )
2020-09-14 02:41:42 +00:00
if ( player . s . upgrades . includes ( 24 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) mod = mod . times ( 0.5 )
2020-09-08 16:48:48 +00:00
if ( player . s . upgrades . includes ( 42 ) ) mod = mod . times ( 0.6 )
2020-09-09 02:10:25 +00:00
if ( spellActive ( 4 ) ) mod = mod . times ( Decimal . sub ( 1 , tmp . spellEffs [ 4 ] . sub ( 1 ) ) )
2020-09-13 02:38:32 +00:00
if ( player . ba . upgrades . includes ( 15 ) ) mod = mod . div ( LAYER _UPGS . ba [ 15 ] . currently ( ) )
2020-08-20 04:55:26 +00:00
return mod ;
}
2020-08-29 23:43:53 +00:00
function getSpaceBuildingCostMult ( ) {
let mult = new Decimal ( 1 )
if ( player . ss . unl ) mult = mult . div ( tmp . ssEff2 )
2020-09-08 16:48:48 +00:00
if ( player . s . upgrades . includes ( 41 ) ) mult = mult . div ( LAYER _UPGS . s [ 41 ] . currently ( ) )
2020-08-29 23:43:53 +00:00
return mult
}
2020-08-19 02:50:24 +00:00
function getSpaceBuildingCost ( x ) {
2020-09-14 02:41:42 +00:00
let inputVal = SPACE _BUILDINGS [ x ] . cost
2020-09-11 23:10:57 +00:00
let bought = tmp . s . sb [ x ]
2020-08-27 15:38:26 +00:00
if ( bought . gte ( 100 ) ) bought = bought . pow ( 2 ) . div ( 100 )
2020-09-14 02:41:42 +00:00
let cost = Decimal . pow ( inputVal , bought . times ( tmp . s . sbCostMod ) . pow ( 1.35 ) ) . times ( inputVal ) . times ( ( bought . gt ( 0 ) || x > 1 ) ? 1 : 0 ) . times ( tmp . s . sbCostMult )
2020-08-19 02:50:24 +00:00
return cost
}
2020-08-30 01:39:01 +00:00
function getSpaceBuildingTarg ( x ) {
2020-09-14 02:41:42 +00:00
let inputVal = SPACE _BUILDINGS [ x ] . cost
let target = player . g . power . div ( tmp . s . sbCostMult ) . div ( inputVal ) . max ( 1 ) . log ( inputVal ) . pow ( 1 / 1.35 ) . div ( tmp . s . sbCostMod )
2020-08-30 01:39:01 +00:00
if ( target . gte ( 100 ) ) target = target . times ( 100 ) . sqrt ( )
2020-09-14 19:26:10 +00:00
return target . add ( 1 ) . floor ( )
2020-08-30 01:39:01 +00:00
}
2020-08-19 22:12:31 +00:00
function getSpaceBuildingPow ( ) {
if ( ! player . s . unl ) return new Decimal ( 0 )
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 22 ] : true ) return new Decimal ( 0 )
if ( tmp . challActive ? tmp . challActive . h [ 41 ] : true ) return new Decimal ( 0 )
2020-08-19 22:12:31 +00:00
let pow = new Decimal ( 1 )
2020-09-14 02:41:42 +00:00
if ( player . s . upgrades . includes ( 21 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . s [ 21 ] . currently ( ) )
if ( player . s . upgrades . includes ( 22 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . s [ 22 ] . currently ( ) )
if ( player . s . upgrades . includes ( 23 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . s [ 23 ] . currently ( ) )
if ( player . s . upgrades . includes ( 44 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( 1.25 )
2020-08-29 18:00:32 +00:00
if ( player . q . upgrades . includes ( 41 ) ) pow = pow . times ( 1.4 )
2020-08-29 23:43:53 +00:00
if ( player . ss . unl ) pow = pow . times ( tmp . ssEff3 )
2020-09-08 00:11:57 +00:00
if ( player . ba . upgrades . includes ( 44 ) ) pow = pow . times ( 1.5 )
2020-08-19 22:12:31 +00:00
return pow
}
2020-09-14 02:41:42 +00:00
function getExtraBuildingLevels ( ) {
2020-08-19 19:53:14 +00:00
let lvl = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . s . upgrades . includes ( 11 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) lvl = lvl . add ( 1 ) ;
if ( player . s . upgrades . includes ( 14 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) lvl = lvl . add ( 1 ) ;
if ( player . q . upgrades . includes ( 31 ) ) lvl = lvl . add ( 1 ) ;
if ( player . m . upgrades . includes ( 32 ) ) lvl = lvl . add ( LAYER _UPGS . m [ 32 ] . currently ( ) )
2020-08-19 19:53:14 +00:00
return lvl
}
2020-08-19 02:50:24 +00:00
function getSpaceBuildingEff ( x ) {
2020-09-14 02:41:42 +00:00
let bought
if ( ! player . s . unl ) bought = new Decimal ( 0 )
else {
2020-09-14 19:26:10 +00:00
bought = tmp . s . sb [ x ] . add ( tmp . s . sbExtra )
2020-09-14 22:32:29 +00:00
if ( x < 5 && tmp . s . trueSbUnl >= 5 ) bought = bought . add ( tmp . s . sbEff [ 5 ] )
2020-09-14 02:41:42 +00:00
var compressLvl = new Decimal ( 1 )
2020-09-15 00:24:28 +00:00
if ( tmp . i !== undefined && layerUnl ( "i" ) && tmp . i . compressed >= x ) compressLvl = tmp . s . sbUnl . sub ( x - SPACE _BUILDINGS . max - 1 ) . div ( SPACE _BUILDINGS . max ) . ceil ( ) . cbrt ( )
2020-09-14 02:41:42 +00:00
bought = bought . times ( tmp . s . sbPow ) . times ( compressLvl )
if ( tmp . hs !== undefined && layerUnl ( "hs" ) ) {
tmp . hs . suEff [ x ] = HYPERSPACE . effs [ x ] ( bought , fixValue ( tmp . hs . su [ x ] ) . times ( tmp . hs . eff ) . times ( compressLvl ) )
bought = bought . times ( tmp . hs . suEff [ x ] )
}
2020-08-19 02:50:24 +00:00
}
2020-09-14 02:41:42 +00:00
return SPACE _BUILDINGS [ x ] . eff ( bought )
2020-08-19 02:50:24 +00:00
}
function getSpaceBuildingEffDesc ( x ) {
2020-09-11 23:10:57 +00:00
let eff = tmp . s . sbEff [ x ]
2020-09-14 02:41:42 +00:00
return SPACE _BUILDINGS [ x ] . effDesc ( eff )
2020-08-19 02:50:24 +00:00
}
function buyBuilding ( x ) {
if ( ! player . s . unl ) return
2020-09-11 23:10:57 +00:00
if ( tmp . s . trueSbUnl < x ) return
2020-08-19 02:50:24 +00:00
if ( getSpace ( ) . lt ( 1 ) ) return
let cost = getSpaceBuildingCost ( x )
if ( player . g . power . lt ( cost ) ) return
player . g . power = player . g . power . sub ( cost )
2020-09-11 23:10:57 +00:00
addSpaceBuilding ( x , 1 )
2020-08-19 02:50:24 +00:00
}
2020-08-30 01:39:01 +00:00
function maxSpaceBuilding ( x ) {
if ( ! player . s . unl ) return
2020-09-11 23:10:57 +00:00
if ( tmp . s . trueSbUnl < x ) return
2020-08-30 01:39:01 +00:00
let space = getSpace ( )
if ( space . lt ( 1 ) ) return
let target = getSpaceBuildingTarg ( x )
2020-09-11 23:10:57 +00:00
let bulk = target . sub ( tmp . s . sb [ x ] ) . min ( space )
2020-08-30 01:39:01 +00:00
if ( bulk . lt ( 1 ) ) return
2020-09-11 23:10:57 +00:00
addSpaceBuilding ( x , bulk )
2020-08-30 01:39:01 +00:00
}
2020-08-29 18:00:32 +00:00
function destroyBuilding ( x , all = false ) {
if ( ! player . s . unl ) return
2020-09-11 23:10:57 +00:00
if ( tmp . s . trueSbUnl < x ) return
if ( tmp . s . sb [ x ] . lt ( 1 ) ) return
2020-08-29 18:00:32 +00:00
if ( player . q . best . lt ( 2500 ) ) return
2020-09-11 23:10:57 +00:00
addSpaceBuilding ( x , all ? tmp . s . sb [ x ] . neg ( ) : - 1 )
}
function addSpaceBuilding ( x , amt ) {
amt = getSpace ( ) . min ( amt )
player . s . spent = player . s . spent . add ( amt )
tmp . s . sb [ x ] = tmp . s . sb [ x ] . add ( amt )
player . s . buildings [ x ] = tmp . s . sb [ x ]
2020-08-29 18:00:32 +00:00
}
2020-08-19 02:50:24 +00:00
function respecSpaceBuildings ( ) {
if ( ! player . s . unl ) return ;
if ( ! confirm ( "Are you sure you want to reset your Space Buildings? This will force you to do a Space reset as well!" ) ) return
2020-09-10 02:44:25 +00:00
player . s . buildings = { }
2020-08-19 02:50:24 +00:00
player . s . spent = new Decimal ( 0 )
2020-08-19 19:53:14 +00:00
doReset ( "s" , true )
}
function getSpaceBuildingsUnl ( ) {
let x = 3
2020-09-14 02:41:42 +00:00
if ( player . s . upgrades . includes ( 14 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) x ++ ;
if ( player . s . upgrades . includes ( 32 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) x ++ ;
if ( layerUnl ( "i" ) ) {
x = new Decimal ( x )
if ( player . i . unl ) x = x . add ( player . i . extraBuildings )
}
2020-08-19 19:53:14 +00:00
return x ;
2020-08-19 02:50:24 +00:00
}
2020-08-26 03:32:27 +00:00
function toggleAuto ( layer , end = "" ) {
player [ layer ] [ "auto" + end ] = ! player [ layer ] [ "auto" + end ]
2020-08-20 04:55:26 +00:00
}
2020-08-22 01:16:23 +00:00
function getSuperBoosterPow ( ) {
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 41 ] : true ) return new Decimal ( 0 )
2020-08-22 01:16:23 +00:00
let pow = new Decimal ( 1 )
2020-09-14 02:41:42 +00:00
if ( player . sb . upgrades . includes ( 11 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . sb [ 11 ] . currently ( ) )
if ( player . sb . upgrades . includes ( 12 ) && ! ( tmp . challActive ? tmp . challActive . h [ 12 ] : true ) ) pow = pow . times ( LAYER _UPGS . sb [ 12 ] . currently ( ) )
2020-08-30 01:39:01 +00:00
if ( player . hb . upgrades . includes ( 11 ) ) pow = pow . times ( LAYER _UPGS . hb [ 11 ] . currently ( ) )
2020-08-22 01:16:23 +00:00
return pow ;
}
2020-08-26 22:42:19 +00:00
function addToSBBase ( ) {
let toAdd = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . h . challs . includes ( 22 ) ) toAdd = toAdd . add ( 0.25 )
if ( player . h . challs . includes ( 41 ) ) toAdd = toAdd . add ( 0.25 )
if ( player . sb . upgrades . includes ( 22 ) ) toAdd = toAdd . add ( LAYER _UPGS . sb [ 22 ] . currently ( ) )
2020-08-29 23:43:53 +00:00
if ( player . hb . unl ) toAdd = toAdd . times ( tmp . layerEffs . hb )
2020-08-26 22:42:19 +00:00
return toAdd
}
2020-09-05 17:11:53 +00:00
function getQuirkLayerCostBase ( ) {
let base = new Decimal ( 2 )
if ( player . ba . upgrades . includes ( 31 ) ) base = LAYER _UPGS . ba [ 31 ] . currently ( )
return base
}
2020-09-13 02:38:32 +00:00
function getQuirkLayerCost ( layers ) {
if ( layers === undefined ) layers = player . q . layers
2020-09-09 22:47:26 +00:00
if ( layers . gte ( 20 ) ) layers = Decimal . pow ( 1.05 , layers . sub ( 20 ) ) . times ( 20 )
2020-09-14 19:26:10 +00:00
if ( player . ba . upgrades . includes ( 55 ) ) layers = layers . sub ( LAYER _UPGS . ba [ 55 ] . currently ( ) )
2020-09-14 02:41:42 +00:00
let cost = Decimal . pow ( tmp . qCB , Decimal . pow ( tmp . qCB , layers ) . sub ( 1 ) )
2020-08-26 01:45:22 +00:00
return cost . max ( 1 ) ;
}
2020-09-04 02:25:24 +00:00
function getQuirkLayerTarg ( ) {
2020-09-14 02:41:42 +00:00
let targ = player . q . points . log ( tmp . qCB ) . add ( 1 ) . log ( tmp . qCB )
2020-09-14 19:26:10 +00:00
if ( player . ba . upgrades . includes ( 55 ) ) targ = targ . add ( LAYER _UPGS . ba [ 55 ] . currently ( ) )
if ( targ . gte ( 20 ) ) targ = targ . div ( 20 ) . log ( 1.05 ) . add ( 20 )
return targ . add ( 1 ) . floor ( )
2020-09-04 02:25:24 +00:00
}
2020-08-26 16:26:46 +00:00
function getQuirkLayerMult ( ) {
let mult = new Decimal ( 1 )
if ( player . q . upgrades . includes ( 13 ) ) mult = mult . times ( 2 )
2020-08-29 16:43:58 +00:00
if ( player . q . upgrades . includes ( 14 ) ) mult = mult . times ( 3 )
2020-08-26 19:08:00 +00:00
if ( player . q . upgrades . includes ( 21 ) ) mult = mult . times ( LAYER _UPGS . q [ 21 ] . currently ( ) )
2020-09-08 20:47:32 +00:00
if ( player . q . upgrades . includes ( 52 ) ) mult = mult . times ( LAYER _UPGS . q [ 52 ] . currently ( ) )
2020-09-14 02:41:42 +00:00
if ( player . h . challs . includes ( 52 ) ) mult = mult . times ( LAYER _CHALLS . h [ 52 ] . currently ( ) )
2020-09-04 17:45:22 +00:00
if ( player . ba . upgrades . includes ( 13 ) ) mult = mult . times ( LAYER _UPGS . ba [ 13 ] . currently ( ) )
2020-08-26 16:26:46 +00:00
return mult
}
2020-09-05 17:11:53 +00:00
function getExtraQuirkLayers ( ) {
let layers = new Decimal ( 0 ) ;
2020-09-14 19:26:10 +00:00
if ( player . q . upgrades . includes ( 51 ) ) layers = layers . add ( LAYER _UPGS . q [ 51 ] . currently ( ) )
if ( player . m . upgrades . includes ( 24 ) ) layers = layers . add ( LAYER _UPGS . m [ 24 ] . currently ( ) )
if ( player . m . upgrades . includes ( 34 ) ) layers = layers . add ( 1 )
2020-09-14 02:41:42 +00:00
if ( tmp . s !== undefined && tmp . s . trueSbUnl >= 8 ) layers = layers . add ( tmp . s . sbEff [ 8 ] )
2020-09-05 17:11:53 +00:00
return layers ;
}
2020-08-26 01:45:22 +00:00
function getQuirkEnergyGainExp ( ) {
2020-09-03 21:59:23 +00:00
let mult = new Decimal ( 1 )
if ( spellActive ( 3 ) ) mult = mult . times ( tmp . spellEffs [ 3 ] )
2020-09-14 19:26:10 +00:00
return player . q . layers . add ( getExtraQuirkLayers ( ) ) . sub ( 1 ) . times ( mult )
2020-08-26 01:45:22 +00:00
}
function getQuirkEnergyEff ( ) {
2020-09-14 19:26:10 +00:00
let eff = player . q . energy . add ( 1 ) . pow ( 2 )
2020-08-26 16:26:46 +00:00
if ( player . q . upgrades . includes ( 12 ) ) {
2020-09-14 19:26:10 +00:00
let mod = player . q . energy . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . add ( 1 )
2020-08-26 16:26:46 +00:00
if ( mod . gte ( 2 ) ) {
eff = eff . times ( mod . div ( 2 ) . pow ( 10 ) )
mod = new Decimal ( 2 )
}
eff = eff . pow ( mod )
}
2020-08-27 15:38:26 +00:00
if ( player . q . upgrades . includes ( 32 ) ) eff = eff . pow ( 2 )
2020-09-04 03:15:10 +00:00
if ( player . h . challs . includes ( 61 ) ) eff = eff . pow ( 1.2 )
2020-09-04 17:45:22 +00:00
if ( player . ba . upgrades . includes ( 13 ) ) eff = eff . pow ( 3 )
2020-08-26 01:45:22 +00:00
return eff ;
}
function buyQuirkLayer ( ) {
if ( ! player . q . unl ) return
let cost = getQuirkLayerCost ( )
if ( player . q . points . lt ( cost ) ) return
player . q . points = player . q . points . sub ( cost )
2020-09-14 19:26:10 +00:00
player . q . layers = player . q . layers . add ( 1 )
2020-08-26 01:45:22 +00:00
}
2020-09-04 02:25:24 +00:00
function maxQuirkLayers ( ) {
if ( ! player . q . unl ) return
let cost = getQuirkLayerCost ( )
if ( player . q . points . lt ( cost ) ) return
let target = getQuirkLayerTarg ( )
if ( target . lte ( player . q . layers ) ) return
player . q . points = player . q . points . sub ( cost )
player . q . layers = player . q . layers . max ( target )
}
2020-09-14 02:41:42 +00:00
const LAYER _CHALLS = {
h : {
rows : 7 ,
cols : 2 ,
2020-09-14 19:26:10 +00:00
active ( x ) {
2020-09-14 02:41:42 +00:00
if ( x < 71 && x != 42 && x != 52 ) if ( this . active ( 71 ) ) return true
if ( x == 11 || x == 41 ) if ( this . active ( 51 ) ) return true
if ( x == 31 || x == 32 ) if ( this . active ( 61 ) ) return true
return player . h . active == x ;
2020-08-31 18:33:29 +00:00
} ,
2020-09-14 02:41:42 +00:00
11 : {
name : "Skip the Second" ,
desc : "Boosters and Generator Power do nothing" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . best . gt ( 0 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e2400" ) ,
reward : "The generator power effect is raised to the power of 1.25" ,
} ,
12 : {
name : "Anti-Upgrades" ,
desc : "Row 3 Upgrades do nothing" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 11 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e840" ) ,
reward : "Quirk gain is boosted by your Quirk Layers" ,
2020-09-14 19:26:10 +00:00
currently ( ) { return Decimal . pow ( 1.5 , player . q . layers . times ( player . sp . upgrades . includes ( 22 ) ? 250 : 1 ) ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-14 02:41:42 +00:00
} ,
21 : {
name : "Prestigeless" ,
desc : "Prestige Point gain is raised to the power of 0.01" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 12 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e1200" ) ,
reward : "Hindrance Spirit & Quirks make Time Capsules & Space Energy cheaper." ,
2020-09-14 19:26:10 +00:00
currently ( ) { return player . h . points . add ( player . q . points ) . div ( 2 ) . add ( 1 ) . pow ( 1000 ) . pow ( player . sp . upgrades . includes ( 22 ) ? 250 : 1 ) } ,
effDisp ( x ) { return format ( x ) + "x cheaper" } ,
2020-09-14 02:41:42 +00:00
} ,
22 : {
name : "Impaired Nodes" ,
desc : "Enhancers, Extra Time Capsules, and Space Buildings do nothing." ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 12 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e4600" ) ,
reward : "Add 0.25 to the Super-Booster base." ,
} ,
31 : {
name : "Flattened Curve" ,
desc : "Point generation is tetrated by 0.1" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 21 ) || player . h . challs . includes ( 22 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( 1e208 ) ,
reward : "Enhancers are twice as strong." ,
} ,
32 : {
name : "Surprise Junction" ,
desc : "Prestige Upgrade 2 does nothing" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 21 ) && player . h . challs . includes ( 22 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e2580" ) ,
reward : "Unlock 2 new Super-Booster Upgrades and 7 new Quirk Upgrades." ,
} ,
41 : {
name : "Skip the Third" ,
desc : "Enhancers, Time Capsules, Space Buildings, and Super-Boosters do nothing." ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 31 ) || player . h . challs . includes ( 32 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "4.444e4444" ) ,
reward : "Add 0.25 to the Super-Booster base." ,
} ,
42 : {
name : "Slowed to a Halt" ,
desc : "Time slows down over time, halting to a stop after 10 seconds. Hint: This also impacts auto Enhance Point generation, so make sure to manually press E!" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 31 ) && player . h . challs . includes ( 32 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e16500" ) ,
reward : "Cube the Generator Power effect." ,
} ,
51 : {
name : "It's all Gone" ,
desc : '"Skip the Second" and "Skip the Third" are both applied at once.' ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 41 ) && player . h . challs . includes ( 42 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e2840" ) ,
reward : "Super-Boosters multiply the Generator base." ,
2020-09-14 19:26:10 +00:00
currently ( ) { return player . sb . points . add ( 1 ) . sqrt ( ) } ,
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-14 02:41:42 +00:00
} ,
52 : {
name : "Anti-Enhancers" ,
desc : "You lose Enhancers over time, which can make your Enhancer amount get below 0. Hint: Maybe it's best to not have any Time Capsules or Space Energy?" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . h . challs . includes ( 41 ) && player . h . challs . includes ( 42 ) && player . h . challs . includes ( 51 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e440000" ) ,
reward : "Quirk Layers are faster based on your Hindrance Spirit & Quirks." ,
2020-09-14 19:26:10 +00:00
currently ( ) {
2020-09-14 02:41:42 +00:00
let h = player . h . points . times ( player . q . points ) . sqrt ( ) ;
if ( h . gte ( 1e150 ) ) h = h . log10 ( ) . pow ( 50 ) . times ( 1e150 / Math . pow ( 150 , 50 ) ) . min ( h )
if ( h . gte ( 1e100 ) ) h = h . times ( 1e100 ) . sqrt ( )
2020-09-14 19:26:10 +00:00
let ret = h . add ( 1 ) . pow ( 0.04 ) ;
2020-09-14 02:41:42 +00:00
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-14 02:41:42 +00:00
} ,
61 : {
name : "Microanalysis" ,
desc : '"Flattened Curve" and "Surprised Junction" are both applied at once.' ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 12 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e12300" ) ,
reward : "Hindrance Spirit & Quirk Energy are 20% stronger." ,
} ,
62 : {
name : "Truly Prestigeless" ,
desc : "You cannot gain Prestige Points." ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 12 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e134000" ) ,
reward : "Unlock Super-Generators." ,
} ,
71 : {
name : "The Final Stockade" ,
desc : 'All previous Hindrances (except "Slowed to a Halt" and "Anti-Enhancers") are applied at once.' ,
2020-09-14 19:26:10 +00:00
unl ( ) { return player . m . upgrades . includes ( 31 ) } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( "1e1150" ) ,
reward : "Gain more Hindrance Spirit based on your Quirk Energy." ,
2020-09-14 19:26:10 +00:00
currently ( ) {
let ret = player . q . energy . add ( 1 ) . sqrt ( )
2020-09-14 02:41:42 +00:00
if ( ret . gte ( "1.8e308" ) ) ret = ret . sqrt ( ) . times ( Decimal . sqrt ( "1.8e308" ) )
return ret ;
} ,
2020-09-14 19:26:10 +00:00
effDisp ( x ) { return format ( x ) + "x" } ,
2020-09-14 02:41:42 +00:00
} ,
72 : {
name : "You shouldn't be seeing this" ,
desc : "Never gonna give you up, never gonna let you down, never gonna run around and dessert you" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return false } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( 1 / 0 ) ,
reward : "???" ,
2020-09-07 16:33:50 +00:00
} ,
2020-09-05 20:00:21 +00:00
} ,
2020-09-14 02:41:42 +00:00
test : {
rows : 1 ,
cols : 1 ,
11 : {
name : "You shouldn't be seeing this" ,
desc : "Never gonna give you up, never gonna let you down, never gonna run around and dessert you" ,
2020-09-14 19:26:10 +00:00
unl ( ) { return true } ,
2020-09-14 02:41:42 +00:00
goal : new Decimal ( 0 ) ,
reward : "???" ,
} ,
2020-09-05 20:00:21 +00:00
} ,
2020-08-26 16:26:46 +00:00
}
2020-09-14 02:41:42 +00:00
function startChall ( layer , x ) {
if ( ! player [ layer ] . unl ) return
if ( player [ layer ] . active == x ) {
completeChall ( layer , x )
delete player [ layer ] . active
2020-08-26 16:26:46 +00:00
} else {
2020-09-14 02:41:42 +00:00
player [ layer ] . active = x
2020-08-26 16:26:46 +00:00
}
2020-09-14 02:41:42 +00:00
doReset ( layer , true )
updateChallTemp ( layer )
2020-08-26 16:26:46 +00:00
}
2020-09-14 02:41:42 +00:00
function completeChall ( layer , x ) {
var x = player [ layer ] . active
if ( ! x ) return
if ( ! player . points . gte ( LAYER _CHALLS [ layer ] [ x ] . goal ) ) return
if ( ! player [ layer ] . challs . includes ( x ) ) {
if ( layer == "h" && x == 62 ) needCanvasUpdate = true
player [ layer ] . challs . push ( x ) ;
2020-09-09 22:14:05 +00:00
}
2020-09-14 02:41:42 +00:00
delete player [ layer ] . active
updateChallTemp ( layer )
2020-09-09 22:14:05 +00:00
}
2020-08-27 19:12:20 +00:00
function adjustMSDisp ( ) {
let displays = [ "always" , "automation" , "incomplete" , "never" ] ;
player . msDisplay = displays [ ( displays . indexOf ( player . msDisplay ) + 1 ) % 4 ]
}
function milestoneShown ( complete , auto = false ) {
switch ( player . msDisplay ) {
case "always" :
return true ;
break ;
case "automation" :
return auto || ! complete
break ;
case "incomplete" :
return ! complete
break ;
case "never" :
return false ;
break ;
}
return false ;
}
2020-08-29 23:43:53 +00:00
function getSubspaceEff1 ( ) {
if ( ! player . ss . unl ) return new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
let eff = player . ss . subspace . times ( player . ss . points ) . add ( 1 ) . log10 ( ) . times ( 100 )
2020-09-16 02:50:53 +00:00
if ( player . sp . upgrades . includes ( 35 ) ) eff = eff . times ( LAYER _UPGS . sp [ 35 ] . currently ( ) )
2020-08-29 23:43:53 +00:00
return eff . floor ( ) ;
}
function getSubspaceEff2 ( ) {
if ( ! player . ss . unl ) return new Decimal ( 1 )
2020-09-14 19:26:10 +00:00
let eff = player . ss . subspace . add ( 1 ) . pow ( 750 )
2020-09-16 02:50:53 +00:00
if ( player . sp . upgrades . includes ( 35 ) ) eff = eff . pow ( LAYER _UPGS . sp [ 35 ] . currently ( ) )
2020-08-29 23:43:53 +00:00
return eff ;
}
function getSubspaceEff3 ( ) {
if ( ! player . ss . unl ) return new Decimal ( 1 )
2020-09-14 19:26:10 +00:00
let eff = player . ss . subspace . add ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 2.5 ) . add ( 1 )
2020-08-30 01:39:01 +00:00
if ( player . ss . upgrades . includes ( 13 ) ) eff = eff . times ( 1.5 )
2020-09-16 02:50:53 +00:00
if ( player . sp . upgrades . includes ( 35 ) ) eff = eff . times ( LAYER _UPGS . sp [ 35 ] . currently ( ) )
2020-09-14 19:26:10 +00:00
if ( eff . gte ( 2 ) ) eff = eff . log2 ( ) . add ( 1 )
2020-08-29 23:43:53 +00:00
return eff ;
}
2020-08-30 01:39:01 +00:00
function getSubspaceGainMult ( ) {
let mult = new Decimal ( 1 )
if ( player . ss . upgrades . includes ( 12 ) ) mult = mult . times ( LAYER _UPGS . ss [ 12 ] . currently ( ) )
2020-09-01 00:39:33 +00:00
if ( player . ss . upgrades . includes ( 22 ) ) mult = mult . times ( LAYER _UPGS . ss [ 22 ] . currently ( ) )
2020-09-04 23:09:10 +00:00
if ( player . ss . upgrades . includes ( 24 ) ) mult = mult . times ( LAYER _UPGS . ss [ 24 ] . currently ( ) )
2020-09-07 02:17:10 +00:00
if ( player . ss . upgrades . includes ( 25 ) ) mult = mult . times ( LAYER _UPGS . ss [ 25 ] . currently ( ) )
2020-09-04 03:15:10 +00:00
if ( player . ba . upgrades . includes ( 12 ) ) mult = mult . times ( LAYER _UPGS . ba [ 12 ] . currently ( ) )
2020-08-30 01:39:01 +00:00
return mult
}
2020-09-04 17:45:22 +00:00
function addToHBBase ( ) {
let toAdd = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . m . upgrades . includes ( 13 ) ) toAdd = toAdd . add ( LAYER _UPGS . m [ 13 ] . currently ( ) )
if ( player . m . upgrades . includes ( 33 ) ) toAdd = toAdd . add ( LAYER _UPGS . m [ 33 ] . currently ( ) )
2020-09-04 17:45:22 +00:00
return toAdd
}
2020-08-30 01:39:01 +00:00
function getHyperBoosterExp ( ) {
let exp = new Decimal ( 1 )
if ( player . hb . order > 0 ) exp = new Decimal ( 0.5 )
return exp
}
2020-09-12 02:03:58 +00:00
function getExtraHyperBoosters ( ) {
let x = new Decimal ( 0 )
if ( player . l . unl && tmp . l !== undefined ) x = x . add ( tmp . l . lbEff [ 1 ] )
return x
}
2020-08-30 01:39:01 +00:00
function getHyperBoosterPow ( ) {
let pow = new Decimal ( 1 )
if ( player . hb . upgrades . includes ( 12 ) ) pow = pow . times ( LAYER _UPGS . hb [ 12 ] . currently ( ) )
return pow ;
}
2020-09-03 21:59:23 +00:00
function getBalancePowerEff ( ) {
2020-09-14 19:26:10 +00:00
let eff = player . ba . power . times ( 2 ) . add ( 1 ) . pow ( 2 / 3 )
2020-09-10 13:18:18 +00:00
if ( player . ba . upgrades . includes ( 14 ) ) eff = eff . pow ( 3.85 )
2020-09-05 17:11:53 +00:00
if ( player . ba . upgrades . includes ( 33 ) ) eff = eff . pow ( 2 )
2020-09-03 21:59:23 +00:00
return eff ;
}
function getBalanceTypesEff ( ) {
2020-09-14 19:26:10 +00:00
let mod = player . ba . positivity . add ( 1 ) . log10 ( ) . add ( 1 ) . div ( player . ba . negativity . add ( 1 ) . log10 ( ) . add ( 1 ) ) . log10 ( ) . abs ( ) . add ( 1 ) . pow ( - 1 )
let pos = player . ba . positivity . add ( 1 ) . log10 ( ) . add ( 1 )
let neg = player . ba . negativity . add ( 1 ) . log10 ( ) . add ( 1 )
2020-09-05 17:11:53 +00:00
if ( player . ba . upgrades . includes ( 34 ) ) mod = mod . times ( 1.5 )
2020-09-08 20:47:32 +00:00
if ( player . ba . upgrades . includes ( 53 ) ) mod = mod . times ( LAYER _UPGS . ba [ 53 ] . currently ( ) )
2020-09-03 21:59:23 +00:00
let eff = pos . times ( neg ) . pow ( mod )
return eff ;
}
2020-09-04 02:25:24 +00:00
function getBalanceEnergyExp ( ) {
let exp = new Decimal ( 1 )
if ( player . ba . unl ) exp = exp . times ( 1.5 )
return exp ;
}
2020-09-04 19:42:40 +00:00
function getPosGainMult ( ) {
let mult = new Decimal ( 1 )
if ( player . ba . upgrades . includes ( 22 ) ) mult = mult . times ( LAYER _UPGS . ba [ 22 ] . currently ( ) )
return mult ;
}
function getNegGainMult ( ) {
let mult = new Decimal ( 1 )
if ( player . ba . upgrades . includes ( 22 ) ) mult = mult . times ( LAYER _UPGS . ba [ 22 ] . currently ( ) )
return mult ;
}
2020-09-09 02:10:25 +00:00
function getBalPowGainMult ( ) {
let mult = new Decimal ( 1 )
if ( player . sp . upgrades . includes ( 14 ) ) mult = mult . times ( LAYER _UPGS . sp [ 14 ] . currently ( ) )
return mult ;
}
2020-09-10 02:44:25 +00:00
const MAX _SPELLS = 4
2020-09-03 21:59:23 +00:00
const SPELL _NAMES = {
2020-09-05 17:11:53 +00:00
1 : "Booster Launch" ,
2 : "Time Warp" ,
3 : "Quirk Amplification" ,
2020-09-09 02:10:25 +00:00
4 : "Spacial Compression" ,
2020-09-03 21:59:23 +00:00
}
const SPELL _DESCS = {
1 : "Boosters are X% stronger" ,
2 : "Time Capsules are X% stronger" ,
3 : "Quirk Layers are X% more efficient" ,
2020-09-09 02:10:25 +00:00
4 : "Space Buildings cost scale X% slower" ,
2020-09-03 21:59:23 +00:00
}
const SPELL _BASE = {
1 : 1.25 ,
2 : 1.1 ,
3 : 1.04 ,
2020-09-09 02:10:25 +00:00
4 : 1.01 ,
2020-09-03 21:59:23 +00:00
}
function getSpellPower ( x ) {
let power = new Decimal ( 1 ) ;
2020-09-04 02:25:24 +00:00
if ( player . m . upgrades . includes ( 11 ) ) power = power . times ( LAYER _UPGS . m [ 11 ] . currently ( ) )
2020-09-04 19:42:40 +00:00
if ( player . m . upgrades . includes ( 21 ) && ( x == 2 || x == 3 ) ) power = power . times ( LAYER _UPGS . m [ 21 ] . currently ( ) )
2020-09-04 23:09:10 +00:00
if ( player . m . upgrades . includes ( 22 ) && ( x == 2 ) ) power = power . times ( 10 )
2020-09-09 22:47:26 +00:00
if ( player . m . upgrades . includes ( 41 ) ) {
let casted = player . m . casted [ x ]
2020-09-14 19:26:10 +00:00
power = power . times ( casted . max ( 1 ) . log10 ( ) . add ( 1 ) . log10 ( ) . div ( 5 ) . add ( 1 ) )
2020-09-09 22:47:26 +00:00
}
2020-09-09 16:51:59 +00:00
if ( player . sp . upgrades . includes ( 23 ) ) power = power . times ( LAYER _UPGS . sp [ 23 ] . currently ( ) )
2020-09-12 02:03:58 +00:00
if ( player . ps . upgrades . includes ( 13 ) ) power = power . times ( LAYER _UPGS . ps [ 13 ] . currently ( ) )
2020-09-09 22:47:26 +00:00
if ( power . gte ( 50 ) ) power = power . log10 ( ) . times ( 50 / Math . log10 ( 50 ) ) . min ( power )
2020-09-09 16:51:59 +00:00
return power . max ( 1 ) ;
2020-09-03 21:59:23 +00:00
}
function getSpellEff ( x ) {
let base = SPELL _BASE [ x ]
let power = getSpellPower ( x )
let eff = Decimal . pow ( base , power )
2020-09-14 19:26:10 +00:00
if ( x == 4 ) eff = Decimal . sub ( 2 , Decimal . div ( base , power . log2 ( ) . add ( 1 ) ) )
2020-09-03 21:59:23 +00:00
return eff
}
function getSpellDesc ( x ) {
let desc = SPELL _DESCS [ x ]
let eff = tmp . spellEffs [ x ]
return desc . replace ( "X" , format ( eff . sub ( 1 ) . times ( 100 ) ) )
}
function getSpellTime ( ) {
2020-09-10 13:18:18 +00:00
let time = 60
if ( player . m . total . gte ( 2.5 e9 ) ) time *= 4
2020-09-08 00:11:57 +00:00
if ( player . m . upgrades . includes ( 43 ) ) time *= LAYER _UPGS . m [ 43 ] . currently ( ) . toNumber ( )
2020-09-03 21:59:23 +00:00
return time
}
function spellActive ( x ) {
if ( ! player . m . unl ) return false
2020-09-04 02:25:24 +00:00
if ( ! tmp . spellEffs ) return false
2020-09-09 02:10:25 +00:00
if ( tmp . spellsUnl < x ) return false
2020-09-03 21:59:23 +00:00
return player . m . spellTimes [ x ] > 0
}
2020-09-08 00:11:57 +00:00
function activateSpell ( x , force = false ) {
2020-09-09 02:10:25 +00:00
if ( tmp . spellsUnl < x ) return ;
2020-09-09 02:23:06 +00:00
let toCast = setToCast ( player . m . toCast [ x ] ) . max ( 1 )
2020-09-08 00:11:57 +00:00
if ( ! force ) {
if ( ! player . m . unl ) return
if ( spellActive ( x ) ) return
if ( player . m . points . lt ( toCast ) ) return
}
2020-09-09 02:14:23 +00:00
if ( player . sp . total . lt ( 2 ) ) player . m . points = player . m . points . sub ( toCast ) . max ( 0 )
2020-09-08 00:11:57 +00:00
player . m . casted [ x ] = toCast
2020-09-03 21:59:23 +00:00
player . m . spellTimes [ x ] = getSpellTime ( )
2020-09-14 19:26:10 +00:00
if ( ! force ) player . m . hexes = player . m . hexes . add ( getHexGain ( ) )
2020-09-04 17:45:22 +00:00
}
function getHexGain ( ) {
let gain = new Decimal ( 1 )
if ( player . m . upgrades . includes ( 14 ) ) gain = gain . times ( LAYER _UPGS . m [ 14 ] . currently ( ) )
2020-09-09 02:10:25 +00:00
if ( player . sp . upgrades . includes ( 14 ) ) gain = gain . times ( LAYER _UPGS . sp [ 14 ] . currently ( ) )
2020-09-11 02:15:05 +00:00
if ( player . l . unl && tmp . l !== undefined ) gain = gain . times ( tmp . l . lbEff [ 2 ] )
2020-09-04 17:45:22 +00:00
return gain . floor ( )
2020-09-03 21:59:23 +00:00
}
function getHexEff ( ) {
2020-09-10 13:18:18 +00:00
let eff = player . m . hexes . times ( 2 ) . max ( 1 ) . pow ( 5 )
2020-09-03 21:59:23 +00:00
return eff ;
}
2020-09-08 00:11:57 +00:00
function isToCastValid ( val ) {
try {
val = new Decimal ( val ) . floor ( )
if ( val . eq ( undefined ) || val . eq ( null ) ) return false
if ( val . lt ( 1 ) ) return false
if ( val . gt ( player . m . points ) ) return false
return val ;
} catch ( e ) {
return false ;
}
}
function setToCast ( val ) {
if ( ! player . m . upgrades . includes ( 41 ) ) return new Decimal ( 1 )
let validVal = isToCastValid ( val )
if ( ! validVal ) return new Decimal ( 1 )
else return validVal
}
function updateToCast ( id ) {
activateSpell ( id , true )
}
2020-09-04 17:45:22 +00:00
function getSGenPowEff ( ) {
if ( ! player . sg . unl ) return new Decimal ( 1 )
2020-09-14 19:26:10 +00:00
let eff = player . sg . power . add ( 1 ) . pow ( 3 )
2020-09-04 17:45:22 +00:00
return eff
}
2020-09-04 19:42:40 +00:00
function getSuperGenPowerGainMult ( ) {
let mult = new Decimal ( 1 )
if ( player . ba . upgrades . includes ( 21 ) ) mult = mult . times ( LAYER _UPGS . ba [ 21 ] . currently ( ) )
return mult
}
2020-09-04 23:09:10 +00:00
function addToSGBase ( ) {
let toAdd = new Decimal ( 0 )
2020-09-14 19:26:10 +00:00
if ( player . ba . upgrades . includes ( 23 ) ) toAdd = toAdd . add ( LAYER _UPGS . ba [ 23 ] . currently ( ) )
if ( player . sp . upgrades . includes ( 21 ) ) toAdd = toAdd . add ( LAYER _UPGS . sp [ 21 ] . currently ( ) )
2020-09-04 23:09:10 +00:00
return toAdd
}
2020-09-11 14:21:08 +00:00
function getLifePowerMult ( ) {
2020-09-14 19:26:10 +00:00
let x = tmp . layerEffs . ps . mult . div ( 30 )
2020-09-12 02:03:58 +00:00
if ( player . sp . upgrades . includes ( 42 ) ) x = x . times ( LAYER _UPGS . sp [ 42 ] . currently ( ) )
2020-09-14 02:41:42 +00:00
if ( tmp . s !== undefined && tmp . s . trueSbUnl >= 6 ) x = x . times ( tmp . s . sbEff [ 6 ] )
2020-09-11 14:21:08 +00:00
return x
}
function getLifePowerExp ( ) {
let x = tmp . layerEffs . ps . exp
return x
}
function getLifePowerSoftcapStart ( ) {
2020-09-15 19:27:33 +00:00
let x = tmp . layerEffs . l
2020-09-11 14:21:08 +00:00
return x
}
function getLifePowerSoftcapExp ( ) {
let x = 1 / 3
return x
}
2020-09-11 02:15:05 +00:00
let LIFE _BOOSTERS = {
max : 5 ,
2020-09-14 19:26:10 +00:00
unl ( ) {
2020-09-12 02:03:58 +00:00
if ( player . ps . upgrades . includes ( 21 ) ) return 5
2020-09-11 02:15:05 +00:00
return 4
} ,
2020-09-15 00:45:31 +00:00
calcNewPower ( diff ) {
2020-09-15 02:13:33 +00:00
if ( ! player . l . unl ) return new Decimal ( 0 )
2020-09-15 00:45:31 +00:00
let exp = getLifePowerExp ( )
let cap = getLifePowerSoftcapStart ( )
let capExp = getLifePowerSoftcapExp ( )
let power = player . l . power
if ( power . gt ( 1 ) ) power = power . root ( exp )
if ( power . gt ( cap ) ) power = power . div ( cap ) . pow ( 1 / capExp ) . times ( cap )
power = power . add ( getLifePowerMult ( ) . times ( diff ) )
if ( power . gt ( cap ) ) power = power . div ( cap ) . pow ( capExp ) . times ( cap )
if ( power . gt ( 1 ) ) power = power . pow ( exp )
return power
} ,
2020-09-14 19:26:10 +00:00
eff ( ) {
2020-09-12 02:03:58 +00:00
return player . l . power . add ( 1 ) . log10 ( )
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
req ( x ) {
2020-09-11 02:15:05 +00:00
return tmp . l . lb [ x ] . times ( this [ x ] . reqMult ) . add ( this [ x ] . req )
} ,
2020-09-14 19:26:10 +00:00
reqTarget ( x ) {
return player . ps . points . sub ( this [ x ] . req ) . div ( this [ x ] . reqMult ) . add ( 1 ) . floor ( )
2020-09-14 02:41:42 +00:00
} ,
2020-09-11 02:15:05 +00:00
1 : {
req : new Decimal ( 1 ) ,
2020-09-12 02:03:58 +00:00
reqMult : new Decimal ( 1 ) ,
2020-09-14 19:26:10 +00:00
eff ( str ) {
2020-09-12 02:03:58 +00:00
return str . pow ( 0.15 ) . div ( 3 )
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-12 02:03:58 +00:00
return "Add " + format ( x ) + " Hyper-Boosters to its effect"
2020-09-11 02:15:05 +00:00
}
} ,
2 : {
2020-09-12 02:03:58 +00:00
req : new Decimal ( 1.5 ) ,
reqMult : new Decimal ( 1.5 ) ,
2020-09-14 19:26:10 +00:00
eff ( str ) {
let x = Decimal . pow ( 1e20 , str . pow ( 0.75 ) )
if ( x . gte ( "1e400" ) ) x = Decimal . pow ( 10 , x . log10 ( ) . times ( 400 ) . sqrt ( ) )
2020-09-13 02:38:32 +00:00
return x
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-11 02:15:05 +00:00
return "Gain " + format ( x ) + "x more Hexes"
}
} ,
3 : {
2020-09-14 19:26:10 +00:00
req : new Decimal ( 3.5 ) ,
reqMult : new Decimal ( 2.5 ) ,
eff ( str ) {
2020-09-13 02:38:32 +00:00
return str . div ( 1.5 ) . max ( 1 ) . log10 ( ) . add ( 1 )
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-11 02:15:05 +00:00
return "Multiply the base of Time Capsule effect by " + format ( x ) + "x"
}
} ,
4 : {
2020-09-14 19:26:10 +00:00
req : new Decimal ( 10 ) ,
2020-09-13 02:38:32 +00:00
reqMult : new Decimal ( 3 ) ,
2020-09-14 19:26:10 +00:00
eff ( str ) {
2020-09-12 14:26:57 +00:00
return str . div ( 40 ) . add ( 1 )
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-12 02:03:58 +00:00
return "Reduce the requirement of Super-Boosters, Super-Generators, and Hyper-Boosters by " + format ( x ) + "x"
2020-09-11 02:15:05 +00:00
}
} ,
5 : {
2020-09-14 19:26:10 +00:00
req : new Decimal ( 5 ) ,
reqMult : new Decimal ( 6 ) ,
eff ( str ) {
return Decimal . pow ( 3 , str . sqrt ( ) )
2020-09-11 02:15:05 +00:00
} ,
2020-09-14 19:26:10 +00:00
effDesc ( x ) {
2020-09-13 02:38:32 +00:00
return "Gain " + format ( x ) + "x more Hyperspace Energy"
2020-09-11 02:15:05 +00:00
}
} ,
2020-09-10 01:39:08 +00:00
}
2020-09-13 02:38:32 +00:00
let HYPERSPACE = {
2020-09-14 19:26:10 +00:00
cost ( x ) {
2020-09-13 02:38:32 +00:00
if ( x === undefined ) x = player . hs . space
2020-09-14 19:26:10 +00:00
if ( tmp . s !== undefined && tmp . s . trueSbUnl >= 9 ) x = x . div ( tmp . s . sbEff [ 9 ] )
2020-09-16 20:56:29 +00:00
let reduction = this . costReduction ( )
2020-09-13 02:38:32 +00:00
return {
2020-09-16 20:56:29 +00:00
hs : Decimal . pow ( 2 , x . sqr ( ) ) . div ( reduction ) . floor ( ) ,
ba : Decimal . pow ( 10 , x . max ( x . div ( 2 ) . sqr ( ) ) . times ( 20 ) . add ( 150 ) ) . div ( reduction ) . floor ( )
2020-09-13 02:38:32 +00:00
}
} ,
2020-09-16 20:56:29 +00:00
costReduction ( ) {
let r = new Decimal ( 1 )
if ( player . ba . upgrades . includes ( 45 ) ) r = LAYER _UPGS . ba [ 45 ] . currently ( )
return r
} ,
2020-09-14 19:26:10 +00:00
canBuy ( ) {
2020-09-13 02:38:32 +00:00
let cost = this . cost ( )
return player . hs . points . gte ( cost . hs ) && player . ba . points . gte ( cost . ba )
} ,
2020-09-14 19:26:10 +00:00
buy ( ) {
2020-09-13 02:38:32 +00:00
let cost = this . cost ( )
if ( ! this . canBuy ( ) ) return
player . ba . points = player . ba . points . sub ( cost . ba )
player . hs . points = player . hs . points . sub ( cost . hs )
player . hs . space = player . hs . space . add ( 1 )
} ,
2020-09-14 19:26:10 +00:00
canSuperUpg ( x ) {
2020-09-13 02:38:32 +00:00
return player . hs . space . gt ( player . hs . spent ) && tmp . hs . su [ x ] . lt ( player . hs . superUpgradeCap )
} ,
2020-09-14 19:26:10 +00:00
superUpg ( x ) {
2020-09-13 02:38:32 +00:00
if ( ! this . canSuperUpg ( x ) ) return
player . hs . spent = player . hs . spent . add ( 1 )
tmp . hs . su [ x ] = tmp . hs . su [ x ] . add ( 1 )
player . hs . superUpgrades [ x ] = tmp . hs . su [ x ]
} ,
2020-09-14 19:26:10 +00:00
respec ( x ) {
2020-09-13 02:38:32 +00:00
if ( ! player . hs . unl || ! confirm ( "Are you sure?" ) ) return
player . hs . spent = new Decimal ( 0 )
player . hs . superUpgrades = { }
doReset ( "hs" , true )
} ,
2020-09-14 19:26:10 +00:00
eff ( ) {
2020-09-14 02:41:42 +00:00
let r = new Decimal ( 1 )
2020-09-14 19:26:10 +00:00
if ( player . ba . upgrades . includes ( 35 ) ) r = r . times ( 1.25 )
if ( tmp . s !== undefined && tmp . s . trueSbUnl >= 10 ) r = r . times ( tmp . s . sbEff [ 10 ] )
2020-09-14 02:41:42 +00:00
return r
2020-09-13 02:38:32 +00:00
} ,
2020-09-14 19:26:10 +00:00
nextCapReq ( x ) {
2020-09-13 02:38:32 +00:00
if ( x === undefined ) x = player . hs . superUpgradeCap
2020-09-14 02:41:42 +00:00
return Decimal . times ( x , 200 ) . add ( 1300 )
2020-09-13 02:38:32 +00:00
} ,
2020-09-14 19:26:10 +00:00
nextCapTarget ( ) {
2020-09-14 02:41:42 +00:00
let x = player . g . points . sub ( 1300 ) . div ( 200 )
2020-09-13 02:38:32 +00:00
return x . floor ( ) . add ( 1 )
} ,
effs : {
2020-09-14 19:26:10 +00:00
1 ( sb , su ) {
return sb . add ( 1 ) . pow ( su . sqrt ( ) . times ( 2.5 ) )
2020-09-13 02:38:32 +00:00
} ,
2020-09-14 19:26:10 +00:00
2 ( sb , su ) {
return sb . pow ( 0.25 ) . times ( su . sqrt ( ) ) . div ( 120 ) . add ( 1 )
2020-09-13 02:38:32 +00:00
} ,
2020-09-14 19:26:10 +00:00
3 ( sb , su ) {
2020-09-13 02:38:32 +00:00
return sb . cbrt ( ) . times ( su . sqrt ( ) ) . times ( 0.75 ) . add ( 1 )
} ,
2020-09-14 19:26:10 +00:00
4 ( sb , su ) {
return Decimal . pow ( 2.5 , sb . cbrt ( ) . times ( su . sqrt ( ) ) )
2020-09-13 02:38:32 +00:00
} ,
2020-09-14 19:26:10 +00:00
5 ( sb , su ) {
2020-09-14 02:41:42 +00:00
return sb . add ( 10 ) . log10 ( ) . times ( su . sqrt ( ) ) . div ( 1.75 ) . max ( 1 )
} ,
2020-09-14 19:26:10 +00:00
6 ( sb , su ) {
return Decimal . pow ( sb . div ( 1e3 ) . add ( 1 ) , su )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
7 ( sb , su ) {
return sb . add ( 1 ) . log10 ( ) . times ( su . cbrt ( ) ) . div ( 25 ) . add ( 1 )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
8 ( sb , su ) {
2020-09-16 02:50:53 +00:00
return sb . times ( su . sqr ( ) ) . div ( 100 ) . max ( 1 ) . log10 ( ) . add ( 1 )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
9 ( sb , su ) {
return sb . times ( su ) . max ( 1 ) . log10 ( ) . add ( 1 )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
10 ( sb , su ) {
2020-09-16 20:56:29 +00:00
return sb . add ( 1 ) . pow ( su . cbrt ( ) . div ( 5 ) )
2020-09-13 02:38:32 +00:00
}
}
}
2020-09-14 19:26:10 +00:00
let VERSION = {
num : 1.1 ,
name : "The Life Update"
}
2020-09-15 19:27:33 +00:00
VERSION . withoutName = "v" + VERSION . num + ( VERSION . pre ? " Pre-Release " + VERSION . pre : VERSION . pre ? " Beta " + VERSION . beta : "" )
2020-09-14 19:26:10 +00:00
VERSION . withName = VERSION . withoutName + ( VERSION . name ? ": " + VERSION . name : "" )
2020-09-14 02:41:42 +00:00
let IMPERIUM = {
2020-09-14 19:26:10 +00:00
lifeReq ( ) {
return Decimal . pow ( 10 , player . i . lifeBricks . times ( 2 ) . sqr ( ) . add ( 15 ) )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
lifeTarget ( ) {
return player . l . power . log10 ( ) . sub ( 15 ) . sqrt ( ) . div ( 2 ) . add ( 1 ) . floor ( )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
canBuild ( ) {
let cost = this . cost ( )
return player . i . building || ( player . i . points . gte ( cost . i ) && player . i . lifeBricks . gte ( cost . l ) )
2020-09-14 02:41:42 +00:00
} ,
2020-09-14 19:26:10 +00:00
build ( ) {
2020-09-14 02:41:42 +00:00
if ( ! this . canBuild ( ) ) return
if ( player . i . building ) {
if ( ! confirm ( "Are you sure?" ) ) return
delete player . i . building
} else {
2020-09-14 19:26:10 +00:00
let cost = this . cost ( )
player . i . points = player . i . points . sub ( cost . i )
player . i . lifeBricks = player . i . lifeBricks . sub ( cost . l )
2020-09-14 02:41:42 +00:00
player . i . building = 1
doReset ( "i" , true )
}
player . i . progress = 0
} ,
2020-09-14 19:26:10 +00:00
cost ( x ) {
if ( x === undefined ) x = player . i . extraBuildings
let sub = player . sp . upgrades . includes ( 45 ) ? 3 : 0
return {
2020-09-16 02:50:53 +00:00
i : x . times ( 1.75 ) . add ( 0.5 ) . sub ( sub ) . ceil ( ) ,
2020-09-14 19:26:10 +00:00
l : x . times ( 1.5 ) . add ( 1 ) . sub ( sub ) . ceil ( )
}
} ,
speed ( ) {
2020-09-15 00:45:31 +00:00
let x = Decimal . pow ( 3.75 , player . i . extraBuildings . add ( 5 ) ) . recip ( )
2020-09-14 19:26:10 +00:00
x = x . times ( IMPERIUM . sgSpeedBoost ( ) )
2020-09-15 19:27:33 +00:00
if ( player . sp . upgrades . includes ( 45 ) ) x = x . times ( 5 )
2020-09-14 19:26:10 +00:00
return x
} ,
sgSpeedBoost ( ) {
2020-09-16 02:50:53 +00:00
return player . sg . points . add ( 1 ) . pow ( 2 )
2020-09-16 14:25:07 +00:00
} ,
collapsed ( row ) {
return tmp . i !== undefined && tmp . i . collapse !== undefined && tmp . i . collapse [ row ]
} ,
maxCollapseRows : 1
2020-09-14 02:41:42 +00:00
}
2020-09-16 02:50:53 +00:00
const ENDGAME = new Decimal ( "e280000000" ) ;
2020-09-10 01:28:47 +00:00
2020-09-11 02:15:05 +00:00
function keepGoing ( ) {
player . keepGoing = true ;
showTab ( "tree" )
}
2020-09-15 14:38:47 +00:00
function toNumber ( x ) {
if ( x . mag !== undefined ) return x . toNumber ( )
if ( x + 0 !== x ) return parseFloat ( x )
return x
}
2020-09-14 22:12:36 +00:00
function addTime ( diff , layer ) {
let data = player
let time = data . timePlayed
if ( layer ) {
data = data [ layer ]
time = data . time
}
//I am not that good to perfectly fix that leak. ~ DB Aarex
if ( time + 0 !== time ) {
console . log ( "Memory leak detected. Trying to fix..." )
2020-09-15 14:38:47 +00:00
time = toNumber ( time )
2020-09-14 22:12:36 +00:00
if ( isNaN ( time ) || time == 0 ) {
console . log ( "Couldn't fix! Resetting..." )
time = layer ? player . timePlayed : 0
if ( ! layer ) player . timePlayedReset = true
}
}
2020-09-15 14:38:47 +00:00
time += toNumber ( diff )
2020-09-14 22:12:36 +00:00
if ( layer ) data . time = time
else data . timePlayed = time
}
2020-08-19 02:50:24 +00:00
function gameLoop ( diff ) {
2020-09-14 19:26:10 +00:00
if ( player . points . gte ( ENDGAME ) || gameEnded ) gameEnded = 1
2020-09-09 22:14:05 +00:00
if ( isNaN ( diff ) ) diff = 0
2020-09-10 01:46:36 +00:00
if ( gameEnded && ! player . keepGoing ) {
diff = 0
player . tab = "gameEnded"
2020-09-10 01:28:47 +00:00
}
2020-09-14 19:26:10 +00:00
if ( player . devSpeed ) diff *= player . devSpeed
2020-09-14 21:18:02 +00:00
2020-09-14 22:12:36 +00:00
addTime ( diff )
addTime ( diff , "h" )
2020-09-14 21:18:02 +00:00
2020-09-14 02:41:42 +00:00
if ( tmp . challActive ? tmp . challActive . h [ 42 ] : true ) {
2020-09-09 22:14:05 +00:00
if ( player . h . time >= 10 ) diff = 0
else diff = Decimal . div ( diff , Decimal . div ( 10 , Decimal . sub ( 10 , player . h . time + 1 ) ) . pow ( 1000 ) )
2020-08-29 19:45:18 +00:00
}
2020-09-14 02:41:42 +00:00
if ( diff === 0 ) return
2020-09-14 19:26:10 +00:00
if ( player . p . upgrades . includes ( 11 ) ) player . points = player . points . add ( tmp . pointGen . times ( diff ) ) . max ( 0 )
if ( player . g . unl ) player . g . power = player . g . power . add ( tmp . layerEffs . g . times ( diff ) ) . max ( 0 )
2020-09-09 22:14:05 +00:00
if ( player . g . best . gte ( 10 ) ) generatePoints ( "p" , diff )
2020-08-19 02:50:24 +00:00
if ( player . t . unl ) {
2020-08-21 19:02:34 +00:00
let data = tmp . layerEffs . t
2020-09-14 19:26:10 +00:00
player . t . energy = player . t . energy . add ( data . gain . times ( diff ) ) . min ( data . limit ) . max ( 0 )
2020-08-19 02:50:24 +00:00
}
2020-09-14 19:26:10 +00:00
if ( player . sg . unl ) player . sg . power = player . sg . power . add ( tmp . layerEffs . sg . times ( diff ) ) . max ( 0 )
2020-08-26 01:45:22 +00:00
if ( player . q . unl ) {
2020-08-26 16:26:46 +00:00
let mult = getQuirkLayerMult ( )
2020-09-14 19:26:10 +00:00
player . q . time = player . q . time . add ( mult . times ( diff ) ) . max ( 0 )
2020-08-26 01:45:22 +00:00
let exp = getQuirkEnergyGainExp ( )
2020-09-14 19:26:10 +00:00
if ( exp . gte ( 0 ) ) player . q . energy = player . q . energy . add ( player . q . time . pow ( exp ) . times ( mult ) . times ( diff ) ) . max ( 0 )
2020-08-26 01:45:22 +00:00
}
2020-09-09 22:14:05 +00:00
if ( player . q . best . gte ( 15 ) ) generatePoints ( "e" , diff )
2020-09-14 19:26:10 +00:00
if ( player . ss . unl ) player . ss . subspace = player . ss . subspace . add ( tmp . layerEffs . ss . times ( diff ) ) . max ( 0 )
2020-09-03 21:59:23 +00:00
if ( player . ba . unl ) {
2020-09-14 19:26:10 +00:00
player . ba . power = player . ba . power . add ( tmp . layerEffs . ba . power . times ( tmp . balEff2 ) . times ( getBalPowGainMult ( ) ) . times ( diff ) ) . max ( 0 )
player . ba . positivity = player . ba . positivity . add ( tmp . layerEffs . ba . pos . times ( getPosGainMult ( ) ) . times ( diff ) ) . max ( 0 )
player . ba . negativity = player . ba . negativity . add ( tmp . layerEffs . ba . neg . times ( getNegGainMult ( ) ) . times ( diff ) ) . max ( 0 )
2020-09-03 21:59:23 +00:00
}
2020-09-10 02:44:25 +00:00
if ( player . m . unl ) {
for ( let i = 1 ; i <= tmp . spellsUnl ; i ++ ) {
player . m . spellTimes [ i ] = Decimal . sub ( player . m . spellTimes [ i ] , diff ) . max ( 0 ) . toNumber ( )
}
}
2020-09-10 13:18:18 +00:00
if ( player . m . total . gte ( 3 ) ) {
2020-09-09 22:14:05 +00:00
generatePoints ( "h" , diff )
generatePoints ( "q" , diff )
2020-09-04 02:25:24 +00:00
}
2020-09-14 19:26:10 +00:00
if ( player . m . total . gte ( 2.5 e9 ) ) player . m . hexes = player . m . hexes . add ( getHexGain ( ) . times ( diff ) ) . max ( 0 )
2020-09-09 02:10:25 +00:00
if ( player . sp . total . gte ( 10 ) ) {
2020-09-09 22:14:05 +00:00
generatePoints ( "m" , diff )
generatePoints ( "ba" , diff )
2020-09-09 02:10:25 +00:00
}
2020-09-14 19:26:10 +00:00
if ( player . hs . best . gte ( 2e4 ) ) generatePoints ( "sp" , Decimal . div ( diff , 100 ) )
2020-09-11 02:15:05 +00:00
if ( player . l . unl ) {
2020-09-15 00:45:31 +00:00
player . l . power = LIFE _BOOSTERS . calcNewPower ( diff )
2020-09-14 02:41:42 +00:00
for ( var i = 1 ; i <= tmp . l . lbUnl ; i ++ ) player . l . boosters [ i ] = LIFE _BOOSTERS . reqTarget ( i ) . max ( player . l . boosters [ i ] )
2020-09-11 02:15:05 +00:00
}
2020-09-14 02:41:42 +00:00
if ( player . hs . unl ) player . hs . superUpgradeCap = player . hs . superUpgradeCap . max ( HYPERSPACE . nextCapTarget ( ) )
if ( player . i . unl ) {
player . i . lifeBricks = player . i . lifeBricks . max ( IMPERIUM . lifeTarget ( ) )
if ( player . i . building ) player . i . progress += IMPERIUM . speed ( ) . times ( diff ) . toNumber ( )
if ( player . i . progress >= 1 ) {
player . i . progress = 0
player . i . extraBuildings = player . i . extraBuildings . add ( 1 )
delete player . i . building
}
2020-09-13 02:38:32 +00:00
}
2020-08-26 03:32:27 +00:00
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 ( )
2020-08-26 14:16:23 +00:00
if ( player . t . auto && player . q . best . gte ( 10 ) ) doReset ( "t" )
if ( player . s . auto && player . q . best . gte ( 10 ) ) doReset ( "s" )
2020-09-11 23:10:57 +00:00
if ( player . s . autoBuild && player . ss . best . gte ( 1 ) ) for ( let i = tmp . s . trueSbUnl ; i >= 1 ; i -- ) maxSpaceBuilding ( i )
2020-08-26 14:16:23 +00:00
if ( player . sb . auto && player . h . best . gte ( 15 ) ) doReset ( "sb" )
2020-09-04 17:45:22 +00:00
if ( player . sg . auto && player . sg . best . gte ( 2 ) ) doReset ( "sg" )
2020-09-04 02:25:24 +00:00
if ( player . q . auto && player . ba . best . gte ( 3 ) ) maxQuirkLayers ( )
2020-09-10 13:18:18 +00:00
if ( player . hb . auto && player . m . total . gte ( 4 ) ) doReset ( "hb" )
if ( player . ss . auto && player . m . total . gte ( 4 ) ) doReset ( "ss" )
2020-09-09 02:10:25 +00:00
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
}
2020-09-10 13:18:18 +00:00
if ( player . m . auto && player . m . total . gte ( 50 ) ) for ( let i = 1 ; i <= tmp . spellsUnl ; i ++ ) activateSpell ( i )
2020-09-14 19:26:10 +00:00
if ( player . ps . auto && player . ps . best . gte ( 2 ) ) doReset ( "ps" )
2020-08-26 03:32:27 +00:00
2020-08-24 02:01:14 +00:00
if ( player . hasNaN && ! NaNalert ) {
2020-08-25 22:42:43 +00:00
clearInterval ( interval ) ;
2020-08-26 01:45:22 +00:00
player . autosave = false ;
2020-08-24 02:01:14 +00:00
NaNalert = true ;
2020-09-14 21:18:02 +00:00
alert ( "We have detected a corruption in your save. Please visit https://discord.gg/wwQfgPa for help." )
2020-08-24 02:01:14 +00:00
}
2020-08-19 02:50:24 +00:00
}
function hardReset ( ) {
if ( ! confirm ( "Are you sure you want to do this? You will lose all your progress!" ) ) return
player = getStartPlayer ( )
save ( ) ;
window . location . reload ( ) ;
}
var saveInterval = setInterval ( function ( ) {
2020-08-19 22:20:42 +00:00
if ( player === undefined ) return ;
2020-09-10 01:39:08 +00:00
if ( gameEnded && ! player . keepGoing ) return ;
2020-08-19 02:50:24 +00:00
if ( player . autosave ) save ( ) ;
} , 5000 )
2020-09-15 00:45:31 +00:00
var ticking = false
2020-08-19 02:50:24 +00:00
var interval = setInterval ( function ( ) {
2020-08-31 18:33:29 +00:00
if ( player === undefined || tmp === undefined ) return ;
2020-09-15 00:45:31 +00:00
if ( ticking ) return ;
2020-09-10 01:39:08 +00:00
if ( gameEnded && ! player . keepGoing ) return ;
2020-09-15 00:45:31 +00:00
ticking = true
let now = Date . now ( )
2020-09-15 19:27:33 +00:00
let diff = ( now - player . time ) / 1e3
if ( player . offTime !== undefined ) {
if ( player . offTime . remain > 0 ) {
let offlineDiff = Math . max ( player . offTime . remain / 10 , diff )
player . offTime . remain -= offlineDiff
diff += offlineDiff
}
if ( ! player . offlineProd || player . offTime . remain <= 0 ) delete player . offTime
2020-09-01 00:39:33 +00:00
}
2020-09-15 19:27:33 +00:00
if ( player . devSpeed ) diff *= player . devSpeed
2020-09-15 00:45:31 +00:00
player . time = now
2020-08-22 03:59:24 +00:00
if ( needCanvasUpdate ) resizeCanvas ( ) ;
2020-08-21 19:02:34 +00:00
updateTemp ( ) ;
2020-09-09 22:14:05 +00:00
gameLoop ( diff )
2020-09-15 00:45:31 +00:00
ticking = false
2020-08-19 22:12:31 +00:00
} , 50 )
2020-09-14 19:26:10 +00:00
const themes = {
1 : "aqua"
}
const theme _names = {
aqua : "Aqua"
}
function changeTheme ( ) {
let aqua = player . theme == "aqua"
colors _theme = colors [ player . theme || "default" ]
2020-09-14 21:18:02 +00:00
document . body . style . setProperty ( '--background' , aqua ? "#001f3f" : "#0f0f0f" )
document . body . style . setProperty ( '--background_tooltip' , aqua ? "rgba(0, 15, 31, 0.75)" : "rgba(0, 0, 0, 0.75)" )
document . body . style . setProperty ( '--color' , aqua ? "#bfdfff" : "#dfdfdf" )
document . body . style . setProperty ( '--points' , aqua ? "#dfefff" : "#ffffff" )
2020-09-14 19:26:10 +00:00
}
function getThemeName ( ) {
return player . theme ? theme _names [ player . theme ] : "Default"
}
function switchTheme ( ) {
if ( player . theme === undefined ) player . theme = themes [ 1 ]
else {
player . theme = themes [ Object . keys ( themes ) [ player . theme ] + 1 ]
if ( ! player . theme ) delete player . theme
}
changeTheme ( )
resizeCanvas ( )
}
2020-08-19 22:12:31 +00:00
document . onkeydown = function ( e ) {
2020-08-19 22:20:42 +00:00
if ( player === undefined ) return ;
2020-09-10 01:39:08 +00:00
if ( gameEnded && ! player . keepGoing ) return ;
2020-08-19 22:12:31 +00:00
let shiftDown = e . shiftKey
2020-08-29 23:43:53 +00:00
let ctrlDown = e . ctrlKey
2020-08-19 22:12:31 +00:00
let key = e . key
2020-09-11 02:15:05 +00:00
if ( onFocused ) return
2020-09-15 00:45:31 +00:00
if ( ctrlDown && key != "-" && key != "_" && key != "+" && key != "=" && key != "r" && key != "R" && key != "F5" ) e . preventDefault ( )
2020-09-11 02:15:05 +00:00
if ( player . m . unl && key >= 0 && key <= 9 ) {
if ( key == 0 ) activateSpell ( 10 )
else activateSpell ( key )
return
} else if ( ( ! LAYERS . includes ( key ) ) || ctrlDown || shiftDown ) {
2020-08-22 03:59:24 +00:00
switch ( key ) {
2020-09-03 21:59:23 +00:00
case "a" :
if ( player . ba . unl ) doReset ( "ba" )
2020-09-11 02:15:05 +00:00
return
2020-08-29 23:43:53 +00:00
case "b" :
if ( ctrlDown && player . hb . unl ) doReset ( "hb" )
2020-09-11 02:15:05 +00:00
return
2020-08-22 03:59:24 +00:00
case "B" :
if ( player . sb . unl ) doReset ( "sb" )
2020-09-11 02:15:05 +00:00
return
2020-09-04 17:45:22 +00:00
case "G" :
if ( player . sg . unl ) doReset ( "sg" )
2020-09-11 02:15:05 +00:00
return
case "s" :
2020-09-14 21:18:02 +00:00
if ( ctrlDown && player . hs . unl ) doReset ( "hs" )
2020-09-11 02:15:05 +00:00
return
2020-08-29 23:43:53 +00:00
case "S" :
if ( player . ss . unl ) doReset ( "ss" )
2020-09-11 02:15:05 +00:00
return
case "p" :
if ( ctrlDown && player . sp . unl ) doReset ( "ps" )
return
2020-09-09 02:10:25 +00:00
case "P" :
if ( player . sp . unl ) doReset ( "sp" )
2020-09-11 02:15:05 +00:00
return
2020-08-22 03:59:24 +00:00
}
} else if ( player [ key ] . unl ) doReset ( key )
2020-09-11 02:15:05 +00:00
}
var onFocused = false
function focused ( x ) {
onFocused = x
2020-08-19 22:12:31 +00:00
}