[MIRROR] mega arachnid basic monster [MDB IGNORE] (#23135)

* mega arachnid basic monster (#77601)

## About The Pull Request
the mega arachnid is now a basic monster. he is a very tricky and
opportunistic creature he will plan his attacks carefully and only
attack the weak. he will first try to throw fleshy legcuffs at his
victims, if the victim becomes cuffed he will move in to attack him,
otherwise he will run away from him while trying to throw restraints at
his legs. while he is running away he will also release slippery acid to
slip his prey. also when he is looking for his prey, he will be
transparent for more stealth. after he finds his prey the transparency
will wear off. he is also a very stealthy creature, he will break any
lights and cameras near him and he can also climb trees to hide in them
while he is looking for a victim.

## Why It's Good For The Game
add more combat depth for the mega arachnid

## Changelog
🆑
refactor: the mega arachnid is now a basic monster ,please report any
bugs
feature: the mega arachnid now have an ability to slip victims
/🆑

* mega arachnid basic monster

---------

Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-08-16 18:26:34 -04:00
committed by GitHub
co-authored by Ben10Omintrix
parent c973b3abcd
commit 32f4007f93
12 changed files with 282 additions and 132 deletions
@@ -0,0 +1,49 @@
/**
* component gave to basic creatures to allow them to change appearance when find a target
*/
/datum/component/appearance_on_aggro
var/target_key = BB_BASIC_MOB_CURRENT_TARGET
/// path of the overlay to apply
var/mutable_appearance/overlay_path
/// visibility of our icon when aggroed
var/alpha_on_aggro
/// visibility of our icon when deaggroed
var/alpha_on_deaggro
/datum/component/appearance_on_aggro/Initialize(overlay_icon, overlay_state, alpha_on_aggro, alpha_on_deaggro)
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
if(overlay_icon && overlay_state)
src.overlay_path = mutable_appearance(overlay_icon, overlay_state)
if(!alpha_on_aggro || !alpha_on_deaggro)
return
src.alpha_on_aggro = alpha_on_aggro
src.alpha_on_deaggro = alpha_on_deaggro
/datum/component/appearance_on_aggro/RegisterWithParent()
RegisterSignal(parent, COMSIG_AI_BLACKBOARD_KEY_SET(target_key), PROC_REF(change_appearance))
RegisterSignal(parent, COMSIG_AI_BLACKBOARD_KEY_CLEARED(target_key), PROC_REF(revert_appearance))
/datum/component/appearance_on_aggro/UnregisterFromParent()
. = ..()
UnregisterSignal(parent, list(COMSIG_AI_BLACKBOARD_KEY_SET(target_key), COMSIG_AI_BLACKBOARD_KEY_CLEARED(target_key)))
/datum/component/appearance_on_aggro/proc/change_appearance(mob/living/source)
SIGNAL_HANDLER
var/atom/target = source.ai_controller.blackboard[target_key]
if(isnull(target))
return
if(overlay_path)
source.add_overlay(overlay_path)
if(alpha_on_aggro)
animate(source, alpha = alpha_on_aggro, time = 2 SECONDS)
/datum/component/appearance_on_aggro/proc/revert_appearance(mob/living/source)
SIGNAL_HANDLER
if(overlay_path)
source.cut_overlay(overlay_path)
if(alpha_on_deaggro)
animate(source, alpha = alpha_on_deaggro, time = 2 SECONDS)