mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-29 19:42:42 +00:00
-Makes a lot of unsuitable events excluded from faking. Some of them could do with reworking to make them function, like the infestation and prison breaks, but for now i just had to exclude them -Adds an In-character/descriptive name, used for the announcement apologising for the mistake -Fixes an issue where using debug Trigger Event verb would fill the events list with empty severe events and cause runtime errors
50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
/datum/event/carp_migration
|
|
announceWhen = 50
|
|
endWhen = 900
|
|
|
|
var/list/spawned_carp = list()
|
|
ic_name = "biological entities"
|
|
|
|
/datum/event/carp_migration/setup()
|
|
announceWhen = rand(40, 60)
|
|
endWhen = rand(600,1200)
|
|
|
|
/datum/event/carp_migration/announce()
|
|
var/announcement = ""
|
|
if(severity == EVENT_LEVEL_MAJOR)
|
|
announcement = "Massive migration of unknown biological entities has been detected near [station_name()], please stand-by."
|
|
else
|
|
announcement = "Unknown biological [spawned_carp.len == 1 ? "entity has" : "entities have"] been detected near [station_name()], please stand-by."
|
|
command_announcement.Announce(announcement, "Lifesign Alert")
|
|
|
|
/datum/event/carp_migration/start()
|
|
if(severity == EVENT_LEVEL_MAJOR)
|
|
spawn_fish(landmarks_list.len)
|
|
else if(severity == EVENT_LEVEL_MODERATE)
|
|
spawn_fish(rand(4, 6)) //12 to 30 carp, in small groups
|
|
else
|
|
spawn_fish(rand(1, 3), 1, 2) //1 to 6 carp, alone or in pairs
|
|
|
|
/datum/event/carp_migration/proc/spawn_fish(var/num_groups, var/group_size_min=3, var/group_size_max=5)
|
|
var/list/spawn_locations = list()
|
|
|
|
for(var/obj/effect/landmark/C in landmarks_list)
|
|
if(C.name == "carpspawn")
|
|
spawn_locations.Add(C.loc)
|
|
spawn_locations = shuffle(spawn_locations)
|
|
num_groups = min(num_groups, spawn_locations.len)
|
|
|
|
var/i = 1
|
|
while (i <= num_groups)
|
|
var/group_size = rand(group_size_min, group_size_max)
|
|
for (var/j = 1, j <= group_size, j++)
|
|
spawned_carp.Add(new /mob/living/simple_animal/hostile/carp(spawn_locations[i]))
|
|
i++
|
|
|
|
/datum/event/carp_migration/end()
|
|
for(var/mob/living/simple_animal/hostile/carp/C in spawned_carp)
|
|
if(!C.stat)
|
|
var/turf/T = get_turf(C)
|
|
if(istype(T, /turf/space))
|
|
qdel(C)
|