Files
CHOMPStation2/code/modules/events/carp_migration.dm
Leshana f0270451a7 Added vore capabilies to the new simple_animal system.
* Added happy friend time mechanics working properly for fox and cat.
* Added vore mechanics and vore overrides
* No longer enable vore on simple animals by creating a "/vore" subtype.  Instead we simply enable vore on the main type.  Consensus being we don't need a type for non-vore versions of stuff.
  * This allowed us to revert many path references throughout the codebase to the original non-vorestation back to their original values.  In these cases the "Vorestation Edit" comment is removed.
* Moved the vore overrides for upstream simple animals into its own file zz_vore_overrides.dm
2017-03-22 19:32:19 -04:00

49 lines
1.7 KiB
Plaintext

/datum/event/carp_migration
announceWhen = 50
endWhen = 900
var/list/spawned_carp = list()
/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))
if(!prob(25))
qdel(C)