Replace all direct setting of mob.stat with mob.set_stat()

This commit is contained in:
Leshana
2020-03-20 23:45:29 -04:00
parent 252acb5011
commit 767e6227f5
33 changed files with 49 additions and 49 deletions
+1 -1
View File
@@ -146,7 +146,7 @@
living_mob_list += H
H.timeofdeath = 0
H.stat = UNCONSCIOUS
H.set_stat(UNCONSCIOUS)
H.failed_last_breath = 0
H.reload_fullscreen()
+1 -1
View File
@@ -12,7 +12,7 @@
spawn(75)
if(!host.ckey && !host.client)
host.death() // This seems redundant, but a lot of mobs don't
host.stat = DEAD // handle death() properly. Better safe than etc.
host.set_stat(DEAD) // handle death() properly. Better safe than etc.
host.visible_message("<span class='danger'>[host] is malformed and unable to survive. It expires pitifully, leaving behind some seeds.</span>")
var/total_yield = rand(1,3)
+1 -1
View File
@@ -33,7 +33,7 @@
/obj/effect/landmark/mobcorpse/proc/createCorpse() //Creates a mob and checks for gear in each slot before attempting to equip it.
var/mob/living/carbon/human/M = new /mob/living/carbon/human (src.loc)
M.real_name = src.name
M.stat = 2 //Kills the new mob
M.set_stat(DEAD) //Kills the new mob
if(src.corpseuniform)
M.equip_to_slot_or_del(new src.corpseuniform(M), slot_w_uniform)
if(src.corpsesuit)
+1 -1
View File
@@ -76,7 +76,7 @@
if(!gibbed && deathmessage != "no message") // This is gross, but reliable. Only brains use it.
src.visible_message("<b>\The [src.name]</b> [deathmessage]")
stat = DEAD
set_stat(DEAD)
update_canmove()
+1 -1
View File
@@ -79,7 +79,7 @@
/mob/living/bot/updatehealth()
if(status_flags & GODMODE)
health = getMaxHealth()
stat = CONSCIOUS
set_stat(CONSCIOUS)
else
health = getMaxHealth() - getFireLoss() - getBruteLoss()
oxyloss = 0
+3 -3
View File
@@ -51,7 +51,7 @@
if(paralysis && paralysis > 0)
blinded = 1
stat = UNCONSCIOUS
set_stat(UNCONSCIOUS)
if(halloss > 0)
adjustHalLoss(-3)
@@ -61,13 +61,13 @@
if(mind.active && client != null)
sleeping = max(sleeping-1, 0)
blinded = 1
stat = UNCONSCIOUS
set_stat(UNCONSCIOUS)
else if(resting)
if(halloss > 0)
adjustHalLoss(-3)
else
stat = CONSCIOUS
set_stat(CONSCIOUS)
if(halloss > 0)
adjustHalLoss(-1)
+3 -3
View File
@@ -64,7 +64,7 @@
B.brainmob = null
brainmob.loc = src
brainmob.container = src
brainmob.stat = 0
brainmob.set_stat(CONSCIOUS)
dead_mob_list -= brainmob//Update dem lists
living_mob_list += brainmob
@@ -185,7 +185,7 @@
src.brainmob.add_language(LANGUAGE_EAL)
src.brainmob.loc = src
src.brainmob.container = src
src.brainmob.stat = 0
src.brainmob.set_stat(CONSCIOUS)
src.brainmob.silent = 0
radio = new(src)
dead_mob_list -= src.brainmob
@@ -230,7 +230,7 @@
/obj/item/device/mmi/digital/transfer_identity(var/mob/living/carbon/H)
brainmob.dna = H.dna
brainmob.timeofhostdeath = H.timeofdeath
brainmob.stat = 0
brainmob.set_stat(CONSCIOUS)
if(H.mind)
H.mind.transfer_to(brainmob)
return
@@ -4,7 +4,7 @@
if(status_flags & GODMODE)
health = getMaxHealth()
stat = CONSCIOUS
set_stat(CONSCIOUS)
return
var/total_burn = 0
@@ -102,18 +102,18 @@
else
if (src.paralysis || src.stunned || src.weakened || (status_flags & FAKEDEATH)) //Stunned etc.
if (src.stunned > 0)
src.stat = 0
src.set_stat(CONSCIOUS)
if (src.weakened > 0)
src.lying = 0
src.stat = 0
src.set_stat(CONSCIOUS)
if (src.paralysis > 0)
src.blinded = 0
src.lying = 0
src.stat = 0
src.set_stat(CONSCIOUS)
else
src.lying = 0
src.stat = 0
src.set_stat(CONSCIOUS)
if (src.stuttering) src.stuttering = 0
+3 -3
View File
@@ -98,11 +98,11 @@
updatehealth()
if(stat != DEAD)
if(paralysis)
stat = UNCONSCIOUS
set_stat(UNCONSCIOUS)
else if (status_flags & FAKEDEATH)
stat = UNCONSCIOUS
set_stat(UNCONSCIOUS)
else
stat = CONSCIOUS
set_stat(CONSCIOUS)
return 1
/mob/living/proc/handle_statuses()
+2 -2
View File
@@ -207,7 +207,7 @@ default behaviour is:
/mob/living/proc/updatehealth()
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
set_stat(CONSCIOUS)
else
health = getMaxHealth() - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss() - getCloneLoss() - halloss
@@ -702,7 +702,7 @@ default behaviour is:
timeofdeath = 0
// restore us to conciousness
stat = CONSCIOUS
set_stat(CONSCIOUS)
// make the icons look correct
regenerate_icons()
+1 -1
View File
@@ -169,7 +169,7 @@
/mob/living/silicon/ai/updatehealth()
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
set_stat(CONSCIOUS)
setOxyLoss(0)
else
health = 100 - getFireLoss() - getBruteLoss() // Oxyloss is not part of health as it represents AIs backup power. AI is immune against ToxLoss as it is machine.
@@ -10,6 +10,6 @@
/mob/living/silicon/decoy/updatehealth()
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
set_stat(CONSCIOUS)
else
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
+1 -1
View File
@@ -30,6 +30,6 @@
/mob/living/silicon/pai/updatehealth()
if(status_flags & GODMODE)
health = 100
stat = CONSCIOUS
set_stat(CONSCIOUS)
else
health = 100 - getBruteLoss() - getFireLoss()
@@ -257,7 +257,7 @@ var/list/mob_hat_cache = list()
/mob/living/silicon/robot/drone/updatehealth()
if(status_flags & GODMODE)
health = maxHealth
stat = CONSCIOUS
set_stat(CONSCIOUS)
return
health = maxHealth - (getBruteLoss() + getFireLoss())
return
@@ -88,7 +88,7 @@
if (src.stat != 2) //Alive.
if (src.paralysis || src.stunned || src.weakened || !src.has_power) //Stunned etc.
src.stat = 1
src.set_stat(UNCONSCIOUS)
if (src.stunned > 0)
AdjustStunned(-1)
if (src.weakened > 0)
@@ -100,7 +100,7 @@
src.blinded = 0
else //Not stunned.
src.stat = 0
src.set_stat(CONSCIOUS)
AdjustConfused(-1)
@@ -1,7 +1,7 @@
/mob/living/silicon/robot/updatehealth()
if(status_flags & GODMODE)
health = getMaxHealth()
stat = CONSCIOUS
set_stat(CONSCIOUS)
return
health = getMaxHealth() - (getBruteLoss() + getFireLoss())
return
@@ -76,7 +76,7 @@
/mob/living/simple_mob/animal/passive/mouse/proc/splat()
src.health = 0
src.stat = DEAD
src.set_stat(DEAD)
src.icon_dead = "mouse_[body_color]_splat"
src.icon_state = "mouse_[body_color]_splat"
layer = MOB_LAYER
+2 -2
View File
@@ -14,7 +14,7 @@
..()
// This is very ghetto way of rebooting an IPC. TODO better way.
if(owner && owner.stat == DEAD)
owner.stat = 0
owner.set_stat(CONSCIOUS)
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
/obj/item/organ/internal/cell/emp_act(severity)
@@ -68,7 +68,7 @@
stored_mmi.brainmob.languages = owner.languages
if(owner && owner.stat == DEAD)
owner.stat = 0
owner.set_stat(CONSCIOUS)
dead_mob_list -= owner
living_mob_list |= owner
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
+1 -1
View File
@@ -53,7 +53,7 @@
newspecies = prosfab.species
var/mob/living/carbon/human/H = new(newloc,newspecies)
H.stat = DEAD
H.set_stat(DEAD)
H.gender = gender
for(var/obj/item/organ/external/EO in H.organs)
if(EO.organ_tag == BP_TORSO || EO.organ_tag == BP_GROIN)
+1 -1
View File
@@ -93,7 +93,7 @@ Also includes Life and New
traitdat.source = name
if(!health)
stat = DEAD
set_stat(DEAD)
/mob/living/simple_animal/xeno/bullet_act(var/obj/item/projectile/Proj)
if(istype(Proj, /obj/item/projectile/beam/stun/xeno))