diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm index 7e5c0325403..fb04d3c866e 100644 --- a/code/game/turfs/simulated/floor.dm +++ b/code/game/turfs/simulated/floor.dm @@ -138,24 +138,20 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," return 1 if(..()) return 1 - if(intact && istype(C, /obj/item/weapon/crowbar)) - if(broken || burnt) - broken = 0 - burnt = 0 - to_chat(user, "You remove the broken plating.") - else - if(istype(src, /turf/simulated/floor/wood)) - to_chat(user, "You forcefully pry off the planks, destroying them in the process.") - else if(!builtin_tile) - to_chat(user, "You are unable to pry up \the [src] with a crowbar.") - return 1 - else - to_chat(user, "You remove \the [builtin_tile.singular_name].") - builtin_tile.loc = src - builtin_tile = null //deassociate tile, it no longer belongs to this turf - make_plating() - playsound(src, C.usesound, 80, 1) + if(intact && iscrowbar(C)) + pry_tile(C, user) return 1 + if(intact && istype(C, /obj/item/stack/tile)) + var/obj/item/stack/tile/T = C + if(T.turf_type == type) + return + var/obj/item/weapon/crowbar/CB = user.get_inactive_hand(/obj/item/weapon/crowbar) + if(!CB) + return + var/turf/simulated/floor/plating/P = pry_tile(CB, user, TRUE) + if(!istype(P)) + return + P.attackby(T, user, params) if(istype(C, /obj/item/pipe)) var/obj/item/pipe/P = C if(P.pipe_type != -1) // ANY PIPE @@ -181,6 +177,24 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3"," return 1 return 0 +/turf/simulated/floor/proc/pry_tile(obj/item/C, mob/user, silent = FALSE) + playsound(src, C.usesound, 80, 1) + return remove_tile(user, silent) + +/turf/simulated/floor/proc/remove_tile(mob/user, silent = FALSE, make_tile = TRUE) + if(broken || burnt) + broken = 0 + burnt = 0 + if(user && !silent) + to_chat(user, "You remove the broken plating.") + else + if(user && !silent) + to_chat(user, "You remove the floor tile.") + if(builtin_tile && make_tile) + builtin_tile.forceMove(src) + builtin_tile = null + return make_plating() + /turf/simulated/floor/singularity_pull(S, current_size) if(current_size == STAGE_THREE) if(prob(30)) diff --git a/code/game/turfs/simulated/floor/fancy_floor.dm b/code/game/turfs/simulated/floor/fancy_floor.dm index add026866be..f7c49fa463c 100644 --- a/code/game/turfs/simulated/floor/fancy_floor.dm +++ b/code/game/turfs/simulated/floor/fancy_floor.dm @@ -11,15 +11,33 @@ /turf/simulated/floor/wood/attackby(obj/item/C, mob/user, params) if(..()) return - if(istype(C, /obj/item/weapon/screwdriver)) - if(broken || burnt) - return - to_chat(user, "You unscrew the planks.") - new floor_tile(src) - make_plating() - playsound(src, C.usesound, 80, 1) + if(isscrewdriver(C)) + pry_tile(C, user) return +/turf/simulated/floor/wood/pry_tile(obj/item/C, mob/user, silent = FALSE) + var/is_screwdriver = isscrewdriver(C) + playsound(src, C.usesound, 80, 1) + return remove_tile(user, silent, make_tile = is_screwdriver) + +/turf/simulated/floor/wood/remove_tile(mob/user, silent = FALSE, make_tile = TRUE) + if(broken || burnt) + broken = 0 + burnt = 0 + if(user && !silent) + to_chat(user, "You remove the broken planks.") + else + if(make_tile) + if(user && !silent) + to_chat(user, "You unscrew the planks.") + if(builtin_tile) + builtin_tile.forceMove(src) + builtin_tile = null + else + if(user && !silent) + to_chat(user, "You forcefully pry off the planks, destroying them in the process.") + return make_plating() + /turf/simulated/floor/grass name = "grass patch" icon_state = "grass1" @@ -45,7 +63,7 @@ to_chat(user, "You shovel the grass.") playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1) make_plating() - + // NEEDS TO BE UPDATED /turf/simulated/floor/basalt //By your powers combined, I am captain planet name = "volcanic floor" @@ -54,7 +72,7 @@ oxygen = 14 nitrogen = 23 temperature = 300 - + /turf/simulated/floor/basalt/attackby(obj/item/W, mob/user, params) if(..()) return