mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-15 09:03:23 +01:00
Changes even more uses of stat comparisons to use the defines (#26154)
* First wave
* Second wave
* Last wave
* Apply suggestions from code review
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* We love signals in this household
* Revert "We love signals in this household"
This reverts commit 75fe8d46a3.
* Update code/game/machinery/camera/tracking.dm
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
* Update code/game/machinery/camera/tracking.dm
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
---------
Signed-off-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
|
||||
/mob/living/carbon/update_stamina()
|
||||
var/stam = getStaminaLoss()
|
||||
if(stam > DAMAGE_PRECISION && (maxHealth - stam) <= HEALTH_THRESHOLD_CRIT && !stat)
|
||||
if(stam > DAMAGE_PRECISION && (maxHealth - stam) <= HEALTH_THRESHOLD_CRIT && stat == CONSCIOUS)
|
||||
enter_stamcrit()
|
||||
else if(stam_paralyzed)
|
||||
SEND_SIGNAL(src, COMSIG_CARBON_EXIT_STAMINACRIT)
|
||||
|
||||
@@ -531,7 +531,7 @@ emp_act
|
||||
if(get_dist(H, src) <= 1) //people with TK won't get smeared with blood
|
||||
H.add_mob_blood(src)
|
||||
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
switch(hit_area)
|
||||
if("head")//Harder to score a stun but if you do it lasts a bit longer
|
||||
if(stat == CONSCIOUS && armor < 50)
|
||||
|
||||
@@ -691,7 +691,7 @@
|
||||
|
||||
/mob/living/carbon/human/handle_random_events()
|
||||
// Puke if toxloss is too high
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
if(getToxLoss() >= 45 && nutrition > 20)
|
||||
lastpuke ++
|
||||
if(lastpuke >= 25) // about 25 second delay I guess
|
||||
@@ -764,7 +764,7 @@
|
||||
if(reagents.has_reagent("formaldehyde")) //embalming fluid stops decay
|
||||
return
|
||||
|
||||
if(decaytime <= 8 MINUTES)
|
||||
if(decaytime <= 8 MINUTES)
|
||||
return
|
||||
|
||||
if(decaytime > 8 MINUTES)
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
var/maxHealth = 100 //Maximum health that should be possible.
|
||||
var/health = 100 //A mob's health
|
||||
|
||||
|
||||
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
|
||||
var/bruteloss = 0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
|
||||
var/oxyloss = 0 //Oxygen depravation damage (no air in lungs)
|
||||
|
||||
@@ -807,7 +807,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
set category = "AI Commands"
|
||||
set name = "Access Robot Control"
|
||||
set desc = "Wirelessly control various automatic robots."
|
||||
if(stat == 2)
|
||||
if(stat == DEAD)
|
||||
to_chat(src, "<span class='danger'>Critical error. System offline.</span>")
|
||||
return
|
||||
|
||||
@@ -905,7 +905,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
if(check_unable())
|
||||
return
|
||||
|
||||
if(usr.stat == 2)
|
||||
if(usr.stat == DEAD)
|
||||
to_chat(usr, "You can't change your camera network because you are dead!")
|
||||
return
|
||||
|
||||
@@ -945,7 +945,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
|
||||
set category = "AI Commands"
|
||||
set name = "AI Status"
|
||||
|
||||
if(usr.stat == 2)
|
||||
if(usr.stat == DEAD)
|
||||
to_chat(usr, "You cannot change your emotional status because you are dead!")
|
||||
return
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
set category = "AI Commands"
|
||||
set name = "Toggle Camera Acceleration"
|
||||
|
||||
if(usr.stat == 2)
|
||||
if(usr.stat == DEAD)
|
||||
return //won't work if dead
|
||||
acceleration = !acceleration
|
||||
to_chat(usr, "Camera acceleration has been toggled [acceleration ? "on" : "off"].")
|
||||
|
||||
@@ -277,7 +277,7 @@
|
||||
playsound(loc, 'sound/machines/buzz-two.ogg', 50, FALSE)
|
||||
last_warning = world.time
|
||||
return
|
||||
if(H.stat == 2)
|
||||
if(H.stat == DEAD)
|
||||
return
|
||||
|
||||
if((H == oldpatient) && (world.time < last_found + 200))
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
collar_type = "[initial(collar_type)]_sit"
|
||||
|
||||
/mob/living/simple_animal/pet/cat/handle_automated_action()
|
||||
if(!stat && !buckled)
|
||||
if(stat == CONSCIOUS && !buckled)
|
||||
if(prob(1))
|
||||
custom_emote(EMOTE_VISIBLE, pick("stretches out for a belly rub.", "wags its tail.", "lies down."))
|
||||
lay_down()
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
/mob/living/simple_animal/crab/handle_automated_movement()
|
||||
//CRAB movement
|
||||
if(!stat || !isturf(loc) || IS_HORIZONTAL(src) || buckled)
|
||||
if(stat == CONSCIOUS || !isturf(loc) || IS_HORIZONTAL(src) || buckled)
|
||||
return
|
||||
|
||||
turns_since_move++
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/Move()
|
||||
. = ..()
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
eat_plants()
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/goat/attackby(obj/item/O as obj, mob/user as mob, params)
|
||||
@@ -159,12 +159,12 @@
|
||||
udder.generateMilk()
|
||||
|
||||
/mob/living/simple_animal/cow/attack_hand(mob/living/carbon/M as mob)
|
||||
if(!stat && M.a_intent == INTENT_DISARM && icon_state != icon_dead)
|
||||
if(stat == CONSCIOUS && M.a_intent == INTENT_DISARM && icon_state != icon_dead)
|
||||
M.visible_message("<span class='warning'>[M] tips over [src].</span>","<span class='notice'>You tip over [src].</span>")
|
||||
Weaken(60 SECONDS)
|
||||
icon_state = icon_dead
|
||||
spawn(rand(20,50))
|
||||
if(!stat && M)
|
||||
if(stat == CONSCIOUS && M)
|
||||
icon_state = icon_living
|
||||
var/list/responses = list( "[src] looks at you imploringly.",
|
||||
"[src] looks at you pleadingly",
|
||||
@@ -312,7 +312,7 @@ GLOBAL_VAR_INIT(chicken_count, 0)
|
||||
|
||||
/mob/living/simple_animal/chicken/attackby(obj/item/O, mob/user, params)
|
||||
if(istype(O, food_type)) //feedin' dem chickens
|
||||
if(!stat && eggsleft < 8)
|
||||
if(stat == CONSCIOUS && eggsleft < 8)
|
||||
var/feedmsg = "[user] feeds [O] to [name]! [pick(feedMessages)]"
|
||||
user.visible_message(feedmsg)
|
||||
user.drop_item()
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
var/has_tail = TRUE
|
||||
|
||||
/mob/living/simple_animal/lizard/handle_automated_action()
|
||||
if(!stat && !buckled)
|
||||
if(stat == CONSCIOUS && !buckled)
|
||||
if(prob(1))
|
||||
custom_emote(EMOTE_VISIBLE, pick("sticks out its tongue.", "wags its tail.", "lies down."))
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
/mob/living/simple_animal/mouse/Crossed(AM as mob|obj, oldloc)
|
||||
if(ishuman(AM))
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
var/mob/M = AM
|
||||
to_chat(M, "<span class='notice'>[bicon(src)] Squeek!</span>")
|
||||
..()
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/adjustHealth(damage, updating_health = TRUE)
|
||||
. = ..()
|
||||
if(!ckey && !stat && search_objects < 3 && damage > 0)//Not unconscious, and we don't ignore mobs
|
||||
if(!ckey && stat == CONSCIOUS && search_objects < 3 && damage > 0)//Not unconscious, and we don't ignore mobs
|
||||
if(search_objects)//Turn off item searching and ignore whatever item we were looking at, we're more concerned with fight or flight
|
||||
target = null
|
||||
LoseSearchObjects()
|
||||
|
||||
@@ -329,7 +329,7 @@ Difficulty: Very Hard
|
||||
INVOKE_ASYNC(src, TYPE_PROC_REF(/atom/movable, orbit), target, 0, FALSE, 0, 0, FALSE, TRUE)
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/colossus/bullet_act(obj/item/projectile/P)
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
var/obj/effect/temp_visual/at_shield/AT = new /obj/effect/temp_visual/at_shield(loc, src)
|
||||
var/random_x = rand(-32, 32)
|
||||
AT.pixel_x += random_x
|
||||
|
||||
@@ -529,7 +529,7 @@ Difficulty: Hard
|
||||
|
||||
/mob/living/simple_animal/hostile/megafauna/hierophant/Moved(oldLoc, movement_dir)
|
||||
. = ..()
|
||||
if(!stat && .)
|
||||
if(stat == CONSCIOUS && .)
|
||||
var/obj/effect/temp_visual/hierophant/squares/HS = new(oldLoc)
|
||||
HS.setDir(movement_dir)
|
||||
playsound(src, 'sound/mecha/mechmove04.ogg', 65, TRUE, -4)
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
visible_message("<span class='notice'>The ore was swallowed whole!</span>")
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/goldgrub/proc/Burrow()//Begin the chase to kill the goldgrub in time
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
visible_message("<span class='danger'>[src] buries into the ground, vanishing from sight!</span>")
|
||||
qdel(src)
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
icon_state = icon_living
|
||||
|
||||
/mob/living/simple_animal/hostile/asteroid/bullet_act(obj/item/projectile/P)//Reduces damage from most projectiles to curb off-screen kills
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
Aggro()
|
||||
if(P.damage < 30 && P.damage_type != BRUTE && has_laser_resist)
|
||||
P.damage = (P.damage / 3)
|
||||
@@ -46,7 +46,7 @@
|
||||
/mob/living/simple_animal/hostile/asteroid/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum) //No floor tiling them to death, wiseguy
|
||||
if(isitem(AM))
|
||||
var/obj/item/T = AM
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
Aggro()
|
||||
if(T.throwforce <= 20)
|
||||
visible_message("<span class='notice'>[T] [throw_message] [src.name]!</span>")
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/mushroom/Life(seconds, times_fired)
|
||||
..()
|
||||
if(!stat)//Mushrooms slowly regenerate if conscious, for people who want to save them from being eaten
|
||||
if(stat == CONSCIOUS)//Mushrooms slowly regenerate if conscious, for people who want to save them from being eaten
|
||||
adjustBruteLoss(-2)
|
||||
|
||||
/mob/living/simple_animal/hostile/mushroom/Initialize(mapload) //Makes every shroom a little unique
|
||||
@@ -147,7 +147,7 @@
|
||||
adjustBruteLoss(-maxHealth) //They'll always heal, even if they don't gain a level, in case you want to keep this shroom around instead of harvesting it
|
||||
|
||||
/mob/living/simple_animal/hostile/mushroom/proc/Bruise()
|
||||
if(!bruised && !stat)
|
||||
if(!bruised && stat == CONSCIOUS)
|
||||
src.visible_message("<span class='notice'>[src] was bruised!</span>")
|
||||
bruised = 1
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/queen/princess/spider_special_action()
|
||||
// Princess AI routine. GREATLY simplified version of queen routine.
|
||||
if(!stat && !ckey)
|
||||
if(stat == CONSCIOUS && !ckey)
|
||||
// Utilize normal queen AI for finding a nest site (neststep=0), and activating NestMode() (neststep=1)
|
||||
if(neststep != 2)
|
||||
return ..()
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
|
||||
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/queen/spider_special_action()
|
||||
if(!stat && !ckey)
|
||||
if(stat == CONSCIOUS && !ckey)
|
||||
switch(neststep)
|
||||
if(0)
|
||||
// No nest. If current location is eligible for nesting, advance to step 1.
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
/mob/living/simple_animal/hostile/poison/terror_spider/LoseTarget()
|
||||
if(target && isliving(target))
|
||||
var/mob/living/T = target
|
||||
if(T.stat > 0)
|
||||
if(T.stat != CONSCIOUS)
|
||||
killcount++
|
||||
regen_points += regen_points_per_kill
|
||||
attackstep = 0
|
||||
|
||||
@@ -139,7 +139,7 @@
|
||||
if(client)
|
||||
return
|
||||
|
||||
if(!stat && M.a_intent == "harm")
|
||||
if(stat == CONSCIOUS && M.a_intent == "harm")
|
||||
icon_state = "parrot_fly" //It is going to be flying regardless of whether it flees or attacks
|
||||
|
||||
if(parrot_state == PARROT_PERCH)
|
||||
@@ -161,7 +161,7 @@
|
||||
//Mobs with objects
|
||||
/mob/living/simple_animal/parrot/attackby(obj/item/O, mob/user, params)
|
||||
..()
|
||||
if(!stat && !client && !istype(O, /obj/item/stack/medical))
|
||||
if(stat == CONSCIOUS && !client && !istype(O, /obj/item/stack/medical))
|
||||
if(O.force)
|
||||
if(parrot_state == PARROT_PERCH)
|
||||
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
|
||||
@@ -175,7 +175,7 @@
|
||||
//Bullets
|
||||
/mob/living/simple_animal/parrot/bullet_act(obj/item/projectile/P)
|
||||
..()
|
||||
if(!stat && !client)
|
||||
if(stat == CONSCIOUS && !client)
|
||||
if(parrot_state == PARROT_PERCH)
|
||||
parrot_sleep_dur = parrot_sleep_max //Reset it's sleep timer if it was perched
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
/mob/living/simple_animal/parrot/grabbedby(mob/living/carbon/user, supress_message)
|
||||
..()
|
||||
|
||||
if(held_item && !stat)
|
||||
if(held_item && stat == CONSCIOUS)
|
||||
drop_held_item()
|
||||
|
||||
/*
|
||||
|
||||
@@ -622,7 +622,7 @@
|
||||
|
||||
/mob/living/simple_animal/adjustHealth(amount, updating_health = TRUE)
|
||||
. = ..()
|
||||
if(!ckey && !stat)//Not unconscious
|
||||
if(!ckey && stat == CONSCIOUS)//Not unconscious
|
||||
if(AIStatus == AI_IDLE)
|
||||
toggle_ai(AI_ON)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
if(..())
|
||||
if(buckled)
|
||||
handle_feeding()
|
||||
if(!stat) // Slimes in stasis don't lose nutrition, don't change mood and don't respond to speech
|
||||
if(stat == CONSCIOUS) // Slimes in stasis don't lose nutrition, don't change mood and don't respond to speech
|
||||
handle_nutrition()
|
||||
if(QDELETED(src)) // Stop if the slime split during handle_nutrition()
|
||||
return
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
/mob/living/simple_animal/slime/handle_status_effects()
|
||||
..()
|
||||
if(prob(30) && !stat)
|
||||
if(prob(30) && stat == CONSCIOUS)
|
||||
adjustBruteLoss(-1)
|
||||
|
||||
/mob/living/simple_animal/slime/proc/handle_feeding()
|
||||
@@ -436,7 +436,7 @@
|
||||
phrases += "What happened?"
|
||||
if(!slimes_near)
|
||||
phrases += "Lonely..."
|
||||
if(!stat)
|
||||
if(stat == CONSCIOUS)
|
||||
say (pick(phrases))
|
||||
|
||||
/mob/living/simple_animal/slime/proc/get_max_nutrition() // Can't go above it
|
||||
|
||||
@@ -133,7 +133,7 @@
|
||||
icon_dead = "[icon_text] dead"
|
||||
if(stat != DEAD)
|
||||
icon_state = icon_text
|
||||
if(mood && !stat)
|
||||
if(mood && stat == CONSCIOUS)
|
||||
add_overlay("aslime-[mood]")
|
||||
else
|
||||
icon_state = icon_dead
|
||||
@@ -357,7 +357,7 @@
|
||||
for(var/datum/surgery/S in surgeries)
|
||||
if(S.next_step(user, src))
|
||||
return 1
|
||||
if(istype(I, /obj/item/stack/sheet/mineral/plasma) && !stat) //Let's you feed slimes plasma.
|
||||
if(istype(I, /obj/item/stack/sheet/mineral/plasma) && stat == CONSCIOUS) //Let's you feed slimes plasma.
|
||||
to_chat(user, "<span class='notice'>You feed the slime the plasma. It chirps happily.</span>")
|
||||
var/obj/item/stack/sheet/mineral/plasma/S = I
|
||||
S.use(1)
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
var/datum/mind/mind
|
||||
blocks_emissive = EMISSIVE_BLOCK_GENERIC
|
||||
|
||||
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
|
||||
/// Is this mob alive, unconscious or dead?
|
||||
var/stat = CONSCIOUS // TODO: Move to /mob/living
|
||||
|
||||
/// The zone this mob is currently targeting
|
||||
var/zone_selected = null
|
||||
|
||||
Reference in New Issue
Block a user