>datum/event and datum/event_control were renamed to datum/round_event and datum/round_event_control. This is because datum/event was already used by a different/more-general event queue system (used primarily on mechas)

Removed overriding of event values via feeding in an associative list into datum/round_event/New(). Instead you can do basic initializations (i.e. feed it constants) by doing new /datum/round_event{variablename=5;}(). This method is handled well by the compiler (it's the same method the maps use), so it will detect unrecognized variablenames etc.
More complex initializations for post setup() stuff can be done by accessing variables directly Event.variablename = whatever;
round_events now have a processing variable, which effectively pauses them.
This commit is contained in:
carnie
2013-04-08 07:42:46 +01:00
parent 2c3a67ae7e
commit 6a98fc89d0
32 changed files with 218 additions and 218 deletions

View File

@@ -181,7 +181,7 @@ datum/controller/game_controller/proc/process()
//EVENTS //EVENTS
timer = world.timeofday timer = world.timeofday
last_thing_processed = /datum/event last_thing_processed = /datum/round_event
events.process() events.process()
events_cost = (world.timeofday - timer) / 10 events_cost = (world.timeofday - timer) / 10

View File

@@ -1614,11 +1614,7 @@
else if(href_list["secretsfun"]) else if(href_list["secretsfun"])
if(!check_rights(R_FUN)) return if(!check_rights(R_FUN)) return
var/datum/round_event/E
var/list/overrides = list()
if(alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No") == "No")
overrides["announceWhen"] = -1
var/ok = 0 var/ok = 0
switch(href_list["secretsfun"]) switch(href_list["secretsfun"])
if("monkey") if("monkey")
@@ -1647,7 +1643,7 @@
feedback_add_details("admin_secrets_fun_used","TriAI") feedback_add_details("admin_secrets_fun_used","TriAI")
if("gravity") if("gravity")
alert("WIP - event unavailable") alert("WIP - event unavailable")
/* new /datum/event/weightless(overrides) /* E = new /datum/round_event/weightless()
log_admin("[key_name(usr)] triggered a gravity-failure event.", 1) log_admin("[key_name(usr)] triggered a gravity-failure event.", 1)
message_admins("\blue [key_name_admin(usr)] triggered a gravity-failure event.", 1) message_admins("\blue [key_name_admin(usr)] triggered a gravity-failure event.", 1)
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
@@ -1796,44 +1792,44 @@
if("wave") if("wave")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","MW") feedback_add_details("admin_secrets_fun_used","MW")
new /datum/event/meteor_wave(overrides) E = new /datum/round_event/meteor_wave()
if("gravanomalies") if("gravanomalies")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","GA") feedback_add_details("admin_secrets_fun_used","GA")
new /datum/event/gravitational_anomaly(overrides) E = new /datum/round_event/gravitational_anomaly()
if("timeanomalies") //dear god this code was awful :P Still needs further optimisation if("timeanomalies") //dear god this code was awful :P Still needs further optimisation
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","STA") feedback_add_details("admin_secrets_fun_used","STA")
new /datum/event/wormholes(overrides) E = new /datum/round_event/wormholes()
if("goblob") if("goblob")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BL") feedback_add_details("admin_secrets_fun_used","BL")
message_admins("[key_name_admin(usr)] has spawned blob", 1) message_admins("[key_name_admin(usr)] has spawned blob", 1)
new /datum/event/blob(overrides) E = new /datum/round_event/blob()
if("aliens") if("aliens")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","AL") feedback_add_details("admin_secrets_fun_used","AL")
message_admins("[key_name_admin(usr)] has spawned aliens", 1) message_admins("[key_name_admin(usr)] has spawned aliens", 1)
new /datum/event/alien_infestation(overrides) E = new /datum/round_event/alien_infestation()
if("alien_silent") //replaces the spawn_xeno verb if("alien_silent") //replaces the spawn_xeno verb
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","ALS") feedback_add_details("admin_secrets_fun_used","ALS")
create_xeno() create_xeno()
if("spiders") if("spiders")
new /datum/event/spider_infestation(overrides) E = new /datum/round_event/spider_infestation()
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SL") feedback_add_details("admin_secrets_fun_used","SL")
message_admins("[key_name_admin(usr)] has spawned spiders", 1) message_admins("[key_name_admin(usr)] has spawned spiders", 1)
if("bluespaceanomaly") if("bluespaceanomaly")
new /datum/event/bluespace_anomaly(overrides) E = new /datum/round_event/bluespace_anomaly()
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BA") feedback_add_details("admin_secrets_fun_used","BA")
message_admins("[key_name_admin(usr)] has triggered a bluespace anomaly", 1) message_admins("[key_name_admin(usr)] has triggered a bluespace anomaly", 1)
if("comms_blackout") if("comms_blackout")
new /datum/event/communications_blackout(overrides) E = new /datum/round_event/communications_blackout()
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","CB") feedback_add_details("admin_secrets_fun_used","CB")
message_admins("[key_name_admin(usr)] triggered a communications blackout.", 1) message_admins("[key_name_admin(usr)] triggered a communications blackout.", 1)
@@ -1841,9 +1837,9 @@
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SN") feedback_add_details("admin_secrets_fun_used","SN")
message_admins("[key_name_admin(usr)] has sent in a space ninja", 1) message_admins("[key_name_admin(usr)] has sent in a space ninja", 1)
new /datum/event/ninja(list(overrides)) E = new /datum/round_event/ninja()
if("carp") if("carp")
new /datum/event/carp_migration(overrides) E = new /datum/round_event/carp_migration()
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","C") feedback_add_details("admin_secrets_fun_used","C")
message_admins("[key_name_admin(usr)] has spawned carp.", 1) message_admins("[key_name_admin(usr)] has spawned carp.", 1)
@@ -1851,29 +1847,27 @@
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","R") feedback_add_details("admin_secrets_fun_used","R")
message_admins("[key_name_admin(usr)] has has irradiated the station", 1) message_admins("[key_name_admin(usr)] has has irradiated the station", 1)
new /datum/event/radiation_storm(overrides) E = new /datum/round_event/radiation_storm()
if("immovable") if("immovable")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","IR") feedback_add_details("admin_secrets_fun_used","IR")
message_admins("[key_name_admin(usr)] has sent an immovable rod to the station", 1) message_admins("[key_name_admin(usr)] has sent an immovable rod to the station", 1)
new /datum/event/immovable_rod(overrides) E = new /datum/round_event/immovable_rod()
if("prison_break") if("prison_break")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","PB") feedback_add_details("admin_secrets_fun_used","PB")
message_admins("[key_name_admin(usr)] has allowed a prison break", 1) message_admins("[key_name_admin(usr)] has allowed a prison break", 1)
new /datum/event/prison_break(overrides) E = new /datum/round_event/prison_break()
if("lightsout") if("lightsout")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","LO") feedback_add_details("admin_secrets_fun_used","LO")
message_admins("[key_name_admin(usr)] has broke a lot of lights", 1) message_admins("[key_name_admin(usr)] has broke a lot of lights", 1)
overrides["lightsoutAmount"]=2 E = new /datum/round_event/electrical_storm{lightsoutAmount=2}()
new /datum/event/electrical_storm(overrides)
if("blackout") if("blackout")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BO") feedback_add_details("admin_secrets_fun_used","BO")
message_admins("[key_name_admin(usr)] broke all lights", 1) message_admins("[key_name_admin(usr)] broke all lights", 1)
overrides["lightsoutAmount"]=0 E = new /datum/round_event/electrical_storm{lightsoutAmount=0}()
new /datum/event/electrical_storm(overrides)
if("whiteout") if("whiteout")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","WO") feedback_add_details("admin_secrets_fun_used","WO")
@@ -1955,10 +1949,12 @@
if("Make Your Own") if("Make Your Own")
AdminCreateVirus(usr.client) AdminCreateVirus(usr.client)
if("Random") if("Random")
new /datum/event/disease_outbreak(overrides) E = new /datum/round_event/disease_outbreak()
if("Choose") if("Choose")
overrides["virus_type"] = input("Choose the virus to spread", "BIOHAZARD") as null|anything in typesof(/datum/disease) var/virus = input("Choose the virus to spread", "BIOHAZARD") as null|anything in typesof(/datum/disease)
new /datum/event/disease_outbreak(overrides) E = new /datum/round_event/disease_outbreak{}()
var/datum/round_event/disease_outbreak/DO = E
DO.virus_type = virus
if("retardify") if("retardify")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RET") feedback_add_details("admin_secrets_fun_used","RET")
@@ -1986,17 +1982,23 @@
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","I") feedback_add_details("admin_secrets_fun_used","I")
message_admins("[key_name_admin(usr)] triggered an ion storm") message_admins("[key_name_admin(usr)] triggered an ion storm")
new /datum/event/ion_storm(overrides) E = new /datum/round_event/ion_storm()
if("spacevines") if("spacevines")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","K") feedback_add_details("admin_secrets_fun_used","K")
message_admins("[key_name_admin(usr)] has spawned spacevines", 1) message_admins("[key_name_admin(usr)] has spawned spacevines", 1)
new /datum/event/spacevine(overrides) E = new /datum/round_event/spacevine()
if("onlyone") if("onlyone")
feedback_inc("admin_secrets_fun_used",1) feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","OO") feedback_add_details("admin_secrets_fun_used","OO")
usr.client.only_one() usr.client.only_one()
// message_admins("[key_name_admin(usr)] has triggered a battle to the death (only one)") // message_admins("[key_name_admin(usr)] has triggered a battle to the death (only one)")
if(E)
E.processing = 0
if(E.announceWhen>0)
if(alert(usr, "Would you like to alert the crew?", "Alert", "Yes", "No") == "No")
E.announceWhen = -1
E.processing = 1
if(usr) if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]") log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
if (ok) if (ok)

View File

@@ -306,11 +306,11 @@ client/proc/one_click_antag()
/datum/admins/proc/makeAliens() /datum/admins/proc/makeAliens()
new /datum/event/alien_infestation(list("spawncount"=3)) new /datum/round_event/alien_infestation{spawncount=3}()
return 1 return 1
/datum/admins/proc/makeSpaceNinja() /datum/admins/proc/makeSpaceNinja()
new /datum/event/ninja() new /datum/round_event/ninja()
return 1 return 1
/* DEATH SQUADS /* DEATH SQUADS

View File

@@ -192,7 +192,7 @@ proc/cmd_admin_mute(whom, mute_type, automute = 0)
command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert") command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert")
world << sound('sound/AI/ionstorm.ogg') world << sound('sound/AI/ionstorm.ogg')
new /datum/event/ion_storm(list("botEmagChance"=0)) new /datum/round_event/ion_storm{botEmagChance=0}()
feedback_add_details("admin_verb","ION") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! feedback_add_details("admin_verb","ION") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!

View File

@@ -1,32 +1,32 @@
/datum/event_control/alien_infestation /datum/round_event_control/alien_infestation
name = "Alien Infestation" name = "Alien Infestation"
typepath = /datum/event/alien_infestation typepath = /datum/round_event/alien_infestation
weight = 5 weight = 5
max_occurrences = 1 max_occurrences = 1
/datum/event/alien_infestation /datum/round_event/alien_infestation
announceWhen = 400 announceWhen = 400
var/spawncount = 1 var/spawncount = 1
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned. var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
/datum/event/alien_infestation/setup() /datum/round_event/alien_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 50) announceWhen = rand(announceWhen, announceWhen + 50)
spawncount = rand(1, 2) spawncount = rand(1, 2)
/datum/event/alien_infestation/kill() /datum/round_event/alien_infestation/kill()
if(!successSpawn && control) if(!successSpawn && control)
control.occurrences-- control.occurrences--
return ..() return ..()
/datum/event/alien_infestation/announce() /datum/round_event/alien_infestation/announce()
if(successSpawn) if(successSpawn)
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
world << sound('sound/AI/aliens.ogg') world << sound('sound/AI/aliens.ogg')
/datum/event/alien_infestation/start() /datum/round_event/alien_infestation/start()
var/list/vents = list() var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network)

View File

@@ -1,22 +1,22 @@
/datum/event_control/blob /datum/round_event_control/blob
name = "Blob" name = "Blob"
typepath = /datum/event/blob typepath = /datum/round_event/blob
weight = 5 weight = 5
max_occurrences = 1 max_occurrences = 1
/datum/event/blob /datum/round_event/blob
announceWhen = 12 announceWhen = 12
endWhen = 120 endWhen = 120
var/obj/effect/blob/core/Blob var/obj/effect/blob/core/Blob
/datum/event/blob/announce() /datum/round_event/blob/announce()
command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") command_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('sound/AI/outbreak5.ogg') world << sound('sound/AI/outbreak5.ogg')
/datum/event/blob/start() /datum/round_event/blob/start()
var/turf/T = pick(blobstart) var/turf/T = pick(blobstart)
if(!T) if(!T)
return kill() return kill()
@@ -25,7 +25,7 @@
Blob.process() Blob.process()
/datum/event/blob/tick() /datum/round_event/blob/tick()
if(!Blob) if(!Blob)
kill() kill()
return return

View File

@@ -1,16 +1,16 @@
/datum/event_control/bluespace_anomaly /datum/round_event_control/bluespace_anomaly
name = "Bluespace Anomaly" name = "Bluespace Anomaly"
typepath = /datum/event/bluespace_anomaly typepath = /datum/round_event/bluespace_anomaly
weight = 5 weight = 5
max_occurrences = 1 max_occurrences = 1
/datum/event/bluespace_anomaly /datum/round_event/bluespace_anomaly
announceWhen = 20 announceWhen = 20
var/area/impact_area var/area/impact_area
/datum/event/bluespace_anomaly/setup() /datum/round_event/bluespace_anomaly/setup()
var/list/safe_areas = list( var/list/safe_areas = list(
/area/turret_protected/ai, /area/turret_protected/ai,
/area/turret_protected/ai_upload, /area/turret_protected/ai_upload,
@@ -37,11 +37,11 @@
impact_area = locate(pick((the_station_areas - safe_areas) + danger_areas)) //need to locate() as it's just a list of paths. impact_area = locate(pick((the_station_areas - safe_areas) + danger_areas)) //need to locate() as it's just a list of paths.
/datum/event/bluespace_anomaly/announce() /datum/round_event/bluespace_anomaly/announce()
command_alert("Bluespace anomaly detected in the vicinity of [station_name()]. [impact_area.name] has gone missing.", "Anomaly Alert") command_alert("Bluespace anomaly detected in the vicinity of [station_name()]. [impact_area.name] has gone missing.", "Anomaly Alert")
/datum/event/bluespace_anomaly/start() /datum/round_event/bluespace_anomaly/start()
var/turf/T = pick(get_area_turfs(impact_area)) var/turf/T = pick(get_area_turfs(impact_area))
if(T) if(T)
// Calculate new position (searches through beacons in world) // Calculate new position (searches through beacons in world)

View File

@@ -1,10 +1,10 @@
/datum/event_control/brand_intelligence /datum/round_event_control/brand_intelligence
name = "Brand Intelligence" name = "Brand Intelligence"
typepath = /datum/event/brand_intelligence typepath = /datum/round_event/brand_intelligence
weight = 5 weight = 5
max_occurrences = 1 max_occurrences = 1
/datum/event/brand_intelligence /datum/round_event/brand_intelligence
announceWhen = 21 announceWhen = 21
endWhen = 1000 //Ends when all vending machines are subverted anyway. endWhen = 1000 //Ends when all vending machines are subverted anyway.
@@ -12,11 +12,11 @@
var/obj/machinery/vending/originMachine var/obj/machinery/vending/originMachine
/datum/event/brand_intelligence/announce() /datum/round_event/brand_intelligence/announce()
command_alert("Rampant brand intelligence has been detected aboard [station_name()], please stand-by.", "Machine Learning Alert") command_alert("Rampant brand intelligence has been detected aboard [station_name()], please stand-by.", "Machine Learning Alert")
/datum/event/brand_intelligence/start() /datum/round_event/brand_intelligence/start()
for(var/obj/machinery/vending/V in machines) for(var/obj/machinery/vending/V in machines)
if(V.z != 1) continue if(V.z != 1) continue
vendingMachines.Add(V) vendingMachines.Add(V)
@@ -31,7 +31,7 @@
originMachine.shoot_inventory = 1 originMachine.shoot_inventory = 1
/datum/event/brand_intelligence/tick() /datum/round_event/brand_intelligence/tick()
if(!vendingMachines.len || !originMachine || originMachine.shut_up) //if every machine is infected, or if the original vending machine is missing or has it's voice switch flipped if(!vendingMachines.len || !originMachine || originMachine.shut_up) //if every machine is infected, or if the original vending machine is missing or has it's voice switch flipped
kill() kill()
return return

View File

@@ -1,21 +1,21 @@
/datum/event_control/carp_migration /datum/round_event_control/carp_migration
name = "Carp Migration" name = "Carp Migration"
typepath = /datum/event/carp_migration typepath = /datum/round_event/carp_migration
weight = 15 weight = 15
earliest_start = 6000 earliest_start = 6000
max_occurrences = 6 max_occurrences = 6
/datum/event/carp_migration /datum/round_event/carp_migration
announceWhen = 50 announceWhen = 50
/datum/event/carp_migration/setup() /datum/round_event/carp_migration/setup()
announceWhen = rand(40, 60) announceWhen = rand(40, 60)
/datum/event/carp_migration/announce() /datum/round_event/carp_migration/announce()
command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert") command_alert("Unknown biological entities have been detected near [station_name()], please stand-by.", "Lifesign Alert")
/datum/event/carp_migration/start() /datum/round_event/carp_migration/start()
for(var/obj/effect/landmark/C in landmarks_list) for(var/obj/effect/landmark/C in landmarks_list)
if(C.name == "carpspawn") if(C.name == "carpspawn")
new /mob/living/simple_animal/hostile/carp(C.loc) new /mob/living/simple_animal/hostile/carp(C.loc)

View File

@@ -1,9 +1,9 @@
/datum/event_control/communications_blackout /datum/round_event_control/communications_blackout
name = "Communications Blackout" name = "Communications Blackout"
typepath = /datum/event/communications_blackout typepath = /datum/round_event/communications_blackout
weight = 30 weight = 30
/datum/event/communications_blackout/announce() /datum/round_event/communications_blackout/announce()
var/alert = pick( "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you*%fj00)`5vc-BZZT", \ var/alert = pick( "Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you*%fj00)`5vc-BZZT", \
"Ionospheric anomalies detected. Temporary telecommunication failu*3mga;b4;'1v<31>-BZZZT", \ "Ionospheric anomalies detected. Temporary telecommunication failu*3mga;b4;'1v<31>-BZZZT", \
"Ionospheric anomalies detected. Temporary telec#MCi46:5.;@63-BZZZZT", \ "Ionospheric anomalies detected. Temporary telec#MCi46:5.;@63-BZZZZT", \
@@ -20,6 +20,6 @@
command_alert(alert) command_alert(alert)
/datum/event/communications_blackout/start() /datum/round_event/communications_blackout/start()
for(var/obj/machinery/telecomms/T in telecomms_list) for(var/obj/machinery/telecomms/T in telecomms_list)
T.emp_act(1) T.emp_act(1)

View File

@@ -1,23 +1,23 @@
/datum/event_control/disease_outbreak /datum/round_event_control/disease_outbreak
name = "Disease Outbreak" name = "Disease Outbreak"
typepath = /datum/event/disease_outbreak typepath = /datum/round_event/disease_outbreak
max_occurrences = 1 max_occurrences = 1
weight = 5 weight = 5
/datum/event/disease_outbreak /datum/round_event/disease_outbreak
announceWhen = 15 announceWhen = 15
var/virus_type var/virus_type
/datum/event/disease_outbreak/announce() /datum/round_event/disease_outbreak/announce()
command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") command_alert("Confirmed outbreak of level 7 viral biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert")
world << sound('sound/AI/outbreak7.ogg') world << sound('sound/AI/outbreak7.ogg')
/datum/event/disease_outbreak/setup() /datum/round_event/disease_outbreak/setup()
announceWhen = rand(15, 30) announceWhen = rand(15, 30)
/datum/event/disease_outbreak/start() /datum/round_event/disease_outbreak/start()
if(!virus_type) if(!virus_type)
virus_type = pick(/datum/disease/dnaspread, /datum/disease/advance/flu, /datum/disease/advance/cold, /datum/disease/brainrot, /datum/disease/magnitis) virus_type = pick(/datum/disease/dnaspread, /datum/disease/advance/flu, /datum/disease/advance/cold, /datum/disease/brainrot, /datum/disease/magnitis)

View File

@@ -1,17 +1,17 @@
/datum/event_control/dust /datum/round_event_control/dust
name = "Minor Space Dust" name = "Minor Space Dust"
typepath = /datum/event/dust typepath = /datum/round_event/dust
weight = 600 weight = 600
max_occurrences = 10000 max_occurrences = 10000
earliest_start = 0 earliest_start = 0
/datum/event/dust /datum/round_event/dust
var/qnty = 1 var/qnty = 1
/datum/event/dust/setup() /datum/round_event/dust/setup()
qnty = rand(1,5) qnty = rand(1,5)
/datum/event/dust/start() /datum/round_event/dust/start()
while(qnty-- > 0) while(qnty-- > 0)
new /obj/effect/space_dust/weak() new /obj/effect/space_dust/weak()

View File

@@ -1,19 +1,19 @@
/datum/event_control/electrical_storm /datum/round_event_control/electrical_storm
name = "Electrical Storm" name = "Electrical Storm"
typepath = /datum/event/electrical_storm typepath = /datum/round_event/electrical_storm
earliest_start = 6000 earliest_start = 6000
weight = 40 weight = 40
/datum/event/electrical_storm /datum/round_event/electrical_storm
var/lightsoutAmount = 1 var/lightsoutAmount = 1
var/lightsoutRange = 25 var/lightsoutRange = 25
/datum/event/electrical_storm/announce() /datum/round_event/electrical_storm/announce()
command_alert("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert") command_alert("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert")
/datum/event/electrical_storm/start() /datum/round_event/electrical_storm/start()
var/list/epicentreList = list() var/list/epicentreList = list()
for(var/i=1, i <= lightsoutAmount, i++) for(var/i=1, i <= lightsoutAmount, i++)

View File

@@ -1,16 +1,16 @@
/datum/event_control/energetic_flux /datum/round_event_control/energetic_flux
name = "Energetic Flux" name = "Energetic Flux"
typepath = /datum/event/energetic_flux typepath = /datum/round_event/energetic_flux
max_occurrences = 2 max_occurrences = 2
weight = 15 weight = 15
/datum/event/energetic_flux /datum/round_event/energetic_flux
startWhen = 30 startWhen = 30
var/area/impact_area var/area/impact_area
/datum/event/energetic_flux/setup() /datum/round_event/energetic_flux/setup()
var/list/safe_areas = list( var/list/safe_areas = list(
/area/turret_protected/ai, /area/turret_protected/ai,
/area/turret_protected/ai_upload, /area/turret_protected/ai_upload,
@@ -37,11 +37,11 @@
impact_area = locate(pick((the_station_areas - safe_areas) + danger_areas)) //need to locate() as it's just a list of paths. impact_area = locate(pick((the_station_areas - safe_areas) + danger_areas)) //need to locate() as it's just a list of paths.
/datum/event/energetic_flux/announce() /datum/round_event/energetic_flux/announce()
command_alert("Warning! Localized hyper-energetic flux wave detected on long range scanners. Expected location of impact: [impact_area.name]. Vacate [impact_area.name].", "Anomaly Alert") command_alert("Warning! Localized hyper-energetic flux wave detected on long range scanners. Expected location of impact: [impact_area.name]. Vacate [impact_area.name].", "Anomaly Alert")
/datum/event/energetic_flux/start() /datum/round_event/energetic_flux/start()
var/turf/T = pick(get_area_turfs(impact_area)) var/turf/T = pick(get_area_turfs(impact_area))
if(T) if(T)
explosion(T, -1, 2, 4, 5) explosion(T, -1, 2, 4, 5)

View File

@@ -1,7 +1,7 @@
//this datum is used by the events controller to dictate how it selects events //this datum is used by the events controller to dictate how it selects events
/datum/event_control /datum/round_event_control
var/name //The name human-readable name of the event var/name //The name human-readable name of the event
var/typepath //The typepath of the event datum /datum/event var/typepath //The typepath of the event datum /datum/round_event
var/weight = 10 //The weight this event has in the random-selection process. var/weight = 10 //The weight this event has in the random-selection process.
//Higher weights are more likely to be picked. //Higher weights are more likely to be picked.
@@ -17,17 +17,18 @@
//anything with a (non-null) holidayID which does not match holiday, cannot run. //anything with a (non-null) holidayID which does not match holiday, cannot run.
/datum/event_control/proc/runEvent() /datum/round_event_control/proc/runEvent()
if(!ispath(typepath,/datum/event)) if(!ispath(typepath,/datum/round_event))
return PROCESS_KILL return PROCESS_KILL
var/datum/event/E = new typepath() var/datum/round_event/E = new typepath()
E.control = src E.control = src
occurrences++ occurrences++
testing("[time2text(world.time, "hh:mm:ss")] [E.type]") testing("[time2text(world.time, "hh:mm:ss")] [E.type]")
/datum/event //NOTE: Times are measured in master controller ticks! /datum/round_event //NOTE: Times are measured in master controller ticks!
var/datum/event_control/control var/processing = 1
var/datum/round_event_control/control
var/startWhen = 0 //When in the lifetime to call start(). var/startWhen = 0 //When in the lifetime to call start().
var/announceWhen = 0 //When in the lifetime to call announce(). var/announceWhen = 0 //When in the lifetime to call announce().
@@ -42,26 +43,26 @@
//EDIT: if there's anything you want to override within the new() call, it will not be overridden by the time this proc is called. //EDIT: if there's anything you want to override within the new() call, it will not be overridden by the time this proc is called.
//It will only have been overridden by the time we get to announce() start() tick() or end() (anything but setup basically). //It will only have been overridden by the time we get to announce() start() tick() or end() (anything but setup basically).
//This is really only for setting defaults which can be overridden later wehn New() finishes. //This is really only for setting defaults which can be overridden later wehn New() finishes.
/datum/event/proc/setup() /datum/round_event/proc/setup()
return return
//Called when the tick is equal to the startWhen variable. //Called when the tick is equal to the startWhen variable.
//Allows you to start before announcing or vice versa. //Allows you to start before announcing or vice versa.
//Only called once. //Only called once.
/datum/event/proc/start() /datum/round_event/proc/start()
return return
//Called when the tick is equal to the announceWhen variable. //Called when the tick is equal to the announceWhen variable.
//Allows you to announce before starting or vice versa. //Allows you to announce before starting or vice versa.
//Only called once. //Only called once.
/datum/event/proc/announce() /datum/round_event/proc/announce()
return return
//Called on or after the tick counter is equal to startWhen. //Called on or after the tick counter is equal to startWhen.
//You can include code related to your event or add your own //You can include code related to your event or add your own
//time stamped events. //time stamped events.
//Called more than once. //Called more than once.
/datum/event/proc/tick() /datum/round_event/proc/tick()
return return
//Called on or after the tick is equal or more than endWhen //Called on or after the tick is equal or more than endWhen
@@ -70,14 +71,17 @@
//the activeFor variable. //the activeFor variable.
//For example: if(activeFor == myOwnVariable + 30) doStuff() //For example: if(activeFor == myOwnVariable + 30) doStuff()
//Only called once. //Only called once.
/datum/event/proc/end() /datum/round_event/proc/end()
return return
//Do not override this proc, instead use the appropiate procs. //Do not override this proc, instead use the appropiate procs.
//This proc will handle the calls to the appropiate procs. //This proc will handle the calls to the appropiate procs.
/datum/event/proc/process() /datum/round_event/proc/process()
if(!processing)
return
if(activeFor == startWhen) if(activeFor == startWhen)
start() start()
@@ -100,20 +104,12 @@
//Garbage collects the event by removing it from the global events list, //Garbage collects the event by removing it from the global events list,
//which should be the only place it's referenced. //which should be the only place it's referenced.
//Called when start(), announce() and end() has all been called. //Called when start(), announce() and end() has all been called.
/datum/event/proc/kill() /datum/round_event/proc/kill()
events.running -= src events.running -= src
//Sets up the event then adds the event to the the list of running events //Sets up the event then adds the event to the the list of running events
/datum/event/New(list/overrides) /datum/round_event/New()
setup() setup()
//overrides
if(istype(overrides))
for(var/varname in overrides)
if(varname in vars)
vars[varname] = overrides[varname]
events.running += src events.running += src
return ..() return ..()

View File

@@ -1,8 +1,8 @@
var/datum/controller/event/events var/datum/controller/event/events
/datum/controller/event /datum/controller/event
var/list/control = list() //list of all datum/event_control. Used for selecting events based on weight and occurrences. var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
var/list/running = list() //list of all existing /datum/event var/list/running = list() //list of all existing /datum/round_event
var/scheduled = 0 //The next world.time that a naturally occuring random event can be selected. var/scheduled = 0 //The next world.time that a naturally occuring random event can be selected.
var/frequency_lower = 3000 //5 minutes lower bound. var/frequency_lower = 3000 //5 minutes lower bound.
@@ -18,8 +18,8 @@ var/datum/controller/event/events
del(events) del(events)
events = src events = src
for(var/type in typesof(/datum/event_control)) for(var/type in typesof(/datum/round_event_control))
var/datum/event_control/E = new type() var/datum/round_event_control/E = new type()
if(!E.typepath) if(!E.typepath)
continue //don't want this one! leave it for the garbage collector continue //don't want this one! leave it for the garbage collector
control += E //add it to the list of all events (controls) control += E //add it to the list of all events (controls)
@@ -31,7 +31,7 @@ var/datum/controller/event/events
checkEvent() checkEvent()
var/i = 1 var/i = 1
while(i<=running.len) while(i<=running.len)
var/datum/event/Event = running[i] var/datum/round_event/Event = running[i]
if(Event) if(Event)
Event.process() Event.process()
i++ i++
@@ -54,7 +54,7 @@ var/datum/controller/event/events
return return
var/sum_of_weights = 0 var/sum_of_weights = 0
for(var/datum/event_control/E in control) for(var/datum/round_event_control/E in control)
if(E.occurrences >= E.max_occurrences) continue if(E.occurrences >= E.max_occurrences) continue
if(E.earliest_start >= world.time) continue if(E.earliest_start >= world.time) continue
if(E.holidayID) if(E.holidayID)
@@ -68,7 +68,7 @@ var/datum/controller/event/events
sum_of_weights = rand(0,sum_of_weights) //reusing this variable. It now represents the 'weight' we want to select sum_of_weights = rand(0,sum_of_weights) //reusing this variable. It now represents the 'weight' we want to select
for(var/datum/event_control/E in control) for(var/datum/round_event_control/E in control)
if(E.occurrences >= E.max_occurrences) continue if(E.occurrences >= E.max_occurrences) continue
if(E.earliest_start >= world.time) continue if(E.earliest_start >= world.time) continue
if(E.holidayID) if(E.holidayID)
@@ -82,7 +82,7 @@ var/datum/controller/event/events
return return
//allows a client to trigger an event (For Debugging Purposes) //allows a client to trigger an event (For Debugging Purposes)
/client/proc/forceEvent(var/datum/event_control/E in events.control) /client/proc/forceEvent(var/datum/round_event_control/E in events.control)
set name = "Trigger Event (Debug Only)" set name = "Trigger Event (Debug Only)"
set category = "Debug" set category = "Debug"

View File

@@ -1,28 +1,28 @@
/datum/event_control/gravitational_anomaly /datum/round_event_control/gravitational_anomaly
name = "Gravitational Anomaly" name = "Gravitational Anomaly"
typepath = /datum/event/gravitational_anomaly typepath = /datum/round_event/gravitational_anomaly
max_occurrences = 5 max_occurrences = 5
weight = 2 weight = 2
/datum/event/gravitational_anomaly /datum/round_event/gravitational_anomaly
startWhen = 10 startWhen = 10
var/obj/effect/bhole/blackhole var/obj/effect/bhole/blackhole
/datum/event/gravitational_anomaly/announce() /datum/round_event/gravitational_anomaly/announce()
command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert") command_alert("Gravitational anomalies detected on the station. There is no additional data.", "Anomaly Alert")
for(var/mob/M in player_list) for(var/mob/M in player_list)
if(!istype(M,/mob/new_player)) if(!istype(M,/mob/new_player))
M << sound('sound/AI/granomalies.ogg') M << sound('sound/AI/granomalies.ogg')
/datum/event/gravitational_anomaly/setup() /datum/round_event/gravitational_anomaly/setup()
endWhen = rand(50, 200) endWhen = rand(50, 200)
/datum/event/gravitational_anomaly/start() /datum/round_event/gravitational_anomaly/start()
var/turf/T = pick(blobstart) var/turf/T = pick(blobstart)
blackhole = new /obj/effect/bhole( T.loc, 30 ) blackhole = new /obj/effect/bhole( T.loc, 30 )
/datum/event/gravitational_anomaly/end() /datum/round_event/gravitational_anomaly/end()
del(blackhole) del(blackhole)

View File

@@ -1,11 +1,11 @@
/datum/event_control/treevenge /datum/round_event_control/treevenge
name = "Treevenge" name = "Treevenge"
holidayID = "Xmas" holidayID = "Xmas"
typepath = /datum/event/treevenge typepath = /datum/round_event/treevenge
max_occurrences = 1 max_occurrences = 1
weight = 20 weight = 20
/datum/event/treevenge/start() /datum/round_event/treevenge/start()
for(var/obj/structure/flora/tree/pine/xmas in world) for(var/obj/structure/flora/tree/pine/xmas in world)
var/mob/living/simple_animal/hostile/tree/evil_tree = new /mob/living/simple_animal/hostile/tree(xmas.loc) var/mob/living/simple_animal/hostile/tree/evil_tree = new /mob/living/simple_animal/hostile/tree(xmas.loc)
evil_tree.icon_state = xmas.icon_state evil_tree.icon_state = xmas.icon_state
@@ -15,15 +15,15 @@
del(xmas) del(xmas)
//this is an example of a possible round-start event //this is an example of a possible round-start event
/datum/event_control/presents /datum/round_event_control/presents
name = "Presents under Trees" name = "Presents under Trees"
holidayID = "Xmas" holidayID = "Xmas"
typepath = /datum/event/presents typepath = /datum/round_event/presents
weight = -1 //forces it to be called, regardless of weight weight = -1 //forces it to be called, regardless of weight
max_occurrences = 1 max_occurrences = 1
earliest_start = 0 earliest_start = 0
/datum/event/presents/start() /datum/round_event/presents/start()
for(var/obj/structure/flora/tree/pine/xmas in world) for(var/obj/structure/flora/tree/pine/xmas in world)
if(xmas.z != 1) continue if(xmas.z != 1) continue
for(var/turf/simulated/floor/T in orange(1,xmas)) for(var/turf/simulated/floor/T in orange(1,xmas))
@@ -32,7 +32,7 @@
for(var/mob/living/simple_animal/corgi/Ian/Ian in mob_list) for(var/mob/living/simple_animal/corgi/Ian/Ian in mob_list)
Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian)) Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian))
/datum/event/presents/announce() /datum/round_event/presents/announce()
command_alert("Ho Ho Ho, Merry Xmas!", "Unknown Transmission") command_alert("Ho Ho Ho, Merry Xmas!", "Unknown Transmission")

View File

@@ -7,18 +7,18 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
--NEOFite --NEOFite
*/ */
/datum/event_control/immovable_rod /datum/round_event_control/immovable_rod
name = "Immovable Rod" name = "Immovable Rod"
typepath = /datum/event/immovable_rod typepath = /datum/round_event/immovable_rod
max_occurrences = 5 max_occurrences = 5
/datum/event/immovable_rod /datum/round_event/immovable_rod
announceWhen = 5 announceWhen = 5
/datum/event/immovable_rod/announce() /datum/round_event/immovable_rod/announce()
command_alert("What the fuck was that?!", "General Alert") command_alert("What the fuck was that?!", "General Alert")
/datum/event/immovable_rod/start() /datum/round_event/immovable_rod/start()
var/startx = 0 var/startx = 0
var/starty = 0 var/starty = 0
var/endy = 0 var/endy = 0

View File

@@ -1,18 +1,18 @@
/datum/event_control/ion_storm /datum/round_event_control/ion_storm
name = "Ion Storm" name = "Ion Storm"
typepath = /datum/event/ion_storm typepath = /datum/round_event/ion_storm
weight = 15 weight = 15
/datum/event/ion_storm /datum/round_event/ion_storm
var/botEmagChance = 10 var/botEmagChance = 10
/datum/event/ion_storm/announce() /datum/round_event/ion_storm/announce()
if(prob(33)) if(prob(33))
command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert") command_alert("Ion storm detected near the station. Please check all AI-controlled equipment for errors.", "Anomaly Alert")
world << sound('sound/AI/ionstorm.ogg') world << sound('sound/AI/ionstorm.ogg')
/datum/event/ion_storm/start() /datum/round_event/ion_storm/start()
//AI laws //AI laws
for(var/mob/living/silicon/ai/M in living_mob_list) for(var/mob/living/silicon/ai/M in living_mob_list)
if(M.stat != 2 && M.see_in_dark != 0) if(M.stat != 2 && M.see_in_dark != 0)

View File

@@ -1,9 +1,9 @@
/datum/event_control/mass_hallucination /datum/round_event_control/mass_hallucination
name = "Mass Hallucination" name = "Mass Hallucination"
typepath = /datum/event/mass_hallucination typepath = /datum/round_event/mass_hallucination
weight = 7 weight = 7
max_occurrences = 2 max_occurrences = 2
/datum/event/mass_hallucination/start() /datum/round_event/mass_hallucination/start()
for(var/mob/living/carbon/C in living_mob_list) for(var/mob/living/carbon/C in living_mob_list)
C.hallucination += rand(20, 50) C.hallucination += rand(20, 50)

View File

@@ -1,18 +1,18 @@
/datum/event_control/meteor_wave /datum/round_event_control/meteor_wave
name = "Meteor Wave" name = "Meteor Wave"
typepath = /datum/event/meteor_wave typepath = /datum/round_event/meteor_wave
weight = 5 weight = 5
max_occurrences = 3 max_occurrences = 3
/datum/event/meteor_wave /datum/round_event/meteor_wave
startWhen = 6 startWhen = 6
endWhen = 66 endWhen = 66
/datum/event/meteor_wave/announce() /datum/round_event/meteor_wave/announce()
command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert")
world << sound('sound/AI/meteors.ogg') world << sound('sound/AI/meteors.ogg')
/datum/event/meteor_wave/tick() /datum/round_event/meteor_wave/tick()
if(IsMultiple(activeFor, 3)) if(IsMultiple(activeFor, 3))
spawn_meteors(5) spawn_meteors(5)

View File

@@ -1,32 +1,32 @@
//Note to future generations: I didn't write this god-awful code I just ported it to the event system and tried to make it less moon-speaky. //Note to future generations: I didn't write this god-awful code I just ported it to the event system and tried to make it less moon-speaky.
//Don't judge me D; ~Carn //Don't judge me D; ~Carn
/datum/event_control/ninja /datum/round_event_control/ninja
name = "Space Ninja" name = "Space Ninja"
typepath = /datum/event/ninja typepath = /datum/round_event/ninja
max_occurrences = 1 max_occurrences = 1
/datum/event/ninja /datum/round_event/ninja
var/success_spawn = 0 var/success_spawn = 0
var/helping_station var/helping_station
var/key var/key
var/turf/spawnturf var/spawn_loc
var/mission var/mission
var/mob/living/carbon/human/Ninja var/mob/living/carbon/human/Ninja
/datum/event/ninja/setup() /datum/round_event/ninja/setup()
helping_station = rand(0,1) helping_station = rand(0,1)
/datum/event/ninja/kill() /datum/round_event/ninja/kill()
if(!success_spawn && control) if(!success_spawn && control)
control.occurrences-- control.occurrences--
return ..() return ..()
/datum/event/ninja/start() /datum/round_event/ninja/start()
//selecting a spawnturf //selecting a spawn_loc
if(!spawnturf) if(!spawn_loc)
var/list/spawn_locs = list() var/list/spawn_locs = list()
for(var/obj/effect/landmark/L in landmarks_list) for(var/obj/effect/landmark/L in landmarks_list)
if(isturf(L.loc)) if(isturf(L.loc))
@@ -35,8 +35,8 @@
spawn_locs += L.loc spawn_locs += L.loc
if(!spawn_locs.len) if(!spawn_locs.len)
return kill() return kill()
spawnturf = pick(spawn_locs) spawn_loc = pick(spawn_locs)
if(!spawnturf) if(!spawn_loc)
return kill() return kill()
//selecting a candidate player //selecting a candidate player
@@ -161,7 +161,7 @@
Mind.store_memory("Officially, [helping_station?"Nanotrasen":"The Syndicate"] are my employer.") Mind.store_memory("Officially, [helping_station?"Nanotrasen":"The Syndicate"] are my employer.")
//spawn the ninja and assign the candidate //spawn the ninja and assign the candidate
Ninja = create_space_ninja(spawnturf) Ninja = create_space_ninja(spawn_loc)
Mind.transfer_to(Ninja) Mind.transfer_to(Ninja)
//initialise equipment //initialise equipment
@@ -180,7 +180,7 @@ This proc will give the ninja a directive to follow. They are not obligated to d
Making this random or semi-random will probably not work without it also being incredibly silly. Making this random or semi-random will probably not work without it also being incredibly silly.
As such, it's hard-coded for now. No reason for it not to be, really. As such, it's hard-coded for now. No reason for it not to be, really.
*/ */
/datum/event/ninja/proc/generate_ninja_directive() /datum/round_event/ninja/proc/generate_ninja_directive()
switch(rand(1,13)) switch(rand(1,13))
if(1) return "The Spider Clan must not be linked to this operation. Remain as hidden and covert as possible." if(1) return "The Spider Clan must not be linked to this operation. Remain as hidden and covert as possible."
if(2) return "[station_name] is financed by an enemy of the Spider Clan. Cause as much structural damage as possible." if(2) return "[station_name] is financed by an enemy of the Spider Clan. Cause as much structural damage as possible."
@@ -330,7 +330,9 @@ ________________________________________________________________________________
if(!C) if(!C)
return return
new /datum/event/ninja(list("key"=C.key,"mission"=mission)) var/datum/round_event/ninja/E = new /datum/round_event/ninja()
E.key=C.key
E.mission=mission
message_admins("\blue [key_name_admin(key)] has spawned [key_name_admin(C.key)] as a Space Ninja.") message_admins("\blue [key_name_admin(key)] has spawned [key_name_admin(C.key)] as a Space Ninja.")
log_admin("[key] used Spawn Space Ninja.") log_admin("[key] used Spawn Space Ninja.")
@@ -339,8 +341,8 @@ ________________________________________________________________________________
//=======//NINJA CREATION PROCS//=======// //=======//NINJA CREATION PROCS//=======//
/proc/create_space_ninja(turf/spawnturf) /proc/create_space_ninja(spawn_loc)
var/mob/living/carbon/human/new_ninja = new(spawnturf) var/mob/living/carbon/human/new_ninja = new(spawn_loc)
var/datum/preferences/A = new()//Randomize appearance for the ninja. var/datum/preferences/A = new()//Randomize appearance for the ninja.
A.real_name = "[pick(ninja_titles)] [pick(ninja_names)]" A.real_name = "[pick(ninja_titles)] [pick(ninja_names)]"

View File

@@ -1,15 +1,15 @@
/datum/event_control/prison_break /datum/round_event_control/prison_break
name = "Prison Break" name = "Prison Break"
typepath = /datum/event/prison_break typepath = /datum/round_event/prison_break
max_occurrences = 2 max_occurrences = 2
/datum/event/prison_break /datum/round_event/prison_break
announceWhen = 50 announceWhen = 50
endWhen = 20 endWhen = 20
var/list/area/prisonAreas = list() var/list/area/prisonAreas = list()
/datum/event/prison_break/setup() /datum/round_event/prison_break/setup()
announceWhen = rand(50, 60) announceWhen = rand(50, 60)
endWhen = rand(20, 30) endWhen = rand(20, 30)
@@ -18,7 +18,7 @@
prisonAreas += A prisonAreas += A
/datum/event/prison_break/announce() /datum/round_event/prison_break/announce()
if(prisonAreas && prisonAreas.len > 0) if(prisonAreas && prisonAreas.len > 0)
command_alert("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert") command_alert("Gr3y.T1d3 virus detected in [station_name()] imprisonment subroutines. Recommend station AI involvement.", "Security Alert")
else else
@@ -26,12 +26,12 @@
kill() kill()
/datum/event/prison_break/start() /datum/round_event/prison_break/start()
for(var/area/A in prisonAreas) for(var/area/A in prisonAreas)
for(var/obj/machinery/light/L in A) for(var/obj/machinery/light/L in A)
L.flicker(10) L.flicker(10)
/datum/event/prison_break/end() /datum/round_event/prison_break/end()
for(var/area/A in prisonAreas) for(var/area/A in prisonAreas)
for(var/obj/O in A) for(var/obj/O in A)
if(istype(O,/obj/machinery/power/apc)) if(istype(O,/obj/machinery/power/apc))

View File

@@ -1,18 +1,18 @@
/datum/event_control/radiation_storm /datum/round_event_control/radiation_storm
name = "Radiation Storm" name = "Radiation Storm"
typepath = /datum/event/radiation_storm typepath = /datum/round_event/radiation_storm
max_occurrences = 1 max_occurrences = 1
/datum/event/radiation_storm /datum/round_event/radiation_storm
announceWhen = 5 announceWhen = 5
/datum/event/radiation_storm/announce() /datum/round_event/radiation_storm/announce()
command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert") command_alert("High levels of radiation detected near the station. Please report to the Med-bay if you feel strange.", "Anomaly Alert")
world << sound('sound/AI/radiation.ogg') world << sound('sound/AI/radiation.ogg')
/datum/event/radiation_storm/start() /datum/round_event/radiation_storm/start()
for(var/mob/living/carbon/C in living_mob_list) for(var/mob/living/carbon/C in living_mob_list)
var/turf/T = get_turf(C) var/turf/T = get_turf(C)
if(!T) continue if(!T) continue

View File

@@ -1,10 +1,10 @@
/datum/event_control/spacevine /datum/round_event_control/spacevine
name = "Spacevine" name = "Spacevine"
typepath = /datum/event/spacevine typepath = /datum/round_event/spacevine
weight = 15 weight = 15
max_occurrences = 3 max_occurrences = 3
/datum/event/spacevine/start() /datum/round_event/spacevine/start()
var/list/turfs = list() //list of all the empty floor turfs in the hallway areas var/list/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/area/hallway/A in world) for(var/area/hallway/A in world)

View File

@@ -1,25 +1,25 @@
/datum/event_control/spider_infestation /datum/round_event_control/spider_infestation
name = "Spider Infestation" name = "Spider Infestation"
typepath = /datum/event/spider_infestation typepath = /datum/round_event/spider_infestation
weight = 5 weight = 5
max_occurrences = 1 max_occurrences = 1
/datum/event/spider_infestation /datum/round_event/spider_infestation
announceWhen = 400 announceWhen = 400
var/spawncount = 1 var/spawncount = 1
/datum/event/spider_infestation/setup() /datum/round_event/spider_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 50) announceWhen = rand(announceWhen, announceWhen + 50)
spawncount = rand(5, 8) spawncount = rand(5, 8)
/datum/event/spider_infestation/announce() /datum/round_event/spider_infestation/announce()
command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert") command_alert("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert")
world << sound('sound/AI/aliens.ogg') world << sound('sound/AI/aliens.ogg')
/datum/event/spider_infestation/start() /datum/round_event/spider_infestation/start()
var/list/vents = list() var/list/vents = list()
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world) for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network) if(temp_vent.loc.z == 1 && !temp_vent.welded && temp_vent.network)

View File

@@ -1,11 +1,11 @@
/datum/event_control/spontaneous_appendicitis /datum/round_event_control/spontaneous_appendicitis
name = "Spontaneous Appendicitis" name = "Spontaneous Appendicitis"
typepath = /datum/event/spontaneous_appendicitis typepath = /datum/round_event/spontaneous_appendicitis
weight = 20 weight = 20
max_occurrences = 4 max_occurrences = 4
earliest_start = 6000 earliest_start = 6000
/datum/event/spontaneous_appendicitis/start() /datum/round_event/spontaneous_appendicitis/start()
for(var/mob/living/carbon/human/H in shuffle(living_mob_list)) for(var/mob/living/carbon/human/H in shuffle(living_mob_list))
var/foundAlready = 0 //don't infect someone that already has the virus var/foundAlready = 0 //don't infect someone that already has the virus
for(var/datum/disease/D in H.viruses) for(var/datum/disease/D in H.viruses)

View File

@@ -1,27 +1,27 @@
/datum/event_control/weightless /datum/round_event_control/weightless
name = "Gravity Systems Failure" name = "Gravity Systems Failure"
typepath = /datum/event/weightless typepath = /datum/round_event/weightless
weight = 15 weight = 15
/datum/event/weightless /datum/round_event/weightless
startWhen = 5 startWhen = 5
endWhen = 65 endWhen = 65
/datum/event/weightless/setup() /datum/round_event/weightless/setup()
startWhen = rand(0,10) startWhen = rand(0,10)
endWhen = rand(40,80) endWhen = rand(40,80)
var/datum/event_control/E = locate(/datum/event_control/gravitational_anomaly) in events.control
if(E)
E.weight *= 2
/datum/event/weightless/announce() /datum/round_event/weightless/announce()
command_alert("Warning: Failsafes for the station's artificial gravity arrays have been triggered. Please be aware that if this problem recurs it may result in formation of gravitational anomalies. Nanotrasen wishes to remind you that the unauthorised formation of anomalies within Nanotrasen facilities is strictly prohibited by health and safety regulation [rand(99,9999)][pick("a","b","c")]:subclause[rand(1,20)][pick("a","b","c")].") command_alert("Warning: Failsafes for the station's artificial gravity arrays have been triggered. Please be aware that if this problem recurs it may result in formation of gravitational anomalies. Nanotrasen wishes to remind you that the unauthorised formation of anomalies within Nanotrasen facilities is strictly prohibited by health and safety regulation [rand(99,9999)][pick("a","b","c")]:subclause[rand(1,20)][pick("a","b","c")].")
/datum/event/weightless/start() /datum/round_event/weightless/start()
for(var/area/A in world) for(var/area/A in world)
A.gravitychange(0) A.gravitychange(0)
/datum/event/weightless/end() if(control)
control.weight *= 2
/datum/round_event/weightless/end()
for(var/area/A in world) for(var/area/A in world)
A.gravitychange(1) A.gravitychange(1)

View File

@@ -1,10 +1,10 @@
/datum/event_control/wormholes /datum/round_event_control/wormholes
name = "Wormholes" name = "Wormholes"
typepath = /datum/event/wormholes typepath = /datum/round_event/wormholes
max_occurrences = 3 max_occurrences = 3
weight = 2 weight = 2
/datum/event/wormholes /datum/round_event/wormholes
announceWhen = 10 announceWhen = 10
endWhen = 60 endWhen = 60
@@ -12,24 +12,24 @@
var/shift_frequency = 3 var/shift_frequency = 3
var/number_of_wormholes = 1000 var/number_of_wormholes = 1000
/datum/event/wormholes/setup() /datum/round_event/wormholes/setup()
announceWhen = rand(0,20) announceWhen = rand(0,20)
endWhen = rand(40,80) endWhen = rand(40,80)
/datum/event/wormholes/start() /datum/round_event/wormholes/start()
for(var/i=1, i<=number_of_wormholes, i++) for(var/i=1, i<=number_of_wormholes, i++)
var/x = rand(40,world.maxx-40) var/x = rand(40,world.maxx-40)
var/y = rand(40,world.maxy-40) var/y = rand(40,world.maxy-40)
var/turf/T = locate(x, y, 1) var/turf/T = locate(x, y, 1)
wormholes += new /obj/effect/portal/wormhole(T, null, null, -1) wormholes += new /obj/effect/portal/wormhole(T, null, null, -1)
/datum/event/wormholes/announce() /datum/round_event/wormholes/announce()
command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert") command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert")
for(var/mob/M in player_list) for(var/mob/M in player_list)
if(!istype(M,/mob/new_player)) if(!istype(M,/mob/new_player))
M << sound('sound/AI/spanomalies.ogg') M << sound('sound/AI/spanomalies.ogg')
/datum/event/wormholes/tick() /datum/round_event/wormholes/tick()
if(activeFor % shift_frequency == 0) if(activeFor % shift_frequency == 0)
for(var/obj/effect/portal/wormhole/O in wormholes) for(var/obj/effect/portal/wormhole/O in wormholes)
var/x = rand(20,world.maxx-20) var/x = rand(20,world.maxx-20)
@@ -37,7 +37,7 @@
var/turf/T = locate(x, y, 1) var/turf/T = locate(x, y, 1)
if(T) O.loc = T if(T) O.loc = T
/datum/event/wormholes/end() /datum/round_event/wormholes/end()
portals.Remove(wormholes) portals.Remove(wormholes)
for(var/obj/effect/portal/wormhole/O in wormholes) for(var/obj/effect/portal/wormhole/O in wormholes)
O.loc = null O.loc = null

View File

@@ -245,16 +245,18 @@
i++ i++
index = "[T.loc.name]\[[i]\]" index = "[T.loc.name]\[[i]\]"
vents[index] = temp_vent vents[index] = temp_vent
if(!vents.len)
src << "\red There are no available vents to travel to, they could be welded."
return
var/turf/startloc = loc var/turf/startloc = loc
var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortList(vents) var/obj/selection = input("Select a destination.", "Duct System") as null|anything in sortList(vents)
if(!selection) return if(!selection) return
if(loc==startloc) if(loc==startloc)
if(contents.len) for(var/obj/item/carried_item in contents)//If the monkey got on objects.
for(var/obj/item/carried_item in contents)//If the monkey got on objects. if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger
if( !istype(carried_item, /obj/item/weapon/implant) && !istype(carried_item, /obj/item/clothing/mask/facehugger) )//If it's not an implant or a facehugger src << "\red You can't be carrying items or have items equipped when vent crawling!"
src << "\red You can't be carrying items or have items equipped when vent crawling!" return
return
var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection] var/obj/machinery/atmospherics/unary/vent_pump/target_vent = vents[selection]
if(target_vent) if(target_vent)
for(var/mob/O in viewers(src, null)) for(var/mob/O in viewers(src, null))

View File

@@ -210,9 +210,7 @@
x_c -= 3 x_c -= 3
var/obj/item/weapon/photo/P = new/obj/item/weapon/photo() var/obj/item/weapon/photo/P = new/obj/item/weapon/photo()
P.loc = user.loc user.put_in_hands(P)
if(!user.get_inactive_hand())
user.put_in_inactive_hand(P)
var/icon/small_img = icon(temp) var/icon/small_img = icon(temp)
var/icon/ic = icon('icons/obj/items.dmi',"photo") var/icon/ic = icon('icons/obj/items.dmi',"photo")
small_img.Scale(8, 8) small_img.Scale(8, 8)