[MIRROR] Blood Reagents Refactor (#6980)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
CHOMPStation2
2023-09-18 08:41:12 -07:00
committed by GitHub
parent a4287d1c23
commit a69fe76a7b
12 changed files with 403 additions and 384 deletions

View File

@@ -370,6 +370,7 @@ var/global/list/PDA_Manifest = list()
var/datum/data/record/M = CreateMedicalRecord(H.real_name, id, hidden)
M.fields["species"] = "[H.custom_species ? "[H.custom_species] ([H.species.name])" : H.species.name]" //VOREStation Edit
M.fields["b_type"] = H.b_type
M.fields["blood_reagent"] = H.species.blood_reagents
M.fields["b_dna"] = H.dna.unique_enzymes
M.fields["id_gender"] = gender2text(H.identifying_gender)
if(H.get_FBP_type())

View File

@@ -41,6 +41,7 @@
// Medical
"id_gender" = "Please select new gender identity:",
"blood_type" = "Please select new blood type:",
"blood_reagent" = "Please select new blood basis:",
"b_dna" = "Please input new DNA:",
"mi_dis" = "Please input new minor disabilities:",
"mi_dis_d" = "Please summarize minor disabilities:",
@@ -159,6 +160,7 @@
medical["fields"] = fields
fields[++fields.len] = MED_FIELD("Gender identity", active2.fields["id_gender"], "id_gender", TRUE)
fields[++fields.len] = MED_FIELD("Blood Type", active2.fields["b_type"], "blood_type", FALSE)
fields[++fields.len] = MED_FIELD("Blood Basis", active2.fields["blood_reagent"], "blood_reagent", FALSE)
fields[++fields.len] = MED_FIELD("DNA", active2.fields["b_dna"], "b_dna", TRUE)
fields[++fields.len] = MED_FIELD("Brain Type", active2.fields["brain_type"], "brain_type", TRUE)
fields[++fields.len] = MED_FIELD("Important Notes", active2.fields["notes"], "notes", TRUE)
@@ -301,6 +303,7 @@
R.fields["id"] = active1.fields["id"]
R.name = "Medical Record #[R.fields["id"]]"
R.fields["b_type"] = "Unknown"
R.fields["blood_reagent"] = "Unknown"
R.fields["b_dna"] = "Unknown"
R.fields["mi_dis"] = "None"
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
@@ -431,6 +434,7 @@
P.info += {"<br>\n<center><b>Medical Data</b></center>
<br>\nGender Identity: [active2.fields["id_gender"]]
<br>\nBlood Type: [active2.fields["b_type"]]
<br>\nBlood Basis: [active2.fields["blood_reagent"]]
<br>\nDNA: [active2.fields["b_dna"]]<br>\n
<br>\nMinor Disabilities: [active2.fields["mi_dis"]]
<br>\nDetails: [active2.fields["mi_dis_d"]]<br>\n

View File

@@ -304,14 +304,15 @@
var/blood_volume = H.vessel.get_reagent_amount("blood")
var/blood_percent = round((blood_volume / H.species.blood_volume)*100)
var/blood_type = H.dna.b_type
var/blood_reagent = H.species.blood_reagents
if(blood_volume <= H.species.blood_volume*H.species.blood_level_danger)
dat += "<span class='danger'><i>Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl. Type: [blood_type]</i></span><br>"
dat += "<span class='danger'><i>Warning: Blood Level CRITICAL: [blood_percent]% [blood_volume]cl. Type: [blood_type]. Basis: [blood_reagent].</i></span><br>"
else if(blood_volume <= H.species.blood_volume*H.species.blood_level_warning)
dat += "<span class='danger'><i>Warning: Blood Level VERY LOW: [blood_percent]% [blood_volume]cl. Type: [blood_type]</i></span><br>"
dat += "<span class='danger'><i>Warning: Blood Level VERY LOW: [blood_percent]% [blood_volume]cl. Type: [blood_type]. Basis: [blood_reagent].</i></span><br>"
else if(blood_volume <= H.species.blood_volume*H.species.blood_level_safe)
dat += "<span class='danger'>Warning: Blood Level LOW: [blood_percent]% [blood_volume]cl. Type: [blood_type]</span><br>"
dat += "<span class='danger'>Warning: Blood Level LOW: [blood_percent]% [blood_volume]cl. Type: [blood_type]. Basis: [blood_reagent].</span><br>"
else
dat += "<span class='notice'>Blood Level Normal: [blood_percent]% [blood_volume]cl. Type: [blood_type]</span><br>"
dat += "<span class='notice'>Blood Level Normal: [blood_percent]% [blood_volume]cl. Type: [blood_type]. Basis: [blood_reagent].</span><br>"
dat += "<span class='notice'>Subject's pulse: <font color='[H.pulse == PULSE_THREADY || H.pulse == PULSE_NONE ? "red" : "blue"]'>[H.get_pulse(GETPULSE_TOOL)] bpm.</font></span><br>" // VORE Edit: Missed a linebreak here.
if(istype(H.species, /datum/species/xenochimera)) // VOREStation Edit Start: Visible feedback for medmains on Xenochimera.
if(H.stat == DEAD && H.revive_ready == REVIVING_READY && !H.hasnutriment())

View File

@@ -5,6 +5,8 @@
#define ORGANICS 1
#define SYNTHETICS 2
var/global/list/valid_bloodreagents = list("iron","copper","phoron","silver","gold","slimejelly") //allowlist-based so people don't make their blood restored by alcohol or something really silly. use reagent IDs!
/datum/preferences
var/custom_species // Custom species name, can't be changed due to it having been used in savefiles already.
var/custom_base // What to base the custom species on
@@ -121,6 +123,7 @@
S["neu_traits"] >> pref.neu_traits
S["neg_traits"] >> pref.neg_traits
S["blood_color"] >> pref.blood_color
S["blood_reagents"] >> pref.blood_reagents
S["traits_cheating"] >> pref.traits_cheating
S["max_traits"] >> pref.max_traits
@@ -141,6 +144,7 @@
S["neu_traits"] << pref.neu_traits
S["neg_traits"] << pref.neg_traits
S["blood_color"] << pref.blood_color
S["blood_reagents"] << pref.blood_reagents
S["traits_cheating"] << pref.traits_cheating
S["max_traits"] << pref.max_traits
@@ -160,6 +164,7 @@
if(!pref.neg_traits) pref.neg_traits = list()
pref.blood_color = sanitize_hexcolor(pref.blood_color, default="#A10808")
pref.blood_reagents = sanitize_text(pref.blood_reagents, initial(pref.blood_reagents))
if(!pref.traits_cheating)
var/datum/species/S = GLOB.all_species[pref.species]
@@ -259,6 +264,7 @@
//Any additional non-trait settings can be applied here
new_S.blood_color = pref.blood_color
new_S.blood_reagents = pref.blood_reagents
//Any additional non-trait settings can be applied here
new_S.blood_color = pref.blood_color
@@ -327,6 +333,8 @@
. += "<b>Blood Color: </b>" //People that want to use a certain species to have that species traits (xenochimera/promethean/spider) should be able to set their own blood color.
. += "<a href='?src=\ref[src];blood_color=1'>Set Color</a>"
. += "<a href='?src=\ref[src];blood_reset=1'>R</a><br>"
. += "<b>Blood Reagent: </b>" //Wanna be copper-based? Go ahead.
. += "<a href='?src=\ref[src];blood_reagents=1'>[pref.blood_reagents]</a><br>"
. += "<br>"
. += "<b>Custom Say: </b>"
@@ -384,6 +392,12 @@
pref.blood_color = "#A10808"
return TOPIC_REFRESH
else if(href_list["blood_reagents"])
var/new_blood_reagents = tgui_input_list(user, "Choose your character's blood restoration reagent:", "Character Preference", valid_bloodreagents)
if(new_blood_reagents && CanUseTopic(user))
pref.blood_reagents = new_blood_reagents
return TOPIC_REFRESH
else if(href_list["clicked_pos_trait"])
var/datum/trait/trait = text2path(href_list["clicked_pos_trait"])
var/choice = tgui_alert(usr, "Remove [initial(trait.name)] and regain [initial(trait.cost)] points?","Remove Trait",list("Remove","Cancel"))

View File

@@ -43,6 +43,7 @@ var/list/preferences_datums = list()
var/bday_announce = FALSE //Public announcement for birthdays
var/spawnpoint = "Arrivals Shuttle" //where this character will spawn (0-2).
var/b_type = "A+" //blood type (not-chooseable)
var/blood_reagents = "iron" //blood restoration reagents
var/backbag = 2 //backpack type
var/pdachoice = 1 //PDA type
var/h_style = "Bald" //Hair type

View File

@@ -511,7 +511,7 @@
if (R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
var/list/medical_hud_text = list()
medical_hud_text += "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]]"
medical_hud_text += "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]] <b>Blood Basis:</b> [R.fields["blood_reagent"]]"
medical_hud_text += "<b>Species:</b> [R.fields["species"]]"
medical_hud_text += "<b>DNA:</b> [R.fields["b_dna"]]"
medical_hud_text += "<b>Minor Disabilities:</b> [R.fields["mi_dis"]]"

View File

@@ -45,6 +45,7 @@
var/virus_immune
var/short_sighted // Permanent weldervision.
var/blood_name = "blood" // Name for the species' blood.
var/blood_reagents = "iron" // Reagent(s) that restore lost blood. goes by reagent IDs.
var/blood_volume = 560 // Initial blood volume.
var/bloodloss_rate = 1 // Multiplier for how fast a species bleeds out. Higher = Faster
var/blood_level_safe = 0.85 //"Safe" blood level; above this, you're OK

View File

@@ -36,6 +36,7 @@ var/datum/species/shapeshifter/promethean/prometheans
assisted_langs = list(LANGUAGE_ROOTGLOBAL, LANGUAGE_VOX) // Prometheans are weird, let's just assume they can use basically any language.
blood_name = "gelatinous ooze"
blood_reagents = "slimejelly"
breath_type = null
poison_type = null

View File

@@ -341,6 +341,7 @@
flash_mod = 1.2
chemOD_mod = 0.9
blood_reagents = "copper"
bloodloss_rate = 1.5
ambiguous_genders = TRUE

View File

@@ -220,6 +220,7 @@
flesh_color = "#AFA59E"
base_color = "#333333"
blood_color = "#240bc4"
blood_reagents = "copper"
reagent_tag = IS_ZORREN
color_mult = 1

View File

@@ -183,6 +183,8 @@
/datum/reagent/proc/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
M.bloodstr.add_reagent(id, removed)
if(src.id == M.species.blood_reagents)
M.add_chemical_effect(CE_BLOODRESTORE, 8 * removed)
return
/datum/reagent/proc/affect_touch(var/mob/living/carbon/M, var/alien, var/removed)

View File

@@ -79,10 +79,6 @@
taste_description = "pennies"
color = "#6E3B08"
/datum/reagent/copper/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_SKRELL || alien == IS_ZORREN)
M.add_chemical_effect(CE_BLOODRESTORE, 8 * removed)
/datum/reagent/ethanol
name = "Ethanol" //Parent class for all alcoholic reagents.
id = "ethanol"
@@ -246,10 +242,6 @@
reagent_state = SOLID
color = "#353535"
/datum/reagent/iron/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA && alien != IS_SKRELL && alien != IS_ZORREN)
M.add_chemical_effect(CE_BLOODRESTORE, 8 * removed)
/datum/reagent/lithium
name = "Lithium"
id = "lithium"