Merge pull request #35629 from ShizCalev/floor-tool_acts

Converts floor tool interactions to tool_act, fixes flooring exploits
This commit is contained in:
vuonojenmustaturska
2018-02-16 14:06:32 +02:00
committed by CitadelStationBot
parent 757df53aa3
commit 5ea2e57419
10 changed files with 49 additions and 16 deletions
+3 -2
View File
@@ -139,12 +139,13 @@
return 1
if(..())
return 1
if(intact && istype(C, /obj/item/crowbar))
return pry_tile(C, user)
if(intact && istype(C, /obj/item/stack/tile))
try_replace_tile(C, user, params)
return 0
/turf/open/floor/crowbar_act(mob/living/user, obj/item/I)
return intact ? pry_tile(I, user) : FALSE
/turf/open/floor/proc/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
if(T.turf_type == type)
return
+9 -13
View File
@@ -17,12 +17,8 @@
..()
to_chat(user, "<span class='notice'>There's a few <b>screws</b> and a <b>small crack</b> visible.</span>")
/turf/open/floor/wood/attackby(obj/item/C, mob/user, params)
if(..())
return
if(istype(C, /obj/item/screwdriver))
pry_tile(C, user)
return
/turf/open/floor/wood/screwdriver_act(mob/living/user, obj/item/I)
return pry_tile(I, user)
/turf/open/floor/wood/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
if(T.turf_type == type)
@@ -38,9 +34,8 @@
P.attackby(T, user, params)
/turf/open/floor/wood/pry_tile(obj/item/C, mob/user, silent = FALSE)
var/is_screwdriver = istype(C, /obj/item/screwdriver)
C.play_tool_sound(src, 80)
return remove_tile(user, silent, make_tile = is_screwdriver)
return remove_tile(user, silent, (C.tool_behaviour == TOOL_SCREWDRIVER))
/turf/open/floor/wood/remove_tile(mob/user, silent = FALSE, make_tile = TRUE)
if(broken || burnt)
@@ -80,7 +75,7 @@
update_icon()
/turf/open/floor/grass/attackby(obj/item/C, mob/user, params)
if(istype(C, /obj/item/shovel) && params)
if((C.tool_behaviour == TOOL_SHOVEL) && params)
new ore_type(src, 2)
user.visible_message("[user] digs up [src].", "<span class='notice'>You [turfverb] [src].</span>")
playsound(src, 'sound/effects/shovel_dig.ogg', 50, 1)
@@ -99,10 +94,11 @@
initial_gas_mix = "o2=22;n2=82;TEMP=180"
slowdown = 2
/turf/open/floor/grass/snow/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/crowbar))//You need to dig this turf out instead of crowbarring it
return
..()
/turf/open/floor/grass/snow/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/grass/snow/crowbar_act(mob/living/user, obj/item/I)
return
/turf/open/floor/grass/snow/basalt //By your powers combined, I am captain planet
name = "volcanic floor"
@@ -42,7 +42,7 @@
if(exposed_temperature > 300)
PlasmaBurn(exposed_temperature)
/turf/open/floor/mineral/plasma/attackby(obj/item/W as obj, mob/user as mob, params)
/turf/open/floor/mineral/plasma/attackby(obj/item/W, mob/user, params)
if(W.is_hot() > 300)//If the temperature of the object is over 300, then ignite
message_admins("Plasma flooring was ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(src)]",0,1)
log_game("Plasma flooring was ignited by [key_name(user)] in [COORD(src)]")
@@ -196,6 +196,9 @@
flick_overlay(I, viewing, 8)
L.adjustToxLoss(-3, TRUE, TRUE)
/turf/open/floor/clockwork/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/clockwork/crowbar_act(mob/living/user, obj/item/I)
if(baseturfs == type)
return TRUE
@@ -123,3 +123,6 @@
/turf/open/floor/plating/foam/ex_act()
..()
ScrapeAway()
/turf/open/floor/plating/foam/tool_act(mob/living/user, obj/tool/I, tool_type)
return
@@ -26,6 +26,10 @@
if(LAZYLEN(archdrops))
AddComponent(/datum/component/archaeology, 100, archdrops)
/turf/open/floor/plating/asteroid/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/asteroid/burn_tile()
return
@@ -10,3 +10,6 @@
/turf/open/floor/plating/dirt/dark
icon_state = "greenerdirt"
/turf/open/floor/plating/dirt/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
@@ -22,6 +22,8 @@
/turf/open/floor/plating/abductor2/burn_tile()
return //unburnable
/turf/open/floor/plating/abductor2/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/astplate
icon_state = "asteroidplating"
@@ -49,6 +51,9 @@
icon = smooth_icon
. = ..()
/turf/open/floor/plating/ashplanet/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/ashplanet/break_tile()
return
@@ -84,6 +89,9 @@
flags_1 = NONE
attachment_holes = FALSE
/turf/open/floor/plating/beach/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/beach/ex_act(severity, target)
contents_explosion(severity, target)
@@ -122,6 +130,9 @@
/turf/open/floor/plating/ironsand/burn_tile()
return
/turf/open/floor/plating/ironsand/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/ice
name = "ice sheet"
desc = "A sheet of solid ice. Looks slippery."
@@ -135,6 +146,9 @@
wet = TURF_WET_PERMAFROST
attachment_holes = FALSE
/turf/open/floor/plating/ice/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/plating/ice/HandleWet()
if(wet == TURF_WET_ICE)
return
@@ -25,6 +25,12 @@
..()
return //unplateable
/turf/open/floor/engine/try_replace_tile(obj/item/stack/tile/T, mob/user, params)
return
/turf/open/floor/engine/crowbar_act(mob/living/user, obj/item/I)
return
/turf/open/floor/engine/wrench_act(mob/living/user, obj/item/I)
to_chat(user, "<span class='notice'>You begin removing rods...</span>")
if(I.use_tool(src, user, 30, volume=80))
+3
View File
@@ -6,6 +6,9 @@
/turf/open/floor/holofloor/attackby(obj/item/I, mob/living/user)
return // HOLOFLOOR DOES NOT GIVE A FUCK
/turf/open/floor/holofloor/tool_act(mob/living/user, obj/item/I, tool_type)
return
/turf/open/floor/holofloor/burn_tile()
return //you can't burn a hologram!