effectDisplay(){returnformat(this.effect())+"x"},// Add formatting to the effect
},
13:{
description:"Unlock a <b>secret subtab</b> and make this layer act if you unlocked it first.",
cost:newDecimal(69),
currencyDisplayName:"candies",// Use if using a nonstandard currency
currencyInternalName:"points",// Use if using a nonstandard currency
currencyLocation:"",// The object in player data that the currency is contained in
unlocked(){return(hasUpgrade(this.layer,12))},
onPurchase(){// This function triggers when the upgrade is purchased
player[this.layer].unlockOrder=0
},
style(){
if(hasUpgrade(this.layer,this.id))return{
'background-color':'#1111dd'
}
elseif(!canAffordUpgrade(this.layer,this.id)){
return{
'background-color':'#dd1111'
}
}// Otherwise use the default
},
},
22:{
title:"This upgrade doesn't exist",
description:"Or does it?.",
currencyLocation(){returnplayer[this.layer].buyables},// The object in player data that the currency is contained in
currencyDisplayName:"exhancers",// Use if using a nonstandard currency
currencyInternalName:11,// Use if using a nonstandard currency
cost:newDecimal(3),
unlocked(){returnplayer[this.layer].unlocked},// The upgrade is only visible when this is true
},
},
buyables:{
rows:1,
cols:12,
showRespec:true,
respec(){// Optional, reset things and give back your currency. Having this function makes a respec button appear
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
},
respecText:"Respec Thingies",// Text on Respec button, optional
11:{
title:"Exhancers",// Optional, displayed at the top in a larger font
cost(x=player[this.layer].buyables[this.id]){// cost for buying xth buyable, can be an object if there are multiple currencies
if(x.gte(25))x=x.pow(2).div(25)
letcost=Decimal.pow(2,x.pow(1.5))
returncost.floor()
},
effect(x=player[this.layer].buyables[this.id]){// Effects of owning x of the items, x is a decimal
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
},
buyMax(){},// You'll have to handle this yourself if you want
style:{'height':'222px'},
sellOne(){
letamount=getBuyableAmount(this.layer,this.id)
if(amount.lte(0))return// Only sell one if there is at least one
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.
if(layers[resettingLayer].row>this.row)layerDataReset(this.layer,["upgrades","challenges"])// This is actually the default behavior
},
layerShown(){returntrue},// Condition for when layer appears on the tree
automate(){
},// Do any automation inherent to this layer if appropriate
resetsNothing(){returnfalse},
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.
hotkeys:[
{key:"c",description:"C: reset for lollipops or whatever",onPress(){if(canReset(this.layer))doReset(this.layer)}},
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)
},
resetDescription:"Melt your points into ",
})
// This layer is mostly minimal but it uses a custom prestige type and a clickable
addLayer("f",{
startData(){return{
unlocked:false,
points:newDecimal(0),
boop:false,
clickables:{[11]:"Start"}// Optional default Clickable state
}},
color:"#FE0102",
requires(){returnnewDecimal(10)},
resource:"farm points",
baseResource:"candies",
baseAmount(){returnplayer.points},
type:"custom",// A "Custom" type which is effectively static
exponent:0.5,
base:3,
roundUpCost:true,
canBuyMax(){returnhasAchievement('a',13)},
gainMult(){
returnnewDecimal(1)
},
gainExp(){
returnnewDecimal(1)
},
row:1,
layerShown(){returntrue},
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))
// 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)"