Replace explicit z-level checks with defines

This commit is contained in:
Tad Hardesty
2017-12-29 11:40:06 -08:00
committed by CitadelStationBot
parent 48e0c47410
commit 0418ee4df6
96 changed files with 268 additions and 145 deletions
+1 -1
View File
@@ -422,7 +422,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
if(drunkenness >= 91)
adjustBrainLoss(0.4, 60)
if(prob(20) && !stat)
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && (z in GLOB.station_z_levels)) //QoL mainly
if(SSshuttle.emergency.mode == SHUTTLE_DOCKED && is_station_level(z)) //QoL mainly
to_chat(src, "<span class='warning'>You're so tired... but you can't miss that shuttle...</span>")
else
to_chat(src, "<span class='warning'>Just a quick nap...</span>")
+2 -2
View File
@@ -774,9 +774,9 @@
var/turf/T = get_turf(src)
if(!T)
return 0
if(T.z == ZLEVEL_CENTCOM) //dont detect mobs on centcom
if(is_centcom_level(T.z)) //dont detect mobs on centcom
return 0
if(T.z >= ZLEVEL_SPACEMAX)
if(is_away_level(T.z))
return 0
if(user != null && src == user)
return 0
@@ -479,6 +479,25 @@ mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with mega
/mob/living/simple_animal/hostile/consider_wakeup()
..()
<<<<<<< HEAD
if(AIStatus == AI_IDLE && FindTarget(ListTargets(), 1))
=======
var/list/tlist
var/turf/T = get_turf(src)
if (!T)
return
if (!length(SSmobs.clients_by_zlevel[T.z])) // It's fine to use .len here but doesn't compile on 511
toggle_ai(AI_Z_OFF)
return
if (isturf(T) && !is_station_level(T.z))
tlist = ListTargetsLazy(T.z)
else
tlist = ListTargets()
if(AIStatus == AI_IDLE && FindTarget(tlist, 1))
>>>>>>> f2dbe5c... Replace explicit z-level checks with defines (#33829)
toggle_ai(AI_ON)
@@ -114,7 +114,11 @@ Difficulty: Medium
if(L.stat == DEAD)
visible_message("<span class='danger'>[src] butchers [L]!</span>",
"<span class='userdanger'>You butcher [L], restoring your health!</span>")
<<<<<<< HEAD
if(!(z in GLOB.station_z_levels && !client)) //NPC monsters won't heal while on station
=======
if(!is_station_level(z) || client) //NPC monsters won't heal while on station
>>>>>>> f2dbe5c... Replace explicit z-level checks with defines (#33829)
if(guidance)
adjustHealth(-L.maxHealth)
else
@@ -163,7 +167,7 @@ Difficulty: Medium
// do not take my touching of it to be endorsement of it. ~mso
/mob/living/simple_animal/hostile/megafauna/blood_drunk_miner/proc/quick_attack_loop()
while(!QDELETED(target) && next_move <= world.time) //this is done this way because next_move can change to be sooner while we sleep.
stoplag(1)
stoplag(1)
sleep((next_move - world.time) * 1.5) //but don't ask me what the fuck this is about
if(QDELETED(target))
return
@@ -105,7 +105,11 @@
visible_message(
"<span class='danger'>[src] devours [L]!</span>",
"<span class='userdanger'>You feast on [L], restoring your health!</span>")
<<<<<<< HEAD
if(!(z in GLOB.station_z_levels && !client)) //NPC monsters won't heal while on station
=======
if(!is_station_level(z) || client) //NPC monsters won't heal while on station
>>>>>>> f2dbe5c... Replace explicit z-level checks with defines (#33829)
adjustBruteLoss(-L.maxHealth/2)
L.gib()