diff --git a/.vscode/settings.json b/.vscode/settings.json index b6d5ddfed6d..a413f2f4dfd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,4 +2,4 @@ "workbench.editorAssociations": { "*.dmi": "imagePreview.previewEditor" } -} \ No newline at end of file +} diff --git a/code/controllers/subsystem/mobs.dm b/code/controllers/subsystem/mobs.dm index 8827de67123..e024a1f3d4e 100644 --- a/code/controllers/subsystem/mobs.dm +++ b/code/controllers/subsystem/mobs.dm @@ -9,6 +9,8 @@ SUBSYSTEM_DEF(mobs) var/static/list/clients_by_zlevel[][] var/static/list/dead_players_by_zlevel[][] = list(list()) // Needs to support zlevel 1 here, MaxZChanged only happens when CC is created and new_players can login before that. var/static/list/cubemonkeys = list() + /// The amount of giant spiders that exist in the world. Used for mob capping. + var/giant_spiders = 0 /datum/controller/subsystem/mobs/stat_entry() ..("P:[GLOB.mob_living_list.len]") diff --git a/code/game/objects/effects/spiders.dm b/code/game/objects/effects/spiders.dm index 010807c2787..56140e7d2ea 100644 --- a/code/game/objects/effects/spiders.dm +++ b/code/game/objects/effects/spiders.dm @@ -1,4 +1,6 @@ //generic procs copied from obj/effect/alien +#define SPIDER_SOFT_CAP 30 +#define SPIDER_HARD_CAP 40 /obj/structure/spider name = "web" desc = "it's stringy and sticky" @@ -67,7 +69,11 @@ START_PROCESSING(SSobj, src) /obj/structure/spider/eggcluster/process() - amount_grown += rand(0,2) + if(SSmobs.giant_spiders > SPIDER_SOFT_CAP) //eggs gonna chill out until there is less spiders + return + + amount_grown += rand(0, 2) + if(amount_grown >= 100) var/num = rand(3, 12) for(var/i in 1 to num) @@ -75,7 +81,7 @@ S.faction = faction.Copy() S.master_commander = master_commander if(player_spiders) - S.player_spiders = 1 + S.player_spiders = TRUE qdel(src) /obj/structure/spider/spiderling @@ -168,9 +174,13 @@ if(isturf(loc)) amount_grown += rand(0,2) if(amount_grown >= 100) + if(SSmobs.giant_spiders > SPIDER_HARD_CAP) + qdel(src) + return if(!grow_as) grow_as = pick(typesof(/mob/living/simple_animal/hostile/poison/giant_spider)) var/mob/living/simple_animal/hostile/poison/giant_spider/S = new grow_as(loc) + SSmobs.giant_spiders++ S.faction = faction.Copy() S.master_commander = master_commander if(player_spiders && !selecting_player) diff --git a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm index 6f110d0bb13..98dcd8cac6e 100644 --- a/code/modules/mob/living/simple_animal/hostile/giant_spider.dm +++ b/code/modules/mob/living/simple_animal/hostile/giant_spider.dm @@ -56,6 +56,12 @@ for(var/obj/structure/spider/S in range(1, get_turf(src))) return S +/mob/living/simple_animal/hostile/poison/giant_spider/death(gibbed) + . = ..() + if(!.) + return FALSE + SSmobs.giant_spiders-- + //nursemaids - these create webs and eggs /mob/living/simple_animal/hostile/poison/giant_spider/nurse desc = "Furry and black, it makes you shudder to look at it. This one has brilliant green eyes."