diff --git a/_maps/map_files/generic/centcomm.dmm b/_maps/map_files/generic/centcomm.dmm index ce1293894ee..43cb2109b0c 100644 --- a/_maps/map_files/generic/centcomm.dmm +++ b/_maps/map_files/generic/centcomm.dmm @@ -6249,6 +6249,7 @@ /obj/machinery/light/spot, /obj/effect/spawner/lootdrop/trade_sol/serv, /obj/structure/closet, +/obj/item/stack/tile/disco_light/thirty, /turf/simulated/floor/mineral/titanium, /area/shuttle/trade/sol) "wb" = ( diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm index 739634d92f2..c0babdafd44 100644 --- a/code/__HELPERS/lists.dm +++ b/code/__HELPERS/lists.dm @@ -855,3 +855,7 @@ return FALSE return TRUE + +// Pick something else from a list than we last picked +/proc/pick_excluding(list/l, exclude) + return pick(l - exclude) diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 33da4f73e6a..9853caa3022 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -260,3 +260,14 @@ /obj/item/stack/tile/arcade_carpet/loaded amount = 20 + +/obj/item/stack/tile/disco_light + name = "disco light tiles" + singular_name = "disco light tile" + desc = "A sheet of disco light tile." + icon_state = "tile_disco" + turf_type = /turf/simulated/floor/light/disco + merge_type = /obj/item/stack/tile/disco_light + +/obj/item/stack/tile/disco_light/thirty + amount = 30 diff --git a/code/game/turfs/simulated/floor/light_floor.dm b/code/game/turfs/simulated/floor/light_floor.dm index 5c8fd14852c..90183627cff 100644 --- a/code/game/turfs/simulated/floor/light_floor.dm +++ b/code/game/turfs/simulated/floor/light_floor.dm @@ -111,3 +111,42 @@ var/color_save = color ..() color = color_save + +// These tiles change color every now and then +/turf/simulated/floor/light/disco + floor_tile = /obj/item/stack/tile/disco_light + /// Cannot change its color with a multitool + can_modify_colour = FALSE + /// The tile can change into these colors + var/list/available_colors = list("#d41e3c", "#ed7b39", "#fff540", "#77b02a", "#488bd4", "#b0fff1", "#94007a", "#ff417d") + /// This is our current color, don't pick it again + var/current_color + +// We pick a random color when we are spawned +/turf/simulated/floor/light/disco/Initialize() + . = ..() + START_PROCESSING(SSobj, src) + +// The animation happens in this proc +/turf/simulated/floor/light/disco/proc/change_color() + current_color = pick_excluding(available_colors, current_color) + animate_fade_to_color_fill(src, current_color, 2) + +// We change colors every now and then +/turf/simulated/floor/light/disco/process() + if(on) + change_color() + +// Admins can toggle its color with advanced admin interaction +/turf/simulated/floor/light/disco/attack_ghost(mob/user) + if(user.can_advanced_admin_interact()) + change_color() + +// One is able to restart it, if power runs out. However, it cannot be turned off! +/turf/simulated/floor/light/disco/attack_hand(mob/user) + if(!on) + toggle_light(TRUE) + +/turf/simulated/floor/light/disco/Destroy() + STOP_PROCESSING(SSobj, src) + return ..() diff --git a/icons/obj/tiles.dmi b/icons/obj/tiles.dmi index 491e7ef33ec..f088426c1a5 100644 Binary files a/icons/obj/tiles.dmi and b/icons/obj/tiles.dmi differ