Skip to content

Commit

Permalink
Makes the speed for an embryo to burst a config + embryo buff (#3844)
Browse files Browse the repository at this point in the history
# 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:
  • Loading branch information
BeagleGaming1 committed Jul 19, 2023
1 parent d0e7558 commit 61dcea5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
5 changes: 5 additions & 0 deletions code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 11 additions & 9 deletions code/modules/mob/living/carbon/xenomorph/Embryo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
3 changes: 3 additions & 0 deletions config/example/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 61dcea5

Please sign in to comment.