Files
GS13NG/code/game/turfs/simulated/floor/plating.dm
Poojawa b1b4826c0c July 5th TG sync (#1883)
July 5th TG sync
2017-07-05 22:14:19 -05:00

72 lines
2.3 KiB
Plaintext

/* 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, "<span class='warning'>Repair the plating first!</span>")
return
var/obj/item/stack/rods/R = C
if (R.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two rods to make a reinforced floor!</span>")
return
else
to_chat(user, "<span class='notice'>You begin reinforcing the floor...</span>")
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, "<span class='notice'>You reinforce the floor.</span>")
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, "<span class='warning'>This section is too damaged to support a tile! Use a welder to fix the damage.</span>")
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, "<span class='danger'>You fix some dents on the broken plating.</span>")
playsound(src, welder.usesound, 80, 1)
icon_state = icon_plating
burnt = 0
broken = 0