pages/assets/public_gamedevtree_docs_milestones.md.Idyk5tE3.js

7 lines
3.8 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as e,q as s,p as t,ag as i}from"./chunks/framework.DvHfxfnp.js";const m=JSON.parse('{"title":"Milestones","description":"","frontmatter":{},"headers":[],"relativePath":"public/gamedevtree/docs/milestones.md","filePath":"public/gamedevtree/docs/milestones.md"}'),a={name:"public/gamedevtree/docs/milestones.md"},n=i(`<h1 id="milestones" tabindex="-1">Milestones <a class="header-anchor" href="#milestones" aria-label="Permalink to &quot;Milestones&quot;"></a></h1><p>Milestones are awarded to the player when they meet a certain goal, and give some benefit. Milestones should be formatted like this:</p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> milestones</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> requirementDesc: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;123 waffles&quot;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> etc</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span></code></pre></div><p>You can use hasMilestone(layer, id) to determine if the player has a given milestone</p><p>Milestone features:</p><ul><li><p>requirementDesc: A string describing the requirement for unlocking this milestone. Suggestion: Use a &quot;total&quot;. It can also be a function that returns updating text. Can use basic HTML.</p></li><li><p>effectDesc: A string describing the reward for having the milestone. <em>You will have to implement the reward elsewhere.</em> It can also be a function that returns updating text. Can use basic HTML.</p></li><li><p>done(): A function returning a boolean to determine if the milestone should be awarded.</p></li><li><p>toggles: <em>optional</em>, Creates toggle buttons that appear on the milestone when it is unlocked. The toggles can toggle a given boolean value in a layer. It is defined as an array of paired items, one pair per toggle. The first is the internal name of the layer the value being toggled is stored in, and the second is the internal name of the variable to toggle. (e.g. [[&quot;b&quot;, &quot;auto&quot;], [&quot;g&quot;, &quot;auto&quot;])</p><pre><code> **Tip:** Toggles are not de-set if the milestone becomes locked! In this case, you should also check if the player has the milestone.
</code></pre></li><li><p>style: <strong>Optional</strong>, Applies CSS to this milestone, in the form of an object where the keys are CSS attributes, and the values are the values for those attributes (both as strings)</p></li><li><p>unlocked(): <strong>Optional</strong> A function returning a boolean to determine if the milestone should be shown. If absent, it is always shown.</p></li><li><p>layer: <strong>Assigned automagically</strong>. It&#39;s the same value as the name of this layer, so you can do player[this.layer].points or similar</p></li><li><p>id: <strong>Assigned automagically</strong>. It&#39;s the &quot;key&quot; which the milestone was stored under, for convenient access. The milestone in the example&#39;s id is 0.</p></li></ul>`,6),o=[n];function l(r,h,p,d,c,u){return t(),s("div",null,o)}const k=e(a,[["render",l]]);export{m as __pageData,k as default};