mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
[MIRROR] Fixes issue where self-resp and enabling Godmode may not clear the suffocating moodlet (#817)
* Fixes issue where self-resp and enabling Godmode may not clear the suffocating moodlet (#53715) Clears suffocation-related flags while the user doesn't need to breathe due to the self-resp virus symptom or Godmode. * Fixes issue where self-resp and enabling Godmode may not clear the suffocating moodlet Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
@@ -10,13 +10,19 @@
|
||||
usable_legs = 0 //Populated on init through list/bodyparts
|
||||
num_hands = 0 //Populated on init through list/bodyparts
|
||||
usable_hands = 0 //Populated on init through list/bodyparts
|
||||
var/list/internal_organs = list() ///List of [/obj/item/organ] in the mob. They don't go in the contents for some reason I don't want to know.
|
||||
var/list/internal_organs_slot= list() ///Same as [above][/mob/living/carbon/var/internal_organs], but stores "slot ID" - "organ" pairs for easy access.
|
||||
var/silent = 0 ///Can't talk. Value goes down every life proc. NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
|
||||
var/dreaming = 0 ///How many dream images we have left to send
|
||||
///List of [/obj/item/organ] in the mob. They don't go in the contents for some reason I don't want to know.
|
||||
var/list/internal_organs = list()
|
||||
///Same as [above][/mob/living/carbon/var/internal_organs], but stores "slot ID" - "organ" pairs for easy access.
|
||||
var/list/internal_organs_slot = list()
|
||||
///Can't talk. Value goes down every life proc. NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
|
||||
var/silent = 0
|
||||
///How many dream images we have left to send
|
||||
var/dreaming = 0
|
||||
|
||||
var/obj/item/handcuffed = null///Whether or not the mob is handcuffed
|
||||
var/obj/item/legcuffed = null ///Same as handcuffs but for legs. Bear traps use this.
|
||||
///Whether or not the mob is handcuffed
|
||||
var/obj/item/handcuffed = null
|
||||
///Same as handcuffs but for legs. Bear traps use this.
|
||||
var/obj/item/legcuffed = null
|
||||
|
||||
var/disgust = 0
|
||||
|
||||
@@ -27,15 +33,22 @@
|
||||
var/obj/item/tank/internal = null
|
||||
var/obj/item/clothing/head = null
|
||||
|
||||
var/obj/item/clothing/gloves = null ///only used by humans
|
||||
var/obj/item/clothing/shoes/shoes = null ///only used by humans.
|
||||
var/obj/item/clothing/glasses/glasses = null ///only used by humans.
|
||||
var/obj/item/clothing/ears = null ///only used by humans.
|
||||
///only used by humans
|
||||
var/obj/item/clothing/gloves = null
|
||||
///only used by humans.
|
||||
var/obj/item/clothing/shoes/shoes = null
|
||||
///only used by humans.
|
||||
var/obj/item/clothing/glasses/glasses = null
|
||||
///only used by humans.
|
||||
var/obj/item/clothing/ears = null
|
||||
|
||||
var/datum/dna/dna = null /// Carbon
|
||||
var/datum/mind/last_mind = null ///last mind to control this mob, for blood-based cloning
|
||||
/// Carbon
|
||||
var/datum/dna/dna = null
|
||||
///last mind to control this mob, for blood-based cloning
|
||||
var/datum/mind/last_mind = null
|
||||
|
||||
var/failed_last_breath = 0 ///This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
|
||||
///This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
|
||||
var/failed_last_breath = FALSE
|
||||
|
||||
var/co2overloadtime = null
|
||||
var/temperature_resistance = T0C+75
|
||||
@@ -45,7 +58,8 @@
|
||||
|
||||
var/rotate_on_lying = 1
|
||||
|
||||
var/tinttotal = 0 /// Total level of visualy impairing items
|
||||
/// Total level of visualy impairing items
|
||||
var/tinttotal = 0
|
||||
|
||||
///Gets filled up in [create_bodyparts()][/mob/living/carbon/proc/create_bodyparts]
|
||||
var/list/bodyparts = list(
|
||||
@@ -57,7 +71,8 @@
|
||||
/obj/item/bodypart/l_leg,
|
||||
)
|
||||
|
||||
var/list/hand_bodyparts = list() ///a collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
|
||||
/// A collection of arms (or actually whatever the fug /bodyparts you monsters use to wreck my systems)
|
||||
var/list/hand_bodyparts = list()
|
||||
|
||||
var/icon_render_key = ""
|
||||
var/static/list/limb_icon_cache = list()
|
||||
@@ -70,8 +85,10 @@
|
||||
var/next_hallucination = 0
|
||||
var/damageoverlaytemp = 0
|
||||
|
||||
var/drunkenness = 0 ///Overall drunkenness
|
||||
var/stam_regen_start_time = 0 ///used to halt stamina regen temporarily
|
||||
///Overall drunkenness
|
||||
var/drunkenness = 0
|
||||
///used to halt stamina regen temporarily
|
||||
var/stam_regen_start_time = 0
|
||||
|
||||
/// Protection (insulation) from the heat, Value 0-1 corresponding to the percentage of protection
|
||||
var/heat_protection = 0 // No heat protection
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
else if(!HAS_TRAIT(src, TRAIT_NOCRITDAMAGE))
|
||||
adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS)
|
||||
|
||||
failed_last_breath = 1
|
||||
failed_last_breath = TRUE
|
||||
|
||||
var/datum/species/S = dna.species
|
||||
|
||||
|
||||
@@ -136,8 +136,12 @@
|
||||
//Third link in a breath chain, calls handle_breath_temperature()
|
||||
/mob/living/carbon/proc/check_breath(datum/gas_mixture/breath)
|
||||
if(status_flags & GODMODE)
|
||||
failed_last_breath = FALSE
|
||||
clear_alert("not_enough_oxy")
|
||||
return FALSE
|
||||
if(HAS_TRAIT(src, TRAIT_NOBREATH))
|
||||
failed_last_breath = FALSE
|
||||
clear_alert("not_enough_oxy")
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/lungs = getorganslot(ORGAN_SLOT_LUNGS)
|
||||
@@ -150,7 +154,7 @@
|
||||
return FALSE
|
||||
adjustOxyLoss(1)
|
||||
|
||||
failed_last_breath = 1
|
||||
failed_last_breath = TRUE
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
return FALSE
|
||||
|
||||
@@ -176,15 +180,15 @@
|
||||
if(O2_partialpressure > 0)
|
||||
var/ratio = 1 - O2_partialpressure/safe_oxy_min
|
||||
adjustOxyLoss(min(5*ratio, 3))
|
||||
failed_last_breath = 1
|
||||
failed_last_breath = TRUE
|
||||
oxygen_used = breath_gases[/datum/gas/oxygen][MOLES]*ratio
|
||||
else
|
||||
adjustOxyLoss(3)
|
||||
failed_last_breath = 1
|
||||
failed_last_breath = TRUE
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
|
||||
else //Enough oxygen
|
||||
failed_last_breath = 0
|
||||
failed_last_breath = FALSE
|
||||
if(health >= crit_threshold)
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath_gases[/datum/gas/oxygen][MOLES]
|
||||
|
||||
Reference in New Issue
Block a user