diff --git a/code/game/objects/mob_spawner_vr.dm b/code/game/objects/mob_spawner_vr.dm index 6feebec885..f79e408e07 100644 --- a/code/game/objects/mob_spawner_vr.dm +++ b/code/game/objects/mob_spawner_vr.dm @@ -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) diff --git a/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm b/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm index 61983b08f2..ffea0e7548 100644 --- a/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm +++ b/code/modules/mob/living/simple_mob/subtypes/vore/mimic.dm @@ -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)) diff --git a/code/game/objects/mob_spawner_ch.dm b/modular_chomp/code/game/objects/mob_spawner.dm similarity index 78% rename from code/game/objects/mob_spawner_ch.dm rename to modular_chomp/code/game/objects/mob_spawner.dm index 4752b77410..44e8e4e9fd 100644 --- a/code/game/objects/mob_spawner_ch.dm +++ b/modular_chomp/code/game/objects/mob_spawner.dm @@ -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) diff --git a/vorestation.dme b/vorestation.dme index c2a068ba21..9f1f07dd0f 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -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"