mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-22 04:46:45 +01:00
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request  <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> ## Why It's Good For The Game Mappers thought their reign would last a thousand years, and hardcoded extremely specific announcements that make no sense in new maps. <!-- Argue for the merits of your changes and how they benefit the game, especially if they are controversial and/or far reaching. If you can't actually explain WHY what you are doing will improve the game, then it probably isn't good for the game in the first place. --> ## Changelog <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> 🆑 tweak: tweaked many IC event announcements tweak: small medical terminology fixes tweak: cult and meteor alarm volume has been reduced /🆑 <!-- Both 🆑's are required for the changelog to work! You can put your name to the right of the first 🆑 if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. -->
105 lines
3.2 KiB
Plaintext
105 lines
3.2 KiB
Plaintext
GLOBAL_LIST_INIT(carp_count,list())// a list of Z levels (string), associated with a list of all the carp spawned by carp events
|
|
|
|
/datum/event/carp_migration
|
|
var/no_show = FALSE // Carp are laggy, so if there is too much stuff going on we're going to dial it down.
|
|
var/spawned_carp //for debugging purposes only?
|
|
var/carp_per_z = 8
|
|
var/carp_per_event = 5
|
|
has_skybox_image = FALSE
|
|
var/list/players = list()
|
|
|
|
/datum/event/carp_migration/setup()
|
|
announceWhen = rand(5, 10)
|
|
endWhen += severity*25
|
|
|
|
/datum/event/carp_migration/proc/count_carps()
|
|
var/total_carps
|
|
var/local_carps
|
|
for(var/Z in GLOB.carp_count)
|
|
var/list/L = GLOB.carp_count[Z]
|
|
total_carps += L.len
|
|
if(text2num(Z) in affecting_z)
|
|
local_carps += L.len
|
|
|
|
if(total_carps >= 65)
|
|
no_show = TRUE
|
|
else
|
|
no_show = FALSE
|
|
|
|
/datum/event/carp_migration/start()
|
|
count_carps()
|
|
if(no_show && prob(95))
|
|
return
|
|
else
|
|
spawn_carp()
|
|
|
|
|
|
/datum/event/carp_migration/announce()
|
|
if(severity > EVENT_LEVEL_MODERATE)
|
|
command_announcement.Announce("A massive migration of space-borne biological entities has been detected in the vicinity of the [location_name()]. Exercise external operations with caution.")
|
|
else
|
|
command_announcement.Announce("A large migration of space-borne biological entities has been detected in the vicinity of the [location_name()]. Caution is advised.")
|
|
|
|
|
|
/datum/event/carp_migration/proc/spawn_carp(var/num_groups, var/group_size_min, var/group_size_max, var/dir, var/speed)
|
|
var/Z = pick(affecting_z)
|
|
|
|
if(!dir)
|
|
dir = pick(GLOB.cardinal)
|
|
if(!speed)
|
|
speed = rand(1,3)
|
|
|
|
var/n = rand(severity, severity*2)
|
|
var/I = 0
|
|
var/safety = 0
|
|
while(I < n)
|
|
if(++safety == 1000)
|
|
CRASH("could not get turfs for carp migration")
|
|
var/turf/T = get_random_edge_turf(dir,TRANSITIONEDGE + 2, Z)
|
|
if(istype(T,/turf/space))
|
|
var/mob/living/simple_mob/animal/space/M
|
|
if(prob(96))
|
|
M = new /mob/living/simple_mob/animal/space/carp(T)
|
|
I++
|
|
else
|
|
M = new /mob/living/simple_mob/animal/space/carp/large(T)
|
|
I += 3
|
|
LAZYADD(GLOB.carp_count["[Z]"], M)
|
|
spawned_carp ++
|
|
M.throw_at_old(get_random_edge_turf(global.reverse_dir[dir],TRANSITIONEDGE + 2, Z), 5, speed)//, callback = CALLBACK(src, TYPE_PROC_REF(/datum/event/carp_migration, check_gib),M))
|
|
if(no_show)
|
|
break
|
|
|
|
/proc/get_random_edge_turf(var/dir, var/clearance = TRANSITIONEDGE + 1, var/Z)
|
|
if(!dir)
|
|
return
|
|
|
|
switch(dir)
|
|
if(NORTH)
|
|
return locate(rand(clearance, world.maxx - clearance), world.maxy - clearance, Z)
|
|
if(SOUTH)
|
|
return locate(rand(clearance, world.maxx - clearance), clearance, Z)
|
|
if(EAST)
|
|
return locate(world.maxx - clearance, rand(clearance, world.maxy - clearance), Z)
|
|
if(WEST)
|
|
return locate(clearance, rand(clearance, world.maxy - clearance), Z)
|
|
|
|
/datum/event/carp_migration/proc/check_gib(var/mob/living/simple_mob/animal/space/carp/M) //awesome road kills
|
|
if(M.health <= 0 && prob(60))
|
|
M.gib()
|
|
|
|
/datum/event/carp_migration/proc/reduce_carp_count(var/mob/M)
|
|
for(var/Z in affecting_z)
|
|
var/list/L = GLOB.carp_count["[Z]"]
|
|
if(M in L)
|
|
LAZYREMOVE(L,M)
|
|
break
|
|
|
|
/datum/event/carp_migration/end()
|
|
message_admins("Carp migration event spawned [spawned_carp] carp.")
|
|
|
|
|
|
// Overmap version
|
|
/datum/event/carp_migration/overmap/announce()
|
|
return
|