[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
@@ -62,7 +62,7 @@
var/obj/item/card/id/id_card = user.get_idcard(hand_first = FALSE)
if(id_card)
gps_name = id_card.registered_name
AddComponent(/datum/component/gps, "*[gps_name]'s Kheiral Link")
AddComponent(/datum/component/gps/kheiral_cuffs, "*[gps_name]'s Kheiral Link")
balloon_alert(user, "GPS activated")
ADD_TRAIT(user, TRAIT_MULTIZ_SUIT_SENSORS, REF(src))
gps_enabled = TRUE
@@ -74,7 +74,6 @@
if(on_wrist && far_from_home)
return
balloon_alert(user, "GPS de-activated")
qdel(GetComponent(/datum/component/gps))
REMOVE_TRAIT(user, TRAIT_MULTIZ_SUIT_SENSORS, REF(src))
gps_enabled = FALSE
@@ -32,7 +32,11 @@
/obj/item/kinetic_crusher/ComponentInitialize()
. = ..()
AddComponent(/datum/component/butchering, 60, 110) //technically it's huge and bulky, but this provides an incentive to use it
AddComponent(/datum/component/butchering, \
speed = 6 SECONDS, \
effectiveness = 110, \
)
//technically it's huge and bulky, but this provides an incentive to use it
AddComponent(/datum/component/two_handed, force_unwielded=0, force_wielded=20)
/obj/item/kinetic_crusher/Destroy()
@@ -130,7 +130,11 @@
/obj/item/shovel/Initialize(mapload)
. = ..()
AddComponent(/datum/component/butchering, 150, 40) //it's sharp, so it works, but barely.
AddComponent(/datum/component/butchering, \
speed = 15 SECONDS, \
effectiveness = 40, \
)
//it's sharp, so it works, but barely.
/obj/item/shovel/suicide_act(mob/living/user)
user.visible_message(span_suicide("[user] begins digging their own grave! It looks like [user.p_theyre()] trying to commit suicide!"))
+13 -14
View File
@@ -309,30 +309,26 @@
/obj/item/clothing/head/hooded/hostile_environment/Initialize(mapload)
. = ..()
update_appearance()
AddComponent(/datum/component/butchering, 5, 150, null, null, null, TRUE, CALLBACK(src, .proc/consume))
AddComponent(/datum/component/butchering/wearable, \
speed = 0.5 SECONDS, \
effectiveness = 150, \
bonus_modifier = 0, \
butcher_sound = null, \
disabled = null, \
can_be_blunt = TRUE, \
butcher_callback = CALLBACK(src, .proc/consume), \
)
AddElement(/datum/element/radiation_protected_clothing)
AddComponent(/datum/component/gags_recolorable)
/obj/item/clothing/head/hooded/hostile_environment/equipped(mob/user, slot, initial = FALSE)
. = ..()
RegisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK, .proc/butcher_target)
var/datum/component/butchering/butchering = GetComponent(/datum/component/butchering)
butchering.butchering_enabled = TRUE
to_chat(user, span_notice("You feel a bloodlust. You can now butcher corpses with your bare arms."))
/obj/item/clothing/head/hooded/hostile_environment/dropped(mob/user, silent = FALSE)
. = ..()
UnregisterSignal(user, COMSIG_HUMAN_EARLY_UNARMED_ATTACK)
var/datum/component/butchering/butchering = GetComponent(/datum/component/butchering)
butchering.butchering_enabled = FALSE
to_chat(user, span_notice("You lose your bloodlust."))
/obj/item/clothing/head/hooded/hostile_environment/proc/butcher_target(mob/user, atom/target, proximity)
SIGNAL_HANDLER
if(!isliving(target))
return
return SEND_SIGNAL(src, COMSIG_ITEM_ATTACK, target, user)
/obj/item/clothing/head/hooded/hostile_environment/proc/consume(mob/living/user, mob/living/butchered)
if(butchered.mob_biotypes & (MOB_ROBOTIC | MOB_SPIRIT))
return
@@ -633,7 +629,10 @@
spirits = list()
START_PROCESSING(SSobj, src)
SSpoints_of_interest.make_point_of_interest(src)
AddComponent(/datum/component/butchering, 150, 90)
AddComponent(/datum/component/butchering, \
speed = 15 SECONDS, \
effectiveness = 90, \
)
/obj/item/melee/ghost_sword/Destroy()
for(var/mob/dead/observer/G in spirits)