diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 5c89153f521..cf92e5d61fe 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -156,7 +156,7 @@ /atom/movable/screen/alert/too_much_n2o name = "Choking (N2O)" - desc = "There's semi-toxic sleeping gas in the air and you're breathing it in. Find some fresh air. The box in your backpack has an oxygen tank and gas mask in it." + desc = "There's sleeping gas in the air and you're breathing it in. Find some fresh air. The box in your backpack has an oxygen tank and gas mask in it." icon_state = "too_much_n2o" //End gas alerts diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm index c929439c240..9d70490febb 100644 --- a/code/game/objects/items/tanks/tanks.dm +++ b/code/game/objects/items/tanks/tanks.dm @@ -224,6 +224,13 @@ var/tank_pressure = air_contents.return_pressure() var/actual_distribute_pressure = clamp(tank_pressure, 0, distribute_pressure) + // Lets do some algebra to understand why this works, yeah? + // R_IDEAL_GAS_EQUATION is (kPa * L) / (K * mol) by the by, so the units in this equation look something like this + // kpa * L / (R_IDEAL_GAS_EQUATION * K) + // Or restated (kpa * L / K) * 1/R_IDEAL_GAS_EQUATION + // (kpa * L * K * mol) / (kpa * L * K) + // If we cancel it all out, we get moles, which is the expected unit + // This sort of thing comes up often in atmos, keep the tool in mind for other bits of code var/moles_needed = actual_distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature) return remove_air(moles_needed) diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index a3949088f66..29e0f9b1dd8 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -242,21 +242,22 @@ if(breath_gases[/datum/gas/nitrous_oxide]) var/SA_partialpressure = (breath_gases[/datum/gas/nitrous_oxide][MOLES]/breath.total_moles())*breath_pressure if(SA_partialpressure > SA_para_min) + throw_alert("too_much_n2o", /atom/movable/screen/alert/too_much_n2o) + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") Unconscious(60) if(SA_partialpressure > SA_sleep_min) Sleeping(max(AmountSleeping() + 40, 200)) else if(SA_partialpressure > 0.01) + clear_alert("too_much_n2o") if(prob(20)) emote(pick("giggle","laugh")) SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "chemical_euphoria", /datum/mood_event/chemical_euphoria) - if(SA_partialpressure > safe_tox_max*3) - var/ratio = (breath_gases[/datum/gas/nitrous_oxide][MOLES]/safe_tox_max) - adjustToxLoss(clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE)) - throw_alert("too_much_tox", /atom/movable/screen/alert/too_much_tox) else - clear_alert("too_much_tox") + SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") + clear_alert("too_much_n2o") else SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "chemical_euphoria") + clear_alert("too_much_n2o") //BZ (Facepunch port of their Agent B) if(breath_gases[/datum/gas/bz]) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 6e6e24c14f4..bac226d4339 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -264,21 +264,17 @@ var/SA_pp = breath.get_breath_partial_pressure(breath_gases[/datum/gas/nitrous_oxide][MOLES]) if(SA_pp > SA_para_min) // Enough to make us stunned for a bit + H.throw_alert("too_much_n2o", /atom/movable/screen/alert/too_much_n2o) H.Unconscious(60) // 60 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 H.Sleeping(min(H.AmountSleeping() + 100, 200)) 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 + H.clear_alert("too_much_n2o") if(prob(20)) n2o_euphoria = EUPHORIA_ACTIVE H.emote(pick("giggle", "laugh")) else n2o_euphoria = EUPHORIA_INACTIVE - - if(safe_toxins_max && SA_pp > safe_toxins_max*3) - var/ratio = (breath_gases[/datum/gas/nitrous_oxide][MOLES]/safe_toxins_max) - H.apply_damage_type(clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type) - H.throw_alert("too_much_n2o", /atom/movable/screen/alert/too_much_n2o) - else H.clear_alert("too_much_n2o")