Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nightshift #1240

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,566 changes: 1,279 additions & 1,287 deletions _maps/map_files/Theseus/Theseus.dmm

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions code/__DEFINES/lighting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ do { \

#define TURF_IS_DYNAMICALLY_LIT(T) (!(T.always_lit || T.loc.luminosity))

#define LIGHTBULB_COLOR_WHITE "#fefefe"
#define LIGHTBULB_COLOR_SLIGHTLY_WARM "#fffee0"
#define LIGHTBULB_COLOR_WARM "#dfac72"

// Machinery lights
///How much power emergency lights will consume per tick
#define LIGHT_EMERGENCY_POWER_USE 0.2
Expand Down
2 changes: 0 additions & 2 deletions code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@

/datum/config_entry/flag/roundstart_traits

/datum/config_entry/flag/enable_night_shifts

/datum/config_entry/flag/randomize_shift_time

/datum/config_entry/flag/shift_time_realtime
Expand Down
62 changes: 0 additions & 62 deletions code/controllers/subsystem/nightshift.dm

This file was deleted.

1 change: 0 additions & 1 deletion code/controllers/subsystem/security_level.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ SUBSYSTEM_DEF(security_level)
/datum/controller/subsystem/security_level/proc/set_level(new_level)
SSsecurity_level.current_level = new_level
SEND_SIGNAL(src, COMSIG_SECURITY_LEVEL_CHANGED, new_level)
SSnightshift.check_nightshift()
SSblackbox.record_feedback("tally", "security_level_changes", 1, get_security_level())
2 changes: 2 additions & 0 deletions code/game/turfs/open/floor/fancy_floor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
desc = "A welcoming wooden floor."
icon = 'icons/turf/wood.dmi'
icon_state = "wood"

flags_1 = parent_type::flags_1 &~ (CAN_BE_DIRTY_1)
floor_tile = /obj/item/stack/tile/wood
broken_blend = BLEND_DEFAULT
burned_blend = BLEND_MULTIPLY
Expand Down
15 changes: 0 additions & 15 deletions code/modules/admin/verbs/secrets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,6 @@ GLOBAL_DATUM(everyone_a_traitor, /datum/everyone_is_a_traitor_controller)
log_admin("[key_name(holder)] reset the station name.")
message_admins(span_adminnotice("[key_name_admin(holder)] reset the station name."))
priority_announce("[command_name()] has renamed the station to \"[new_name]\".", PA_TITLE_COMMAND_REPORT, sound_type = ANNOUNCER_CENTCOM)
if("night_shift_set")
var/val = tgui_alert(holder, "What do you want to set night shift to? This will override the automatic system until set to automatic again.", "Night Shift", list("On", "Off", "Automatic"))
switch(val)
if("Automatic")
if(CONFIG_GET(flag/enable_night_shifts))
SSnightshift.can_fire = TRUE
SSnightshift.fire()
else
SSnightshift.update_nightshift(FALSE, TRUE)
if("On")
SSnightshift.can_fire = FALSE
SSnightshift.update_nightshift(TRUE, TRUE)
if("Off")
SSnightshift.can_fire = FALSE
SSnightshift.update_nightshift(FALSE, TRUE)
if("moveferry")
SSblackbox.record_feedback("nested tally", "admin_secrets_fun_used", 1, list("Send CentCom Ferry"))
if(!SSshuttle.toggleShuttle("ferry","ferry_home","ferry_away"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ GLOBAL_LIST_EMPTY(heretic_sacrifice_landmarks)

// Some VERY dim lights, used for the void sacrifice realm.
/obj/machinery/light/very_dim
nightshift_allowed = FALSE
bulb_colour = "#d6b6a6ff"
bulb_inner_range = 3
bulb_power = 0.5
Expand Down
10 changes: 1 addition & 9 deletions code/modules/power/apc/apc_main.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,6 @@ DEFINE_INTERACTABLE(/obj/machinery/power/apc)
var/force_update = FALSE
///Should the emergency lights be on?
var/emergency_lights = FALSE
///Should the nighshift lights be on?
var/nightshift_lights = FALSE
///Time when the nightshift where turned on last, to prevent spamming
var/last_nightshift_switch = 0
///Stores the flags for the icon state
var/update_state = -1
///Stores the flag for the overlays
Expand Down Expand Up @@ -274,7 +270,6 @@ GLOBAL_REAL_VAR(default_apc_armor) = list(BLUNT = 20, PUNCTURE = 20, SLASH = 0,
"malfStatus" = get_malf_status(user),
"mainLights" = area.lightswitch,
"emergencyLights" = !emergency_lights,
"nightshiftLights" = nightshift_lights,

"powerChannels" = list(
list(
Expand Down Expand Up @@ -317,7 +312,7 @@ GLOBAL_REAL_VAR(default_apc_armor) = list(BLUNT = 20, PUNCTURE = 20, SLASH = 0,
. = UI_INTERACTIVE

/obj/machinery/power/apc/ui_act(action, params)
var/list/locked_actions = list("main_lights", "toggle_nightshift")
var/list/locked_actions = list("main_lights")
. = ..()

if(. || !can_use(usr, 1) || (locked && !usr.has_unlimited_silicon_privilege && !failure_timer && !(action in locked_actions)))
Expand All @@ -337,9 +332,6 @@ GLOBAL_REAL_VAR(default_apc_armor) = list(BLUNT = 20, PUNCTURE = 20, SLASH = 0,
if("breaker")
toggle_breaker(usr)
. = TRUE
if("toggle_nightshift")
toggle_nightshift_lights()
. = TRUE
if("charge")
chargemode = !chargemode
if(!chargemode)
Expand Down
16 changes: 0 additions & 16 deletions code/modules/power/apc/apc_power_proc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
terminal.setDir(dir)
terminal.master = src

/obj/machinery/power/apc/proc/toggle_nightshift_lights(mob/living/user)
if(last_nightshift_switch > world.time - 100) //~10 seconds between each toggle to prevent spamming
to_chat(usr, span_warning("[src]'s night lighting circuit breaker is still cycling!"))
return
last_nightshift_switch = world.time
set_nightshift(!nightshift_lights)

/obj/machinery/power/apc/proc/update()
if(operating && !shorted && !failure_timer)
area.power_light = (lighting > APC_CHANNEL_AUTO_OFF)
Expand Down Expand Up @@ -124,12 +117,3 @@
failure_timer = max(failure_timer, round(duration))
update()
queue_icon_update()

/obj/machinery/power/apc/proc/set_nightshift(on)
set waitfor = FALSE
nightshift_lights = on
for(var/obj/machinery/light/night_light in area.lights)
if(night_light.nightshift_allowed)
night_light.nightshift_enabled = nightshift_lights
night_light.update(FALSE)
CHECK_TICK
6 changes: 0 additions & 6 deletions code/modules/power/lighting/floor_light.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@
// Floor lights use a steep falloff because they're pointing at the ceiling, they diffuse sharply as a result.
bulb_falloff = LIGHTING_DEFAULT_FALLOFF_CURVE //+ 0.5

nightshift_inner_range = 0.5
nightshift_outer_range = 5
nightshift_falloff = LIGHTING_DEFAULT_FALLOFF_CURVE + 1
nightshift_light_power = 1
nightshift_light_color = "#f2f9f7"

/obj/machinery/light/floor/has_bulb
status = LIGHT_OK
start_with_cell = TRUE
Expand Down
113 changes: 92 additions & 21 deletions code/modules/power/lighting/light.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ DEFINE_INTERACTABLE(/obj/machinery/light)
///The falloff of the emitted light. Adjust until it looks good.
var/bulb_falloff = 1.85
///Default colour of the light.
var/bulb_colour = "#dfac72"
var/bulb_colour = LIGHTBULB_COLOR_WARM
///LIGHT_OK, _EMPTY, _BURNED or _BROKEN

var/status = LIGHT_OK
Expand All @@ -53,19 +53,6 @@ DEFINE_INTERACTABLE(/obj/machinery/light)
var/obj/item/stock_parts/cell/cell
///If true, this fixture generates a very weak cell at roundstart
var/start_with_cell = TRUE
///Currently in night shift mode?
var/nightshift_enabled = FALSE
///Set to FALSE to never let this light get switched to night mode.
var/nightshift_allowed = TRUE
///Outer radius of the nightshift light
var/nightshift_outer_range = 6
///Inner, brightest radius of the nightshift light
var/nightshift_inner_range = 1.5
///Alpha of the nightshift light
var/nightshift_light_power = 0.5
///Basecolor of the nightshift light
var/nightshift_light_color = "#dfac72"
var/nightshift_falloff = 1.85

///If true, the light is in emergency mode
var/emergency_mode = FALSE
Expand All @@ -92,10 +79,6 @@ DEFINE_INTERACTABLE(/obj/machinery/light)
/obj/machinery/light/Initialize(mapload)
. = ..()
SET_TRACKING(__TYPE__)
if(!mapload) //sync up nightshift lighting for player made lights
var/area/local_area = get_area(src)
var/obj/machinery/power/apc/temp_apc = local_area.apc
nightshift_enabled = temp_apc?.nightshift_lights

if(start_with_cell && !no_emergency)
cell = new/obj/item/stock_parts/cell/emergency_light(src)
Expand Down Expand Up @@ -158,9 +141,6 @@ DEFINE_INTERACTABLE(/obj/machinery/light)
if(emergency_mode || firealarm) //PARIAH EDIT END
. += mutable_appearance(overlay_icon, "[base_state]_emergency")
return
if(nightshift_enabled)
. += mutable_appearance(overlay_icon, "[base_state]_nightshift")
return
. += mutable_appearance(overlay_icon, base_state)

/obj/machinery/light/setDir(ndir)
Expand Down Expand Up @@ -696,3 +676,94 @@ DEFINE_INTERACTABLE(/obj/machinery/light)
L.set_light(bulb_outer_range, bulb_inner_range, bulb_power, bulb_falloff, bulb_colour)
CHECK_TICK


// DEBUG VERBS
// /obj/machinery/light/verb/_change_color()
// set name = "Mass Change Color"
// set category = "Debug"
// set src in view(5)

// var/new_color = input(usr, "New Color", "Change Color", bulb_colour) as null|color
// if(!new_color)
// return

// var/old_color = bulb_colour

// for(var/obj/machinery/light/L as anything in INSTANCES_OF(/obj/machinery/light))
// if(L.bulb_colour == old_color && is_station_level(L.z))
// L.bulb_colour = new_color
// L.set_light(L.bulb_outer_range, L.bulb_inner_range, L.bulb_power, L.bulb_falloff, L.bulb_colour)

// CHECK_TICK

// /obj/machinery/light/verb/_change_power()
// set name = "Mass Change Power"
// set category = "Debug"
// set src in view(5)

// var/new_power = input(usr, "New Color", "Change Color", bulb_power) as null|num
// if(!new_power)
// return

// var/old_power = bulb_power

// for(var/obj/machinery/light/L as anything in INSTANCES_OF(/obj/machinery/light))
// if(L.bulb_power == old_power && is_station_level(L.z))
// L.bulb_power = new_power
// L.set_light(L.bulb_outer_range, L.bulb_inner_range, L.bulb_power, L.bulb_falloff, L.bulb_colour)

// CHECK_TICK

// /obj/machinery/light/verb/_change_orange()
// set name = "Mass Change ORange"
// set category = "Debug"
// set src in view(5)

// var/new_orange = input(usr, "New Color", "Change Color", bulb_outer_range) as null|num
// if(!new_orange)
// return

// var/old_orange = bulb_outer_range

// for(var/obj/machinery/light/L as anything in INSTANCES_OF(/obj/machinery/light))
// if(L.bulb_outer_range == old_orange && is_station_level(L.z))
// L.bulb_outer_range = new_orange
// L.set_light(L.bulb_outer_range, L.bulb_inner_range, L.bulb_power, L.bulb_falloff, L.bulb_colour)

// CHECK_TICK

// /obj/machinery/light/verb/_change_irange()
// set name = "Mass Change IRange"
// set category = "Debug"
// set src in view(5)

// var/new_irange = input(usr, "New Color", "Change Color", bulb_inner_range) as null|num
// if(!new_irange)
// return

// var/old_irange = bulb_inner_range

// for(var/obj/machinery/light/L as anything in INSTANCES_OF(/obj/machinery/light))
// if(L.bulb_inner_range == old_irange && is_station_level(L.z))
// L.bulb_inner_range = new_irange
// L.set_light(L.bulb_outer_range, L.bulb_inner_range, L.bulb_power, L.bulb_falloff, L.bulb_colour)

// CHECK_TICK

// /obj/machinery/light/verb/_change_falloff()
// set name = "Mass Change Falloff"
// set category = "Debug"
// set src in view(5)

// var/new_falloff = input(usr, "New Color", "Change Color", bulb_falloff) as null|num
// if(!new_falloff)
// return

// var/old_falloff = bulb_falloff

// for(var/obj/machinery/light/L as anything in INSTANCES_OF(/obj/machinery/light))
// if(L.bulb_falloff == old_falloff && is_station_level(L.z))
// L.bulb_falloff = new_falloff
// L.set_light(L.bulb_outer_range, L.bulb_inner_range, L.bulb_power, L.bulb_falloff, L.bulb_colour)

// CHECK_TICK
Loading
Loading