[MIRROR] Replaces GetComponent in Mining items with Signalers [MDB IGNORE] (#15221)

* Replaces GetComponent in Mining items with Signalers (#68575)

* Replaces many instances of GetComponents in mining items with signals and better uses overall of Components, in drills and the GPS handcuffs.
* To do this, also added 3 new signals to mechs when you are adding/removing mech equipment onto one.

* Replaces GetComponent in Mining items with Signalers

Co-authored-by: Salex08 <33989683+Salex08@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-07-28 20:45:29 +02:00
committed by GitHub
parent 4c95ef5fe6
commit 83665417d2
31 changed files with 306 additions and 100 deletions
@@ -10,22 +10,11 @@
/obj/item/clothing/gloves/butchering/Initialize(mapload)
. = ..()
AddComponent(/datum/component/butchering, 5, 125, null, null, TRUE, TRUE)
/obj/item/clothing/gloves/butchering/equipped(mob/user, slot, initial = FALSE)
. = ..()
RegisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK, .proc/butcher_target)
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
butchering.butchering_enabled = TRUE
/obj/item/clothing/gloves/butchering/dropped(mob/user, silent = FALSE)
. = ..()
UnregisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK)
var/datum/component/butchering/butchering = src.GetComponent(/datum/component/butchering)
butchering.butchering_enabled = FALSE
/obj/item/clothing/gloves/butchering/proc/butcher_target(mob/user, atom/target, proximity)
SIGNAL_HANDLER
if(!isliving(target))
return
return SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, target, user)
AddComponent(/datum/component/butchering/wearable, \
speed = 0.5 SECONDS, \
effectiveness = 125, \
bonus_modifier = 0, \
butcher_sound = null, \
disabled = TRUE, \
can_be_blunt = TRUE, \
)