[MIRROR] Converts gas, ore, plants and reagent strings to defines (#9611)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2024-12-11 18:11:06 -07:00
committed by GitHub
parent d5b62d4159
commit fd5d9267ff
622 changed files with 11273 additions and 9558 deletions

View File

@@ -35,17 +35,17 @@ var/const/CE_STABLE_THRESHOLD = 0.5
return
if(!amt)
vessel.add_reagent("blood",species.blood_volume)
vessel.add_reagent(REAGENT_ID_BLOOD,species.blood_volume)
else
vessel.add_reagent("blood", clamp(amt, 1, species.blood_volume))
vessel.add_reagent(REAGENT_ID_BLOOD, clamp(amt, 1, species.blood_volume))
//Resets blood data
/mob/living/carbon/human/proc/fixblood()
for(var/datum/reagent/blood/B in vessel.reagent_list)
if(B.id == "blood")
if(B.id == REAGENT_ID_BLOOD)
B.data = list( "donor"=src,"viruses"=null,"species"=species.name,"blood_DNA"=dna.unique_enzymes,"blood_colour"= species.get_blood_colour(src),"blood_type"=dna.b_type, \
"resistances"=null,"trace_chem"=null, "virus2" = null, "antibodies" = list(), "blood_name" = species.get_blood_name(src))
"resistances"=null,"trace_chem"=null, "virus2" = null, REAGENT_ID_ANTIBODIES = list(), "blood_name" = species.get_blood_name(src))
if(isSynthetic())
B.data["species"] = "synthetic"
@@ -63,7 +63,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5
if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
var/blood_volume_raw = vessel.get_reagent_amount("blood")
var/blood_volume_raw = vessel.get_reagent_amount(REAGENT_ID_BLOOD)
var/blood_volume = round((blood_volume_raw/species.blood_volume)*100) // Percentage.
//Blood regeneration if there is some space
@@ -229,14 +229,14 @@ var/const/CE_STABLE_THRESHOLD = 0.5
return 0
//CHOMPAdd End
var/current_blood = vessel.get_reagent_amount("blood")
var/current_blood = vessel.get_reagent_amount(REAGENT_ID_BLOOD)
if(current_blood < BLOOD_MINIMUM_STOP_PROCESS)
return 0 //We stop processing under 3 units of blood because apparently weird shit can make it overflowrandomly.
if(amt > current_blood)
amt = current_blood - 2 // Bit of a safety net; it's impossible to add blood if there's not blood already in the vessel.
return vessel.remove_reagent("blood",amt)
return vessel.remove_reagent(REAGENT_ID_BLOOD,amt)
/****************************************************
BLOOD TRANSFERS
@@ -288,7 +288,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5
if(!should_have_organ(O_HEART))
return null
if(vessel.get_reagent_amount("blood") < max(amount, BLOOD_MINIMUM_STOP_PROCESS))
if(vessel.get_reagent_amount(REAGENT_ID_BLOOD) < max(amount, BLOOD_MINIMUM_STOP_PROCESS))
return null
. = ..()
@@ -306,8 +306,8 @@ var/const/CE_STABLE_THRESHOLD = 0.5
ContractDisease(D)
if (injected.data["resistances"] && prob(5))
antibodies |= injected.data["resistances"]
if (injected.data["antibodies"] && prob(5))
antibodies |= injected.data["antibodies"]
if (injected.data[REAGENT_ID_ANTIBODIES] && prob(5))
antibodies |= injected.data[REAGENT_ID_ANTIBODIES]
var/list/chems = list()
chems = params2list(injected.data["trace_chem"])
for(var/C in chems)
@@ -318,7 +318,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5
/mob/living/carbon/human/inject_blood(var/datum/reagent/blood/injected, var/amount)
if(!should_have_organ(O_HEART))
reagents.add_reagent("blood", amount, injected.data)
reagents.add_reagent(REAGENT_ID_BLOOD, amount, injected.data)
reagents.update_total()
return
@@ -336,7 +336,7 @@ var/const/CE_STABLE_THRESHOLD = 0.5
log_debug("Failed to re-initialize blood datums on [src]!")
return
if(vessel.total_volume < species.blood_volume)
vessel.add_reagent("blood", species.blood_volume - vessel.total_volume)
vessel.add_reagent(REAGENT_ID_BLOOD, species.blood_volume - vessel.total_volume)
else if(vessel.total_volume > species.blood_volume)
vessel.maximum_volume = species.blood_volume
fixblood()
@@ -347,10 +347,10 @@ var/const/CE_STABLE_THRESHOLD = 0.5
if(blood_incompatible(injected.data["blood_type"],our.data["blood_type"],injected.data["species"],our.data["species"]) )
reagents.add_reagent("toxin",amount * 0.5)
reagents.add_reagent(REAGENT_ID_TOXIN,amount * 0.5)
reagents.update_total()
else
vessel.add_reagent("blood", amount, injected.data)
vessel.add_reagent(REAGENT_ID_BLOOD, amount, injected.data)
vessel.update_total()
..()

View File

@@ -294,7 +294,7 @@ GLOBAL_LIST_BOILERPLATE(all_brain_organs, /obj/item/organ/internal/brain)
name = "Promethean Revival"
id = "prom_revival"
result = null
required_reagents = list("phoron" = 40)
required_reagents = list(REAGENT_ID_PHORON = 40)
result_amount = 1
/decl/chemical_reaction/instant/promethean_brain_revival/can_happen(var/datum/reagents/holder)

View File

@@ -11,7 +11,7 @@
if(owner.life_tick % PROCESS_ACCURACY == 0)
//High toxins levels are dangerous
if(owner.getToxLoss() >= 50 && !owner.reagents.has_reagent("anti_toxin"))
if(owner.getToxLoss() >= 50 && !owner.reagents.has_reagent(REAGENT_ID_ANTITOXIN))
//Healthy liver suffers on its own
if (src.damage < min_broken_damage)
src.damage += 0.2 * PROCESS_ACCURACY
@@ -22,7 +22,7 @@
O.damage += 0.2 * PROCESS_ACCURACY
//Detox can heal small amounts of damage
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent("anti_toxin"))
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent(REAGENT_ID_ANTITOXIN))
src.damage -= 0.2 * PROCESS_ACCURACY
if(src.damage < 0)

View File

@@ -15,7 +15,7 @@
if(owner.life_tick % spleen_tick == 0)
//High toxins levels are dangerous
if(owner.getToxLoss() >= 30 && !owner.reagents.has_reagent("anti_toxin"))
if(owner.getToxLoss() >= 30 && !owner.reagents.has_reagent(REAGENT_ID_ANTITOXIN))
//Healthy liver suffers on its own
if (src.damage < min_broken_damage)
src.damage += 0.2 * spleen_tick
@@ -34,7 +34,7 @@
B.adjust_germ_level(round(rand(-3 * spleen_efficiency, -10 * spleen_efficiency)))
//Detox can heal small amounts of damage
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent("anti_toxin"))
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent(REAGENT_ID_ANTITOXIN))
src.damage -= 0.2 * spleen_tick * spleen_efficiency
if(src.damage < 0)

View File

@@ -6,7 +6,7 @@
unacidable = TRUE // Don't melt when holding your acid, dangit.
var/acidtype = "stomacid" // Incase you want some stomach organ with, say, polyacid instead, or sulphuric.
var/acidtype = REAGENT_ID_STOMACID // Incase you want some stomach organ with, say, polyacid instead, or sulphuric.
var/max_acid_volume = 30
var/deadly_hold = TRUE // Does the stomach do damage to mobs eaten by its owner? Xenos should probably have this FALSE.
@@ -47,7 +47,7 @@
/obj/item/organ/internal/stomach/xeno
color = "#555555"
acidtype = "pacid"
acidtype = REAGENT_ID_PACID
/obj/item/organ/internal/stomach/machine
name = "reagent cycler"
@@ -56,7 +56,7 @@
robotic = ORGAN_ROBOT
acidtype = "sacid"
acidtype = REAGENT_ID_SACID
organ_verbs = list(/mob/living/carbon/human/proc/reagent_purge, /mob/living/carbon/human/proc/synth_reag_toggle) //VOREStation Add + CHOMPAdd

View File

@@ -11,7 +11,7 @@
/obj/item/organ/internal/borer/process()
// Borer husks regenerate health, feel no pain, and are resistant to stuns and brainloss.
for(var/chem in list("tricordrazine","tramadol","hyperzine","alkysine"))
for(var/chem in list(REAGENT_ID_TRICORDRAZINE,REAGENT_ID_TRAMADOL,REAGENT_ID_HYPERZINE,REAGENT_ID_ALKYSINE))
if(owner.reagents.get_reagent_amount(chem) < 3)
owner.reagents.add_reagent(chem, 5)
@@ -59,4 +59,4 @@
/obj/item/organ/internal/stack/vox/stack
name = "vox cortical stack"
icon_state = "cortical_stack"
icon_state = "cortical_stack"

View File

@@ -177,7 +177,7 @@ var/list/organ_cache = list()
if(!owner && reagents)
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list
if(B && prob(40) && !isbelly(loc)) //VOREStation Edit
reagents.remove_reagent("blood",0.1)
reagents.remove_reagent(REAGENT_ID_BLOOD,0.1)
blood_splatter(src,B,1)
if(CONFIG_GET(flag/organs_decay) && decays) damage += rand(1,3)
if(damage >= max_damage)
@@ -275,7 +275,7 @@ var/list/organ_cache = list()
adjust_germ_level(rand(2,3))
if(501 to INFINITY)
adjust_germ_level(rand(3,5))
owner.reagents.add_reagent("toxin", rand(1,2))
owner.reagents.add_reagent(REAGENT_ID_TOXIN, rand(1,2))
/obj/item/organ/proc/receive_chem(chemical as obj)
return 0

View File

@@ -752,9 +752,9 @@ Note that amputating the affected organ does in fact remove the infection from t
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
if(W.internal && owner.bodytemperature >= 170)
var/bicardose = owner.reagents.get_reagent_amount("bicaridine")
var/inaprovaline = owner.reagents.get_reagent_amount("inaprovaline")
var/myeldose = owner.reagents.get_reagent_amount("myelamine")
var/bicardose = owner.reagents.get_reagent_amount(REAGENT_ID_BICARIDINE)
var/inaprovaline = owner.reagents.get_reagent_amount(REAGENT_ID_INAPROVALINE)
var/myeldose = owner.reagents.get_reagent_amount(REAGENT_ID_MYELAMINE)
if(!(W.can_autoheal() || (bicardose && inaprovaline) || myeldose)) //bicaridine and inaprovaline stop internal wounds from growing bigger with time, unless it is so small that it is already healing
W.open_wound(0.1 * wound_update_accuracy)

View File

@@ -3,7 +3,7 @@
return 0
//This is a terrible hack and I should be ashamed.
var/datum/seed/diona = SSplants.seeds["diona"]
var/datum/seed/diona = SSplants.seeds[PLANT_DIONA]
if(!diona)
return 0

View File

@@ -59,10 +59,10 @@
var/modifier = 1 - 0.5 * is_bruised()
if(owner.bloodstr.has_reagent("phoron"))
if(owner.bloodstr.has_reagent(REAGENT_ID_PHORON))
adjust_plasma(round(4 * modifier))
if(owner.ingested.has_reagent("phoron"))
if(owner.ingested.has_reagent(REAGENT_ID_PHORON))
adjust_plasma(round(2 * modifier))
adjust_plasma(2) //Make it a decent amount so people can actually build stuff without stealing all of medbays phoron

View File

@@ -39,10 +39,10 @@
var/modifier = 1 - 0.5 * is_bruised()
if(owner.bloodstr.has_reagent("phoron"))
if(owner.bloodstr.has_reagent(REAGENT_ID_PHORON))
adjust_plasma(round(4 * modifier))
if(owner.ingested.has_reagent("phoron"))
if(owner.ingested.has_reagent(REAGENT_ID_PHORON))
adjust_plasma(round(2 * modifier))
adjust_plasma(1)