diff --git a/baystation12.dme b/baystation12.dme index a538b999ade..3409afb0d45 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -162,11 +162,9 @@ #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Supermatter" #define FILE_DIR "code/WorkInProgress/Cael_Aislinn/Tajara" #define FILE_DIR "code/WorkInProgress/Chinsky" -#define FILE_DIR "code/WorkInProgress/Holiday" #define FILE_DIR "code/WorkInProgress/mapload" #define FILE_DIR "code/WorkInProgress/Mini" #define FILE_DIR "code/WorkInProgress/Mloc" -#define FILE_DIR "code/WorkInProgress/Mloc/MAtmos" #define FILE_DIR "code/WorkInProgress/organs" #define FILE_DIR "code/WorkInProgress/Ported" #define FILE_DIR "code/WorkInProgress/Ported/Abi79" @@ -484,6 +482,7 @@ #include "code\game\machinery\dispenser.dm" #include "code\game\machinery\door_control.dm" #include "code\game\machinery\flasher.dm" +#include "code\game\machinery\floodlight.dm" #include "code\game\machinery\Freezer.dm" #include "code\game\machinery\hologram.dm" #include "code\game\machinery\hydroponics.dm" diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 3bed4357d8d..dc2fe2e28cd 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -117,9 +117,18 @@ var/datum/roundinfo/roundinfo = new() spawn() supply_ticker() // Added to kick-off the supply shuttle regenerating points -- TLE spawn(0) - while(1) - sleep(5000+rand(6000,10000)) - SpawnEvent() + while (1) + var/potential_sleep_time = 10000 + rand(10000, 20000) + for (var/mob/living/M in world) + if(!M.client) continue + if(M.client.inactivity > 10 * 60 * 10) continue + if(M.stat == 2) continue + + if (potential_sleep_time > 10000) + potential_sleep_time -= 600 + + sleep(potential_sleep_time) + SpawnEvent() //Start master_controller.process() spawn master_controller.process() diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm new file mode 100644 index 00000000000..08e13e535cb --- /dev/null +++ b/code/game/machinery/floodlight.dm @@ -0,0 +1,108 @@ +/obj/machinery/floodlight + name = "Emergency Floodlight" + icon = 'floodlight.dmi' + icon_state = "flood00" + density = 1 + var/on = 0 + var/obj/item/weapon/cell/cell = null + var/use = 1 + var/unlocked = 0 + var/open = 0 + +/obj/machinery/floodlight/proc/updateicon() + icon_state = "flood[open ? "o" : ""][open && cell ? "b" : ""]0[on]" + +/obj/machinery/floodlight/process() + if (!on) + if (luminosity) + updateicon() + sd_SetLuminosity(0) + return + + if(!luminosity && cell && cell.charge > 0) + sd_SetLuminosity(10) + updateicon() + + if(!cell && luminosity) + on = 0 + updateicon() + sd_SetLuminosity(0) + return + + cell.charge -= use + + if(cell.charge <= 0 && luminosity) + on = 0 + updateicon() + sd_SetLuminosity(0) + return + +/obj/machinery/floodlight/attack_hand(mob/user as mob) + if(open && cell) + cell.loc = usr + cell.layer = 20 + if (user.hand ) + user.l_hand = cell + else + user.r_hand = cell + + cell.add_fingerprint(user) + updateicon() + cell.updateicon() + + src.cell = null + user << "You remove the power cell" + return + + if(on) + on = 0 + user << "You turn off the light" + else + if(!cell) + return + if(cell.charge <= 0) + return + on = 1 + user << "You turn on the light" + + updateicon() + + +/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob) + if (istype(W, /obj/item/weapon/screwdriver)) + if (!open) + if(unlocked) + unlocked = 0 + user << "You screw the battery panel in place." + else + unlocked = 1 + user << "You unscrew the battery panel." + + if (istype(W, /obj/item/weapon/crowbar)) + if(unlocked) + if(open) + open = 0 + overlays = null + user << "You crowbar the battery panel in place." + else + if(unlocked) + open = 1 + user << "You remove the battery panel." + + if (istype(W, /obj/item/weapon/cell)) + if(open) + if(cell) + user << "There is a power cell already installed." + else + user.drop_item() + W.loc = src + cell = W + user << "You insert the power cell." + updateicon() + +/obj/machinery/floodlight/New() + src.cell = new/obj/item/weapon/cell(src) + cell.maxcharge = 1000 + cell.charge = 1000 + ..() + diff --git a/icons/obj/machines/floodlight.dmi b/icons/obj/machines/floodlight.dmi new file mode 100644 index 00000000000..8dea4dc8b67 Binary files /dev/null and b/icons/obj/machines/floodlight.dmi differ