diff --git a/code/controllers/configuration/sections/general_configuration.dm b/code/controllers/configuration/sections/general_configuration.dm index 00fad2808c3..ab1173a62c3 100644 --- a/code/controllers/configuration/sections/general_configuration.dm +++ b/code/controllers/configuration/sections/general_configuration.dm @@ -76,6 +76,8 @@ var/enable_night_shifts = TRUE /// Cap for monkey cube monkey spawns var/monkey_cube_cap = 32 + /// Cap for chickens + var/chicken_hatched_cap = 50 /// Enable to make explosions react to obstacles instead of ignoring them var/reactionary_explosions = TRUE /// Bomb cap (Devastation) Other values will be calculated around this diff --git a/code/modules/food_and_drinks/food/foods/meat.dm b/code/modules/food_and_drinks/food/foods/meat.dm index 3659e98195d..6a9c58ff15a 100644 --- a/code/modules/food_and_drinks/food/foods/meat.dm +++ b/code/modules/food_and_drinks/food/foods/meat.dm @@ -513,6 +513,7 @@ list_reagents = list("protein" = 1, "egg" = 5) tastes = list("egg" = 1) var/amount_grown = 0 + var/fertile = FALSE /obj/item/food/egg/throw_impact(atom/hit_atom) ..() diff --git a/code/modules/mob/living/basic/farm_animals/chicken.dm b/code/modules/mob/living/basic/farm_animals/chicken.dm index 005bfd5f5f8..3a5017e5ad6 100644 --- a/code/modules/mob/living/basic/farm_animals/chicken.dm +++ b/code/modules/mob/living/basic/farm_animals/chicken.dm @@ -38,6 +38,7 @@ /// Basic mobs need a language otherwise their speech is garbled add_language("Galactic Common") set_default_language(GLOB.all_languages["Galactic Common"]) + GLOB.chicken_count++ /mob/living/basic/chick/scatter_atom(x_offset, y_offset) pixel_x = rand(-6, 6) + x_offset @@ -48,6 +49,7 @@ if(.) amount_grown += rand(1,2) if(amount_grown >= 100) + GLOB.chicken_count-- var/mob/living/basic/chicken/C = new /mob/living/basic/chicken(loc) if(name != initial(name)) C.name = name @@ -67,7 +69,6 @@ get_scooped(M, TRUE) ..() -#define MAX_CHICKENS 50 GLOBAL_VAR_INIT(chicken_count, 0) /mob/living/basic/chicken @@ -176,14 +177,15 @@ GLOBAL_VAR_INIT(chicken_count, 0) if((. && prob(3) && eggsleft > 0) && egg_type) visible_message("[src] [pick(layMessage)]") eggsleft-- - var/obj/item/E = new egg_type(get_turf(src)) + var/obj/item/food/egg/E = new egg_type(get_turf(src)) E.scatter_atom() if(eggsFertile) - if(GLOB.chicken_count < MAX_CHICKENS && prob(25)) + if((GLOB.chicken_count <= GLOB.configuration.general.chicken_hatched_cap) && prob(25)) + E.fertile = TRUE START_PROCESSING(SSobj, E) /obj/item/food/egg/process() - if(isturf(loc)) + if(isturf(loc) && fertile && GLOB.chicken_count <= GLOB.configuration.general.chicken_hatched_cap) amount_grown += rand(1,2) if(amount_grown >= 100) visible_message("[src] hatches with a quiet cracking sound.") @@ -254,4 +256,3 @@ GLOBAL_VAR_INIT(chicken_count, 0) emote_hear = list("cheeps.") emote_see = list("pecks at the ground", "flaps its tiny wings") -#undef MAX_CHICKENS diff --git a/config/example/config.toml b/config/example/config.toml index 011acb78f38..43a484e58e9 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -366,6 +366,8 @@ randomise_shift_time = true enable_night_shifts = true # Cap for monkeys spawned from monkey cubes monkey_cube_cap = 32 +# Cap for chickens +chicken_hatched_cap = 50 # Make explosions react to obstacles (walls+doors) instead of ignoring them reactionary_explosions = true # Bomb cap for explosions (Outer devastation. Other values calculate from this)