Files
GS13NG/datum/summon_weapon.html
2025-02-05 06:19:18 +00:00

16 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>/datum/summon_weapon - /tg/ Station 13</title></head><body><header><a href="index.html">/tg/ Station 13</a> - <a href="index.html#modules">Modules</a> - <a href="index.html#types">Types</a><a href="datum/summon_weapon.html#var">Var Details</a> - <a href="datum/summon_weapon.html#proc">Proc Details</a></header><main><h1>summon_weapon <aside>/<a href="datum.html">datum</a>/<a href="datum/summon_weapon.html">summon_weapon</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L225"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 225"></a></h1><p>A singular summoned object</p>
<p>How summon weapons work:</p>
<p>Reset() - makes it go back to its master.
Target() - locks onto a target for a duration</p>
<p>The biggest challenge is synchronizing animations.
Variables keep track of when things tick, but,
animations are client-timed, and not server-timed</p>
<p>Animations:
The weapon can only track its &quot;intended&quot; angle and dist
&quot;Current&quot; pixel x/y are always calculated relative to a target from the current orbiting atom the physical effect is on
There's 3 animations,
MoveTo(location, angle, dist, rotation)
Orbit(location)
Rotate(degrees)</p>
<p>And an non-animation that just snaps it to a location,
HardReset(location)</p><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/summon_weapon.html#var/angle">angle</a></th><td>current angle from victim - clockwise from 0. null if not attacking.</td></tr><tr><th><a href="datum/summon_weapon.html#var/angle_vary">angle_vary</a></th><td>rand dist to rotate during reattack phase</td></tr><tr><th><a href="datum/summon_weapon.html#var/animation_lock">animation_lock</a></th><td>animation locked until</td></tr><tr><th><a href="datum/summon_weapon.html#var/animation_timerid">animation_timerid</a></th><td>animation lock timer</td></tr><tr><th><a href="datum/summon_weapon.html#var/appearance">appearance</a></th><td>mutable_appearance to use, will skip making from icon/icon state if so</td></tr><tr><th><a href="datum/summon_weapon.html#var/atom">atom</a></th><td>the actual effect</td></tr><tr><th><a href="datum/summon_weapon.html#var/attack_damage">attack_damage</a></th><td>attack damage</td></tr><tr><th><a href="datum/summon_weapon.html#var/attack_length">attack_length</a></th><td>attack length in deciseconds - this is the attack animation speed in total</td></tr><tr><th><a href="datum/summon_weapon.html#var/attack_sound">attack_sound</a></th><td>attack sound</td></tr><tr><th><a href="datum/summon_weapon.html#var/attack_speed">attack_speed</a></th><td>attack delay in deciseconds - this is time spent between attacks</td></tr><tr><th><a href="datum/summon_weapon.html#var/attack_type">attack_type</a></th><td>attack damtype</td></tr><tr><th><a href="datum/summon_weapon.html#var/attack_verb">attack_verb</a></th><td>attack verb</td></tr><tr><th><a href="datum/summon_weapon.html#var/dist">dist</a></th><td>current distance from victim - pixels</td></tr><tr><th><a href="datum/summon_weapon.html#var/host">host</a></th><td>host</td></tr><tr><th><a href="datum/summon_weapon.html#var/icon">icon</a></th><td>icon file</td></tr><tr><th><a href="datum/summon_weapon.html#var/icon_state">icon_state</a></th><td>icon state</td></tr><tr><th><a href="datum/summon_weapon.html#var/name">name</a></th><td>name</td></tr><tr><th><a href="datum/summon_weapon.html#var/orbit_dist">orbit_dist</a></th><td>orbit distance from victim - pixels</td></tr><tr><th><a href="datum/summon_weapon.html#var/orbit_dist_vary">orbit_dist_vary</a></th><td>orbit distance variation from victim</td></tr><tr><th><a href="datum/summon_weapon.html#var/reset_speed">reset_speed</a></th><td>reset animation duration</td></tr><tr><th><a href="datum/summon_weapon.html#var/reset_timerid">reset_timerid</a></th><td>reset timerid</td></tr><tr><th><a href="datum/summon_weapon.html#var/rotation">rotation</a></th><td>current rotation - angles clockwise from north</td></tr><tr><th><a href="datum/summon_weapon.html#var/state">state</a></th><td>current state</td></tr><tr><th><a href="datum/summon_weapon.html#var/victim">victim</a></th><td>currently locked attack target</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/summon_weapon.html#proc/MoveTo">MoveTo</a></th><td>relative to defaults to current location</td></tr><tr><th><a href="datum/summon_weapon.html#proc/Rotate">Rotate</a></th><td>rotation defaults to facing towards locked atom</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/angle"><aside class="declaration">var </aside>angle <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L241"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 241"></a></h3><p>current angle from victim - clockwise from 0. null if not attacking.</p><h3 id="var/angle_vary"><aside class="declaration">var </aside>angle_vary <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L247"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 247"></a></h3><p>rand dist to rotate during reattack phase</p><h3 id="var/animation_lock"><aside class="declaration">var </aside>animation_lock <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L277"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 277"></a></h3><p>animation locked until</p><h3 id="var/animation_timerid"><aside class="declaration">var </aside>animation_timerid <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L279"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 279"></a></h3><p>animation lock timer</p><h3 id="var/appearance"><aside class="declaration">var </aside>appearance <aside> /mutable_appearance</aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L235"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 235"></a></h3><p>mutable_appearance to use, will skip making from icon/icon state if so</p><h3 id="var/atom"><aside class="declaration">var </aside>atom <aside> /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/<a href="atom/movable/summon_weapon_effect.html">summon_weapon_effect</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L237"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 237"></a></h3><p>the actual effect</p><h3 id="var/attack_damage"><aside class="declaration">var </aside>attack_damage <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L257"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 257"></a></h3><p>attack damage</p><h3 id="var/attack_length"><aside class="declaration">var </aside>attack_length <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L255"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 255"></a></h3><p>attack length in deciseconds - this is the attack animation speed in total</p><h3 id="var/attack_sound"><aside class="declaration">var </aside>attack_sound <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L263"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 263"></a></h3><p>attack sound</p><h3 id="var/attack_speed"><aside class="declaration">var </aside>attack_speed <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L253"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 253"></a></h3><p>attack delay in deciseconds - this is time spent between attacks</p><h3 id="var/attack_type"><aside class="declaration">var </aside>attack_type <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L261"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 261"></a></h3><p>attack damtype</p><h3 id="var/attack_verb"><aside class="declaration">var </aside>attack_verb <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L268"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 268"></a></h3><p>attack verb</p><h3 id="var/dist"><aside class="declaration">var </aside>dist <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L243"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 243"></a></h3><p>current distance from victim - pixels</p><h3 id="var/host"><aside class="declaration">var </aside>host <aside> /<a href="datum.html">datum</a>/<a href="datum/summon_weapon_host.html">summon_weapon_host</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L229"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 229"></a></h3><p>host</p><h3 id="var/icon"><aside class="declaration">var </aside>icon <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L231"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 231"></a></h3><p>icon file</p><h3 id="var/icon_state"><aside class="declaration">var </aside>icon_state <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L233"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 233"></a></h3><p>icon state</p><h3 id="var/name"><aside class="declaration">var </aside>name <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L227"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 227"></a></h3><p>name</p><h3 id="var/orbit_dist"><aside class="declaration">var </aside>orbit_dist <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L249"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 249"></a></h3><p>orbit distance from victim - pixels</p><h3 id="var/orbit_dist_vary"><aside class="declaration">var </aside>orbit_dist_vary <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L251"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 251"></a></h3><p>orbit distance variation from victim</p><h3 id="var/reset_speed"><aside class="declaration">var </aside>reset_speed <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L259"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 259"></a></h3><p>reset animation duration</p><h3 id="var/reset_timerid"><aside class="declaration">var </aside>reset_timerid <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L283"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 283"></a></h3><p>reset timerid</p><h3 id="var/rotation"><aside class="declaration">var </aside>rotation <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L245"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 245"></a></h3><p>current rotation - angles clockwise from north</p><h3 id="var/state"><aside class="declaration">var </aside>state <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L275"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 275"></a></h3><p>current state</p><h3 id="var/victim"><aside class="declaration">var </aside>victim <aside> /<a href="atom.html">atom</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L239"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 239"></a></h3><p>currently locked attack target</p><h2 id="proc">Proc Details</h2><h3 id="proc/MoveTo"><aside class="declaration">proc </aside>MoveTo<aside>(/<a href="atom.html">atom</a>/destination, /<a href="atom.html">atom</a>/relative_to, angle, dist, rotation, time) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L415"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 415"></a></aside></h3><p>relative to defaults to current location</p><h3 id="proc/Rotate"><aside class="declaration">proc </aside>Rotate<aside>(degrees, time, rotation) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/game/objects/items/summon.dm#L458"><img src="git.png" width="16" height="16" title="code/game/objects/items/summon.dm 458"></a></aside></h3><p>rotation defaults to facing towards locked atom</p></main><footer>tgstation.dme <a href="https://github.com/evilew/GS13-Citadel/tree/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e">e8e0068</a> (master) — <a href="https://github.com/SpaceManiac/SpacemanDMM/blob/master/crates/dmdoc/README.md">dmdoc 1.9.0</a></footer></body></html>