allows mimics to spawn again, fixes mob_spawner runtime (#7334)

This commit is contained in:
Kashargul
2023-12-06 21:27:21 +01:00
committed by GitHub
parent 21b6370c0f
commit e87a358334
4 changed files with 60 additions and 31 deletions
-22
View File
@@ -1,22 +0,0 @@
/obj/structure/mob_spawner/scanner/mining_animals
name = "Mining Lazy Spawner"
spawn_delay = 10 MINUTES
range = 10
simultaneous_spawns = 1
mob_faction = "wild animal"
total_spawns = 2
destructible = 0
anchored = 1
invisibility = 101
spawn_types = list(
/mob/living/simple_mob/mechanical/hivebot/swarm = 1,
/mob/living/simple_mob/animal/space/carp = 10,
/obj/structure/closet/crate/mimic = 2,
/mob/living/simple_mob/animal/space/bats = 70,
/mob/living/simple_mob/vore/jelly = 25,
/mob/living/simple_mob/animal/space/bear = 1,
/mob/living/simple_mob/vore/aggressive/deathclaw = 1,
/mob/living/simple_mob/animal/space/goose = 60,
/mob/living/simple_mob/vore/bee = 50,
/mob/living/simple_mob/metroid/mine = 20,
)
+26 -8
View File
@@ -29,8 +29,15 @@
/obj/structure/mob_spawner/Destroy()
STOP_PROCESSING(SSobj, src)
for(var/mob/living/L in spawned_mobs)
L.nest = null
//CHOMPEdit Start
for(var/spawned in spawned_mobs)
if(istype(spawned, /mob/living))
var/mob/living/L = spawned
L.nest = null
if(istype(spawned, /obj/structure/closet/crate/mimic))
var/obj/structure/closet/crate/mimic/O = spawned
O.nest = null
//CHOMPEdit End
spawned_mobs.Cut()
return ..()
@@ -56,15 +63,26 @@
/obj/structure/mob_spawner/proc/do_spawn(var/mob_path)
if(!ispath(mob_path))
return 0
var/mob/living/L = new mob_path(get_turf(src))
L.nest = src
spawned_mobs.Add(L)
//CHOMPEdit Start
if(!ispath(mob_path, /mob/living) && !ispath(mob_path, /obj/structure/closet/crate/mimic))
return 0
last_spawn = world.time
if(total_spawns > 0)
total_spawns--
if(mob_faction)
L.faction = mob_faction
return L
if(ispath(mob_path, /mob/living))
var/mob/living/L = new mob_path(get_turf(src))
L.nest = src
spawned_mobs.Add(L)
if(mob_faction)
L.faction = mob_faction
return L
if(ispath(mob_path, /obj/structure/closet/crate/mimic))
var/obj/structure/closet/crate/mimic/O = new mob_path(get_turf(src))
spawned_mobs.Add(O)
O.nest = src
return O
return 0
//CHOMPEdit End
/obj/structure/mob_spawner/proc/get_death_report(var/mob/living/L)
if(L in spawned_mobs)