Bools and returns super-pr (#53221)

Replaces like 70-80% of 0 and such, as a side effect cleaned up a bunch of returns
Edit: Most left out ones are in mecha which should be done in mecha refactor already
Oh my look how clean it is

Co-authored-by: TiviPlus <TiviPlus>
Co-authored-by: Couls <coul422@gmail.com>
This commit is contained in:
TiviPlus
2020-08-28 14:26:37 -07:00
committed by GitHub
co-authored by TiviPlus <TiviPlus> Couls
parent cb49d3301b
commit ca366c3ea1
355 changed files with 1549 additions and 1591 deletions
@@ -162,14 +162,14 @@
/obj/effect/particle_effect/foam/proc/foam_mob(mob/living/L)
if(lifetime<1)
return 0
return FALSE
if(!istype(L))
return 0
return FALSE
var/fraction = 1/initial(reagent_divisor)
if(lifetime % reagent_divisor)
reagents.expose(L, VAPOR, fraction)
lifetime--
return 1
return TRUE
/obj/effect/particle_effect/foam/proc/spread_foam()
var/turf/t_loc = get_turf(src)
@@ -85,11 +85,11 @@
/datum/effect_system/reagents_explosion
var/amount // TNT equivalent
var/flashing = 0 // does explosion creates flash effect?
var/flashing = FALSE // does explosion creates flash effect?
var/flashing_factor = 0 // factor of how powerful the flash effect relatively to the explosion
var/explosion_message = 1 //whether we show a message to mobs.
/datum/effect_system/reagents_explosion/set_up(amt, loca, flash = 0, flash_fact = 0, message = 1)
/datum/effect_system/reagents_explosion/set_up(amt, loca, flash = FALSE, flash_fact = 0, message = TRUE)
amount = amt
explosion_message = message
if(isturf(loca))
@@ -12,7 +12,7 @@
layer = FLY_LAYER
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
animate_movement = 0
animate_movement = FALSE
var/amount = 4
var/lifetime = 5
var/opaque = 1 //whether the smoke can block the view when in enough amount
@@ -49,23 +49,23 @@
lifetime--
if(lifetime < 1)
kill_smoke()
return 0
return FALSE
for(var/mob/living/L in range(0,src))
smoke_mob(L)
return 1
return TRUE
/obj/effect/particle_effect/smoke/proc/smoke_mob(mob/living/carbon/C)
if(!istype(C))
return 0
return FALSE
if(lifetime<1)
return 0
return FALSE
if(C.internal != null || C.has_smoke_protection())
return 0
return FALSE
if(C.smoke_delay)
return 0
return FALSE
C.smoke_delay++
addtimer(CALLBACK(src, .proc/remove_smoke_delay, C), 10)
return 1
return TRUE
/obj/effect/particle_effect/smoke/proc/remove_smoke_delay(mob/living/carbon/C)
if(C)
@@ -126,11 +126,12 @@
lifetime = 8
/obj/effect/particle_effect/smoke/bad/smoke_mob(mob/living/carbon/M)
if(..())
. = ..()
if(.)
M.drop_all_held_items()
M.adjustOxyLoss(1)
M.emote("cough")
return 1
return TRUE
/obj/effect/particle_effect/smoke/bad/Crossed(atom/movable/AM, oldloc)
. = ..()
@@ -148,7 +149,7 @@
/obj/effect/particle_effect/smoke/freezing
name = "nanofrost smoke"
color = "#B2FFFF"
opaque = 0
opaque = FALSE
/datum/effect_system/smoke_spread/freezing
effect_type = /obj/effect/particle_effect/smoke/freezing
@@ -226,7 +227,8 @@
/obj/effect/particle_effect/smoke/chem/process()
if(..())
. = ..()
if(.)
var/turf/T = get_turf(src)
var/fraction = 1/initial(lifetime)
for(var/atom/movable/AM in T)
@@ -237,20 +239,20 @@
reagents.expose(AM, TOUCH, fraction)
reagents.expose(T, TOUCH, fraction)
return 1
return TRUE
/obj/effect/particle_effect/smoke/chem/smoke_mob(mob/living/carbon/M)
if(lifetime<1)
return 0
return FALSE
if(!istype(M))
return 0
return FALSE
var/mob/living/carbon/C = M
if(C.internal != null || C.has_smoke_protection())
return 0
return FALSE
var/fraction = 1/initial(lifetime)
reagents.copy_to(C, fraction*reagents.total_volume)
reagents.expose(M, INGEST, fraction)
return 1
return TRUE
@@ -14,10 +14,10 @@
/obj/effect/particle_effect/water/Move(turf/newloc)
if (--src.life < 1)
qdel(src)
return 0
return FALSE
if(newloc.density)
return 0
.=..()
return FALSE
return ..()
/obj/effect/particle_effect/water/Bump(atom/A)
if(reagents)