Skip to content

Commit

Permalink
cap and percent gain
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Jul 27, 2023
1 parent 700e5d8 commit 5d8a9ed
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 17 additions & 1 deletion code/modules/cm_aliens/structures/special/pylon_core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@
structure.activated = TRUE
addtimer(CALLBACK(structure, PROC_REF(give_larva)), XENO_PYLON_ACTIVATION_COOLDOWN, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_LOOP|TIMER_DELETE_ME)

#define ENDGAME_LARVA_CAP_MULTIPLIER 0.4
#define LARVA_ADDITION_MULTIPLIER 0.05

/// Looped proc via timer to give larva after time
/obj/effect/alien/resin/special/pylon/endgame/proc/give_larva()
if(!activated)
Expand All @@ -143,9 +146,22 @@
if(!linked_hive.hive_location || !linked_hive.living_xeno_queen)
return

linked_hive.stored_larva++
var/list/hive_xenos = linked_hive.totalXenos

for(var/mob/living/carbon/xenomorph/xeno in hive_xenos)
if(!xeno.counts_for_slots)
hive_xenos -= xeno

if(length(hive_xenos) > (length(GLOB.alive_human_list) * ENDGAME_LARVA_CAP_MULTIPLIER))
return

linked_hive.partial_larva += length(hive_xenos) * LARVA_ADDITION_MULTIPLIER
linked_hive.convert_partial_larva_to_full_larva()
linked_hive.hive_ui.update_burrowed_larva()

#undef ENDGAME_LARVA_CAP_MULTIPLIER
#undef LARVA_ADDITION_MULTIPLIER

//Hive Core - Generates strong weeds, supports other buildings
/obj/effect/alien/resin/special/pylon/core
name = XENO_STRUCTURE_CORE
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/xeno_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,10 @@
/datum/hive_status/proc/increase_larva_after_burst()
var/extra_per_burst = CONFIG_GET(number/extra_larva_per_burst)
partial_larva += extra_per_burst
convert_partial_larva_to_full_larva()

///Called after times when partial larva are added to process them to stored larva
/datum/hive_status/proc/convert_partial_larva_to_full_larva()
for(var/i = 1 to partial_larva)
partial_larva--
stored_larva++
Expand Down

0 comments on commit 5d8a9ed

Please sign in to comment.