bad code, but tidier code

This commit is contained in:
S34NW
2021-04-21 23:42:20 +01:00
parent 11d46098cb
commit fbf958b6fc
15 changed files with 23 additions and 19 deletions
+1 -1
View File
@@ -26,7 +26,7 @@
Beacon.syndicate = syndicate
Beacon.area_bypass = area_bypass
Beacon.cc_beacon = cc_beacon
if(!istype(T, /turf/simulated/floor/transparent))
if(!T.transparent_floor)
hide(T.intact)
/obj/machinery/bluespace_beacon/proc/destroy_beacon()
+1 -1
View File
@@ -32,7 +32,7 @@
/obj/machinery/magnetic_module/New()
..()
var/turf/T = loc
if(!istype(T, /turf/simulated/floor/transparent))
if(!T.transparent_floor)
hide(T.intact)
center = T
+1 -1
View File
@@ -26,7 +26,7 @@
set_codes()
var/turf/T = loc
if(!istype(T, /turf/simulated/floor/transparent))
if(!T.transparent_floor)
hide(T.intact)
if(!codes || !codes.len)
log_runtime(EXCEPTION("Empty codes datum at ([x],[y],[z])"), src, list("codes_txt: '[codes_txt]'"))
+1 -1
View File
@@ -368,7 +368,7 @@ GLOBAL_LIST_EMPTY(safes)
/obj/structure/safe/floor/Initialize()
. = ..()
var/turf/T = loc
if(!istype(T, /turf/simulated/floor/transparent))
if(!T.transparent_floor)
hide(T.intact)
/obj/structure/safe/floor/hide(intact)
+4 -2
View File
@@ -76,7 +76,7 @@
return TRUE
var/obj/item/stack/sheet/glass/R = C
if(R.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two glass to make a glass floor!</span>")
to_chat(user, "<span class='warning'>You need two sheets of glass to build a glass floor!</span>")
return TRUE
else
to_chat(user, "<span class='notice'>You begin swapping the plating for glass...</span>")
@@ -86,6 +86,7 @@
playsound(src, C.usesound, 80, 1)
R.use(2)
to_chat(user, "<span class='notice'>You swap the plating for glass.</span>")
new /obj/item/stack/sheet/metal(src, 2)
return TRUE
else if(istype(C, /obj/item/stack/sheet/rglass))
@@ -94,7 +95,7 @@
return TRUE
var/obj/item/stack/sheet/rglass/R = C
if(R.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two reinforced glass to make a reinforced glass floor!</span>")
to_chat(user, "<span class='warning'>You need two sheets of reinforced glass to build a reinforced glass floor!</span>")
return TRUE
else
to_chat(user, "<span class='notice'>You begin swapping the plating for reinforced glass...</span>")
@@ -104,6 +105,7 @@
playsound(src, C.usesound, 80, 1)
R.use(2)
to_chat(user, "<span class='notice'>You swap the plating for reinforced glass.</span>")
new /obj/item/stack/sheet/metal(src, 2)
return TRUE
/turf/simulated/floor/plating/screwdriver_act(mob/user, obj/item/I)
@@ -13,6 +13,7 @@
layer = TRANSPARENT_TURF_LAYER
keep_dir = FALSE
intact = FALSE
transparent_floor = TRUE
/turf/simulated/floor/transparent/glass/Initialize(mapload)
. = ..()
+1
View File
@@ -6,6 +6,7 @@
var/intact = TRUE
var/turf/baseturf = /turf/space
var/slowdown = 0 //negative for faster, positive for slower
var/transparent_floor = FALSE //true for transparent floors
///Properties for open tiles (/floor)
/// All the gas vars, on the turf, are meant to be utilized for initializing a gas datum and setting its first gas values; the turf vars are never further modified at runtime; it is never directly used for calculations by the atmospherics system.
@@ -165,7 +165,7 @@ Pipelines + Other Objects -> Pipe network
/obj/machinery/atmospherics/attackby(obj/item/W, mob/user)
if(can_unwrench && istype(W, /obj/item/wrench))
var/turf/T = get_turf(src)
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
to_chat(user, "<span class='danger'>You must remove the glass first.</span>")
return
if(level == 1 && isturf(T) && T.intact)
@@ -76,7 +76,7 @@
break
var/turf/T = get_turf(src) // hide if turf is not intact
if(!istype(T) || istype(T, /turf/simulated/floor/transparent))
if(!istype(T) || T.transparent_floor)
return
hide(T.intact)
update_icon()
@@ -55,7 +55,7 @@
node3 = target
break
var/turf/T = src.loc // hide if turf is not intact
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
return
hide(T.intact)
update_icon()
@@ -162,7 +162,7 @@
break
var/turf/T = src.loc // hide if turf is not intact
if(!istype(T, /turf/simulated/floor/transparent))
if(!T.transparent_floor)
hide(T.intact)
update_icon()
@@ -68,7 +68,7 @@
break
var/turf/T = loc // hide if turf is not intact
if(!istype(T, /turf/simulated/floor/transparent))
if(!T.transparent_floor)
hide(T.intact)
update_icon()
+3 -3
View File
@@ -70,7 +70,7 @@ By design, d1 is the smallest direction and d2 is the highest
var/turf/T = get_turf(src) // hide if turf is not intact
LAZYADD(GLOB.cable_list, src) //add it to the global cable list
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
return
if(level == 1)
hide(T.intact)
@@ -165,7 +165,7 @@ By design, d1 is the smallest direction and d2 is the highest
//
/obj/structure/cable/attackby(obj/item/W, mob/user)
var/turf/T = get_turf(src)
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
to_chat(user, "<span class='danger'>You must remove the glass first.</span>")
return
if(T.intact)
@@ -210,7 +210,7 @@ By design, d1 is the smallest direction and d2 is the highest
/obj/structure/cable/wirecutter_act(mob/user, obj/item/I)
. = TRUE
var/turf/T = get_turf(src)
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
to_chat(user, "<span class='danger'>You must remove the glass first.</span>")
return
if(T.intact)
+1 -1
View File
@@ -15,7 +15,7 @@
/obj/machinery/power/terminal/Initialize(mapload)
. = ..()
var/turf/T = get_turf(src)
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
return
if(level == 1)
hide(T.intact)
+4 -4
View File
@@ -758,7 +758,7 @@
// update the icon_state to reflect hidden status
/obj/structure/disposalpipe/proc/update()
var/turf/T = get_turf(src)
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
update_icon()
return
hide(T.intact && !istype(T, /turf/space)) // space never hides pipes
@@ -893,8 +893,8 @@
/obj/structure/disposalpipe/attackby(obj/item/I, mob/user, params)
var/turf/T = get_turf(src)
if(T.intact || istype(T, /turf/simulated/floor/transparent))
to_chat(user, "<span class='danger'>You must remove the plating first.</span>")
if(T.intact || T.transparent_floor)
to_chat(user, "<span class='danger'>You must remove the [T.transparent_floor ? "glass": "plating"] first.</span>")
return // prevent interaction with T-scanner revealed pipes and pipes under glass
add_fingerprint(user)
@@ -904,7 +904,7 @@
var/turf/T = get_turf(src)
if(!I.tool_use_check(user, 0))
return
if(istype(T, /turf/simulated/floor/transparent))
if(T.transparent_floor)
to_chat(user, "<span class='danger'>You must remove the glass first.</span>")
return
WELDER_ATTEMPT_SLICING_MESSAGE