Skip to content

Commit

Permalink
Mimites - Mimic based creatures and their midround event (#11170)
Browse files Browse the repository at this point in the history
* Initial Commit

* ranged vision adjust

* Adds hud icon for observers and variants to see

* Crate mimites no longer vent or replicate, and can be randomised, renamed to mimites

* updates the dmi icon name oops

* New Sprite

* ranged update

* add qdelcheck, increase growth time, add hudset to crate
  • Loading branch information
ro5490 authored Jul 14, 2024
1 parent f2403bc commit b6bdbcc
Show file tree
Hide file tree
Showing 7 changed files with 409 additions and 0 deletions.
2 changes: 2 additions & 0 deletions beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,7 @@
#include "code\modules\events\meateor_wave.dm"
#include "code\modules\events\meteor_wave.dm"
#include "code\modules\events\mice_migration.dm"
#include "code\modules\events\mimite_infestation.dm"
#include "code\modules\events\nightmare.dm"
#include "code\modules\events\operative.dm"
#include "code\modules\events\pirates.dm"
Expand Down Expand Up @@ -3222,6 +3223,7 @@
#include "code\modules\mob\living\simple_animal\hostile\macrophage.dm"
#include "code\modules\mob\living\simple_animal\hostile\mecha_pilot.dm"
#include "code\modules\mob\living\simple_animal\hostile\mimic.dm"
#include "code\modules\mob\living\simple_animal\hostile\mimite.dm"
#include "code\modules\mob\living\simple_animal\hostile\mushroom.dm"
#include "code\modules\mob\living\simple_animal\hostile\nanotrasen.dm"
#include "code\modules\mob\living\simple_animal\hostile\netherworld.dm"
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ GLOBAL_LIST_INIT(turfs_without_ground, typecacheof(list(

#define isfaithless(A) (istype(A, /mob/living/simple_animal/hostile/faithless))

#define ismimite(A) (istype(A, /mob/living/simple_animal/hostile/mimite))

//Misc mobs
#define isobserver(A) (istype(A, /mob/dead/observer))

Expand Down
9 changes: 9 additions & 0 deletions code/game/alternate_appearance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,12 @@ GLOBAL_LIST_EMPTY(active_alternate_appearances)

/datum/atom_hud/alternate_appearance/basic/heretics/mobShouldSee(mob/M)
return IS_HERETIC(M) || IS_HERETIC_MONSTER(M)

/datum/atom_hud/alternate_appearance/basic/mimites/New()
..()
for(var/mob in GLOB.player_list)
if(mobShouldSee(mob))
add_hud_to(mob)

/datum/atom_hud/alternate_appearance/basic/mimites/mobShouldSee(mob/M)
return ismimite(M) || isobserver(M)
49 changes: 49 additions & 0 deletions code/modules/events/mimite_infestation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/datum/round_event_control/mimite_infestation
name = "Mimite Infestation"
typepath = /datum/round_event/mimite_infestation
weight = 10
min_players = 20


/datum/round_event/mimite_infestation
announceWhen = 400
// 50% chance of being incremented by one
var/spawncount = 2
fakeable = TRUE

/datum/round_event/mimite_infestation/setup()
announceWhen = rand(announceWhen, announceWhen + 50)
if(prob(50))
spawncount++

/datum/round_event/mimite_infestation/announce(fake)
var/living_mimites = FALSE
for(var/mob/living/simple_animal/hostile/mimite/A)
if(A.stat != DEAD)
living_mimites = TRUE

if(living_mimites || fake)
priority_announce("Unidentified lifesigns detected coming aboard [station_name()]. Secure any exterior access, including ducting and ventilation.", "Lifesign Alert", ANNOUNCER_ALIENS)

/datum/round_event/mimite_infestation/start()
var/list/vents = list()
for(var/obj/machinery/atmospherics/components/unary/vent_pump/temp_vent in GLOB.machines)
if(QDELETED(temp_vent))
continue
if(is_station_level(temp_vent.loc.z) && !temp_vent.welded)
var/datum/pipeline/temp_vent_parent = temp_vent.parents[1]
if(!temp_vent_parent)
continue//no parent vent
//Stops mimites getting stuck in small networks.
if(temp_vent_parent.other_atmosmch.len > 20)
vents += temp_vent
if(!vents.len)
message_admins("An event attempted to spawn mimites but no suitable vents were found. Shutting down.")
return MAP_ERROR
while(spawncount > 0 && vents.len)
var/obj/vent = pick_n_take(vents)
var/mob/living/simple_animal/hostile/mimite/new_mimite = new(vent.loc)
spawncount--
message_admins("[ADMIN_LOOKUPFLW(new_mimite)] has been spawned by an event.")
log_game("mimites where spawned by an event.")
return SUCCESSFUL_SPAWN
Loading

0 comments on commit b6bdbcc

Please sign in to comment.