mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-23 13:18:09 +01:00
allows mimics to spawn again, fixes mob_spawner runtime (#7334)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
desc = "A rectangular steel crate. This one looks particularly unstable."
|
||||
var/mimic_chance = 30
|
||||
var/mimic_active = TRUE
|
||||
var/nest = null //CHOMPAdd
|
||||
|
||||
/obj/structure/closet/crate/mimic/open()
|
||||
if(src.opened)
|
||||
@@ -27,6 +28,12 @@
|
||||
if(!src.can_open())
|
||||
return 0
|
||||
|
||||
//CHOMPAdd Start
|
||||
if(istype(nest, /obj/structure/mob_spawner))
|
||||
var/obj/structure/mob_spawner/S = nest
|
||||
S.get_used_report(src)
|
||||
//CHOMPAdd End
|
||||
|
||||
if(mimic_active)
|
||||
mimic_active = FALSE
|
||||
if(prob(mimic_chance))
|
||||
|
||||
+26
-22
@@ -1,22 +1,26 @@
|
||||
/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,
|
||||
)
|
||||
/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/dangerous = 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,
|
||||
)
|
||||
|
||||
/obj/structure/mob_spawner/proc/get_used_report(var/obj/structure/closet/crate/mimic/O)
|
||||
if(O in spawned_mobs)
|
||||
spawned_mobs.Remove(O)
|
||||
+1
-1
@@ -1155,7 +1155,6 @@
|
||||
#include "code\game\objects\kasscbuttons_ch.dm"
|
||||
#include "code\game\objects\micro_event.dm"
|
||||
#include "code\game\objects\micro_structures.dm"
|
||||
#include "code\game\objects\mob_spawner_ch.dm"
|
||||
#include "code\game\objects\mob_spawner_vr.dm"
|
||||
#include "code\game\objects\objs.dm"
|
||||
#include "code\game\objects\structures.dm"
|
||||
@@ -4628,6 +4627,7 @@
|
||||
#include "modular_chomp\code\game\machinery\portable_turret.dm"
|
||||
#include "modular_chomp\code\game\machinery\virtual_reality\vr_console.dm"
|
||||
#include "modular_chomp\code\game\objects\items.dm"
|
||||
#include "modular_chomp\code\game\objects\mob_spawner.dm"
|
||||
#include "modular_chomp\code\game\objects\items\holosign_creator.dm"
|
||||
#include "modular_chomp\code\game\objects\items\petrifier.dm"
|
||||
#include "modular_chomp\code\game\objects\items\clockwork\ratvarian_spear.dm"
|
||||
|
||||
Reference in New Issue
Block a user