/tg/ Station 13 - Modules - TypesVar Details - Proc Details

embed

Vars

embed_chancewhether 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!)

Procs

checkEmbedChecking to see if we're gonna embed into a human
checkEmbedProjectilecheckEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.
detachFromWeaponIf we don't want to be embeddable anymore (deactivating an e-dagger for instance)
embed_objectActually sticks the object to a victim
examinedSomeone inspected our embeddable item
roll_embed_chanceCalculates the actual chance to embed based on armour penetration and throwing speed, then returns true if we pass that probability check
severancePackageA different embed element has been attached, so we'll detach and let them handle things
tryForceEmbedtryForceEmbed() is called here when we fire COMSIG_EMBED_TRY_FORCE from /obj/item/proc/tryEmbed. Mostly, this means we're a piece of shrapnel from a projectile that just impacted something, and we're trying to embed in it.

Var Details

embed_chance

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!)

Proc Details

checkEmbed

Checking to see if we're gonna embed into a human

checkEmbedProjectile

checkEmbedProjectile() is what we get when a projectile with a defined shrapnel_type impacts a target.

If we hit a valid target, we create the shrapnel_type object and then forcefully try to embed it on its behalf. DO NOT EVER add an embed element to the payload and let it do the rest. That's awful, and it'll limit us to drop-deletable shrapnels in the worry of stuff like arrows and harpoons being embeddable even when not let loose by their weapons.

detachFromWeapon

If we don't want to be embeddable anymore (deactivating an e-dagger for instance)

embed_object

Actually sticks the object to a victim

examined

Someone inspected our embeddable item

roll_embed_chance

Calculates the actual chance to embed based on armour penetration and throwing speed, then returns true if we pass that probability check

severancePackage

A different embed element has been attached, so we'll detach and let them handle things

tryForceEmbed

tryForceEmbed() is called here when we fire COMSIG_EMBED_TRY_FORCE from /obj/item/proc/tryEmbed. Mostly, this means we're a piece of shrapnel from a projectile that just impacted something, and we're trying to embed in it.

The reason for this extra mucking about is avoiding having to do an extra hitby(), and annoying the target by impacting them once with the projectile, then again with the shrapnel, and possibly AGAIN if we actually embed. This way, we save on at least one message.

Arguments: