import{_asi,cass,a0ast,oasa}from"./chunks/framework.P9qPzDnn.js";constm=JSON.parse('{"title":"Requirements","description":"","frontmatter":{},"headers":[],"relativePath":"guide/important-concepts/requirements.md","filePath":"guide/important-concepts/requirements.md","lastUpdated":1737059031000}'),n={name:"guide/important-concepts/requirements.md"};functionr(l,e,h,p,o,u){returna(),s("div",null,e[0]||(e[0]=[t(`<h1 id="requirements" tabindex="-1">Requirements <a class="header-anchor" href="#requirements" aria-label="Permalink to "Requirements""></a></h1><p>The requirements system in Profectus is designed to handle various conditions that must be met before certain actions or features can be accessed by the player. These conditions can include resource amounts, completed challenges, or other milestones within the game.</p><h2 id="creating-requirements" tabindex="-1">Creating Requirements <a class="header-anchor" href="#creating-requirements" aria-label="Permalink to "Creating Requirements""></a></h2><p>To create a requirement, you can use one of the provided utility functions like <a href="/api/game/requirements/functions/createCostRequirement">createCostRequirement</a>, <a href="/api/game/requirements/functions/createVisibilityRequirement">createVisibilityRequirement</a>, or <a href="/api/game/requirements/functions/createBooleanRequirement">createBooleanRequirement</a>. These functions return a <code>Requirement</code> object with specific properties that define the requirement conditions.</p><p>Cost requirements are probably the most common requirement you'll be using. For something with multiple levels, like repeatables, you'll typically want to use a formula for the cost instead of a function, and the input to the formula will be the repeatable's <code>amount</code> property. Typically that means the code will look like this:</p><div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes material-theme-palenight material-theme-palenight vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#C792EA;--shiki-dark:#C792EA;">const</span><span style="--shiki-light:#BABED8;--shiki-dark:#BABED8;"> repeatable </span><span style="--shiki-light:#89DDFF;--shiki-dark:#89DDFF;">=</span><span style="--shiki-light:#82AAFF;--shiki-dark:#82AAFF;"> createRepeatable</span><span style="--shiki-light:#BABED8;--shiki-dark:#BABED8;">(</span><span style="--shiki-light:#89DDFF;--shiki-dark:#89DDFF;">()</span><span style="--shiki-light:#C792EA;--shiki-dark:#C792EA;"> =></span><span style="--shiki-light:#BABED8;--shiki-dark:#BABED8;"> (</span><span style="--shiki-light:#89DDFF;--shiki-dark:#89DDFF;">{</span></span>