From 086bd846a01104c6ce1ad86f4d4e25d84b3efab0 Mon Sep 17 00:00:00 2001 From: cib Date: Tue, 11 Dec 2012 13:14:32 +0100 Subject: [PATCH] Converted the virus event to new virus code. --- code/game/gamemodes/events.dm | 61 +++++------------------------------ 1 file changed, 8 insertions(+), 53 deletions(-) diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index 5d984c7a127..f2952026556 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -200,61 +200,16 @@ break /proc/viral_outbreak(var/virus = null) -// 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') - var/virus_type - if(!virus) - virus_type = pick(/datum/disease/dnaspread,/datum/disease/flu,/datum/disease/cold,/datum/disease/brainrot,/datum/disease/magnitis,/datum/disease/pierrot_throat) - else - switch(virus) - if("fake gbs") - virus_type = /datum/disease/fake_gbs - if("gbs") - virus_type = /datum/disease/gbs - if("magnitis") - virus_type = /datum/disease/magnitis - if("rhumba beat") - virus_type = /datum/disease/rhumba_beat - if("brain rot") - virus_type = /datum/disease/brainrot - if("cold") - virus_type = /datum/disease/cold - if("retrovirus") - virus_type = /datum/disease/dnaspread - if("flu") - virus_type = /datum/disease/flu -// if("t-virus") -// virus_type = /datum/disease/t_virus - if("pierrot's throat") - virus_type = /datum/disease/pierrot_throat - for(var/mob/living/carbon/human/H in living_mob_list) - - var/foundAlready = 0 // don't infect someone that already has the virus - for(var/datum/disease/D in H.viruses) - foundAlready = 1 - if(H.stat == 2 || foundAlready) + for(var/mob/living/carbon/human/H in world) + if((H.virus2) || (H.stat == 2) || prob(30)) continue - if(virus_type == /datum/disease/dnaspread) //Dnaspread needs strain_data set to work. - if((!H.dna) || (H.sdisabilities & BLIND)) //A blindness disease would be the worst. - continue - var/datum/disease/dnaspread/D = new - D.strain_data["name"] = H.real_name - D.strain_data["UI"] = H.dna.uni_identity - D.strain_data["SE"] = H.dna.struc_enzymes - D.carrier = 1 - D.holder = H - D.affected_mob = H - H.viruses += D - break - else - var/datum/disease/D = new virus_type - D.carrier = 1 - D.holder = H - D.affected_mob = H - H.viruses += D - break - spawn(rand(1500, 3000)) //Delayed announcements to keep the crew on their toes. + infect_mob_random_lesser(H) + break + + command_alert("An unknown virus has been detected onboard the ship.", "Virus Alert") + + spawn(rand(0, 3000)) //Delayed announcements to keep the crew on their toes. 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')