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

9 lines
7.7 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/element/embed - /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/element/embed.html#var">Var Details</a> - <a href="datum/element/embed.html#proc">Proc Details</a></header><main><h1>embed <aside>/<a href="datum.html">datum</a>/<a href="datum/element.html">element</a>/<a href="datum/element/embed.html">embed</a></aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L14"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 14"></a></h1><table class="summary" cellspacing="0"><tr><td colspan="2"><h2>Vars</h2></td></tr><tr><th><a href="datum/element/embed.html#var/embed_chance">embed_chance</a></th><td>whether we can skip assigning all the vars (since these are bespoke elements, we don't have to reset the vars every time we attach to something, we already know what we are!)</td></tr><tr><td colspan="2"><h2>Procs</h2></td></tr><tr><th><a href="datum/element/embed.html#proc/checkEmbedMob">checkEmbedMob</a></th><td>Checking to see if we're gonna embed into a human</td></tr><tr><th><a href="datum/element/embed.html#proc/checkEmbedOther">checkEmbedOther</a></th><td>We need the hit_zone if we're embedding into a human, so this proc only handles if we're embedding into a turf</td></tr><tr><th><a href="datum/element/embed.html#proc/checkEmbedProjectile">checkEmbedProjectile</a></th><td>checkEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.</td></tr><tr><th><a href="datum/element/embed.html#proc/detachFromWeapon">detachFromWeapon</a></th><td>If we don't want to be embeddable anymore (deactivating an e-dagger for instance)</td></tr><tr><th><a href="datum/element/embed.html#proc/examined">examined</a></th><td>Someone inspected our embeddable item</td></tr><tr><th><a href="datum/element/embed.html#proc/severancePackage">severancePackage</a></th><td>A different embed element has been attached, so we'll detach and let them handle things</td></tr><tr><th><a href="datum/element/embed.html#proc/tryForceEmbed">tryForceEmbed</a></th><td>Arguments:</td></tr></table><h2 id="var">Var Details</h2><h3 id="var/embed_chance"><aside class="declaration">var </aside>embed_chance <aside> </aside> <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L20"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 20"></a></h3><p>whether we can skip assigning all the vars (since these are bespoke elements, we don't have to reset the vars every time we attach to something, we already know what we are!)</p><h2 id="proc">Proc Details</h2><h3 id="proc/checkEmbedMob"><aside class="declaration">proc </aside>checkEmbedMob<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/weapon, /<a href="mob.html">mob</a>/<a href="mob/living.html">living</a>/<a href="mob/living/carbon.html">carbon</a>/victim, hit_zone, /<a href="datum.html">datum</a>/<a href="datum/thrownthing.html">thrownthing</a>/throwingdatum, blocked, forced) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L75"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 75"></a></aside></h3><p>Checking to see if we're gonna embed into a human</p><h3 id="proc/checkEmbedOther"><aside class="declaration">proc </aside>checkEmbedOther<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/weapon, /<a href="turf.html">turf</a>/<a href="turf/closed.html">closed</a>/hit, /<a href="datum.html">datum</a>/<a href="datum/thrownthing.html">thrownthing</a>/throwingdatum, forced) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L116"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 116"></a></aside></h3><p>We need the hit_zone if we're embedding into a human, so this proc only handles if we're embedding into a turf</p><h3 id="proc/checkEmbedProjectile"><aside class="declaration">proc </aside>checkEmbedProjectile<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/<a href="obj/item/projectile.html">projectile</a>/P, /<a href="atom.html">atom</a>/<a href="atom/movable.html">movable</a>/firer, /<a href="atom.html">atom</a>/hit, angle, hit_zone, blocked) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L171"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 171"></a></aside></h3><p>checkEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.</p>
<p>If we hit a valid target (carbon or closed turf), we create the shrapnel_type object and immediately call tryEmbed() on it, targeting what we impacted. That will lead
it to call tryForceEmbed() on its own embed element (it's out of our hands here, our projectile is done), where it will run through all the checks it needs to.</p><h3 id="proc/detachFromWeapon"><aside class="declaration">proc </aside>detachFromWeapon<aside>(/<a href="obj.html">obj</a>/weapon) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L155"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 155"></a></aside></h3><p>If we don't want to be embeddable anymore (deactivating an e-dagger for instance)</p><h3 id="proc/examined"><aside class="declaration">proc </aside>examined<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/I, /<a href="mob.html">mob</a>/user, /list/examine_list) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L159"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 159"></a></aside></h3><p>Someone inspected our embeddable item</p><h3 id="proc/severancePackage"><aside class="declaration">proc </aside>severancePackage<aside>(/<a href="obj.html">obj</a>/weapon, /<a href="datum.html">datum</a>/<a href="datum/element.html">element</a>/E) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L150"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 150"></a></aside></h3><p>A different embed element has been attached, so we'll detach and let them handle things</p><h3 id="proc/tryForceEmbed"><aside class="declaration">proc </aside>tryForceEmbed<aside>(/<a href="obj.html">obj</a>/<a href="obj/item.html">item</a>/I, /<a href="atom.html">atom</a>/target, hit_zone, forced) <a href="https://github.com/evilew/GS13-Citadel/blob/e8e0068531dd988f9e65b33ae7866d4fbf1fdd9e/code/datums/elements/embed.dm#L198"><img src="git.png" width="16" height="16" title="code/datums/elements/embed.dm 198"></a></aside></h3><p>Arguments:</p>
<ul>
<li>I- the item we're trying to insert into the target</li>
<li>target- what we're trying to shish-kabob, either a bodypart or a carbon</li>
<li>hit_zone- if our target is a carbon, try to hit them in this zone, if we don't have one, pick a random one. If our target is a bodypart, we already know where we're hitting.</li>
<li>forced- if we want this to succeed 100%</li>
</ul></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>