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 23:26:37 +02:00
committed by GitHub
parent cb49d3301b
commit ca366c3ea1
355 changed files with 1549 additions and 1591 deletions

View File

@@ -15,7 +15,7 @@
ammo_type = /obj/item/ammo_casing/a357
caliber = "357"
max_ammo = 6
multiload = 0
multiload = FALSE
/obj/item/ammo_box/magazine/internal/rus357/Initialize()
stored_ammo += new ammo_type(src)

View File

@@ -4,7 +4,7 @@
ammo_type = /obj/item/ammo_casing/a762
caliber = "a762"
max_ammo = 5
multiload = 1
multiload = TRUE
/obj/item/ammo_box/magazine/internal/boltaction/enchanted
max_ammo = 1

View File

@@ -3,7 +3,7 @@
ammo_type = /obj/item/ammo_casing/shotgun/beanbag
caliber = "shotgun"
max_ammo = 4
multiload = 0
multiload = FALSE
/obj/item/ammo_box/magazine/internal/shot/tube
name = "dual feed shotgun internal tube"
@@ -17,7 +17,7 @@
name = "combat shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
max_ammo = 6
/obj/item/ammo_box/magazine/internal/shot/dual
name = "double-barrel shotgun internal magazine"
max_ammo = 2

View File

@@ -12,7 +12,7 @@
slot_flags = ITEM_SLOT_BACK
w_class = WEIGHT_CLASS_HUGE
var/obj/item/gun/ballistic/minigun/gun
var/armed = 0 //whether the gun is attached, 0 is attached, 1 is the gun is wielded.
var/armed = FALSE //whether the gun is attached, FALSE is attached, TRUE is the gun is wielded.
var/overheat = 0
var/overheat_max = 40
var/heat_diffusion = 1
@@ -34,9 +34,9 @@
if(src.loc == user)
if(!armed)
if(user.get_item_by_slot(ITEM_SLOT_BACK) == src)
armed = 1
armed = TRUE
if(!user.put_in_hands(gun))
armed = 0
armed = FALSE
to_chat(user, "<span class='warning'>You need a free hand to hold the gun!</span>")
return
update_icon()
@@ -84,7 +84,7 @@
if(!gun)
gun = new(src)
gun.forceMove(src)
armed = 0
armed = FALSE
if(user)
to_chat(user, "<span class='notice'>You attach the [gun.name] to the [name].</span>")
else
@@ -127,7 +127,7 @@
return
/obj/item/gun/ballistic/minigun/dropped(mob/user)
SHOULD_CALL_PARENT(0)
SHOULD_CALL_PARENT(FALSE)
if(ammo_pack)
ammo_pack.attach_gun(user)
else

View File

@@ -87,7 +87,7 @@
icon_state = "flatgun"
/obj/item/gun/ballistic/automatic/pistol/stickman/pickup(mob/living/user)
SHOULD_CALL_PARENT(0)
SHOULD_CALL_PARENT(FALSE)
to_chat(user, "<span class='notice'>As you try to pick up [src], it slips out of your grip..</span>")
if(prob(50))
to_chat(user, "<span class='notice'>..and vanishes from your vision! Where the hell did it go?</span>")

View File

@@ -91,7 +91,7 @@
"The Peacemaker" = "detective_peacemaker",
"Black Panther" = "detective_panther"
)
/// Used to avoid some redundancy on a revolver loaded with 357 regarding misfiring while being wrenched.
var/skip_357_missfire_check = FALSE
@@ -250,7 +250,7 @@
user.visible_message("<span class='danger'>[user.name]'s soul is captured by \the [src]!</span>", "<span class='userdanger'>You've lost the gamble! Your soul is forfeit!</span>")
/obj/item/gun/ballistic/revolver/reverse //Fires directly at its user... unless the user is a clown, of course.
clumsy_check = 0
clumsy_check = FALSE
/obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) || (user.mind && user.mind.assigned_role == "Clown"))

View File

@@ -227,7 +227,7 @@
. = ..()
if(. && slung) //sawing off the gun removes the sling
new /obj/item/stack/cable_coil(get_turf(src), 10)
slung = 0
slung = FALSE
update_icon()
lefthand_file = 'icons/mob/inhands/weapons/64x_guns_left.dmi'
righthand_file = 'icons/mob/inhands/weapons/64x_guns_right.dmi'

View File

@@ -10,7 +10,7 @@
throwforce = 0
burst_size = 3
can_suppress = TRUE
clumsy_check = 0
clumsy_check = FALSE
item_flags = NONE
casing_ejector = FALSE

View File

@@ -13,7 +13,7 @@
name = "practice laser gun"
desc = "A modified version of the basic laser gun, this one fires less concentrated energy bolts designed for target practice."
ammo_type = list(/obj/item/ammo_casing/energy/laser/practice)
clumsy_check = 0
clumsy_check = FALSE
item_flags = NONE
/obj/item/gun/energy/laser/retro

View File

@@ -10,7 +10,7 @@
var/last_check = 0
var/check_delay = 10 //Check los as often as possible, max resolution is SSobj tick though
var/max_range = 8
var/active = 0
var/active = FALSE
var/datum/beam/current_beam = null
var/mounted = 0 //Denotes if this is a handheld or mounted version
@@ -37,7 +37,7 @@
if(active)
qdel(current_beam)
current_beam = null
active = 0
active = FALSE
on_beam_release(current_target)
current_target = null
@@ -87,7 +87,7 @@
if(mounted)
user_turf = get_turf(user)
else if(!istype(user_turf))
return 0
return FALSE
var/obj/dummy = new(user_turf)
dummy.pass_flags |= PASSTABLE|PASSGLASS|PASSGRILLE //Grille/Glass so it can be used through common windows
for(var/turf/turf in getline(user_turf,target))
@@ -95,18 +95,18 @@
continue //Mechs are dense and thus fail the check
if(turf.density)
qdel(dummy)
return 0
return FALSE
for(var/atom/movable/AM in turf)
if(!AM.CanPass(dummy,turf,1))
qdel(dummy)
return 0
return FALSE
for(var/obj/effect/ebeam/medical/B in turf)// Don't cross the str-beams!
if(B.owner.origin != current_beam.origin)
explosion(B.loc,0,3,5,8)
qdel(dummy)
return 0
return FALSE
qdel(dummy)
return 1
return TRUE
/obj/item/gun/medbeam/proc/on_beam_hit(mob/living/target)
return
@@ -128,7 +128,7 @@
//////////////////////////////Mech Version///////////////////////////////
/obj/item/gun/medbeam/mech
mounted = 1
mounted = TRUE
/obj/item/gun/medbeam/mech/Initialize()
. = ..()

View File

@@ -8,7 +8,7 @@
throw_range = 7
force = 4
custom_materials = list(/datum/material/iron=2000)
clumsy_check = 0
clumsy_check = FALSE
fire_sound = 'sound/items/syringeproj.ogg'
var/load_sound = 'sound/weapons/gun/shotgun/insert_shell.ogg'
var/list/syringes = list()
@@ -44,7 +44,7 @@
/obj/item/gun/syringe/attack_self(mob/living/user)
if(!syringes.len)
to_chat(user, "<span class='warning'>[src] is empty!</span>")
return 0
return FALSE
var/obj/item/reagent_containers/syringe/S = syringes[syringes.len]

View File

@@ -10,9 +10,9 @@
attack_verb_continuous = list("pokes")
attack_verb_simple = list("poke")
var/fail_message = "<span class='warning'>INVALID USER.</span>"
var/selfdestruct = 0 // Explode when user check is failed.
var/force_replace = 0 // Can forcefully replace other pins.
var/pin_removeable = 0 // Can be replaced by any pin.
var/selfdestruct = FALSE // Explode when user check is failed.
var/force_replace = FALSE // Can forcefully replace other pins.
var/pin_removeable = FALSE // Can be replaced by any pin.
var/obj/item/gun/gun
/obj/item/firing_pin/New(newloc)