From 5d3b968b99d2bcaa6c346d60c80fac98609c2d17 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:12:36 -0500 Subject: [PATCH 1/7] initial --- code/_globalvars/lists/mobs.dm | 2 ++ code/datums/gamemodes/_game_mode.dm | 8 +++++++ code/datums/gamemodes/crash.dm | 23 ++++++++++--------- .../mob/living/carbon/xenomorph/evolution.dm | 4 ++++ .../mob/living/carbon/xenomorph/hive_datum.dm | 2 +- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 1acf370017593..9100269ac3a36 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -168,6 +168,8 @@ GLOBAL_LIST_INIT(hive_ui_static_data, init_hive_status_lists()) // init by make_ "evolution_max" = initial(caste.evolution_threshold) )) +///List of castes we dont want to be evolvable. +GLOBAL_LIST_EMPTY(restricted_castes) /proc/update_config_movespeed_type_lookup(update_mobs = TRUE) diff --git a/code/datums/gamemodes/_game_mode.dm b/code/datums/gamemodes/_game_mode.dm index 7c89bc7054eeb..a838b094ae002 100644 --- a/code/datums/gamemodes/_game_mode.dm +++ b/code/datums/gamemodes/_game_mode.dm @@ -2,6 +2,7 @@ #define SERVER_LAST_ROUND "server last round" GLOBAL_VAR(common_report) //Contains common part of roundend report +GLOBAL_VAR(tier3_penalty) //Increases the amount of xenos needed to evolve to t3 by the value. /datum/game_mode var/name = "" @@ -45,6 +46,10 @@ GLOBAL_VAR(common_report) //Contains common part of roundend report var/time_between_round = 0 ///What factions are used in this gamemode, typically TGMC and xenos var/list/factions = list(FACTION_TERRAGOV, FACTION_ALIEN) + ///Increases the amount of xenos needed to evolve to tier3 by x + var/gamemode_tier3_penalty = 0 + ///List of castes we dont want to be evolvable depending on gamemode. + var/list/gamemode_restricted_castes //Distress call variables. var/list/datum/emergency_call/all_calls = list() //initialized at round start and stores the datums. @@ -108,6 +113,9 @@ GLOBAL_VAR(common_report) //Contains common part of roundend report continue job.on_pre_setup() + GLOB.restricted_castes += gamemode_restricted_castes + GLOB.tier3_penalty = gamemode_tier3_penalty + return TRUE /datum/game_mode/proc/setup() diff --git a/code/datums/gamemodes/crash.dm b/code/datums/gamemodes/crash.dm index bf63b285285c4..91f88e1a4af11 100644 --- a/code/datums/gamemodes/crash.dm +++ b/code/datums/gamemodes/crash.dm @@ -22,6 +22,10 @@ ) xenorespawn_time = 3 MINUTES blacklist_ground_maps = list(MAP_BIG_RED, MAP_DELTA_STATION, MAP_PRISON_STATION, MAP_LV_624, MAP_WHISKEY_OUTPOST, MAP_OSCAR_OUTPOST, MAP_FORT_PHOBOS, MAP_CHIGUSA, MAP_LAVA_OUTPOST, MAP_CORSAT, MAP_KUTJEVO_REFINERY, MAP_BLUESUMMERS) + //We want tier 3s one xeno later. + gamemode_tier3_penalty = 1 + //List of xenos we dont want to be playable. + gamemode_restricted_castes = list(/datum/xeno_caste/hivelord, /datum/xeno_caste/wraith, /datum/xeno_caste/hivemind) // Round end conditions var/shuttle_landed = FALSE @@ -194,7 +198,7 @@ if(stored_larva) return //No need for respawns var/num_xenos = xeno_hive.get_total_xeno_number() + stored_larva - if(!num_xenos) + if(num_xenos < 2) xeno_job.add_job_positions(1) return var/larva_surplus = (get_total_joblarvaworth() - (num_xenos * xeno_job.job_points_needed )) / xeno_job.job_points_needed @@ -203,13 +207,10 @@ xeno_job.add_job_positions(1) xeno_hive.update_tier_limits() -/datum/game_mode/infestation/crash/get_total_joblarvaworth(list/z_levels, count_flags) - . = 0 - - for(var/mob/living/carbon/human/H AS in GLOB.human_mob_list) - if(!H.job) - continue - if(isspaceturf(H.loc)) - continue - . += H.job.jobworth[/datum/job/xenomorph] - +///This checks to see if we're above our minimum xeno amount so that we get our 3rd xeno at 7 pop instead of 4. +/datum/game_mode/infestation/crash/proc/check_starter_xenos() + var/datum/job/xeno_job = SSjob.GetJobType(/datum/job/xenomorph) + if(xeno_job.total_positions < 3) + xeno_job.job_points_needed *= 2 + else + xeno_job.job_points_needed = CRASH_LARVA_POINTS_NEEDED diff --git a/code/modules/mob/living/carbon/xenomorph/evolution.dm b/code/modules/mob/living/carbon/xenomorph/evolution.dm index 6cfccda4b9fb6..4c4461f18f000 100644 --- a/code/modules/mob/living/carbon/xenomorph/evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/evolution.dm @@ -285,6 +285,10 @@ balloon_alert(src, "We can't evolve to that caste from our current one") return FALSE + if(new_caste_type in GLOB.restricted_castes) + balloon_alert(src, "Our weak hive can't support that caste!") + return FALSE + var/no_room_tier_two = length(hive.xenos_by_tier[XENO_TIER_TWO]) >= hive.tier2_xeno_limit var/no_room_tier_three = length(hive.xenos_by_tier[XENO_TIER_THREE]) >= hive.tier3_xeno_limit var/datum/xeno_caste/new_caste = GLOB.xeno_caste_datums[new_caste_type][XENO_UPGRADE_BASETYPE] // tivi todo make so evo takes the strict caste datums diff --git a/code/modules/mob/living/carbon/xenomorph/hive_datum.dm b/code/modules/mob/living/carbon/xenomorph/hive_datum.dm index 2accf2293d193..e31dd5282cdc0 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_datum.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_datum.dm @@ -1197,7 +1197,7 @@ to_chat will check for valid clients itself already so no need to double check f var/threes = length(xenos_by_tier[XENO_TIER_THREE]) var/fours = length(xenos_by_tier[XENO_TIER_FOUR]) - tier3_xeno_limit = max(threes, FLOOR((zeros + ones + twos + fours) / 3 + length(psychictowers) + 1, 1)) + tier3_xeno_limit = max(threes, FLOOR(((zeros + ones + twos + fours) - GLOB.tier3_penalty) / 3 + length(psychictowers) + 1, 1)) tier2_xeno_limit = max(twos, (zeros + ones + fours) + length(psychictowers) * 2 + 1 - threes) // *************************************** From 472f3e2bfe87dc868b30f4a1f055f232e4e584d5 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 30 Oct 2024 17:22:09 -0500 Subject: [PATCH 2/7] oops couldnt figure out how to get this called elsewhere but maybe useful in the future --- code/datums/gamemodes/crash.dm | 8 -------- 1 file changed, 8 deletions(-) diff --git a/code/datums/gamemodes/crash.dm b/code/datums/gamemodes/crash.dm index 91f88e1a4af11..0651904a62b4e 100644 --- a/code/datums/gamemodes/crash.dm +++ b/code/datums/gamemodes/crash.dm @@ -206,11 +206,3 @@ return //Things are balanced, no burrowed needed xeno_job.add_job_positions(1) xeno_hive.update_tier_limits() - -///This checks to see if we're above our minimum xeno amount so that we get our 3rd xeno at 7 pop instead of 4. -/datum/game_mode/infestation/crash/proc/check_starter_xenos() - var/datum/job/xeno_job = SSjob.GetJobType(/datum/job/xenomorph) - if(xeno_job.total_positions < 3) - xeno_job.job_points_needed *= 2 - else - xeno_job.job_points_needed = CRASH_LARVA_POINTS_NEEDED From 04c76074f043bcf2bad75d4d8aca3cda4eddfe52 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:56:48 -0500 Subject: [PATCH 3/7] Update _game_mode.dm --- code/datums/gamemodes/_game_mode.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/datums/gamemodes/_game_mode.dm b/code/datums/gamemodes/_game_mode.dm index a838b094ae002..b1d05527523cb 100644 --- a/code/datums/gamemodes/_game_mode.dm +++ b/code/datums/gamemodes/_game_mode.dm @@ -565,7 +565,7 @@ GLOBAL_LIST_INIT(bioscan_locations, list( var/mob/living/carbon/human/H = i if(!H.job) continue - if(H.stat == DEAD && !H.has_working_organs()) + if(H.stat == DEAD && HAS_TRAIT(H, TRAIT_UNDEFIBBABLE)) continue if(count_flags & COUNT_IGNORE_HUMAN_SSD && !H.client) continue From c421ca65610b460d7a00a67dc7819f80c86c1654 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 30 Oct 2024 22:03:00 -0500 Subject: [PATCH 4/7] hugged --- code/datums/gamemodes/_game_mode.dm | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/datums/gamemodes/_game_mode.dm b/code/datums/gamemodes/_game_mode.dm index b1d05527523cb..3aa8a247f347a 100644 --- a/code/datums/gamemodes/_game_mode.dm +++ b/code/datums/gamemodes/_game_mode.dm @@ -569,8 +569,6 @@ GLOBAL_LIST_INIT(bioscan_locations, list( continue if(count_flags & COUNT_IGNORE_HUMAN_SSD && !H.client) continue - if(H.status_flags & XENO_HOST) - continue if(!(H.z in z_levels) || isspaceturf(H.loc)) continue . += H.job.jobworth[/datum/job/xenomorph] From 972d7f3cdbbaa1a3882c62777efe498bbda0ec0b Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Sat, 2 Nov 2024 13:18:12 -0500 Subject: [PATCH 5/7] review pt1 --- code/_globalvars/lists/mobs.dm | 2 -- code/datums/gamemodes/_game_mode.dm | 10 +++------- code/datums/gamemodes/crash.dm | 6 ++---- code/modules/mob/living/carbon/xenomorph/evolution.dm | 2 +- code/modules/mob/living/carbon/xenomorph/hive_datum.dm | 2 +- 5 files changed, 7 insertions(+), 15 deletions(-) diff --git a/code/_globalvars/lists/mobs.dm b/code/_globalvars/lists/mobs.dm index 9100269ac3a36..1acf370017593 100644 --- a/code/_globalvars/lists/mobs.dm +++ b/code/_globalvars/lists/mobs.dm @@ -168,8 +168,6 @@ GLOBAL_LIST_INIT(hive_ui_static_data, init_hive_status_lists()) // init by make_ "evolution_max" = initial(caste.evolution_threshold) )) -///List of castes we dont want to be evolvable. -GLOBAL_LIST_EMPTY(restricted_castes) /proc/update_config_movespeed_type_lookup(update_mobs = TRUE) diff --git a/code/datums/gamemodes/_game_mode.dm b/code/datums/gamemodes/_game_mode.dm index 3aa8a247f347a..5ca90c5d665a5 100644 --- a/code/datums/gamemodes/_game_mode.dm +++ b/code/datums/gamemodes/_game_mode.dm @@ -2,7 +2,6 @@ #define SERVER_LAST_ROUND "server last round" GLOBAL_VAR(common_report) //Contains common part of roundend report -GLOBAL_VAR(tier3_penalty) //Increases the amount of xenos needed to evolve to t3 by the value. /datum/game_mode var/name = "" @@ -46,10 +45,10 @@ GLOBAL_VAR(tier3_penalty) //Increases the amount of xenos needed to evolve to t3 var/time_between_round = 0 ///What factions are used in this gamemode, typically TGMC and xenos var/list/factions = list(FACTION_TERRAGOV, FACTION_ALIEN) - ///Increases the amount of xenos needed to evolve to tier3 by x - var/gamemode_tier3_penalty = 0 + ///Increases the amount of xenos needed to evolve to tier three by the value. + var/tier_three_penalty = 0 ///List of castes we dont want to be evolvable depending on gamemode. - var/list/gamemode_restricted_castes + var/list/restricted_castes //Distress call variables. var/list/datum/emergency_call/all_calls = list() //initialized at round start and stores the datums. @@ -113,9 +112,6 @@ GLOBAL_VAR(tier3_penalty) //Increases the amount of xenos needed to evolve to t3 continue job.on_pre_setup() - GLOB.restricted_castes += gamemode_restricted_castes - GLOB.tier3_penalty = gamemode_tier3_penalty - return TRUE /datum/game_mode/proc/setup() diff --git a/code/datums/gamemodes/crash.dm b/code/datums/gamemodes/crash.dm index 0651904a62b4e..d03ea0fd24202 100644 --- a/code/datums/gamemodes/crash.dm +++ b/code/datums/gamemodes/crash.dm @@ -22,10 +22,8 @@ ) xenorespawn_time = 3 MINUTES blacklist_ground_maps = list(MAP_BIG_RED, MAP_DELTA_STATION, MAP_PRISON_STATION, MAP_LV_624, MAP_WHISKEY_OUTPOST, MAP_OSCAR_OUTPOST, MAP_FORT_PHOBOS, MAP_CHIGUSA, MAP_LAVA_OUTPOST, MAP_CORSAT, MAP_KUTJEVO_REFINERY, MAP_BLUESUMMERS) - //We want tier 3s one xeno later. - gamemode_tier3_penalty = 1 - //List of xenos we dont want to be playable. - gamemode_restricted_castes = list(/datum/xeno_caste/hivelord, /datum/xeno_caste/wraith, /datum/xeno_caste/hivemind) + tier_three_penalty = 1 + restricted_castes = list(/datum/xeno_caste/hivelord, /datum/xeno_caste/wraith, /datum/xeno_caste/hivemind) // Round end conditions var/shuttle_landed = FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/evolution.dm b/code/modules/mob/living/carbon/xenomorph/evolution.dm index 4c4461f18f000..bda9c48979f82 100644 --- a/code/modules/mob/living/carbon/xenomorph/evolution.dm +++ b/code/modules/mob/living/carbon/xenomorph/evolution.dm @@ -285,7 +285,7 @@ balloon_alert(src, "We can't evolve to that caste from our current one") return FALSE - if(new_caste_type in GLOB.restricted_castes) + if(new_caste_type in SSticker.mode.restricted_castes) balloon_alert(src, "Our weak hive can't support that caste!") return FALSE diff --git a/code/modules/mob/living/carbon/xenomorph/hive_datum.dm b/code/modules/mob/living/carbon/xenomorph/hive_datum.dm index e31dd5282cdc0..b7c9c586f4aec 100644 --- a/code/modules/mob/living/carbon/xenomorph/hive_datum.dm +++ b/code/modules/mob/living/carbon/xenomorph/hive_datum.dm @@ -1197,7 +1197,7 @@ to_chat will check for valid clients itself already so no need to double check f var/threes = length(xenos_by_tier[XENO_TIER_THREE]) var/fours = length(xenos_by_tier[XENO_TIER_FOUR]) - tier3_xeno_limit = max(threes, FLOOR(((zeros + ones + twos + fours) - GLOB.tier3_penalty) / 3 + length(psychictowers) + 1, 1)) + tier3_xeno_limit = max(threes, FLOOR(((zeros + ones + twos + fours) - SSticker.mode.tier_three_penalty) / 3 + length(psychictowers) + 1, 1)) tier2_xeno_limit = max(twos, (zeros + ones + fours) + length(psychictowers) * 2 + 1 - threes) // *************************************** From 052fbd221a744d48ce7f0a656af85a7dc33c3973 Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 6 Nov 2024 20:02:25 -0600 Subject: [PATCH 6/7] revert-ratios --- code/datums/gamemodes/_game_mode.dm | 4 +++- code/datums/gamemodes/crash.dm | 12 +++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/code/datums/gamemodes/_game_mode.dm b/code/datums/gamemodes/_game_mode.dm index 5ca90c5d665a5..e79ecba03252b 100644 --- a/code/datums/gamemodes/_game_mode.dm +++ b/code/datums/gamemodes/_game_mode.dm @@ -561,10 +561,12 @@ GLOBAL_LIST_INIT(bioscan_locations, list( var/mob/living/carbon/human/H = i if(!H.job) continue - if(H.stat == DEAD && HAS_TRAIT(H, TRAIT_UNDEFIBBABLE)) + if(H.stat == DEAD && !H.has_working_organs()) continue if(count_flags & COUNT_IGNORE_HUMAN_SSD && !H.client) continue + if(H.status_flags & XENO_HOST) + continue if(!(H.z in z_levels) || isspaceturf(H.loc)) continue . += H.job.jobworth[/datum/job/xenomorph] diff --git a/code/datums/gamemodes/crash.dm b/code/datums/gamemodes/crash.dm index d03ea0fd24202..df2f6542b9346 100644 --- a/code/datums/gamemodes/crash.dm +++ b/code/datums/gamemodes/crash.dm @@ -196,7 +196,7 @@ if(stored_larva) return //No need for respawns var/num_xenos = xeno_hive.get_total_xeno_number() + stored_larva - if(num_xenos < 2) + if(!num_xenos) xeno_job.add_job_positions(1) return var/larva_surplus = (get_total_joblarvaworth() - (num_xenos * xeno_job.job_points_needed )) / xeno_job.job_points_needed @@ -204,3 +204,13 @@ return //Things are balanced, no burrowed needed xeno_job.add_job_positions(1) xeno_hive.update_tier_limits() + +/datum/game_mode/infestation/crash/get_total_joblarvaworth(list/z_levels, count_flags) + . = 0 + + for(var/mob/living/carbon/human/H AS in GLOB.human_mob_list) + if(!H.job) + continue + if(isspaceturf(H.loc)) + continue + . += H.job.jobworth[/datum/job/xenomorph] From fd1a60c83a72b7b438d939d8694492e64d24c88e Mon Sep 17 00:00:00 2001 From: blackdav123 <106282690+blackdav123@users.noreply.github.com> Date: Wed, 6 Nov 2024 20:04:17 -0600 Subject: [PATCH 7/7] clean --- code/datums/gamemodes/crash.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/datums/gamemodes/crash.dm b/code/datums/gamemodes/crash.dm index df2f6542b9346..5c75d1bc4bedb 100644 --- a/code/datums/gamemodes/crash.dm +++ b/code/datums/gamemodes/crash.dm @@ -214,3 +214,4 @@ if(isspaceturf(H.loc)) continue . += H.job.jobworth[/datum/job/xenomorph] +