mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-16 13:13:03 +00:00
Merge branch 'dev' of https://github.com/Baystation12/Baystation12 into hydroponics
This commit is contained in:
@@ -69,15 +69,15 @@
|
||||
..()
|
||||
|
||||
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
if(target)
|
||||
ManualFollow(target)
|
||||
|
||||
|
||||
|
||||
|
||||
/mob/dead/observer/Topic(href, href_list)
|
||||
if (href_list["track"])
|
||||
var/mob/target = locate(href_list["track"]) in mob_list
|
||||
if(target)
|
||||
ManualFollow(target)
|
||||
|
||||
|
||||
|
||||
/mob/dead/attackby(obj/item/W, mob/user)
|
||||
if(istype(W,/obj/item/weapon/tome))
|
||||
var/mob/dead/M = src
|
||||
@@ -111,7 +111,7 @@ Works together with spawning an observer, noted above.
|
||||
for(var/image/hud in client.images)
|
||||
if(copytext(hud.icon_state,1,4) == "hud")
|
||||
client.images.Remove(hud)
|
||||
|
||||
|
||||
if(antagHUD)
|
||||
var/list/target_list = list()
|
||||
for(var/mob/living/target in oview(src, 14))
|
||||
@@ -123,19 +123,19 @@ Works together with spawning an observer, noted above.
|
||||
process_medHUD(src)
|
||||
|
||||
|
||||
/mob/dead/proc/process_medHUD(var/mob/M)
|
||||
var/client/C = M.client
|
||||
for(var/mob/living/carbon/human/patient in oview(M, 14))
|
||||
C.images += patient.hud_list[HEALTH_HUD]
|
||||
C.images += patient.hud_list[STATUS_HUD_OOC]
|
||||
|
||||
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
|
||||
var/client/C = U.client
|
||||
for(var/mob/living/carbon/human/target in target_list)
|
||||
C.images += target.hud_list[SPECIALROLE_HUD]
|
||||
|
||||
|
||||
/*
|
||||
/mob/dead/proc/process_medHUD(var/mob/M)
|
||||
var/client/C = M.client
|
||||
for(var/mob/living/carbon/human/patient in oview(M, 14))
|
||||
C.images += patient.hud_list[HEALTH_HUD]
|
||||
C.images += patient.hud_list[STATUS_HUD_OOC]
|
||||
|
||||
/mob/dead/proc/assess_targets(list/target_list, mob/dead/observer/U)
|
||||
var/client/C = U.client
|
||||
for(var/mob/living/carbon/human/target in target_list)
|
||||
C.images += target.hud_list[SPECIALROLE_HUD]
|
||||
|
||||
|
||||
/*
|
||||
else//If the silicon mob has no law datum, no inherent laws, or a law zero, add them to the hud.
|
||||
var/mob/living/silicon/silicon_target = target
|
||||
if(!silicon_target.laws||(silicon_target.laws&&(silicon_target.laws.zeroth||!silicon_target.laws.inherent.len))||silicon_target.mind.special_role=="traitor")
|
||||
@@ -143,9 +143,9 @@ Works together with spawning an observer, noted above.
|
||||
U.client.images += image(tempHud,silicon_target,"hudmalborg")
|
||||
else
|
||||
U.client.images += image(tempHud,silicon_target,"hudmalai")
|
||||
*/
|
||||
return 1
|
||||
|
||||
*/
|
||||
return 1
|
||||
|
||||
/mob/proc/ghostize(var/can_reenter_corpse = 1)
|
||||
if(key)
|
||||
var/mob/dead/observer/ghost = new(src) //Transfer safety to observer spawning proc.
|
||||
@@ -180,7 +180,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if(NewLoc)
|
||||
loc = NewLoc
|
||||
for(var/obj/effect/step_trigger/S in NewLoc)
|
||||
S.HasEntered(src)
|
||||
S.Crossed(src)
|
||||
|
||||
return
|
||||
loc = get_turf(src) //Get out of closets and such as a ghost
|
||||
@@ -194,7 +194,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
x--
|
||||
|
||||
for(var/obj/effect/step_trigger/S in locate(x, y, z)) //<-- this is dumb
|
||||
S.HasEntered(src)
|
||||
S.Crossed(src)
|
||||
|
||||
/mob/dead/observer/examine()
|
||||
if(usr)
|
||||
@@ -256,10 +256,10 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
set category = "Ghost"
|
||||
set name = "Toggle AntagHUD"
|
||||
set desc = "Toggles AntagHUD allowing you to see who is the antagonist"
|
||||
|
||||
if(!client)
|
||||
return
|
||||
var/mentor = is_mentor(usr.client)
|
||||
|
||||
if(!client)
|
||||
return
|
||||
var/mentor = is_mentor(usr.client)
|
||||
if(!config.antag_hud_allowed && (!client.holder || mentor))
|
||||
src << "\red Admins have disabled this for this round."
|
||||
return
|
||||
@@ -387,9 +387,9 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
/mob/dead/observer/verb/analyze_air()
|
||||
set name = "Analyze Air"
|
||||
set category = "Ghost"
|
||||
|
||||
|
||||
if(!istype(usr, /mob/dead/observer)) return
|
||||
|
||||
|
||||
// Shamelessly copied from the Gas Analyzers
|
||||
if (!( istype(usr.loc, /turf) ))
|
||||
return
|
||||
@@ -397,7 +397,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
var/datum/gas_mixture/environment = usr.loc.return_air()
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
var/total_moles = environment.total_moles
|
||||
|
||||
src << "\blue <B>Results:</B>"
|
||||
if(abs(pressure - ONE_ATMOSPHERE) < 10)
|
||||
@@ -405,33 +405,8 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
else
|
||||
src << "\red Pressure: [round(pressure,0.1)] kPa"
|
||||
if(total_moles)
|
||||
var/o2_concentration = environment.oxygen/total_moles
|
||||
var/n2_concentration = environment.nitrogen/total_moles
|
||||
var/co2_concentration = environment.carbon_dioxide/total_moles
|
||||
var/phoron_concentration = environment.phoron/total_moles
|
||||
|
||||
var/unknown_concentration = 1-(o2_concentration+n2_concentration+co2_concentration+phoron_concentration)
|
||||
if(abs(n2_concentration - N2STANDARD) < 20)
|
||||
src << "\blue Nitrogen: [round(n2_concentration*100)]% ([round(environment.nitrogen,0.01)] moles)"
|
||||
else
|
||||
src << "\red Nitrogen: [round(n2_concentration*100)]% ([round(environment.nitrogen,0.01)] moles)"
|
||||
|
||||
if(abs(o2_concentration - O2STANDARD) < 2)
|
||||
src << "\blue Oxygen: [round(o2_concentration*100)]% ([round(environment.oxygen,0.01)] moles)"
|
||||
else
|
||||
src << "\red Oxygen: [round(o2_concentration*100)]% ([round(environment.oxygen,0.01)] moles)"
|
||||
|
||||
if(co2_concentration > 0.01)
|
||||
src << "\red CO2: [round(co2_concentration*100)]% ([round(environment.carbon_dioxide,0.01)] moles)"
|
||||
else
|
||||
src << "\blue CO2: [round(co2_concentration*100)]% ([round(environment.carbon_dioxide,0.01)] moles)"
|
||||
|
||||
if(phoron_concentration > 0.01)
|
||||
src << "\red Phoron: [round(phoron_concentration*100)]% ([round(environment.phoron,0.01)] moles)"
|
||||
|
||||
if(unknown_concentration > 0.01)
|
||||
src << "\red Unknown: [round(unknown_concentration*100)]% ([round(unknown_concentration*total_moles,0.01)] moles)"
|
||||
|
||||
for(var/g in environment.gas)
|
||||
src << "\blue [gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]% ([round(environment.gas[g], 0.01)] moles)"
|
||||
src << "\blue Temperature: [round(environment.temperature-T0C,0.1)]°C"
|
||||
src << "\blue Heat Capacity: [round(environment.heat_capacity(),0.1)]"
|
||||
|
||||
@@ -572,4 +547,4 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
W.update_icon()
|
||||
W.message = message
|
||||
W.add_hiddenprint(src)
|
||||
W.visible_message("\red Invisible fingers crudely paint something in blood on [T]...")
|
||||
W.visible_message("\red Invisible fingers crudely paint something in blood on [T]...")
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
@@ -172,24 +172,24 @@
|
||||
return 0
|
||||
|
||||
var/phoron_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the phoron in our breath
|
||||
var/Toxins_pp = (breath.phoron/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect phoron in air
|
||||
|
||||
adjustToxLoss(breath.phoron*250)
|
||||
adjustToxLoss(breath.gas["phoron"] * 250)
|
||||
phoron_alert = max(phoron_alert, 1)
|
||||
|
||||
phoron_used = breath.phoron
|
||||
phoron_used = breath.gas["phoron"]
|
||||
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
//Breathe in phoron and out oxygen
|
||||
breath.phoron -= phoron_used
|
||||
breath.oxygen += phoron_used
|
||||
breath.adjust_gas("phoron", -phoron_used)
|
||||
breath.adjust_gas("oxygen", phoron_used)
|
||||
|
||||
if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :(
|
||||
if(prob(20))
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
@@ -147,24 +147,24 @@
|
||||
return 0
|
||||
|
||||
var/phoron_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the phoron in our breath
|
||||
var/Toxins_pp = (breath.phoron/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect phoron in air
|
||||
|
||||
adjustToxLoss(breath.phoron*250)
|
||||
adjustToxLoss(breath.gas["phoron"] * 250)
|
||||
phoron_alert = max(phoron_alert, 1)
|
||||
|
||||
phoron_used = breath.phoron
|
||||
phoron_used = breath.gas["phoron"]
|
||||
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
//Breathe in phoron and out oxygen
|
||||
breath.phoron -= phoron_used
|
||||
breath.oxygen += phoron_used
|
||||
breath.adjust_gas("phoron", -phoron_used)
|
||||
breath.adjust_gas("oxygen", phoron_used)
|
||||
|
||||
if(breath.temperature > (T0C+66) && !(COLD_RESISTANCE in mutations)) // Hot air hurts :(
|
||||
if(prob(20))
|
||||
|
||||
@@ -80,7 +80,7 @@ var/const/MAX_ACTIVE_TIME = 400
|
||||
/obj/item/clothing/mask/facehugger/equipped(mob/M)
|
||||
Attach(M)
|
||||
|
||||
/obj/item/clothing/mask/facehugger/HasEntered(atom/target)
|
||||
/obj/item/clothing/mask/facehugger/Crossed(atom/target)
|
||||
HasProximity(target)
|
||||
return
|
||||
|
||||
|
||||
@@ -450,7 +450,7 @@
|
||||
|
||||
// called when something steps onto a human
|
||||
// this handles mulebots and vehicles
|
||||
/mob/living/carbon/human/HasEntered(var/atom/movable/AM)
|
||||
/mob/living/carbon/human/Crossed(var/atom/movable/AM)
|
||||
if(istype(AM, /obj/machinery/bot/mulebot))
|
||||
var/obj/machinery/bot/mulebot/MB = AM
|
||||
MB.RunOver(src)
|
||||
|
||||
@@ -354,26 +354,15 @@
|
||||
breath_moles = (ONE_ATMOSPHERE*BREATH_VOLUME/R_IDEAL_GAS_EQUATION*environment.temperature)
|
||||
else*/
|
||||
// Not enough air around, take a percentage of what's there to model this properly
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas) && breath)
|
||||
var/obj/item/clothing/mask/gas/G = wear_mask
|
||||
var/datum/gas_mixture/filtered = new
|
||||
|
||||
filtered.copy_from(breath)
|
||||
filtered.phoron *= G.gas_filter_strength
|
||||
for(var/datum/gas/gas in filtered.trace_gases)
|
||||
gas.moles *= G.gas_filter_strength
|
||||
filtered.update_values()
|
||||
if(istype(wear_mask, /obj/item/clothing/mask) && breath)
|
||||
var/obj/item/clothing/mask/M = wear_mask
|
||||
var/datum/gas_mixture/filtered = M.filter_air(breath)
|
||||
loc.assume_air(filtered)
|
||||
|
||||
breath.phoron *= 1 - G.gas_filter_strength
|
||||
for(var/datum/gas/gas in breath.trace_gases)
|
||||
gas.moles *= 1 - G.gas_filter_strength
|
||||
breath.update_values()
|
||||
|
||||
if(!is_lung_ruptured())
|
||||
if(!breath || breath.total_moles < BREATH_MOLES / 5 || breath.total_moles > BREATH_MOLES * 5)
|
||||
if(prob(5))
|
||||
@@ -436,7 +425,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles() == 0) || suiciding)
|
||||
if(!breath || (breath.total_moles == 0) || suiciding)
|
||||
if(suiciding)
|
||||
adjustOxyLoss(2)//If you are suiciding, you should die a little bit faster
|
||||
failed_last_breath = 1
|
||||
@@ -461,51 +450,41 @@
|
||||
var/SA_sleep_min = 5
|
||||
var/inhaled_gas_used = 0
|
||||
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
var/inhaling
|
||||
var/exhaling
|
||||
var/poison
|
||||
var/exhaling
|
||||
var/no_exhale
|
||||
|
||||
var/breath_type
|
||||
var/poison_type
|
||||
var/exhale_type
|
||||
|
||||
var/failed_inhale = 0
|
||||
var/failed_exhale = 0
|
||||
|
||||
switch(species.breath_type)
|
||||
if("nitrogen")
|
||||
inhaling = breath.nitrogen
|
||||
if("phoron")
|
||||
inhaling = breath.phoron
|
||||
if("carbon_dioxide")
|
||||
inhaling = breath.carbon_dioxide
|
||||
else
|
||||
inhaling = breath.oxygen
|
||||
if(species.breath_type)
|
||||
breath_type = species.breath_type
|
||||
inhaling = breath.gas[breath_type]
|
||||
else
|
||||
inhaling = "oxygen"
|
||||
|
||||
switch(species.poison_type)
|
||||
if("oxygen")
|
||||
poison = breath.oxygen
|
||||
if("nitrogen")
|
||||
poison = breath.nitrogen
|
||||
if("carbon_dioxide")
|
||||
poison = breath.carbon_dioxide
|
||||
else
|
||||
poison = breath.phoron
|
||||
if(species.poison_type)
|
||||
poison_type = species.poison_type
|
||||
poison = breath.gas[poison_type]
|
||||
else
|
||||
poison = "phoron"
|
||||
|
||||
switch(species.exhale_type)
|
||||
if("carbon_dioxide")
|
||||
exhaling = breath.carbon_dioxide
|
||||
if("oxygen")
|
||||
exhaling = breath.oxygen
|
||||
if("nitrogen")
|
||||
exhaling = breath.nitrogen
|
||||
if("phoron")
|
||||
exhaling = breath.phoron
|
||||
else
|
||||
no_exhale = 1
|
||||
if(species.exhale_type)
|
||||
exhale_type = species.exhale_type
|
||||
exhaling = breath.gas[exhale_type]
|
||||
else
|
||||
no_exhale = 1
|
||||
|
||||
var/inhale_pp = (inhaling/breath.total_moles())*breath_pressure
|
||||
var/toxins_pp = (poison/breath.total_moles())*breath_pressure
|
||||
var/exhaled_pp = (exhaling/breath.total_moles())*breath_pressure
|
||||
var/inhale_pp = (inhaling/breath.total_moles)*breath_pressure
|
||||
var/toxins_pp = (poison/breath.total_moles)*breath_pressure
|
||||
var/exhaled_pp = (exhaling/breath.total_moles)*breath_pressure
|
||||
|
||||
// Not enough to breathe
|
||||
if(inhale_pp < safe_pressure_min)
|
||||
@@ -532,32 +511,16 @@
|
||||
inhaled_gas_used = inhaling/6
|
||||
oxygen_alert = 0
|
||||
|
||||
switch(species.breath_type)
|
||||
if("nitrogen")
|
||||
breath.nitrogen -= inhaled_gas_used
|
||||
if("phoron")
|
||||
breath.phoron -= inhaled_gas_used
|
||||
if("carbon_dioxide")
|
||||
breath.carbon_dioxide-= inhaled_gas_used
|
||||
else
|
||||
breath.oxygen -= inhaled_gas_used
|
||||
breath.adjust_gas(breath_type, -inhaled_gas_used)
|
||||
|
||||
if(!no_exhale)
|
||||
switch(species.exhale_type)
|
||||
if("oxygen")
|
||||
breath.oxygen += inhaled_gas_used
|
||||
if("nitrogen")
|
||||
breath.nitrogen += inhaled_gas_used
|
||||
if("phoron")
|
||||
breath.phoron += inhaled_gas_used
|
||||
if("CO2")
|
||||
breath.carbon_dioxide += inhaled_gas_used
|
||||
breath.adjust_gas(exhale_type, inhaled_gas_used)
|
||||
|
||||
// Too much exhaled gas in the air
|
||||
if(exhaled_pp > safe_exhaled_max)
|
||||
if (!co2_alert|| prob(15))
|
||||
var/word = pick("extremely dizzy","short of breath","faint","confused")
|
||||
src << "\red <b>You feel [word].</b>"
|
||||
src << "<span class='danger'>You feel [word].</span>"
|
||||
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
co2_alert = 1
|
||||
@@ -566,7 +529,7 @@
|
||||
else if(exhaled_pp > safe_exhaled_max * 0.7)
|
||||
if (!co2_alert || prob(1))
|
||||
var/word = pick("dizzy","short of breath","faint","momentarily confused")
|
||||
src << "\red You feel [word]."
|
||||
src << "<span class='warning>You feel [word].</span>"
|
||||
|
||||
//scale linearly from 0 to 1 between safe_exhaled_max and safe_exhaled_max*0.7
|
||||
var/ratio = 1.0 - (safe_exhaled_max - exhaled_pp)/(safe_exhaled_max*0.3)
|
||||
@@ -580,7 +543,7 @@
|
||||
else if(exhaled_pp > safe_exhaled_max * 0.6)
|
||||
if (prob(0.3))
|
||||
var/word = pick("a little dizzy","short of breath")
|
||||
src << "\red You feel [word]."
|
||||
src << "<span class='warning>You feel [word].</span>"
|
||||
|
||||
else
|
||||
co2_alert = 0
|
||||
@@ -594,26 +557,27 @@
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
|
||||
|
||||
// If there's some other shit in the air lets deal with it here.
|
||||
if(breath.trace_gases.len)
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(breath.gas["sleeping_agent"])
|
||||
var/SA_pp = (breath.gas["sleeping_agent"] / breath.total_moles) * breath_pressure
|
||||
|
||||
// Enough to make us paralysed for a bit
|
||||
if(SA_pp > SA_para_min)
|
||||
// Enough to make us paralysed for a bit
|
||||
if(SA_pp > SA_para_min)
|
||||
|
||||
// 3 gives them one second to wake up and run away a bit!
|
||||
Paralyse(3)
|
||||
// 3 gives them one second to wake up and run away a bit!
|
||||
Paralyse(3)
|
||||
|
||||
// Enough to make us sleep as well
|
||||
if(SA_pp > SA_sleep_min)
|
||||
sleeping = min(sleeping+2, 10)
|
||||
// Enough to make us sleep as well
|
||||
if(SA_pp > SA_sleep_min)
|
||||
sleeping = min(sleeping+2, 10)
|
||||
|
||||
// There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
else if(SA_pp > 0.15)
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
SA.moles = 0
|
||||
// There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
else if(SA_pp > 0.15)
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
breath.adjust_gas("sleeping_agent", -breath.gas["sleeping_agent"])
|
||||
|
||||
// Were we able to breathe?
|
||||
if (failed_inhale || failed_exhale)
|
||||
@@ -630,10 +594,10 @@
|
||||
|
||||
if(breath.temperature < species.cold_level_1)
|
||||
if(prob(20))
|
||||
src << "\red You feel your face freezing and icicles forming in your lungs!"
|
||||
src << "<span class='danger'>You feel your face freezing and icicles forming in your lungs!</span>"
|
||||
else if(breath.temperature > species.heat_level_1)
|
||||
if(prob(20))
|
||||
src << "\red You feel your face burning and a searing heat in your lungs!"
|
||||
src << "<span class='danger'>You feel your face burning and a searing heat in your lungs!</span>"
|
||||
|
||||
switch(breath.temperature)
|
||||
if(-INFINITY to species.cold_level_3)
|
||||
@@ -662,7 +626,7 @@
|
||||
else
|
||||
temp_adj /= (BODYTEMP_HEAT_DIVISOR * 5) //don't raise temperature as much as if we were directly exposed
|
||||
|
||||
var/relative_density = breath.total_moles() / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE)
|
||||
var/relative_density = breath.total_moles / (MOLES_CELLSTANDARD * BREATH_PERCENTAGE)
|
||||
temp_adj *= relative_density
|
||||
|
||||
if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX
|
||||
@@ -689,7 +653,7 @@
|
||||
else
|
||||
loc_temp = environment.temperature
|
||||
|
||||
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1 && environment.phoron < MOLES_PHORON_VISIBLE)
|
||||
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1)
|
||||
pressure_alert = 0
|
||||
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
|
||||
|
||||
@@ -705,7 +669,7 @@
|
||||
temp_adj = (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR)
|
||||
|
||||
//Use heat transfer as proportional to the gas density. However, we only care about the relative density vs standard 101 kPa/20 C air. Therefore we can use mole ratios
|
||||
var/relative_density = environment.total_moles() / MOLES_CELLSTANDARD
|
||||
var/relative_density = environment.total_moles / MOLES_CELLSTANDARD
|
||||
temp_adj *= relative_density
|
||||
|
||||
if (temp_adj > BODYTEMP_HEATING_MAX) temp_adj = BODYTEMP_HEATING_MAX
|
||||
@@ -765,8 +729,10 @@
|
||||
else
|
||||
pressure_alert = -1
|
||||
|
||||
if(environment.phoron > MOLES_PHORON_VISIBLE)
|
||||
pl_effects()
|
||||
for(var/g in environment.gas)
|
||||
if(gas_data.flags[g] & XGM_GAS_CONTAMINANT && environment.gas[g] > gas_data.overlay_limit[g] + 1)
|
||||
pl_effects()
|
||||
break
|
||||
return
|
||||
|
||||
/*
|
||||
|
||||
@@ -237,25 +237,14 @@
|
||||
var/obj/location_as_object = loc
|
||||
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
|
||||
else if(istype(loc, /turf/))
|
||||
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
var/breath_moles = environment.total_moles*BREATH_PERCENTAGE
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/gas))
|
||||
var/obj/item/clothing/mask/gas/G = wear_mask
|
||||
var/datum/gas_mixture/filtered = new
|
||||
|
||||
filtered.copy_from(breath)
|
||||
filtered.phoron *= G.gas_filter_strength
|
||||
for(var/datum/gas/gas in filtered.trace_gases)
|
||||
gas.moles *= G.gas_filter_strength
|
||||
filtered.update_values()
|
||||
if(istype(wear_mask, /obj/item/clothing/mask) && breath)
|
||||
var/obj/item/clothing/mask/M = wear_mask
|
||||
var/datum/gas_mixture/filtered = M.filter_air(breath)
|
||||
loc.assume_air(filtered)
|
||||
|
||||
breath.phoron *= 1 - G.gas_filter_strength
|
||||
for(var/datum/gas/gas in breath.trace_gases)
|
||||
gas.moles *= 1 - G.gas_filter_strength
|
||||
breath.update_values()
|
||||
|
||||
// Handle chem smoke effect -- Doohl
|
||||
var/block = 0
|
||||
if(wear_mask)
|
||||
@@ -316,14 +305,14 @@
|
||||
var/SA_para_min = 0.5
|
||||
var/SA_sleep_min = 5
|
||||
var/oxygen_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
var/breath_pressure = (breath.total_moles * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the O2 in our breath
|
||||
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
|
||||
var/O2_pp = (breath.gas["oxygen"] / breath.total_moles) * breath_pressure
|
||||
// Same, but for the phoron
|
||||
var/Toxins_pp = (breath.phoron/breath.total_moles())*breath_pressure
|
||||
var/Toxins_pp = (breath.gas["phoron"] / breath.total_moles) * breath_pressure
|
||||
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
|
||||
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure
|
||||
var/CO2_pp = (breath.gas["carbon_dioxide"] / breath.total_moles) * breath_pressure
|
||||
|
||||
if(O2_pp < safe_oxygen_min) // Too little oxygen
|
||||
if(prob(20))
|
||||
@@ -332,7 +321,7 @@
|
||||
O2_pp = 0.01
|
||||
var/ratio = safe_oxygen_min/O2_pp
|
||||
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
|
||||
oxygen_used = breath.oxygen*ratio/6
|
||||
oxygen_used = breath.gas["oxygen"] * ratio / 6
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
/*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose)
|
||||
spawn(0) emote("cough")
|
||||
@@ -342,11 +331,11 @@
|
||||
oxygen_alert = max(oxygen_alert, 1)*/
|
||||
else // We're in safe limits
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath.oxygen/6
|
||||
oxygen_used = breath.gas["oxygen"] / 6
|
||||
oxygen_alert = 0
|
||||
|
||||
breath.oxygen -= oxygen_used
|
||||
breath.carbon_dioxide += oxygen_used
|
||||
breath.adjust_gas("oxygen", -oxygen_used)
|
||||
breath.adjust_gas("carbon_dioxide", oxygen_used)
|
||||
|
||||
if(CO2_pp > safe_co2_max)
|
||||
if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
|
||||
@@ -363,7 +352,7 @@
|
||||
co2overloadtime = 0
|
||||
|
||||
if(Toxins_pp > safe_phoron_max) // Too much phoron
|
||||
var/ratio = (breath.phoron/safe_phoron_max) * 10
|
||||
var/ratio = (breath.gas["phoron"] / safe_phoron_max) * 10
|
||||
//adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
|
||||
if(reagents)
|
||||
reagents.add_reagent("toxin", Clamp(ratio, MIN_TOXIN_DAMAGE, MAX_TOXIN_DAMAGE))
|
||||
@@ -371,16 +360,15 @@
|
||||
else
|
||||
phoron_alert = 0
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
sleeping = max(sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
if(breath.gas["sleeping_agent"])
|
||||
var/SA_pp = (breath.gas["sleeping_agent"] / breath.total_moles) * breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
sleeping = max(sleeping+2, 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
spawn(0) emote(pick("giggle", "laugh"))
|
||||
|
||||
|
||||
if(breath.temperature > (T0C+66)) // Hot air hurts :(
|
||||
@@ -403,7 +391,7 @@
|
||||
var/pressure = environment.return_pressure()
|
||||
var/adjusted_pressure = calculate_affecting_pressure(pressure) //Returns how much pressure actually affects the mob.
|
||||
|
||||
if(adjusted_pressure < WARNING_HIGH_PRESSURE && adjusted_pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.phoron < MOLES_PHORON_VISIBLE)
|
||||
if(adjusted_pressure < WARNING_HIGH_PRESSURE && adjusted_pressure > WARNING_LOW_PRESSURE && abs(environment.temperature - 293.15) < 20 && abs(bodytemperature - 310.14) < 0.5 && environment.gas["phoron"] < gas_data.overlay_limit["phoron"])
|
||||
|
||||
//Hopefully should fix the walk-inside-still-pressure-warning issue.
|
||||
if(pressure_alert)
|
||||
|
||||
@@ -576,22 +576,13 @@
|
||||
var/datum/gas_mixture/environment = T.return_air()
|
||||
|
||||
var/pressure = environment.return_pressure()
|
||||
var/total_moles = environment.total_moles()
|
||||
var/total_moles = environment.total_moles
|
||||
|
||||
dat += "Air Pressure: [round(pressure,0.1)] kPa<br>"
|
||||
|
||||
if (total_moles)
|
||||
var/o2_level = environment.oxygen/total_moles
|
||||
var/n2_level = environment.nitrogen/total_moles
|
||||
var/co2_level = environment.carbon_dioxide/total_moles
|
||||
var/phoron_level = environment.phoron/total_moles
|
||||
var/unknown_level = 1-(o2_level+n2_level+co2_level+phoron_level)
|
||||
dat += "Nitrogen: [round(n2_level*100)]%<br>"
|
||||
dat += "Oxygen: [round(o2_level*100)]%<br>"
|
||||
dat += "Carbon Dioxide: [round(co2_level*100)]%<br>"
|
||||
dat += "Phoron: [round(phoron_level*100)]%<br>"
|
||||
if(unknown_level > 0.01)
|
||||
dat += "OTHER: [round(unknown_level)]%<br>"
|
||||
if(total_moles)
|
||||
for(var/g in environment.gas)
|
||||
dat += "[gas_data.name[g]]: [round((environment.gas[g] / total_moles) * 100)]%<br>"
|
||||
dat += "Temperature: [round(environment.temperature-T0C)]°C<br>"
|
||||
dat += "<br><a href='byond://?src=\ref[src];software=atmosensor;sub=0'>Refresh Reading</a>"
|
||||
return dat
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
src << "<span class='warning'>You are too small to pull anything.</span>"
|
||||
return
|
||||
|
||||
/mob/living/simple_animal/mouse/HasEntered(AM as mob|obj)
|
||||
/mob/living/simple_animal/mouse/Crossed(AM as mob|obj)
|
||||
if( ishuman(AM) )
|
||||
if(!stat)
|
||||
var/mob/M = AM
|
||||
|
||||
@@ -141,41 +141,41 @@
|
||||
//Atmos
|
||||
var/atmos_suitable = 1
|
||||
|
||||
var/atom/A = src.loc
|
||||
var/atom/A = src.loc
|
||||
|
||||
if(istype(A,/turf))
|
||||
var/turf/T = A
|
||||
|
||||
var/turf/T = A
|
||||
|
||||
var/datum/gas_mixture/Environment = T.return_air()
|
||||
|
||||
|
||||
if(Environment)
|
||||
|
||||
|
||||
if( abs(Environment.temperature - bodytemperature) > 40 )
|
||||
bodytemperature += ((Environment.temperature - bodytemperature) / 5)
|
||||
|
||||
|
||||
if(min_oxy)
|
||||
if(Environment.oxygen < min_oxy)
|
||||
if(Environment.gas["oxygen"] < min_oxy)
|
||||
atmos_suitable = 0
|
||||
if(max_oxy)
|
||||
if(Environment.oxygen > max_oxy)
|
||||
if(Environment.gas["oxygen"] > max_oxy)
|
||||
atmos_suitable = 0
|
||||
if(min_tox)
|
||||
if(Environment.phoron < min_tox)
|
||||
if(Environment.gas["phoron"] < min_tox)
|
||||
atmos_suitable = 0
|
||||
if(max_tox)
|
||||
if(Environment.phoron > max_tox)
|
||||
if(Environment.gas["phoron"] > max_tox)
|
||||
atmos_suitable = 0
|
||||
if(min_n2)
|
||||
if(Environment.nitrogen < min_n2)
|
||||
if(Environment.gas["nitrogen"] < min_n2)
|
||||
atmos_suitable = 0
|
||||
if(max_n2)
|
||||
if(Environment.nitrogen > max_n2)
|
||||
if(Environment.gas["nitrogen"] > max_n2)
|
||||
atmos_suitable = 0
|
||||
if(min_co2)
|
||||
if(Environment.carbon_dioxide < min_co2)
|
||||
if(Environment.gas["carbon_dioxide"] < min_co2)
|
||||
atmos_suitable = 0
|
||||
if(max_co2)
|
||||
if(Environment.carbon_dioxide > max_co2)
|
||||
if(Environment.gas["carbon_dioxide"] > max_co2)
|
||||
atmos_suitable = 0
|
||||
|
||||
//Atmos effect
|
||||
|
||||
@@ -13,25 +13,6 @@
|
||||
living_mob_list += src
|
||||
..()
|
||||
|
||||
/mob/proc/Cell()
|
||||
set category = "Admin"
|
||||
set hidden = 1
|
||||
|
||||
if(!loc) return 0
|
||||
|
||||
var/datum/gas_mixture/environment = loc.return_air()
|
||||
|
||||
var/t = "\blue Coordinates: [x],[y] \n"
|
||||
t+= "\red Temperature: [environment.temperature] \n"
|
||||
t+= "\blue Nitrogen: [environment.nitrogen] \n"
|
||||
t+= "\blue Oxygen: [environment.oxygen] \n"
|
||||
t+= "\blue Phoron : [environment.phoron] \n"
|
||||
t+= "\blue Carbon Dioxide: [environment.carbon_dioxide] \n"
|
||||
for(var/datum/gas/trace_gas in environment.trace_gases)
|
||||
usr << "\blue [trace_gas.type]: [trace_gas.moles] \n"
|
||||
|
||||
usr.show_message(t, 1)
|
||||
|
||||
/mob/proc/show_message(msg, type, alt, alt_type)//Message, type of message (1 or 2), alternative message, alt message type (1 or 2)
|
||||
|
||||
if(!client) return
|
||||
|
||||
Reference in New Issue
Block a user