mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 11:35:19 +01:00
Added more colour defines, added functionality to the floor painter.
This commit is contained in:
+15
-7
@@ -63,15 +63,23 @@
|
||||
#define LIFE_HUD 10 // STATUS_HUD that only reports dead or alive
|
||||
|
||||
//some colors
|
||||
#define COLOR_RED "#FF0000"
|
||||
#define COLOR_GREEN "#00FF00"
|
||||
#define COLOR_BLUE "#0000FF"
|
||||
#define COLOR_CYAN "#00FFFF"
|
||||
#define COLOR_PINK "#FF00FF"
|
||||
#define COLOR_YELLOW "#FFFF00"
|
||||
#define COLOR_ORANGE "#FF9900"
|
||||
#define COLOR_WHITE "#FFFFFF"
|
||||
#define COLOR_SILVER "#C0C0C0"
|
||||
#define COLOR_GRAY "#808080"
|
||||
#define COLOR_BLACK "#000000"
|
||||
#define COLOR_RED "#FF0000"
|
||||
#define COLOR_MAROON "#800000"
|
||||
#define COLOR_YELLOW "#FFFF00"
|
||||
#define COLOR_OLIVE "#808000"
|
||||
#define COLOR_LIME "#00FF00"
|
||||
#define COLOR_GREEN "#008000"
|
||||
#define COLOR_CYAN "#00FFFF"
|
||||
#define COLOR_TEAL "#008080"
|
||||
#define COLOR_BLUE "#0000FF"
|
||||
#define COLOR_NAVY "#000080"
|
||||
#define COLOR_PINK "#FF00FF"
|
||||
#define COLOR_PURPLE "#800080"
|
||||
#define COLOR_ORANGE "#FF9900"
|
||||
|
||||
// Shuttles.
|
||||
|
||||
|
||||
@@ -1,47 +1,36 @@
|
||||
#define CELLS 4
|
||||
#define CELLSIZE (32/CELLS)
|
||||
|
||||
/obj/item/device/floor_painter
|
||||
name = "floor painter"
|
||||
icon = 'icons/obj/bureaucracy.dmi'
|
||||
icon_state = "labeler1"
|
||||
item_state = "flight"
|
||||
|
||||
var/list/decals = list(
|
||||
"white square" = /obj/effect/floor_decal/corner,
|
||||
"blue square" = /obj/effect/floor_decal/corner/blue,
|
||||
"pale blue square" = /obj/effect/floor_decal/corner/paleblue,
|
||||
"green square" = /obj/effect/floor_decal/corner/green,
|
||||
"lime square" = /obj/effect/floor_decal/corner/lime,
|
||||
"yellow square" = /obj/effect/floor_decal/corner/yellow,
|
||||
"beige square" = /obj/effect/floor_decal/corner/beige,
|
||||
"red square" = /obj/effect/floor_decal/corner/red,
|
||||
"pink square" = /obj/effect/floor_decal/corner/pink,
|
||||
"purple square" = /obj/effect/floor_decal/corner/purple,
|
||||
"mauve square" = /obj/effect/floor_decal/corner/mauve,
|
||||
"orange square" = /obj/effect/floor_decal/corner/orange,
|
||||
"brown square" = /obj/effect/floor_decal/corner/brown,
|
||||
"grey square" = /obj/effect/floor_decal/corner/grey,
|
||||
"hazard stripes" = /obj/effect/floor_decal/industrial/warning,
|
||||
"corner, hazard" = /obj/effect/floor_decal/industrial/warning/corner,
|
||||
"hatched marking" = /obj/effect/floor_decal/industrial/hatch,
|
||||
"white outline" = /obj/effect/floor_decal/industrial/outline,
|
||||
"blue outline" = /obj/effect/floor_decal/industrial/outline/blue,
|
||||
"yellow outline" = /obj/effect/floor_decal/industrial/outline/yellow,
|
||||
"grey outline" = /obj/effect/floor_decal/industrial/outline/grey,
|
||||
"loading sign" = /obj/effect/floor_decal/industrial/loading,
|
||||
"1" = /obj/effect/floor_decal/sign,
|
||||
"2" = /obj/effect/floor_decal/sign/two,
|
||||
"A" = /obj/effect/floor_decal/sign/a,
|
||||
"B" = /obj/effect/floor_decal/sign/b,
|
||||
"C" = /obj/effect/floor_decal/sign/c,
|
||||
"D" = /obj/effect/floor_decal/sign/d,
|
||||
"Ex" = /obj/effect/floor_decal/sign/ex,
|
||||
"M" = /obj/effect/floor_decal/sign/m,
|
||||
"CMO" = /obj/effect/floor_decal/sign/cmo,
|
||||
"V" = /obj/effect/floor_decal/sign/v,
|
||||
"Psy" = /obj/effect/floor_decal/sign/p,
|
||||
"remove all decals" = /obj/effect/floor_decal/reset
|
||||
)
|
||||
var/decal = "remove all decals"
|
||||
var/decal = "remove all decals"
|
||||
var/paint_dir = "precise"
|
||||
var/paint_colour = "white"
|
||||
|
||||
var/list/decals = list(
|
||||
"quarter-turf" = list("path" = /obj/effect/floor_decal/corner, "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),
|
||||
"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,
|
||||
@@ -51,11 +40,41 @@
|
||||
"southeast" = SOUTHEAST,
|
||||
"east" = EAST,
|
||||
"northeast" = NORTHEAST,
|
||||
"user-facing" = 0
|
||||
"precise" = 0
|
||||
)
|
||||
var/list/paint_colours = list(
|
||||
"white" = COLOR_WHITE,
|
||||
"light gray" = COLOR_SILVER,
|
||||
"dark gray" = COLOR_GRAY,
|
||||
"blue-grey" = "#6A97B0",
|
||||
"pale blue-grey" = "#8BBBD5",
|
||||
"green-grey" = "#8DAF6A",
|
||||
"pale green-gray" = "#AED18B",
|
||||
"red-gray" = "#AA5F61",
|
||||
"pale red-gray" = "#CC9090",
|
||||
"purple-gray" = "#A2819E",
|
||||
"pale purple-gray" = "#BDA2BA",
|
||||
"black" = COLOR_BLACK,
|
||||
"red" = COLOR_RED,
|
||||
"dark red" = COLOR_MAROON,
|
||||
"yellow" = COLOR_YELLOW,
|
||||
"dark yellow" = COLOR_OLIVE,
|
||||
"green" = COLOR_LIME,
|
||||
"dark green" = COLOR_GREEN,
|
||||
"cyan" = COLOR_CYAN,
|
||||
"teal" = COLOR_TEAL,
|
||||
"blue" = COLOR_BLUE,
|
||||
"dark blue" = COLOR_NAVY,
|
||||
"magenta" = COLOR_PINK,
|
||||
"purple" = COLOR_PURPLE,
|
||||
"orange" = COLOR_ORANGE,
|
||||
"dark orange" = "#B95A00",
|
||||
"dark brown" = "#917448",
|
||||
"brown" = "#B19664",
|
||||
"pale brown" = "#CEB689"
|
||||
)
|
||||
var/paint_dir = "user-facing"
|
||||
|
||||
/obj/item/device/floor_painter/afterattack(var/atom/A, var/mob/user, proximity)
|
||||
/obj/item/device/floor_painter/afterattack(var/atom/A, var/mob/user, proximity, params)
|
||||
if(!proximity)
|
||||
return
|
||||
|
||||
@@ -68,25 +87,58 @@
|
||||
user << "<span class='warning'>\The [src] cannot paint broken or missing tiles.</span>"
|
||||
return
|
||||
|
||||
if(F.decals && F.decals.len > 5)
|
||||
user << "<span class='warning'>\The [F] has been painted too much; you need to clear it off.</span>"
|
||||
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
|
||||
|
||||
var/painting_decal = decals[decal]
|
||||
if(!ispath(painting_decal))
|
||||
if(config_error)
|
||||
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)
|
||||
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 == "user-facing")
|
||||
painting_dir = user.dir
|
||||
if(paint_dir == "precise")
|
||||
if(!decal_data["precise"])
|
||||
painting_dir = user.dir
|
||||
else
|
||||
var/list/mouse_control = params2list(params)
|
||||
var/mouse_x = text2num(mouse_control["icon-x"])
|
||||
var/mouse_y = text2num(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]
|
||||
new painting_decal(F, painting_dir)
|
||||
|
||||
var/painting_colour
|
||||
if(paint_colour && !isnull(paint_colours[paint_colour]) && decal_data["coloured"])
|
||||
painting_colour = paint_colours[paint_colour]
|
||||
|
||||
new painting_decal(F, painting_dir, painting_colour)
|
||||
|
||||
/obj/item/device/floor_painter/attack_self(mob/user as mob)
|
||||
|
||||
var/choice = input("Do you wish to change the decal type or the paint direction?") as null|anything in list("Decal","Direction")
|
||||
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")
|
||||
var/new_decal = input("Select a decal.") as null|anything in decals
|
||||
if(new_decal && !isnull(decals[new_decal]))
|
||||
@@ -97,7 +149,54 @@
|
||||
if(new_dir && !isnull(paint_dirs[new_dir]))
|
||||
paint_dir = new_dir
|
||||
user << "<span class='notice'>You set \the [src] direction to '[paint_dir]'.</span>"
|
||||
else if(choice == "Colour")
|
||||
var/new_colour = input("Select a colour.") as null|anything in paint_colours
|
||||
if(new_colour && !isnull(paint_colours[new_colour]))
|
||||
paint_colour = new_colour
|
||||
user << "<span class='notice'>You set \the [src] colour to '[paint_colour]'.</span>"
|
||||
|
||||
/obj/item/device/floor_painter/examine(mob/user)
|
||||
..(user)
|
||||
user << "It is configured to paint the '[decal]' decal with a direction of '[paint_dir]'."
|
||||
user << "It is configured to produce the '[decal]' decal with a direction of '[paint_dir]' using [paint_colour] paint."
|
||||
|
||||
/obj/item/device/floor_painter/verb/choose_colour(new_colour in paint_colours)
|
||||
set name = "Choose Colour"
|
||||
set desc = "Choose a floor painter colour."
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(new_colour && !isnull(paint_colours[new_colour]))
|
||||
paint_colour = new_colour
|
||||
usr << "<span class='notice'>You set \the [src] colour to '[paint_colour]'.</span>"
|
||||
|
||||
/obj/item/device/floor_painter/verb/choose_decal(new_decal in decals)
|
||||
set name = "Choose Decal"
|
||||
set desc = "Choose a floor painter decal."
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(new_decal && !isnull(decals[new_decal]))
|
||||
decal = new_decal
|
||||
usr << "<span class='notice'>You set \the [src] decal to '[decal]'.</span>"
|
||||
|
||||
/obj/item/device/floor_painter/verb/choose_direction(new_dir in paint_dirs)
|
||||
set name = "Choose Direction"
|
||||
set desc = "Choose a floor painter direction."
|
||||
set category = "Object"
|
||||
set src in usr
|
||||
|
||||
if(usr.incapacitated())
|
||||
return
|
||||
|
||||
if(new_dir && !isnull(paint_dirs[new_dir]))
|
||||
paint_dir = new_dir
|
||||
usr << "<span class='notice'>You set \the [src] direction to '[paint_dir]'.</span>"
|
||||
|
||||
#undef CELLS
|
||||
#undef CELLSIZE
|
||||
|
||||
@@ -9,8 +9,9 @@ var/list/floor_decals = list()
|
||||
layer = TURF_LAYER + 0.01
|
||||
var/supplied_dir
|
||||
|
||||
/obj/effect/floor_decal/New(var/newloc, var/newdir)
|
||||
/obj/effect/floor_decal/New(var/newloc, var/newdir, var/newcolour)
|
||||
supplied_dir = newdir
|
||||
if(newcolour) color = newcolour
|
||||
..(newloc)
|
||||
|
||||
/obj/effect/floor_decal/initialize()
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
if("Yellow")
|
||||
colour = COLOR_YELLOW
|
||||
if("Green")
|
||||
colour = COLOR_GREEN
|
||||
colour = COLOR_LIME
|
||||
if("Pink")
|
||||
colour = COLOR_PINK
|
||||
if("Blue")
|
||||
|
||||
@@ -50,7 +50,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
color = COLOR_YELLOW
|
||||
|
||||
/obj/structure/cable/green
|
||||
color = COLOR_GREEN
|
||||
color = COLOR_LIME
|
||||
|
||||
/obj/structure/cable/blue
|
||||
color = COLOR_BLUE
|
||||
@@ -538,7 +538,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
|
||||
/obj/item/stack/cable_coil/update_icon()
|
||||
if (!color)
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_ORANGE, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
if(amount == 1)
|
||||
icon_state = "coil1"
|
||||
name = "cable piece"
|
||||
@@ -597,7 +597,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
if("Yellow")
|
||||
color = COLOR_YELLOW
|
||||
if("Green")
|
||||
color = COLOR_GREEN
|
||||
color = COLOR_LIME
|
||||
if("Pink")
|
||||
color = COLOR_PINK
|
||||
if("Blue")
|
||||
@@ -878,7 +878,7 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
color = COLOR_BLUE
|
||||
|
||||
/obj/item/stack/cable_coil/green
|
||||
color = COLOR_GREEN
|
||||
color = COLOR_LIME
|
||||
|
||||
/obj/item/stack/cable_coil/pink
|
||||
color = COLOR_PINK
|
||||
@@ -893,5 +893,5 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
color = COLOR_WHITE
|
||||
|
||||
/obj/item/stack/cable_coil/random/New()
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
color = pick(COLOR_RED, COLOR_BLUE, COLOR_LIME, COLOR_WHITE, COLOR_PINK, COLOR_YELLOW, COLOR_CYAN)
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user