mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-06-04 13:45:25 +01:00
3218d85198
## About The Pull Request Adds two new global helper procs, find_maintenance_spawn and find_space_spawn. These check the list of maintenance/space carp spawn landmarks, and return the turf of a random one. The find_maintenance_spawn helper has two arguments, for atmos safety checks and making sure the spawn is properly shrouded in darkness. This also includes some tidiness changes to the ghost_role event file, because the helper was originally just going to be a proc on ghost role events. **Stuff moved to find_maintenance_spawn:** - Spiders - Nightmares - Fugitives - Paradox clones - Morph **Stuff moved to find_space_spawn:** - Space Dragon - Loneop - Ninja - Slaughter Demon - Revenant backup spawn location If we ignore all of the autodocing, this should remove about a dozen or two lines of code. ## Why It's Good For The Game Reduces an amount of duplicated code. Also makes future implementation a bit easier and less copy-pastey. ## Changelog 🆑 Rhials code: Adds two new super-duper helpful helper procs for finding a maintenance/space spawn location, for all of your event/midround/whatever needs! code: Moves all midrounds/ghost_role events that hinged on maintenance/space carp spawns to the aforementioned helpers. code: The ghost_role event module file is now autodoced. /🆑
37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
/datum/round_event_control/spider_infestation
|
|
name = "Spider Infestation"
|
|
typepath = /datum/round_event/spider_infestation
|
|
weight = 10
|
|
max_occurrences = 1
|
|
min_players = 20
|
|
dynamic_should_hijack = TRUE
|
|
category = EVENT_CATEGORY_ENTITIES
|
|
description = "Spawns spider eggs, ready to hatch."
|
|
min_wizard_trigger_potency = 5
|
|
max_wizard_trigger_potency = 7
|
|
|
|
/datum/round_event/spider_infestation
|
|
announce_when = 400
|
|
var/spawncount = 2
|
|
|
|
/datum/round_event/spider_infestation/setup()
|
|
announce_when = rand(announce_when, announce_when + 50)
|
|
|
|
/datum/round_event/spider_infestation/announce(fake)
|
|
priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", ANNOUNCER_ALIENS)
|
|
|
|
/datum/round_event/spider_infestation/start()
|
|
create_midwife_eggs(spawncount)
|
|
|
|
/proc/create_midwife_eggs(amount)
|
|
while(amount > 0)
|
|
var/turf/spawn_loc = find_maintenance_spawn(atmos_sensitive = TRUE, require_darkness = TRUE)
|
|
if(isnull(spawn_loc))
|
|
return //Admins will have already been notified of the spawning failure at this point
|
|
var/obj/effect/mob_spawn/ghost_role/spider/midwife/new_eggs = new (spawn_loc)
|
|
new_eggs.amount_grown = 98
|
|
amount--
|
|
log_game("Midwife spider eggs were spawned via an event.")
|
|
return TRUE
|
|
|