Fixed human hard dels (#32417)

This commit is contained in:
DamianX
2022-04-18 18:03:05 +02:00
committed by GitHub
parent d799dd5b10
commit c894ce81b0
9 changed files with 24 additions and 42 deletions

View File

@@ -291,22 +291,18 @@
capture_soul(user,new_target.client,target)
else if(humanTarget)
//aw shit, our target is a brain/headless human, let's try and locate the head.
if(!humanTarget.decapitated || (humanTarget.decapitated.loc == null))
var/obj/item/organ/external/head/target_head = humanTarget.decapitated?.get()
if(!target_head)
if (!blade)
to_chat(user, "<span class='warning'>\The [receptacle] isn't reacting, looks like their brain has been removed or head has been destroyed.</span>")
return
else if(istype(humanTarget.decapitated.loc,/mob/living/carbon/human))
if (!blade)
to_chat(user, "<span class='warning'>\The [receptacle] isn't reacting, looks like their head has been grafted on another body.</span>")
return
else
var/obj/item/organ/external/head/humanHead = humanTarget.decapitated
if((humanHead.z != humanTarget.z) || (get_dist(humanTarget,humanHead) > 5))//F I V E T I L E S
if(target_head.z != humanTarget.z || get_dist(humanTarget, target_head) > 5)//F I V E T I L E S
if (!blade)
to_chat(user, "<span class='warning'>\The [receptacle] isn't reacting, the head needs to be closer from the body.</span>")
return
else
init_head(receptacle, humanHead, user)
init_head(receptacle, target_head, user)
return
else
@@ -348,11 +344,11 @@
else
to_chat(new_target, "<span class='danger'>You feel your soul getting sucked into \the [receptacle].</span>")
to_chat(user, "<span class='rose'>\The [receptacle] reacts to the corpse and starts glowing.</span>")
capture_soul(user,new_target.client,humanHead,humanHead.origin_body)
capture_soul(user,new_target.client,humanHead,humanHead.origin_body?.get())
else
to_chat(humanBrainMob, "<span class='danger'>You feel your soul getting sucked into \the [receptacle].</span>")
to_chat(user, "<span class='rose'>\The [receptacle] reacts to the corpse and starts glowing.</span>")
capture_soul(user,humanBrainMob.client,humanHead,humanHead.origin_body)
capture_soul(user, humanBrainMob.client, humanHead, humanHead.origin_body?.get())
/datum/soul_capture/proc/capture_soul(var/mob/living/carbon/user, var/client/targetClient, var/atom/movable/target, var/atom/movable/add_target = null)
//user is the guy using the soulstone
@@ -407,7 +403,7 @@
else
anim(target = T, a_icon = 'icons/mob/mob.dmi', flick_anim = "dust-h", sleeptime = 26)
if(!gem && body.decapitated && (body.decapitated == target))//just making sure we're dealing with the right head
if(!gem && body.decapitated?.get() == target)//just making sure we're dealing with the right head
new /obj/item/weapon/skull(get_turf(target))
target.invisibility = 101 //It's not possible to interact with the body normally now, but we don't want to delete it just yet

View File

@@ -14,8 +14,9 @@
if(istype(H))
head = H
name = "[H.name]"
if(H.origin_body)
desc = "The severed head of [H.origin_body.real_name], crudely shoved onto the tip of a spear."
var/mob/living/carbon/human/body = H.origin_body?.get()
if(body)
desc = "The severed head of [body.real_name], crudely shoved onto the tip of a spear."
else
desc = "A severed head, crudely shoved onto the tip of a spear."
display_head = new (src)

View File

@@ -77,10 +77,6 @@
qdel(species)
species = null
if(decapitated)
decapitated.origin_body = null
decapitated = null
if(vessel)
qdel(vessel)
vessel = null
@@ -175,4 +171,4 @@
update_body(0)
update_mutantrace()
vessel.remove_reagent(BLOOD,vessel.get_reagent_amount(BLOOD))
return
return

View File

@@ -845,7 +845,7 @@
var/datum/organ/internal/brain/BBrain = internal_organs_by_name["brain"]
if(!BBrain)
var/obj/item/organ/external/head/B = decapitated
var/obj/item/organ/external/head/B = decapitated?.get()
if(B)
var/datum/organ/internal/brain/copied
if(B.organ_data)

View File

@@ -68,7 +68,9 @@
var/lastAnemia = 0 //Anemia rest cooldown
var/last_emote_sound = 0 // Prevent scream spam in some situations
var/obj/item/organ/external/head/decapitated = null //to keep track of a decapitated head, for debug and soulstone purposes
/// To keep track of a decapitated head, for debug and soulstone purposes.
/// (obj/item/organ/external/head)
var/datum/weakref/decapitated
fire_dmi = 'icons/mob/OnFire.dmi'
fire_sprite = "Standing"

View File

@@ -1197,7 +1197,6 @@ var/list/has_died_as_golem = list()
O.organ_data.transplant_data["blood_type"] = slime_person.dna.b_type
O.organ_data.transplant_data["blood_DNA"] = slime_person.dna.unique_enzymes
O.organ_data.organ_holder = null
O.organ_data.owner = slime_person
slime_person.internal_organs |= O.organ_data
head.internal_organs |= O.organ_data

View File

@@ -1070,13 +1070,9 @@ Note that amputating the affected organ does in fact remove the infection from t
//Transfer any internal_organs from the organ item to the body
for(var/datum/organ/internal/transfer in organ.internal_organs)
if(transfer) //Don't transfer null organs
owner.internal_organs += transfer
//Transfer any internal_organs (by name) from the organ item to the body
for(var/datum/organ/internal/transfer_by_name in organ.internal_organs)
if(transfer_by_name)
owner.internal_organs_by_name[transfer_by_name.organ_type] = transfer_by_name
owner.internal_organs_by_name[transfer_by_name.organ_type].owner = owner
owner.internal_organs += transfer
owner.internal_organs_by_name[transfer.organ_type] = transfer
owner.internal_organs_by_name[transfer.organ_type].owner = owner
//Process attached parts (i.e. if attaching an arm with a hand, this will process the hand)
@@ -1496,13 +1492,12 @@ Note that amputating the affected organ does in fact remove the infection from t
/datum/organ/external/head/generate_dropped_organ(current_organ)
if(!current_organ)
current_organ = new /obj/item/organ/external/head(owner.loc, owner, src)
owner.decapitated = current_organ
owner.decapitated = makeweakref(current_organ)
var/datum/organ/internal/brain/B = eject_brain()
eject_eyes()
var/obj/item/organ/external/head/H = current_organ
if(B)
H.organ_data = B
B.organ_holder = current_organ
B.owner_dna = H.owner_dna
return current_organ
@@ -1819,7 +1814,8 @@ Note that amputating the affected organ does in fact remove the infection from t
w_class = W_CLASS_SMALL
var/mob/living/carbon/brain/brainmob
var/brain_op_stage = 0
var/mob/living/carbon/human/origin_body = null
/// (/mob/living/carbon/human)
var/datum/weakref/origin_body
/// Copied from the human passed to New(). Used when the head is reattached.
var/datum/human_appearance/owner_appearance
@@ -1841,7 +1837,7 @@ Note that amputating the affected organ does in fact remove the infection from t
name = "robotic head"
/obj/item/organ/external/head/New(loc, mob/living/carbon/human/H, var/datum/organ/external/head/O)
origin_body = H
origin_body = makeweakref(H)
if(istype(H))
src.icon_state = H.gender == MALE? "head_m" : "head_f"
@@ -2028,9 +2024,8 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/head/Destroy()
if(brainmob)
brainmob.ghostize()
if(origin_body)
origin_body.decapitated = null
origin_body = null
qdel(brainmob)
brainmob = null
..()
/mob/living/carbon/human/find_organ_by_grasp_index(index)

View File

@@ -14,7 +14,6 @@
var/removed_type //When removed, forms this object.
var/list/transplant_data // Blood DNA and colour of donor
var/rejecting // Is this organ already being rejected?
var/obj/item/organ/internal/organ_holder
var/datum/dna/owner_dna
@@ -25,9 +24,6 @@
var/datum/organ/external/E = owner.organs_by_name[parent_organ] //Fuck this setup
E.internal_organs -= src
owner = null
if(organ_holder)
organ_holder.organ_data = null
organ_holder = null
..()
/datum/organ/internal/Copy()
@@ -41,7 +37,6 @@
I.removed_type = removed_type
I.transplant_data = transplant_data
I.rejecting = rejecting
I.organ_holder = null
I.owner_dna = owner_dna
return I
@@ -248,7 +243,6 @@
if(owner)
removed_organ.had_mind = !isnull(owner.mind)
removed_organ.update()
organ_holder = removed_organ
removed_organ.stabilized = FALSE
return removed_organ

View File

@@ -441,7 +441,6 @@
O.organ_data.transplant_data["blood_type"] = transplant_blood.data["blood_type"]
O.organ_data.transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"]
O.organ_data.organ_holder = null
O.organ_data.owner = target
target.internal_organs |= O.organ_data
affected.internal_organs |= O.organ_data