Files
Bubberstation/code/datums/mind/initialization.dm
Jacquerel 517d33e6f0 Basic blob mobs (#78520)
## About The Pull Request

I remembered today that blob code is ass, especially blob spores.
There's still a lot to improve but I cleaned up _some_ of it by
converting these mobs.
Now they use a newer framework and more signal handling as compared to
circular references.

I _expect_ the behaviour here to largely be the same as it was or
similar. I haven't added anything fancy or new.

This is a reasonably big PR but at least all of the files are small?
Everything here touched every other thing enough that it didnt make
sense to split up sorry.

Other things I did in code:
- Experimented with replacing the `mob/blob` subtype with a component.
Don't know if this is genius or stupid.
- AI subtree which just walks somewhere. We've used this behaviour a lot
but never given it its own subtree.
- Blob Spores and Zombies are two different mobs now instead of being
one mob which just changes every single one of its properties.
- Made a few living defence procs call super, because the only thing
super does was send a signal and we weren't doing that for no reason.
Also added a couple extra signals for intercepts we did not have.

## Changelog

🆑
fix: Blob spores will respond to rallies more reliably (it won't runtime
every time they try and pathfind).
fix: Blobbernaut pain animation overlays should align with the direction
the mob is facing instead of always facing South
refactor: Blob spores, zombies, and blobbernauts now all use the basic
mob framework. They should work the same, but please report any issues.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: san7890 <the@san7890.com>
2023-09-26 15:28:26 -06:00

38 lines
892 B
Plaintext

//Initialisation procs
/mob/proc/mind_initialize()
if(mind)
mind.key = key
else
mind = new /datum/mind(key)
SSticker.minds += mind
if(!mind.name)
mind.name = real_name
mind.set_current(src)
// There's nowhere else to set this up, mind code makes me depressed
mind.antag_hud = add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/antagonist_hud, "combo_hud", mind)
SEND_SIGNAL(src, COMSIG_MOB_MIND_INITIALIZED, mind)
/mob/living/carbon/mind_initialize()
..()
last_mind = mind
//AI
/mob/living/silicon/ai/mind_initialize()
. = ..()
mind.set_assigned_role(SSjob.GetJobType(/datum/job/ai))
//BORG
/mob/living/silicon/robot/mind_initialize()
. = ..()
mind.set_assigned_role(SSjob.GetJobType(/datum/job/cyborg))
//PAI
/mob/living/silicon/pai/mind_initialize()
. = ..()
mind.set_assigned_role(SSjob.GetJobType(/datum/job/personal_ai))
mind.special_role = ""