Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

[MIRROR] adds in a midround zombie outbreak event #1023

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,7 @@
#include "code\modules\events\supermatter_surge.dm"
#include "code\modules\events\vent_clog.dm"
#include "code\modules\events\wormholes.dm"
#include "code\modules\events\zombie_outbreak.dm"
#include "code\modules\events\holiday\halloween.dm"
#include "code\modules\events\holiday\vday.dm"
#include "code\modules\events\holiday\xmas.dm"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/events/wizard/blobies.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/datum/round_event_control/wizard/blobies //avast!
name = "Zombie Outbreak"
name = "Blob Zombie Outbreak"
weight = 3
typepath = /datum/round_event/wizard/blobies
max_occurrences = 3
Expand Down
32 changes: 32 additions & 0 deletions code/modules/events/zombie_outbreak.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/datum/round_event_control/zombie_outbreak
name = "Zombie Outbreak"
typepath = /datum/round_event/zombie_outbreak
weight = 5
max_occurrences = 1
min_players = 30

/datum/round_event/zombie_outbreak
fakeable = FALSE

/datum/round_event/zombie_outbreak/start()
// The amount of infections among the crew depends on the amount of living, non-AFK, non-silicon players on the station
var/list/living_crew = list()
living_crew = get_living_station_crew()
var/infection_count = round(length(living_crew) / 10)

for(var/mob/living/carbon/human/H in shuffle(GLOB.player_list))
if(H.stat == DEAD)
continue
if(!SSjob.GetJob(H.mind.assigned_role) || (H.mind.assigned_role in GLOB.nonhuman_positions))
continue
if(!H.getorgan(/obj/item/organ/brain))
continue
if(!(MOB_ORGANIC in H.mob_biotypes))
continue
if(!H.getorganslot(ORGAN_SLOT_ZOMBIE))
var/obj/item/organ/zombie_infection/ZI = new()
ZI.Insert(H)
announce_to_ghosts(H)
infection_count --
if (infection_count <= 0)
break