This commit is contained in:
Timothy Teakettle
2020-06-11 21:47:48 +01:00
parent 34c9a2f821
commit fda0d4d23e
2 changed files with 12 additions and 4 deletions

View File

@@ -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

View File

@@ -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)]"