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
+23 -23
View File
@@ -70,7 +70,7 @@
return ..()
else
last_failed_movement = direct
return 0
return FALSE
/obj/singularity/attack_hand(mob/user)
consume(user)
@@ -87,10 +87,10 @@
/obj/singularity/attackby(obj/item/W, mob/user, params)
consume(user)
return 1
return TRUE
/obj/singularity/Process_Spacemove() //The singularity stops drifting for no man!
return 0
return FALSE
/obj/singularity/blob_act(obj/structure/blob/B)
return
@@ -252,18 +252,18 @@
dissipate = 0
if(current_size == allowed_size)
investigate_log("<font color='red'>grew to size [current_size]</font>", INVESTIGATE_SINGULO)
return 1
return TRUE
else if(current_size < (--temp_allowed_size))
expand(temp_allowed_size)
else
return 0
return FALSE
/obj/singularity/proc/check_energy()
if(energy <= 0)
investigate_log("collapsed.", INVESTIGATE_SINGULO)
qdel(src)
return 0
return FALSE
switch(energy)//Some of these numbers might need to be changed up later -Mport
if(1 to 199)
allowed_size = STAGE_ONE
@@ -280,7 +280,7 @@
allowed_size = STAGE_FIVE
if(current_size != allowed_size)
expand()
return 1
return TRUE
/obj/singularity/proc/eat()
@@ -316,7 +316,7 @@
/obj/singularity/proc/move(force_move = 0)
if(!move_self)
return 0
return FALSE
var/drifting_dir = pick(GLOB.alldirs - last_failed_movement)
@@ -337,11 +337,11 @@
if(step(src, i)) //Move in each direction.
if(check_cardinals_range(steps, FALSE)) //New location passes, return true.
return TRUE
. = !.
return !.
/obj/singularity/proc/check_turfs_in(direction = 0, step = 0)
if(!direction)
return 0
return FALSE
var/steps = 0
if(!step)
switch(current_size)
@@ -362,7 +362,7 @@
for(var/i = 1 to steps)
T = get_step(T,direction)
if(!isturf(T))
return 0
return FALSE
turfs.Add(T)
var/dir2 = 0
var/dir3 = 0
@@ -377,35 +377,35 @@
for(var/j = 1 to steps-1)
T2 = get_step(T2,dir2)
if(!isturf(T2))
return 0
return FALSE
turfs.Add(T2)
for(var/k = 1 to steps-1)
T = get_step(T,dir3)
if(!isturf(T))
return 0
return FALSE
turfs.Add(T)
for(var/turf/T3 in turfs)
if(isnull(T3))
continue
if(!can_move(T3))
return 0
return 1
return FALSE
return TRUE
/obj/singularity/proc/can_move(turf/T)
if(!T)
return 0
return FALSE
if((locate(/obj/machinery/field/containment) in T)||(locate(/obj/machinery/shieldwall) in T))
return 0
return FALSE
else if(locate(/obj/machinery/field/generator) in T)
var/obj/machinery/field/generator/G = locate(/obj/machinery/field/generator) in T
if(G && G.active)
return 0
return FALSE
else if(locate(/obj/machinery/power/shieldwallgen) in T)
var/obj/machinery/power/shieldwallgen/S = locate(/obj/machinery/power/shieldwallgen) in T
if(S && S.active)
return 0
return 1
return FALSE
return TRUE
/obj/singularity/proc/event()
@@ -417,11 +417,11 @@
mezzer()
if(3,4) //Sets all nearby mobs on fire
if(current_size < STAGE_SIX)
return 0
return FALSE
combust_mobs()
else
return 0
return 1
return FALSE
return TRUE
/obj/singularity/proc/combust_mobs()