From e2249fa1775d288cf41263a4294d1230d42701e5 Mon Sep 17 00:00:00 2001 From: cib Date: Sat, 18 May 2013 13:48:57 +0200 Subject: [PATCH] Added organ damage random medical event. It doesn't make a lot of sense, but who cares about that! --- baystation12.dme | 1 + code/modules/events/event_dynamic.dm | 7 ++++--- code/modules/events/organ_failure.dm | 28 ++++++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 code/modules/events/organ_failure.dm diff --git a/baystation12.dme b/baystation12.dme index 915e5c3d5fa..7b8c7d1e617 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1030,6 +1030,7 @@ #include "code\modules\events\money_hacker.dm" #include "code\modules\events\money_lotto.dm" #include "code\modules\events\money_spam.dm" +#include "code\modules\events\organ_failure.dm" #include "code\modules\events\prison_break.dm" #include "code\modules\events\radiation_storm.dm" #include "code\modules\events\rogue_drones.dm" diff --git a/code/modules/events/event_dynamic.dm b/code/modules/events/event_dynamic.dm index d60f33ae06f..6af66ced1b8 100644 --- a/code/modules/events/event_dynamic.dm +++ b/code/modules/events/event_dynamic.dm @@ -69,11 +69,12 @@ possibleEvents[/datum/event/meteor_shower] = 80 * active_with_role["Engineer"] possibleEvents[/datum/event/blob] = 30 * active_with_role["Engineer"] - possibleEvents[/datum/event/viral_infection] = 25 + active_with_role["Medical"] * 25 + possibleEvents[/datum/event/viral_infection] = 25 + active_with_role["Medical"] * 100 if(active_with_role["Medical"] > 0) possibleEvents[/datum/event/radiation_storm] = active_with_role["Medical"] * 100 - possibleEvents[/datum/event/spontaneous_appendicitis] = active_with_role["Medical"] * 75 - possibleEvents[/datum/event/viral_outbreak] = active_with_role["Medical"] * 5 + possibleEvents[/datum/event/spontaneous_appendicitis] = active_with_role["Medical"] * 150 + possibleEvents[/datum/event/viral_outbreak] = active_with_role["Medical"] * 10 + possibleEvents[/datum/event/organ_failure] = active_with_role["Medical"] * 50 possibleEvents[/datum/event/prison_break] = active_with_role["Security"] * 50 if(active_with_role["Security"] > 0) diff --git a/code/modules/events/organ_failure.dm b/code/modules/events/organ_failure.dm new file mode 100644 index 00000000000..2a6b0b6a372 --- /dev/null +++ b/code/modules/events/organ_failure.dm @@ -0,0 +1,28 @@ +datum/event/organ_failure + var/severity = 1 + +datum/event/organ_failure/setup() + announceWhen = rand(0, 3000) + endWhen = announceWhen + 1 + severity = rand(1, 3) + +datum/event/organ_failure/announce() + command_alert("Confirmed outbreak of level [rand(3,7)] biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert") + world << sound('sound/AI/outbreak5.ogg') + +datum/event/organ_failure/start() + var/list/candidates = list() //list of candidate keys + for(var/mob/living/carbon/human/G in player_list) + if(!(G.mind && G.mind.current && G.mind.current.stat != DEAD && G.health > 70)) + candidates += G + if(!candidates.len) return + candidates = shuffle(candidates)//Incorporating Donkie's list shuffle + + while(severity > 0 && candidates.len) + var/mob/living/carbon/human/C = candidates[1] + + // Bruise one of their organs + var/datum/organ/internal/I = pick(C.internal_organs) + I.damage = I.min_bruised_damage + candidates.Remove(C) + severity--