mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 20:37:34 +01:00
Unified /organ Initialize() in a single proc (#18731)
* Atomization * sadf --------- Co-authored-by: FluffyGhost <FluffyGhost>
This commit is contained in:
@@ -51,6 +51,33 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
|
||||
|
||||
/obj/item/organ/Initialize(mapload, internal)
|
||||
. = ..()
|
||||
var/mob/living/carbon/holder = loc
|
||||
create_reagents(5)
|
||||
if(!max_damage)
|
||||
max_damage = min_broken_damage * 2
|
||||
if(istype(holder))
|
||||
src.owner = holder
|
||||
species = GLOB.all_species[SPECIES_HUMAN]
|
||||
if(holder.dna)
|
||||
dna = holder.dna.Clone()
|
||||
species = GLOB.all_species[dna.species]
|
||||
else
|
||||
LOG_DEBUG("[src] at [loc] spawned without a proper DNA.")
|
||||
var/mob/living/carbon/human/H = holder
|
||||
if(istype(H))
|
||||
if(internal)
|
||||
var/obj/item/organ/external/E = H.get_organ(parent_organ)
|
||||
if(E)
|
||||
if(E.internal_organs == null)
|
||||
E.internal_organs = list()
|
||||
E.internal_organs |= src
|
||||
if(dna)
|
||||
if(!blood_DNA)
|
||||
blood_DNA = list()
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
if(internal)
|
||||
holder.internal_organs |= src
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
|
||||
/obj/item/organ/Destroy()
|
||||
@@ -83,36 +110,6 @@ INITIALIZE_IMMEDIATE(/obj/item/organ)
|
||||
/obj/item/organ/proc/update_health()
|
||||
return
|
||||
|
||||
/obj/item/organ/Initialize(mapload, internal)
|
||||
. = ..()
|
||||
var/mob/living/carbon/holder = loc
|
||||
create_reagents(5)
|
||||
if(!max_damage)
|
||||
max_damage = min_broken_damage * 2
|
||||
if(istype(holder))
|
||||
src.owner = holder
|
||||
species = GLOB.all_species[SPECIES_HUMAN]
|
||||
if(holder.dna)
|
||||
dna = holder.dna.Clone()
|
||||
species = GLOB.all_species[dna.species]
|
||||
else
|
||||
LOG_DEBUG("[src] at [loc] spawned without a proper DNA.")
|
||||
var/mob/living/carbon/human/H = holder
|
||||
if(istype(H))
|
||||
if(internal)
|
||||
var/obj/item/organ/external/E = H.get_organ(parent_organ)
|
||||
if(E)
|
||||
if(E.internal_organs == null)
|
||||
E.internal_organs = list()
|
||||
E.internal_organs |= src
|
||||
if(dna)
|
||||
if(!blood_DNA)
|
||||
blood_DNA = list()
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
if(internal)
|
||||
holder.internal_organs |= src
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/obj/item/organ/proc/set_dna(var/datum/dna/new_dna)
|
||||
if(new_dna)
|
||||
dna = new_dna.Clone()
|
||||
|
||||
Reference in New Issue
Block a user