Files
Paradise/code/game/objects/items/devices/painter/airlock_painter.dm
SabreML 150e7e3f60 Painter Item Refactor (#15828)
* Modular Painter V1

* Improved Suicide

* Type & Text

Also `item_state` just goes from `icon_state` so it's not needed.

* Modular Painter V2

Big refactor of everything to use datums rather than separate objects.

* Steel airlock stuff

Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>

* Vile Heresy

Co-authored-by: Sean Williams <12197162+S34NW@users.noreply.github.com>

Co-authored-by: SteelSlayer <42044220+SteelSlayer@users.noreply.github.com>
Co-authored-by: Sean Williams <12197162+S34NW@users.noreply.github.com>
2021-07-20 15:25:45 +01:00

62 lines
2.8 KiB
Plaintext

/datum/painter/airlock
module_name = "airlock painter"
module_desc = "An advanced autopainter preprogrammed with several paintjobs for airlocks. Use it on a completed airlock to change its paintjob."
module_state = "airlock_painter"
// All the different paint jobs that an airlock painter can apply.
// If the airlock you're using it on is glass, the new paint job will also be glass
var/list/available_paint_jobs = list(
"Atmospherics" = /obj/machinery/door/airlock/atmos,
"Command" = /obj/machinery/door/airlock/command,
"Engineering" = /obj/machinery/door/airlock/engineering,
"External" = /obj/machinery/door/airlock/external,
"External Maintenance"= /obj/machinery/door/airlock/maintenance/external,
"Freezer" = /obj/machinery/door/airlock/freezer,
"Maintenance" = /obj/machinery/door/airlock/maintenance,
"Medical" = /obj/machinery/door/airlock/medical,
"Mining" = /obj/machinery/door/airlock/mining,
"Public" = /obj/machinery/door/airlock/public,
"Research" = /obj/machinery/door/airlock/research,
"Science" = /obj/machinery/door/airlock/science,
"Security" = /obj/machinery/door/airlock/security,
"Standard" = /obj/machinery/door/airlock)
/datum/painter/airlock/pick_color(mob/user)
var/choice = input(user, "Please select a paintjob.") as null|anything in available_paint_jobs
if(!choice)
return
paint_setting = choice
to_chat(user, "<span class='notice'>The [paint_setting] paint setting has been selected.</span>")
/datum/painter/airlock/paint_atom(atom/target, mob/user)
if(!istype(target, /obj/machinery/door/airlock))
return
var/obj/machinery/door/airlock/A = target
if(!paint_setting)
to_chat(user, "<span class='warning'>You need to select a paintjob first.</span>")
return
if(!A.paintable)
to_chat(user, "<span class='warning'>This type of airlock cannot be painted.</span>")
return
var/obj/machinery/door/airlock/airlock = available_paint_jobs["[paint_setting]"] // get the airlock type path associated with the airlock name the user just chose
var/obj/structure/door_assembly/assembly = initial(airlock.assemblytype)
if(A.assemblytype == assembly)
to_chat(user, "<span class='notice'>This airlock is already painted with the \"[paint_setting]\" color scheme!</span>")
return
if(A.airlock_material == "glass" && initial(assembly.noglass)) // prevents painting glass airlocks with a paint job that doesn't have a glass version, such as the freezer
to_chat(user, "<span class='warning'>This paint job can only be applied to non-glass airlocks.</span>")
return
if(do_after(user, 2 SECONDS, FALSE, A))
// applies the user-chosen airlock's icon, overlays and assemblytype to the target airlock
A.icon = initial(airlock.icon)
A.overlays_file = initial(airlock.overlays_file)
A.assemblytype = initial(airlock.assemblytype)
A.update_icon()
return TRUE