-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3695 from MistakeNot4892/tweak/blood
Condensing blood code.
- Loading branch information
Showing
38 changed files
with
287 additions
and
325 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
code/game/objects/effects/gibs.dm → code/game/objects/effects/gibspawner.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/proc/blood_splatter(atom/target, atom/source, var/large = FALSE, var/spray_dir) | ||
|
||
var/obj/effect/decal/cleanable/blood/splatter | ||
var/decal_type = /obj/effect/decal/cleanable/blood/splatter | ||
var/turf/bleed_turf = get_turf(target) | ||
|
||
// Are we dripping or splattering? | ||
var/list/drips | ||
// Only a certain number of drips (or one large splatter) can be on a given turf. | ||
for(var/obj/effect/decal/cleanable/blood/drip/drop in bleed_turf) | ||
LAZYDISTINCTADD(drips, drop.drips) | ||
qdel(drop) | ||
if(!large && LAZYLEN(drips) < 3) | ||
decal_type = /obj/effect/decal/cleanable/blood/drip | ||
|
||
// Find a blood decal or create a new one. | ||
if(bleed_turf) | ||
var/list/existing = filter_list(bleed_turf.contents, decal_type) | ||
if(length(existing) > 3) | ||
splatter = pick(existing) | ||
if(!splatter) | ||
splatter = new decal_type(bleed_turf) | ||
|
||
if(QDELETED(splatter)) | ||
return | ||
|
||
var/obj/effect/decal/cleanable/blood/drip/drop = splatter | ||
if(istype(drop) && LAZYLEN(drips) && !large) | ||
drop.drips |= drips | ||
drop.update_icon() | ||
|
||
// If there's no data to copy, call it quits here. | ||
var/blood_data | ||
var/blood_type | ||
if(isliving(source)) | ||
var/mob/living/donor = source | ||
blood_data = donor.get_blood_data() | ||
blood_type = donor.get_blood_type() | ||
else if(isatom(source)) | ||
var/atom/donor = source | ||
blood_data = REAGENT_DATA(donor.reagents, /decl/material/liquid/blood) | ||
if(!islist(blood_data)) | ||
return splatter | ||
|
||
if(spray_dir) | ||
splatter.icon_state = "squirt" | ||
splatter.set_dir(spray_dir) | ||
|
||
// Update blood information. | ||
if(LAZYACCESS(blood_data, "blood_DNA")) | ||
LAZYSET(splatter.blood_data, blood_data["blood_DNA"], blood_data) | ||
splatter.blood_DNA = list() | ||
if(LAZYACCESS(blood_data, "blood_type")) | ||
splatter.blood_DNA[blood_data["blood_DNA"]] = blood_data["blood_type"] | ||
else | ||
splatter.blood_DNA[blood_data["blood_DNA"]] = "O+" | ||
var/datum/extension/forensic_evidence/forensics = get_or_create_extension(splatter, /datum/extension/forensic_evidence) | ||
forensics.add_data(/datum/forensics/blood_dna, blood_data["blood_DNA"]) | ||
|
||
if(!blood_type && LAZYACCESS(blood_data, "blood_type")) | ||
blood_type = LAZYACCESS(blood_data, "blood_type") | ||
|
||
// Update appearance. | ||
if(blood_type) | ||
var/decl/blood_type/blood_type_decl = get_blood_type_by_name(blood_type) | ||
splatter.name = blood_type_decl.splatter_name | ||
splatter.desc = blood_type_decl.splatter_desc | ||
splatter.basecolor = blood_type_decl.splatter_colour | ||
|
||
if(LAZYACCESS(blood_data, "blood_color")) | ||
splatter.basecolor = blood_data["blood_color"] | ||
|
||
splatter.update_icon() | ||
splatter.fluorescent = FALSE | ||
splatter.set_invisibility(INVISIBILITY_NONE) | ||
return splatter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/decl/blood_type/ominus | ||
name = "O-" | ||
random_weighting = 4 | ||
|
||
/decl/blood_type/oplus | ||
name = "O+" | ||
antigens = list("Rh") | ||
random_weighting = 36 | ||
|
||
/decl/blood_type/aminus | ||
name = "A-" | ||
antigens = list("A") | ||
random_weighting = 3 | ||
|
||
/decl/blood_type/aplus | ||
name = "A+" | ||
antigens = list("A", "Rh") | ||
random_weighting = 28 | ||
|
||
/decl/blood_type/bminus | ||
name = "B-" | ||
antigens = list("B") | ||
|
||
/decl/blood_type/bplus | ||
name = "B+" | ||
antigens = list("B", "Rh") | ||
random_weighting = 20 | ||
|
||
/decl/blood_type/abminus | ||
name = "AB-" | ||
antigens = list("A", "B") | ||
|
||
/decl/blood_type/abplus | ||
name = "AB+" | ||
antigens = list("A", "B", "Rh") | ||
random_weighting = 5 | ||
|
||
// Insect blood. | ||
/decl/blood_type/hemolymph | ||
|
||
name = "hemolymph" | ||
antigen_category = "insect" | ||
|
||
splatter_name = "ichor" | ||
splatter_desc = "A smear of insect ichor. It smells acrid." | ||
splatter_colour = "#525252" | ||
|
||
// Robo-blood. | ||
/decl/blood_type/coolant | ||
|
||
name = "coolant" | ||
antigen_category = "machine" | ||
|
||
splatter_name = "coolant" | ||
splatter_desc = "A smear of machine coolant. It looks discoloured." | ||
splatter_colour = SYNTH_BLOOD_COLOR | ||
|
||
transfusion_fail_reagent = /decl/material/liquid/acid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.