Moves External Organs to Nullspace (#15548)

* Moves External Organs to Nullspace

* additions

* oops

* further cleanup
This commit is contained in:
Fox McCloud
2021-03-03 21:34:49 +00:00
committed by GitHub
parent 75935ff876
commit 926d484277
21 changed files with 39 additions and 60 deletions
+1 -1
View File
@@ -91,7 +91,7 @@
return
if(!breath || (breath.total_moles() == 0))
if(isspaceturf(loc))
if(isspaceturf(H.loc))
H.adjustOxyLoss(10)
else
H.adjustOxyLoss(5)
+1 -1
View File
@@ -239,7 +239,7 @@
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
if(affected) affected.internal_organs -= src
loc = get_turf(owner)
forceMove(get_turf(owner))
START_PROCESSING(SSobj, src)
if(owner && vital && is_primary_organ()) // I'd do another check for species or whatever so that you couldn't "kill" an IPC by removing a human head from them, but it doesn't matter since they'll come right back from the dead
@@ -7,7 +7,6 @@
max_damage = 0
dir = SOUTH
organ_tag = "limb"
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2 // On Para, external organs have a loc, ergo they need this.
var/brute_mod = 1
var/burn_mod = 1
@@ -115,7 +114,7 @@
/obj/item/organ/external/replaced(var/mob/living/carbon/human/target)
owner = target
forceMove(owner)
loc = null
if(istype(owner))
if(!isnull(owner.bodyparts_by_name[limb_name]))
log_debug("Duplicate organ in slot \"[limb_name]\", mob '[target]'")
@@ -227,7 +226,7 @@
check_fracture(brute)
var/mob/living/carbon/owner_old = owner //Need to update health, but need a reference in case the below check cuts off a limb.
//If limb took enough damage, try to cut or tear it off
if(owner && loc == owner)
if(owner)
if(!cannot_amputate && (brute_dam) >= (max_damage))
if(prob(brute / 2))
if(sharp)
@@ -49,8 +49,7 @@
colour = BlendRGB(owner.m_colours["body"], owner.m_colours["head"], 0.65) //then again im pretty bad at theoretics
if(new_light != glowing)
var/obj/item/organ/external/groin/lbody = owner.get_organ(check_zone(parent_organ))
lbody.set_light(new_light,l_color = colour)
owner.set_light(new_light, l_color = colour)
glowing = new_light
return
@@ -73,14 +72,12 @@
if(!glowing)
var/light = calculate_glow(KIDAN_LANTERN_LIGHT)
var/obj/item/organ/external/groin/lbody = owner.get_organ(check_zone(parent_organ))
lbody.set_light(light,l_color = colour)
owner.set_light(light, l_color = colour)
glowing = light
return 1
else
var/obj/item/organ/external/groin/lbody = owner.get_organ(check_zone(parent_organ))
lbody.set_light(0)
owner.set_light(0)
glowing = 0
return 1
+13 -5
View File
@@ -16,14 +16,24 @@
var/obj/item/storage/internal/pocket
/obj/item/organ/internal/headpocket/New()
..()
pocket = new /obj/item/storage/internal(src)
pocket.storage_slots = 1
// Allow adjacency calculation to work properly
loc = owner
// Fit only pocket sized items
pocket.max_w_class = WEIGHT_CLASS_SMALL
pocket.max_combined_w_class = 2
..()
/obj/item/organ/internal/headpocket/Destroy()
QDEL_NULL(pocket)
return ..()
/obj/item/organ/internal/headpocket/insert(mob/living/carbon/M, special = FALSE, dont_remove_slot = 0)
. = ..()
pocket.master_item = M // So headpockets work with adjacency checks
/obj/item/organ/internal/headpocket/remove(mob/living/carbon/M, special = 0)
pocket.master_item = src
return ..()
/obj/item/organ/internal/headpocket/on_life()
..()
@@ -34,8 +44,6 @@
empty_contents()
/obj/item/organ/internal/headpocket/ui_action_click()
if(!loc)
loc = owner
pocket.MouseDrop(owner)
/obj/item/organ/internal/headpocket/on_owner_death()