2020-10-03 19:45:47 +00:00
addLayer ( "c" , {
layer : "c" , // This is assigned automatically, both to the layer and all upgrades, etc. Shown here so you know about it
2020-10-07 15:08:20 +00:00
name : "Candies" , // This is optional, only used in a few places, If absent it just uses the layer id.
2020-10-11 03:26:26 +00:00
symbol : "C" , // This appears on the layer's node. Default is the id with the first letter capitalized
position : 0 , // Horizontal position within a row. By default it uses the layer id and sorts in alphabetical order
2020-09-24 15:54:41 +00:00
startData ( ) { return {
2020-10-13 03:08:19 +00:00
unlocked : true ,
2020-09-24 15:54:41 +00:00
points : new Decimal ( 0 ) ,
2020-09-24 23:32:34 +00:00
best : new Decimal ( 0 ) ,
total : new Decimal ( 0 ) ,
2020-10-01 00:25:14 +00:00
buyables : { } , // You don't actually have to initialize this one
2020-09-24 21:46:57 +00:00
beep : false ,
2020-09-24 15:54:41 +00:00
} } ,
2020-10-15 01:52:48 +00:00
color : "#4BDC13" ,
requires : new Decimal ( 10 ) , // Can be a function that takes requirement increases into account
2020-09-24 15:54:41 +00:00
resource : "lollipops" , // Name of prestige currency
baseResource : "candies" , // Name of resource prestige is based on
2020-10-03 19:45:47 +00:00
baseAmount ( ) { return player . points } , // Get the current amount of baseResource
2020-09-24 15:54:41 +00:00
type : "normal" , // normal: cost to gain currency depends on amount gained. static: cost depends on how much you already have
exponent : 0.5 , // Prestige currency exponent
base : 5 , // Only needed for static layers, base of the formula (b^(x^exp))
2020-10-13 03:08:19 +00:00
roundUpCost : false , // True if the cost needs to be rounded up (use when baseResource is static?)
2020-10-03 19:45:47 +00:00
canBuyMax ( ) { } , // Only needed for static layers with buy max
gainMult ( ) { // Calculate the multiplier for main currency from bonuses
2020-09-24 15:54:41 +00:00
mult = new Decimal ( 1 )
2020-10-13 03:08:19 +00:00
if ( hasUpgrade ( this . layer , 166 ) ) mult = mult . times ( 2 ) // These upgrades don't exist
if ( hasUpgrade ( this . layer , 120 ) ) mult = mult . times ( upgradeEffect ( this . layer , 120 ) )
2020-09-24 15:54:41 +00:00
return mult
} ,
2020-10-03 19:45:47 +00:00
gainExp ( ) { // Calculate the exponent on main currency from bonuses
2020-09-24 15:54:41 +00:00
return new Decimal ( 1 )
} ,
2020-10-03 19:45:47 +00:00
row : 0 , // Row the layer is in on the tree (0 is the first row)
effect ( ) {
return { // Formulas for any boosts inherent to resources in the layer. Can return a single value instead of an object if there is just one effect
waffleBoost : ( true == false ? 0 : Decimal . pow ( player [ this . layer ] . points , 0.2 ) ) ,
icecreamCap : ( player [ this . layer ] . points * 10 )
2020-09-24 15:54:41 +00:00
} } ,
2020-10-03 19:45:47 +00:00
effectDescription ( ) { // Optional text to describe the effects
2020-10-04 21:14:13 +00:00
eff = this . effect ( ) ;
2020-10-07 03:11:36 +00:00
eff . waffleBoost = eff . waffleBoost . times ( buyableEffect ( this . layer , 11 ) . first )
2020-09-24 15:54:41 +00:00
return "which are boosting waffles by " + format ( eff . waffleBoost ) + " and increasing the Ice Cream cap by " + format ( eff . icecreamCap )
} ,
2020-09-24 21:46:57 +00:00
milestones : {
2020-10-15 01:52:48 +00:00
0 : { requirementDescription : "3 Lollipops" ,
2020-10-07 20:41:45 +00:00
done ( ) { return player [ this . layer ] . best . gte ( 3 ) } , // Used to determine when to give the milestone
2020-10-15 01:52:48 +00:00
effectDescription : "Unlock the next milestone" ,
2020-09-24 21:46:57 +00:00
} ,
2020-10-15 01:52:48 +00:00
1 : { requirementDescription : "4 Lollipops" ,
2020-10-13 03:08:19 +00:00
unlocked ( ) { return hasMilestone ( this . layer , 0 ) } ,
2020-10-07 20:41:45 +00:00
done ( ) { return player [ this . layer ] . best . gte ( 4 ) } ,
2020-10-15 01:52:48 +00:00
effectDescription : "You can toggle beep and boop (which do nothing)" ,
2020-10-07 20:41:45 +00:00
toggles : [
[ "c" , "beep" ] , // Each toggle is defined by a layer and the data toggled for that layer
[ "f" , "boop" ] ] ,
style ( ) {
if ( hasMilestone ( this . layer , this . id ) ) return {
'background-color' : '#1111DD'
} } ,
} ,
2020-09-24 21:46:57 +00:00
} ,
2020-10-13 03:08:19 +00:00
challenges : {
2020-10-11 01:52:27 +00:00
rows : 2 ,
cols : 12 ,
2020-10-03 19:45:47 +00:00
11 : {
2020-10-15 01:52:48 +00:00
name : "Fun" ,
2020-10-11 20:42:32 +00:00
completionLimit : 3 ,
2020-10-13 03:08:19 +00:00
challengeDescription ( ) { return "Makes the game 0% harder<br>" + challengeCompletions ( this . layer , this . id ) + "/" + this . completionLimit + " completions" } ,
unlocked ( ) { return player [ this . layer ] . best . gt ( 0 ) } ,
2020-10-15 01:52:48 +00:00
goal : new Decimal ( "20" ) ,
2020-10-03 19:45:47 +00:00
currencyDisplayName : "lollipops" , // Use if using a nonstandard currency
currencyInternalName : "points" , // Use if using a nonstandard currency
currencyLayer : this . layer , // Leave empty if not in a layer
2020-10-13 03:08:19 +00:00
rewardEffect ( ) {
2020-10-03 19:45:47 +00:00
let ret = player [ this . layer ] . points . add ( 1 ) . tetrate ( 0.02 )
return ret ;
} ,
2020-10-13 03:08:19 +00:00
rewardDisplay ( ) { return format ( this . rewardEffect ( ) ) + "x" } ,
2020-10-03 19:45:47 +00:00
countsAs : [ 12 , 21 ] , // Use this for if a challenge includes the effects of other challenges. Being in this challenge "counts as" being in these.
2020-10-13 03:08:19 +00:00
rewardDescription : "Says hi" ,
2020-10-03 19:45:47 +00:00
onComplete ( ) { console . log ( "hiii" ) } // Called when you complete the challenge
} ,
} ,
2020-09-24 15:54:41 +00:00
upgrades : {
2020-10-11 01:32:41 +00:00
rows : 2 ,
2020-09-24 15:54:41 +00:00
cols : 3 ,
11 : {
2020-10-15 01:52:48 +00:00
title : "Generator of Genericness" ,
description : "Gain 1 Point every second." ,
cost : new Decimal ( 1 ) ,
2020-10-13 03:08:19 +00:00
unlocked ( ) { return player [ this . layer ] . unlocked } , // The upgrade is only visible when this is true
2020-09-24 15:54:41 +00:00
} ,
12 : {
2020-10-15 01:52:48 +00:00
description : "Candy generation is faster based on your unspent Lollipops." ,
cost : new Decimal ( 1 ) ,
2020-10-13 03:08:19 +00:00
unlocked ( ) { return ( hasUpgrade ( this . layer , 11 ) ) } ,
2020-10-03 19:45:47 +00:00
effect ( ) { // Calculate bonuses from the upgrade. Can return a single value or an object with multiple values
let ret = player [ this . layer ] . points . add ( 1 ) . pow ( player [ this . layer ] . upgrades . includes ( 24 ) ? 1.1 : ( player [ this . layer ] . upgrades . includes ( 14 ) ? 0.75 : 0.5 ) )
2020-09-24 15:54:41 +00:00
if ( ret . gte ( "1e20000000" ) ) ret = ret . sqrt ( ) . times ( "1e10000000" )
return ret ;
} ,
2020-10-10 03:16:29 +00:00
effectDisplay ( ) { return format ( this . effect ( ) ) + "x" } , // Add formatting to the effect
2020-09-24 15:54:41 +00:00
} ,
13 : {
2020-10-15 01:52:48 +00:00
description : "Unlock a <b>secret subtab</b> and make this layer act if you unlocked it first." ,
cost : new Decimal ( 69 ) ,
2020-09-24 15:54:41 +00:00
currencyDisplayName : "candies" , // Use if using a nonstandard currency
currencyInternalName : "points" , // Use if using a nonstandard currency
currencyLayer : "" , // Leave empty if not in a layer "e.g. points"
2020-10-13 03:08:19 +00:00
unlocked ( ) { return ( hasUpgrade ( this . layer , 12 ) ) } ,
2020-10-03 19:45:47 +00:00
onPurchase ( ) { // This function triggers when the upgrade is purchased
2020-10-15 03:31:05 +00:00
player [ this . layer ] . unlockOrder = 0
2020-10-07 20:41:45 +00:00
} ,
style ( ) {
2020-10-13 03:08:19 +00:00
if ( hasUpgrade ( this . layer , this . id ) ) return {
2020-10-07 20:41:45 +00:00
'background-color' : '#1111dd'
}
2020-10-13 03:08:19 +00:00
else if ( ! canAffordUpgrade ( this . layer , this . id ) ) {
2020-10-07 20:41:45 +00:00
return {
'background-color' : '#dd1111'
}
} // Otherwise use the default
} ,
2020-09-24 15:54:41 +00:00
} ,
2020-10-11 01:32:41 +00:00
22 : {
2020-10-15 01:52:48 +00:00
title : "This upgrade doesn't exist" ,
description : "Or does it?." ,
cost : new Decimal ( 3 ) ,
2020-10-13 03:08:19 +00:00
unlocked ( ) { return player [ this . layer ] . unlocked } , // The upgrade is only visible when this is true
2020-10-11 01:32:41 +00:00
} ,
2020-09-24 15:54:41 +00:00
} ,
2020-10-01 00:25:14 +00:00
buyables : {
rows : 1 ,
2020-10-11 01:52:27 +00:00
cols : 12 ,
2020-10-01 00:25:14 +00:00
respec ( ) { // Optional, reset things and give back your currency. Having this function makes a respec button appear
2020-10-03 19:45:47 +00:00
player [ this . layer ] . points = player [ this . layer ] . points . add ( player [ this . layer ] . spentOnBuyables ) // A built-in thing to keep track of this but only keeps a single value
resetBuyables ( this . layer )
doReset ( this . layer , true ) // Force a reset
2020-10-01 00:25:14 +00:00
} ,
2020-10-15 01:52:48 +00:00
respecText : "Respec Thingies" , // Text on Respec button, optional
2020-10-01 00:25:14 +00:00
11 : {
2020-10-15 01:52:48 +00:00
title : "Exhancers" , // Optional, displayed at the top in a larger font
2020-10-10 03:16:29 +00:00
cost ( x = player [ this . layer ] . buyables [ this . id ] ) { // cost for buying xth buyable, can be an object if there are multiple currencies
2020-10-01 00:25:14 +00:00
if ( x . gte ( 25 ) ) x = x . pow ( 2 ) . div ( 25 )
let cost = Decimal . pow ( 2 , x . pow ( 1.5 ) )
return cost . floor ( )
} ,
2020-10-10 03:16:29 +00:00
effect ( x = player [ this . layer ] . buyables [ this . id ] ) { // Effects of owning x of the items, x is a decimal
2020-10-01 00:25:14 +00:00
let eff = { }
if ( x . gte ( 0 ) ) eff . first = Decimal . pow ( 25 , x . pow ( 1.1 ) )
else eff . first = Decimal . pow ( 1 / 25 , x . times ( - 1 ) . pow ( 1.1 ) )
if ( x . gte ( 0 ) ) eff . second = x . pow ( 0.8 )
else eff . second = x . times ( - 1 ) . pow ( 0.8 ) . times ( - 1 )
return eff ;
} ,
2020-10-03 19:45:47 +00:00
display ( ) { // Everything else displayed in the buyable button after the title
2020-10-10 03:16:29 +00:00
let data = tmp [ this . layer ] . buyables [ this . id ]
2020-10-01 00:25:14 +00:00
return "Cost: " + format ( data . cost ) + " lollipops \ n \
2020-10-03 20:47:56 +00:00
Amount : " + player[this.layer].buyables[this.id] + " \ n \
2020-10-03 19:45:47 +00:00
Adds + " + format(data.effect.first) + " things and multiplies stuff by " + format ( data . effect . second )
2020-10-01 00:25:14 +00:00
} ,
2020-10-13 03:08:19 +00:00
unlocked ( ) { return player [ this . layer ] . unlocked } ,
2020-10-03 19:45:47 +00:00
canAfford ( ) {
2020-10-10 03:16:29 +00:00
return player [ this . layer ] . points . gte ( tmp [ this . layer ] . buyables [ this . id ] . cost ) } ,
2020-10-03 19:45:47 +00:00
buy ( ) {
2020-10-10 03:16:29 +00:00
cost = tmp [ this . layer ] . buyables [ this . id ] . cost
2020-10-03 19:45:47 +00:00
player [ this . layer ] . points = player [ this . layer ] . points . sub ( cost )
2020-10-03 20:47:56 +00:00
player [ this . layer ] . buyables [ this . id ] = player [ this . layer ] . buyables [ this . id ] . add ( 1 )
2020-10-03 19:45:47 +00:00
player [ this . layer ] . spentOnBuyables = player [ this . layer ] . spentOnBuyables . add ( cost ) // This is a built-in system that you can use for respeccing but it only works with a single Decimal value
2020-10-01 00:25:14 +00:00
} ,
buyMax ( ) { } , // You'll have to handle this yourself if you want
2020-10-11 02:08:20 +00:00
style : { 'height' : '222px' }
2020-10-01 00:25:14 +00:00
} ,
} ,
2020-10-03 19:45:47 +00:00
doReset ( resettingLayer ) { // Triggers when this layer is being reset, along with the layer doing the resetting. Not triggered by lower layers resetting, but is by layers on the same row.
2020-10-13 22:56:17 +00:00
if ( layers [ resettingLayer ] . row > this . row ) layerDataReset ( this . layer , [ "upgrades" , "challenges" ] ) // This is actually the default behavior
2020-09-24 21:46:57 +00:00
} ,
2020-10-03 19:45:47 +00:00
layerShown ( ) { return true } , // Condition for when layer appears on the tree
2020-09-24 15:54:41 +00:00
automate ( ) {
} , // Do any automation inherent to this layer if appropriate
resetsNothing ( ) { return false } ,
2020-10-03 19:45:47 +00:00
onPrestige ( gain ) {
return
} , // Useful for if you gain secondary resources or have other interesting things happen to this layer when you reset it. You gain the currency after this function ends.
2020-10-01 01:30:50 +00:00
hotkeys : [
2020-10-13 03:08:19 +00:00
{ key : "c" , description : "C: reset for lollipops or whatever" , onPress ( ) { if ( player [ this . layer ] . unlocked ) doReset ( this . layer ) } } ,
{ key : "ctrl+c" + this . layer , description : "Ctrl+c: respec things" , onPress ( ) { if ( player [ this . layer ] . unlocked ) respecBuyables ( this . layer ) } } ,
2020-10-01 01:30:50 +00:00
] ,
2020-10-15 03:31:05 +00:00
increaseUnlockOrder : [ ] , // Array of layer names to have their order increased when this one is first unlocked
2020-10-01 01:30:50 +00:00
2020-10-07 03:11:36 +00:00
microtabs : {
stuff : {
first : {
content : [ "upgrades" , [ "display-text" , function ( ) { return "confirmed" } ] ]
} ,
second : {
content : [ [ "upgrade" , 11 ] ,
[ "row" , [ [ "upgrade" , 11 ] , "blank" , "blank" , [ "upgrade" , 11 ] , ] ] ,
[ "display-text" , function ( ) { return "double confirmed" } ] ]
} ,
} ,
otherStuff : {
// There could be another set of microtabs here
}
} ,
2020-10-12 22:28:12 +00:00
bars : {
2020-10-09 03:13:15 +00:00
longBoi : {
2020-10-12 22:28:12 +00:00
fillStyle : { 'background-color' : "#FFFFFF" } ,
baseStyle : { 'background-color' : "#696969" } ,
textStyle : { 'color' : '#04e050' } ,
2020-10-09 03:13:15 +00:00
2020-10-12 22:28:12 +00:00
borderStyle ( ) { return { } } ,
direction : RIGHT ,
width : 300 ,
height : 30 ,
2020-10-09 03:13:15 +00:00
progress ( ) {
2020-10-12 22:28:12 +00:00
return ( player . points . log ( 10 ) . div ( 10 ) ) . toNumber ( )
2020-10-09 03:13:15 +00:00
} ,
display ( ) {
2020-10-12 22:28:12 +00:00
return format ( player . points ) + " / 1e10 points"
} ,
2020-10-15 01:52:48 +00:00
unlocked : true ,
2020-10-12 22:28:12 +00:00
} ,
tallBoi : {
fillStyle : { 'background-color' : "#4BEC13" } ,
baseStyle : { 'background-color' : "#000000" } ,
textStyle : { 'text-shadow' : '0px 0px 2px #000000' } ,
borderStyle ( ) { return { } } ,
direction : UP ,
width : 50 ,
height : 200 ,
progress ( ) {
return player . points . div ( 100 )
} ,
display ( ) {
return formatWhole ( ( player . points . div ( 1 ) ) . min ( 100 ) ) + "%"
} ,
2020-10-15 01:52:48 +00:00
unlocked : true ,
2020-10-12 22:28:12 +00:00
} ,
flatBoi : {
fillStyle : { 'background-color' : "#FE0102" } ,
baseStyle : { 'background-color' : "#222222" } ,
textStyle : { 'text-shadow' : '0px 0px 2px #000000' } ,
borderStyle ( ) { return { } } ,
direction : UP ,
width : 100 ,
height : 30 ,
progress ( ) {
return player . c . points . div ( 50 )
2020-10-09 03:13:15 +00:00
} ,
2020-10-15 01:52:48 +00:00
unlocked : true ,
2020-10-09 03:13:15 +00:00
} ,
} ,
2020-09-28 01:00:10 +00:00
// Optional, lets you format the tab yourself by listing components. You can create your own components in v.js.
2020-10-04 17:10:04 +00:00
tabFormat : {
2020-10-07 04:57:41 +00:00
"main tab" : {
2020-10-07 20:41:45 +00:00
buttonStyle ( ) { return { 'color' : 'orange' } } ,
2020-10-07 03:11:36 +00:00
content :
[ "main-display" ,
2020-10-10 03:16:29 +00:00
"prestige-button" ,
2020-10-07 03:11:36 +00:00
[ "blank" , "5px" ] , // Height
[ "raw-html" , function ( ) { return "<button onclick='console.log(`yeet`)'>'HI'</button>" } ] ,
[ "display-text" ,
function ( ) { return 'I have ' + format ( player . points ) + ' pointy points!' } ,
{ "color" : "red" , "font-size" : "32px" , "font-family" : "Comic Sans MS" } ] ,
2020-10-13 03:08:19 +00:00
"h-line" , "milestones" , "blank" , "upgrades" , "challenges" ] ,
2020-10-07 03:11:36 +00:00
} ,
thingies : {
2020-10-07 20:41:45 +00:00
style ( ) { return { 'background-color' : '#222222' } } ,
buttonStyle ( ) { return { 'border-color' : 'orange' } } ,
2020-10-12 22:28:12 +00:00
content : [
2020-10-11 02:08:20 +00:00
[ "buyables" , "" ] , "blank" ,
2020-10-07 03:11:36 +00:00
[ "row" , [
[ "toggle" , [ "c" , "beep" ] ] , [ "blank" , [ "30px" , "10px" ] ] , // Width, height
[ "display-text" , function ( ) { return "Beep" } ] , "blank" , [ "v-line" , "200px" ] ,
[ "column" , [
2020-10-10 03:16:29 +00:00
[ "prestige-button" , "" , { 'width' : '150px' , 'height' : '80px' } ] ,
[ "prestige-button" , "" , { 'width' : '100px' , 'height' : '150px' } ] ,
2020-10-07 03:11:36 +00:00
] ] ,
] , { 'width' : '600px' , 'height' : '350px' , 'background-color' : 'green' , 'border-style' : 'solid' } ] ,
"blank" ,
[ "display-image" , "discord.png" ] , ] ,
} ,
2020-10-12 22:28:12 +00:00
jail : {
content : [
[ "bar" , "longBoi" ] , "blank" ,
[ "row" , [
[ "column" , [
[ "display-text" , "Sugar level:" , { 'color' : 'teal' } ] , "blank" , [ "bar" , "tallBoi" ] ] ,
{ 'background-color' : '#555555' , 'padding' : '15px' } ] ,
"blank" ,
[ "column" , [
[ "display-text" , "idk" ] ,
[ "blank" , [ '0' , '50px' ] ] , [ "bar" , "flatBoi" ]
] ] ,
] ] ,
2020-10-13 03:28:02 +00:00
"blank" , [ "display-text" , "It's jail because \"bars\"! So funny! Ha ha!" ] ,
2020-10-12 22:28:12 +00:00
] ,
} ,
2020-10-07 03:11:36 +00:00
illuminati : {
2020-10-13 03:08:19 +00:00
unlocked ( ) { return ( hasUpgrade ( "c" , 13 ) ) } ,
2020-10-07 03:11:36 +00:00
content : [
2020-10-12 22:28:12 +00:00
[ "raw-html" , function ( ) { return "<h1> C O N F I R M E D </h1>" } ] , "blank" ,
2020-10-07 03:11:36 +00:00
[ "microtabs" , "stuff" , { 'width' : '600px' , 'height' : '350px' , 'background-color' : 'brown' , 'border-style' : 'solid' } ]
]
}
2020-10-04 17:10:04 +00:00
} ,
2020-10-03 19:45:47 +00:00
style ( ) { return {
2020-10-12 22:28:12 +00:00
//'background-color': '#3325CC'
2020-10-07 20:41:45 +00:00
} } ,
nodeStyle ( ) { return { // Style on the layer node
'color' : '#3325CC' ,
'text-decoration' : 'underline'
2020-10-03 19:45:47 +00:00
} } ,
2020-10-07 20:41:45 +00:00
componentStyles : {
2020-10-13 03:08:19 +00:00
"challenge" ( ) { return { 'height' : '200px' } } ,
2020-10-07 20:41:45 +00:00
"prestige-button" ( ) { return { 'color' : '#AA66AA' } } ,
} ,
tooltip ( ) { // Optional, tooltip displays when the layer is unlocked
let tooltip = formatWhole ( player [ this . layer ] . points ) + " " + this . resource
if ( player [ this . layer ] . buyables [ 11 ] . gt ( 0 ) ) tooltip += "\n" + formatWhole ( player [ this . layer ] . buyables [ 11 ] ) + " Exhancers"
return tooltip
} ,
2020-10-04 15:23:38 +00:00
shouldNotify ( ) { // Optional, layer will be highlighted on the tree if true.
// Layer will automatically highlight if an upgrade is purchasable.
return ( player . c . buyables [ 11 ] == 1 )
2020-10-10 03:16:29 +00:00
} ,
2020-10-13 03:08:19 +00:00
resetDescription : "Melt your points into " ,
2020-10-03 19:45:47 +00:00
} )
2020-09-24 21:46:57 +00:00
2020-10-11 20:16:36 +00:00
// This layer is mostly minimal but it uses a custom prestige type and a clickable
2020-10-03 19:45:47 +00:00
addLayer ( "f" , {
2020-10-14 23:34:15 +00:00
startData ( ) { return {
unlocked : false ,
points : new Decimal ( 0 ) ,
boop : false ,
clickables : { [ 11 ] : "Start" } // Optional default Clickable state
} } ,
2020-10-15 01:52:48 +00:00
color : "#FE0102" ,
2020-10-14 23:34:15 +00:00
requires ( ) { return new Decimal ( 10 ) } ,
resource : "farm points" ,
baseResource : "candies" ,
baseAmount ( ) { return player . points } ,
type : "custom" , // A "Custom" type which is effectively static
exponent : 0.5 ,
base : 3 ,
roundUpCost : true ,
2020-10-15 01:52:48 +00:00
canBuyMax ( ) { return hasAchievement ( 'a' , 13 ) } ,
2020-10-14 23:34:15 +00:00
gainMult ( ) {
return new Decimal ( 1 )
} ,
gainExp ( ) {
return new Decimal ( 1 )
} ,
row : 1 ,
layerShown ( ) { return true } ,
branches : [ "c" ] , // When this layer appears, a branch will appear from this layer to any layers here. Each entry can be a pair consisting of a layer id and a color.
tooltipLocked ( ) { // Optional, tooltip displays when the layer is locked
return ( "This weird farmer dinosaur will only see you if you have at least " + this . requires ( ) + " candies. You only have " + formatWhole ( player . points ) )
} ,
midsection : [
"blank" , [ 'display-image' , 'https://images.beano.com/store/24ab3094eb95e5373bca1ccd6f330d4406db8d1f517fc4170b32e146f80d?auto=compress%2Cformat&dpr=1&w=390' ] ,
[ "display-text" , "Bork bork!" ]
] ,
// The following are only currently used for "custom" Prestige type:
prestigeButtonText ( ) { //Is secretly HTML
if ( ! this . canBuyMax ( ) ) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you a Farm Point in exchange for all of your candies and lollipops! (At least " + formatWhole ( tmp [ this . layer ] . nextAt ) + " candies)"
if ( this . canBuyMax ( ) ) return "Hi! I'm a <u>weird dinosaur</u> and I'll give you <b>" + formatWhole ( tmp [ this . layer ] . resetGain ) + "</b> Farm Points in exchange for all of your candies and lollipops! (You'll get another one at " + formatWhole ( tmp [ layer ] . nextAtDisp ) + " candies)"
} ,
getResetGain ( ) {
return getResetGain ( this . layer , useType = "static" )
} ,
getNextAt ( canMax = false ) { //
return getNextAt ( this . layer , canMax , useType = "static" )
} ,
canReset ( ) {
return tmp [ this . layer ] . baseAmount . gte ( tmp [ this . layer ] . nextAt )
} ,
// This is also non minimal, a Clickable!
clickables : {
rows : 1 ,
cols : 1 ,
masterButtonPress ( ) { // Optional, reset things and give back your currency. Having this function makes a respec button appear
if ( getClickableState ( this . layer , 11 ) == "Borkened..." )
player [ this . layer ] . clickables [ 11 ] = "Start"
} ,
masterButtonText ( ) { return ( getClickableState ( this . layer , 11 ) == "Borkened..." ) ? "Fix the clickable!" : "Does nothing" } , // Text on Respec button, optional
11 : {
2020-10-15 01:52:48 +00:00
title : "Clicky clicky!" , // Optional, displayed at the top in a larger font
2020-10-14 23:34:15 +00:00
display ( ) { // Everything else displayed in the buyable button after the title
let data = getClickableState ( this . layer , this . id )
return "Current state:<br>" + data
} ,
unlocked ( ) { return player [ this . layer ] . unlocked } ,
canClick ( ) {
return getClickableState ( this . layer , this . id ) !== "Borkened..." } ,
onClick ( ) {
switch ( getClickableState ( this . layer , this . id ) ) {
case "Start" :
player [ this . layer ] . clickables [ this . id ] = "A new state!"
break ;
case "A new state!" :
player [ this . layer ] . clickables [ this . id ] = "Keep going!"
break ;
case "Keep going!" :
player [ this . layer ] . clickables [ this . id ] = "Maybe that's a bit too far..."
break ;
case "Maybe that's a bit too far..." :
player [ this . layer ] . clickables [ this . id ] = "Borkened..."
break ;
default :
player [ this . layer ] . clickables [ this . id ] = "Start"
break ;
}
} ,
style ( ) {
switch ( getClickableState ( this . layer , this . id ) ) {
case "Start" :
return { 'background-color' : 'green' }
break ;
case "A new state!" :
return { 'background-color' : 'yellow' }
break ;
case "Keep going!" :
return { 'background-color' : 'orange' }
break ;
case "Maybe that's a bit too far..." :
return { 'background-color' : 'red' }
break ;
default :
return { }
break ;
} } ,
} ,
} ,
} ,
)
// This layer is mostly minimal but it uses a custom prestige type and a clickable
addLayer ( "a" , {
2020-09-24 15:54:41 +00:00
startData ( ) { return {
2020-10-14 23:34:15 +00:00
unlocked : true ,
2020-09-24 15:54:41 +00:00
points : new Decimal ( 0 ) ,
} } ,
2020-10-14 23:34:15 +00:00
color : "yellow" ,
2020-10-15 01:43:16 +00:00
resource : "achievement power" ,
2020-10-15 03:09:30 +00:00
type : "none" ,
2020-10-14 23:34:15 +00:00
row : "side" ,
2020-09-24 21:46:57 +00:00
layerShown ( ) { return true } ,
2020-10-15 01:43:16 +00:00
tooltip ( ) { // Optional, tooltip displays when the layer is locked
return ( "Achievements" )
2020-10-11 20:16:36 +00:00
} ,
2020-10-15 01:43:16 +00:00
achievements : {
rows : 2 ,
cols : 3 ,
11 : {
name : "Get me!" ,
done ( ) { return true } , // This one is a freebie
goalTooltip : "How did this happen?" , // Shows when achievement is not completed
doneTooltip : "You did it!" , // Showed when the achievement is completed
} ,
12 : {
name : "Impossible!" ,
done ( ) { return false } ,
goalTooltip : "Mwahahaha!" , // Shows when achievement is not completed
doneTooltip : "HOW????" , // Showed when the achievement is completed
} ,
13 : {
name : "EIEIO" ,
done ( ) { return player . f . points . gte ( 1 ) } ,
goalTooltip : "Get a farm point." , // Shows when achievement is not completed
2020-10-15 03:24:34 +00:00
doneTooltip : "Get a farm point.\n\nReward: The dinosaur is now your friend (you can max Farm Points)." , // Showed when the achievement is completed
2020-10-15 01:43:16 +00:00
onComplete ( ) { console . log ( "Bork bork bork!" ) }
} ,
} ,
2020-10-15 03:09:30 +00:00
midsection : [
"achievements" ,
2020-10-15 01:43:16 +00:00
]
2020-09-24 15:54:41 +00:00
} ,
2020-10-03 19:45:47 +00:00
)
2020-09-24 15:54:41 +00:00