Minor refactor of how gas IDs are handled

This commit is contained in:
duncathan salt
2017-10-12 00:30:09 -05:00
committed by CitadelStationBot
parent 5b4e26cb06
commit c0e9cde5c2
52 changed files with 438 additions and 331 deletions
+58 -1
View File
@@ -1,3 +1,4 @@
<<<<<<< HEAD
/mob/living/carbon/alien/Life()
findQueen()
return..()
@@ -51,4 +52,60 @@
if(..())
return
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
return
return
=======
/mob/living/carbon/alien/Life()
findQueen()
return..()
/mob/living/carbon/alien/check_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
return
if(!breath || (breath.total_moles() == 0))
//Aliens breathe in vaccuum
return 0
var/toxins_used = 0
var/tox_detect_threshold = 0.02
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
var/list/breath_gases = breath.gases
breath.assert_gases(/datum/gas/plasma, /datum/gas/oxygen)
//Partial pressure of the toxins in our breath
var/Toxins_pp = (breath_gases[/datum/gas/plasma][MOLES]/breath.total_moles())*breath_pressure
if(Toxins_pp > tox_detect_threshold) // Detect toxins in air
adjustPlasma(breath_gases[/datum/gas/plasma][MOLES]*250)
throw_alert("alien_tox", /obj/screen/alert/alien_tox)
toxins_used = breath_gases[/datum/gas/plasma][MOLES]
else
clear_alert("alien_tox")
//Breathe in toxins and out oxygen
breath_gases[/datum/gas/plasma][MOLES] -= toxins_used
breath_gases[/datum/gas/oxygen][MOLES] += toxins_used
breath.garbage_collect()
//BREATH TEMPERATURE
handle_breath_temperature(breath)
/mob/living/carbon/alien/handle_status_effects()
..()
//natural reduction of movement delay due to stun.
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
/mob/living/carbon/alien/handle_changeling()
return
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
if(..())
return
bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up!
return
>>>>>>> 454d16f... Minor refactor of how gas IDs are handled (#31528)