Files

7 lines
14 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>/obj/effect/spawner/random - 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="obj/effect/spawner/random.html#var">Var Details</a> - <a href="obj/effect/spawner/random.html#proc">Proc Details</a></header><main><h1>random <aside>/<a href="obj.html">obj</a>/<a href="obj/effect/spawner.html">effect/spawner</a>/<a href="obj/effect/spawner/random.html">random</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L4"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 4"></a></h1><p>Base class for all random spawners.</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="obj/effect/spawner/random.html#var/loot">loot</a></th><td>Stops persistent lootdrop spawns from being shoved into lockers
A list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect)</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/loot_subtype_path">loot_subtype_path</a></th><td>The subtypes (this excludes the provided path) to combine with the loot list</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/loot_type_path">loot_type_path</a></th><td>The subtypes AND type to combine with the loot list</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/pixel_placer">pixel_placer</a></th><td>The placer for loot when <code>spawn_loot_split</code> is enabled</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/record_spawn">record_spawn</a></th><td>Whether blackbox should record when the spawner spawns.</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_all_loot">spawn_all_loot</a></th><td>Whether the spawner should spawn all the loot in the list</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_inside">spawn_inside</a></th><td>Where do we want to spawn an item (closet, safe etc.)</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_loot_chance">spawn_loot_chance</a></th><td>The chance for the spawner to create loot (ignores spawn_loot_count)</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_loot_count">spawn_loot_count</a></th><td>How many items will be spawned</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_loot_double">spawn_loot_double</a></th><td>If the same item can be spawned twice</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_loot_split">spawn_loot_split</a></th><td>Whether the items should be staggered visually on their location.</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_loot_split_pixel_offsets">spawn_loot_split_pixel_offsets</a></th><td>The pixel x/y divider offsets for spawn_loot_split (spaced 2 pixels apart by default)</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_random_angle">spawn_random_angle</a></th><td>Whether the spawned items should be rotated randomly.</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_random_offset">spawn_random_offset</a></th><td>Whether the items should have a random pixel_x/y offset (maximum offset distance is ± spawn_random_offset_max_pixels for x/y)</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_random_offset_max_pixels">spawn_random_offset_max_pixels</a></th><td>Maximum offset distance for random pixel offsets.</td></tr><tr><th><a href="obj/effect/spawner/random.html#var/spawn_scatter_radius">spawn_scatter_radius</a></th><td>Determines how big of a range (in tiles) we should scatter things in.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="obj/effect/spawner/random.html#proc/get_spawn_locations">get_spawn_locations</a></th><td>If the spawner has a spawn_scatter_radius set, this creates a list of nearby turfs available that are in view and have an unblocked line to them.</td></tr><tr><th><a href="obj/effect/spawner/random.html#proc/make_item">make_item</a></th><td>Makes the actual item related to our spawner. If <code>record_spawn</code> is <code>TRUE</code>,
this is when the items spawned are recorded to blackbox (except for <code>/obj/effect</code>s).</td></tr><tr><th><a href="obj/effect/spawner/random.html#proc/spawn_loot">spawn_loot</a></th><td>If the spawner has any loot defined, randomly picks some and spawns it. Does not cleanup the spawner.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/loot"><aside class="declaration">var </aside>loot <aside> /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L9"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 9"></a></h3><p>Stops persistent lootdrop spawns from being shoved into lockers
A list of possible items to spawn e.g. list(/obj/item, /obj/structure, /obj/effect)</p><h3 id="var/loot_subtype_path"><aside class="declaration">var </aside>loot_subtype_path <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L13"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 13"></a></h3><p>The subtypes (this excludes the provided path) to combine with the loot list</p><h3 id="var/loot_type_path"><aside class="declaration">var </aside>loot_type_path <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L11"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 11"></a></h3><p>The subtypes AND type to combine with the loot list</p><h3 id="var/pixel_placer"><aside class="declaration">var </aside>pixel_placer <aside> /<a href="datum.html">datum</a>/<a href="datum/spawner_pixel_placer.html">spawner_pixel_placer</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L23"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 23"></a></h3><p>The placer for loot when <code>spawn_loot_split</code> is enabled</p><h3 id="var/record_spawn"><aside class="declaration">var </aside>record_spawn <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L37"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 37"></a></h3><p>Whether blackbox should record when the spawner spawns.</p><h3 id="var/spawn_all_loot"><aside class="declaration">var </aside>spawn_all_loot <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L25"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 25"></a></h3><p>Whether the spawner should spawn all the loot in the list</p><h3 id="var/spawn_inside"><aside class="declaration">var </aside>spawn_inside <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L39"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 39"></a></h3><p>Where do we want to spawn an item (closet, safe etc.)</p><h3 id="var/spawn_loot_chance"><aside class="declaration">var </aside>spawn_loot_chance <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L27"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 27"></a></h3><p>The chance for the spawner to create loot (ignores spawn_loot_count)</p><h3 id="var/spawn_loot_count"><aside class="declaration">var </aside>spawn_loot_count <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L15"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 15"></a></h3><p>How many items will be spawned</p><h3 id="var/spawn_loot_double"><aside class="declaration">var </aside>spawn_loot_double <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L17"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 17"></a></h3><p>If the same item can be spawned twice</p><h3 id="var/spawn_loot_split"><aside class="declaration">var </aside>spawn_loot_split <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L19"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 19"></a></h3><p>Whether the items should be staggered visually on their location.</p><h3 id="var/spawn_loot_split_pixel_offsets"><aside class="declaration">var </aside>spawn_loot_split_pixel_offsets <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L21"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 21"></a></h3><p>The pixel x/y divider offsets for spawn_loot_split (spaced 2 pixels apart by default)</p><h3 id="var/spawn_random_angle"><aside class="declaration">var </aside>spawn_random_angle <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L35"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 35"></a></h3><p>Whether the spawned items should be rotated randomly.</p><h3 id="var/spawn_random_offset"><aside class="declaration">var </aside>spawn_random_offset <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L31"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 31"></a></h3><p>Whether the items should have a random pixel_x/y offset (maximum offset distance is ± spawn_random_offset_max_pixels for x/y)</p><h3 id="var/spawn_random_offset_max_pixels"><aside class="declaration">var </aside>spawn_random_offset_max_pixels <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L33"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 33"></a></h3><p>Maximum offset distance for random pixel offsets.</p><h3 id="var/spawn_scatter_radius"><aside class="declaration">var </aside>spawn_scatter_radius <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L29"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 29"></a></h3><p>Determines how big of a range (in tiles) we should scatter things in.</p><h2 id="proc">Proc Details</h2><h3 id="proc/get_spawn_locations"><aside class="declaration">proc </aside>get_spawn_locations<aside>(radius) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L163"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 163"></a></aside></h3><p>If the spawner has a spawn_scatter_radius set, this creates a list of nearby turfs available that are in view and have an unblocked line to them.</p><h3 id="proc/make_item"><aside class="declaration">proc </aside>make_item<aside>(spawn_loc, type_path_to_make) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L144"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 144"></a></aside></h3><p>Makes the actual item related to our spawner. If <code>record_spawn</code> is <code>TRUE</code>,
this is when the items spawned are recorded to blackbox (except for <code>/obj/effect</code>s).</p>
<p>spawn_loc - where are we spawning it?
type_path_to_make - what are we spawning?</p><h3 id="proc/spawn_loot"><aside class="declaration">proc </aside>spawn_loot<aside>(lootcount_override) <a href="https://github.com/ParadiseSS13/Paradise/blob/8a8a00a2a9bec485351e5f219982b7315d3504fa/code/game/objects/effects/spawners/random/random_spawner.dm#L71"><img src="git.png" width="16" height="16" title="code/game/objects/effects/spawners/random/random_spawner.dm 71"></a></aside></h3><p>If the spawner has any loot defined, randomly picks some and spawns it. Does not cleanup the spawner.</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>