mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-25 17:41:56 +00:00
Final merge
Merge branch 'development-2' into development # Conflicts: # baystation12.dme # code/_helpers/icons.dm # code/controllers/master_controller.dm # code/game/machinery/Sleeper.dm # code/game/machinery/computer3/laptop.dm # code/game/machinery/doors/door.dm # code/game/machinery/floorlayer.dm # code/game/machinery/vending.dm # code/game/mecha/mech_fabricator.dm # code/game/objects/effects/decals/contraband.dm # code/game/objects/explosion.dm # code/game/objects/items/robot/robot_upgrades.dm # code/game/objects/items/weapons/melee/misc.dm # code/game/objects/items/weapons/storage/boxes.dm # code/game/objects/structures/crates_lockers/closets/secure/security.dm # code/game/objects/structures/window.dm # code/modules/clothing/spacesuits/rig/rig.dm # code/modules/clothing/suits/jobs.dm # code/modules/mob/freelook/update_triggers.dm # code/modules/mob/living/carbon/human/human_defense.dm # code/modules/mob/living/carbon/human/human_movement.dm # code/modules/mob/living/carbon/human/life.dm # code/modules/mob/living/carbon/human/species/species.dm # code/modules/mob/living/carbon/human/species/station/station.dm # code/modules/mob/living/living_defines.dm # code/modules/mob/mob_helpers.dm # code/modules/mob/mob_movement.dm # code/modules/projectiles/ammunition/boxes.dm # nano/templates/sleeper.tmpl
This commit is contained in:
22
code/controllers/Processes/modifier.dm
Normal file
22
code/controllers/Processes/modifier.dm
Normal file
@@ -0,0 +1,22 @@
|
||||
/datum/controller/process/modifier/setup()
|
||||
name = "modifiers"
|
||||
schedule_interval = 10
|
||||
start_delay = 8
|
||||
|
||||
/datum/controller/process/modifier/started()
|
||||
..()
|
||||
if(!processing_modifiers)
|
||||
processing_modifiers = list()
|
||||
|
||||
/datum/controller/process/modifier/doWork()
|
||||
for(last_object in processing_modifiers)
|
||||
var/datum/modifier/O = last_object
|
||||
if(isnull(O.gcDestroyed))
|
||||
O.process()
|
||||
else
|
||||
catchBadType(O)
|
||||
processing_objects -= O
|
||||
|
||||
/datum/controller/process/modifier/statProcess()
|
||||
..()
|
||||
stat(null, "[processing_modifiers.len] modifiers")
|
||||
89
code/controllers/Processes/night_lighting.dm
Normal file
89
code/controllers/Processes/night_lighting.dm
Normal file
@@ -0,0 +1,89 @@
|
||||
/datum/controller/process/night_lighting/
|
||||
|
||||
var/isactive = 0
|
||||
var/firstrun = 1
|
||||
|
||||
var/list/area/lighting_areas = list(
|
||||
/area/hallway/primary/fore,
|
||||
/area/hallway/primary/starboard,
|
||||
/area/hallway/primary/aft,
|
||||
/area/hallway/primary/port,
|
||||
/area/hallway/primary/central_one,
|
||||
/area/hallway/primary/central_two,
|
||||
/area/hallway/primary/central_three,
|
||||
/area/hallway/secondary/exit,
|
||||
/area/hallway/secondary/entry/fore,
|
||||
/area/hallway/secondary/entry/port,
|
||||
/area/hallway/secondary/entry/starboard,
|
||||
/area/hallway/secondary/entry/aft,
|
||||
/area/crew_quarters/sleep,
|
||||
/area/crew_quarters/locker,
|
||||
/area/crew_quarters/fitness,
|
||||
/area/crew_quarters/bar,
|
||||
/area/engineering/foyer,
|
||||
/area/security/lobby,
|
||||
/area/storage/tools,
|
||||
/area/storage/primary
|
||||
)
|
||||
|
||||
/datum/controller/process/night_lighting/setup()
|
||||
name = "night lighting controller"
|
||||
schedule_interval = 3600 // Every 5 minutes.
|
||||
|
||||
if (!config.night_lighting)
|
||||
// Stop trying to delete processes. Not how it goes.
|
||||
disabled = 1
|
||||
|
||||
/datum/controller/process/night_lighting/preStart()
|
||||
|
||||
switch (worldtime2ticks())
|
||||
if (0 to MORNING_LIGHT_RESET)
|
||||
deactivate()
|
||||
if (NIGHT_LIGHT_ACTIVE to TICKS_IN_DAY)
|
||||
activate()
|
||||
|
||||
|
||||
/datum/controller/process/night_lighting/doWork()
|
||||
|
||||
switch (worldtime2ticks())
|
||||
if (0 to MORNING_LIGHT_RESET)
|
||||
if (isactive)
|
||||
command_announcement.Announce("Good morning. The time is [worldtime2text()]. \n\nThe automated systems aboard the [station_name()] will now return the public hallway lighting levels to normal.", "Automated Lighting System", new_sound = 'sound/misc/bosuns_whistle.ogg')
|
||||
deactivate()
|
||||
|
||||
if (NIGHT_LIGHT_ACTIVE to TICKS_IN_DAY)
|
||||
if (!isactive)
|
||||
command_announcement.Announce("Good evening. The time is [worldtime2text()]. \n\nThe automated systems aboard the [station_name()] will now dim lighting in the public hallways in order to accommodate the circadian rhythm of some species.", "Automated Lighting System", new_sound = 'sound/misc/bosuns_whistle.ogg')
|
||||
activate()
|
||||
|
||||
else
|
||||
if (isactive)
|
||||
deactivate()
|
||||
|
||||
/datum/controller/process/night_lighting/proc/activate()
|
||||
for (var/obj/machinery/power/apc/APC in get_apc_list())
|
||||
APC.toggle_nightlight("on")
|
||||
isactive = 1
|
||||
|
||||
SCHECK
|
||||
|
||||
/datum/controller/process/night_lighting/proc/deactivate()
|
||||
for (var/obj/machinery/power/apc/APC in get_apc_list())
|
||||
APC.toggle_nightlight("off")
|
||||
isactive = 0
|
||||
|
||||
SCHECK
|
||||
|
||||
/datum/controller/process/night_lighting/proc/get_apc_list()
|
||||
var/list/obj/machinery/power/apc/lighting_apcs = list()
|
||||
|
||||
for (var/A in all_areas)
|
||||
var/area/B = A
|
||||
if (!(B.type in lighting_areas))
|
||||
continue
|
||||
if (B.apc)
|
||||
lighting_apcs += B.apc
|
||||
|
||||
SCHECK
|
||||
|
||||
return lighting_apcs
|
||||
Reference in New Issue
Block a user