Files
Paradise/code/datums/components/effect_remover.dm
Kyani 203105788c [IDB Ignore] Heretic: The Mansus Re-Opened (#30738)
* fixes

* fuck my stupid chungus life

* Minion limit, heal fix, dead sac fix

* cooldown, no sacrificing star gazer or ascended alive heretics

* blade debuff

* oopsy

* Update tgui.bundle.js

* map diff bot what ya doing

* fuck that chat spam

* lets heretic armour hold a haunted longsword

* why not it makes sense

* do_after

* god I hate this bullshit

* other lewc stuff

* push

* heretic id card fix

* she tg on my ui till I css

* yes

* spent

* fix / ipc buff (real)™️

* moderate again

* revert

* no reserve

* bringing up to master

* update map files to master

* didnt replace centcomm

* beginning some rebalancing

* aggressive spread tweaks

* lots of tweaks and fixes

* trying to un-key the maps

* maybe this time

* this time????

* oops

* sql fix

* basicmob conversion

* paintings! and a critical influence fix

* rust + tweaks

* monster tweak

* small change

* removing this

* more tweaks. no more dusting

* added some examine_more

* flower seeds

* various tweaks. more to come

* no more conduit spacing

* fixed some dumb stuff

* silly stuff

* its always prettier

* bugfixes and linters

* linters, wow

* oops

* bah

* linter

* fuck you

* temp check

* hidden influence drain

* influence visible message

* tweak fix

* void cloak bugfix

* small fixes

* fixes

* do_after_once broken

* fixes and tweaks

* heretic blade potential fix + sacrifice changes

* batch of fixes

* tiny tweak

* rebuilt TGUI

* no greentext + rerolls

* logging + bugfix

* unused var

* small fix

* various fixes

* comment

* projectile change

* tgui rebuild

* tgui bundle redo

* rune issue solved

* influence visible now

* fix ui reloading

* new moon ascension + fixes + icons

* tweaks, species sprites

* tgui rebuild

* small tweak + linter

* harvester icon tweak

* spans

* fixes and tweaks

* caretaker nerf + tweaks

* potential fix for knowledge

* roller fix

* mad mask

* Update tgui.bundle.js

* void phase tweak

* Update tgui.bundle.js

* misc tweaks

* fix heretic not retargeting correctly with cryo

* simplify logic

* this is better

* lots of fixes and tweaks

* Update tgui.bundle.js

* linter

* linter

* fireshark and greyscale insanity

* fish

* Update tgui.bundle.js

* linter

* linter

* tgui

* no window shopping

* fish fix

* tgui rebundle

* moon smile runtime fix

* various fixes

* sacrifice fixes

* insanity is easier now, madness mask changes.

* bugfixing + teleport change

* linters + tweaks

* Update code/modules/antagonists/heretic/status_effects/mark_effects.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>

* Update code/modules/antagonists/heretic/status_effects/mark_effects.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>

---------

Signed-off-by: Kyani <65205627+EmeraldCandy@users.noreply.github.com>
Co-authored-by: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: Paul <pmerkamp@gmail.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
2026-01-27 20:36:52 +00:00

85 lines
2.5 KiB
Plaintext

/*
* Simple component for something that is able to destroy
* certain effects (such as cult runes) in one attack.
*/
/datum/component/effect_remover
dupe_mode = COMPONENT_DUPE_ALLOWED
/// Line sent to the user on successful removal.
var/success_feedback
/// Line forcesaid by the user on successful removal.
var/success_forcesay
/// Callback invoked with removal is done.
var/datum/callback/on_clear_callback
/// A typecache of all effects we can clear with our item.
var/list/obj/effect/effects_we_clear
/// If above 0, how long it takes while standing still to remove the effect.
var/time_to_remove = 0 SECONDS
/datum/component/effect_remover/Initialize(
success_forcesay,
success_feedback,
on_clear_callback,
effects_we_clear,
time_to_remove,
)
. = ..()
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE
if(!effects_we_clear)
stack_trace("[type] was instantiated without any valid removable effects!")
return COMPONENT_INCOMPATIBLE
src.success_feedback = success_feedback
src.success_forcesay = success_forcesay
src.on_clear_callback = on_clear_callback
src.effects_we_clear = typecacheof(effects_we_clear)
src.time_to_remove = time_to_remove
/datum/component/effect_remover/Destroy(force)
on_clear_callback = null
return ..()
/datum/component/effect_remover/RegisterWithParent()
RegisterSignal(parent, COMSIG_INTERACTING, PROC_REF(try_remove_effect))
/datum/component/effect_remover/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_INTERACTING)
/*
* Signal proc for [COMSIG_ITEM_INTERACTING_WITH_ATOM].
*/
/datum/component/effect_remover/proc/try_remove_effect(datum/source, mob/user, atom/target)
SIGNAL_HANDLER
if(!isliving(user))
return NONE
if(is_type_in_typecache(target, effects_we_clear)) // Make sure we get all subtypes and everything
INVOKE_ASYNC(src, PROC_REF(do_remove_effect), target, user)
return ITEM_INTERACT_COMPLETE
/*
* Actually removes the effect, invoking our on_clear_callback before it's deleted.
*/
/datum/component/effect_remover/proc/do_remove_effect(obj/effect/target, mob/living/user)
if(time_to_remove && !do_after(user, time_to_remove, target = target))
return
var/obj/item/item_parent = parent
if(success_forcesay)
user.say(success_forcesay)
if(success_feedback)
var/real_feedback = replacetext(success_feedback, "%THEEFFECT", "\the [target]")
real_feedback = replacetext(real_feedback, "%THEWEAPON", "\the [item_parent]")
to_chat(user, real_feedback)
on_clear_callback?.Invoke(target, user)
if(!QDELETED(target))
qdel(target)