diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm index 4e01642c1a9..79727b9e8e3 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm @@ -322,3 +322,6 @@ /// From /obj/item/book/bible/attack() : (mob/living/user, obj/item/book/bible/bible, bless_result) #define COMSIG_LIVING_BLESSED "living_blessed" + +/// From /mob/living/set_blood_type : (mob/living/user, datum/blood_type, update_cached_blood_dna_info) +#define COMSIG_LIVING_CHANGED_BLOOD_TYPE "living_set_blood_type" diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 268a0cde078..49b17b6297a 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -151,7 +151,6 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) new_dna.default_mutation_genes = default_mutation_genes new_dna.unique_identity = unique_identity new_dna.unique_features = unique_features - new_dna.blood_type = blood_type new_dna.features = features.Copy() //SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION new_dna.mutant_bodyparts = mutant_bodyparts.Copy() @@ -160,8 +159,10 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) //SKYRAT EDIT ADDITION END //if the new DNA has a holder, transform them immediately, otherwise save it if(new_dna.holder) + new_dna.holder.set_blood_type(blood_type) new_dna.holder.set_species(species.type, icon_update = 0) else + new_dna.blood_type = blood_type new_dna.species = new species.type new_dna.real_name = real_name // Mutations aren't gc managed, but they still aren't templates diff --git a/code/datums/quirks/negative_quirks/blood_deficiency.dm b/code/datums/quirks/negative_quirks/blood_deficiency.dm index d8a33ec3f36..c65208ca9dd 100644 --- a/code/datums/quirks/negative_quirks/blood_deficiency.dm +++ b/code/datums/quirks/negative_quirks/blood_deficiency.dm @@ -17,11 +17,11 @@ var/mob/living/carbon/human/human_holder = quirk_holder if(!istype(human_holder)) return - update_mail(new_species = human_holder.dna.species) - RegisterSignal(quirk_holder, COMSIG_SPECIES_GAIN, PROC_REF(update_mail)) + update_mail(human_quirk_holder = human_holder, new_blood_type = human_holder.dna.blood_type) // matches the mail goodies blood bag to our blood type + RegisterSignal(quirk_holder, COMSIG_LIVING_CHANGED_BLOOD_TYPE, PROC_REF(update_mail)) /datum/quirk/blooddeficiency/remove() - UnregisterSignal(quirk_holder, list(COMSIG_HUMAN_ON_HANDLE_BLOOD, COMSIG_SPECIES_GAIN)) + UnregisterSignal(quirk_holder, list(COMSIG_HUMAN_ON_HANDLE_BLOOD, COMSIG_LIVING_CHANGED_BLOOD_TYPE)) /datum/quirk/blooddeficiency/is_species_appropriate(datum/species/mob_species) var/datum/species_traits = GLOB.species_prototypes[mob_species].inherent_traits @@ -43,20 +43,19 @@ human_holder.blood_volume = max(min_blood, human_holder.blood_volume - human_holder.dna.species.blood_deficiency_drain_rate * seconds_per_tick) -/datum/quirk/blooddeficiency/proc/update_mail(datum/source, datum/species/new_species, datum/species/old_species, pref_load, regenerate_icons) +/// Try to update the mail goodies to match the quirk holder's blood type. If we fail for whatever reason then it will just default to the initial O- blood pack that we start with. +/datum/quirk/blooddeficiency/proc/update_mail(mob/living/carbon/human/human_quirk_holder, datum/blood_type/new_blood_type, update_cached_blood_dna_info) SIGNAL_HANDLER - if(isnull(new_species.exotic_blood) && isnull(new_species.exotic_bloodtype)) - if(TRAIT_NOBLOOD in new_species.inherent_traits) // jellypeople have both exotic_blood and TRAIT_NOBLOOD + if(isnull(human_quirk_holder.dna.species.exotic_blood) && isnull(human_quirk_holder.dna.species.exotic_bloodtype)) + if(TRAIT_NOBLOOD in human_quirk_holder.dna.species.inherent_traits) // jellypeople have both exotic_blood and TRAIT_NOBLOOD mail_goodies.Cut() return - var/mob/living/carbon/human/human_holder = quirk_holder - var/datum/blood_type/blood_type = human_holder.dna.blood_type - if(isnull(blood_type)) + if(isnull(new_blood_type)) return for(var/obj/item/reagent_containers/blood/blood_bag as anything in typesof(/obj/item/reagent_containers/blood)) - if(blood_bag::blood_type == blood_type.name) + if(blood_bag::blood_type == new_blood_type.name) mail_goodies = list(blood_bag) return diff --git a/code/datums/quirks/neutral_quirks/evil.dm b/code/datums/quirks/neutral_quirks/evil.dm index fc63937222f..75b87950a84 100644 --- a/code/datums/quirks/neutral_quirks/evil.dm +++ b/code/datums/quirks/neutral_quirks/evil.dm @@ -15,31 +15,28 @@ var/evil_policy = get_policy("[type]") || "Please note that while you may be [LOWER_TEXT(name)], this does NOT give you any additional right to attack people or cause chaos." // We shouldn't need this, but it prevents people using it as a dumb excuse in ahelps. to_chat(quirk_holder, span_big(span_info(evil_policy))) - RegisterSignal(quirk_holder, COMSIG_SPECIES_GAIN, PROC_REF(make_blood_evil)) + RegisterSignal(quirk_holder, COMSIG_LIVING_CHANGED_BLOOD_TYPE, PROC_REF(make_blood_evil)) /datum/quirk/evil/add(client/client_source) var/mob/living/carbon/human/human_holder = quirk_holder if(!istype(human_holder)) return - make_blood_evil(new_species = human_holder.dna.species) + make_blood_evil(human_quirk_holder = human_holder, new_blood_type = human_holder.dna.blood_type) /datum/quirk/evil/remove() - UnregisterSignal(quirk_holder, list(COMSIG_SPECIES_GAIN)) + UnregisterSignal(quirk_holder, list(COMSIG_LIVING_CHANGED_BLOOD_TYPE)) -/// Get a dynamically generated blood type based off the mob's old blood type and make it 'evil'. Needs to happen whenever the species changes. -/datum/quirk/evil/proc/make_blood_evil(datum/source, datum/species/new_species, datum/species/old_species, pref_load, regenerate_icons) +/// Get a dynamically generated blood type based off the mob's old blood type and make it 'evil'. Needs to happen whenever the blood type changes. +/datum/quirk/evil/proc/make_blood_evil(mob/living/carbon/human/human_quirk_holder, datum/blood_type/new_blood_type, update_cached_blood_dna_info) SIGNAL_HANDLER - var/mob/living/carbon/human/human_holder = quirk_holder - if(!istype(human_holder)) - return - // Try to find a corresponding evil blood type for this - var/datum/blood_type/new_blood_type = get_blood_type("[human_holder.dna.blood_type.id]_but_evil") - if(isnull(new_blood_type)) // this blood type doesn't exist yet in the global list, so make a new one - new_blood_type = new /datum/blood_type/evil(human_holder.dna.blood_type, human_holder.dna.blood_type.compatible_types) - GLOB.blood_types[new_blood_type.id] = new_blood_type - human_holder.set_blood_type(new_blood_type) + var/datum/blood_type/evil_blood_type + evil_blood_type = get_blood_type("[new_blood_type.id]_but_evil") + if(isnull(evil_blood_type)) // this blood type doesn't exist yet in the global list, so make a new one + evil_blood_type = new /datum/blood_type/evil(new_blood_type, new_blood_type.compatible_types) + GLOB.blood_types[evil_blood_type.id] = evil_blood_type + human_quirk_holder.set_blood_type(evil_blood_type) - if(new_species.exotic_bloodtype) - new_species.exotic_bloodtype = new_blood_type + if(human_quirk_holder.dna.species.exotic_bloodtype) + human_quirk_holder.dna.species.exotic_bloodtype = evil_blood_type diff --git a/code/game/objects/effects/temporary_visuals/miscellaneous.dm b/code/game/objects/effects/temporary_visuals/miscellaneous.dm index 9b9bb2b85ff..421ac86a71f 100644 --- a/code/game/objects/effects/temporary_visuals/miscellaneous.dm +++ b/code/game/objects/effects/temporary_visuals/miscellaneous.dm @@ -49,9 +49,9 @@ animate(src, pixel_x = target_pixel_x, pixel_y = target_pixel_y, alpha = 0, time = duration) /obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter - splatter_type = "xsplatter" + splatter_type = "splatter" -/obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter/Initialize(mapload, set_dir, set_color = GLOB.blood_types[/datum/blood_type/xeno::name]) +/obj/effect/temp_visual/dir_setting/bloodsplatter/xenosplatter/Initialize(mapload, set_dir, set_color = get_blood_type(/datum/blood_type/xeno::name)) return ..() /obj/effect/temp_visual/dir_setting/speedbike_trail diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index c0234006bb1..aca44e180dc 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -93,9 +93,9 @@ /mob/living/carbon/alien/getTrail() if(getBruteLoss() < 200) - return pick (list("xltrails_1", "xltrails2")) + return pick (list("ltrails_1", "ltrails2")) else - return pick (list("xttrails_1", "xttrails2")) + return pick (list("trails_1", "trails2")) /mob/living/carbon/alien/get_trail_blood() return BLOOD_STATE_XENO diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 7ea50789ab6..9effd09059f 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1508,6 +1508,8 @@ if(update_cached_blood_dna_info) update_cached_blood_dna_info() + return ..() + /mob/living/carbon/dropItemToGround(obj/item/item, force = FALSE, silent = FALSE, invdrop = TRUE) if(item && ((item in organs) || (item in bodyparts))) //let's not do this, aight? return FALSE diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 40def8e0915..2d6995573e0 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -3131,4 +3131,5 @@ GLOBAL_LIST_EMPTY(fire_appearances) /// Setter for changing a mob's blood type /mob/living/proc/set_blood_type(datum/blood_type/new_blood_type, update_cached_blood_dna_info) - return + SHOULD_CALL_PARENT(TRUE) + SEND_SIGNAL(src, COMSIG_LIVING_CHANGED_BLOOD_TYPE, new_blood_type, update_cached_blood_dna_info) diff --git a/code/modules/surgery/organs/organ_movement.dm b/code/modules/surgery/organs/organ_movement.dm index 2f5127e3131..30039888445 100644 --- a/code/modules/surgery/organs/organ_movement.dm +++ b/code/modules/surgery/organs/organ_movement.dm @@ -233,7 +233,7 @@ return TRUE -// Called on limb removal to remove limb specific limb effects or statuses +/// Called on limb removal to remove limb specific limb effects or statuses /obj/item/organ/proc/on_bodypart_remove(obj/item/bodypart/limb, movement_flags) SHOULD_CALL_PARENT(TRUE) diff --git a/icons/effects/blood.dmi b/icons/effects/blood.dmi index 420737cf34c..b71df50e638 100644 Binary files a/icons/effects/blood.dmi and b/icons/effects/blood.dmi differ