/* In this file:
*
* Plating
* Airless
* Airless plating
* Engine floor
*/
// note that plating and engine floor do not call their parent attackby, unlike other flooring
// this is done in order to avoid inheriting the crowbar attackby
/turf/open/floor/plating
name = "plating"
icon_state = "plating"
intact = 0
/turf/open/floor/plating/Initialize()
if (!broken_states)
broken_states = list("platingdmg1", "platingdmg2", "platingdmg3")
if (!burnt_states)
burnt_states = list("panelscorched")
..()
icon_plating = icon_state
/turf/open/floor/plating/update_icon()
if(!..())
return
if(!broken && !burnt)
icon_state = icon_plating //Because asteroids are 'platings' too.
/turf/open/floor/plating/attackby(obj/item/C, mob/user, params)
if(..())
return
if(istype(C, /obj/item/stack/rods))
if(broken || burnt)
to_chat(user, "Repair the plating first!")
return
var/obj/item/stack/rods/R = C
if (R.get_amount() < 2)
to_chat(user, "You need two rods to make a reinforced floor!")
return
else
to_chat(user, "You begin reinforcing the floor...")
if(do_after(user, 30, target = src))
if (R.get_amount() >= 2 && !istype(src, /turf/open/floor/engine))
ChangeTurf(/turf/open/floor/engine)
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
R.use(2)
to_chat(user, "You reinforce the floor.")
return
else if(istype(C, /obj/item/stack/tile))
if(!broken && !burnt)
var/obj/item/stack/tile/W = C
if(!W.use(1))
return
var/turf/open/floor/T = ChangeTurf(W.turf_type)
if(istype(W,/obj/item/stack/tile/light)) //TODO: get rid of this ugly check somehow
var/obj/item/stack/tile/light/L = W
var/turf/open/floor/light/F = T
F.state = L.state
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
else
to_chat(user, "This section is too damaged to support a tile! Use a welder to fix the damage.")
else if(istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/welder = C
if( welder.isOn() && (broken || burnt) )
if(welder.remove_fuel(0,user))
to_chat(user, "You fix some dents on the broken plating.")
playsound(src, welder.usesound, 80, 1)
icon_state = icon_plating
burnt = 0
broken = 0