Files
Aurora.3/code/game/objects/items/devices/paint_sprayer.dm
T
+2 99b4033ca5 Aurora 2: The 3/4thening (#17186)
* after dark

* FIXES

* breakin

* butt

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

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>

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

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>

* Update code/game/objects/structures/lattice.dm

Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>

* testing 1

* a

* FUCK THIS PRESET!!!

* allah

* OTEMACHI

* tis' done

* Project Exorcism : Sneed's Snairs (Formerly Chuck's)

* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm

* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm

* Update stools.dm

* Update code/game/objects/structures/stool_bed_chair_nest/stools.dm

* Update code/game/objects/structures/stool_bed_chair_nest/stools.dm

* Update stools.dm

* Update chairs.dm

* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm

* inhand fixes

* airlocks (matt has cooked)

fuck

* my cody plays the mamba

* fuck

* fixes layering issue

* airlocks and everything else Please fucking kill me

* underlays

* unfuck blending

* finished replacing old ass shit

* your ass is geass

* conflicts die now

* public fat'wa

* progress on walls and windows

* more mapping

* baltimore accents be like

* minor progress

* monitors

* fire alarms and apc adjustments

* apcs pixel adjustments, final airlock look

* also grilles

* shuttle wall start plus shuttle windows

* starting consoles

* table outlines

* I love broke ass sprites

* fixing the stupid ass exterior walls

* light fuckery

* terminal directionals, external airlocks, table fixes, blahblahblah

* fix 1

* fix 2

* some more fixes

* fix chairs

* basic untested railings and updating colors from atteria

* bridge and some fixes

* removing some artifacts on the new walls

* breaking wood tables and adding 4 wall materials

* fix

* compile & wood fixes

* make the horizon compile again

* railings, firedoors, ATMs, intercomms and tables again

* mapping begins also some tweaks to map view of icons

* full tile steel walls

* i sure hope nothing bad happens

* airlock updates (untested)

* reverts most wall machinery

* skull

* wall coloring

* makes the tg wood chill out

* work on airlocks

* hull consistency

* cause you live forever in the lights you make

* whoops can't show that in a christian manga

* terminals should be on walls and everything's hunky dory now

also i changed the wood stuff as per atteria's suggestion

* fixing airlocks

* fixes

* window resprite, coloring adjustments

* scc hull resprite

* new grilles, frame edits, and borosilicate

* greyscale wood palette improvement

* shuttle windows

* window frame fix

* apc update

* refit and reshaded fire alarms

* mapping icon fixes

* table fixes

* map fixes, platforms and stairs

* updates cutter, new walls and terminals

* mapping fixes

* fix preview

* preview fix stone

* stairs

* initial work for the map

* railing and windowpane fuckery

* new external airlocks

* a

* fix the maps in preparation

* wall object pixel offsets

* air alarms D1

* extinguisher cabinets

* APC DESTROYED MISSION ACCOMPLISHED GOOD WORK

* deck 3: floor decals, APCs, air alarms, fire extinguisher cabinets

* deck 3: fireaxe cabinet

* /shuttle_landmark/distress/blue, move base_turf from map to obj def

* intercom presets

* formatting

* deck 1: floor decals

* deck 2: named area fix (LMAO), signs to use single quotes

* deck 2: floor decals, APCs, air alarms, fire extinguisher cabinets, fireaxe cabinets

* Platforms and stairs!

* grates and bugfixes

* Angled ship walls + grate color fix

* corrects apc anim overlay

* deck 2 and away site fixes

# Conflicts:
#	maps/sccv_horizon/sccv_horizon-2_deck_2.dmm

* deck 2 missing grate

* warning stripes

* railings and ledges

* windows and fixtures

* windoorsagain

* airlocks pt1

* windows de-seamed and transparent

* airlocks and pixel offsets

* fixes for airlocks

* more airlock fixes

* presets for ringer, request console and newscaster

* 132

* asfsaf

* kitchen tiling

* thicker freezer tile bevels

* More angled walls

* New shutters and blast doors

* directional corrections

* ops railing fixes

* updated window map things and shutters

* value changes and blast door changes

* Ledges and platforms galore (D2/D3)

* all decks: fix door dirs

* all decks: newscasters, intercoms, requests consoles, ringer consoles

* helm light blue decals to dark blue

* supermatter door dir fix

* fix directional presets (dirs/offsets): newscaster, intercom, requests console, ringer console

* firedoor changes

* deck 3: overlapping wall mountables fixes

* map changes

* airlock changes

* map tweaks

* airlock & stair icons

* various mapping modifications

* Double airlocks + fixing denied states + fixing airlocks on all levels

* Rebase

* directional terminals buttons and lights again, platform tweaks

terminal north facing sprites, atm/food terminal directionals
proper door control and lightswitch directionals (presets still need to be set up, mapping)
re-adds new light tube sprites, again
new sprites for floor lights and the other stuff that got added
adjusted platforms to be recolorable, added light and dark versions, fixed some shading

* missing ERT outfit thingy fix

* floor lights fixed

* deck 3: various small fixes

* deck 1: various small fixes

* deck 2: various small fixes

* fixes

* d2 fixes & multitile door fix

* d2 fixes, remove unused airlock files, button icon fixes, window icon fixes

* make it actually compile, oops!

* make it actually compile, pt2

* CE office camera

* pew pew pew

* pew pew pew 2

* fixes

* deck 3: buttons fixes

* deck 3: button and other fixes

* deck 3: fixes and stuff

* D1 fixes & skrell airlocks

* minor D2 tweaks

* a lot of airlock-related fixes, glass tables, paint sprayer fixes, decal fixes, changelog

* maintenance hatch sprites

* fixing double doors

* flips multi-tiles, fixes multi-tiles, adds desk windoors

* new plastic flaps

* deck 2: a few buttons

* side + middle doors

* created paths for 3-tiles doors

* apply to map the 3 tiles airlocks

* some fixes, windoor alpha

* remove this random ass potted plant

* more map fixes

* holodeck disposal pipe fix

* secure airlock sprites

no code or obj definitions yet

* vault airlock

* vault door fixes

* scc window alpha

* adjusts double door glass, firedoor open state

* adjusts construction states for doors

* remove some defunct icons and fix anims

* assembly stuff

* pharma fixes

* vault door dir

* firedoor smart generation moved to its own proc

* lift doors, d1 fixes

* firedoor smart generation: adjacent wall check

* firedoor smart generation: adjacent firedoor check

* all decks: missing firedoor and other fixes

* deck 2: weird maint stairs fix

* oops

* diona airlock fix

* the shuttle wall gigadeath

* fixes

* some fixes for leftover map item paths, and double lattices

* new diona walls

* more fixes

* and more

* deck 1: fix out of bounds keys

* deck 3: fix out of bounds keys

* runtime 3: duplicate APCs fix

* all decks: make all 3 tile wide doors glass

---------

Co-authored-by: Wezzy <wowzewow@gmail.com>
Co-authored-by: Wowzewow (Wezzy) <42310821+alsoandanswer@users.noreply.github.com>
Co-authored-by: Cody Brittain <cbrittain10@yahoo.com>
Co-authored-by: kyres1 <noodle.buster31@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: atteria <tarkona@protonmail.com>
Co-authored-by: Fluffy <65877598+FluffyGhoster@users.noreply.github.com>
Co-authored-by: DreamySkrell <107256943+DreamySkrell@users.noreply.github.com>
Co-authored-by: naut <nautilussplat@gmail.com>
Co-authored-by: naut <55491249+nauticall@users.noreply.github.com>
2023-08-30 21:18:10 +00:00

350 lines
12 KiB
Plaintext

#define AIRLOCK_REGION_PAINT "Paint"
#define AIRLOCK_REGION_STRIPE "Stripe"
#define AIRLOCK_REGION_WINDOW "Window"
/obj/item/device/paint_sprayer
name = "paint gun"
desc = "A Hephaestus-made paint gun that uses microbes to replenish its paint storage. Very high-tech and fancy too!"
desc_info = "Use control-click on a coloured decal on a turf to copy its colour. You can also use shift-click on a turf with the paint gun in hand to clear all decals on it."
icon = 'icons/obj/item/tools/paint_sprayer.dmi'
icon_state = "floor_painter"
item_state = "floor_painter"
contained_sprite = TRUE
var/decal = "remove all decals"
var/paint_dir = "precise"
var/paint_colour = COLOR_WHITE
var/list/decals = list(
"quarter-turf" = list("path" = /obj/effect/floor_decal/corner, "precise" = 1, "coloured" = 1),
"wide quarter-turf" = list("path" = /obj/effect/floor_decal/corner_wide, "precise" = 1, "coloured" = 1),
"full quarter-turf" = list("path" = /obj/effect/floor_decal/corner_full, "precise" = 1, "coloured" = 1),
"hazard stripes" = list("path" = /obj/effect/floor_decal/industrial/warning),
"corner, hazard" = list("path" = /obj/effect/floor_decal/industrial/warning/corner),
"hatched marking" = list("path" = /obj/effect/floor_decal/industrial/hatch, "coloured" = 1),
"dotted outline" = list("path" = /obj/effect/floor_decal/industrial/outline, "coloured" = 1),
"loading sign" = list("path" = /obj/effect/floor_decal/industrial/loading),
"1" = list("path" = /obj/effect/floor_decal/sign),
"2" = list("path" = /obj/effect/floor_decal/sign/two),
"A" = list("path" = /obj/effect/floor_decal/sign/a),
"B" = list("path" = /obj/effect/floor_decal/sign/b),
"C" = list("path" = /obj/effect/floor_decal/sign/c),
"D" = list("path" = /obj/effect/floor_decal/sign/d),
"Ex" = list("path" = /obj/effect/floor_decal/sign/ex),
"M" = list("path" = /obj/effect/floor_decal/sign/m),
"CMO" = list("path" = /obj/effect/floor_decal/sign/cmo),
"V" = list("path" = /obj/effect/floor_decal/sign/v),
"Psy" = list("path" = /obj/effect/floor_decal/sign/p),
"remove all decals" = list("path" = /obj/effect/floor_decal/reset)
)
var/list/paint_dirs = list(
"north" = NORTH,
"northwest" = NORTHWEST,
"west" = WEST,
"southwest" = SOUTHWEST,
"south" = SOUTH,
"southeast" = SOUTHEAST,
"east" = EAST,
"northeast" = NORTHEAST,
"precise" = 0
)
var/list/preset_colors = list(
"beasty brown" = COLOR_BEASTY_BROWN,
"blue" = COLOR_BLUE_GRAY,
"civvie green" = COLOR_CIVIE_GREEN,
"command blue" = COLOR_COMMAND_BLUE,
"cyan" = COLOR_CYAN,
"green" = COLOR_GREEN,
"bottle green" = COLOR_PALE_BTL_GREEN,
"dark red" = COLOR_DARK_RED,
"orange" = COLOR_ORANGE,
"pale orange" = COLOR_PALE_ORANGE,
"red" = COLOR_RED,
"sky blue" = COLOR_DEEP_SKY_BLUE,
"titanium" = COLOR_TITANIUM,
"aluminium"= COLOR_ALUMINIUM,
"violet" = COLOR_VIOLET,
"white" = COLOR_WHITE,
"yellow" = COLOR_AMBER,
"hull blue" = COLOR_HULL,
"bulkhead black" = COLOR_WALL_GUNMETAL
)
/obj/item/device/paint_sprayer/afterattack(var/atom/A, var/mob/user, proximity, params)
if(!proximity)
return
var/mob/living/heavy_vehicle/ES = A
if(istype(ES))
to_chat(user, "<span class='warning'>You can't paint an active exosuit. Dismantle it first.</span>")
return
var/obj/structure/heavy_vehicle_frame/EF = A
if(istype(EF))
playsound(get_turf(src), 'sound/effects/spray3.ogg', 30, 1, -6)
EF.set_colour(paint_colour)
return
var/obj/item/mech_component/MC = A
if(istype(MC))
playsound(get_turf(src), 'sound/effects/spray3.ogg', 30, 1, -6)
MC.set_colour(paint_colour)
return
var/obj/structure/bed/B = A
if(istype(B))
playsound(get_turf(src), 'sound/effects/spray3.ogg', 30, 1, -6)
B.set_colour(paint_colour)
B.update_icon()
return
else if (istype(A, /obj/machinery/door/airlock))
return paint_airlock(A, user)
else if (istype(A, /turf/simulated/floor))
return paint_floor(A, user, params)
/obj/item/device/paint_sprayer/proc/paint_floor(turf/simulated/floor/F, mob/user, params)
if(!F.flooring.can_paint)
to_chat(user, SPAN_WARNING("\The [src] cannot paint this type of flooring."))
return
if(!F.flooring || F.broken || F.burnt)
to_chat(user, SPAN_WARNING("\The [src] cannot paint damaged or missing tiles."))
return
var/list/decal_data = decals[decal]
var/config_error
if(!islist(decal_data))
config_error = 1
var/painting_decal
if(!config_error)
painting_decal = decal_data["path"]
if(!ispath(painting_decal))
config_error = 1
if(config_error)
to_chat(user, "<span class='warning'>\The [src] flashes an error light. You might need to reconfigure it.</span>")
return
if(F.decals && F.decals.len > 5 && painting_decal != /obj/effect/floor_decal/reset)
to_chat(user, "<span class='warning'>\The [F] has been painted too much; you need to clear it off.</span>")
return
var/painting_dir = 0
if(paint_dir == "precise")
if(!decal_data["precise"])
painting_dir = user.dir
else
var/list/mouse_control = mouse_safe_xy(params)
var/mouse_x = mouse_control["icon-x"]
var/mouse_y = mouse_control["icon-y"]
if(isnum(mouse_x) && isnum(mouse_y))
if(mouse_x <= 16)
if(mouse_y <= 16)
painting_dir = WEST
else
painting_dir = NORTH
else
if(mouse_y <= 16)
painting_dir = SOUTH
else
painting_dir = EAST
else
painting_dir = user.dir
else if(paint_dirs[paint_dir])
painting_dir = paint_dirs[paint_dir]
var/painting_colour
if(decal_data["coloured"] && paint_colour)
painting_colour = paint_colour
playsound(get_turf(src), 'sound/effects/spray3.ogg', 30, 1, -6)
new painting_decal(F, painting_dir, painting_colour)
/obj/item/device/paint_sprayer/attack_self(var/mob/user)
var/choice = input("Do you wish to change the decal type, paint direction, or paint colour?") as null|anything in list("Decal","Direction", "Colour")
if(choice == "Decal")
choose_decal()
else if(choice == "Direction")
choose_direction()
else if(choice == "Colour")
choose_colour()
/obj/item/device/paint_sprayer/proc/change_colour(new_colour, mob/user)
if (new_colour)
paint_colour = new_colour
if (user)
add_fingerprint(user)
to_chat(user, SPAN_NOTICE("You set \the [src] to paint with <span style='color:[paint_colour]'>a new color</span>."))
update_icon()
playsound(src, 'sound/weapons/blade_open.ogg', 30, 1)
return TRUE
return FALSE
/turf/simulated/floor/Click(location, control, params)
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
var/list/modifiers = params2list(params)
var/obj/item/device/paint_sprayer/paint_sprayer = H.get_active_hand()
if(istype(paint_sprayer))
if(!istype(H.buckled_to))
H.face_atom(src)
if(modifiers["ctrl"] && paint_sprayer.pick_color(src, H))
return
if(modifiers["shift"] && paint_sprayer.remove_paint(src, H))
return
. = ..()
/obj/item/device/paint_sprayer/proc/pick_color(atom/A, mob/user)
if (!user.Adjacent(A) || user.incapacitated())
return FALSE
var/new_color
if (istype(A, /turf/simulated/floor))
new_color = pick_color_from_floor(A, user)
else if (istype(A, /obj/machinery/door/airlock))
new_color = pick_color_from_airlock(A, user)
if (!change_colour(new_color, user))
to_chat(user, SPAN_WARNING("\The [A] does not have a colour that you could pick from."))
return TRUE // There was an attempt to pick a color.
/obj/item/device/paint_sprayer/proc/pick_color_from_floor(turf/simulated/floor/F, mob/user)
if (!F.decals || !F.decals.len)
return FALSE
var/list/available_colors = list()
for (var/img in F.decals)
/// This snowflake code is necessary because for some reason images added to the decals list at roundstart become appearances.
var/image/I = image(img)
available_colors |= isnull(I.color) ? COLOR_WHITE : I.color
var/picked_color = available_colors[1]
if (available_colors.len > 1)
picked_color = input(user, "Which color do you wish to pick from?") as null|anything in available_colors
if (user.incapacitated() || !user.Adjacent(F))
return FALSE
return picked_color
/obj/item/device/paint_sprayer/proc/pick_color_from_airlock(obj/machinery/door/airlock/D, mob/user)
if (!D.paintable)
return FALSE
switch (select_airlock_region(D, user, "Where do you wish to pick the color from?"))
if (AIRLOCK_REGION_PAINT)
return D.door_color
if (AIRLOCK_REGION_STRIPE)
return D.stripe_color
if (AIRLOCK_REGION_WINDOW)
return D.window_color
else
return FALSE
/obj/item/device/paint_sprayer/proc/paint_airlock(obj/machinery/door/airlock/D, mob/user)
if (!D.paintable)
to_chat(user, SPAN_WARNING("You can't paint this airlock type."))
return FALSE
switch (select_airlock_region(D, user, "What do you wish to paint?"))
if (AIRLOCK_REGION_PAINT)
D.paint_airlock(paint_colour)
if (AIRLOCK_REGION_STRIPE)
D.stripe_airlock(paint_colour)
if (AIRLOCK_REGION_WINDOW)
D.paint_window(paint_colour)
else
return FALSE
return TRUE
/obj/item/device/paint_sprayer/proc/select_airlock_region(obj/machinery/door/airlock/D, mob/user, input_text)
var/choice
var/list/choices = list()
if (D.paintable & AIRLOCK_PAINTABLE_MAIN)
choices |= AIRLOCK_REGION_PAINT
if (D.paintable & AIRLOCK_PAINTABLE_STRIPE)
choices |= AIRLOCK_REGION_STRIPE
if (D.paintable & AIRLOCK_PAINTABLE_WINDOW)
choices |= AIRLOCK_REGION_WINDOW
choice = input(user, input_text) as null|anything in sortList(choices)
if (!user.use_check_and_message() || !D || !user.Adjacent(D))
return FALSE
return choice
/obj/item/device/paint_sprayer/proc/remove_paint(atom/A, mob/user)
if(!user.Adjacent(A) || user.incapacitated())
return FALSE
if (istype(A, /turf/simulated/floor))
var/turf/simulated/floor/F = A
if (F.decals && F.decals.len > 0)
F.decals.len--
F.update_icon()
. = TRUE
else if (istype(A, /obj/machinery/door/airlock))
var/obj/machinery/door/airlock/D = A
if (D.paintable)
D.paint_airlock(null)
D.stripe_airlock(null)
D.paint_window(null)
. = TRUE
if (.)
add_fingerprint(user)
playsound(get_turf(src), 'sound/effects/spray3.ogg', 30, 1, -6)
return .
/obj/item/device/paint_sprayer/examine(mob/user)
. = ..(user)
to_chat(user, "It is configured to produce the '[decal]' decal with a direction of '[paint_dir]' using [paint_colour] paint.")
/obj/item/device/paint_sprayer/verb/choose_colour()
set name = "Choose Colour"
set desc = "Choose a paintgun colour."
set category = "Object"
set src in usr
if(usr.incapacitated())
return
var/new_colour = input(usr, "Choose a colour.", "paintgun", paint_colour) as color|null
change_colour(new_colour, usr)
/obj/item/device/paint_sprayer/verb/choose_preset_colour()
set name = "Choose Preset Colour"
set desc = "Choose a paintgun colour."
set category = "Object"
set src in usr
if(usr.incapacitated())
return
var/new_colour = input(usr, "Choose a colour.", "paintgun", paint_colour) as null|anything in preset_colors
if(new_colour && new_colour != paint_colour)
paint_colour = preset_colors[new_colour]
to_chat(usr, "<span class='notice'>You set \the [src] to paint with <font color='[paint_colour]'>a new colour</font>.</span>")
/obj/item/device/paint_sprayer/verb/choose_decal()
set name = "Choose Decal"
set desc = "Choose a paintgun decal."
set category = "Object"
set src in usr
if(usr.incapacitated())
return
var/new_decal = input("Select a decal.") as null|anything in decals
if(new_decal && !isnull(decals[new_decal]))
decal = new_decal
to_chat(usr, "<span class='notice'>You set \the [src] decal to '[decal]'.</span>")
/obj/item/device/paint_sprayer/verb/choose_direction()
set name = "Choose Direction"
set desc = "Choose a paintgun direction."
set category = "Object"
set src in usr
if(usr.incapacitated())
return
var/new_dir = input("Select a direction.") as null|anything in paint_dirs
if(new_dir && !isnull(paint_dirs[new_dir]))
paint_dir = new_dir
to_chat(usr, "<span class='notice'>You set \the [src] direction to '[paint_dir]'.</span>")
#undef AIRLOCK_REGION_PAINT
#undef AIRLOCK_REGION_STRIPE