From 070e3f0eb869a2bc4f8b64069ae22698ae413603 Mon Sep 17 00:00:00 2001 From: The Sharkening <95130227+StrangeWeirdKitten@users.noreply.github.com> Date: Thu, 23 Jan 2025 12:31:35 -0500 Subject: [PATCH] Adds Slime overcrowding because my byond client died once when flying over xenobio (#88935) ## About The Pull Request Basically if there's too many slimes on a single turf, the slime will not split. The define I set is 2 (which can change) so you can still reasonably spam a few monkeys inside a 3x3 cell and expect the slimes to split. Overcrowding isn't really meant to stop people from doing xenobio like this, it's to stop instances where people add way too many monkeys and in 30 minutes everyone's clients turn into a powerpoint when entering xenobiology. Basically to prevent this from happening. ``` ADMIN LOG: '(thesharkenning)'/(white wolf) deleted all instances of type or subtype of /mob/living/basic/slime (979 instances deleted) ADMIN LOG: '(thesharkenning)'/(white wolf) deleted all instances of type or subtype of /mob/living/basic/slime (641 instances deleted) ADMIN LOG: '(thesharkenning)'/(white wolf) deleted all instances of type or subtype of /mob/living/basic/slime (962 instances deleted) ``` ## Why It's Good For The Game I'm sure it's hell on the server too, but it's definitely something that makes byond cry. You don't need a whole lot of time: just a lot of monkeys and a single slime. ## Changelog :cl: fix: Fixes uncapped xenobio slime multiplication which can easily result in hundreds of slimes. /:cl: --- code/__DEFINES/mobs.dm | 3 +++ code/modules/mob/living/basic/slime/actions.dm | 14 ++++++++++++++ code/modules/mob/living/basic/slime/slime.dm | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 94b22d55ba7..7b4ec0bc36e 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -329,6 +329,9 @@ //Slime extract crossing. Controls how many extracts is required to feed to a slime to core-cross. #define SLIME_EXTRACT_CROSSING_REQUIRED 10 +//How many slimes can be on the same tile before it can no longer reproduce. +#define SLIME_OVERCROWD_AMOUNT 2 + //Slime commands defines #define SLIME_FRIENDSHIP_FOLLOW 3 //Min friendship to order it to follow #define SLIME_FRIENDSHIP_STOPEAT 5 //Min friendship to order it to stop eating someone diff --git a/code/modules/mob/living/basic/slime/actions.dm b/code/modules/mob/living/basic/slime/actions.dm index c297f48d14e..a3168d81437 100644 --- a/code/modules/mob/living/basic/slime/actions.dm +++ b/code/modules/mob/living/basic/slime/actions.dm @@ -77,6 +77,7 @@ ///Splits the slime into multiple children if possible /mob/living/basic/slime/proc/reproduce() + if(stat != CONSCIOUS) balloon_alert(src, "not conscious!") return @@ -92,6 +93,19 @@ balloon_alert(src, "need growth!") return + var/list/friends_list = list() + for(var/mob/living/basic/slime/friend in loc) + if(QDELETED(friend)) + continue + if(friend == src) + continue + friends_list += friend + + overcrowded = length(friends_list) >= SLIME_OVERCROWD_AMOUNT + if(overcrowded) + balloon_alert(src, "overcrowded!") + return + var/list/babies = list() var/new_nutrition = round(nutrition * 0.9) var/new_powerlevel = round(powerlevel / 4) diff --git a/code/modules/mob/living/basic/slime/slime.dm b/code/modules/mob/living/basic/slime/slime.dm index 8623f69b0e4..8f80e24f699 100644 --- a/code/modules/mob/living/basic/slime/slime.dm +++ b/code/modules/mob/living/basic/slime/slime.dm @@ -66,6 +66,9 @@ ///Our slime's current mood var/current_mood = SLIME_MOOD_NONE + ///If the slime is currently overcrowded and unable to reproduce. + var/overcrowded = FALSE + ///The number of /obj/item/slime_extract's the slime has left inside var/cores = 1 ///Chance of mutating, should be between 25 and 35 @@ -243,6 +246,8 @@ if(SLIME_MAX_POWER) . += span_boldwarning("It is radiating with massive levels of electrical activity!") + if(overcrowded) + . += span_warning("It seems too overcroweded to properly reproduce!") ///Changes the slime's current life state /mob/living/basic/slime/proc/set_life_stage(new_life_stage = SLIME_LIFE_STAGE_BABY)