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-31 00:18:34 -04:00
committed by GitHub
parent f837a3e541
commit 6d470992cb
317 changed files with 2090 additions and 2118 deletions
@@ -1,4 +1,4 @@
/obj/item/organ/cyberimp/bci
/obj/item/organ/internal/cyberimp/bci
name = "brain-computer interface"
desc = "An implant that can be placed in a user's head to control circuits using their brain."
icon = 'icons/obj/wiremod.dmi'
@@ -7,7 +7,7 @@
zone = BODY_ZONE_HEAD
w_class = WEIGHT_CLASS_TINY
/obj/item/organ/cyberimp/bci/Initialize(mapload)
/obj/item/organ/internal/cyberimp/bci/Initialize(mapload)
. = ..()
var/obj/item/integrated_circuit/circuit = new(src)
@@ -17,13 +17,13 @@
new /obj/item/circuit_component/bci_core,
), SHELL_CAPACITY_SMALL, starting_circuit = circuit)
/obj/item/organ/cyberimp/bci/Insert(mob/living/carbon/reciever, special, drop_if_replaced)
/obj/item/organ/internal/cyberimp/bci/Insert(mob/living/carbon/reciever, special, drop_if_replaced)
. = ..()
// Organs are put in nullspace, but this breaks circuit interactions
forceMove(reciever)
/obj/item/organ/cyberimp/bci/say(message, bubble_type, list/spans, sanitize, datum/language/language, ignore_spam, forced)
/obj/item/organ/internal/cyberimp/bci/say(message, bubble_type, list/spans, sanitize, datum/language/language, ignore_spam, forced)
if (owner)
// Otherwise say_dead will be called.
// It's intentional that a circuit for a dead person does not speak from the shell.
@@ -37,7 +37,7 @@
/obj/item/circuit_component/equipment_action/bci
display_name = "BCI Action"
desc = "Represents an action the user can take when implanted with the brain-computer interface."
required_shells = list(/obj/item/organ/cyberimp/bci)
required_shells = list(/obj/item/organ/internal/cyberimp/bci)
/// A reference to the action button itself
var/datum/action/innate/bci_action/bci_action
@@ -48,7 +48,7 @@
/obj/item/circuit_component/equipment_action/bci/register_shell(atom/movable/shell)
. = ..()
var/obj/item/organ/cyberimp/bci/bci = shell
var/obj/item/organ/internal/cyberimp/bci/bci = shell
if(istype(bci))
bci_action = new(src)
update_action()
@@ -56,7 +56,7 @@
bci.actions += list(bci_action)
/obj/item/circuit_component/equipment_action/bci/unregister_shell(atom/movable/shell)
var/obj/item/organ/cyberimp/bci/bci = shell
var/obj/item/organ/internal/cyberimp/bci/bci = shell
if(istype(bci))
bci.actions -= bci_action
QDEL_NULL(bci_action)
@@ -118,7 +118,7 @@
return ..()
/obj/item/circuit_component/bci_core/register_shell(atom/movable/shell)
var/obj/item/organ/cyberimp/bci/bci = shell
var/obj/item/organ/internal/cyberimp/bci/bci = shell
charge_action = new(src)
bci.actions += list(charge_action)
@@ -127,7 +127,7 @@
RegisterSignal(shell, COMSIG_ORGAN_REMOVED, .proc/on_organ_removed)
/obj/item/circuit_component/bci_core/unregister_shell(atom/movable/shell)
var/obj/item/organ/cyberimp/bci/bci = shell
var/obj/item/organ/internal/cyberimp/bci/bci = shell
bci.actions -= charge_action
QDEL_NULL(charge_action)
@@ -290,7 +290,7 @@
occupant_typecache = typecacheof(/mob/living/carbon)
/obj/machinery/bci_implanter/on_deconstruction()
var/obj/item/organ/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
var/obj/item/organ/internal/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
bci_to_implant_resolved?.forceMove(drop_location())
bci_to_implant = null
@@ -350,7 +350,7 @@
balloon_alert(user, "it's locked!")
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
var/obj/item/organ/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
var/obj/item/organ/internal/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
if (isnull(bci_to_implant_resolved))
balloon_alert(user, "no bci inserted!")
else
@@ -362,13 +362,13 @@
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
/obj/machinery/bci_implanter/attackby(obj/item/weapon, mob/user, params)
var/obj/item/organ/cyberimp/bci/new_bci = weapon
var/obj/item/organ/internal/cyberimp/bci/new_bci = weapon
if (istype(new_bci))
if (!(locate(/obj/item/integrated_circuit) in new_bci))
balloon_alert(user, "bci has no circuit!")
return
var/obj/item/organ/cyberimp/bci/previous_bci_to_implant = bci_to_implant?.resolve()
var/obj/item/organ/internal/cyberimp/bci/previous_bci_to_implant = bci_to_implant?.resolve()
bci_to_implant = WEAKREF(weapon)
weapon.moveToNullspace()
@@ -425,8 +425,8 @@
playsound(loc, 'sound/machines/ping.ogg', 30, FALSE)
var/obj/item/organ/cyberimp/bci/bci_organ = carbon_occupant.getorgan(/obj/item/organ/cyberimp/bci)
var/obj/item/organ/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
var/obj/item/organ/internal/cyberimp/bci/bci_organ = carbon_occupant.getorgan(/obj/item/organ/internal/cyberimp/bci)
var/obj/item/organ/internal/cyberimp/bci/bci_to_implant_resolved = bci_to_implant?.resolve()
if (bci_organ)
bci_organ.Remove(carbon_occupant)
@@ -459,7 +459,7 @@
var/mob/living/carbon/carbon_occupant = occupant
if (istype(occupant))
var/obj/item/organ/cyberimp/bci/existing_bci_organ = carbon_occupant.getorgan(/obj/item/organ/cyberimp/bci)
var/obj/item/organ/internal/cyberimp/bci/existing_bci_organ = carbon_occupant.getorgan(/obj/item/organ/internal/cyberimp/bci)
if (isnull(existing_bci_organ) && isnull(bci_to_implant?.resolve()))
say("No brain-computer interface inserted, and occupant does not have one. Insert a BCI to implant one.")
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)