mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Frankenstein
This commit does the following
- Organs are no longer reliant on the species and DNA of their attached
owner. Whoever made the organs (ex a spawned mob) transfers their
species and DNA to the organ, and it uses that for calculations.
- You may now attach organs cross-species; Yes, this means sticking
skrell heads onto humans to make tentacle monsters. Or something.
- IPC's may now choose their frame color.
- I did say elsewhere this was not feasible; However, after taking a few
hours to learn the systems behind all of it, I managed to hack
something together. It's snowflakey, but fuck it, it doesn't need to
be not-snowflakey.
This commit is contained in:
@@ -21,7 +21,8 @@ var/list/organ_cache = list()
|
||||
var/list/trace_chemicals = list() // traces of chemicals in the organ,
|
||||
// links chemical IDs to number of ticks for which they'll stay in the blood
|
||||
germ_level = 0
|
||||
|
||||
var/datum/dna/dna
|
||||
var/datum/species/species
|
||||
|
||||
/obj/item/organ/Destroy()
|
||||
if(!owner)
|
||||
@@ -59,6 +60,12 @@ var/list/organ_cache = list()
|
||||
max_damage = min_broken_damage * 2
|
||||
if(istype(holder))
|
||||
src.owner = holder
|
||||
species = all_species["Human"]
|
||||
if(holder.dna)
|
||||
dna = holder.dna.Clone()
|
||||
species = all_species[dna.species]
|
||||
else
|
||||
log_to_dd("[src] at [loc] spawned without a proper DNA.")
|
||||
var/mob/living/carbon/human/H = holder
|
||||
if(istype(H))
|
||||
if(internal)
|
||||
@@ -67,13 +74,19 @@ var/list/organ_cache = list()
|
||||
if(E.internal_organs == null)
|
||||
E.internal_organs = list()
|
||||
E.internal_organs |= src
|
||||
if(H.dna)
|
||||
if(dna)
|
||||
if(!blood_DNA)
|
||||
blood_DNA = list()
|
||||
blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
if(internal)
|
||||
holder.internal_organs |= src
|
||||
|
||||
/obj/item/organ/proc/set_dna(var/datum/dna/new_dna)
|
||||
if(new_dna)
|
||||
dna = new_dna.Clone()
|
||||
blood_DNA.Cut()
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
|
||||
/obj/item/organ/proc/die()
|
||||
if(status & ORGAN_ROBOT)
|
||||
return
|
||||
|
||||
@@ -12,13 +12,25 @@ var/global/list/limb_icon_cache = list()
|
||||
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
|
||||
s_tone = null
|
||||
s_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(status & ORGAN_ROBOT && !(species && species.name == "Machine")) //machine people get skin color
|
||||
return
|
||||
if(species && human.species && species.name != human.species.name)
|
||||
return
|
||||
if(!isnull(human.s_tone) && (human.species.bodyflags & HAS_SKIN_TONE))
|
||||
s_tone = human.s_tone
|
||||
if(human.species.bodyflags & HAS_SKIN_COLOR)
|
||||
s_col = list(human.r_skin, human.g_skin, human.b_skin)
|
||||
|
||||
/obj/item/organ/external/proc/sync_colour_to_dna()
|
||||
s_tone = null
|
||||
s_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
return
|
||||
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.flags & HAS_SKIN_TONE))
|
||||
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
|
||||
if(species.flags & HAS_SKIN_COLOR)
|
||||
s_col = list(dna.GetUIValue(DNA_UI_SKIN_R), dna.GetUIValue(DNA_UI_SKIN_G), dna.GetUIValue(DNA_UI_SKIN_B))
|
||||
|
||||
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
|
||||
..()
|
||||
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"]
|
||||
@@ -34,11 +46,11 @@ var/global/list/limb_icon_cache = list()
|
||||
overlays.Cut()
|
||||
if(!owner)
|
||||
return
|
||||
|
||||
if(owner.species.has_organ["eyes"])
|
||||
|
||||
if(species.has_organ["eyes"])
|
||||
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"]
|
||||
if(owner.species.eyes)
|
||||
var/icon/eyes_icon = new/icon('icons/mob/human_face.dmi', owner.species.eyes)
|
||||
if(species.eyes)
|
||||
var/icon/eyes_icon = new/icon('icons/mob/human_face.dmi', species.eyes)
|
||||
if(eyes)
|
||||
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
|
||||
else
|
||||
@@ -46,14 +58,14 @@ var/global/list/limb_icon_cache = list()
|
||||
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
|
||||
overlays |= eyes_icon
|
||||
|
||||
if(owner.lip_style && (owner.species && (owner.species.flags & HAS_LIPS)))
|
||||
if(owner.lip_style && (species && (species.flags & HAS_LIPS)))
|
||||
var/icon/lip_icon = new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s")
|
||||
overlays |= lip_icon
|
||||
mob_icon.Blend(lip_icon, ICON_OVERLAY)
|
||||
|
||||
if(owner.f_style)
|
||||
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style]
|
||||
if(facial_hair_style && facial_hair_style.species_allowed && (owner.species.name in facial_hair_style.species_allowed))
|
||||
if(facial_hair_style && facial_hair_style.species_allowed && (species.name in facial_hair_style.species_allowed))
|
||||
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
|
||||
if(facial_hair_style.do_colouration)
|
||||
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD)
|
||||
@@ -61,7 +73,7 @@ var/global/list/limb_icon_cache = list()
|
||||
|
||||
if(owner.h_style && !(owner.head && (owner.head.flags & BLOCKHEADHAIR)))
|
||||
var/datum/sprite_accessory/hair_style = hair_styles_list[owner.h_style]
|
||||
if(hair_style && (owner.species.name in hair_style.species_allowed))
|
||||
if(hair_style && (species.name in hair_style.species_allowed))
|
||||
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
|
||||
if(hair_style.do_colouration)
|
||||
hair_s.Blend(rgb(owner.r_hair, owner.g_hair, owner.b_hair), ICON_ADD)
|
||||
@@ -74,26 +86,29 @@ var/global/list/limb_icon_cache = list()
|
||||
var/gender
|
||||
if(force_icon)
|
||||
mob_icon = new /icon(force_icon, "[icon_name]")
|
||||
if(species && species.name == "Machine") //snowflake for IPC's, sorry.
|
||||
if(s_col && s_col.len >= 3)
|
||||
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
|
||||
else
|
||||
if(!owner)
|
||||
if(!dna)
|
||||
mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]")
|
||||
else
|
||||
|
||||
if(gendered_icon)
|
||||
if(owner.gender == FEMALE)
|
||||
if(dna.GetUIState(DNA_UI_GENDER))
|
||||
gender = "f"
|
||||
else
|
||||
gender = "m"
|
||||
|
||||
if(skeletal)
|
||||
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else if (status & ORGAN_ROBOT)
|
||||
else if(status & ORGAN_ROBOT)
|
||||
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else
|
||||
if (status & ORGAN_MUTATED)
|
||||
mob_icon = new /icon(owner.species.deform, "[icon_name][gender ? "_[gender]" : ""]")
|
||||
mob_icon = new /icon(species.deform, "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else
|
||||
mob_icon = new /icon(owner.species.icobase, "[icon_name][gender ? "_[gender]" : ""]")
|
||||
mob_icon = new /icon(species.icobase, "[icon_name][gender ? "_[gender]" : ""]")
|
||||
|
||||
if(status & ORGAN_DEAD)
|
||||
mob_icon.ColorTone(rgb(10,50,0))
|
||||
|
||||
Reference in New Issue
Block a user