Replace explicit z-level checks with defines (#33829)

* Replace explicit z-level checks with defines

* Rename turf_z_is_planet for consistency

* Use TRUE/FALSE in onSyndieBase
This commit is contained in:
Tad Hardesty
2017-12-29 11:40:06 -08:00
committed by ShizCalev
parent 555f2ce006
commit f2dbe5cf13
96 changed files with 174 additions and 165 deletions
+1 -1
View File
@@ -408,7 +408,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
@@ -761,9 +761,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
@@ -476,7 +476,7 @@ mob/living/simple_animal/hostile/proc/DestroySurroundings() // for use with mega
toggle_ai(AI_Z_OFF)
return
if (isturf(T) && !(T.z in GLOB.station_z_levels))
if (isturf(T) && !is_station_level(T.z))
tlist = ListTargetsLazy(T.z)
else
tlist = ListTargets()
@@ -114,7 +114,7 @@ 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>")
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
if(guidance)
adjustHealth(-L.maxHealth)
else
@@ -163,7 +163,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
@@ -101,7 +101,7 @@
visible_message(
"<span class='danger'>[src] devours [L]!</span>",
"<span class='userdanger'>You feast on [L], restoring your health!</span>")
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
adjustBruteLoss(-L.maxHealth/2)
L.gib()