Files
Bubberstation/code/game/objects/items/devices/anomaly_neutralizer.dm
T
AnturK 4d6a8bc537 515 Compatibility (#71161)
Makes the code compatible with 515.1594+

Few simple changes and one very painful one.
Let's start with the easy:
* puts call behind `LIBCALL` define, so call_ext is properly used in 515
* Adds `NAMEOF_STATIC(_,X)` macro for nameof in static definitions since
src is now invalid there.
* Fixes tgui and devserver. From 515 onward the tmp3333{procid} cache
directory is not appened to base path in browser controls so we don't
check for it in base js and put the dev server dummy window file in
actual directory not the byond root.
* Renames the few things that had /final/ in typepath to ultimate since
final is a new keyword

And the very painful change:
`.proc/whatever` format is no longer valid, so we're replacing it with
new nameof() function. All this wrapped in three new macros.
`PROC_REF(X)`,`TYPE_PROC_REF(TYPE,X)`,`GLOBAL_PROC_REF(X)`. Global is
not actually necessary but if we get nameof that does not allow globals
it would be nice validation.
This is pretty unwieldy but there's no real alternative.
If you notice anything weird in the commits let me know because majority
was done with regex replace.

@tgstation/commit-access Since the .proc/stuff is pretty big change.

Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com>
2022-11-15 03:50:11 +00: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/device.dmi'
icon_state = "memorizer2"
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)