Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#define FACING_INIT_FACING_TARGET_TARGET_FACING_PERPENDICULAR 3 //Do I win the most informative but also most stupid define award?

// NON-MODULE CHANGE
/// Gets random human blood type, weighted to real human blood type distribution.
/proc/random_human_blood_type()
var/static/list/human_blood_type_weights = list(
/datum/blood_type/crew/human/o_minus = 4,
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/decals/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
var/list/all_dna = GET_ATOM_BLOOD_DNA(source)
var/list/all_blood_names = list()
for(var/dna_sample in all_dna)
var/datum/blood_type/blood = GLOB.blood_types[all_dna[dna_sample]]
var/datum/blood_type/blood = find_blood_type(all_dna[dna_sample])
all_blood_names |= lowertext(initial(blood.reagent_type.name))

override[EXAMINE_POSITION_BEFORE] = "[english_list(all_blood_names, nothing_text = "blood")] stained"
2 changes: 1 addition & 1 deletion code/datums/quirks/negative_quirks/blood_deficiency.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
return

for(var/obj/item/reagent_containers/blood/blood_bag as anything in typesof(/obj/item/reagent_containers/blood))
if(initial(blood_bag.blood_type) == new_type.type)
if(initial(blood_bag.blood_type) == new_type.type_key())
mail_goodies += blood_bag
break

Expand Down
4 changes: 2 additions & 2 deletions code/game/atom/_atom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
/mob/living/proc/get_blood_dna_list()
var/datum/blood_type/blood = get_blood_type()
if(!isnull(blood))
return list("UNKNOWN DNA" = blood.type)
return list("UNKNOWN DNA" = blood.type_key())
return null

///Get the mobs dna list
Expand All @@ -498,7 +498,7 @@
var/datum/blood_type/blood = get_blood_type()
if(isnull(blood)) // Skeletons?
return null
return list("[dna.unique_enzymes]" = blood.type)
return list("[dna.unique_enzymes]" = blood.type_key())

// NON-MODULE CHANGE END

Expand Down
2 changes: 1 addition & 1 deletion code/game/atom/atom_examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
if(iscarbon(old_wearer))
var/mob/living/carbon/carbon_wearer = old_wearer
id_species ||= carbon_wearer.dna.species.name
id_blood_type ||= GLOB.blood_types[carbon_wearer.dna.species.exotic_bloodtype || carbon_wearer.dna.human_blood_type].name
id_blood_type ||= find_blood_type(carbon_wearer.dna?.species?.exotic_bloodtype || carbon_wearer.dna?.human_blood_type)?.name

var/id_examine = span_slightly_larger(separator_hr("This is <em>[old_wearer]'s ID card</em>."))
id_examine += "<div class='img_by_text_container'>"
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/computer/dna_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@
"UE"=scanner_occupant.dna.unique_enzymes,
"UF"=scanner_occupant.dna.unique_features,
"name"=scanner_occupant.real_name,
"blood_type"="[GLOB.blood_types[scanner_occupant.dna.human_blood_type]]")
"blood_type"="[find_blood_type(scanner_occupant.dna.human_blood_type)]")

return

Expand Down Expand Up @@ -1721,7 +1721,7 @@
scanner_occupant.real_name = buffer_slot["name"]
scanner_occupant.name = buffer_slot["name"]
scanner_occupant.dna.unique_enzymes = buffer_slot["UE"]
scanner_occupant.dna.human_blood_type = blood_name_to_blood_type(buffer_slot["blood_type"])
scanner_occupant.dna.human_blood_type = find_blood_type(buffer_slot["blood_type"]).type_key()
scanner_occupant.apply_status_effect(/datum/status_effect/genetic_damage, damage_increase)
scanner_occupant.domutcheck()
return TRUE
Expand All @@ -1739,7 +1739,7 @@
scanner_occupant.real_name = buffer_slot["name"]
scanner_occupant.name = buffer_slot["name"]
scanner_occupant.dna.unique_enzymes = buffer_slot["UE"]
scanner_occupant.dna.human_blood_type = blood_name_to_blood_type(buffer_slot["blood_type"])
scanner_occupant.dna.human_blood_type = find_blood_type(buffer_slot["blood_type"]).type_key()
scanner_occupant.apply_status_effect(/datum/status_effect/genetic_damage, damage_increase)
scanner_occupant.domutcheck()
return TRUE
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/records/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
return FALSE

target.age = 18
target.blood_type = "[GLOB.blood_types[random_human_blood_type()]]" // NON-MODULE CHANGE
target.blood_type = "[find_blood_type(random_human_blood_type())]" // NON-MODULE CHANGE
target.dna_string = "Unknown"
target.gender = "Unknown"
target.major_disabilities = ""
Expand Down
55 changes: 41 additions & 14 deletions code/game/objects/effects/decals/cleanable/humans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
/// Is this blood dried out?
var/dried = FALSE

/// How much our blood glows, up to 255 (it's the alpha of the EM overlay). 0 = no glow
var/emissive_alpha = 0

/// The "base name" of the blood, IE the "pool of" in "pool of blood"
var/base_name = "pool of"
/// When dried, this is prefixed to the name
Expand Down Expand Up @@ -78,7 +81,7 @@
var/list/all_dna = GET_ATOM_BLOOD_DNA(src)
var/list/all_blood_names = list()
for(var/dna_sample in all_dna)
var/datum/blood_type/blood = GLOB.blood_types[all_dna[dna_sample]]
var/datum/blood_type/blood = find_blood_type(all_dna[dna_sample])
all_blood_names |= lowertext(initial(blood.reagent_type.name))
return english_list(all_blood_names, nothing_text = "blood")

Expand All @@ -105,6 +108,14 @@
if(dried && dry_desc)
desc = dry_desc

/obj/effect/decal/cleanable/blood/update_overlays()
. = ..()
if(icon_state && emissive_alpha && emissive_alpha < alpha && !dried)
. += blood_emissive(icon, icon_state)

/obj/effect/decal/cleanable/blood/proc/blood_emissive(icon_to_use, icon_state_to_use)
return emissive_appearance(icon_to_use, icon_state_to_use, src, layer, alpha - emissive_alpha)

///This is what actually "dries" the blood. Returns true if it's all out of blood to dry, and false otherwise
/obj/effect/decal/cleanable/blood/proc/dry()
dried = TRUE
Expand All @@ -118,7 +129,7 @@
var/list/all_dna = GET_ATOM_BLOOD_DNA(src)
var/list/reagents_to_add = list()
for(var/dna_sample in all_dna)
var/datum/blood_type/blood = GLOB.blood_types[all_dna[dna_sample]]
var/datum/blood_type/blood = find_blood_type(all_dna[dna_sample])
reagents_to_add += blood.reagent_type

var/num_reagents = length(reagents_to_add)
Expand Down Expand Up @@ -345,8 +356,8 @@
var/ang_change = dir2angle(newdir) - dir2angle(dir)
var/old_entered_dirs = entered_dirs
var/old_exited_dirs = exited_dirs
entered_dirs = 0
exited_dirs = 0
entered_dirs = NONE
exited_dirs = NONE

for(var/Ddir in GLOB.cardinals)
if(old_entered_dirs & Ddir)
Expand All @@ -357,14 +368,9 @@
update_appearance()
return ..()

//Cache of bloody footprint images
//Key:
//"entered-[blood_state]-[dir_of_image]"
//or: "exited-[blood_state]-[dir_of_image]"
GLOBAL_LIST_EMPTY(bloody_footprints_cache)

/obj/effect/decal/cleanable/blood/footprints/update_overlays()
. = ..()
var/static/list/bloody_footprints_cache = list()
var/icon_state_to_use = "blood"
if(LAZYACCESS(species_types, BODYPART_ID_DIGITIGRADE))
icon_state_to_use += "claw"
Expand All @@ -375,17 +381,38 @@ GLOBAL_LIST_EMPTY(bloody_footprints_cache)

for(var/Ddir in GLOB.cardinals)
if(entered_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["entered-[icon_state_to_use]-[Ddir]"]
var/enter_state = "entered-[icon_state_to_use]-[Ddir]"
var/image/bloodstep_overlay = bloody_footprints_cache[enter_state]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["entered-[icon_state_to_use]-[Ddir]"] = bloodstep_overlay = image(icon, "[icon_state_to_use]1", dir = Ddir)
bloodstep_overlay = image(icon, "[icon_state_to_use]1", dir = Ddir)
bloody_footprints_cache[enter_state] = bloodstep_overlay
. += bloodstep_overlay

if(emissive_alpha && emissive_alpha < alpha && !dried)
var/enter_emissive_state = "[enter_state]_emissive-[emissive_alpha]"
var/mutable_appearance/emissive_overlay = bloody_footprints_cache[enter_emissive_state]
if(!emissive_overlay)
emissive_overlay = blood_emissive(icon, "[icon_state_to_use]1")
emissive_overlay.dir = Ddir
bloody_footprints_cache[enter_emissive_state] = emissive_overlay
. += emissive_overlay

if(exited_dirs & Ddir)
var/image/bloodstep_overlay = GLOB.bloody_footprints_cache["exited-[icon_state_to_use]-[Ddir]"]
var/exit_state = "exited-[icon_state_to_use]-[Ddir]"
var/image/bloodstep_overlay = bloody_footprints_cache[exit_state]
if(!bloodstep_overlay)
GLOB.bloody_footprints_cache["exited-[icon_state_to_use]-[Ddir]"] = bloodstep_overlay = image(icon, "[icon_state_to_use]2", dir = Ddir)
bloodstep_overlay = image(icon, "[icon_state_to_use]2", dir = Ddir)
bloody_footprints_cache[exit_state] = bloodstep_overlay
. += bloodstep_overlay

if(emissive_alpha && emissive_alpha < alpha && !dried)
var/exit_emissive_state = "[exit_state]_emissive-[emissive_alpha]"
var/mutable_appearance/emissive_overlay = bloody_footprints_cache[exit_emissive_state]
if(!emissive_overlay)
emissive_overlay = blood_emissive(icon, "[icon_state_to_use]2")
emissive_overlay.dir = Ddir
bloody_footprints_cache[exit_emissive_state] = emissive_overlay
. += emissive_overlay

/obj/effect/decal/cleanable/blood/footprints/examine(mob/user)
. = ..()
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/items/dna_injector.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
target.real_name = fields["name"]
target.dna.unique_enzymes = fields["UE"]
target.name = target.real_name
target.dna.human_blood_type = blood_name_to_blood_type(fields["blood_type"])
target.dna.human_blood_type = find_blood_type(fields["blood_type"]).type_key()
if(fields["UI"]) //UI+UE
target.dna.unique_identity = merge_text(target.dna.unique_identity, fields["UI"])
if(fields["UF"])
Expand Down Expand Up @@ -136,7 +136,7 @@
target.real_name = fields["name"]
target.dna.unique_enzymes = fields["UE"]
target.name = target.real_name
target.dna.human_blood_type = blood_name_to_blood_type(fields["blood_type"])
target.dna.human_blood_type = find_blood_type(fields["blood_type"]).type_key()
target.dna.temporary_mutations[UE_CHANGED] = endtime
if(fields["UI"]) //UI+UE
if(!target.dna.previous["UI"])
Expand Down
22 changes: 16 additions & 6 deletions code/modules/antagonists/abductor/equipment/glands/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
righthand_file = 'icons/mob/inhands/items/food_righthand.dmi'
mind_control_uses = 3
mind_control_duration = 1500
var/new_bloodtype = null

/obj/item/organ/internal/heart/gland/blood/ownerCheck()
return ..() && !HAS_TRAIT(owner, TRAIT_NOBLOOD) && !!owner.dna?.species

/obj/item/organ/internal/heart/gland/blood/activate()
if(!ishuman(owner) || !owner.dna.species)
return
var/mob/living/carbon/human/H = owner
var/datum/species/species = H.dna.species
to_chat(H, span_warning("You feel your blood heat up for a moment."))
species.exotic_bloodtype = pick(subtypesof(/datum/blood_type)) // NON-MODULE CHANGE: ANYthing, including xeno blood
to_chat(owner, span_warning("You feel your blood heat up for a moment."))
new_bloodtype = get_random_reagent_id()
owner.dna.species.exotic_bloodtype = new_bloodtype

/obj/item/organ/internal/heart/gland/blood/on_mob_remove(mob/living/carbon/organ_owner, special)
. = ..()
organ_owner.dna?.species?.exotic_bloodtype = initial(owner.dna.species.exotic_bloodtype)

/obj/item/organ/internal/heart/gland/blood/on_mob_insert(mob/living/carbon/organ_owner, special, movement_flags)
. = ..()
if(new_bloodtype)
organ_owner.dna?.species?.exotic_bloodtype = new_bloodtype
2 changes: 1 addition & 1 deletion code/modules/detectivework/scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@

for(var/bloodtype in blood)
LAZYADD(det_data[DETSCAN_CATEGORY_BLOOD], \
"Type: <font color='red'>[GLOB.blood_types[blood[bloodtype]]]</font> DNA (UE): <font color='red'>[bloodtype]</font>") // NON-MODULE CHANGE
"Type: <font color='red'>[find_blood_type(blood[bloodtype])]</font> DNA (UE): <font color='red'>[bloodtype]</font>") // NON-MODULE CHANGE

// sends it off to be modified by the items
SEND_SIGNAL(scanned_atom, COMSIG_DETECTIVE_SCANNED, user, det_data)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/forensics/forensics_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@
var/list/colors = list()
var/list/all_dna = GET_ATOM_BLOOD_DNA(src)
for(var/dna_sample in all_dna)
var/datum/blood_type/blood = GLOB.blood_types[all_dna[dna_sample]]
colors += blood.color
colors += find_blood_type(all_dna[dna_sample]).color

var/final_color = pop(colors)
for(var/color in colors)
Expand All @@ -95,7 +94,8 @@

/obj/effect/decal/cleanable/blood/drip/get_blood_dna_color()
var/list/all_dna = GET_ATOM_BLOOD_DNA(src)
return GLOB.blood_types[all_dna[all_dna[1]]]?.color // what the fuck was i doing?
var/blood_type_to_use = all_dna[all_dna[1]]
return find_blood_type(blood_type_to_use).color

/// Adds blood dna to the atom
/atom/proc/add_blood_DNA(list/blood_DNA_to_add) //ASSOC LIST DNA = BLOODTYPE
Expand All @@ -121,7 +121,7 @@
color = get_blood_dna_color()
// Imperfect, ends up with some blood types being double-set-up, but harmless (for now)
for(var/new_blood in blood_DNA_to_add)
var/datum/blood_type/blood = GLOB.blood_types[blood_DNA_to_add[new_blood]]
var/datum/blood_type/blood = find_blood_type(blood_DNA_to_add[new_blood])
blood.set_up_blood(src, first_dna == 0)
update_appearance()
return TRUE
Expand Down
13 changes: 7 additions & 6 deletions code/modules/hydroponics/grown/replicapod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,15 @@
podman.hardset_dna(null, null, null, podman.real_name, blood_type, new /datum/species/pod, features) // Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman
podman.set_cloned_appearance()

//Get the most plentiful reagent, if there's none: get water
var/list/most_plentiful_reagent = list(/datum/reagent/water = 0)
//Get the most plentiful reagent,
var/datum/reagent/most_plentiful_reagent
for(var/reagent in reagents_add)
if(reagents_add[reagent] > most_plentiful_reagent[most_plentiful_reagent[1]])
most_plentiful_reagent.Cut()
most_plentiful_reagent[reagent] = reagents_add[reagent]
if(!most_plentiful_reagent || reagents_add[reagent] > reagents_add[most_plentiful_reagent])
most_plentiful_reagent = reagent

// podman.dna.species.exotic_blood = most_plentiful_reagent[1] // NON-MODULE CHANGE : MELBERT TODO
//if there's none: get water
most_plentiful_reagent ||= /datum/reagent/water
podman.dna.species.exotic_bloodtype = most_plentiful_reagent
investigate_log("[key_name(mind)] cloned as a podman via [src] in [parent]", INVESTIGATE_BOTANY)
parent.update_tray(user, 1)
return result
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
/mob/living/basic/wizard/get_blood_type()
if(!fake_blood_type)
fake_blood_type = random_human_blood_type()
return GLOB.blood_types[fake_blood_type]
return find_blood_type(fake_blood_type)

/// Uses the colors and loadout of the original wizard simplemob
/mob/living/basic/wizard/classic
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/basic/space_fauna/cat_surgeon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/mob/living/basic/cat_butcherer/get_blood_type()
if(!fake_blood_type)
fake_blood_type = random_human_blood_type()
return GLOB.blood_types[fake_blood_type]
return find_blood_type(fake_blood_type)

/mob/living/basic/cat_butcherer/proc/after_attack(mob/living/basic/attacker, atom/target)
SIGNAL_HANDLER
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/basic/trooper/trooper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
/mob/living/basic/trooper/get_blood_type()
if(!fake_blood_type)
fake_blood_type = random_human_blood_type()
return GLOB.blood_types[fake_blood_type]
return find_blood_type(fake_blood_type)
22 changes: 10 additions & 12 deletions code/modules/mob/living/blood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -266,41 +266,39 @@
RETURN_TYPE(/datum/blood_type)
if(HAS_TRAIT(src, TRAIT_NOBLOOD))
return null
return GLOB.blood_types[/datum/blood_type/animal]
return find_blood_type(/datum/blood_type/animal)

/mob/living/basic/get_blood_type()
// All basic mobs are noblood but we should still pretend
return GLOB.blood_types[/datum/blood_type/animal]
return find_blood_type(/datum/blood_type/animal)

/mob/living/simple_animal/get_blood_type()
// Same here
return GLOB.blood_types[/datum/blood_type/animal]
return find_blood_type(/datum/blood_type/animal)

/mob/living/silicon/get_blood_type()
return GLOB.blood_types[/datum/blood_type/oil]
return find_blood_type(/datum/blood_type/oil)

/mob/living/simple_animal/bot/get_blood_type()
return GLOB.blood_types[/datum/blood_type/oil]
return find_blood_type(/datum/blood_type/oil)

/mob/living/basic/bot/get_blood_type()
return GLOB.blood_types[/datum/blood_type/oil]
return find_blood_type(/datum/blood_type/oil)

/mob/living/basic/drone/get_blood_type()
return GLOB.blood_types[/datum/blood_type/oil]
return find_blood_type(/datum/blood_type/oil)

/mob/living/carbon/alien/get_blood_type()
if(HAS_TRAIT(src, TRAIT_HUSK) || HAS_TRAIT(src, TRAIT_NOBLOOD))
return null
return GLOB.blood_types[/datum/blood_type/xenomorph]
return find_blood_type(/datum/blood_type/xenomorph)

/mob/living/carbon/human/get_blood_type()
if(HAS_TRAIT(src, TRAIT_HUSK) || isnull(dna) || HAS_TRAIT(src, TRAIT_NOBLOOD))
return null
if(check_holidays(APRIL_FOOLS) && is_clown_job(mind?.assigned_role))
return GLOB.blood_types[/datum/blood_type/clown]
if(dna.species.exotic_bloodtype)
return GLOB.blood_types[dna.species.exotic_bloodtype]
return GLOB.blood_types[dna.human_blood_type]
return find_blood_type(/datum/blood_type/clown)
return find_blood_type(dna.species.exotic_bloodtype || dna.human_blood_type)

//to add a splatter of blood or other mob liquid.
/mob/living/proc/add_splatter_floor(turf/blood_turf = get_turf(src), small_drip)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
var/list/all_dna = GET_ATOM_BLOOD_DNA(src)
var/list/all_blood_names = list()
for(var/dna_sample in all_dna)
var/datum/blood_type/blood = GLOB.blood_types[all_dna[dna_sample]]
var/datum/blood_type/blood = find_blood_type(all_dna[dna_sample])
all_blood_names |= lowertext(initial(blood.reagent_type.name))

clothes[CLOTHING_SLOT(GLOVES)] = span_warning("[t_He] [t_has] [num_hands > 1 ? "" : "a "][english_list(all_blood_names, nothing_text = "blood")] stained hand[num_hands > 1 ? "s" : ""]!")
Expand Down
Loading