Fixes Blood Types (#12520)

This commit is contained in:
Fox McCloud
2019-10-07 23:15:54 -04:00
committed by variableundefined
parent 36e464cf7e
commit 93fa76bee0
16 changed files with 44 additions and 85 deletions
+2 -2
View File
@@ -294,7 +294,7 @@ var/record_id_num = 1001
var/datum/data/record/M = new()
M.fields["id"] = id
M.fields["name"] = H.real_name
M.fields["b_type"] = H.b_type
M.fields["blood_type"] = H.dna.blood_type
M.fields["b_dna"] = H.dna.unique_enzymes
M.fields["mi_dis"] = "None"
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
@@ -334,7 +334,7 @@ var/record_id_num = 1001
L.fields["rank"] = H.mind.assigned_role
L.fields["age"] = H.age
L.fields["sex"] = capitalize(H.gender)
L.fields["b_type"] = H.b_type
L.fields["blood_type"] = H.dna.blood_type
L.fields["b_dna"] = H.dna.unique_enzymes
L.fields["enzymes"] = H.dna.SE // Used in respawning
L.fields["identity"] = H.dna.UI // "
+1 -2
View File
@@ -491,8 +491,7 @@ var/list/blood_splatter_icons = list()
return
var/list/blood_dna = list()
if(dna)
var/mob/living/carbon/human/H = src
blood_dna[dna.unique_enzymes] = H.b_type
blood_dna[dna.unique_enzymes] = dna.blood_type
else
blood_dna["UNKNOWN DNA"] = "X*"
return blood_dna
+4 -4
View File
@@ -96,7 +96,7 @@ var/global/list/bad_blocks[0]
var/list/UI[DNA_UI_LENGTH]
// From old dna.
var/b_type = "A+" // Should probably change to an integer => string map but I'm lazy.
var/blood_type = "A+" // Should probably change to an integer => string map but I'm lazy.
var/real_name // Stores the real name of the person who originally got this dna datum. Used primarily for changelings,
var/datum/species/species = new /datum/species/human //The type of mutant race the player is if applicable (i.e. potato-man)
@@ -108,7 +108,7 @@ var/global/list/bad_blocks[0]
var/datum/dna/new_dna = new()
new_dna.unique_enzymes=unique_enzymes
new_dna.struc_enzymes_original=struc_enzymes_original // will make clone's SE the same as the original, do we want this?
new_dna.b_type=b_type
new_dna.blood_type = blood_type
new_dna.real_name=real_name
new_dna.species = new species.type
for(var/b=1;b<=DNA_SE_LENGTH;b++)
@@ -423,7 +423,7 @@ var/global/list/bad_blocks[0]
data["UI"] = UI.Copy()
data["species"] = species.type
// Because old DNA coders were insane or something
data["b_type"] = b_type
data["blood_type"] = blood_type
data["real_name"] = real_name
return data
@@ -436,7 +436,7 @@ var/global/list/bad_blocks[0]
UpdateSE()
var/datum/species/S = data["species"]
species = new S
b_type = data["b_type"]
blood_type = data["blood_type"]
real_name = data["real_name"]
/datum/dna/proc/transfer_identity(mob/living/carbon/human/destination)
+1 -1
View File
@@ -315,6 +315,6 @@
qdel(S)
var/obj/effect/rune/R = new rune_to_scribe(runeturf, chosen_keyword)
R.blood_DNA = list()
R.blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
R.blood_DNA[H.dna.unique_enzymes] = H.dna.blood_type
R.add_hiddenprint(H)
to_chat(user, "<span class='cult'>The [lowertext(initial(rune_to_scribe.cultist_name))] rune [initial(rune_to_scribe.cultist_desc)]</span>")
+2 -40
View File
@@ -54,44 +54,6 @@
add_fingerprint(user)
ui_interact(user)
///obj/machinery/computer/operating/interact(mob/user)
// if( ((get_dist(src, user) > 1) && !isobserver(user)) || (stat & (BROKEN|NOPOWER)) )
// if(!istype(user, /mob/living/silicon))
// user.unset_machine()
// user << browse(null, "window=op")
// return
//
// user.set_machine(src)
// var/dat = "<HEAD><TITLE>Operating Computer</TITLE><META HTTP-EQUIV='Refresh' CONTENT='10'></HEAD><BODY>\n"
// dat += "<A HREF='?src=[user.UID()];mach_close=op'>Close</A><br><br>" //| <A HREF='?src=[user.UID()];update=1'>Update</A>"
// if(src.table && (src.table.check_victim()))
// src.victim = src.table.victim
// dat += {"
//<B>Patient Information:</B><BR>
//<BR>
//<B>Name:</B> [src.victim.real_name]<BR>
//<B>Age:</B> [src.victim.age]<BR>
//<B>Blood Type:</B> [src.victim.b_type]<BR>
//<BR>
//<B>Health:</B> [src.victim.health]<BR>
//<B>Brute Damage:</B> [src.victim.getBruteLoss()]<BR>
//<B>Toxins Damage:</B> [src.victim.getToxLoss()]<BR>
//<B>Fire Damage:</B> [src.victim.getFireLoss()]<BR>
//<B>Suffocation Damage:</B> [src.victim.getOxyLoss()]<BR>
//<B>Patient Status:</B> [src.victim.stat ? "Non-Responsive" : "Awake"]<BR>
//<B>Heartbeat rate:</B> [victim.get_pulse(GETPULSE_TOOL)]<BR>
//"}
// else
// src.victim = null
// dat += {"
//<B>Patient Information:</B><BR>
//<BR>
//<B>No Patient Detected</B>
//"}
// user << browse(dat, "window=op")
// onclose(user, "op")
/obj/machinery/computer/operating/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)//ui is mostly copy pasta from the sleeper ui
ui = SSnanoui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
@@ -154,7 +116,7 @@
occupantData["bloodMax"] = occupant.max_blood
occupantData["bloodPercent"] = round(100*(occupant.blood_volume/occupant.max_blood), 0.01) //copy pasta ends here
occupantData["bloodType"]=occupant.b_type
occupantData["bloodType"] = occupant.dna.blood_type
if(occupant.surgeries.len)
occupantData["inSurgery"] = 1
for(var/datum/surgery/procedure in occupant.surgeries)
@@ -215,7 +177,7 @@
patientName=table.victim.name
atom_say("New patient detected, loading stats")
victim = table.victim
atom_say("[victim.real_name], [victim.b_type] blood, [victim.stat ? "Non-Responsive" : "Awake"]")
atom_say("[victim.real_name], [victim.dna.blood_type] blood, [victim.stat ? "Non-Responsive" : "Awake"]")
if(nextTick < world.time)
nextTick=world.time + OP_COMPUTER_COOLDOWN
if(crit && victim.health <= -50 )
+22 -22
View File
@@ -93,7 +93,7 @@
if(istype(active2, /datum/data/record) && data_core.medical.Find(active2))
var/list/fields = list()
medical["fields"] = fields
fields[++fields.len] = list("field" = "Blood Type:", "value" = active2.fields["b_type"], "edit" = "b_type", "line_break" = 0)
fields[++fields.len] = list("field" = "Blood Type:", "value" = active2.fields["blood_type"], "edit" = "blood_type", "line_break" = 0)
fields[++fields.len] = list("field" = "DNA:", "value" = active2.fields["b_dna"], "edit" = "b_dna", "line_break" = 1)
fields[++fields.len] = list("field" = "Minor Disabilities:", "value" = active2.fields["mi_dis"], "edit" = "mi_dis", "line_break" = 0)
fields[++fields.len] = list("field" = "Details:", "value" = active2.fields["mi_dis_d"], "edit" = "mi_dis_d", "line_break" = 1)
@@ -184,25 +184,25 @@
active1.fields["m_stat"] = "*Watch*"
if("stable")
active1.fields["m_stat"] = "Stable"
if("b_type")
if("blood_type")
if(active2)
switch(temp_href[2])
if("an")
active2.fields["b_type"] = "A-"
active2.fields["blood_type"] = "A-"
if("bn")
active2.fields["b_type"] = "B-"
active2.fields["blood_type"] = "B-"
if("abn")
active2.fields["b_type"] = "AB-"
active2.fields["blood_type"] = "AB-"
if("on")
active2.fields["b_type"] = "O-"
active2.fields["blood_type"] = "O-"
if("ap")
active2.fields["b_type"] = "A+"
active2.fields["blood_type"] = "A+"
if("bp")
active2.fields["b_type"] = "B+"
active2.fields["blood_type"] = "B+"
if("abp")
active2.fields["b_type"] = "AB+"
active2.fields["blood_type"] = "AB+"
if("op")
active2.fields["b_type"] = "O+"
active2.fields["blood_type"] = "O+"
if("del_r2")
QDEL_NULL(active2)
@@ -378,17 +378,17 @@
buttons[++buttons.len] = list("name" = "*Watch*", "icon" = "stethoscope", "href" = "m_stat=watch", "status" = (active1.fields["m_stat"] == "*Watch*" ? "selected" : null))
buttons[++buttons.len] = list("name" = "Stable", "icon" = "stethoscope", "href" = "m_stat=stable", "status" = (active1.fields["m_stat"] == "Stable" ? "selected" : null))
setTemp("<h3>Mental Condition</h3>", buttons)
if("b_type")
if("blood_type")
if(istype(active2, /datum/data/record))
var/list/buttons = list()
buttons[++buttons.len] = list("name" = "A-", "icon" = "tint", "href" = "b_type=an", "status" = (active2.fields["b_type"] == "A-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "A+", "icon" = "tint", "href" = "b_type=ap", "status" = (active2.fields["b_type"] == "A+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "B-", "icon" = "tint", "href" = "b_type=bn", "status" = (active2.fields["b_type"] == "B-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "B+", "icon" = "tint", "href" = "b_type=bp", "status" = (active2.fields["b_type"] == "B+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "AB-", "icon" = "tint", "href" = "b_type=abn", "status" = (active2.fields["b_type"] == "AB-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "AB+", "icon" = "tint", "href" = "b_type=abp", "status" = (active2.fields["b_type"] == "AB+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "O-", "icon" = "tint", "href" = "b_type=on", "status" = (active2.fields["b_type"] == "O-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "O+", "icon" = "tint", "href" = "b_type=op", "status" = (active2.fields["b_type"] == "O+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "A-", "icon" = "tint", "href" = "blood_type=an", "status" = (active2.fields["blood_type"] == "A-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "A+", "icon" = "tint", "href" = "blood_type=ap", "status" = (active2.fields["blood_type"] == "A+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "B-", "icon" = "tint", "href" = "blood_type=bn", "status" = (active2.fields["blood_type"] == "B-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "B+", "icon" = "tint", "href" = "blood_type=bp", "status" = (active2.fields["blood_type"] == "B+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "AB-", "icon" = "tint", "href" = "blood_type=abn", "status" = (active2.fields["blood_type"] == "AB-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "AB+", "icon" = "tint", "href" = "blood_type=abp", "status" = (active2.fields["blood_type"] == "AB+" ? "selected" : null))
buttons[++buttons.len] = list("name" = "O-", "icon" = "tint", "href" = "blood_type=on", "status" = (active2.fields["blood_type"] == "O-" ? "selected" : null))
buttons[++buttons.len] = list("name" = "O+", "icon" = "tint", "href" = "blood_type=op", "status" = (active2.fields["blood_type"] == "O+" ? "selected" : null))
setTemp("<h3>Blood Type</h3>", buttons)
if("b_dna")
if(istype(active2, /datum/data/record))
@@ -437,7 +437,7 @@
R.fields["name"] = active1.fields["name"]
R.fields["id"] = active1.fields["id"]
R.name = "Medical Record #[R.fields["id"]]"
R.fields["b_type"] = "Unknown"
R.fields["blood_type"] = "Unknown"
R.fields["b_dna"] = "Unknown"
R.fields["mi_dis"] = "None"
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
@@ -502,7 +502,7 @@
P.info += "<B>General Record Lost!</B><BR>"
if(istype(active2, /datum/data/record) && data_core.medical.Find(active2))
P.info += {"<BR>\n<CENTER><B>Medical Data</B></CENTER>
<BR>\nBlood Type: [active2.fields["b_type"]]
<BR>\nBlood Type: [active2.fields["blood_type"]]
<BR>\nDNA: [active2.fields["b_dna"]]<BR>\n
<BR>\nMinor Disabilities: [active2.fields["mi_dis"]]
<BR>\nDetails: [active2.fields["mi_dis_d"]]<BR>\n
@@ -542,7 +542,7 @@
if(3)
R.fields["age"] = rand(5, 85)
if(4)
R.fields["b_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+")
R.fields["blood_type"] = pick("A-", "B-", "AB-", "O-", "A+", "B+", "AB+", "O+")
if(5)
R.fields["p_stat"] = pick("*SSD*", "Active", "Physically Unfit", "Disabled")
if(6)
+1 -1
View File
@@ -41,7 +41,7 @@
gib.blood_DNA = list()
if(MobDNA)
gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.b_type
gib.blood_DNA[MobDNA.unique_enzymes] = MobDNA.blood_type
else if(istype(src, /obj/effect/gibspawner/xeno))
gib.blood_DNA["UNKNOWN DNA"] = "X*"
else if(istype(src, /obj/effect/gibspawner/human)) // Probably a monkey
+1 -1
View File
@@ -245,7 +245,7 @@ REAGENT SCANNER
if(H.bleed_rate)
to_chat(user, "<span class='danger'>Subject is bleeding!</span>")
var/blood_percent = round((H.blood_volume / BLOOD_VOLUME_NORMAL)*100)
var/blood_type = H.b_type
var/blood_type = H.dna.blood_type
if(blood_id != "blood")//special blood substance
var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id]
if(R)
+2 -2
View File
@@ -162,7 +162,7 @@
sex = capitalize(H.gender)
age = H.age
blood_type = H.dna.b_type
blood_type = H.dna.blood_type
dna_hash = H.dna.unique_enzymes
fingerprint_hash = md5(H.dna.uni_identity)
@@ -526,7 +526,7 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.dna)
default = H.dna.b_type
default = H.dna.blood_type
var/new_blood_type = sanitize(input(user,"What blood type would you like to be written on this card?","Agent Card Blood Type",default) as text)
if(!Adjacent(user))
+1 -1
View File
@@ -2990,7 +2990,7 @@
dat += "<table cellspacing=5><tr><th>Name</th><th>DNA</th><th>Blood Type</th></tr>"
for(var/mob/living/carbon/human/H in GLOB.mob_list)
if(H.dna && H.ckey)
dat += "<tr><td>[H]</td><td>[H.dna.unique_enzymes]</td><td>[H.b_type]</td></tr>"
dat += "<tr><td>[H]</td><td>[H.dna.unique_enzymes]</td><td>[H.dna.blood_type]</td></tr>"
dat += "</table>"
usr << browse(dat, "window=DNA;size=440x410")
if("fingerprints")
+1 -1
View File
@@ -397,7 +397,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
new_character.real_name = record_found.fields["name"]
new_character.change_gender(record_found.fields["sex"])
new_character.age = record_found.fields["age"]
new_character.b_type = record_found.fields["b_type"]
new_character.dna.blood_type = record_found.fields["blood_type"]
else
new_character.change_gender(pick(MALE,FEMALE))
var/datum/preferences/A = new()
@@ -2145,7 +2145,6 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
character.change_gender(gender)
character.age = age
character.b_type = b_type
//Head-specific
var/obj/item/organ/external/head/H = character.get_organ("head")
@@ -2188,7 +2187,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(status == "cybernetic")
I.robotize()
character.dna.b_type = b_type
character.dna.blood_type = b_type
// Wheelchair necessary?
var/obj/item/organ/external/l_foot = character.get_organ("l_foot")
@@ -16,7 +16,6 @@ var/global/default_martial_art = new/datum/martial_art
var/lip_color = "white"
var/age = 30 //Player's age (pure fluff)
var/b_type = "A+" //Player's bloodtype
var/underwear = "Nude" //Which underwear the player wants
var/undershirt = "Nude" //Which undershirt the player wants
@@ -147,7 +147,7 @@
if(method == INGEST && iscarbon(M))
var/mob/living/carbon/C = M
if(C.get_blood_id() == "blood")
if((!data || !(data["blood_type"] in get_safe_blood(C.dna.b_type))))
if((!data || !(data["blood_type"] in get_safe_blood(C.dna.blood_type))))
C.reagents.add_reagent("toxin", volume * 0.5)
else
C.blood_volume = min(C.blood_volume + round(volume, 0.1), BLOOD_VOLUME_NORMAL)
+2 -2
View File
@@ -155,7 +155,7 @@
if((D.spread_flags & SPECIAL) || (D.spread_flags & NON_CONTAGIOUS))
continue
C.ForceContractDisease(D)
if(!(blood_data["blood_type"] in get_safe_blood(C.dna.b_type)))
if(!(blood_data["blood_type"] in get_safe_blood(C.dna.blood_type)))
C.reagents.add_reagent("toxin", amount * 0.5)
return 1
@@ -193,7 +193,7 @@
blood_data["ckey"] = ckey
if(!suiciding)
blood_data["cloneable"] = 1
blood_data["blood_type"] = copytext(src.dna.b_type,1,0)
blood_data["blood_type"] = copytext(src.dna.blood_type,1,0)
blood_data["gender"] = gender
blood_data["real_name"] = real_name
blood_data["blood_color"] = dna.species.blood_color
+2 -2
View File
@@ -57,7 +57,7 @@
if(dna)
if(!blood_DNA)
blood_DNA = list()
blood_DNA[dna.unique_enzymes] = dna.b_type
blood_DNA[dna.unique_enzymes] = dna.blood_type
else
dna = new /datum/dna(null)
if(species_override)
@@ -79,7 +79,7 @@
blood_DNA.Cut()
else
blood_DNA = list()
blood_DNA[dna.unique_enzymes] = dna.b_type
blood_DNA[dna.unique_enzymes] = dna.blood_type
/obj/item/organ/proc/necrotize(update_sprite = TRUE)
damage = max_damage