This tail refactor turned into an organ refactor. Funny how that works. (#67017)

* Fuck you (refactors ur tails)

* Errors

* Wow. Pain.

* Fixes up probably everything

* finish up here

* Fixes hard del maybe

* original owner hard del

* garbage collection runtime

* suck my peen byond

* Mapped tails

* motherfucker.

* motherrfucker. again.

* Whooopppppsie

* yeah bad idea

* Turns out external organs literally just sat in nullspace forever if their parent was deleted, and didnt Remove() themselves, causing harddels.

* So anyways I repathed all organs

* Fixes

* really.

* unit test... test

* unit test-test but it passes linters this time because im a moh-ron

* I've lost track of what im doing at this point

* Hopefully fixes hard del?

* meh

* Update code/datums/dna.dm

* things n stuff

* repath from master pull
This commit is contained in:
Kapu1178
2022-05-30 21:18:34 -07:00
committed by GitHub
parent f837a3e541
commit 6d470992cb
317 changed files with 2090 additions and 2118 deletions
+1 -1
View File
@@ -65,7 +65,7 @@
return TRUE
/obj/item/airlock_painter/suicide_act(mob/user)
var/obj/item/organ/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
var/obj/item/organ/internal/lungs/L = user.getorganslot(ORGAN_SLOT_LUNGS)
if(can_use(user) && L)
user.visible_message(span_suicide("[user] is inhaling toner from [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
+11 -11
View File
@@ -1,4 +1,4 @@
/obj/item/organ/body_egg
/obj/item/organ/internal/body_egg
name = "body egg"
desc = "All slimy and yuck."
icon_state = "innards"
@@ -6,23 +6,23 @@
zone = BODY_ZONE_CHEST
slot = ORGAN_SLOT_PARASITE_EGG
/obj/item/organ/body_egg/on_find(mob/living/finder)
/obj/item/organ/internal/body_egg/on_find(mob/living/finder)
..()
to_chat(finder, span_warning("You found an unknown alien organism in [owner]'s [zone]!"))
/obj/item/organ/body_egg/Initialize(mapload)
/obj/item/organ/internal/body_egg/Initialize(mapload)
. = ..()
if(iscarbon(loc))
Insert(loc)
/obj/item/organ/body_egg/Insert(mob/living/carbon/M, special = FALSE)
/obj/item/organ/internal/body_egg/Insert(mob/living/carbon/M, special = FALSE)
..()
ADD_TRAIT(owner, TRAIT_XENO_HOST, ORGAN_TRAIT)
ADD_TRAIT(owner, TRAIT_XENO_IMMUNE, ORGAN_TRAIT)
owner.med_hud_set_status()
INVOKE_ASYNC(src, .proc/AddInfectionImages, owner)
/obj/item/organ/body_egg/Remove(mob/living/carbon/M, special = FALSE)
/obj/item/organ/internal/body_egg/Remove(mob/living/carbon/M, special = FALSE)
if(owner)
REMOVE_TRAIT(owner, TRAIT_XENO_HOST, ORGAN_TRAIT)
REMOVE_TRAIT(owner, TRAIT_XENO_IMMUNE, ORGAN_TRAIT)
@@ -30,25 +30,25 @@
INVOKE_ASYNC(src, .proc/RemoveInfectionImages, owner)
..()
/obj/item/organ/body_egg/on_death(delta_time, times_fired)
/obj/item/organ/internal/body_egg/on_death(delta_time, times_fired)
. = ..()
if(!owner)
return
egg_process(delta_time, times_fired)
/obj/item/organ/body_egg/on_life(delta_time, times_fired)
/obj/item/organ/internal/body_egg/on_life(delta_time, times_fired)
. = ..()
egg_process(delta_time, times_fired)
/obj/item/organ/body_egg/proc/egg_process(delta_time, times_fired)
/obj/item/organ/internal/body_egg/proc/egg_process(delta_time, times_fired)
return
/obj/item/organ/body_egg/proc/RefreshInfectionImage()
/obj/item/organ/internal/body_egg/proc/RefreshInfectionImage()
RemoveInfectionImages()
AddInfectionImages()
/obj/item/organ/body_egg/proc/AddInfectionImages()
/obj/item/organ/internal/body_egg/proc/AddInfectionImages()
return
/obj/item/organ/body_egg/proc/RemoveInfectionImages()
/obj/item/organ/internal/body_egg/proc/RemoveInfectionImages()
return
+6 -6
View File
@@ -96,12 +96,12 @@
if(!augment_list)
augment_list = list()
var/list/templist = list(
/obj/item/organ/cyberimp/brain/anti_drop,
/obj/item/organ/cyberimp/arm/toolset,
/obj/item/organ/cyberimp/arm/surgery,
/obj/item/organ/cyberimp/chest/thrusters,
/obj/item/organ/lungs/cybernetic/tier3,
/obj/item/organ/liver/cybernetic/tier3) //cyberimplants range from a nice bonus to fucking broken bullshit so no subtypesof
/obj/item/organ/internal/cyberimp/brain/anti_drop,
/obj/item/organ/internal/cyberimp/arm/toolset,
/obj/item/organ/internal/cyberimp/arm/surgery,
/obj/item/organ/internal/cyberimp/chest/thrusters,
/obj/item/organ/internal/lungs/cybernetic/tier3,
/obj/item/organ/internal/liver/cybernetic/tier3) //cyberimplants range from a nice bonus to fucking broken bullshit so no subtypesof
for(var/V in templist)
var/atom/A = V
augment_list[initial(A.name)] = A
+1 -1
View File
@@ -303,7 +303,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
reagents.expose(smoker, INGEST, min(to_smoke / reagents.total_volume, 1))
var/obj/item/organ/lungs/lungs = smoker.getorganslot(ORGAN_SLOT_LUNGS)
var/obj/item/organ/internal/lungs/lungs = smoker.getorganslot(ORGAN_SLOT_LUNGS)
if(lungs && !(lungs.organ_flags & ORGAN_SYNTHETIC))
var/smoker_resistance = HAS_TRAIT(smoker, TRAIT_SMOKER) ? 0.5 : 1
smoker.adjustOrganLoss(ORGAN_SLOT_LUNGS, lung_harm*smoker_resistance)
+2 -2
View File
@@ -571,7 +571,7 @@
if(do_after(user, 3 SECONDS, H)) //beginning to place the paddles on patient's chest to allow some time for people to move away to stop the process
user.visible_message(span_notice("[user] places [src] on [H]'s chest."), span_warning("You place [src] on [H]'s chest."))
playsound(src, 'sound/machines/defib_charge.ogg', 75, FALSE)
var/obj/item/organ/heart = H.getorgan(/obj/item/organ/heart)
var/obj/item/organ/internal/heart = H.getorgan(/obj/item/organ/internal/heart)
if(do_after(user, 2 SECONDS, H)) //placed on chest and short delay to shock for dramatic effect, revive time is 5sec total
if((!combat && !req_defib) || (req_defib && !defib.combat))
for(var/obj/item/clothing/C in H.get_equipped_items())
@@ -640,7 +640,7 @@
log_combat(user, H, "revived", defib)
do_success()
return
else if (!H.getorgan(/obj/item/organ/heart))
else if (!H.getorgan(/obj/item/organ/internal/heart))
user.visible_message(span_warning("[req_defib ? "[defib]" : "[src]"] buzzes: Patient's heart is missing. Operation aborted."))
playsound(src, 'sound/machines/defib_failed.ogg', 50, FALSE)
else if(H.undergoing_cardiac_arrest())
@@ -75,7 +75,7 @@
to_chat(user, span_warning("You're going to need to remove that [(M.head && M.head.flags_cover & HEADCOVERSEYES) ? "helmet" : (M.wear_mask && M.wear_mask.flags_cover & MASKCOVERSEYES) ? "mask": "glasses"] first!"))
return
var/obj/item/organ/eyes/E = M.getorganslot(ORGAN_SLOT_EYES)
var/obj/item/organ/internal/eyes/E = M.getorganslot(ORGAN_SLOT_EYES)
if(!E)
to_chat(user, span_warning("[M] doesn't have any eyes!"))
return
@@ -527,7 +527,7 @@
if(!fuel)
user.visible_message(span_suicide("[user] is trying to squirt [src]'s fluids into [user.p_their()] eyes... but it's empty!"))
return SHAME
var/obj/item/organ/eyes/eyes = user.getorganslot(ORGAN_SLOT_EYES)
var/obj/item/organ/internal/eyes/eyes = user.getorganslot(ORGAN_SLOT_EYES)
if(!eyes)
user.visible_message(span_suicide("[user] is trying to squirt [src]'s fluids into [user.p_their()] eyes... but [user.p_they()] don't have any!"))
return SHAME
@@ -196,7 +196,7 @@
var/mob/living/carbon/carbontarget = target
// Ear status
var/obj/item/organ/ears/ears = carbontarget.getorganslot(ORGAN_SLOT_EARS)
var/obj/item/organ/internal/ears/ears = carbontarget.getorganslot(ORGAN_SLOT_EARS)
if(istype(ears))
if(HAS_TRAIT_FROM(carbontarget, TRAIT_DEAF, GENETIC_MUTATION))
render_list = "<span class='alert ml-2'>Subject is genetically deaf.\n</span>"
@@ -211,7 +211,7 @@
render_list += "<span class='alert ml-2'>Subject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "] deaf.\n</span>"
// Eye status
var/obj/item/organ/eyes/eyes = carbontarget.getorganslot(ORGAN_SLOT_EYES)
var/obj/item/organ/internal/eyes/eyes = carbontarget.getorganslot(ORGAN_SLOT_EYES)
if(istype(eyes))
if(carbontarget.is_blind())
render_list += "<span class='alert ml-2'>Subject is blind.\n</span>"
@@ -365,7 +365,7 @@
if(iscarbon(target))
var/mob/living/carbon/carbontarget = target
var/cyberimp_detect
for(var/obj/item/organ/cyberimp/CI in carbontarget.internal_organs)
for(var/obj/item/organ/internal/cyberimp/CI in carbontarget.internal_organs)
if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant)
cyberimp_detect += "[!cyberimp_detect ? "[CI.get_examine_string(user)]" : ", [CI.get_examine_string(user)]"]"
if(cyberimp_detect)
@@ -397,7 +397,7 @@
render_list += "<span class='notice ml-1'>Subject contains no reagents in their blood.</span>\n"
// Stomach reagents
var/obj/item/organ/stomach/belly = target.getorganslot(ORGAN_SLOT_STOMACH)
var/obj/item/organ/internal/stomach/belly = target.getorganslot(ORGAN_SLOT_STOMACH)
if(belly)
if(belly.reagents.reagent_list.len)
render_list += "<span class='notice ml-1'>Subject contains the following reagents in their stomach:</span>\n"
+1 -1
View File
@@ -73,7 +73,7 @@
user.visible_message(span_suicide("[user] begins spinning way too fast! It looks like [user.p_theyre()] trying to commit suicide!"))
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)//stole from chainsaw code
var/obj/item/organ/brain/B = user.getorganslot(ORGAN_SLOT_BRAIN)
var/obj/item/organ/internal/brain/B = user.getorganslot(ORGAN_SLOT_BRAIN)
B.organ_flags &= ~ORGAN_VITAL //this cant possibly be a good idea
var/randdir
for(var/i in 1 to 24)//like a headless chicken!
+2 -2
View File
@@ -217,7 +217,7 @@
if(ishuman(slapped))
var/mob/living/carbon/human/human_slapped = slapped
human_slapped.dna?.species?.stop_wagging_tail(slapped)
SEND_SIGNAL(human_slapped, COMSIG_ORGAN_WAG_TAIL, FALSE)
user.do_attack_animation(slapped)
var/slap_volume = 50
@@ -569,7 +569,7 @@
if(!iscarbon(target))
return
var/mob/living/carbon/heartbreakee = target
var/obj/item/organ/heart/dont_go_breakin_my_heart = heartbreakee.getorganslot(ORGAN_SLOT_HEART)
var/obj/item/organ/internal/heart/dont_go_breakin_my_heart = heartbreakee.getorganslot(ORGAN_SLOT_HEART)
dont_go_breakin_my_heart.applyOrganDamage(999)
+1 -1
View File
@@ -312,7 +312,7 @@
/obj/item/melee/baton/telescopic/suicide_act(mob/user)
var/mob/living/carbon/human/human_user = user
var/obj/item/organ/brain/our_brain = human_user.getorgan(/obj/item/organ/brain)
var/obj/item/organ/internal/brain/our_brain = human_user.getorgan(/obj/item/organ/internal/brain)
user.visible_message(span_suicide("[user] stuffs [src] up [user.p_their()] nose and presses the 'extend' button! It looks like [user.p_theyre()] trying to clear [user.p_their()] mind."))
if(active)
+3 -4
View File
@@ -220,10 +220,9 @@
else if(istype(W, /obj/item/bodypart/head/robot))
var/obj/item/bodypart/head/robot/HD = W
for(var/X in HD.contents)
if(istype(X, /obj/item/organ))
to_chat(user, span_warning("There are organs inside [HD]!"))
return
if(locate(/obj/item/organ/internal) in HD)
to_chat(user, span_warning("There are organs inside [HD]!"))
return
if(head)
return
if(HD.flash2 && HD.flash1)
+10 -14
View File
@@ -577,30 +577,26 @@
///freezes the organ and loops bodyparts like heads
/obj/item/storage/organbox/proc/freeze(datum/source, obj/item/I)
SIGNAL_HANDLER
if(isorgan(I))
var/obj/item/organ/organ = I
organ.organ_flags |= ORGAN_FROZEN
if(isinternalorgan(I))
var/obj/item/organ/internal/int_organ = I
int_organ.organ_flags |= ORGAN_FROZEN
return
if(istype(I, /obj/item/bodypart))
var/obj/item/bodypart/B = I
for(var/O in B.contents)
if(isorgan(O))
var/obj/item/organ/organ = O
organ.organ_flags |= ORGAN_FROZEN
for(var/obj/item/organ/internal/int_organ in B.contents)
int_organ.organ_flags |= ORGAN_FROZEN
///unfreezes the organ and loops bodyparts like heads
/obj/item/storage/organbox/proc/unfreeze(datum/source, obj/item/I)
SIGNAL_HANDLER
if(isorgan(I))
var/obj/item/organ/organ = I
organ.organ_flags &= ~ORGAN_FROZEN
if(isinternalorgan(I))
var/obj/item/organ/internal/int_organ = I
int_organ.organ_flags &= ~ORGAN_FROZEN
return
if(istype(I, /obj/item/bodypart))
var/obj/item/bodypart/B = I
for(var/O in B.contents)
if(isorgan(O))
var/obj/item/organ/organ = O
organ.organ_flags &= ~ORGAN_FROZEN
for(var/obj/item/organ/internal/int_organ in B.contents)
int_organ.organ_flags &= ~ORGAN_FROZEN
/obj/item/storage/organbox/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/reagent_containers) && I.is_open_container())