mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-28 22:47:59 +01:00
31 lines
9.2 KiB
HTML
31 lines
9.2 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><base href="../"><link rel="stylesheet" href="dmdoc.css"><title>/datum/beam - 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/beam.html#var">Var Details</a> - <a href="datum/beam.html#proc">Proc Details</a></header><main><h1>beam <aside>/<a href="datum.html">datum</a>/<a href="datum/beam.html">beam</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L13"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 13"></a></h1><ul>
|
||
<li><h1 id="beam-datum-and-effect">Beam Datum and Effect</h1></li>
|
||
<li>
|
||
<p><strong>IF YOU ARE LAZY AND DO NOT WANT TO READ, GO TO THE BOTTOM OF THE FILE AND USE THAT PROC!</strong></p>
|
||
</li>
|
||
<li>
|
||
<p>This is the beam datum! It's a really neat effect for the game in drawing a line from one atom to another.</p>
|
||
</li>
|
||
<li>
|
||
<p>It has two parts:</p>
|
||
</li>
|
||
<li>
|
||
<p>The datum itself which manages redrawing the beam to constantly keep it pointing from the origin to the target.</p>
|
||
</li>
|
||
<li>
|
||
<p>The effect which is what the beams are made out of. They're placed in a line from the origin to target, rotated towards the target and snipped off at the end.</p>
|
||
</li>
|
||
<li>
|
||
<p>These effects are kept in a list and constantly created and destroyed (hence the proc names draw and reset, reset destroying all effects and draw creating more.)</p>
|
||
</li>
|
||
<li>
|
||
<p>You can add more special effects to the beam itself by changing what the drawn beam effects do. For example you can make a vine that pricks people by making the beam_type</p>
|
||
</li>
|
||
<li>
|
||
<p>include a crossed proc that damages the crosser. Examples in venus_human_trap.dm</p>
|
||
</li>
|
||
</ul><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/beam.html#var/beam_color">beam_color</a></th><td>The color of the beam we're drawing.</td></tr><tr><th><a href="datum/beam.html#var/beam_type">beam_type</a></th><td>the objects placed in the elements list</td></tr><tr><th><a href="datum/beam.html#var/elements">elements</a></th><td>list of beam objects. These have their visuals set by the visuals var which is created on starting</td></tr><tr><th><a href="datum/beam.html#var/icon">icon</a></th><td>icon used by the beam.</td></tr><tr><th><a href="datum/beam.html#var/icon_state">icon_state</a></th><td>icon state of the main segments of the beam</td></tr><tr><th><a href="datum/beam.html#var/max_distance">max_distance</a></th><td>The beam will qdel if it's longer than this many tiles.</td></tr><tr><th><a href="datum/beam.html#var/origin">origin</a></th><td>where the beam goes from</td></tr><tr><th><a href="datum/beam.html#var/target">target</a></th><td>where the beam goes to</td></tr><tr><th><a href="datum/beam.html#var/use_get_turf">use_get_turf</a></th><td>Should we use a turf for origin/target's x and y values instead</td></tr><tr><th><a href="datum/beam.html#var/visuals">visuals</a></th><td>This is used as the visual_contents of beams, so you can apply one effect to this and the whole beam will look like that. never gets deleted on redrawing.</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/beam.html#proc/Draw">Draw</a></th><td>Creates the beam effects and places them in a line from the origin to the target. Sets their rotation to make the beams face the target, too.</td></tr><tr><th><a href="datum/beam.html#proc/Start">Start</a></th><td>Proc called by the atom Beam() proc. Sets up signals, and draws the beam for the first time.</td></tr><tr><th><a href="datum/beam.html#proc/redrawing">redrawing</a></th><td>Triggered by signals set up when the beam is set up. If it's still sane to create a beam, it removes the old beam, creates a new one. Otherwise it kills the beam.</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/beam_color"><aside class="declaration">var </aside>beam_color <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L31"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 31"></a></h3><p>The color of the beam we're drawing.</p><h3 id="var/beam_type"><aside class="declaration">var </aside>beam_type <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L27"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 27"></a></h3><p>the objects placed in the elements list</p><h3 id="var/elements"><aside class="declaration">var </aside>elements <aside>– /list</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L19"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 19"></a></h3><p>list of beam objects. These have their visuals set by the visuals var which is created on starting</p><h3 id="var/icon"><aside class="declaration">var </aside>icon <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L21"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 21"></a></h3><p>icon used by the beam.</p><h3 id="var/icon_state"><aside class="declaration">var </aside>icon_state <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L23"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 23"></a></h3><p>icon state of the main segments of the beam</p><h3 id="var/max_distance"><aside class="declaration">var </aside>max_distance <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L25"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 25"></a></h3><p>The beam will qdel if it's longer than this many tiles.</p><h3 id="var/origin"><aside class="declaration">var </aside>origin <aside>– /<a href="atom.html">atom</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L15"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 15"></a></h3><p>where the beam goes from</p><h3 id="var/target"><aside class="declaration">var </aside>target <aside>– /<a href="atom.html">atom</a></aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L17"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 17"></a></h3><p>where the beam goes to</p><h3 id="var/use_get_turf"><aside class="declaration">var </aside>use_get_turf <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L33"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 33"></a></h3><p>Should we use a turf for origin/target's x and y values instead</p><h3 id="var/visuals"><aside class="declaration">var </aside>visuals <aside>– /<a href="obj.html">obj</a>/effect/ebeam</aside> <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L29"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 29"></a></h3><p>This is used as the visual_contents of beams, so you can apply one effect to this and the whole beam will look like that. never gets deleted on redrawing.</p><h2 id="proc">Proc Details</h2><h3 id="proc/Draw"><aside class="declaration">proc </aside>Draw<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L105"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 105"></a></aside></h3><p>Creates the beam effects and places them in a line from the origin to the target. Sets their rotation to make the beams face the target, too.</p><h3 id="proc/Start"><aside class="declaration">proc </aside>Start<aside>() <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L60"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 60"></a></aside></h3><p>Proc called by the atom Beam() proc. Sets up signals, and draws the beam for the first time.</p><h3 id="proc/redrawing"><aside class="declaration">proc </aside>redrawing<aside>(/<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/mover, /<a href="atom.html">atom</a>/oldloc, direction) <a href="https://github.com/ParadiseSS13/Paradise/blob/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7/code/datums/beam.dm#L79"><img src="git.png" width="16" height="16" title="code/datums/beam.dm 79"></a></aside></h3><p>Triggered by signals set up when the beam is set up. If it's still sane to create a beam, it removes the old beam, creates a new one. Otherwise it kills the beam.</p>
|
||
<p>Arguments:
|
||
mover: either the origin of the beam or the target of the beam that moved.
|
||
oldloc: from where mover moved.
|
||
direction: in what direction mover moved from.</p></main><footer>paradise.dme <a href="https://github.com/ParadiseSS13/Paradise/tree/c8dfcdac13f08c689c3a1cf77d6f1a90087d1dd7">c8dfcda</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.11.0</a></footer></body></html> |