Files
Bubberstation/code/game/objects/items/devices/anomaly_neutralizer.dm
YesterdaysPromise 71a1fee2f1 Explodes device.dmi (#80025)
## About The Pull Request

I woke up today and thought 'what would be easy thing to do today so I
can say I've done something?'. Then I remembered I saw several gangtool
usages the time I split radio up, and I could remedy those. 7 hours
later, device.dmi is split in a folder of its own, and I've also given
unique sprites to door remotes and landing desginators.


## Why It's Good For The Game

The device.dmi was kind of a mess.

## Changelog

🆑
/🆑
2023-12-09 13:31:50 +01:00

44 lines
1.7 KiB
Plaintext

/obj/item/anomaly_neutralizer
name = "anomaly neutralizer"
desc = "A one-use device capable of instantly neutralizing anomalous or otherworldly entities."
icon = 'icons/obj/devices/tool.dmi'
icon_state = "neutralyzer"
inhand_icon_state = "electronic"
worn_icon_state = "electronic"
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
item_flags = NOBLUDGEON
/obj/item/anomaly_neutralizer/Initialize(mapload)
. = ..()
// Primarily used to delete and neutralize anomalies.
AddComponent(/datum/component/effect_remover, \
success_feedback = "You neutralize %THEEFFECT with %THEWEAPON, frying its circuitry in the process.", \
tip_text = "Neutralize anomaly", \
on_clear_callback = CALLBACK(src, PROC_REF(on_anomaly_neutralized)), \
effects_we_clear = list(/obj/effect/anomaly))
// Can also be used to delete drained heretic influences, to stop fools from losing arms.
AddComponent(/datum/component/effect_remover, \
success_feedback = "You close %THEEFFECT with %THEWEAPON, frying its circuitry in the process.", \
tip_text = "Close rift", \
on_clear_callback = CALLBACK(src, PROC_REF(on_use)), \
effects_we_clear = list(/obj/effect/visible_heretic_influence))
/**
* Callback for the effect remover component to handle neutralizing anomalies.
*/
/obj/item/anomaly_neutralizer/proc/on_anomaly_neutralized(obj/effect/anomaly/target, mob/living/user)
target.anomalyNeutralize()
on_use(target, user)
/**
* Use up the anomaly neutralizer. Cause some sparks and delete it.
*/
/obj/item/anomaly_neutralizer/proc/on_use(obj/effect/target, mob/living/user)
do_sparks(3, FALSE, user)
qdel(src)