mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Ports /TG/'s Marker Beacons (#4529)
Ports an item stack that can be used to mark trails, useful for explorers, miners, and anyone else who doesn't want to get lost or wants to make the room more colorful.
This commit is contained in:
@@ -49,3 +49,28 @@
|
||||
#define CL_MATRIX_CG 18
|
||||
#define CL_MATRIX_CB 19
|
||||
#define CL_MATRIX_CA 20
|
||||
|
||||
//Some defines to generalise colours used in lighting.
|
||||
//Important note on colors. Colors can end up significantly different from the basic html picture, especially when saturated
|
||||
#define LIGHT_COLOR_RED "#FA8282" //Warm but extremely diluted red. rgb(250, 130, 130)
|
||||
#define LIGHT_COLOR_GREEN "#64C864" //Bright but quickly dissipating neon green. rgb(100, 200, 100)
|
||||
#define LIGHT_COLOR_BLUE "#6496FA" //Cold, diluted blue. rgb(100, 150, 250)
|
||||
|
||||
#define LIGHT_COLOR_BLUEGREEN "#7DE1AF" //Light blueish green. rgb(125, 225, 175)
|
||||
#define LIGHT_COLOR_CYAN "#7DE1E1" //Diluted cyan. rgb(125, 225, 225)
|
||||
#define LIGHT_COLOR_LIGHT_CYAN "#40CEFF" //More-saturated cyan. rgb(64, 206, 255)
|
||||
#define LIGHT_COLOR_DARK_BLUE "#6496FA" //Saturated blue. rgb(51, 117, 248)
|
||||
#define LIGHT_COLOR_PINK "#E17DE1" //Diluted, mid-warmth pink. rgb(225, 125, 225)
|
||||
#define LIGHT_COLOR_YELLOW "#E1E17D" //Dimmed yellow, leaning kaki. rgb(225, 225, 125)
|
||||
#define LIGHT_COLOR_BROWN "#966432" //Clear brown, mostly dim. rgb(150, 100, 50)
|
||||
#define LIGHT_COLOR_ORANGE "#FA9632" //Mostly pure orange. rgb(250, 150, 50)
|
||||
#define LIGHT_COLOR_PURPLE "#952CF4" //Light Purple. rgb(149, 44, 244)
|
||||
#define LIGHT_COLOR_LAVENDER "#9B51FF" //Less-saturated light purple. rgb(155, 81, 255)
|
||||
|
||||
//These ones aren't a direct colour like the ones above, because nothing would fit
|
||||
#define LIGHT_COLOR_FIRE "#FAA019" //Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25)
|
||||
#define LIGHT_COLOR_LAVA "#C48A18" //Very warm yellow, leaning slightly towards orange. rgb(196, 138, 24)
|
||||
#define LIGHT_COLOR_FLARE "#FA644B" //Bright, non-saturated red. Leaning slightly towards pink for visibility. rgb(250, 100, 75)
|
||||
#define LIGHT_COLOR_SLIME_LAMP "#AFC84B" //Weird color, between yellow and green, very slimy. rgb(175, 200, 75)
|
||||
#define LIGHT_COLOR_TUNGSTEN "#FAE1AF" //Extremely diluted yellow, close to skin color (for some reason). rgb(250, 225, 175)
|
||||
#define LIGHT_COLOR_HALOGEN "#F0FAFA" //Barely visible cyan-ish hue, as the doctor prescribed. rgb(240, 250, 250)
|
||||
@@ -321,7 +321,7 @@
|
||||
w_class = ITEMSIZE_SMALL
|
||||
brightness_on = 8 // Pretty bright.
|
||||
light_power = 3
|
||||
light_color = "#e58775"
|
||||
light_color = LIGHT_COLOR_FLARE
|
||||
icon_state = "flare"
|
||||
item_state = "flare"
|
||||
action_button_name = null //just pull it manually, neckbeard.
|
||||
|
||||
138
code/game/objects/items/stacks/marker_beacons.dm
Normal file
138
code/game/objects/items/stacks/marker_beacons.dm
Normal file
@@ -0,0 +1,138 @@
|
||||
/*****************Marker Beacons**************************/
|
||||
var/list/marker_beacon_colors = list(
|
||||
"Random" = FALSE, //not a true color, will pick a random color
|
||||
"Burgundy" = LIGHT_COLOR_FLARE,
|
||||
"Bronze" = LIGHT_COLOR_ORANGE,
|
||||
"Yellow" = LIGHT_COLOR_YELLOW,
|
||||
"Lime" = LIGHT_COLOR_SLIME_LAMP,
|
||||
"Olive" = LIGHT_COLOR_GREEN,
|
||||
"Jade" = LIGHT_COLOR_BLUEGREEN,
|
||||
"Teal" = LIGHT_COLOR_LIGHT_CYAN,
|
||||
"Cerulean" = LIGHT_COLOR_BLUE,
|
||||
"Indigo" = LIGHT_COLOR_DARK_BLUE,
|
||||
"Purple" = LIGHT_COLOR_PURPLE,
|
||||
"Violet" = LIGHT_COLOR_LAVENDER,
|
||||
"Fuchsia" = LIGHT_COLOR_PINK
|
||||
)
|
||||
|
||||
/obj/item/stack/marker_beacon
|
||||
name = "marker beacons"
|
||||
singular_name = "marker beacon"
|
||||
desc = "Prismatic path illumination devices. Used by explorers and miners to mark paths and warn of danger."
|
||||
description_info = "Use inhand to drop one marker beacon. You can pick them up again with an empty hand or \
|
||||
hitting them with this marker stack. Alt-click to select a specific color."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "marker"
|
||||
max_amount = 100
|
||||
no_variants = TRUE
|
||||
var/picked_color = "random"
|
||||
|
||||
/obj/item/stack/marker_beacon/ten
|
||||
amount = 10
|
||||
|
||||
/obj/item/stack/marker_beacon/thirty
|
||||
amount = 30
|
||||
|
||||
/obj/item/stack/marker_beacon/hundred
|
||||
amount = 100
|
||||
|
||||
/obj/item/stack/marker_beacon/initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
/obj/item/stack/marker_beacon/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>Use in-hand to place a [singular_name].</span>")
|
||||
to_chat(user, "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>")
|
||||
|
||||
/obj/item/stack/marker_beacon/update_icon()
|
||||
icon_state = "[initial(icon_state)][lowertext(picked_color)]"
|
||||
|
||||
/obj/item/stack/marker_beacon/attack_self(mob/user)
|
||||
if(!isturf(user.loc))
|
||||
to_chat(user, "<span class='warning'>You need more space to place a [singular_name] here.</span>")
|
||||
return
|
||||
if(locate(/obj/structure/marker_beacon) in user.loc)
|
||||
to_chat(user, "<span class='warning'>There is already a [singular_name] here.</span>")
|
||||
return
|
||||
if(use(1))
|
||||
to_chat(user, "<span class='notice'>You activate and anchor [amount ? "a":"the"] [singular_name] in place.</span>")
|
||||
playsound(user, 'sound/machines/click.ogg', 50, 1)
|
||||
var/obj/structure/marker_beacon/M = new(user.loc, picked_color)
|
||||
transfer_fingerprints_to(M)
|
||||
|
||||
/obj/item/stack/marker_beacon/AltClick(mob/living/user)
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
return
|
||||
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in marker_beacon_colors
|
||||
if(user.incapacitated() || !istype(user) || !in_range(src, user))
|
||||
return
|
||||
if(input_color)
|
||||
picked_color = input_color
|
||||
update_icon()
|
||||
|
||||
/obj/structure/marker_beacon
|
||||
name = "marker beacon"
|
||||
desc = "A prismatic path illumination device. It is anchored in place and glowing steadily."
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
icon_state = "marker"
|
||||
// layer = BELOW_OPEN_DOOR_LAYER
|
||||
anchored = TRUE
|
||||
light_range = 2
|
||||
light_power = 3
|
||||
var/remove_speed = 15
|
||||
var/picked_color
|
||||
|
||||
/obj/structure/marker_beacon/New(newloc, set_color)
|
||||
. = ..()
|
||||
picked_color = set_color
|
||||
update_icon()
|
||||
|
||||
/obj/structure/marker_beacon/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>Alt-click to select a color. Current color is [picked_color].</span>")
|
||||
|
||||
/obj/structure/marker_beacon/update_icon()
|
||||
while(!picked_color || !marker_beacon_colors[picked_color])
|
||||
picked_color = pick(marker_beacon_colors)
|
||||
icon_state = "[initial(icon_state)][lowertext(picked_color)]-on"
|
||||
set_light(light_range, light_power, marker_beacon_colors[picked_color])
|
||||
|
||||
/obj/structure/marker_beacon/attack_hand(mob/living/user)
|
||||
to_chat(user, "<span class='notice'>You start picking [src] up...</span>")
|
||||
if(do_after(user, remove_speed, target = src))
|
||||
var/obj/item/stack/marker_beacon/M = new(loc)
|
||||
M.picked_color = picked_color
|
||||
M.update_icon()
|
||||
transfer_fingerprints_to(M)
|
||||
if(user.put_in_hands(M, TRUE)) //delete the beacon if it fails
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
qdel(src) //otherwise delete us
|
||||
|
||||
/obj/structure/marker_beacon/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/stack/marker_beacon))
|
||||
var/obj/item/stack/marker_beacon/M = I
|
||||
to_chat(user, "<span class='notice'>You start picking [src] up...</span>")
|
||||
if(do_after(user, remove_speed, target = src) && M.amount + 1 <= M.max_amount)
|
||||
M.add(1)
|
||||
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
qdel(src)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/marker_beacon/AltClick(mob/living/user)
|
||||
..()
|
||||
if(user.incapacitated() || !istype(user))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
return
|
||||
if(!in_range(src, user))
|
||||
return
|
||||
var/input_color = input(user, "Choose a color.", "Beacon Color") as null|anything in marker_beacon_colors
|
||||
if(user.incapacitated() || !istype(user) || !in_range(src, user))
|
||||
return
|
||||
if(input_color)
|
||||
picked_color = input_color
|
||||
update_icon()
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 44 KiB |
@@ -51,6 +51,7 @@
|
||||
new /obj/item/device/geiger(src)
|
||||
new /obj/item/weapon/cell/device(src)
|
||||
new /obj/item/device/radio(src)
|
||||
new /obj/item/stack/marker_beacon/thirty(src)
|
||||
return
|
||||
|
||||
/obj/structure/closet/secure_closet/sar
|
||||
|
||||
@@ -873,6 +873,7 @@
|
||||
#include "code\game\objects\items\robot\robot_parts.dm"
|
||||
#include "code\game\objects\items\robot\robot_upgrades.dm"
|
||||
#include "code\game\objects\items\stacks\fifty_spawner.dm"
|
||||
#include "code\game\objects\items\stacks\marker_beacons.dm"
|
||||
#include "code\game\objects\items\stacks\matter_synth.dm"
|
||||
#include "code\game\objects\items\stacks\medical.dm"
|
||||
#include "code\game\objects\items\stacks\nanopaste.dm"
|
||||
|
||||
Reference in New Issue
Block a user