Files
Bubberstation/code/datums/components/soul_stealer.dm
T
1eab5a8364 [MIRROR] Heretics cannot be converted, and are immune to cult stun hands. Instead, the cult is rewarded for sacrificing them with the bloody bastard sword, an oversized SPIN2WIN funblade. + Soul Stealing Fantasy Affix [MDB IGNORE] (#16486)
* Heretics cannot be converted, and are immune to cult stun hands. Instead, the cult is rewarded for sacrificing them with the bloody bastard sword, an oversized SPIN2WIN funblade. + Soul Stealing Fantasy Affix (#69725)

About The Pull Request

Heretics can no longer be converted to a cult, as they follow their own Forgotten Gods.
Instead, Nar'Sie will reward the cult for managing to sacrifice one, with the bastard sword.
The bloody bastard sword has been cleaned up codewise and all that. Because it is a free reward instead of a (removed) progression mechanic of cult, it swings just a bit slower during the spin and doesn't have a jaunt. It's still a !fun! swinging sword of hilarity and death.
BLOODY BASTARD https://www.youtube.com/watch?v=ukznXQ3MgN0
Fantasy weapons can now roll "soul-stealing" weapons. They, on killing something, capture its soul inside the item.

    Add fail conditions that instantly end a spin2win, ala how

    Mimes can now hold a baguette like a sword by right clicking it #69592 works

Why It's Good For The Game

Bloody bastard sword was fun, it made no sense that heretics were valid converts when they're already worshipping a DIFFERENT evil god granting them powers. Should be in a good spot as a nice little antag to antag special interaction. I fucking love antag to antag special interactions, we should have more of 'em

Fantasy affixes are always a neat thing to throw a new component into
Changelog

cl
add: Heretics can no longer be converted to cult. But sacrificing them is very valuable to Nar'Sie, and she will grant special weapons if you manage to do so.
add: Fantasy affixes can also include soul-stealing items!
/cl

* Heretics cannot be converted, and are immune to cult stun hands. Instead, the cult is rewarded for sacrificing them with the bloody bastard sword, an oversized SPIN2WIN funblade. + Soul Stealing Fantasy Affix

Co-authored-by: tralezab <40974010+tralezab@users.noreply.github.com>
Co-authored-by: Tastyfish <crazychris32@gmail.com>
2022-09-28 11:21:35 +01:00

64 lines
2.3 KiB
Plaintext

/**
* ### Soul Stealer component!
*
* Component that attaches to items, making lethal swings with them steal the victims soul, storing it inside the item.
* Used in the cult bastard sword!
*/
/datum/component/soul_stealer
/// weakref list of soulstones captured by this item.
var/list/weak_souls = list()
/datum/component/soul_stealer/Initialize()
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE
/datum/component/soul_stealer/RegisterWithParent()
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
RegisterSignal(parent, COMSIG_ITEM_AFTERATTACK, .proc/on_afterattack)
/datum/component/soul_stealer/UnregisterFromParent()
UnregisterSignal(parent, list(COMSIG_PARENT_EXAMINE, COMSIG_ITEM_AFTERATTACK))
///signal called on parent being examined
/datum/component/soul_stealer/proc/on_examine(datum/source, mob/user, list/examine_list)
SIGNAL_HANDLER
examine_list += span_notice("It will steal the soul of anyone it defeats in battle.")
//clears out any weakrefs that do not exist anymore
var/list/souls = recursive_list_resolve(weak_souls)
switch(souls.len)
if(0)
examine_list += span_notice("It has not consumed any souls yet.")
if(1 to 9)
examine_list += span_notice("There are <b>[souls.len]</b> souls trapped within it.")
if(10 to INFINITY)
examine_list += span_notice("A staggering <b>[souls.len]</b> souls have been claimed by it! And it hungers for more!")
/datum/component/soul_stealer/proc/on_afterattack(obj/item/source, atom/target, mob/living/user, proximity_flag, click_parameters)
SIGNAL_HANDLER
if(!proximity_flag)
return
if(ishuman(target))
INVOKE_ASYNC(src, .proc/try_capture, target, user)
var/list/souls = recursive_list_resolve(weak_souls)
if(istype(target, /obj/structure/constructshell) && souls.len)
var/obj/item/soulstone/soulstone = souls[1]
INVOKE_ASYNC(soulstone, /obj/item/soulstone/proc/transfer_to_construct, target, user)
///soulstone will be deleted from souls if successful
/datum/component/soul_stealer/proc/try_capture(mob/living/carbon/human/victim, mob/living/captor)
if(victim.stat == CONSCIOUS)
return
var/obj/item/soulstone/soulstone = new /obj/item/soulstone(parent)
soulstone.attack(victim, captor)
if(!LAZYLEN(soulstone.contents))
qdel(soulstone)
return
weak_souls += WEAKREF(soulstone)