This commit is contained in:
thepaperpilot 2022-12-01 06:29:03 +00:00
parent bdbd6d21fc
commit 074eb39703
225 changed files with 455 additions and 455 deletions
public/gamedevtree/docs/buyables

View file

@ -6,8 +6,8 @@
<title>Buyables | The Paper Pilot</title>
<meta name="description" content="The Paper Pilot portfolio site">
<link rel="stylesheet" href="/assets/style.1dbbf581.css">
<link rel="modulepreload" href="/assets/app.f001dff6.js">
<link rel="modulepreload" href="/assets/public_gamedevtree_docs_buyables.md.b96d398b.lean.js">
<link rel="modulepreload" href="/assets/app.99998402.js">
<link rel="modulepreload" href="/assets/public_gamedevtree_docs_buyables.md.0150160d.lean.js">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Pacifico&amp;family=Roboto+Mono:ital,wght@0,400;0,600;1,400&amp;display=swap">
@ -36,8 +36,8 @@
<span class="line"><span style="color:#F07178;"> </span><span style="color:#A6ACCD;">etc</span></span>
<span class="line"><span style="color:#F07178;"> </span><span style="color:#89DDFF;">}</span></span>
<span class="line"></span></code></pre></div><p>Features:</p><ul><li><p>title: <strong>optional</strong>, displayed at the top in a larger font It can also be a function that returns updating text.</p></li><li><p>cost(): cost for buying the next buyable. Can have an optional argument &quot;x&quot; to calculate the cost of the x+1th object, but needs to use &quot;current amount&quot; as a default value for x. (x is a Decimal). Can return an object if there are multiple currencies.</p></li><li><p>effect(): <strong>optional</strong>, A function that calculates and returns the current values of bonuses of this buyable. Can return a value or an object containing multiple values.</p></li><li><p>display(): A function returning everything that should be displayed on the buyable after the title, likely including the description, amount bought, cost, and current effect. Can use basic HTML.</p></li><li><p>unlocked(): <strong>optional</strong>, A function returning a bool to determine if the buyable is visible or not. Default is unlocked.</p></li><li><p>canAfford(): A function returning a bool to determine if you can buy one of the buyables.</p></li><li><p>buy(): A function that implements buying one of the buyable, including spending the currency.</p></li><li><p>buyMax(): <strong>optional</strong>, A function that implements buying as many of the buyable as possible.</p></li><li><p>style: <strong>Optional</strong>, Applies CSS to this buyable, 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>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 buyable was stored under, for convenient access. The buyable in the example&#39;s id is 11.</p></li></ul><p>Sell One/Sell All:</p><p>Including a sellOne or sellAll function will cause an additional button to appear beneath the buyable. They are functionally identical, but &quot;sell one&quot; appears above &quot;sell all&quot;. You can also use them for other things.</p><p>sellOne/sellAll(): <strong>optional</strong>, Called when the button is pressed. The standard use would be to decrease/reset the amount of the buyable, And possibly return some currency to the player.</p><p>canSellOne/canSellAll(): <strong>optional</strong>, booleans determining whether or not to show the buttons. If &quot;canSellOne/All&quot; is absent but &quot;sellOne/All&quot; is present, the appropriate button will always show.</p></div></div></main><!--[--><!--]--><!----><!--[--><!--]--></div></div></div></div></div><!----><!--[--><!--]--></div></div>
<script>__VP_HASH_MAP__ = JSON.parse("{\"guide-to-incrementals_design_introduction.md\":\"84bf29f6\",\"guide-to-incrementals_index.md\":\"bfee2ce9\",\"guide-to-incrementals_ludology_appeal-developers.md\":\"fe587484\",\"guide-to-incrementals_ludology_appeal-gamers.md\":\"333b67dd\",\"guide-to-incrementals_ludology_content.md\":\"b4fbb798\",\"guide-to-incrementals_ludology_definition.md\":\"1b662d48\",\"index.md\":\"c88a6b2c\",\"projects_babble_index.md\":\"51d40cdc\",\"projects_citadel_index.md\":\"30395402\",\"projects_dice_index.md\":\"9f67b587\",\"projects_index.md\":\"8994c058\",\"projects_optispeech_index.md\":\"67028307\",\"projects_vecs_index.md\":\"a899377b\",\"public_gamedevtree_2.0-format-changes.md\":\"e68d2777\",\"public_gamedevtree_readme.md\":\"fe1a4e2c\",\"public_gamedevtree_changelog.md\":\"0fda1f95\",\"public_gamedevtree_docs_!general-info.md\":\"7eb1e984\",\"public_gamedevtree_docs_achievements.md\":\"a461469e\",\"public_gamedevtree_docs_bars.md\":\"d1dfb310\",\"public_gamedevtree_docs_basic-layer-breakdown.md\":\"1dfcc627\",\"public_gamedevtree_docs_buyables.md\":\"b96d398b\",\"public_gamedevtree_docs_challenges.md\":\"19d474a8\",\"public_gamedevtree_docs_clickables.md\":\"0ab76fd5\",\"public_gamedevtree_docs_custom-tab-layouts.md\":\"f808feea\",\"public_gamedevtree_docs_getting-started.md\":\"4271b6f8\",\"public_gamedevtree_docs_infoboxes.md\":\"641545a4\",\"public_gamedevtree_docs_layer-features.md\":\"61f017df\",\"public_gamedevtree_docs_main-mod-info.md\":\"792a9c63\",\"public_gamedevtree_docs_milestones.md\":\"44f8b1cf\",\"public_gamedevtree_docs_subtabs-and-microtabs.md\":\"413105ea\",\"public_gamedevtree_docs_updating-tmt.md\":\"b6d4c1a7\",\"public_gamedevtree_docs_upgrades.md\":\"f26a422f\",\"public_kronos_old things_2.0-format-changes.md\":\"1eb4a960\",\"public_kronos_readme.md\":\"8629d32b\",\"public_kronos_changelog.md\":\"995fb4a0\",\"public_kronos_docs_!general-info.md\":\"472ca3b8\",\"public_kronos_docs_achievements.md\":\"b71153c5\",\"public_kronos_docs_bars.md\":\"ad242f1b\",\"public_kronos_docs_basic-layer-breakdown.md\":\"19ead7b2\",\"public_kronos_docs_buyables.md\":\"65197bc9\",\"public_kronos_docs_challenges.md\":\"408df511\",\"public_kronos_docs_clickables.md\":\"6818dc63\",\"public_kronos_docs_custom-tab-layouts.md\":\"655a0f77\",\"public_kronos_docs_getting-started.md\":\"68e694af\",\"public_kronos_docs_grids.md\":\"685b8c7d\",\"public_kronos_docs_infoboxes.md\":\"28630cfb\",\"public_kronos_docs_layer-features.md\":\"5f87e893\",\"public_kronos_docs_main-mod-info.md\":\"384891cb\",\"public_kronos_docs_milestones.md\":\"dbd0e199\",\"public_kronos_docs_particles.md\":\"ba4e4e7c\",\"public_kronos_docs_subtabs-and-microtabs.md\":\"dc1c32fe\",\"public_kronos_docs_trees-and-tree-customization.md\":\"21f5f59c\",\"public_kronos_docs_updating-tmt.md\":\"4f6dd557\",\"public_kronos_docs_upgrades.md\":\"446042cc\",\"public_lit_old things_2.0-format-changes.md\":\"bbafb3fa\",\"public_lit_readme.md\":\"b0a5ae52\",\"public_lit_changelog.md\":\"1749300f\",\"public_lit_docs_!general-info.md\":\"ee568212\",\"public_lit_docs_achievements.md\":\"b821c694\",\"public_lit_docs_bars.md\":\"39e6b285\",\"public_lit_docs_basic-layer-breakdown.md\":\"49576af3\",\"public_lit_docs_buyables.md\":\"b4a2c4f3\",\"public_lit_docs_challenges.md\":\"bbfb82d1\",\"public_lit_docs_clickables.md\":\"9704f204\",\"public_lit_docs_custom-tab-layouts.md\":\"03d11733\",\"public_lit_docs_getting-started.md\":\"04876e55\",\"public_lit_docs_infoboxes.md\":\"4a07d28f\",\"public_lit_docs_layer-features.md\":\"6f32b68c\",\"public_lit_docs_main-mod-info.md\":\"631bc458\",\"public_lit_docs_milestones.md\":\"483026a5\",\"public_lit_docs_subtabs-and-microtabs.md\":\"3234ff92\",\"public_lit_docs_trees-and-tree-customization.md\":\"ba4eadbc\",\"public_lit_docs_updating-tmt.md\":\"41c6a998\",\"public_lit_docs_upgrades.md\":\"642789e1\"}")</script>
<script type="module" async src="/assets/app.f001dff6.js"></script>
<script>__VP_HASH_MAP__ = JSON.parse("{\"guide-to-incrementals_design_introduction.md\":\"38daee51\",\"guide-to-incrementals_index.md\":\"5d93b5e4\",\"guide-to-incrementals_ludology_appeal-developers.md\":\"ef988d03\",\"guide-to-incrementals_ludology_appeal-gamers.md\":\"e2ccfe16\",\"guide-to-incrementals_ludology_content.md\":\"8399cc9d\",\"guide-to-incrementals_ludology_definition.md\":\"b8d4c239\",\"index.md\":\"089e133d\",\"projects_babble_index.md\":\"07772651\",\"projects_citadel_index.md\":\"2eef0cc2\",\"projects_dice_index.md\":\"413a3b00\",\"projects_index.md\":\"b64464bb\",\"projects_optispeech_index.md\":\"1482aa03\",\"projects_vecs_index.md\":\"dafa3c23\",\"public_gamedevtree_2.0-format-changes.md\":\"869c95cb\",\"public_gamedevtree_readme.md\":\"552fe2c4\",\"public_gamedevtree_changelog.md\":\"d359af81\",\"public_gamedevtree_docs_!general-info.md\":\"b54b0405\",\"public_gamedevtree_docs_achievements.md\":\"dcac48ff\",\"public_gamedevtree_docs_bars.md\":\"5f67f039\",\"public_gamedevtree_docs_basic-layer-breakdown.md\":\"7761b77c\",\"public_gamedevtree_docs_buyables.md\":\"0150160d\",\"public_gamedevtree_docs_challenges.md\":\"0c6f4a98\",\"public_gamedevtree_docs_clickables.md\":\"31209e1f\",\"public_gamedevtree_docs_custom-tab-layouts.md\":\"c0fbc4e0\",\"public_gamedevtree_docs_getting-started.md\":\"8c2ddda0\",\"public_gamedevtree_docs_infoboxes.md\":\"7a0953be\",\"public_gamedevtree_docs_layer-features.md\":\"a7640a7f\",\"public_gamedevtree_docs_main-mod-info.md\":\"6f790508\",\"public_gamedevtree_docs_milestones.md\":\"264c8c9a\",\"public_gamedevtree_docs_subtabs-and-microtabs.md\":\"a5ee4ade\",\"public_gamedevtree_docs_updating-tmt.md\":\"0237de18\",\"public_gamedevtree_docs_upgrades.md\":\"ac3bddbc\",\"public_kronos_old things_2.0-format-changes.md\":\"33740b7e\",\"public_kronos_readme.md\":\"b02e146e\",\"public_kronos_changelog.md\":\"8c678677\",\"public_kronos_docs_!general-info.md\":\"a850fc5c\",\"public_kronos_docs_achievements.md\":\"50170b22\",\"public_kronos_docs_bars.md\":\"e362dd22\",\"public_kronos_docs_basic-layer-breakdown.md\":\"c5012569\",\"public_kronos_docs_buyables.md\":\"18df767f\",\"public_kronos_docs_challenges.md\":\"e035cc8c\",\"public_kronos_docs_clickables.md\":\"0b620d80\",\"public_kronos_docs_custom-tab-layouts.md\":\"83ea4ec4\",\"public_kronos_docs_getting-started.md\":\"bbfb2db6\",\"public_kronos_docs_grids.md\":\"53210faa\",\"public_kronos_docs_infoboxes.md\":\"1e520ae7\",\"public_kronos_docs_layer-features.md\":\"13746ddd\",\"public_kronos_docs_main-mod-info.md\":\"880d3987\",\"public_kronos_docs_milestones.md\":\"ddaaade5\",\"public_kronos_docs_particles.md\":\"78d816e8\",\"public_kronos_docs_subtabs-and-microtabs.md\":\"f0ff58d5\",\"public_kronos_docs_trees-and-tree-customization.md\":\"763f6e41\",\"public_kronos_docs_updating-tmt.md\":\"3d630d86\",\"public_kronos_docs_upgrades.md\":\"e5295c4b\",\"public_lit_old things_2.0-format-changes.md\":\"e73a9b99\",\"public_lit_readme.md\":\"241d60e2\",\"public_lit_changelog.md\":\"08f37d7f\",\"public_lit_docs_!general-info.md\":\"e02fc830\",\"public_lit_docs_achievements.md\":\"9bdd1682\",\"public_lit_docs_bars.md\":\"51d95f97\",\"public_lit_docs_basic-layer-breakdown.md\":\"c311548b\",\"public_lit_docs_buyables.md\":\"cdd4074b\",\"public_lit_docs_challenges.md\":\"ff75af2d\",\"public_lit_docs_clickables.md\":\"2c4bf6c0\",\"public_lit_docs_custom-tab-layouts.md\":\"4ef7b79a\",\"public_lit_docs_getting-started.md\":\"1abd3c25\",\"public_lit_docs_infoboxes.md\":\"6e888c51\",\"public_lit_docs_layer-features.md\":\"77bde097\",\"public_lit_docs_main-mod-info.md\":\"c984b67a\",\"public_lit_docs_milestones.md\":\"05858e62\",\"public_lit_docs_subtabs-and-microtabs.md\":\"84373a35\",\"public_lit_docs_trees-and-tree-customization.md\":\"083d2a32\",\"public_lit_docs_updating-tmt.md\":\"6dce2005\",\"public_lit_docs_upgrades.md\":\"967aa760\"}")</script>
<script type="module" async src="/assets/app.99998402.js"></script>
</body>
</html>