Converts gas, mat and reagent strings to defines

This commit is contained in:
Kashargul
2024-12-06 17:26:00 +01:00
parent 780c07439b
commit 80edcd2c3d
155 changed files with 1183 additions and 1054 deletions
@@ -5,7 +5,7 @@
if(!environment) return
var/turf/T = get_turf(src)
if(environment.gas["phoron"] > 0 || (T && locate(/obj/effect/alien/weeds) in T.contents))
if(environment.gas[GAS_PHORON] > 0 || (T && locate(/obj/effect/alien/weeds) in T.contents))
update_progression()
adjustBruteLoss(-1)
adjustFireLoss(-1)
+11 -11
View File
@@ -609,13 +609,13 @@
if(species.breath_type)
breath_type = species.breath_type
else
breath_type = "oxygen"
breath_type = GAS_O2
inhaling = breath.gas[breath_type]
if(species.poison_type)
poison_type = species.poison_type
else
poison_type = "phoron"
poison_type = GAS_PHORON
poison = breath.gas[poison_type]
if(species.exhale_type)
@@ -640,17 +640,17 @@
failed_inhale = 1
switch(breath_type)
if("oxygen")
if(GAS_O2)
throw_alert("oxy", /obj/screen/alert/not_enough_oxy)
if("phoron")
if(GAS_PHORON)
throw_alert("oxy", /obj/screen/alert/not_enough_tox)
if("nitrogen")
if(GAS_N2)
throw_alert("oxy", /obj/screen/alert/not_enough_nitro)
if("carbon_dioxide")
if(GAS_CO2)
throw_alert("oxy", /obj/screen/alert/not_enough_co2)
if("volatile_fuel")
if(GAS_VOLATILE_FUEL)
throw_alert("oxy", /obj/screen/alert/not_enough_fuel)
if("nitrous_oxide")
if(GAS_N2O)
throw_alert("oxy", /obj/screen/alert/not_enough_n2o)
else
@@ -702,8 +702,8 @@
clear_alert("tox_in_air")
// If there's some other shit in the air lets deal with it here.
if(breath.gas["nitrous_oxide"])
var/SA_pp = (breath.gas["nitrous_oxide"] / breath.total_moles) * breath_pressure
if(breath.gas[GAS_N2O])
var/SA_pp = (breath.gas[GAS_N2O] / breath.total_moles) * breath_pressure
// Enough to make us paralysed for a bit
if(SA_pp > SA_para_min)
@@ -719,7 +719,7 @@
else if(SA_pp > 0.15)
if(prob(20))
spawn(0) emote(pick("giggle", "laugh"))
breath.adjust_gas("nitrous_oxide", -breath.gas["nitrous_oxide"]/6, update = 0) //update after
breath.adjust_gas(GAS_N2O, -breath.gas[GAS_N2O]/6, update = 0) //update after
// Were we able to breathe?
if (failed_inhale || failed_exhale)
@@ -43,8 +43,8 @@
gluttonous = 1
breath_type = "phoron"
poison_type = "oxygen"
breath_type = GAS_PHORON
poison_type = GAS_O2
ideal_air_type = /datum/gas_mixture/belly_air/vox
siemens_coefficient = 0.2
@@ -133,9 +133,9 @@
// Environment tolerance/life processes vars.
var/reagent_tag //Used for metabolizing reagents.
var/breath_type = "oxygen" // Non-oxygen gas breathed, if any.
var/poison_type = "phoron" // Poisonous air.
var/exhale_type = "carbon_dioxide" // Exhaled gas type.
var/breath_type = GAS_O2 // Non-oxygen gas breathed, if any.
var/poison_type = GAS_PHORON // Poisonous air.
var/exhale_type = GAS_CO2 // Exhaled gas type.
var/water_breather = FALSE
var/bad_swimmer = FALSE
@@ -18,9 +18,9 @@
selects_bodytype = SELECTS_BODYTYPE_CUSTOM //VOREStation edit
body_temperature = T20C
breath_type = "oxygen"
poison_type = "phoron"
exhale_type = "oxygen"
breath_type = GAS_O2
poison_type = GAS_PHORON
exhale_type = GAS_O2
water_breather = TRUE //eh, why not? Aquatic plants are a thing.
// Heat and cold resistances are 20 degrees broader on the level 1 range, level 2 is default, level 3 is much weaker, halfway between L2 and normal L3.
@@ -169,7 +169,7 @@
var/failed_inhale = 0
var/failed_exhale = 0
inhaling = breath.gas["carbon_dioxide"]
inhaling = breath.gas[GAS_CO2]
poison = breath.gas[poison_type]
exhaling = breath.gas[exhale_type]
@@ -193,7 +193,7 @@
H.clear_alert("oxy")
inhaled_gas_used = inhaling/6
breath.adjust_gas("carbon_dioxide", -inhaled_gas_used, update = 0) //update afterwards
breath.adjust_gas(GAS_CO2, -inhaled_gas_used, update = 0) //update afterwards
breath.adjust_gas_temp(exhale_type, inhaled_gas_used, H.bodytemperature, update = 0) //update afterwards
//Now we handle CO2.
@@ -69,10 +69,10 @@
//Called when spawning to equip them with special things.
/datum/species/custom/equip_survival_gear(var/mob/living/carbon/human/H, var/extendedtank = 0, var/comprehensive = 0)
. = ..()
if(breath_type != "oxygen")
if(breath_type != GAS_O2)
H.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(H), slot_wear_mask)
var/obj/item/tank/tankpath
if(breath_type == "phoron")
if(breath_type == GAS_PHORON)
tankpath = /obj/item/tank/vox
else
tankpath = text2path("/obj/item/tank/" + breath_type)
@@ -430,7 +430,7 @@
warning_low_pressure = 300 // Low pressure warning.
hazard_low_pressure = 220 // Dangerously low pressure.
safe_pressure = 400
poison_type = "nitrogen" // technically it's a partial pressure thing but IDK if we can emulate that
poison_type = GAS_N2 // technically it's a partial pressure thing but IDK if we can emulate that
ideal_air_type = /datum/gas_mixture/belly_air/zaddat
genders = list(FEMALE, PLURAL) //females are polyp-producing, infertile females and males are nigh-identical
@@ -154,12 +154,12 @@
/datum/trait/negative/breathes/phoron
name = "Phoron Breather"
desc = "You breathe phoron instead of oxygen (which is poisonous to you), much like a Vox."
var_changes = list("breath_type" = "phoron", "poison_type" = "oxygen", "ideal_air_type" = /datum/gas_mixture/belly_air/vox)
var_changes = list("breath_type" = GAS_PHORON, "poison_type" = GAS_O2, "ideal_air_type" = /datum/gas_mixture/belly_air/vox)
/datum/trait/negative/breathes/nitrogen
name = "Nitrogen Breather"
desc = "You breathe nitrogen instead of oxygen (which is poisonous to you). Incidentally, phoron isn't poisonous to breathe to you."
var_changes = list("breath_type" = "nitrogen", "poison_type" = "oxygen", "ideal_air_type" = /datum/gas_mixture/belly_air/nitrogen_breather)
var_changes = list("breath_type" = GAS_N2, "poison_type" = GAS_O2, "ideal_air_type" = /datum/gas_mixture/belly_air/nitrogen_breather)
/datum/trait/negative/monolingual
name = "Monolingual"
@@ -114,7 +114,7 @@
var/datum/gas_mixture/environment = T.return_air()
if(!environment) return
if(environment.gas["phoron"] > 0 || locate(/obj/effect/alien/weeds) in T)
if(environment.gas[GAS_PHORON] > 0 || locate(/obj/effect/alien/weeds) in T)
if(!regenerate(H))
var/obj/item/organ/internal/xenos/plasmavessel/P = H.internal_organs_by_name[O_PLASMA]
P.stored_plasma += weeds_plasma_rate
+1 -1
View File
@@ -442,7 +442,7 @@
return 1
var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment
if(G.gas["oxygen"] < 1)
if(G.gas[GAS_O2] < 1)
ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire
return 1
@@ -340,10 +340,10 @@
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles
if (total_moles)
var/o2_level = environment.gas["oxygen"]/total_moles
var/n2_level = environment.gas["nitrogen"]/total_moles
var/co2_level = environment.gas["carbon_dioxide"]/total_moles
var/phoron_level = environment.gas["phoron"]/total_moles
var/o2_level = environment.gas[GAS_O2]/total_moles
var/n2_level = environment.gas[GAS_N2]/total_moles
var/co2_level = environment.gas[GAS_CO2]/total_moles
var/phoron_level = environment.gas[GAS_PHORON]/total_moles
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
// entry is what the element is describing
+8 -8
View File
@@ -118,37 +118,37 @@
if( abs(Environment.temperature - bodytemperature) > temperature_range ) //VOREStation Edit: heating adjustments
bodytemperature += ((Environment.temperature - bodytemperature) / 5)
if(min_oxy && Environment.gas["oxygen"] < min_oxy)
if(min_oxy && Environment.gas[GAS_O2] < min_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /obj/screen/alert/not_enough_oxy)
else if(max_oxy && Environment.gas["oxygen"] > max_oxy)
else if(max_oxy && Environment.gas[GAS_O2] > max_oxy)
atmos_unsuitable = 1
throw_alert("oxy", /obj/screen/alert/too_much_oxy)
else
clear_alert("oxy")
if(min_tox && Environment.gas["phoron"] < min_tox)
if(min_tox && Environment.gas[GAS_PHORON] < min_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /obj/screen/alert/not_enough_tox)
else if(max_tox && Environment.gas["phoron"] > max_tox)
else if(max_tox && Environment.gas[GAS_PHORON] > max_tox)
atmos_unsuitable = 2
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
else
clear_alert("tox_in_air")
if(min_n2 && Environment.gas["nitrogen"] < min_n2)
if(min_n2 && Environment.gas[GAS_N2] < min_n2)
atmos_unsuitable = 1
throw_alert("n2o", /obj/screen/alert/not_enough_nitro)
else if(max_n2 && Environment.gas["nitrogen"] > max_n2)
else if(max_n2 && Environment.gas[GAS_N2] > max_n2)
atmos_unsuitable = 1
throw_alert("n2o", /obj/screen/alert/too_much_nitro)
else
clear_alert("n2o")
if(min_co2 && Environment.gas["carbon_dioxide"] < min_co2)
if(min_co2 && Environment.gas[GAS_CO2] < min_co2)
atmos_unsuitable = 1
throw_alert("co2", /obj/screen/alert/not_enough_co2)
else if(max_co2 && Environment.gas["carbon_dioxide"] > max_co2)
else if(max_co2 && Environment.gas[GAS_CO2] > max_co2)
atmos_unsuitable = 1
throw_alert("co2", /obj/screen/alert/too_much_co2)
else
@@ -43,7 +43,7 @@
poison_chance = 30
poison_per_bite = 0.5
poison_type = "phoron"
poison_type = REAGENT_ID_PHORON
tame_items = list(
/obj/item/tank/phoron = 20,
@@ -49,8 +49,8 @@
var/list/bodypart_targets = list(BP_L_LEG,BP_R_LEG,BP_L_ARM,BP_R_ARM,BP_TORSO,BP_GROIN,BP_HEAD)
var/infest_target = BP_TORSO // The currently chosen bodypart to infest.
var/mob/living/carbon/host // Our humble host.
var/list/produceable_chemicals = list("inaprovaline","anti_toxin","alkysine","bicaridine","tramadol","kelotane","leporazine","iron","phoron","condensedcapsaicin_v","frostoil")
var/randomized_reagent = "iron" // The reagent chosen at random to be produced, if there's no one piloting the worm.
var/list/produceable_chemicals = list("inaprovaline","anti_toxin","alkysine","bicaridine","tramadol","kelotane","leporazine",REAGENT_ID_IRON,REAGENT_ID_PHORON,"condensedcapsaicin_v","frostoil")
var/randomized_reagent = REAGENT_ID_IRON // The reagent chosen at random to be produced, if there's no one piloting the worm.
var/passive_reagent = "paracetamol" // Reagent passively produced by the leech. Should usually be a painkiller.
var/feeding_delay = 30 SECONDS // How long do we have to wait to bite our host's organs?
@@ -173,7 +173,7 @@
color = "#660088"
slime_color = "dark purple"
coretype = /obj/item/slime_extract/dark_purple
reagent_injected = "phoron"
reagent_injected = REAGENT_ID_PHORON
description_info = "This slime applies phoron to enemies it attacks. A biosuit or other thick armor can protect from the toxic attack. \
If hit with a burning attack, it will erupt in flames."
@@ -190,7 +190,7 @@
/mob/living/simple_mob/slime/xenobio/dark_purple/proc/ignite()
visible_message(span_critical("\The [src] erupts in an inferno!"))
for(var/turf/simulated/target_turf in view(2, src))
target_turf.assume_gas("phoron", 30, 1500+T0C)
target_turf.assume_gas(GAS_PHORON, 30, 1500+T0C)
spawn(0)
target_turf.hotspot_expose(1500+T0C, 400)
qdel(src)