From 61dcea55efb29ea316af3be2a17ebecf1c42bcd0 Mon Sep 17 00:00:00 2001 From: BeagleGaming1 <56142455+BeagleGaming1@users.noreply.github.com> Date: Wed, 19 Jul 2023 06:38:15 -0400 Subject: [PATCH] Makes the speed for an embryo to burst a config + embryo buff (#3844) # About the pull request Changed it from a number to a config. Changed `larva_gestation_multiplier` to 2, as it only processes once every 2 seconds, so it should increase the counter by 2 at a time. Changed an `else if` to `if` as there could never be a situation where the stage was equal to 4 but not less than 5. # Explain why it's good for the game Makes it easier to change, and keeps people guessing what stage they are at when hugged. People were operating under the assumption that it was 7.5 minutes. However, due to `process` only running once every 2 seconds, it ended up taking twice as long. Stage 4 was meant to make stasis slightly less effective, but due to a bug it just never happened. # Changelog :cl: config: Moved time to burst to the config balance: Fixed time to burst, lowering it from 15 minutes to 7.5 minutes by default balance: Stasis bags used on late-stage mobs properly slow growth down less /:cl: --- .../configuration/entries/game_options.dm | 5 +++++ .../mob/living/carbon/xenomorph/Embryo.dm | 20 ++++++++++--------- config/example/config.txt | 3 +++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm index fdf79db138f7..743f9be9fec0 100644 --- a/code/controllers/configuration/entries/game_options.dm +++ b/code/controllers/configuration/entries/game_options.dm @@ -122,3 +122,8 @@ /datum/config_entry/number/extra_larva_per_burst config_entry_value = 1 integer = FALSE + +/datum/config_entry/number/embryo_burst_timer + min_val = 1 + config_entry_value = 450 + integer = TRUE diff --git a/code/modules/mob/living/carbon/xenomorph/Embryo.dm b/code/modules/mob/living/carbon/xenomorph/Embryo.dm index e8966bdf4d02..e6fc734e4e5a 100644 --- a/code/modules/mob/living/carbon/xenomorph/Embryo.dm +++ b/code/modules/mob/living/carbon/xenomorph/Embryo.dm @@ -38,7 +38,7 @@ GLOB.player_embryo_list -= src . = ..() -/obj/item/alien_embryo/process() +/obj/item/alien_embryo/process(delta_time) if(!affected_mob) //The mob we were gestating in is straight up gone, we shouldn't be here STOP_PROCESSING(SSobj, src) qdel(src) @@ -72,24 +72,26 @@ if(affected_mob.in_stasis == STASIS_IN_CRYO_CELL) return FALSE //If they are in cryo, the embryo won't grow. - process_growth() + process_growth(delta_time) -/obj/item/alien_embryo/proc/process_growth() +/obj/item/alien_embryo/proc/process_growth(delta_time) var/datum/hive_status/hive = GLOB.hive_datum[hivenumber] + /// The total time the person is hugged divided by stages until burst + var/per_stage_hugged_time = CONFIG_GET(number/embryo_burst_timer) / 5 //Low temperature seriously hampers larva growth (as in, way below livable), so does stasis if(!hive.hardcore) // Cannot progress if the hive has entered hardcore mode. if(affected_mob.in_stasis || affected_mob.bodytemperature < 170) if(stage < 5) - counter += 0.33 * hive.larva_gestation_multiplier - else if(stage == 4) - counter += 0.11 * hive.larva_gestation_multiplier + counter += 0.33 * hive.larva_gestation_multiplier * delta_time + if(stage == 4) // Stasis affects late-stage less + counter += 0.11 * hive.larva_gestation_multiplier * delta_time else if(HAS_TRAIT(affected_mob, TRAIT_NESTED)) //Hosts who are nested in resin nests provide an ideal setting, larva grows faster - counter += 1.5 * hive.larva_gestation_multiplier //Currently twice as much, can be changed + counter += 1.5 * hive.larva_gestation_multiplier * delta_time //Currently twice as much, can be changed else if(stage < 5) - counter += 1 * hive.larva_gestation_multiplier + counter += 1 * hive.larva_gestation_multiplier * delta_time - if(stage < 5 && counter >= 90) + if(stage < 5 && counter >= per_stage_hugged_time) counter = 0 stage++ if(iscarbon(affected_mob)) diff --git a/config/example/config.txt b/config/example/config.txt index bf061da71417..1fee5c898574 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -239,3 +239,6 @@ GAMEMODE_ROUNDS_NEEDED 5 ## Default gamemode to auto-switch back to after a round has concluded GAMEMODE_DEFAULT extended + +## How long the mob will take to chestburst, in seconds +#EMBRYO_BURST_TIMER 450