From fda0d4d23efce86949fece63da20b5f87337919f Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Thu, 11 Jun 2020 21:47:48 +0100 Subject: [PATCH] part 5 --- code/datums/elements/embed.dm | 8 ++++++-- code/modules/projectiles/projectile.dm | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/code/datums/elements/embed.dm b/code/datums/elements/embed.dm index 0bfeafb4be..1e7ae9baeb 100644 --- a/code/datums/elements/embed.dm +++ b/code/datums/elements/embed.dm @@ -168,7 +168,7 @@ * 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. */ -/datum/element/embed/proc/checkEmbedProjectile(obj/item/projectile/P, atom/movable/firer, atom/hit) +/datum/element/embed/proc/checkEmbedProjectile(obj/projectile/P, atom/movable/firer, atom/hit, angle, hit_zone) if(!iscarbon(hit) && !isclosedturf(hit)) Detach(P) return // we don't care @@ -177,7 +177,10 @@ var/did_embed if(iscarbon(hit)) var/mob/living/carbon/C = hit - var/obj/item/bodypart/limb = C.get_bodypart(C.check_limb_hit(P.def_zone)) + var/obj/item/bodypart/limb + limb = C.get_bodypart(hit_zone) + if(!limb) + limb = C.get_bodypart() did_embed = payload.tryEmbed(limb) else did_embed = payload.tryEmbed(hit) @@ -213,6 +216,7 @@ hit_zone = limb.body_zone else if(isbodypart(target)) limb = target + hit_zone = limb.body_zone C = limb.owner else if(isclosedturf(target)) T = target diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index d85e083cb5..712519923c 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -190,7 +190,11 @@ // i know that this is probably more with wands and gun mods in mind, but it's a bit silly that the projectile on_hit signal doesn't ping the projectile itself. // maybe we care what the projectile thinks! See about combining these via args some time when it's not 5AM - SEND_SIGNAL(src, COMSIG_PROJECTILE_SELF_ON_HIT, firer, target, Angle) + var/obj/item/bodypart/hit_limb + if(isliving(target)) + var/mob/living/L = target + hit_limb = L.check_limb_hit(def_zone) + SEND_SIGNAL(src, COMSIG_PROJECTILE_SELF_ON_HIT, firer, target, Angle, hit_limb) var/turf/target_loca = get_turf(target) var/hitx @@ -242,7 +246,7 @@ new impact_effect_type(target_loca, hitx, hity) var/organ_hit_text = "" - var/limb_hit = L.check_limb_hit(def_zone)//to get the correct message info. + var/limb_hit = hit_limb if(limb_hit) organ_hit_text = " in \the [parse_zone(limb_hit)]"