Files
Paradise/code/game/objects/items/devices/pipe_painter.dm
danni boi ca97f9a92d Windowpainter (#14888)
* adds a window painting tool

* Update code/game/objects/items/devices/window_painter.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* gigit

* edited code to match steelslayer's suggestion

* Update code/game/objects/items/devices/window_painter.dm

OOF thank you for catching that

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

Co-authored-by: danni-boy <32673848+danni-boy@users.noreply.github.com>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
2020-11-23 19:07:54 +00:00

41 lines
1.2 KiB
Plaintext

/obj/item/pipe_painter
name = "pipe painter"
icon = 'icons/obj/device.dmi'
icon_state = "pipe_painter"
item_state = "pipe_painter"
usesound = 'sound/effects/spray2.ogg'
var/list/modes
var/mode
/obj/item/pipe_painter/New()
..()
modes = new()
for(var/C in GLOB.pipe_colors)
modes += "[C]"
mode = pick(modes)
/obj/item/pipe_painter/afterattack(atom/A, mob/user as mob)
if(!istype(A,/obj/machinery/atmospherics/pipe) || istype(A,/obj/machinery/atmospherics/pipe/simple/heat_exchanging) || istype(A,/obj/machinery/atmospherics/pipe/simple/insulated) || !in_range(user, A))
return
var/obj/machinery/atmospherics/pipe/P = A
if(P.pipe_color == "[GLOB.pipe_colors[mode]]")
to_chat(user, "<span class='notice'>This pipe is aready painted [mode]!</span>")
return
var/turf/T = P.loc
if(P.level < 2 && T.level==1 && isturf(T) && T.intact)
to_chat(user, "<span class='warning'>You must remove the plating first.</span>")
return
playsound(loc, usesound, 30, TRUE)
P.change_color(GLOB.pipe_colors[mode])
/obj/item/pipe_painter/attack_self(mob/user as mob)
mode = input("Which colour do you want to use?", name, mode) in modes
/obj/item/pipe_painter/examine(mob/user)
. = ..()
. += "<span class='notice'>It is in [mode] mode.</span>"