Adds a global spores limit (#25155)

This commit is contained in:
DGamerL
2024-05-17 12:49:10 +00:00
committed by GitHub
parent b216289b41
commit a57169eb2e
2 changed files with 9 additions and 3 deletions
+2
View File
@@ -84,6 +84,7 @@
if(istype(linked_node))
factory = linked_node
factory.spores += src
GLOB.spores_active++
/mob/living/simple_animal/hostile/blob/blobspore/Life(seconds, times_fired)
@@ -151,6 +152,7 @@
if(oldguy)
oldguy.forceMove(get_turf(src))
oldguy = null
GLOB.spores_active--
return ..()
@@ -1,3 +1,5 @@
GLOBAL_VAR_INIT(spores_active, 0)
#define MAX_GLOBAL_SPORES 25
/obj/structure/blob/factory
name = "factory blob"
icon = 'icons/mob/blob.dmi'
@@ -5,7 +7,7 @@
max_integrity = 200
point_return = 18
var/list/spores = list()
var/max_spores = 3
var/max_spores = 5
var/spore_delay = 0
/obj/structure/blob/factory/Destroy()
@@ -16,12 +18,14 @@
return ..()
/obj/structure/blob/factory/run_action()
if(length(spores) >= max_spores)
if(length(spores) >= max_spores || GLOB.spores_active >= MAX_GLOBAL_SPORES)
return
if(spore_delay > world.time)
return
flick("blob_factory_glow", src)
spore_delay = world.time + 100 // 10 seconds
spore_delay = world.time + 10 SECONDS
var/mob/living/simple_animal/hostile/blob/blobspore/BS = new/mob/living/simple_animal/hostile/blob/blobspore(src.loc, src)
if(overmind)
overmind.add_mob_to_overmind(BS)
#undef MAX_GLOBAL_SPORES