Files
Paradise/code/modules/events/alien_infestation.dm
GDN 6df2c2e3d2 Ghost bar (#22368)
* Ghost bar initial changes

* more changes

* we ball again brothers

* we are (once again) SO back

* Update code/modules/admin/verbs/debug.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/_onclick/hud/alert.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/_onclick/hud/alert.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/items/weapons/cards_ids.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* deck of cards and shittt

* global placement

* Update code/modules/ruins/ghost_bar.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* readded

* hotfix

* zamn

* fixes

* greyfix

* last of the fixes

* can't stop me baby

* bam

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
2023-10-09 19:47:17 +01:00

44 lines
2.0 KiB
Plaintext

/datum/event/alien_infestation
announceWhen = 400
var/highpop_trigger = 80
var/spawncount = 2
var/list/playercount
var/successSpawn = FALSE //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(false_alarm)
if(successSpawn || false_alarm)
GLOB.major_announcement.Announce("Confirmed outbreak of level 3-X biohazard aboard [station_name()]. All personnel must contain the outbreak.", "Biohazard Alert", 'sound/effects/siren-spooky.ogg', new_sound2 = 'sound/AI/outbreak3.ogg')
else
log_and_message_admins("Warning: Could not spawn any mobs for event Alien Infestation")
/datum/event/alien_infestation/start()
playercount = length(GLOB.clients)//grab playercount when event starts not when game starts
if(playercount >= highpop_trigger) //spawn with 4 if highpop
spawncount = 4
INVOKE_ASYNC(src, PROC_REF(spawn_xenos))
/datum/event/alien_infestation/proc/spawn_xenos()
var/list/candidates = SSghost_spawns.poll_candidates("Do you want to play as an alien?", ROLE_ALIEN, TRUE, source = /mob/living/carbon/alien/larva)
var/list/vents = get_valid_vent_spawns(exclude_mobs_nearby = TRUE)
if(!length(vents))
message_admins("Warning: No suitable vents detected for spawning xenomorphs. Force picking from station vents regardless of state!")
vents = get_valid_vent_spawns(unwelded_only = FALSE, min_network_size = 0)
while(spawncount && length(vents) && length(candidates))
var/obj/vent = pick_n_take(vents)
var/mob/C = pick_n_take(candidates)
if(C)
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
dust_if_respawnable(C)
new_xeno.forceMove(vent)
new_xeno.add_ventcrawl(vent)
if(SSticker && SSticker.mode)
SSticker.mode.xenos += new_xeno.mind
spawncount--
successSpawn = TRUE