Files
Paradise/datum/river_spawner.html

11 lines
9.0 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/river_spawner - Space Station 13</title></head><body><header><a href="index.html">Space Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/river_spawner.html#var">Var Details</a> - <a href="datum/river_spawner.html#proc">Proc Details</a></header><main><h1>river_spawner <aside>/<a href="datum.html">datum</a>/<a href="datum/river_spawner.html">river_spawner</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L21"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 21"></a></h1><p>A straightforward system for making &quot;rivers&quot;, paths made up of a specific
turf type that are generated in a random path on a z-level.</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/river_spawner.html#var/collected_turfs">collected_turfs</a></th><td>To hold all the found turfs to convert to the lava type</td></tr><tr><th><a href="datum/river_spawner.html#var/ignore_bridges">ignore_bridges</a></th><td>Do we ignore building any bridges?</td></tr><tr><th><a href="datum/river_spawner.html#var/river_turf_type">river_turf_type</a></th><td>The base type that makes up the river.</td></tr><tr><th><a href="datum/river_spawner.html#var/shoreline_turf_type">shoreline_turf_type</a></th><td>The turf used when a spread of the tile stops.</td></tr><tr><th><a href="datum/river_spawner.html#var/spread_prob">spread_prob</a></th><td>The initial probability that a river tile will spread to adjacent tiles.</td></tr><tr><th><a href="datum/river_spawner.html#var/spread_prob_loss">spread_prob_loss</a></th><td>The amount reduced from spread_prob on every spread iteration to cause falloff.</td></tr><tr><th><a href="datum/river_spawner.html#var/target_z">target_z</a></th><td>The z-level to generate the river on. There is theoretically nothing stopping
this from being used across z-levels, but we're keeping things simple.</td></tr><tr><th><a href="datum/river_spawner.html#var/warning">warning</a></th><td>Does the lava generate a warning beforehand</td></tr><tr><th><a href="datum/river_spawner.html#var/whitelist_area_type">whitelist_area_type</a></th><td>The area that the spawner is allowed to spread or detour to.</td></tr><tr><th><a href="datum/river_spawner.html#var/whitelist_turf_type">whitelist_turf_type</a></th><td>The type that the spawner is allowed to spread or detour to.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/river_spawner.html#proc/convert_turf">convert_turf</a></th><td>actually convert the turf</td></tr><tr><th><a href="datum/river_spawner.html#proc/generate">generate</a></th><td>Generate a river between the bounds specified by (<code>min_x</code>, <code>min_y</code>) and
(<code>max_x</code>, <code>max_y</code>).</td></tr><tr><th><a href="datum/river_spawner.html#proc/handle_change">handle_change</a></th><td>handles changing the lava turfs, and if it should delay it and place warnings</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/collected_turfs"><aside class="declaration">var </aside>collected_turfs <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L38"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 38"></a></h3><p>To hold all the found turfs to convert to the lava type</p><h3 id="var/ignore_bridges"><aside class="declaration">var </aside>ignore_bridges <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L42"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 42"></a></h3><p>Do we ignore building any bridges?</p><h3 id="var/river_turf_type"><aside class="declaration">var </aside>river_turf_type <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L30"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 30"></a></h3><p>The base type that makes up the river.</p><h3 id="var/shoreline_turf_type"><aside class="declaration">var </aside>shoreline_turf_type <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L36"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 36"></a></h3><p>The turf used when a spread of the tile stops.</p><h3 id="var/spread_prob"><aside class="declaration">var </aside>spread_prob <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L26"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 26"></a></h3><p>The initial probability that a river tile will spread to adjacent tiles.</p><h3 id="var/spread_prob_loss"><aside class="declaration">var </aside>spread_prob_loss <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L28"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 28"></a></h3><p>The amount reduced from spread_prob on every spread iteration to cause falloff.</p><h3 id="var/target_z"><aside class="declaration">var </aside>target_z <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L24"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 24"></a></h3><p>The z-level to generate the river on. There is theoretically nothing stopping
this from being used across z-levels, but we're keeping things simple.</p><h3 id="var/warning"><aside class="declaration">var </aside>warning <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L40"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 40"></a></h3><p>Does the lava generate a warning beforehand</p><h3 id="var/whitelist_area_type"><aside class="declaration">var </aside>whitelist_area_type <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L32"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 32"></a></h3><p>The area that the spawner is allowed to spread or detour to.</p><h3 id="var/whitelist_turf_type"><aside class="declaration">var </aside>whitelist_turf_type <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L34"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 34"></a></h3><p>The type that the spawner is allowed to spread or detour to.</p><h2 id="proc">Proc Details</h2><h3 id="proc/convert_turf"><aside class="declaration">proc </aside>convert_turf<aside>(/<a href="turf.html">turf</a>/cur_turf, ignore_bridges) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L179"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 179"></a></aside></h3><p>actually convert the turf</p><h3 id="proc/generate"><aside class="declaration">proc </aside>generate<aside>(nodes, min_x, min_y, max_x, max_y, ignore_bridges, warning) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L57"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 57"></a></aside></h3><p>Generate a river between the bounds specified by (<code>min_x</code>, <code>min_y</code>) and
(<code>max_x</code>, <code>max_y</code>).</p>
<p><code>nodes</code> is the number of unique points in those bounds the river will
connect to. Note that <code>nodes</code> says little about the resultant size of the
river due to its ability to detour far away from the direct path between them.
set ignore_bridges TRUE to not spawn any new bridges, and set warning to TRUE to
allow for the new generations to have a telegraphed icon first</p><h3 id="proc/handle_change"><aside class="declaration">proc </aside>handle_change<aside>(warning, ignore_bridges) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/turfs/simulated/river.dm#L164"><img src="git.png" width="16" height="16" title="code/game/turfs/simulated/river.dm 164"></a></aside></h3><p>handles changing the lava turfs, and if it should delay it and place warnings</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/8a8a00a2a9bec485351e5f219982b7315d3504fa">8a8a00a</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html>