embed
Procs | |
check_embed | Checking to see if we're gonna embed into a human |
---|---|
check_embed_projectile | check_embed_projectile() is what we get when a projectile with a defined shrapnel_type impacts a target. |
detach_from_weapon | 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_tags | 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 |
sever_element | A different embed element has been attached, so we'll detach and let them handle things |
try_force_embed | try_force_embed() 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. |
Proc Details
check_embed
Checking to see if we're gonna embed into a human
check_embed_projectile
check_embed_projectile() 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.
detach_from_weapon
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_tags
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
sever_element
A different embed element has been attached, so we'll detach and let them handle things
try_force_embed
try_force_embed() 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:
- embedding_item- the item we're trying to insert into the target
- target- what we're trying to shish-kabob, either a bodypart or a carbon
- 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.
- forced- if we want this to succeed 100%