Skip to content

Commit

Permalink
Merge branch 'Hybrisa' of https://github.com/Zenith00000/cmss13 into …
Browse files Browse the repository at this point in the history
…Hybrisa
  • Loading branch information
Zenith00000 committed May 31, 2024
2 parents cfafdf4 + 904751a commit e287fa1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
19 changes: 13 additions & 6 deletions code/__HELPERS/lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,19 @@
return list[index]
return

//Checks for specific types in a list
/proc/is_type_in_list(atom/A, list/L)
for(var/type in L)
if(istype(A, type))
return 1
return 0
///Checks if the needle atom is any type in the type_list
/proc/is_type_in_list(atom/needle, list/type_list)
for(var/type in type_list)
if(istype(needle, type))
return TRUE
return FALSE

///Checks if the needle path derives from any in the path_list
/proc/is_path_in_list(needle, list/path_list)
for(var/path in path_list)
if(ispath(needle, path))
return TRUE
return FALSE

//Removes any null entries from the list
/proc/listclearnulls(list/list)
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/bio-dome_floodlights.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/obj/structure/machinery/colony_floodlight_switch/hydro_floodlight_switch
name = "Biodome Floodlight Switch"
name = "biodome floodlight switch"
icon = 'icons/obj/structures/machinery/power.dmi'
icon_state = "panelnopower"
desc = "This switch controls the floodlights surrounding the archaeology complex. It only functions when there is power."
Expand All @@ -14,7 +14,7 @@
icon_state = "paneloff"

/obj/structure/machinery/hydro_floodlight // TODO: Repath under /obj/structure/machinery/colony_floodlight
name = "Biodome Floodlight"
name = "biodome floodlight"
icon = 'icons/obj/structures/machinery/big_floodlight.dmi'
icon_state = "flood_s_off"
density = TRUE
Expand Down
11 changes: 8 additions & 3 deletions code/game/machinery/colony_floodlights.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ GLOBAL_LIST_INIT(all_breaker_switches, list())
/obj/structure/machinery/colony_floodlight_switch/Initialize(mapload, ...)
. = ..()
for(var/obj/structure/machinery/colony_floodlight_switch/other_switch as anything in GLOB.all_breaker_switches)
if(!length(other_switch.machinery_type_whitelist))
continue
machinery_type_blacklist |= other_switch.machinery_type_whitelist
// blacklist anything other switches whitelist if theres subtype overlap
for(var/other_whitelisted in other_switch.machinery_type_whitelist)
if(is_path_in_list(other_whitelisted, machinery_type_whitelist))
machinery_type_blacklist |= other_whitelisted
for(var/our_whitelisted in machinery_type_whitelist)
if(is_path_in_list(our_whitelisted, other_switch.machinery_type_whitelist))
other_switch.machinery_type_blacklist |= our_whitelisted

GLOB.all_breaker_switches += src
return INITIALIZE_HINT_LATELOAD

Expand Down
8 changes: 4 additions & 4 deletions code/game/machinery/hybrisa_lights.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Hybrisa Electrical Stuff
/obj/structure/machinery/colony_floodlight_switch/electrified_fence_switch
name = "Colony Electrified Fence Switch"
name = "colony electrified fence switch"
icon = 'icons/obj/structures/props/hybrisarandomprops.dmi'
icon_state = "panelnopower"
desc = "This switch controls the electrified fences. It only functions when there is power."
Expand Down Expand Up @@ -45,7 +45,7 @@

// Hybrisa Streetlights
/obj/structure/machinery/colony_floodlight/street
name = "Colony Streetlight"
name = "colony streetlight"
icon = 'icons/obj/structures/props/64x64_hybrisarandomprops.dmi'
icon_state = "street_off"
layer = ABOVE_XENO_LAYER
Expand Down Expand Up @@ -101,10 +101,10 @@

// Engineer Floor lights
/obj/structure/machinery/colony_floodlight_switch/engineerconsole_switch
name = "Giant Alien Console"
name = "giant alien console"
icon = 'icons/obj/structures/props/64x64_hybrisarandomprops.dmi'
icon_state = "engineerconsole"
desc = "A Giant Alien console of some kind, unlike anything you've ever seen before. Who knows the purpose of this strange technology..."
desc = "A giant alien console of some kind, unlike anything you've ever seen before. Who knows the purpose of this strange technology..."
use_power = USE_POWER_NONE
needs_power = FALSE
ispowered = TRUE
Expand Down

0 comments on commit e287fa1

Please sign in to comment.