[MIRROR] Refactors UnarmedAttack so we don't have like 4 Unarmed Attack signals, kills two more snowflake species procs [MDB IGNORE] (#24356)

* Refactors `UnarmedAttack` so we don't have like 4 Unarmed Attack signals, kills two more snowflake species procs

* Update chameleon.dm

* Update _species.dm

* Modular

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-10-16 12:37:49 -04:00
committed by GitHub
co-authored by MrMelbert Bloop
parent e4ce355747
commit 22943b9449
43 changed files with 284 additions and 217 deletions
+5 -3
View File
@@ -632,7 +632,7 @@
. = ..()
if(slot & ITEM_SLOT_GLOVES)
tool_behaviour = TOOL_MINING
RegisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK, PROC_REF(rocksmash))
RegisterSignal(user, COMSIG_LIVING_UNARMED_ATTACK, PROC_REF(rocksmash))
RegisterSignal(user, COMSIG_MOVABLE_BUMP, PROC_REF(rocksmash))
else
stopmining(user)
@@ -643,13 +643,15 @@
/obj/item/clothing/gloves/gauntlets/proc/stopmining(mob/user)
tool_behaviour = initial(tool_behaviour)
UnregisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK)
UnregisterSignal(user, COMSIG_LIVING_UNARMED_ATTACK)
UnregisterSignal(user, COMSIG_MOVABLE_BUMP)
/obj/item/clothing/gloves/gauntlets/proc/rocksmash(mob/living/carbon/human/user, atom/rocks, proximity)
SIGNAL_HANDLER
if(!proximity)
return NONE
if(!ismineralturf(rocks) && !isasteroidturf(rocks))
return
return NONE
rocks.attackby(src, user)
return COMPONENT_CANCEL_ATTACK_CHAIN