From 01a93f37a019ffc241c2571b1d93a261300627ef Mon Sep 17 00:00:00 2001 From: Ren Erthilo Date: Wed, 2 May 2012 16:06:58 +0100 Subject: [PATCH] Increases time between random events happening in low population rounds to a maximum of double. Random events are more likely to happen up to a limit of around 30 active players. Events now fire at the same rate as previously with around 20~ active players. Also adds floodlights, cause floodlights are cool. --- baystation12.dme | 3 +- code/game/gamemodes/gameticker.dm | 15 ++++- code/game/machinery/floodlight.dm | 108 ++++++++++++++++++++++++++++++ icons/obj/machines/floodlight.dmi | Bin 0 -> 1955 bytes 4 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 code/game/machinery/floodlight.dm create mode 100644 icons/obj/machines/floodlight.dmi 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 0000000000000000000000000000000000000000..8dea4dc8b6769c7807d0ac7dab2950d0f7b48a9c GIT binary patch literal 1955 zcmV;U2VD4xP)V=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex7wuvIWN;^NFm z%}mcIfpCgT5=&AQY!#H!a`N+2@{e95o;+fb;=5^el7|wzMfnF+_z~|O?}c!000KkNkl9$F z8it?m_&ULf!;erfP_@$^0Rl2*gsTx%N3ko7(5MSqwHsP#)C!Hver7XUy6b`!3q%$y z5iDBG%wnY3v`$9pNK8GnPzNXCMG7DDAOH?iHR}Ch6+F~o!7Z^UU#Z9vHse4dH1A#dH3g$)i)jg z&49GJ1*ivhyjql{$MgC20WTIC+qb&TYD8WCcP~w9t&&WB``d>1-JQCt2T}v{Sr*E& zKr6syer}H0r*mX>XByhSw*R_TIQ;vYqrWJ9)A5fA*75@@1HAZiJ-CHJq3OlO#>QG) zWAQr66BO$=GCBFVerE3;?%&^!WhGJSv9_!v$z+mbGAS><@FLl47C{gZKvNg{@~f|? zRw{U|t8Lpsl%ja^AfD$@sXWj>-Mh!(k;6T$Z#w=_V?_ag<^iq;Hz*sqMwIn4nO(g9 z{s&MSR$BW5>}L5U4<9^aS0;l}3Zy;&L9_;h;o)Jbl?r?JKEuBK`w^(M1FhkcPd@H> zeK4Q@C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