some more globals (#19098)

* some more globals

* .
This commit is contained in:
Kashargul
2026-01-29 09:21:58 -08:00
committed by GitHub
parent 24e68536bc
commit fdfb49012b
50 changed files with 164 additions and 176 deletions
@@ -1,18 +1,18 @@
/*****************Marker Beacons**************************/
var/list/marker_beacon_colors = list(
"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
)
GLOBAL_LIST_INIT(marker_beacon_colors, list(
"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"
@@ -73,7 +73,7 @@ var/list/marker_beacon_colors = list(
if(!in_range(src, user))
return
var/options = marker_beacon_colors.Copy()
var/options = GLOB.marker_beacon_colors.Copy()
options += list("Random" = FALSE) //not a true color, will pick a random color
var/input_color = tgui_input_list(user, "Choose a color.", "Beacon Color", options)
if(user.incapacitated() || !istype(user) || !in_range(src, user))
@@ -111,10 +111,10 @@ var/list/marker_beacon_colors = list(
. += span_notice("Alt-click to select a color. Current color is [picked_color].")
/obj/structure/marker_beacon/update_icon()
if(!picked_color || !marker_beacon_colors[picked_color])
picked_color = pick(marker_beacon_colors)
if(!picked_color || !GLOB.marker_beacon_colors[picked_color])
picked_color = pick(GLOB.marker_beacon_colors)
icon_state = "[icon_base][lowertext(picked_color)]-on"
set_light(light_range, light_power, marker_beacon_colors[picked_color])
set_light(light_range, light_power, GLOB.marker_beacon_colors[picked_color])
/obj/structure/marker_beacon/attack_hand(mob/living/user)
if(perma)
@@ -152,7 +152,7 @@ var/list/marker_beacon_colors = list(
if(!in_range(src, user))
return
var/options = marker_beacon_colors.Copy()
var/options = GLOB.marker_beacon_colors.Copy()
options += list("Random" = FALSE) //not a true color, will pick a random color
var/input_color = tgui_input_list(user, "Choose a color.", "Beacon Color", options)
if(user.incapacitated() || !istype(user) || !in_range(src, user))
@@ -117,7 +117,6 @@
user.drop_l_hand()
user.stop_pulling()
var/last_chew = 0
/mob/living/carbon/human/RestrainedClickOn(var/atom/A)
if (A != src) return ..()
if (last_chew + 26 > world.time) return
+13 -14
View File
@@ -26,8 +26,13 @@
return INITIALIZE_HINT_QDEL
var/list/image/hazard_overlays
var/list/tape_roll_applications = list()
GLOBAL_LIST_INIT_TYPED(hazard_overlays, /image, list(
"[NORTH]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "N"),
"[EAST]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "E"),
"[SOUTH]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "S"),
"[WEST]" = new/image('icons/effects/warning_stripes.dmi', icon_state = "W")
))
GLOBAL_LIST_EMPTY(tape_roll_applications)
/obj/item/tape
name = "tape"
@@ -55,12 +60,6 @@ var/list/tape_roll_applications = list()
/obj/item/tape/Initialize(mapload)
. = ..()
if(!hazard_overlays)
hazard_overlays = list()
hazard_overlays["[NORTH]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "N")
hazard_overlays["[EAST]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "E")
hazard_overlays["[SOUTH]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "S")
hazard_overlays["[WEST]"] = new/image('icons/effects/warning_stripes.dmi', icon_state = "W")
update_icon()
/obj/item/taperoll/medical
@@ -301,18 +300,18 @@ var/list/tape_roll_applications = list()
if (istype(A, /turf/simulated/floor) ||istype(A, /turf/unsimulated/floor))
var/turf/F = A
var/direction = user.loc == F ? user.dir : turn(user.dir, 180)
var/icon/hazard_overlay = hazard_overlays["[direction]"]
if(tape_roll_applications[F] == null)
tape_roll_applications[F] = 0
var/icon/hazard_overlay = GLOB.hazard_overlays["[direction]"]
if(GLOB.tape_roll_applications[F] == null)
GLOB.tape_roll_applications[F] = 0
if(tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work.
if(GLOB.tape_roll_applications[F] & direction) // hazard_overlay in F.overlays wouldn't work.
user.visible_message("\The [user] uses the adhesive of \the [src] to remove area markings from \the [F].", "You use the adhesive of \the [src] to remove area markings from \the [F].")
F.cut_overlay(hazard_overlay)
tape_roll_applications[F] &= ~direction
GLOB.tape_roll_applications[F] &= ~direction
else
user.visible_message("\The [user] applied \the [src] on \the [F] to create area markings.", "You apply \the [src] on \the [F] to create area markings.")
F.add_overlay(hazard_overlay)
tape_roll_applications[F] |= direction
GLOB.tape_roll_applications[F] |= direction
return
/obj/item/tape/proc/crumple()