Sets a Mob Cap for Giant Spiders (#15923)

* Counting and Capping for Giant Spider Spawning

* Moves magic numbers into defines

* Apply suggestions from code review

Co-authored-by: dearmochi <shenesis@gmail.com>

* Update code/controllers/subsystem/mobs.dm

Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>

* makes requested changes

* I hope to god this fixes this

* implements requested changes

* removes double parent call

Co-authored-by: dearmochi <shenesis@gmail.com>
Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com>
This commit is contained in:
Sirryan2002
2021-08-05 21:23:01 +01:00
committed by GitHub
co-authored by dearmochi AffectedArc07
parent b2d46ba7bc
commit 9bf4d7ad84
4 changed files with 21 additions and 3 deletions
+12 -2
View File
@@ -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)