Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
tiers_scaling (#565)
Browse files Browse the repository at this point in the history
Co-authored-by: Blundir <[email protected]>
  • Loading branch information
homexp13 and Blundir authored May 7, 2024
1 parent 4743624 commit bb0edde
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/hive_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,7 @@ to_chat will check for valid clients itself already so no need to double check f
return FALSE
return TRUE

/* RU TGMC EDIT //moved to modular
///updates and sets the t2 and t3 xeno limits
/datum/hive_status/proc/update_tier_limits()
var/zeros = get_total_tier_zeros()
Expand All @@ -1198,6 +1199,7 @@ to_chat will check for valid clients itself already so no need to double check f
tier3_xeno_limit = max(threes, FLOOR((zeros + ones + twos + fours) / 3 + length(psychictowers) + 1, 1))
tier2_xeno_limit = max(twos, (zeros + ones + fours) + length(psychictowers) * 2 + 1 - threes)
RU TGMC EDIT */

// ***************************************
// *********** Corrupted Xenos
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,3 +308,21 @@
/datum/hive_status/normal/on_shuttle_hijack(obj/docking_port/mobile/marine_dropship/hijacked_ship)
SSticker.mode.update_silo_death_timer(src)
return ..()

/datum/hive_status/proc/update_tier_limits()
var/zeros = get_total_tier_zeros()
var/ones = length(xenos_by_tier[XENO_TIER_ONE])
var/twos = length(xenos_by_tier[XENO_TIER_TWO])
var/threes = length(xenos_by_tier[XENO_TIER_THREE])
var/fours = length(xenos_by_tier[XENO_TIER_FOUR])

var/active_humans = length(GLOB.humans_by_zlevel[SSmonitor.gamestate == SHIPSIDE ? "3" : "2"])

var/datum/job/xeno_job = SSjob.GetJobType(/datum/job/xenomorph)

//Estimated number of xenos calculated for a certain number of marines
var/rated_xeno = active_humans * (LARVA_POINTS_REGULAR / xeno_job.job_points_needed)

//length(psychictowers) are still in the formula for admin spawn or something
tier3_xeno_limit = max(threes, FLOOR(max(rated_xeno - threes,zeros + ones + twos + fours) / 3 + length(psychictowers) + 1, 1))
tier2_xeno_limit = max(twos, FLOOR(max(rated_xeno - twos - threes,zeros + ones + fours) + length(psychictowers) * 2 + 1 - threes, 1))

0 comments on commit bb0edde

Please sign in to comment.