Defining Part 1 - Code cleanup toward defines (#19262)

* This is only the beginning

* Update stack.dm
This commit is contained in:
Vi3trice
2022-10-10 14:50:29 -04:00
committed by GitHub
parent 9235117b40
commit 9e90c81282
107 changed files with 161 additions and 161 deletions
+3 -3
View File
@@ -129,7 +129,7 @@
/obj/structure/alien/weeds/New(pos, node)
..()
linked_node = node
if(istype(loc, /turf/space))
if(isspaceturf(loc))
qdel(src)
return
if(icon_state == "weeds")
@@ -146,7 +146,7 @@
/obj/structure/alien/weeds/proc/Life()
var/turf/U = get_turf(src)
if(istype(U, /turf/space))
if(isspaceturf(U))
qdel(src)
return
@@ -155,7 +155,7 @@
for(var/turf/T in U.GetAtmosAdjacentTurfs())
if(locate(/obj/structure/alien/weeds) in T || istype(T, /turf/space))
if(locate(/obj/structure/alien/weeds) in T || isspaceturf(T))
continue
new /obj/structure/alien/weeds(T, linked_node)
@@ -71,7 +71,7 @@
M.show_message("<span class='notice'>\The [src] has been cut apart by [user] with \the [WC].</span>", 3, "You hear cutting.", 2)
qdel(src)
return
if(istype(W, /obj/item/pen))
if(is_pen(W))
var/decalselection = input("Please select a decal") as null|anything in list("Atmospherics", "Bartender", "Barber", "Blueshield", "Captain",
"Cargo", "Chief Engineer", "Chaplain", "Chef", "Chemist", "Assistant", "Clown", "CMO", "Coroner", "Detective", "Engineering", "Genetics", "HOP",
"HOS", "Hydroponics", "Internal Affairs Agent", "Janitor", "Magistrate", "Medical", "Mime", "Mining", "NT Representative", "Paramedic",
@@ -39,7 +39,7 @@
to_chat(user, "<span class = 'caution'> You disable the locking modules.</span>")
update_icon(UPDATE_ICON_STATE)
return
else if(istype(O, /obj/item))
else if(isitem(O))
user.changeNext_move(CLICK_CD_MELEE)
var/obj/item/W = O
if(smashed || localopened)
@@ -57,7 +57,7 @@
. += "<span class='notice'>There is a small <i>paper</i> placard on the assembly[doorname].</span>"
/obj/structure/door_assembly/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pen))
if(is_pen(W))
// The door assembly gets renamed to "Assembly - Foobar",
// but the `t` returned from the proc is just "Foobar" without the prefix.
var/t = rename_interactive(user, W)
+1 -1
View File
@@ -128,7 +128,7 @@
to_chat(user, "<span class='warning'>[src] is blocked!</span>")
return TRUE
if(!istype(T, /turf/simulated/floor))
if(!isfloorturf(T))
to_chat(user, "<span class='warning'>[src] bolts must be tightened on the floor!</span>")
return TRUE
user.visible_message("<span class='notice'>[user] tightens some bolts on the wall.</span>", "<span class='warning'>You tighten the bolts on the wall.</span>")
+1 -1
View File
@@ -156,7 +156,7 @@
deconstruct()
/obj/structure/grille/screwdriver_act(mob/user, obj/item/I)
if(!(anchored || istype(loc, /turf/simulated) || locate(/obj/structure/lattice) in get_turf(src)))
if(!(anchored || issimulatedturf(loc) || locate(/obj/structure/lattice) in get_turf(src)))
return
. = TRUE
if(shock(user, 90))
+1 -1
View File
@@ -148,7 +148,7 @@
operate()
else
operate()
else if(istype(user, /obj/mecha))
else if(ismecha(user))
operate()
/obj/structure/inflatable/door/proc/operate()
@@ -78,7 +78,7 @@
operate()
else
operate()
else if(istype(user, /obj/mecha))
else if(ismecha(user))
operate()
/obj/structure/mineral_door/proc/operate()
+2 -2
View File
@@ -133,7 +133,7 @@
return
/obj/structure/morgue/attackby(P as obj, mob/user as mob, params)
if(istype(P, /obj/item/pen))
if(is_pen(P))
var/t = rename_interactive(user, P)
if(isnull(t))
@@ -355,7 +355,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
update_icon(UPDATE_OVERLAYS)
/obj/structure/crematorium/attackby(P as obj, mob/user as mob, params)
if(istype(P, /obj/item/pen))
if(is_pen(P))
rename_interactive(user, P)
add_fingerprint(user)
return
+2 -2
View File
@@ -65,11 +65,11 @@
var/obj/item/P = locate(href_list["write"])
if((P && P.loc == src)) //ifthe paper's on the board
if(istype(usr.r_hand, /obj/item/pen)) //and you're holding a pen
if(is_pen(usr.r_hand)) //and you're holding a pen
add_fingerprint(usr)
P.attackby(usr.r_hand, usr) //then do ittttt
else
if(istype(usr.l_hand, /obj/item/pen)) //check other hand for pen
if(is_pen(usr.l_hand)) //check other hand for pen
add_fingerprint(usr)
P.attackby(usr.l_hand, usr)
else
@@ -88,7 +88,7 @@
occupant.Weaken(12 SECONDS)
occupant.Stuttering(12 SECONDS)
playsound(src.loc, 'sound/weapons/punch1.ogg', 50, 1, -1)
if(istype(A, /mob/living))
if(isliving(A))
var/mob/living/victim = A
victim.Weaken(12 SECONDS)
victim.Stuttering(12 SECONDS)
+2 -2
View File
@@ -177,7 +177,7 @@
/obj/structure/table/MouseDrop_T(obj/O, mob/user)
..()
if((!( istype(O, /obj/item) ) || user.get_active_hand() != O))
if((!( isitem(O) ) || user.get_active_hand() != O))
return
if(isrobot(user))
return
@@ -841,7 +841,7 @@
. = . || mover.checkpass(PASSTABLE)
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
if((!( istype(O, /obj/item) ) || user.get_active_hand() != O))
if((!( isitem(O) ) || user.get_active_hand() != O))
return
if(isrobot(user))
return
@@ -165,7 +165,7 @@
else
W.forceMove(loc)
else if(istype(W, /obj/item/pen))
else if(is_pen(W))
var/t = rename_interactive(user, W)
if(!isnull(t))
created_name = t