mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Defining Part 4 - Code cleanup toward defines (... and the rest) (#19388)
* I wasn't done * nits
This commit is contained in:
@@ -126,7 +126,7 @@
|
||||
|
||||
/obj/structure/spider/spiderling/process()
|
||||
if(travelling_in_vent)
|
||||
if(istype(loc, /turf))
|
||||
if(isturf(loc))
|
||||
travelling_in_vent = FALSE
|
||||
entry_vent = null
|
||||
else if(entry_vent)
|
||||
@@ -217,7 +217,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/structure/spider/spiderling/decompile_act(obj/item/matter_decompiler/C, mob/user)
|
||||
if(!istype(user, /mob/living/silicon/robot/drone))
|
||||
if(!isdrone(user))
|
||||
user.visible_message("<span class='notice'>[user] sucks [src] into its decompiler. There's a horrible crunching noise.</span>", \
|
||||
"<span class='warning'>It's a bit of a struggle, but you manage to suck [user] into your decompiler. It makes a series of visceral crunching noises.</span>")
|
||||
C.stored_comms["wood"] += 2
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
* cause - The cause of the EMP. Used for the logging
|
||||
*/
|
||||
/proc/empulse(turf/epicenter, heavy_range, light_range, log = FALSE, cause = null)
|
||||
if(!epicenter) return
|
||||
|
||||
if(!istype(epicenter, /turf))
|
||||
if(!epicenter)
|
||||
return
|
||||
if(!isturf(epicenter))
|
||||
epicenter = get_turf(epicenter.loc)
|
||||
|
||||
if(log)
|
||||
|
||||
@@ -190,7 +190,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
set category = null
|
||||
set src in oview(1)
|
||||
|
||||
if(!istype(src.loc, /turf) || usr.stat || usr.restrained() )
|
||||
if(!isturf(src.loc) || usr.stat || usr.restrained() )
|
||||
return
|
||||
|
||||
var/turf/T = src.loc
|
||||
@@ -549,7 +549,7 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
|
||||
|
||||
/obj/item/proc/get_loc_turf()
|
||||
var/atom/L = loc
|
||||
while(L && !istype(L, /turf/))
|
||||
while(L && !isturf(L))
|
||||
L = L.loc
|
||||
return loc
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
update_icon(UPDATE_ICON_STATE)
|
||||
if(!wax)
|
||||
new/obj/item/trash/candle(src.loc)
|
||||
if(istype(src.loc, /mob))
|
||||
if(ismob(src.loc))
|
||||
var/mob/M = src.loc
|
||||
M.unEquip(src, 1) //src is being deleted anyway
|
||||
qdel(src)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
if(isliving(loc))
|
||||
var/mob/living/M = loc
|
||||
var/turf/T = M.loc
|
||||
if(istype(T, /turf))
|
||||
if(isturf(T))
|
||||
if(!M.moved_recently && M.last_move)
|
||||
M.moved_recently = 1
|
||||
step(M, M.last_move)
|
||||
|
||||
@@ -407,7 +407,7 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
|
||||
jobname = "Cyborg"
|
||||
|
||||
// --- Personal AI (pAI) ---
|
||||
else if(istype(M, /mob/living/silicon/pai))
|
||||
else if(ispAI(M))
|
||||
jobname = "Personal AI"
|
||||
|
||||
// --- Unidentifiable mob ---
|
||||
|
||||
@@ -343,7 +343,7 @@ REAGENT SCANNER
|
||||
return
|
||||
|
||||
var/turf/location = user.loc
|
||||
if(!( istype(location, /turf) ))
|
||||
if(!isturf(location))
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/environment = location.return_air()
|
||||
|
||||
@@ -397,7 +397,7 @@
|
||||
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/flash))
|
||||
if(istype(user,/mob/living/silicon/robot))
|
||||
if(isrobot(user))
|
||||
to_chat(user, "<span class='warning'>How do you propose to do that?</span>")
|
||||
return
|
||||
else if(flash1 && flash2)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob)
|
||||
if(!istype(M) || !istype(user))
|
||||
return 0
|
||||
if(istype(M,/mob/living/silicon/robot)) //Repairing cyborgs
|
||||
if(isrobot(M)) //Repairing cyborgs
|
||||
var/mob/living/silicon/robot/R = M
|
||||
if(R.getBruteLoss() || R.getFireLoss() )
|
||||
R.heal_overall_damage(15, 15)
|
||||
|
||||
@@ -424,7 +424,7 @@
|
||||
..()
|
||||
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)
|
||||
for(var/mob/M in range(10, src))
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai))\
|
||||
if(!M.stat && !isAI(M))\
|
||||
shake_camera(M, 3, 1)
|
||||
qdel(src)
|
||||
|
||||
@@ -833,7 +833,7 @@
|
||||
user.visible_message("<span class='warning'>[user] presses the big red button.</span>", "<span class='notice'>You press the button, it plays a loud noise!</span>", "<span class='notice'>The button clicks loudly.</span>")
|
||||
playsound(src, 'sound/effects/explosionfar.ogg', 50, 0, 0)
|
||||
for(var/mob/M in range(10, src)) // Checks range
|
||||
if(!M.stat && !istype(M, /mob/living/silicon/ai)) // Checks to make sure whoever's getting shaken is alive/not the AI
|
||||
if(!M.stat && !isAI(M)) // Checks to make sure whoever's getting shaken is alive/not the AI
|
||||
sleep(8) // Short delay to match up with the explosion sound
|
||||
shake_camera(M, 2, 1) // Shakes player camera 2 squares for 1 second.
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return null
|
||||
var/turf/location = loc
|
||||
if(istype(location, /mob/))
|
||||
if(ismob(location))
|
||||
var/mob/M = location
|
||||
if(M.l_hand == src || M.r_hand == src)
|
||||
location = M.loc
|
||||
|
||||
@@ -80,7 +80,7 @@
|
||||
if(!isliving(M))
|
||||
return
|
||||
M.IgniteMob()
|
||||
if(!istype(M, /mob))
|
||||
if(!ismob(M))
|
||||
return
|
||||
|
||||
if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_selected == "mouth" && lit)
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
icon_state = "[initial(icon_state)][contents.len]"
|
||||
|
||||
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M, /mob))
|
||||
if(!ismob(M))
|
||||
return
|
||||
|
||||
if(istype(M) && M == user && user.zone_selected == "mouth" && contents.len > 0 && !user.wear_mask)
|
||||
|
||||
@@ -314,7 +314,7 @@
|
||||
nanofrost_cooldown = 0
|
||||
return
|
||||
if(nozzle_mode == METAL_FOAM)
|
||||
if(!Adj|| !istype(target, /turf))
|
||||
if(!Adj|| !isturf(target))
|
||||
return
|
||||
if(metal_synthesis_cooldown < 5)
|
||||
var/obj/effect/particle_effect/foam/F = new /obj/effect/particle_effect/foam(get_turf(target), 1)
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
if((M.client && M.machine == src))
|
||||
is_in_use = TRUE
|
||||
src.attack_hand(M)
|
||||
if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
|
||||
if(isAI(usr) || isrobot(usr))
|
||||
if(!(usr in nearby))
|
||||
if(usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
|
||||
is_in_use = TRUE
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
for(var/mob/M in loc)
|
||||
if(itemcount >= storage_capacity)
|
||||
break
|
||||
if(istype(M, /mob/dead/observer))
|
||||
if(isobserver(M))
|
||||
continue
|
||||
if(istype(M, /mob/living/simple_animal/bot/mulebot))
|
||||
continue
|
||||
@@ -243,7 +243,7 @@
|
||||
return
|
||||
if(user.loc==null) // just in case someone manages to get a closet into the blue light dimension, as unlikely as that seems
|
||||
return
|
||||
if(!istype(user.loc, /turf)) // are you in a container/closet/pod/etc?
|
||||
if(!isturf(user.loc)) // are you in a container/closet/pod/etc?
|
||||
return
|
||||
if(!opened)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user