mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Defining Part 1 - Code cleanup toward defines (#19262)
* This is only the beginning * Update stack.dm
This commit is contained in:
@@ -271,15 +271,15 @@
|
||||
//TODO: much much more. Unnamed airlocks, cameras, etc.
|
||||
|
||||
/obj/item/areaeditor/proc/check_tile_is_border(turf/T2, dir)
|
||||
if(istype(T2, /turf/space))
|
||||
if(isspaceturf(T2))
|
||||
return BORDER_SPACE //omg hull breach we all going to die here
|
||||
if(get_area_type(T2.loc)!=AREA_SPACE)
|
||||
return BORDER_BETWEEN
|
||||
if(istype(T2, /turf/simulated/wall))
|
||||
if(iswallturf(T2))
|
||||
return BORDER_2NDTILE
|
||||
if(istype(T2, /turf/simulated/mineral))
|
||||
if(ismineralturf(T2))
|
||||
return BORDER_2NDTILE
|
||||
if(!istype(T2, /turf/simulated))
|
||||
if(!issimulatedturf(T2))
|
||||
return BORDER_BETWEEN
|
||||
|
||||
for(var/obj/structure/window/W in T2)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
|
||||
/obj/structure/closet/body_bag/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/pen))
|
||||
if(is_pen(I))
|
||||
var/t = rename_interactive(user, I)
|
||||
if(isnull(t))
|
||||
return
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
chemtraces += V
|
||||
|
||||
/obj/item/autopsy_scanner/attackby(obj/item/P, mob/user)
|
||||
if(istype(P, /obj/item/pen))
|
||||
if(is_pen(P))
|
||||
var/dead_name = input("Insert name of deceased individual")
|
||||
var/dead_rank = input("Insert rank of deceased individual")
|
||||
var/dead_tod = input("Insert time of death")
|
||||
|
||||
@@ -148,7 +148,7 @@
|
||||
master.disrupt()
|
||||
|
||||
/obj/effect/dummy/chameleon/relaymove(mob/user, direction)
|
||||
if(!isturf(loc) || istype(loc, /turf/space) || !direction)
|
||||
if(!isturf(loc) || isspaceturf(loc) || !direction)
|
||||
return // No magical movement!
|
||||
|
||||
if(can_move)
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
qdel(L)
|
||||
return
|
||||
|
||||
if(istype(I, /obj/item/storage))
|
||||
if(isstorage(I))
|
||||
var/obj/item/storage/S = I
|
||||
var/found_lightbulbs = FALSE
|
||||
var/replaced_something = TRUE
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
if(pai.master_dna)
|
||||
return
|
||||
var/mob/M = usr
|
||||
if(!istype(M, /mob/living/carbon))
|
||||
if(!iscarbon(M))
|
||||
to_chat(usr, "<font color=blue>You don't have any DNA, or your DNA is incompatible with this device.</font>")
|
||||
else
|
||||
var/datum/dna/dna = usr.dna
|
||||
|
||||
@@ -338,7 +338,7 @@
|
||||
update_icon(UPDATE_OVERLAYS)
|
||||
|
||||
/obj/item/tape/attackby(obj/item/I, mob/user)
|
||||
if(istype(I, /obj/item/pen))
|
||||
if(is_pen(I))
|
||||
rename_interactive(user, I)
|
||||
|
||||
/obj/item/tape/screwdriver_act(mob/living/user, obj/item/I)
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
to_chat(M, "<span class='danger'>[src] will not work here!</span>")
|
||||
|
||||
/obj/item/teleporter/proc/tile_check(turf/T)
|
||||
if(istype(T, /turf/simulated/floor) || istype(T, /turf/space))
|
||||
if(isfloorturf(T) || isspaceturf(T))
|
||||
return TRUE
|
||||
|
||||
/obj/item/teleporter/proc/dir_correction(mob/user) //Direction movement, screws with teleport distance and saving throw, and thus must be removed first
|
||||
|
||||
@@ -375,7 +375,7 @@ GLOBAL_LIST_INIT(cardboard_recipes, list (
|
||||
))
|
||||
|
||||
/obj/item/stack/sheet/cardboard/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/stamp/clown) && !istype(loc, /obj/item/storage))
|
||||
if(istype(I, /obj/item/stamp/clown) && !isstorage(loc))
|
||||
var/atom/droploc = drop_location()
|
||||
if(use(1))
|
||||
playsound(I, 'sound/items/bikehorn.ogg', 50, 1, -1)
|
||||
|
||||
@@ -207,10 +207,10 @@
|
||||
to_chat(usr, "<span class='warning'>There is another [R.title] here!</span>")
|
||||
return FALSE
|
||||
|
||||
if(R.on_floor && !istype(get_turf(src), /turf/simulated))
|
||||
if(R.on_floor && !issimulatedturf(get_turf(src)))
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor!</span>")
|
||||
return FALSE
|
||||
if(R.on_floor_or_lattice && !(istype(get_turf(src), /turf/simulated) || locate(/obj/structure/lattice) in get_turf(src)))
|
||||
if(R.on_floor_or_lattice && !(issimulatedturf(get_turf(src)) || locate(/obj/structure/lattice) in get_turf(src)))
|
||||
to_chat(usr, "<span class='warning'>\The [R.title] must be constructed on the floor or lattice!</span>")
|
||||
return FALSE
|
||||
|
||||
@@ -252,12 +252,12 @@
|
||||
src = null //dont kill proc after qdel()
|
||||
usr.unEquip(oldsrc, 1)
|
||||
qdel(oldsrc)
|
||||
if(istype(O, /obj/item))
|
||||
if(isitem(O))
|
||||
usr.put_in_hands(O)
|
||||
|
||||
O.add_fingerprint(usr)
|
||||
//BubbleWrap - so newly formed boxes are empty
|
||||
if(istype(O, /obj/item/storage))
|
||||
if(isstorage(O))
|
||||
for(var/obj/item/I in O)
|
||||
qdel(I)
|
||||
//BubbleWrap END
|
||||
|
||||
@@ -440,7 +440,7 @@
|
||||
*/
|
||||
/obj/item/rcd/proc/mode_decon(atom/A, mob/user)
|
||||
if(iswallturf(A))
|
||||
if(istype(A, /turf/simulated/wall/r_wall) && !canRwall)
|
||||
if(isreinforcedwallturf(A) && !canRwall)
|
||||
return FALSE
|
||||
if(istype(A, /turf/simulated/wall/indestructible))
|
||||
return FALSE
|
||||
|
||||
@@ -55,7 +55,7 @@ RSF
|
||||
|
||||
/obj/item/rsf/afterattack(atom/A, mob/user as mob, proximity)
|
||||
if(!proximity) return
|
||||
if(!(istype(A, /obj/structure/table) || istype(A, /turf/simulated/floor)))
|
||||
if(!(istype(A, /obj/structure/table) || isfloorturf(A)))
|
||||
return
|
||||
var/spawn_location
|
||||
var/turf/T = get_turf(A)
|
||||
|
||||
@@ -382,7 +382,7 @@
|
||||
return
|
||||
if(istype(O, /obj/item/card/id))
|
||||
var/obj/item/card/id/I = O
|
||||
if(istype(user, /mob/living) && user.mind)
|
||||
if(isliving(user) && user.mind)
|
||||
if(user.mind.special_role)
|
||||
to_chat(usr, "<span class='notice'>The card's microscanners activate as you pass it over \the [I], copying its access.</span>")
|
||||
src.access |= I.access //Don't copy access if user isn't an antag -- to prevent metagaming
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
/obj/item/caution/proximity_sign/HasProximity(atom/movable/AM)
|
||||
if(armed)
|
||||
if(istype(AM, /mob/living/carbon) && !istype(AM, /mob/living/carbon/brain))
|
||||
if(iscarbon(AM) && !isbrain(AM))
|
||||
var/mob/living/carbon/C = AM
|
||||
if(C.m_intent != MOVE_INTENT_WALK)
|
||||
src.visible_message("[src] beeps, \"Running on wet floors is hazardous to your health.\"")
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
if(target)
|
||||
if(!QDELETED(target))
|
||||
location = get_turf(target)
|
||||
if(!ex_breach && istype(target, /turf/simulated/wall)) //Walls get dismantled instead of destroyed to avoid making unwanted holes to space.
|
||||
if(!ex_breach && iswallturf(target)) //Walls get dismantled instead of destroyed to avoid making unwanted holes to space.
|
||||
var/turf/simulated/wall/W = target
|
||||
W.dismantle_wall(TRUE, TRUE)
|
||||
else
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
/obj/item/implantcase/attackby(obj/item/W, mob/user)
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/pen))
|
||||
if(is_pen(W))
|
||||
rename_interactive(user, W)
|
||||
else if(istype(W, /obj/item/implanter))
|
||||
var/obj/item/implanter/I = W
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
/obj/item/implanter/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/pen))
|
||||
if(is_pen(W))
|
||||
rename_interactive(user, W)
|
||||
|
||||
/obj/item/implanter/Initialize(mapload)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
|
||||
/obj/item/restraints/legcuffs/beartrap/Crossed(AM as mob|obj, oldloc)
|
||||
if(armed && isturf(src.loc))
|
||||
if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !istype(AM, /mob/living/simple_animal/hostile/construct) && !istype(AM, /mob/living/simple_animal/shade) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
|
||||
if( (iscarbon(AM) || isanimal(AM)) && !istype(AM, /mob/living/simple_animal/parrot) && !isconstruct(AM) && !isshade(AM) && !istype(AM, /mob/living/simple_animal/hostile/viscerator))
|
||||
var/mob/living/L = AM
|
||||
armed = FALSE
|
||||
update_icon()
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if(loadedWeightClass >= maxWeightClass)
|
||||
to_chat(user, "<span class='warning'>\The [src] can't hold any more items!</span>")
|
||||
return
|
||||
if(istype(W, /obj/item))
|
||||
if(isitem(W))
|
||||
var/obj/item/IW = W
|
||||
if(IW.flags & (ABSTRACT | NODROP | DROPDEL))
|
||||
to_chat(user, "<span class='warning'>You can't put [IW] into [src]!</span>")
|
||||
@@ -83,7 +83,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/item/pneumatic_cannon/afterattack(atom/target, mob/living/carbon/human/user, flag, params)
|
||||
if(istype(target, /obj/item/storage)) //So you can store it in backpacks
|
||||
if(isstorage(target)) //So you can store it in backpacks
|
||||
return ..()
|
||||
if(istype(target, /obj/structure/closet)) //So you can store it in closets
|
||||
return ..()
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
return
|
||||
if(isturf(AM))
|
||||
return
|
||||
if(istype(AM, /obj/item/storage))
|
||||
if(isstorage(AM))
|
||||
return
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
var/label = ""
|
||||
|
||||
/obj/item/picket_sign/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen) || istype(W, /obj/item/toy/crayon))
|
||||
if(is_pen(W) || istype(W, /obj/item/toy/crayon))
|
||||
var/txt = stripped_input(user, "What would you like to write on the sign?", "Sign Label", null , 30)
|
||||
if(txt)
|
||||
label = txt
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
user.visible_message("<span class='warning'>[user] begins to smear [src] on \the [target.name].</span>")
|
||||
if(do_after(user, cleanspeed, target = target))
|
||||
to_chat(user, "<span class='notice'>You 'clean' \the [target.name].</span>")
|
||||
if(istype(target, /turf/simulated))
|
||||
if(issimulatedturf(target))
|
||||
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(target)
|
||||
else if(istype(target,/mob/living/carbon))
|
||||
for(var/obj/item/carried_item in target.contents)
|
||||
|
||||
@@ -746,7 +746,7 @@
|
||||
icon_state = "[item_state]_closed"
|
||||
|
||||
/obj/item/storage/box/papersack/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/pen))
|
||||
if(is_pen(W))
|
||||
//if a pen is used on the sack, dialogue to change its design appears
|
||||
if(contents.len)
|
||||
to_chat(user, "<span class='warning'>You can't modify [src] with items still inside!</span>")
|
||||
|
||||
@@ -297,7 +297,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/storage/pill_bottle/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/pen) || istype(I, /obj/item/flashlight/pen))
|
||||
if(is_pen(I) || istype(I, /obj/item/flashlight/pen))
|
||||
rename_interactive(user, I)
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
return
|
||||
var/mob/M = usr
|
||||
|
||||
if(istype(M.loc, /obj/mecha) || M.incapacitated(FALSE, TRUE)) // Stops inventory actions in a mech as well as while being incapacitated
|
||||
if(ismecha(M.loc) || M.incapacitated(FALSE, TRUE)) // Stops inventory actions in a mech as well as while being incapacitated
|
||||
return
|
||||
|
||||
if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
|
||||
@@ -170,7 +170,7 @@
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/gift/G in src)
|
||||
L += G.gift
|
||||
if(istype(G.gift, /obj/item/storage)) // If the gift contains a storage item
|
||||
if(isstorage(G.gift)) // If the gift contains a storage item
|
||||
var/obj/item/storage/S = G.gift
|
||||
L += S.return_inv()
|
||||
for(var/obj/item/folder/F in src)
|
||||
@@ -361,7 +361,7 @@
|
||||
to_chat(usr, "<span class='warning'>[src] cannot hold [I].</span>")
|
||||
return FALSE
|
||||
|
||||
if(length(cant_hold) && istype(I, /obj/item/storage)) //Checks nested storage contents for restricted objects, we don't want people sneaking the NAD in via boxes now, do we?
|
||||
if(length(cant_hold) && isstorage(I)) //Checks nested storage contents for restricted objects, we don't want people sneaking the NAD in via boxes now, do we?
|
||||
var/obj/item/storage/S = I
|
||||
for(var/obj/A in S.return_inv())
|
||||
if(is_type_in_typecache(A, cant_hold))
|
||||
@@ -383,7 +383,7 @@
|
||||
to_chat(usr, "<span class='warning'>[src] is full, make some space.</span>")
|
||||
return FALSE
|
||||
|
||||
if(I.w_class >= w_class && istype(I, /obj/item/storage))
|
||||
if(I.w_class >= w_class && isstorage(I))
|
||||
if(!istype(src, /obj/item/storage/backpack/holding)) //BoHs should be able to hold backpacks again. The override for putting a BoH in a BoH is in backpack.dm.
|
||||
if(!stop_messages)
|
||||
to_chat(usr, "<span class='warning'>[src] cannot hold [I] as it's a storage item of the same size.</span>")
|
||||
@@ -649,7 +649,7 @@
|
||||
while(cur_atom && !(cur_atom in container.contents))
|
||||
if(isarea(cur_atom))
|
||||
return -1
|
||||
if(istype(cur_atom.loc, /obj/item/storage))
|
||||
if(isstorage(cur_atom.loc))
|
||||
depth++
|
||||
cur_atom = cur_atom.loc
|
||||
|
||||
@@ -670,7 +670,7 @@
|
||||
while(cur_atom && !isturf(cur_atom))
|
||||
if(isarea(cur_atom))
|
||||
return -1
|
||||
if(istype(cur_atom.loc, /obj/item/storage))
|
||||
if(isstorage(cur_atom.loc))
|
||||
depth++
|
||||
cur_atom = cur_atom.loc
|
||||
|
||||
|
||||
@@ -817,12 +817,12 @@
|
||||
Z.gib()
|
||||
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
|
||||
if(wielded)
|
||||
if(istype(A, /turf/simulated/wall))
|
||||
if(iswallturf(A))
|
||||
var/turf/simulated/wall/Z = A
|
||||
Z.ex_act(2)
|
||||
charged = 3
|
||||
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
|
||||
else if(istype(A, /obj/structure) || istype(A, /obj/mecha))
|
||||
else if(istype(A, /obj/structure) || ismecha(A))
|
||||
var/obj/Z = A
|
||||
Z.ex_act(2)
|
||||
charged = 3
|
||||
|
||||
Reference in New Issue
Block a user