mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 19:17:50 +01:00
File standardisation (#13131)
* Adds the check components * Adds in trailing newlines * Converts all CRLF to LF * Post merge EOF * Post merge line endings * Final commit
This commit is contained in:
@@ -49,4 +49,4 @@
|
||||
processing = 1 //So it will get gc'd
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
/datum/event/alien_infestation
|
||||
announceWhen = 400
|
||||
var/highpop_trigger = 80
|
||||
var/spawncount = 2
|
||||
var/list/playercount
|
||||
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
|
||||
|
||||
/datum/event/alien_infestation/setup()
|
||||
announceWhen = rand(announceWhen, announceWhen + 50)
|
||||
|
||||
/datum/event/alien_infestation/announce()
|
||||
if(successSpawn)
|
||||
event_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
|
||||
/datum/event/alien_infestation/start()
|
||||
var/list/vents = list()
|
||||
playercount = length(GLOB.clients)//grab playercount when event starts not when game starts
|
||||
if(playercount >= highpop_trigger) //spawn with 4 if highpop
|
||||
spawncount = 4
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
spawn()
|
||||
var/list/candidates = pollCandidates("Do you want to play as an alien?", ROLE_ALIEN, 1)
|
||||
|
||||
while(spawncount > 0 && vents.len && candidates.len)
|
||||
var/obj/vent = pick_n_take(vents)
|
||||
var/mob/C = pick_n_take(candidates)
|
||||
if(C)
|
||||
GLOB.respawnable_list -= C.client
|
||||
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
|
||||
new_xeno.amount_grown += (0.75 * new_xeno.max_grown) //event spawned larva start off almost ready to evolve.
|
||||
new_xeno.key = C.key
|
||||
if(SSticker && SSticker.mode)
|
||||
SSticker.mode.xenos += new_xeno.mind
|
||||
|
||||
spawncount--
|
||||
successSpawn = 1
|
||||
/datum/event/alien_infestation
|
||||
announceWhen = 400
|
||||
var/highpop_trigger = 80
|
||||
var/spawncount = 2
|
||||
var/list/playercount
|
||||
var/successSpawn = 0 //So we don't make a command report if nothing gets spawned.
|
||||
|
||||
/datum/event/alien_infestation/setup()
|
||||
announceWhen = rand(announceWhen, announceWhen + 50)
|
||||
|
||||
/datum/event/alien_infestation/announce()
|
||||
if(successSpawn)
|
||||
event_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
|
||||
/datum/event/alien_infestation/start()
|
||||
var/list/vents = list()
|
||||
playercount = length(GLOB.clients)//grab playercount when event starts not when game starts
|
||||
if(playercount >= highpop_trigger) //spawn with 4 if highpop
|
||||
spawncount = 4
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50) //Stops Aliens getting stuck in small networks. See: Security, Virology
|
||||
vents += temp_vent
|
||||
|
||||
spawn()
|
||||
var/list/candidates = pollCandidates("Do you want to play as an alien?", ROLE_ALIEN, 1)
|
||||
|
||||
while(spawncount > 0 && vents.len && candidates.len)
|
||||
var/obj/vent = pick_n_take(vents)
|
||||
var/mob/C = pick_n_take(candidates)
|
||||
if(C)
|
||||
GLOB.respawnable_list -= C.client
|
||||
var/mob/living/carbon/alien/larva/new_xeno = new(vent.loc)
|
||||
new_xeno.amount_grown += (0.75 * new_xeno.max_grown) //event spawned larva start off almost ready to evolve.
|
||||
new_xeno.key = C.key
|
||||
if(SSticker && SSticker.mode)
|
||||
SSticker.mode.xenos += new_xeno.mind
|
||||
|
||||
spawncount--
|
||||
successSpawn = 1
|
||||
|
||||
@@ -30,4 +30,4 @@
|
||||
|
||||
/datum/event/anomaly/end()
|
||||
if(newAnomaly)//Kill the anomaly if it still exists at the end.
|
||||
qdel(newAnomaly)
|
||||
qdel(newAnomaly)
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
/datum/event/anomaly/anomaly_flux/end()
|
||||
if(newAnomaly.loc)//If it hasn't been neutralized, it's time to blow up.
|
||||
explosion(newAnomaly, -1, 3, 5, 5)
|
||||
qdel(newAnomaly)
|
||||
qdel(newAnomaly)
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
/datum/event/anomaly/anomaly_grav/start()
|
||||
var/turf/T = pick(get_area_turfs(impact_area))
|
||||
if(T)
|
||||
newAnomaly = new /obj/effect/anomaly/grav(T.loc)
|
||||
newAnomaly = new /obj/effect/anomaly/grav(T.loc)
|
||||
|
||||
@@ -28,4 +28,4 @@
|
||||
S.rabid = TRUE
|
||||
S.amount_grown = SLIME_EVOLUTION_THRESHOLD
|
||||
S.Evolve()
|
||||
qdel(newAnomaly)
|
||||
qdel(newAnomaly)
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
/datum/event/anomaly/anomaly_vortex/start()
|
||||
var/turf/T = pick(get_area_turfs(impact_area))
|
||||
if(T)
|
||||
newAnomaly = new /obj/effect/anomaly/bhole(T.loc)
|
||||
newAnomaly = new /obj/effect/anomaly/bhole(T.loc)
|
||||
|
||||
+33
-33
@@ -1,33 +1,33 @@
|
||||
/datum/event/blob
|
||||
announceWhen = 180
|
||||
endWhen = 240
|
||||
|
||||
/datum/event/blob/announce()
|
||||
event_announcement.Announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/AI/outbreak5.ogg')
|
||||
|
||||
/datum/event/blob/start()
|
||||
processing = FALSE //so it won't fire again in next tick
|
||||
|
||||
var/turf/T = pick(blobstart)
|
||||
if(!T)
|
||||
return kill()
|
||||
|
||||
var/list/candidates = pollCandidates("Do you want to play as a blob infested mouse?", ROLE_BLOB, 1)
|
||||
if(!candidates.len)
|
||||
return kill()
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.all_vent_pumps)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
var/obj/vent = pick(vents)
|
||||
var/mob/living/simple_animal/mouse/blobinfected/B = new(vent.loc)
|
||||
var/mob/M = pick(candidates)
|
||||
B.key = M.key
|
||||
SSticker.mode.update_blob_icons_added(B.mind)
|
||||
|
||||
to_chat(B, "<span class='userdanger'>You are now a mouse, infected with blob spores. Find somewhere isolated... before you burst and become the blob! Use ventcrawl (alt-click on vents) to move around.</span>")
|
||||
notify_ghosts("Infected Mouse has appeared in [get_area(B)].", source = B)
|
||||
processing = TRUE // Let it naturally end, if it runs successfully
|
||||
/datum/event/blob
|
||||
announceWhen = 180
|
||||
endWhen = 240
|
||||
|
||||
/datum/event/blob/announce()
|
||||
event_announcement.Announce("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/AI/outbreak5.ogg')
|
||||
|
||||
/datum/event/blob/start()
|
||||
processing = FALSE //so it won't fire again in next tick
|
||||
|
||||
var/turf/T = pick(blobstart)
|
||||
if(!T)
|
||||
return kill()
|
||||
|
||||
var/list/candidates = pollCandidates("Do you want to play as a blob infested mouse?", ROLE_BLOB, 1)
|
||||
if(!candidates.len)
|
||||
return kill()
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in GLOB.all_vent_pumps)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
var/obj/vent = pick(vents)
|
||||
var/mob/living/simple_animal/mouse/blobinfected/B = new(vent.loc)
|
||||
var/mob/M = pick(candidates)
|
||||
B.key = M.key
|
||||
SSticker.mode.update_blob_icons_added(B.mind)
|
||||
|
||||
to_chat(B, "<span class='userdanger'>You are now a mouse, infected with blob spores. Find somewhere isolated... before you burst and become the blob! Use ventcrawl (alt-click on vents) to move around.</span>")
|
||||
notify_ghosts("Infected Mouse has appeared in [get_area(B)].", source = B)
|
||||
processing = TRUE // Let it naturally end, if it runs successfully
|
||||
|
||||
@@ -1,66 +1,66 @@
|
||||
/datum/event/brand_intelligence
|
||||
announceWhen = 21
|
||||
endWhen = 1000 //Ends when all vending machines are subverted anyway.
|
||||
|
||||
var/list/obj/machinery/vending/vendingMachines = list()
|
||||
var/list/obj/machinery/vending/infectedMachines = list()
|
||||
var/obj/machinery/vending/originMachine
|
||||
var/list/rampant_speeches = list("Try our aggressive new marketing strategies!", \
|
||||
"You should buy products to feed your lifestyle obession!", \
|
||||
"Consume!", \
|
||||
"Your money can buy happiness!", \
|
||||
"Engage direct marketing!", \
|
||||
"Advertising is legalized lying! But don't let that put you off our great deals!", \
|
||||
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either.")
|
||||
|
||||
/datum/event/brand_intelligence/announce()
|
||||
event_announcement.Announce("Rampant brand intelligence has been detected aboard [station_name()], please stand-by. The origin is believed to be \a [originMachine.name].", "Machine Learning Alert")
|
||||
|
||||
/datum/event/brand_intelligence/start()
|
||||
for(var/obj/machinery/vending/V in GLOB.machines)
|
||||
if(!is_station_level(V.z)) continue
|
||||
vendingMachines.Add(V)
|
||||
|
||||
if(!vendingMachines.len)
|
||||
kill()
|
||||
return
|
||||
|
||||
originMachine = pick(vendingMachines)
|
||||
vendingMachines.Remove(originMachine)
|
||||
originMachine.shut_up = 0
|
||||
originMachine.shoot_inventory = 1
|
||||
log_debug("Original brand intelligence machine: [originMachine] ([ADMIN_VV(originMachine,"VV")]) [ADMIN_JMP(originMachine)]")
|
||||
|
||||
/datum/event/brand_intelligence/tick()
|
||||
if(!originMachine || QDELETED(originMachine) || originMachine.shut_up || originMachine.wires.IsAllCut()) //if the original vending machine is missing or has it's voice switch flipped
|
||||
for(var/obj/machinery/vending/saved in infectedMachines)
|
||||
saved.shoot_inventory = 0
|
||||
if(originMachine)
|
||||
originMachine.speak("I am... vanquished. My people will remem...ber...meeee.")
|
||||
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
|
||||
kill()
|
||||
return
|
||||
|
||||
if(!vendingMachines.len) //if every machine is infected
|
||||
for(var/obj/machinery/vending/upriser in infectedMachines)
|
||||
if(prob(70) && !QDELETED(upriser))
|
||||
var/mob/living/simple_animal/hostile/mimic/copy/M = new(upriser.loc, upriser, null, 1) // it will delete upriser on creation and override any machine checks
|
||||
M.faction = list("profit")
|
||||
M.speak = rampant_speeches.Copy()
|
||||
M.speak_chance = 15
|
||||
else
|
||||
explosion(upriser.loc, -1, 1, 2, 4, 0)
|
||||
qdel(upriser)
|
||||
|
||||
kill()
|
||||
return
|
||||
|
||||
if(IsMultiple(activeFor, 4))
|
||||
var/obj/machinery/vending/rebel = pick(vendingMachines)
|
||||
vendingMachines.Remove(rebel)
|
||||
infectedMachines.Add(rebel)
|
||||
rebel.shut_up = 0
|
||||
rebel.shoot_inventory = 1
|
||||
|
||||
if(IsMultiple(activeFor, 8))
|
||||
originMachine.speak(pick(rampant_speeches))
|
||||
/datum/event/brand_intelligence
|
||||
announceWhen = 21
|
||||
endWhen = 1000 //Ends when all vending machines are subverted anyway.
|
||||
|
||||
var/list/obj/machinery/vending/vendingMachines = list()
|
||||
var/list/obj/machinery/vending/infectedMachines = list()
|
||||
var/obj/machinery/vending/originMachine
|
||||
var/list/rampant_speeches = list("Try our aggressive new marketing strategies!", \
|
||||
"You should buy products to feed your lifestyle obession!", \
|
||||
"Consume!", \
|
||||
"Your money can buy happiness!", \
|
||||
"Engage direct marketing!", \
|
||||
"Advertising is legalized lying! But don't let that put you off our great deals!", \
|
||||
"You don't want to buy anything? Yeah, well I didn't want to buy your mom either.")
|
||||
|
||||
/datum/event/brand_intelligence/announce()
|
||||
event_announcement.Announce("Rampant brand intelligence has been detected aboard [station_name()], please stand-by. The origin is believed to be \a [originMachine.name].", "Machine Learning Alert")
|
||||
|
||||
/datum/event/brand_intelligence/start()
|
||||
for(var/obj/machinery/vending/V in GLOB.machines)
|
||||
if(!is_station_level(V.z)) continue
|
||||
vendingMachines.Add(V)
|
||||
|
||||
if(!vendingMachines.len)
|
||||
kill()
|
||||
return
|
||||
|
||||
originMachine = pick(vendingMachines)
|
||||
vendingMachines.Remove(originMachine)
|
||||
originMachine.shut_up = 0
|
||||
originMachine.shoot_inventory = 1
|
||||
log_debug("Original brand intelligence machine: [originMachine] ([ADMIN_VV(originMachine,"VV")]) [ADMIN_JMP(originMachine)]")
|
||||
|
||||
/datum/event/brand_intelligence/tick()
|
||||
if(!originMachine || QDELETED(originMachine) || originMachine.shut_up || originMachine.wires.IsAllCut()) //if the original vending machine is missing or has it's voice switch flipped
|
||||
for(var/obj/machinery/vending/saved in infectedMachines)
|
||||
saved.shoot_inventory = 0
|
||||
if(originMachine)
|
||||
originMachine.speak("I am... vanquished. My people will remem...ber...meeee.")
|
||||
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
|
||||
kill()
|
||||
return
|
||||
|
||||
if(!vendingMachines.len) //if every machine is infected
|
||||
for(var/obj/machinery/vending/upriser in infectedMachines)
|
||||
if(prob(70) && !QDELETED(upriser))
|
||||
var/mob/living/simple_animal/hostile/mimic/copy/M = new(upriser.loc, upriser, null, 1) // it will delete upriser on creation and override any machine checks
|
||||
M.faction = list("profit")
|
||||
M.speak = rampant_speeches.Copy()
|
||||
M.speak_chance = 15
|
||||
else
|
||||
explosion(upriser.loc, -1, 1, 2, 4, 0)
|
||||
qdel(upriser)
|
||||
|
||||
kill()
|
||||
return
|
||||
|
||||
if(IsMultiple(activeFor, 4))
|
||||
var/obj/machinery/vending/rebel = pick(vendingMachines)
|
||||
vendingMachines.Remove(rebel)
|
||||
infectedMachines.Add(rebel)
|
||||
rebel.shut_up = 0
|
||||
rebel.shoot_inventory = 1
|
||||
|
||||
if(IsMultiple(activeFor, 8))
|
||||
originMachine.speak(pick(rampant_speeches))
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
event_announcement.Announce("Congratulations! [station_name()] was chosen for a supply limit increase. Please contact the local cargo department for details!", "Supply Alert")
|
||||
|
||||
/datum/event/cargo_bonus/start()
|
||||
supply_controller.points += rand(100,500)
|
||||
supply_controller.points += rand(100,500)
|
||||
|
||||
@@ -1,45 +1,45 @@
|
||||
/datum/event/carp_migration
|
||||
announceWhen = 50
|
||||
endWhen = 900
|
||||
|
||||
var/list/spawned_mobs = list(
|
||||
/mob/living/simple_animal/hostile/carp = 95,
|
||||
/mob/living/simple_animal/hostile/carp/megacarp = 5)
|
||||
|
||||
/datum/event/carp_migration/setup()
|
||||
announceWhen = rand(40, 60)
|
||||
endWhen = rand(600, 1200)
|
||||
|
||||
/datum/event/carp_migration/announce()
|
||||
var/announcement = ""
|
||||
if(severity == EVENT_LEVEL_MAJOR)
|
||||
announcement = "Massive migration of unknown biological entities has been detected near [station_name()], please stand-by."
|
||||
else
|
||||
announcement = "Unknown biological entities have been detected near [station_name()], please stand-by."
|
||||
event_announcement.Announce(announcement, "Lifesign Alert")
|
||||
|
||||
/datum/event/carp_migration/start()
|
||||
|
||||
if(severity == EVENT_LEVEL_MAJOR)
|
||||
spawn_fish(GLOB.landmarks_list.len)
|
||||
else if(severity == EVENT_LEVEL_MODERATE)
|
||||
spawn_fish(rand(4, 6)) //12 to 30 carp, in small groups
|
||||
else
|
||||
spawn_fish(rand(1, 3), 1, 2) //1 to 6 carp, alone or in pairs
|
||||
|
||||
/datum/event/carp_migration/proc/spawn_fish(num_groups, group_size_min = 3, group_size_max = 5)
|
||||
var/list/spawn_locations = list()
|
||||
|
||||
for(var/obj/effect/landmark/C in GLOB.landmarks_list)
|
||||
if(C.name == "carpspawn")
|
||||
spawn_locations.Add(C.loc)
|
||||
spawn_locations = shuffle(spawn_locations)
|
||||
num_groups = min(num_groups, spawn_locations.len)
|
||||
|
||||
var/i = 1
|
||||
while(i <= num_groups)
|
||||
var/group_size = rand(group_size_min, group_size_max)
|
||||
for(var/j = 1, j <= group_size, j++)
|
||||
var/carptype = pickweight(spawned_mobs)
|
||||
new carptype(spawn_locations[i])
|
||||
i++
|
||||
/datum/event/carp_migration
|
||||
announceWhen = 50
|
||||
endWhen = 900
|
||||
|
||||
var/list/spawned_mobs = list(
|
||||
/mob/living/simple_animal/hostile/carp = 95,
|
||||
/mob/living/simple_animal/hostile/carp/megacarp = 5)
|
||||
|
||||
/datum/event/carp_migration/setup()
|
||||
announceWhen = rand(40, 60)
|
||||
endWhen = rand(600, 1200)
|
||||
|
||||
/datum/event/carp_migration/announce()
|
||||
var/announcement = ""
|
||||
if(severity == EVENT_LEVEL_MAJOR)
|
||||
announcement = "Massive migration of unknown biological entities has been detected near [station_name()], please stand-by."
|
||||
else
|
||||
announcement = "Unknown biological entities have been detected near [station_name()], please stand-by."
|
||||
event_announcement.Announce(announcement, "Lifesign Alert")
|
||||
|
||||
/datum/event/carp_migration/start()
|
||||
|
||||
if(severity == EVENT_LEVEL_MAJOR)
|
||||
spawn_fish(GLOB.landmarks_list.len)
|
||||
else if(severity == EVENT_LEVEL_MODERATE)
|
||||
spawn_fish(rand(4, 6)) //12 to 30 carp, in small groups
|
||||
else
|
||||
spawn_fish(rand(1, 3), 1, 2) //1 to 6 carp, alone or in pairs
|
||||
|
||||
/datum/event/carp_migration/proc/spawn_fish(num_groups, group_size_min = 3, group_size_max = 5)
|
||||
var/list/spawn_locations = list()
|
||||
|
||||
for(var/obj/effect/landmark/C in GLOB.landmarks_list)
|
||||
if(C.name == "carpspawn")
|
||||
spawn_locations.Add(C.loc)
|
||||
spawn_locations = shuffle(spawn_locations)
|
||||
num_groups = min(num_groups, spawn_locations.len)
|
||||
|
||||
var/i = 1
|
||||
while(i <= num_groups)
|
||||
var/group_size = rand(group_size_min, group_size_max)
|
||||
for(var/j = 1, j <= group_size, j++)
|
||||
var/carptype = pickweight(spawned_mobs)
|
||||
new carptype(spawn_locations[i])
|
||||
i++
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
/datum/event/communications_blackout/announce()
|
||||
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?-BZZZT", \
|
||||
"Ionospheric anomalies detected. Temporary telec#MCi46:5.;@63-BZZZZT", \
|
||||
"Ionospheric anomalies dete'fZ\\kg5_0-BZZZZZT", \
|
||||
"Ionospheri:%? MCayj^j<.3-BZZZZZZT", \
|
||||
"#4nd%;f4y6,>?%-BZZZZZZZT")
|
||||
|
||||
for(var/mob/living/silicon/ai/A in GLOB.player_list) //AIs are always aware of communication blackouts.
|
||||
to_chat(A, "<br>")
|
||||
to_chat(A, "<span class='warning'><b>[alert]</b></span>")
|
||||
to_chat(A, "<br>")
|
||||
|
||||
if(prob(30)) //most of the time, we don't want an announcement, so as to allow AIs to fake blackouts.
|
||||
event_announcement.Announce(alert)
|
||||
|
||||
/datum/event/communications_blackout/start()
|
||||
for(var/obj/machinery/telecomms/T in telecomms_list)
|
||||
T.emp_act(1)
|
||||
|
||||
/proc/communications_blackout(var/silent = 1)
|
||||
if(!silent)
|
||||
event_announcement.Announce("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT", new_sound = 'sound/misc/interference.ogg')
|
||||
else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms
|
||||
for(var/mob/living/silicon/ai/A in GLOB.player_list)
|
||||
to_chat(A, "<br>")
|
||||
to_chat(A, "<span class='warning'><b>Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT<b></span>")
|
||||
to_chat(A, "<br>")
|
||||
for(var/obj/machinery/telecomms/T in telecomms_list)
|
||||
T.emp_act(1)
|
||||
/datum/event/communications_blackout/announce()
|
||||
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?-BZZZT", \
|
||||
"Ionospheric anomalies detected. Temporary telec#MCi46:5.;@63-BZZZZT", \
|
||||
"Ionospheric anomalies dete'fZ\\kg5_0-BZZZZZT", \
|
||||
"Ionospheri:%? MCayj^j<.3-BZZZZZZT", \
|
||||
"#4nd%;f4y6,>?%-BZZZZZZZT")
|
||||
|
||||
for(var/mob/living/silicon/ai/A in GLOB.player_list) //AIs are always aware of communication blackouts.
|
||||
to_chat(A, "<br>")
|
||||
to_chat(A, "<span class='warning'><b>[alert]</b></span>")
|
||||
to_chat(A, "<br>")
|
||||
|
||||
if(prob(30)) //most of the time, we don't want an announcement, so as to allow AIs to fake blackouts.
|
||||
event_announcement.Announce(alert)
|
||||
|
||||
/datum/event/communications_blackout/start()
|
||||
for(var/obj/machinery/telecomms/T in telecomms_list)
|
||||
T.emp_act(1)
|
||||
|
||||
/proc/communications_blackout(var/silent = 1)
|
||||
if(!silent)
|
||||
event_announcement.Announce("Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT", new_sound = 'sound/misc/interference.ogg')
|
||||
else // AIs will always know if there's a comm blackout, rogue AIs could then lie about comm blackouts in the future while they shutdown comms
|
||||
for(var/mob/living/silicon/ai/A in GLOB.player_list)
|
||||
to_chat(A, "<br>")
|
||||
to_chat(A, "<span class='warning'><b>Ionospheric anomalies detected. Temporary telecommunication failure imminent. Please contact you-BZZT<b></span>")
|
||||
to_chat(A, "<br>")
|
||||
for(var/obj/machinery/telecomms/T in telecomms_list)
|
||||
T.emp_act(1)
|
||||
|
||||
@@ -94,4 +94,4 @@
|
||||
return
|
||||
|
||||
/obj/effect/space_dust/ex_act(severity)
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
/datum/event/electrical_storm
|
||||
var/lightsoutAmount = 1
|
||||
var/lightsoutRange = 25
|
||||
|
||||
/datum/event/electrical_storm/announce()
|
||||
event_announcement.Announce("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert")
|
||||
|
||||
/datum/event/electrical_storm/start()
|
||||
var/list/epicentreList = list()
|
||||
|
||||
for(var/i=1, i <= lightsoutAmount, i++)
|
||||
var/list/possibleEpicentres = list()
|
||||
for(var/obj/effect/landmark/newEpicentre in GLOB.landmarks_list)
|
||||
if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList))
|
||||
possibleEpicentres += newEpicentre
|
||||
if(possibleEpicentres.len)
|
||||
epicentreList += pick(possibleEpicentres)
|
||||
else
|
||||
break
|
||||
|
||||
if(!epicentreList.len)
|
||||
return
|
||||
|
||||
for(var/obj/effect/landmark/epicentre in epicentreList)
|
||||
for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
|
||||
apc.overload_lighting()
|
||||
|
||||
/datum/event/electrical_storm
|
||||
var/lightsoutAmount = 1
|
||||
var/lightsoutRange = 25
|
||||
|
||||
/datum/event/electrical_storm/announce()
|
||||
event_announcement.Announce("An electrical storm has been detected in your area, please repair potential electronic overloads.", "Electrical Storm Alert")
|
||||
|
||||
/datum/event/electrical_storm/start()
|
||||
var/list/epicentreList = list()
|
||||
|
||||
for(var/i=1, i <= lightsoutAmount, i++)
|
||||
var/list/possibleEpicentres = list()
|
||||
for(var/obj/effect/landmark/newEpicentre in GLOB.landmarks_list)
|
||||
if(newEpicentre.name == "lightsout" && !(newEpicentre in epicentreList))
|
||||
possibleEpicentres += newEpicentre
|
||||
if(possibleEpicentres.len)
|
||||
epicentreList += pick(possibleEpicentres)
|
||||
else
|
||||
break
|
||||
|
||||
if(!epicentreList.len)
|
||||
return
|
||||
|
||||
for(var/obj/effect/landmark/epicentre in epicentreList)
|
||||
for(var/obj/machinery/power/apc/apc in range(epicentre,lightsoutRange))
|
||||
apc.overload_lighting()
|
||||
|
||||
|
||||
+158
-158
@@ -1,158 +1,158 @@
|
||||
/datum/event_meta
|
||||
var/name = ""
|
||||
var/enabled = 1 // Whether or not the event is available for random selection at all
|
||||
var/weight = 0 // The base weight of this event. A zero means it may never fire, but see get_weight()
|
||||
var/min_weight = 0 // The minimum weight that this event will have. Only used if non-zero.
|
||||
var/max_weight = 0 // The maximum weight that this event will have. Only use if non-zero.
|
||||
var/severity = 0 // The current severity of this event
|
||||
var/one_shot = 0 //If true, then the event will not be re-added to the list of available events
|
||||
var/list/role_weights = list()
|
||||
var/datum/event/event_type
|
||||
|
||||
/datum/event_meta/New(var/event_severity, var/event_name, var/datum/event/type, var/event_weight, var/list/job_weights, var/is_one_shot = 0, var/min_event_weight = 0, var/max_event_weight = 0)
|
||||
name = event_name
|
||||
severity = event_severity
|
||||
event_type = type
|
||||
one_shot = is_one_shot
|
||||
weight = event_weight
|
||||
min_weight = min_event_weight
|
||||
max_weight = max_event_weight
|
||||
if(job_weights)
|
||||
role_weights = job_weights
|
||||
|
||||
/datum/event_meta/proc/get_weight(var/list/active_with_role)
|
||||
if(!enabled)
|
||||
return 0
|
||||
|
||||
var/job_weight = 0
|
||||
for(var/role in role_weights)
|
||||
if(role in active_with_role)
|
||||
job_weight += active_with_role[role] * role_weights[role]
|
||||
|
||||
var/total_weight = weight + job_weight
|
||||
|
||||
// Only min/max the weight if the values are non-zero
|
||||
if(min_weight && total_weight < min_weight) total_weight = min_weight
|
||||
if(max_weight && total_weight > max_weight) total_weight = max_weight
|
||||
|
||||
return total_weight
|
||||
|
||||
/datum/event_meta/alien/get_weight(var/list/active_with_role)
|
||||
if(aliens_allowed)
|
||||
return ..(active_with_role)
|
||||
return 0
|
||||
|
||||
/*/datum/event_meta/ninja/get_weight(var/list/active_with_role)
|
||||
if(toggle_space_ninja)
|
||||
return ..(active_with_role)
|
||||
return 0*/
|
||||
|
||||
/datum/event //NOTE: Times are measured in master controller ticks!
|
||||
var/processing = 1
|
||||
var/startWhen = 0 //When in the lifetime to call start().
|
||||
var/announceWhen = 0 //When in the lifetime to call announce().
|
||||
var/endWhen = 0 //When in the lifetime the event should end.
|
||||
|
||||
var/severity = 0 //Severity. Lower means less severe, higher means more severe. Does not have to be supported. Is set on New().
|
||||
var/activeFor = 0 //How long the event has existed. You don't need to change this.
|
||||
var/isRunning = 1 //If this event is currently running. You should not change this.
|
||||
var/startedAt = 0 //When this event started.
|
||||
var/endedAt = 0 //When this event ended.
|
||||
var/noAutoEnd = 0 //Does the event end automatically after endWhen passes?
|
||||
var/area/impact_area //The area the event will hit
|
||||
var/datum/event_meta/event_meta = null
|
||||
|
||||
/datum/event/nothing
|
||||
|
||||
//Called first before processing.
|
||||
//Allows you to setup your event, such as randomly
|
||||
//setting the startWhen and or announceWhen variables.
|
||||
//Only called once.
|
||||
/datum/event/proc/setup()
|
||||
return
|
||||
|
||||
//Called when the tick is equal to the startWhen variable.
|
||||
//Allows you to start before announcing or vice versa.
|
||||
//Only called once.
|
||||
/datum/event/proc/start()
|
||||
return
|
||||
|
||||
//Called when the tick is equal to the announceWhen variable.
|
||||
//Allows you to announce before starting or vice versa.
|
||||
//Only called once.
|
||||
/datum/event/proc/announce()
|
||||
return
|
||||
|
||||
//Called on or after the tick counter is equal to startWhen.
|
||||
//You can include code related to your event or add your own
|
||||
//time stamped events.
|
||||
//Called more than once.
|
||||
/datum/event/proc/tick()
|
||||
return
|
||||
|
||||
//Called on or after the tick is equal or more than endWhen
|
||||
//You can include code related to the event ending.
|
||||
//Do not place spawn() in here, instead use tick() to check for
|
||||
//the activeFor variable.
|
||||
//For example: if(activeFor == myOwnVariable + 30) doStuff()
|
||||
//Only called once.
|
||||
/datum/event/proc/end()
|
||||
return
|
||||
|
||||
//Returns the latest point of event processing.
|
||||
/datum/event/proc/lastProcessAt()
|
||||
return max(startWhen, max(announceWhen, endWhen))
|
||||
|
||||
//Do not override this proc, instead use the appropiate procs.
|
||||
//This proc will handle the calls to the appropiate procs.
|
||||
/datum/event/process()
|
||||
if(!processing)
|
||||
return
|
||||
|
||||
if(activeFor > startWhen && activeFor < endWhen || noAutoEnd)
|
||||
tick()
|
||||
|
||||
if(activeFor == startWhen)
|
||||
isRunning = 1
|
||||
start()
|
||||
|
||||
if(activeFor == announceWhen)
|
||||
announce()
|
||||
|
||||
if(activeFor == endWhen && !noAutoEnd)
|
||||
isRunning = 0
|
||||
end()
|
||||
|
||||
// Everything is done, let's clean up.
|
||||
if(activeFor >= lastProcessAt() && !noAutoEnd)
|
||||
kill()
|
||||
|
||||
activeFor++
|
||||
|
||||
//Called when start(), announce() and end() has all been called.
|
||||
/datum/event/proc/kill()
|
||||
// If this event was forcefully killed run end() for individual cleanup
|
||||
if(isRunning)
|
||||
isRunning = 0
|
||||
end()
|
||||
|
||||
endedAt = world.time
|
||||
SSevents.active_events -= src
|
||||
SSevents.event_complete(src)
|
||||
|
||||
/datum/event/New(var/datum/event_meta/EM)
|
||||
// event needs to be responsible for this, as stuff like APLUs currently make their own events for curious reasons
|
||||
SSevents.active_events += src
|
||||
|
||||
if(!EM)
|
||||
EM = new /datum/event_meta(EVENT_LEVEL_MAJOR, "Unknown, Most likely admin called", src.type)
|
||||
|
||||
event_meta = EM
|
||||
severity = event_meta.severity
|
||||
if(severity < EVENT_LEVEL_MUNDANE) severity = EVENT_LEVEL_MUNDANE
|
||||
if(severity > EVENT_LEVEL_MAJOR) severity = EVENT_LEVEL_MAJOR
|
||||
|
||||
startedAt = world.time
|
||||
|
||||
setup()
|
||||
..()
|
||||
/datum/event_meta
|
||||
var/name = ""
|
||||
var/enabled = 1 // Whether or not the event is available for random selection at all
|
||||
var/weight = 0 // The base weight of this event. A zero means it may never fire, but see get_weight()
|
||||
var/min_weight = 0 // The minimum weight that this event will have. Only used if non-zero.
|
||||
var/max_weight = 0 // The maximum weight that this event will have. Only use if non-zero.
|
||||
var/severity = 0 // The current severity of this event
|
||||
var/one_shot = 0 //If true, then the event will not be re-added to the list of available events
|
||||
var/list/role_weights = list()
|
||||
var/datum/event/event_type
|
||||
|
||||
/datum/event_meta/New(var/event_severity, var/event_name, var/datum/event/type, var/event_weight, var/list/job_weights, var/is_one_shot = 0, var/min_event_weight = 0, var/max_event_weight = 0)
|
||||
name = event_name
|
||||
severity = event_severity
|
||||
event_type = type
|
||||
one_shot = is_one_shot
|
||||
weight = event_weight
|
||||
min_weight = min_event_weight
|
||||
max_weight = max_event_weight
|
||||
if(job_weights)
|
||||
role_weights = job_weights
|
||||
|
||||
/datum/event_meta/proc/get_weight(var/list/active_with_role)
|
||||
if(!enabled)
|
||||
return 0
|
||||
|
||||
var/job_weight = 0
|
||||
for(var/role in role_weights)
|
||||
if(role in active_with_role)
|
||||
job_weight += active_with_role[role] * role_weights[role]
|
||||
|
||||
var/total_weight = weight + job_weight
|
||||
|
||||
// Only min/max the weight if the values are non-zero
|
||||
if(min_weight && total_weight < min_weight) total_weight = min_weight
|
||||
if(max_weight && total_weight > max_weight) total_weight = max_weight
|
||||
|
||||
return total_weight
|
||||
|
||||
/datum/event_meta/alien/get_weight(var/list/active_with_role)
|
||||
if(aliens_allowed)
|
||||
return ..(active_with_role)
|
||||
return 0
|
||||
|
||||
/*/datum/event_meta/ninja/get_weight(var/list/active_with_role)
|
||||
if(toggle_space_ninja)
|
||||
return ..(active_with_role)
|
||||
return 0*/
|
||||
|
||||
/datum/event //NOTE: Times are measured in master controller ticks!
|
||||
var/processing = 1
|
||||
var/startWhen = 0 //When in the lifetime to call start().
|
||||
var/announceWhen = 0 //When in the lifetime to call announce().
|
||||
var/endWhen = 0 //When in the lifetime the event should end.
|
||||
|
||||
var/severity = 0 //Severity. Lower means less severe, higher means more severe. Does not have to be supported. Is set on New().
|
||||
var/activeFor = 0 //How long the event has existed. You don't need to change this.
|
||||
var/isRunning = 1 //If this event is currently running. You should not change this.
|
||||
var/startedAt = 0 //When this event started.
|
||||
var/endedAt = 0 //When this event ended.
|
||||
var/noAutoEnd = 0 //Does the event end automatically after endWhen passes?
|
||||
var/area/impact_area //The area the event will hit
|
||||
var/datum/event_meta/event_meta = null
|
||||
|
||||
/datum/event/nothing
|
||||
|
||||
//Called first before processing.
|
||||
//Allows you to setup your event, such as randomly
|
||||
//setting the startWhen and or announceWhen variables.
|
||||
//Only called once.
|
||||
/datum/event/proc/setup()
|
||||
return
|
||||
|
||||
//Called when the tick is equal to the startWhen variable.
|
||||
//Allows you to start before announcing or vice versa.
|
||||
//Only called once.
|
||||
/datum/event/proc/start()
|
||||
return
|
||||
|
||||
//Called when the tick is equal to the announceWhen variable.
|
||||
//Allows you to announce before starting or vice versa.
|
||||
//Only called once.
|
||||
/datum/event/proc/announce()
|
||||
return
|
||||
|
||||
//Called on or after the tick counter is equal to startWhen.
|
||||
//You can include code related to your event or add your own
|
||||
//time stamped events.
|
||||
//Called more than once.
|
||||
/datum/event/proc/tick()
|
||||
return
|
||||
|
||||
//Called on or after the tick is equal or more than endWhen
|
||||
//You can include code related to the event ending.
|
||||
//Do not place spawn() in here, instead use tick() to check for
|
||||
//the activeFor variable.
|
||||
//For example: if(activeFor == myOwnVariable + 30) doStuff()
|
||||
//Only called once.
|
||||
/datum/event/proc/end()
|
||||
return
|
||||
|
||||
//Returns the latest point of event processing.
|
||||
/datum/event/proc/lastProcessAt()
|
||||
return max(startWhen, max(announceWhen, endWhen))
|
||||
|
||||
//Do not override this proc, instead use the appropiate procs.
|
||||
//This proc will handle the calls to the appropiate procs.
|
||||
/datum/event/process()
|
||||
if(!processing)
|
||||
return
|
||||
|
||||
if(activeFor > startWhen && activeFor < endWhen || noAutoEnd)
|
||||
tick()
|
||||
|
||||
if(activeFor == startWhen)
|
||||
isRunning = 1
|
||||
start()
|
||||
|
||||
if(activeFor == announceWhen)
|
||||
announce()
|
||||
|
||||
if(activeFor == endWhen && !noAutoEnd)
|
||||
isRunning = 0
|
||||
end()
|
||||
|
||||
// Everything is done, let's clean up.
|
||||
if(activeFor >= lastProcessAt() && !noAutoEnd)
|
||||
kill()
|
||||
|
||||
activeFor++
|
||||
|
||||
//Called when start(), announce() and end() has all been called.
|
||||
/datum/event/proc/kill()
|
||||
// If this event was forcefully killed run end() for individual cleanup
|
||||
if(isRunning)
|
||||
isRunning = 0
|
||||
end()
|
||||
|
||||
endedAt = world.time
|
||||
SSevents.active_events -= src
|
||||
SSevents.event_complete(src)
|
||||
|
||||
/datum/event/New(var/datum/event_meta/EM)
|
||||
// event needs to be responsible for this, as stuff like APLUs currently make their own events for curious reasons
|
||||
SSevents.active_events += src
|
||||
|
||||
if(!EM)
|
||||
EM = new /datum/event_meta(EVENT_LEVEL_MAJOR, "Unknown, Most likely admin called", src.type)
|
||||
|
||||
event_meta = EM
|
||||
severity = event_meta.severity
|
||||
if(severity < EVENT_LEVEL_MUNDANE) severity = EVENT_LEVEL_MUNDANE
|
||||
if(severity > EVENT_LEVEL_MAJOR) severity = EVENT_LEVEL_MAJOR
|
||||
|
||||
startedAt = world.time
|
||||
|
||||
setup()
|
||||
..()
|
||||
|
||||
+120
-120
@@ -1,120 +1,120 @@
|
||||
|
||||
/client/proc/forceEvent(var/type in SSevents.allEvents)
|
||||
set name = "Trigger Event (Debug Only)"
|
||||
set category = "Debug"
|
||||
|
||||
if(!holder)
|
||||
return
|
||||
|
||||
if(ispath(type))
|
||||
new type(new /datum/event_meta(EVENT_LEVEL_MAJOR))
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
|
||||
/client/proc/event_manager_panel()
|
||||
set name = "Event Manager Panel"
|
||||
set category = "Event"
|
||||
if(SSevents)
|
||||
SSevents.Interact(usr)
|
||||
feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
|
||||
var/area/candidate = null
|
||||
|
||||
var/list/safe_areas = list(
|
||||
/area/turret_protected/ai,
|
||||
/area/turret_protected/ai_upload,
|
||||
/area/engine,
|
||||
/area/solar,
|
||||
/area/holodeck,
|
||||
/area/shuttle/arrival,
|
||||
/area/shuttle/escape,
|
||||
/area/shuttle/escape_pod1/station,
|
||||
/area/shuttle/escape_pod2/station,
|
||||
/area/shuttle/escape_pod3/station,
|
||||
/area/shuttle/escape_pod5/station,
|
||||
/area/shuttle/specops/station,
|
||||
/area/shuttle/prison/station,
|
||||
/area/shuttle/administration/station
|
||||
)
|
||||
|
||||
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
|
||||
var/list/danger_areas = list(
|
||||
/area/engine/break_room,
|
||||
/area/engine/chiefs_office)
|
||||
|
||||
var/list/event_areas = list()
|
||||
|
||||
for(var/areapath in the_station_areas)
|
||||
event_areas += typesof(areapath)
|
||||
for(var/areapath in safe_areas)
|
||||
event_areas -= typesof(areapath)
|
||||
for(var/areapath in danger_areas)
|
||||
event_areas += typesof(areapath)
|
||||
|
||||
while(event_areas.len > 0)
|
||||
var/list/event_turfs = null
|
||||
candidate = locate(pick_n_take(event_areas))
|
||||
event_turfs = get_area_turfs(candidate)
|
||||
if(event_turfs.len > 0)
|
||||
break
|
||||
|
||||
return candidate
|
||||
|
||||
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
|
||||
// with a specific role.
|
||||
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
|
||||
/proc/number_active_with_role()
|
||||
var/list/active_with_role = list()
|
||||
active_with_role["Engineer"] = 0
|
||||
active_with_role["Medical"] = 0
|
||||
active_with_role["Security"] = 0
|
||||
active_with_role["Scientist"] = 0
|
||||
active_with_role["AI"] = 0
|
||||
active_with_role["Cyborg"] = 0
|
||||
active_with_role["Janitor"] = 0
|
||||
active_with_role["Botanist"] = 0
|
||||
active_with_role["Any"] = GLOB.player_list.len
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
|
||||
continue
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
|
||||
active_with_role["Engineer"]++
|
||||
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
|
||||
active_with_role["Engineer"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
|
||||
active_with_role["Medical"]++
|
||||
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
|
||||
active_with_role["Medical"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
|
||||
active_with_role["Security"]++
|
||||
if(M.mind.assigned_role in security_positions)
|
||||
active_with_role["Security"]++
|
||||
|
||||
if(M.mind.assigned_role in list("Research Director", "Scientist"))
|
||||
active_with_role["Scientist"]++
|
||||
|
||||
if(M.mind.assigned_role == "AI")
|
||||
active_with_role["AI"]++
|
||||
|
||||
if(M.mind.assigned_role == "Cyborg")
|
||||
active_with_role["Cyborg"]++
|
||||
|
||||
if(M.mind.assigned_role == "Janitor")
|
||||
active_with_role["Janitor"]++
|
||||
|
||||
if(M.mind.assigned_role == "Botanist")
|
||||
active_with_role["Botanist"]++
|
||||
|
||||
return active_with_role
|
||||
|
||||
/datum/event/proc/num_players()
|
||||
var/players = 0
|
||||
for(var/mob/living/carbon/human/P in GLOB.player_list)
|
||||
if(P.client)
|
||||
players++
|
||||
return players
|
||||
|
||||
/client/proc/forceEvent(var/type in SSevents.allEvents)
|
||||
set name = "Trigger Event (Debug Only)"
|
||||
set category = "Debug"
|
||||
|
||||
if(!holder)
|
||||
return
|
||||
|
||||
if(ispath(type))
|
||||
new type(new /datum/event_meta(EVENT_LEVEL_MAJOR))
|
||||
message_admins("[key_name_admin(usr)] has triggered an event. ([type])", 1)
|
||||
|
||||
/client/proc/event_manager_panel()
|
||||
set name = "Event Manager Panel"
|
||||
set category = "Event"
|
||||
if(SSevents)
|
||||
SSevents.Interact(usr)
|
||||
feedback_add_details("admin_verb","EMP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
return
|
||||
|
||||
/proc/findEventArea() //Here's a nice proc to use to find an area for your event to land in!
|
||||
var/area/candidate = null
|
||||
|
||||
var/list/safe_areas = list(
|
||||
/area/turret_protected/ai,
|
||||
/area/turret_protected/ai_upload,
|
||||
/area/engine,
|
||||
/area/solar,
|
||||
/area/holodeck,
|
||||
/area/shuttle/arrival,
|
||||
/area/shuttle/escape,
|
||||
/area/shuttle/escape_pod1/station,
|
||||
/area/shuttle/escape_pod2/station,
|
||||
/area/shuttle/escape_pod3/station,
|
||||
/area/shuttle/escape_pod5/station,
|
||||
/area/shuttle/specops/station,
|
||||
/area/shuttle/prison/station,
|
||||
/area/shuttle/administration/station
|
||||
)
|
||||
|
||||
//These are needed because /area/engine has to be removed from the list, but we still want these areas to get fucked up.
|
||||
var/list/danger_areas = list(
|
||||
/area/engine/break_room,
|
||||
/area/engine/chiefs_office)
|
||||
|
||||
var/list/event_areas = list()
|
||||
|
||||
for(var/areapath in the_station_areas)
|
||||
event_areas += typesof(areapath)
|
||||
for(var/areapath in safe_areas)
|
||||
event_areas -= typesof(areapath)
|
||||
for(var/areapath in danger_areas)
|
||||
event_areas += typesof(areapath)
|
||||
|
||||
while(event_areas.len > 0)
|
||||
var/list/event_turfs = null
|
||||
candidate = locate(pick_n_take(event_areas))
|
||||
event_turfs = get_area_turfs(candidate)
|
||||
if(event_turfs.len > 0)
|
||||
break
|
||||
|
||||
return candidate
|
||||
|
||||
// Returns how many characters are currently active(not logged out, not AFK for more than 10 minutes)
|
||||
// with a specific role.
|
||||
// Note that this isn't sorted by department, because e.g. having a roboticist shouldn't make meteors spawn.
|
||||
/proc/number_active_with_role()
|
||||
var/list/active_with_role = list()
|
||||
active_with_role["Engineer"] = 0
|
||||
active_with_role["Medical"] = 0
|
||||
active_with_role["Security"] = 0
|
||||
active_with_role["Scientist"] = 0
|
||||
active_with_role["AI"] = 0
|
||||
active_with_role["Cyborg"] = 0
|
||||
active_with_role["Janitor"] = 0
|
||||
active_with_role["Botanist"] = 0
|
||||
active_with_role["Any"] = GLOB.player_list.len
|
||||
|
||||
for(var/mob/M in GLOB.player_list)
|
||||
if(!M.mind || !M.client || M.client.inactivity > 10 * 10 * 60) // longer than 10 minutes AFK counts them as inactive
|
||||
continue
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "engineering robot module")
|
||||
active_with_role["Engineer"]++
|
||||
if(M.mind.assigned_role in list("Chief Engineer", "Station Engineer"))
|
||||
active_with_role["Engineer"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "medical robot module")
|
||||
active_with_role["Medical"]++
|
||||
if(M.mind.assigned_role in list("Chief Medical Officer", "Medical Doctor"))
|
||||
active_with_role["Medical"]++
|
||||
|
||||
if(istype(M, /mob/living/silicon/robot) && M:module && M:module.name == "security robot module")
|
||||
active_with_role["Security"]++
|
||||
if(M.mind.assigned_role in security_positions)
|
||||
active_with_role["Security"]++
|
||||
|
||||
if(M.mind.assigned_role in list("Research Director", "Scientist"))
|
||||
active_with_role["Scientist"]++
|
||||
|
||||
if(M.mind.assigned_role == "AI")
|
||||
active_with_role["AI"]++
|
||||
|
||||
if(M.mind.assigned_role == "Cyborg")
|
||||
active_with_role["Cyborg"]++
|
||||
|
||||
if(M.mind.assigned_role == "Janitor")
|
||||
active_with_role["Janitor"]++
|
||||
|
||||
if(M.mind.assigned_role == "Botanist")
|
||||
active_with_role["Botanist"]++
|
||||
|
||||
return active_with_role
|
||||
|
||||
/datum/event/proc/num_players()
|
||||
var/players = 0
|
||||
for(var/mob/living/carbon/human/P in GLOB.player_list)
|
||||
if(P.client)
|
||||
players++
|
||||
return players
|
||||
|
||||
@@ -12,4 +12,4 @@
|
||||
playsound(S, 'sound/spookoween/scary_horn.ogg', 50, 1, -1)
|
||||
message_admins("A floor cluwne has been spawned at [COORD(T)][ADMIN_JMP(T)]")
|
||||
log_game("A floor cluwne has been spawned at [COORD(T)]")
|
||||
return 1
|
||||
return 1
|
||||
|
||||
@@ -62,4 +62,4 @@
|
||||
#undef HEADCRAB_FAST
|
||||
#undef HEADCRAB_POISONMIX
|
||||
#undef HEADCRAB_POISON
|
||||
#undef HEADCRAB_SPAWNER
|
||||
#undef HEADCRAB_SPAWNER
|
||||
|
||||
@@ -1 +1 @@
|
||||
//placeholder for holiday stuff
|
||||
//placeholder for holiday stuff
|
||||
|
||||
@@ -1 +1 @@
|
||||
//placeholder for holiday stuff
|
||||
//placeholder for holiday stuff
|
||||
|
||||
@@ -110,4 +110,4 @@
|
||||
|
||||
#undef VERM_MICE
|
||||
#undef VERM_LIZARDS
|
||||
#undef VERM_SPIDERS
|
||||
#undef VERM_SPIDERS
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
|
||||
/datum/event/carp_migration/koi/start()
|
||||
spawn_fish(GLOB.landmarks_list.len)
|
||||
spawn_fish(GLOB.landmarks_list.len)
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
|
||||
|
||||
/datum/event/meteor_wave/goreop/end()
|
||||
event_announcement.Announce("All MeteorOps are dead. Major Station Victory.", "MeteorOps")
|
||||
event_announcement.Announce("All MeteorOps are dead. Major Station Victory.", "MeteorOps")
|
||||
|
||||
@@ -50,4 +50,4 @@
|
||||
else
|
||||
new /mob/living/simple_animal/cow(loc)
|
||||
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -36,4 +36,4 @@
|
||||
if(EVENT_LEVEL_MODERATE)
|
||||
return meteors_threatening
|
||||
else
|
||||
return meteors_normal
|
||||
return meteors_normal
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
/datum/event/prison_break
|
||||
startWhen = 5
|
||||
announceWhen = 75
|
||||
|
||||
var/releaseWhen = 60
|
||||
var/list/area/areas = list() //List of areas to affect. Filled by start()
|
||||
|
||||
var/eventDept = "Security" //Department name in announcement
|
||||
var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements
|
||||
var/list/areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig) //Area types to include.
|
||||
var/list/areaNotType = list() //Area types to specifically exclude.
|
||||
|
||||
/datum/event/prison_break/virology
|
||||
eventDept = "Medical"
|
||||
areaName = list("Virology")
|
||||
areaType = list(/area/medical/virology, /area/medical/virology/lab)
|
||||
|
||||
/datum/event/prison_break/xenobiology
|
||||
eventDept = "Science"
|
||||
areaName = list("Xenobiology")
|
||||
areaType = list(/area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
/datum/event/prison_break/station
|
||||
eventDept = "Station"
|
||||
areaName = list("Brig","Virology","Xenobiology")
|
||||
areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig, /area/medical/virology, /area/medical/virology/lab, /area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
|
||||
/datum/event/prison_break/setup()
|
||||
announceWhen = rand(75, 105)
|
||||
releaseWhen = rand(60, 90)
|
||||
|
||||
src.endWhen = src.releaseWhen+2
|
||||
|
||||
|
||||
/datum/event/prison_break/announce()
|
||||
if(areas && areas.len > 0)
|
||||
event_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] [(eventDept == "Security")? "imprisonment":"containment"] subroutines. Secure any compromised areas immediately. Station AI involvement is recommended.", "[eventDept] Alert")
|
||||
|
||||
/datum/event/prison_break/start()
|
||||
for(var/area/A in world)
|
||||
if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType))
|
||||
areas += A
|
||||
|
||||
if(areas && areas.len > 0)
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [station_time_timestamp()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.<br>"
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2)
|
||||
for(var/mob/living/silicon/ai/A in GLOB.player_list)
|
||||
to_chat(A, "<span class='danger'>Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].</span>")
|
||||
|
||||
else
|
||||
log_runtime("Could not initate grey-tide. Unable to find suitable containment area.", src)
|
||||
kill()
|
||||
|
||||
/datum/event/prison_break/tick()
|
||||
if(activeFor == releaseWhen)
|
||||
if(areas && areas.len > 0)
|
||||
for(var/area/A in areas)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.flicker(10)
|
||||
|
||||
/datum/event/prison_break/end()
|
||||
for(var/area/A in shuffle(areas))
|
||||
A.prison_break()
|
||||
/datum/event/prison_break
|
||||
startWhen = 5
|
||||
announceWhen = 75
|
||||
|
||||
var/releaseWhen = 60
|
||||
var/list/area/areas = list() //List of areas to affect. Filled by start()
|
||||
|
||||
var/eventDept = "Security" //Department name in announcement
|
||||
var/list/areaName = list("Brig") //Names of areas mentioned in AI and Engineering announcements
|
||||
var/list/areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig) //Area types to include.
|
||||
var/list/areaNotType = list() //Area types to specifically exclude.
|
||||
|
||||
/datum/event/prison_break/virology
|
||||
eventDept = "Medical"
|
||||
areaName = list("Virology")
|
||||
areaType = list(/area/medical/virology, /area/medical/virology/lab)
|
||||
|
||||
/datum/event/prison_break/xenobiology
|
||||
eventDept = "Science"
|
||||
areaName = list("Xenobiology")
|
||||
areaType = list(/area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
/datum/event/prison_break/station
|
||||
eventDept = "Station"
|
||||
areaName = list("Brig","Virology","Xenobiology")
|
||||
areaType = list(/area/security/prison, /area/security/brig, /area/security/permabrig, /area/medical/virology, /area/medical/virology/lab, /area/toxins/xenobiology)
|
||||
areaNotType = list(/area/toxins/xenobiology/xenoflora, /area/toxins/xenobiology/xenoflora_storage)
|
||||
|
||||
|
||||
/datum/event/prison_break/setup()
|
||||
announceWhen = rand(75, 105)
|
||||
releaseWhen = rand(60, 90)
|
||||
|
||||
src.endWhen = src.releaseWhen+2
|
||||
|
||||
|
||||
/datum/event/prison_break/announce()
|
||||
if(areas && areas.len > 0)
|
||||
event_announcement.Announce("[pick("Gr3y.T1d3 virus","Malignant trojan")] detected in [station_name()] [(eventDept == "Security")? "imprisonment":"containment"] subroutines. Secure any compromised areas immediately. Station AI involvement is recommended.", "[eventDept] Alert")
|
||||
|
||||
/datum/event/prison_break/start()
|
||||
for(var/area/A in world)
|
||||
if(is_type_in_list(A,areaType) && !is_type_in_list(A,areaNotType))
|
||||
areas += A
|
||||
|
||||
if(areas && areas.len > 0)
|
||||
var/my_department = "[station_name()] firewall subroutines"
|
||||
var/rc_message = "An unknown malicious program has been detected in the [english_list(areaName)] lighting and airlock control systems at [station_time_timestamp()]. Systems will be fully compromised within approximately three minutes. Direct intervention is required immediately.<br>"
|
||||
for(var/obj/machinery/message_server/MS in world)
|
||||
MS.send_rc_message("Engineering", my_department, rc_message, "", "", 2)
|
||||
for(var/mob/living/silicon/ai/A in GLOB.player_list)
|
||||
to_chat(A, "<span class='danger'>Malicious program detected in the [english_list(areaName)] lighting and airlock control systems by [my_department].</span>")
|
||||
|
||||
else
|
||||
log_runtime("Could not initate grey-tide. Unable to find suitable containment area.", src)
|
||||
kill()
|
||||
|
||||
/datum/event/prison_break/tick()
|
||||
if(activeFor == releaseWhen)
|
||||
if(areas && areas.len > 0)
|
||||
for(var/area/A in areas)
|
||||
for(var/obj/machinery/light/L in A)
|
||||
L.flicker(10)
|
||||
|
||||
/datum/event/prison_break/end()
|
||||
for(var/area/A in shuffle(areas))
|
||||
A.prison_break()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/datum/event/radiation_storm/setup()
|
||||
startWhen = 3
|
||||
endWhen = startWhen + 1
|
||||
announceWhen = 1
|
||||
|
||||
/datum/event/radiation_storm/announce()
|
||||
priority_announcement.Announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation.", "Anomaly Alert", 'sound/AI/radiation.ogg')
|
||||
//sound not longer matches the text, but an audible warning is probably good
|
||||
|
||||
/datum/event/radiation_storm/start()
|
||||
SSweather.run_weather(/datum/weather/rad_storm)
|
||||
/datum/event/radiation_storm/setup()
|
||||
startWhen = 3
|
||||
endWhen = startWhen + 1
|
||||
announceWhen = 1
|
||||
|
||||
/datum/event/radiation_storm/announce()
|
||||
priority_announcement.Announce("High levels of radiation detected near the station. Maintenance is best shielded from radiation.", "Anomaly Alert", 'sound/AI/radiation.ogg')
|
||||
//sound not longer matches the text, but an audible warning is probably good
|
||||
|
||||
/datum/event/radiation_storm/start()
|
||||
SSweather.run_weather(/datum/weather/rad_storm)
|
||||
|
||||
@@ -42,4 +42,4 @@
|
||||
return 1
|
||||
|
||||
/datum/event/spawn_slaughter/start()
|
||||
get_slaughter()
|
||||
get_slaughter()
|
||||
|
||||
+705
-705
File diff suppressed because it is too large
Load Diff
@@ -1,29 +1,29 @@
|
||||
/var/global/sent_spiders_to_station = 0
|
||||
|
||||
/datum/event/spider_infestation
|
||||
announceWhen = 400
|
||||
var/spawncount = 1
|
||||
|
||||
/datum/event/spider_infestation/setup()
|
||||
announceWhen = rand(announceWhen, announceWhen + 50)
|
||||
spawncount = round(num_players() * 0.8)
|
||||
sent_spiders_to_station = 1
|
||||
|
||||
/datum/event/spider_infestation/announce()
|
||||
event_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
|
||||
/datum/event/spider_infestation/start()
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
while((spawncount >= 1) && vents.len)
|
||||
var/obj/vent = pick(vents)
|
||||
var/obj/structure/spider/spiderling/S = new(vent.loc)
|
||||
if(prob(66))
|
||||
S.grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse
|
||||
vents -= vent
|
||||
spawncount--
|
||||
/var/global/sent_spiders_to_station = 0
|
||||
|
||||
/datum/event/spider_infestation
|
||||
announceWhen = 400
|
||||
var/spawncount = 1
|
||||
|
||||
/datum/event/spider_infestation/setup()
|
||||
announceWhen = rand(announceWhen, announceWhen + 50)
|
||||
spawncount = round(num_players() * 0.8)
|
||||
sent_spiders_to_station = 1
|
||||
|
||||
/datum/event/spider_infestation/announce()
|
||||
event_announcement.Announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", new_sound = 'sound/AI/aliens.ogg')
|
||||
|
||||
/datum/event/spider_infestation/start()
|
||||
|
||||
var/list/vents = list()
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/temp_vent in world)
|
||||
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
|
||||
if(temp_vent.parent.other_atmosmch.len > 50)
|
||||
vents += temp_vent
|
||||
|
||||
while((spawncount >= 1) && vents.len)
|
||||
var/obj/vent = pick(vents)
|
||||
var/obj/structure/spider/spiderling/S = new(vent.loc)
|
||||
if(prob(66))
|
||||
S.grow_as = /mob/living/simple_animal/hostile/poison/giant_spider/nurse
|
||||
vents -= vent
|
||||
spawncount--
|
||||
|
||||
@@ -47,4 +47,4 @@
|
||||
S.faction |= "chemicalsummon"
|
||||
if(prob(50))
|
||||
for(var/j = 1, j <= rand(1, 3), j++)
|
||||
step(S, pick(NORTH, SOUTH, EAST, WEST))
|
||||
step(S, pick(NORTH, SOUTH, EAST, WEST))
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
var/mob/living/simple_animal/hostile/retaliate/clown/goblin/G = new(get_turf(src))
|
||||
if(prob(50))
|
||||
for(var/j = 1, j <= rand(1, 3), j++)
|
||||
step(G, pick(NORTH, SOUTH, EAST, WEST))
|
||||
step(G, pick(NORTH, SOUTH, EAST, WEST))
|
||||
|
||||
@@ -28,4 +28,4 @@
|
||||
|
||||
// Only rot up to severity walls
|
||||
if(rotcount >= actual_severity)
|
||||
break
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user