Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Larva surge is limited by marines/xenos ratio #3592

Merged
merged 16 commits into from
Jun 27, 2023
7 changes: 6 additions & 1 deletion code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,17 @@
if(players_with_xeno_pref && players_with_xeno_pref.len && can_spawn_larva())
spawn_burrowed_larva(pick(players_with_xeno_pref))

if(linked_hive.hijack_burrowed_surge && (last_surge_time + surge_cooldown) < world.time)
if(linked_hive.hijack_burrowed_surge && linked_hive.hijack_burrowed_left > 0 && (last_surge_time + surge_cooldown) < world.time)
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved
last_surge_time = world.time
linked_hive.stored_larva++
linked_hive.hijack_burrowed_left--
announce_dchat("The hive has gained another burrowed larva! Use the Join As Xeno verb to take it.", src)
if(surge_cooldown > 30 SECONDS) //mostly for sanity purposes
surge_cooldown = surge_cooldown - surge_incremental_reduction //ramps up over time
if(linked_hive.hijack_burrowed_surge && linked_hive.hijack_burrowed_left == 0)
linked_hive.hijack_burrowed_surge = FALSE
xeno_message(SPAN_XENOANNOUNCE("Hive surge is fading away. You will no longer gain burrowed larva over time."), 3, linked_hive.hivenumber)
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved


// Hive core can repair itself over time
if(health < maxhealth && last_healed <= world.time)
Expand Down
15 changes: 15 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
var/larva_gestation_multiplier = 1
var/bonus_larva_spawn_chance = 1
var/hijack_burrowed_surge = FALSE //at hijack, start spawning lots of burrowed
var/hijack_burrowed_left = 0 //how many burrowed is going to spawn during larva surge
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved

var/ignore_slots = FALSE
var/dynamic_evolution = TRUE
Expand Down Expand Up @@ -907,7 +908,21 @@
for(var/obj/item/alien_embryo/embryo in potential_host)
embryo.hivenumber = XENO_HIVE_FORSAKEN
potential_host.update_med_icon()
var/shipside_humans_count = 0
var/xenos_count = 0
for(var/mob/living/carbon/human/current_human as anything in GLOB.alive_human_list)
if(isspecieshuman(current_human) || isspeciessynth(current_human))
var/atom/where = current_human
if (where.z == 0 && current_human.loc)
where = current_human.loc
if(is_mainship_level(where.z))
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved
shipside_humans_count++
for(var/mob/living/carbon/xenomorph as anything in totalXenos)
ihatethisengine marked this conversation as resolved.
Show resolved Hide resolved
if(isfacehugger(xenomorph))
continue
xenos_count++
hijack_burrowed_surge = TRUE
Drulikar marked this conversation as resolved.
Show resolved Hide resolved
hijack_burrowed_left = max(n_ceil((shipside_humans_count - xenos_count) / 5), 1)
hivecore_cooldown = FALSE
xeno_message(SPAN_XENOBOLDNOTICE("The weeds have recovered! A new hive core can be built!"),3,hivenumber)

Expand Down