This commit is contained in:
thepaperpilot 2022-12-01 06:26:18 +00:00
parent 5e3a944cc0
commit bdbd6d21fc
94 changed files with 118 additions and 118 deletions
public/gamedevtree/docs/buyables

View file

@ -36,7 +36,7 @@
<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\":\"d5546b8f\",\"projects_babble_index.md\":\"23282cf7\",\"projects_citadel_index.md\":\"289d40c6\",\"projects_dice_index.md\":\"8f955ccc\",\"projects_index.md\":\"3b0904e6\",\"projects_optispeech_index.md\":\"57bf24f7\",\"projects_vecs_index.md\":\"115967f4\",\"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>__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>
</body>