2020-08-19 02:50:24 +00:00
var app ;
function loadVue ( ) {
2020-09-11 02:15:05 +00:00
Vue . component ( 'layer-node' , {
props : [ 'layer' , 'abb' ] ,
template : `
< button v - if = "nodeShown(layer)"
v - bind : id = "layer"
v - on : click = " function ( ) {
showTab ( layer )
} "
v - bind : tooltip = "
2020-09-24 15:54:41 +00:00
player [ layer ] . unl ? formatWhole ( player [ layer ] . points ) + ' ' + layers [ layer ] . resource
: 'Reach ' + formatWhole ( tmp . layerReqs [ layer ] ) + ' ' + layers [ layer ] . baseResource + ' to unlock (You have ' + formatWhole ( tmp . layerAmt [ layer ] ) + ' ' + layers [ layer ] . baseResource + ')'
2020-09-11 02:15:05 +00:00
"
v - bind : class = " {
treeNode : true ,
[ layer ] : true ,
2020-09-24 15:54:41 +00:00
hidden : ! layers [ layer ] . layerShown ( ) ,
2020-09-27 20:25:06 +00:00
locked : ! player [ layer ] . unl && ! tmp . layerAmt [ layer ] . gte ( tmp . layerReqs [ layer ] ) ,
2020-09-24 15:54:41 +00:00
can : layerUnl ( layer ) ,
} "
v - bind : style = " {
'background-color' : layers [ layer ] . color ,
2020-09-11 02:15:05 +00:00
} " >
{ { abb } }
< / b u t t o n >
`
} )
2020-09-28 01:00:10 +00:00
Vue . component ( 'challs' , {
props : [ 'layer' ] ,
template : `
< div v - if = "layers[layer].challs" class = "upgTable" >
< div v - for = "row in layers[layer].challs.rows" class = "upgRow" >
< div v - for = "col in layers[layer].challs.cols" >
< div v - if = "layers[layer].challs[row*10+col].unl()" v - bind : class = "{hChall: true, done: player[layer].challs.includes(row*10+col), canComplete: tmp.challActive[layer][row*10+col]&&!player[layer].challs.includes(row*10+col)&&canCompleteChall(layer, row*10+col)}" >
< br > < h3 > { { layers [ layer ] . challs [ row * 10 + col ] . name } } < / h 3 > < b r > < b r >
< button v - bind : class = "{ longUpg: true, can: true, [layer]: true }" v - bind : style = "{'background-color': layers[layer].color}" v - on : click = "startChall(layer, row*10+col)" > { { player [ layer ] . active == ( row * 10 + col ) ? ( canCompleteChall ( layer , row * 10 + col ) ? "Finish" : "Exit Early" ) : ( player [ layer ] . challs . includes ( row * 10 + col ) ? "Completed" : "Start" ) } } < / b u t t o n > < b r > < b r >
{ { layers [ layer ] . challs [ row * 10 + col ] . desc } } < br >
Goal : { { format ( layers [ layer ] . challs [ row * 10 + col ] . goal ) } } { { layers [ layer ] . challs [ row * 10 + col ] . currencyDisplayName ? layers [ layer ] . challs [ row * 10 + col ] . currencyDisplayName : "points" } } < br >
Reward : { { layers [ layer ] . challs [ row * 10 + col ] . reward } } < br >
< span v - if = "layers[layer].challs[row*10+col].effDisp!==undefined" > Currently : { { ( layers [ layer ] . challs [ row * 10 + col ] . effDisp ) ? ( layers [ layer ] . challs [ row * 10 + col ] . effDisp ( layers [ layer ] . challs [ row * 10 + col ] . effect ( ) ) ) : format ( layers [ layer ] . challs [ row * 10 + col ] . effect ( ) ) } } < / s p a n >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
`
} )
Vue . component ( 'upgrades' , {
props : [ 'layer' ] ,
template : `
< div v - if = "layers[layer].upgrades" class = "upgTable" >
< div v - for = "row in layers[layer].upgrades.rows" class = "upgRow" >
< div v - for = "col in layers[layer].upgrades.cols" class = "upgAlign" >
< button v - if = "layers[layer].upgrades[row*10+col].unl()" v - on : click = "buyUpg(layer, row*10+col)" v - bind : class = "{ [layer]: true, upg: true, bought: player[layer].upgrades.includes(row*10+col), locked: (!(canAffordUpg(layer, row*10+col))&&!player[layer].upgrades.includes(row*10+col)), can: (canAffordUpg(layer, row*10+col)&&!player[layer].upgrades.includes(row*10+col))}" v - bind : style = "{'background-color': layers[layer].color}" > { { layers [ layer ] . upgrades [ row * 10 + col ] . desc } } < span v - if = "layers[layer].upgrades[row*10+col].effect" > < br > Currently : { { ( layers [ layer ] . upgrades [ row * 10 + col ] . effDisp ) ? ( layers [ layer ] . upgrades [ row * 10 + col ] . effDisp ( layers [ layer ] . upgrades [ row * 10 + col ] . effect ( ) ) ) : format ( layers [ layer ] . upgrades [ row * 10 + col ] . effect ( ) ) } } < / s p a n > < b r > < b r > C o s t : { { f o r m a t W h o l e ( l a y e r s [ l a y e r ] . u p g r a d e s [ r o w * 1 0 + c o l ] . c o s t ) } } { { ( l a y e r s [ l a y e r ] . u p g r a d e s [ r o w * 1 0 + c o l ] . c u r r e n c y D i s p l a y N a m e ? l a y e r s [ l a y e r ] . u p g r a d e s [ r o w * 1 0 + c o l ] . c u r r e n c y D i s p l a y N a m e : l a y e r s [ l a y e r ] . r e s o u r c e ) } } < / b u t t o n >
< / d i v >
< / d i v >
< / d i v >
`
} )
Vue . component ( 'milestones' , {
props : [ 'layer' ] ,
template : `
< div v - if = "layers[layer].milestones" >
< table >
< tr v - for = "id in Object.keys(layers[layer].milestones)" >
< td v - if = "milestoneShown(layer, id)" v - bind : class = "{milestone: !player[layer].milestones.includes(id), milestoneDone: player[layer].milestones.includes(id)}" > < h3 > { { layers [ layer ] . milestones [ id ] . requirementDesc } } < / h 3 > < b r > { { l a y e r s [ l a y e r ] . m i l e s t o n e s [ i d ] . e f f e c t D e s c } } < b r > < s p a n v - i f = " ( l a y e r s [ l a y e r ] . m i l e s t o n e s [ i d ] . t o g g l e s ) & & ( p l a y e r [ l a y e r ] . m i l e s t o n e s . i n c l u d e s ( i d ) ) " v - f o r = " t o g g l e i n l a y e r s [ l a y e r ] . m i l e s t o n e s [ i d ] . t o g g l e s " > < t o g g l e : l a y e r = " l a y e r " : d a t a = " t o g g l e " > < / t o g g l e > & n b s p ; < / s p a n > < / t d > < / t r >
< / t r >
< / t a b l e >
< / d i v >
`
} )
Vue . component ( 'toggle' , {
props : [ 'layer' , 'data' ] ,
template : `
< button class = "smallUpg can" v - bind : style = "{'background-color': layers[data[0]].color}" v - on : click = "toggleAuto(data)" > { { player [ data [ 0 ] ] [ data [ 1 ] ] ? "ON" : "OFF" } } < / b u t t o n >
`
} )
Vue . component ( 'prestige-button' , {
props : [ 'layer' ] ,
template : `
< button v - if = "layers[layer].type=='normal'" v - bind : class = "{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.layerReqs[layer]), can: tmp.layerAmt[layer].gte(tmp.layerReqs[layer]) }" v - bind : style = "{'background-color': layers[layer].color}" v - on : click = "doReset(layer)" > < span v - if = "player[layer].points.lt(1e3)" > Reset for < / s p a n > + < b > { { f o r m a t W h o l e ( t m p . r e s e t G a i n [ l a y e r ] ) } } < / b > { { l a y e r s [ l a y e r ] . r e s o u r c e } } < s p a n v - i f = " t m p . r e s e t G a i n [ l a y e r ] . l t ( 1 0 0 ) & & p l a y e r [ l a y e r ] . p o i n t s . l t ( 1 e 3 ) " > < b r > < b r > N e x t a t { { ( l a y e r s [ l a y e r ] . r e s C e i l ? f o r m a t W h o l e ( t m p . n e x t A t [ l a y e r ] ) : f o r m a t ( t m p . n e x t A t [ l a y e r ] ) ) } } { { l a y e r s [ l a y e r ] . b a s e R e s o u r c e } } < / s p a n > < / b u t t o n >
< button v - if = "layers[layer].type=='static'" v - bind : class = "{ [layer]: true, reset: true, locked: tmp.layerAmt[layer].lt(tmp.nextAt[layer]), can: tmp.layerAmt[layer].gte(tmp.nextAt[layer]) }" v - bind : style = "{'background-color': layers[layer].color}" v - on : click = "doReset(layer)" > < span v - if = "player[layer].points.lt(10)" > Reset for < / s p a n > + < b > { { f o r m a t W h o l e ( t m p . r e s e t G a i n [ l a y e r ] ) } } < / b > { { l a y e r s [ l a y e r ] . r e s o u r c e } } < b r > < b r > < s p a n v - i f = " p l a y e r [ l a y e r ] . p o i n t s . l t ( 1 0 ) " > R e q : { { f o r m a t W h o l e ( t m p . l a y e r A m t [ l a y e r ] ) } } / < / s p a n > { { ( l a y e r s [ l a y e r ] . r e s C e i l ? f o r m a t W h o l e ( t m p . n e x t A t [ l a y e r ] ) : f o r m a t ( t m p . n e x t A t [ l a y e r ] ) ) } } { { l a y e r s [ l a y e r ] . b a s e R e s o u r c e } } < / b u t t o n >
`
} )
// data = content
Vue . component ( 'display-text' , {
props : [ 'layer' , 'data' ] ,
template : `
< span > { { data ( ) } } < / s p a n >
`
} )
// text, colorful and with the shadowy effect. You can probably do other custom text effects if you want.
Vue . component ( 'colored-text' , {
props : [ 'layer' , 'data' , 'data2' ] ,
template : `
< span v - bind : style = "{'color': data2, 'text-shadow': '0px 0px 10px' + data2}" > { { data ( ) } } < / s p a n >
`
} )
// Blank lines
Vue . component ( 'blank' , {
props : [ 'layer' , 'data' ] ,
template : `
< br >
`
} )
2020-08-19 02:50:24 +00:00
app = new Vue ( {
2020-09-11 02:15:05 +00:00
el : "#app" ,
data : {
player ,
tmp ,
2020-09-24 15:54:41 +00:00
layers ,
2020-09-11 02:15:05 +00:00
Decimal ,
format ,
formatWhole ,
formatTime ,
focused ,
2020-09-14 19:26:10 +00:00
getThemeName ,
2020-09-11 02:15:05 +00:00
layerUnl ,
doReset ,
buyUpg ,
2020-09-14 02:41:42 +00:00
startChall ,
2020-09-11 02:15:05 +00:00
milestoneShown ,
keepGoing ,
2020-09-14 19:26:10 +00:00
VERSION ,
ENDGAME ,
2020-09-24 15:54:41 +00:00
LAYERS
2020-09-11 02:15:05 +00:00
} ,
2020-08-19 02:50:24 +00:00
} )
}