mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-01 05:02:33 +00:00
* Initial commit. Event. * Started converting mobs to basic mobs. Migo and Creature. Needs aggressiveness AI * Makes CI happy * Fixes some file names * Ticks files * Fixes file again * Update code/modules/events/demon_incursion.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> * Announcement sound, spawn adjustments * Reduced spread when portals multiply * Elite spawns when portal count gets high * Fixes missing comma * Converted migo, blank, and most of hellhounds to basic mobs. Added new controllers and behaviors * Fixes * Linters! * Faithless moved to basic mob * LINTERS * Makes skeletons basic mobs * Fixes, Ranged Attacks, Ranged variants of nether mobs * Handles portal expansion chance * Linters * Fixes mobs not breaking shit * Fixes ranged attacks * Fixes ranged attacks * oops * Another oops. No config changes are needed here * Twenty percent chance that a nether mob is a grappler * Dimensional tear fixes * Adjusts awaken distance for hostile mobs, makes variable melee attack rate for basic mobs * Variable initial spawns, variable spread rates. * Whole lot of fixes from merge, hellhound completion * Updated lavaland winter biodome * Makes basic mobs able to hurt other mobs * Makes spawners properly rally basic mobs to beat up the attacker * Extra line * Removed comment * Makes hellhounds stop resting when attacked or when they find a new target * Fixed initial portal spawn amounts * Borgs now affected by basic mobs * Nerfs portal spawn rate, nerfs portal integrity, nerfs portal max mobs * Grapplers now teleport to missed turfs * Removes duplicate notices * Buff portals a small bit * Makes nether portals no longer RR - the body is now recoverable from the blank it became * Makes portals layer above mobs * Removed excess ranged attack var * Changes list for determining start count to rely on mobs with client instead of all clients * Nerfs portal max mobs * Portals can no longer spread to within 3 tiles of another portal except on initial event start * Adjusts target portal count for big mobs * Spawners now properly remove nest values of basic mobs * Portals now glow an evil red. When portals are destroyed, 50% chance per mob to slay the mob * add prowling and return to home behaviors * cut this down * be a tiny bit smarter * Some code cleanup * Removes hostile base type, removing excess code * Gives /obj/ a basic mob attack handler. Fixes turrets * Gives basic mobs a HUD * Fixes skeleton death flag * Adjusted initial spawns * Incursion portals now slowly convert turfs, up to range 3 of them, to hellish flooring * Increases reward per destroyed portal * Makes the final portal of an incursion play a sound on destruction, couple portal fixes * Fixes basic mob xenobiology interactions * Non-shit portal sprites * Adds hostile machine element, mobs now actively target turrets and emitters * Properly gibs things when they should gib * Linter fix * Portals now layer under living mobs but over dead ones * Adds blackbox checking for demon incursion portal counts * Increases mob sight range slightly to account for widescreen, adds alt-color for grappler, delays incursion announcement a bit more * Portals now are more likely to spread the less there are * Incursion portals now repair themselves after not being damaged for some time * Grilles now shock basic mobs * Portals will now clean up basic mob corpses near them by gibbing them * Portal spread chance is now exponential regression * Portal mob spawns now linearly scale in time * Fixes some skeleton oversights in ruin mapping * Demon incursions no longer can spread to tiles in a space area, such as near brig plating * Moves corpse cleanup to mobs via component * Portals now drop bodies that are being eaten when they're destroyed. * Addresses code review * Docs some vars --------- Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
95 lines
3.1 KiB
Plaintext
95 lines
3.1 KiB
Plaintext
/datum/component/spawner
|
|
var/mob_types = list(/mob/living/simple_animal/hostile/carp)
|
|
var/spawn_time = 300 //30 seconds default
|
|
var/list/spawned_mobs = list()
|
|
var/spawn_delay = 0
|
|
var/max_mobs = 5
|
|
var/spawn_text = "emerges from"
|
|
var/list/faction = list("mining")
|
|
|
|
COOLDOWN_DECLARE(last_rally)
|
|
|
|
|
|
/datum/component/spawner/Initialize(_mob_types, _spawn_time, _faction, _spawn_text, _max_mobs)
|
|
if(_spawn_time)
|
|
spawn_time=_spawn_time
|
|
if(_mob_types)
|
|
mob_types=_mob_types
|
|
if(_faction)
|
|
faction=_faction
|
|
if(_spawn_text)
|
|
spawn_text=_spawn_text
|
|
if(_max_mobs)
|
|
max_mobs=_max_mobs
|
|
|
|
RegisterSignal(parent, list(COMSIG_PARENT_QDELETING), PROC_REF(stop_spawning))
|
|
RegisterSignal(parent, COMSIG_SPAWNER_SET_TARGET, PROC_REF(rally_spawned_mobs))
|
|
START_PROCESSING(SSprocessing, src)
|
|
|
|
/datum/component/spawner/process()
|
|
try_spawn_mob()
|
|
|
|
|
|
/datum/component/spawner/proc/stop_spawning(force)
|
|
STOP_PROCESSING(SSprocessing, src)
|
|
for(var/mob/living/simple_animal/L in spawned_mobs)
|
|
if(L.nest == src)
|
|
L.nest = null
|
|
for(var/mob/living/basic/L in spawned_mobs)
|
|
if(L.nest == src)
|
|
L.nest = null
|
|
spawned_mobs = null
|
|
|
|
/datum/component/spawner/proc/try_spawn_mob()
|
|
var/atom/P = parent
|
|
if(length(spawned_mobs) >= max_mobs)
|
|
return
|
|
if(spawn_delay > world.time)
|
|
return
|
|
spawn_delay = world.time + spawn_time
|
|
var/chosen_mob_type = pick(mob_types)
|
|
var/mob/living/simple_animal/L = new chosen_mob_type(P.loc)
|
|
L.admin_spawned = P.admin_spawned
|
|
spawned_mobs += L
|
|
L.nest = src
|
|
L.faction = src.faction
|
|
P.visible_message("<span class='danger'>[L] [spawn_text] [P].</span>")
|
|
P.on_mob_spawn(L)
|
|
return L
|
|
|
|
/datum/component/spawner/proc/rally_spawned_mobs(parent, mob/living/target)
|
|
SIGNAL_HANDLER // COMSIG_SPAWNER_SET_TARGET
|
|
|
|
if(!(COOLDOWN_FINISHED(src, last_rally) && length(spawned_mobs)))
|
|
return
|
|
|
|
// start the cooldown first, because a rallied mob might fire on
|
|
// ourselves while this is happening, causing confusion
|
|
COOLDOWN_START(src, last_rally, 30 SECONDS)
|
|
for(var/mob/living/rallied as anything in spawned_mobs)
|
|
if(istype(rallied, /mob/living/basic))
|
|
var/mob/living/basic/basic = rallied
|
|
basic.ai_controller.cancel_actions()
|
|
basic.ai_controller.set_blackboard_key(BB_BASIC_MOB_CURRENT_TARGET, target)
|
|
if(istype(rallied, /mob/living/simple_animal/hostile))
|
|
var/mob/living/simple_animal/hostile/simple = rallied
|
|
INVOKE_ASYNC(simple, TYPE_PROC_REF(/mob/living/simple_animal/hostile, aggro_fast), target)
|
|
|
|
/datum/component/spawner/demon_incursion_portal
|
|
|
|
/datum/component/spawner/demon_incursion_portal/try_spawn_mob()
|
|
var/atom/result = ..()
|
|
if(result && istype(result.ai_controller))
|
|
result.ai_controller.set_blackboard_key(BB_INCURSION_HOME_PORTAL, parent)
|
|
|
|
return result
|
|
|
|
/datum/component/spawner/demon_incursion_portal/rally_spawned_mobs(parent, mob/living/target)
|
|
if(!(COOLDOWN_FINISHED(src, last_rally)))
|
|
return
|
|
|
|
COOLDOWN_START(src, last_rally, 30 SECONDS)
|
|
for(var/mob/living/basic/rallied as anything in spawned_mobs)
|
|
rallied.ai_controller.cancel_actions()
|
|
rallied.ai_controller.queue_behavior(/datum/ai_behavior/return_home/incursion_portal, BB_INCURSION_HOME_PORTAL)
|