63 lines
14 KiB
JavaScript
63 lines
14 KiB
JavaScript
import{_ as s,o as n,c as a,Q as l}from"./chunks/framework.1169fbc9.js";const d=JSON.parse('{"title":"Basic layer breakdown","description":"","frontmatter":{},"headers":[],"relativePath":"public/kronos/docs/basic-layer-breakdown.md","filePath":"public/kronos/docs/basic-layer-breakdown.md","lastUpdated":1664930814000}'),o={name:"public/kronos/docs/basic-layer-breakdown.md"},e=l(`<h1 id="basic-layer-breakdown" tabindex="-1">Basic layer breakdown <a class="header-anchor" href="#basic-layer-breakdown" aria-label="Permalink to "Basic layer breakdown""></a></h1><p>This is a very minimal layer with minimal features. Most things will require additional features.</p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki github-dark vp-code-dark"><code><span class="line"><span style="color:#B392F0;">addLayer</span><span style="color:#E1E4E8;">(</span><span style="color:#9ECBFF;">"p"</span><span style="color:#E1E4E8;">, {</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">startData</span><span style="color:#E1E4E8;">() { </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> { </span><span style="color:#6A737D;">// startData is a function that returns default data for a layer. </span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> unlocked: </span><span style="color:#79B8FF;">true</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// You can add more variables here to add them to your layer.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> points: </span><span style="color:#F97583;">new</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">Decimal</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">0</span><span style="color:#E1E4E8;">), </span><span style="color:#6A737D;">// "points" is the internal name for the main resource of the layer.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> }},</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> color: </span><span style="color:#9ECBFF;">"#4BDC13"</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// The color for this layer, which affects many elements.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> resource: </span><span style="color:#9ECBFF;">"prestige points"</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// The name of this layer's main prestige resource.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> row: </span><span style="color:#79B8FF;">0</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// The row this layer is on (0 is the first row).</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> baseResource: </span><span style="color:#9ECBFF;">"points"</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// The name of the resource your prestige gain is based on.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">baseAmount</span><span style="color:#E1E4E8;">() { </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> player.points }, </span><span style="color:#6A737D;">// A function to return the current amount of baseResource.</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> requires: </span><span style="color:#F97583;">new</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">Decimal</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">10</span><span style="color:#E1E4E8;">), </span><span style="color:#6A737D;">// The amount of the base needed to gain 1 of the prestige currency.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#6A737D;">// Also the amount required to unlock the layer.</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> type: </span><span style="color:#9ECBFF;">"normal"</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// Determines the formula used for calculating prestige currency.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> exponent: </span><span style="color:#79B8FF;">0.5</span><span style="color:#E1E4E8;">, </span><span style="color:#6A737D;">// "normal" prestige gain is (currency^exponent).</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">gainMult</span><span style="color:#E1E4E8;">() { </span><span style="color:#6A737D;">// Returns your multiplier to your gain of the prestige resource.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">new</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">Decimal</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">) </span><span style="color:#6A737D;">// Factor in any bonuses multiplying gain here.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> },</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">gainExp</span><span style="color:#E1E4E8;">() { </span><span style="color:#6A737D;">// Returns your exponent to your gain of the prestige resource.</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> </span><span style="color:#F97583;">new</span><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">Decimal</span><span style="color:#E1E4E8;">(</span><span style="color:#79B8FF;">1</span><span style="color:#E1E4E8;">)</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> },</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#B392F0;">layerShown</span><span style="color:#E1E4E8;">() { </span><span style="color:#F97583;">return</span><span style="color:#E1E4E8;"> </span><span style="color:#79B8FF;">true</span><span style="color:#E1E4E8;"> }, </span><span style="color:#6A737D;">// Returns a bool for if this layer's node should be visible in the tree.</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> upgrades: {</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> </span><span style="color:#6A737D;">// Look in the upgrades docs to see what goes here!</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;"> },</span></span>
|
||
<span class="line"><span style="color:#E1E4E8;">})</span></span></code></pre><pre class="shiki github-light vp-code-light"><code><span class="line"><span style="color:#6F42C1;">addLayer</span><span style="color:#24292E;">(</span><span style="color:#032F62;">"p"</span><span style="color:#24292E;">, {</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">startData</span><span style="color:#24292E;">() { </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> { </span><span style="color:#6A737D;">// startData is a function that returns default data for a layer. </span></span>
|
||
<span class="line"><span style="color:#24292E;"> unlocked: </span><span style="color:#005CC5;">true</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// You can add more variables here to add them to your layer.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> points: </span><span style="color:#D73A49;">new</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">Decimal</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">0</span><span style="color:#24292E;">), </span><span style="color:#6A737D;">// "points" is the internal name for the main resource of the layer.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> }},</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> color: </span><span style="color:#032F62;">"#4BDC13"</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// The color for this layer, which affects many elements.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> resource: </span><span style="color:#032F62;">"prestige points"</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// The name of this layer's main prestige resource.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> row: </span><span style="color:#005CC5;">0</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// The row this layer is on (0 is the first row).</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> baseResource: </span><span style="color:#032F62;">"points"</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// The name of the resource your prestige gain is based on.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">baseAmount</span><span style="color:#24292E;">() { </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> player.points }, </span><span style="color:#6A737D;">// A function to return the current amount of baseResource.</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> requires: </span><span style="color:#D73A49;">new</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">Decimal</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">10</span><span style="color:#24292E;">), </span><span style="color:#6A737D;">// The amount of the base needed to gain 1 of the prestige currency.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6A737D;">// Also the amount required to unlock the layer.</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> type: </span><span style="color:#032F62;">"normal"</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// Determines the formula used for calculating prestige currency.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> exponent: </span><span style="color:#005CC5;">0.5</span><span style="color:#24292E;">, </span><span style="color:#6A737D;">// "normal" prestige gain is (currency^exponent).</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">gainMult</span><span style="color:#24292E;">() { </span><span style="color:#6A737D;">// Returns your multiplier to your gain of the prestige resource.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">new</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">Decimal</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">) </span><span style="color:#6A737D;">// Factor in any bonuses multiplying gain here.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> },</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">gainExp</span><span style="color:#24292E;">() { </span><span style="color:#6A737D;">// Returns your exponent to your gain of the prestige resource.</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> </span><span style="color:#D73A49;">new</span><span style="color:#24292E;"> </span><span style="color:#6F42C1;">Decimal</span><span style="color:#24292E;">(</span><span style="color:#005CC5;">1</span><span style="color:#24292E;">)</span></span>
|
||
<span class="line"><span style="color:#24292E;"> },</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6F42C1;">layerShown</span><span style="color:#24292E;">() { </span><span style="color:#D73A49;">return</span><span style="color:#24292E;"> </span><span style="color:#005CC5;">true</span><span style="color:#24292E;"> }, </span><span style="color:#6A737D;">// Returns a bool for if this layer's node should be visible in the tree.</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="color:#24292E;"> upgrades: {</span></span>
|
||
<span class="line"><span style="color:#24292E;"> </span><span style="color:#6A737D;">// Look in the upgrades docs to see what goes here!</span></span>
|
||
<span class="line"><span style="color:#24292E;"> },</span></span>
|
||
<span class="line"><span style="color:#24292E;">})</span></span></code></pre></div>`,3),p=[e];function t(r,c,y,E,i,u){return n(),a("div",null,p)}const F=s(o,[["render",t]]);export{d as __pageData,F as default};
|