Merge pull request #7931 from Citadel-Station-13/souldeath_neck

Donator Item - Soul Necklace
This commit is contained in:
deathride58
2019-01-14 22:00:33 -05:00
committed by GitHub
9 changed files with 73 additions and 1 deletions
@@ -0,0 +1,35 @@
/datum/component/souldeath
var/mob/living/wearer
var/equip_slot
var/signal = FALSE
/datum/component/souldeath/Initialize()
if(!isitem(parent))
return COMPONENT_INCOMPATIBLE
RegisterSignal(parent, COMSIG_ITEM_EQUIPPED, .proc/equip)
RegisterSignal(parent, COMSIG_ITEM_DROPPED, .proc/unequip)
/datum/component/souldeath/proc/equip(datum/source, mob/living/equipper, slot)
if(!slot || equip_slot == slot)
wearer = equipper
RegisterSignal(wearer, COMSIG_MOB_DEATH, .proc/die, TRUE)
signal = TRUE
else
if(signal)
UnregisterSignal(wearer, COMSIG_MOB_DEATH)
signal = FALSE
return
/datum/component/souldeath/proc/unequip()
UnregisterSignal(wearer, COMSIG_MOB_DEATH)
wearer = null
signal = FALSE
/datum/component/souldeath/proc/die()
if(!wearer)
return //idfk
new/obj/effect/temp_visual/souldeath(wearer.loc, wearer)
playsound(wearer, 'modular_citadel/sound/misc/souldeath.ogg', 100, FALSE)
/datum/component/souldeath/neck
equip_slot = SLOT_NECK
@@ -0,0 +1,5 @@
/obj/effect/temp_visual/souldeath
name = "soul death"
icon = 'modular_citadel/icons/effects/souldeath.dmi'
icon_state = "souldeath"
duration = 30
@@ -361,4 +361,10 @@ datum/gear/darksabresheath
name = "Mime's Overalls"
category = SLOT_WEAR_SUIT
path = /obj/item/clothing/under/mimeoveralls
ckeywhitelist = list("pireamaineach")
ckeywhitelist = list("pireamaineach")
/datum/gear/soulneck
name = "Soul Necklace"
category = SLOT_IN_BACKPACK
path = /obj/item/clothing/neck/undertale
ckeywhitelist = list("twilightic")
@@ -0,0 +1,23 @@
/datum/action/item_action/zanderlocket
name = "Activate the locket"
/obj/item/clothing/neck/undertale
name = "Sylphaen Heart Locket"
desc = "A heart shaped locket...The name: 'Zander Sylphaen is inscribed on the front. Something about this necklace fills you with determination."
icon = 'modular_citadel/icons/obj/clothing/cit_neck.dmi'
item_state = "undertale"
icon_state = "undertale"
alternate_worn_icon = 'modular_citadel/icons/mob/clothing/necks.dmi'
resistance_flags = FIRE_PROOF
actions_types = list(/datum/action/item_action/zanderlocket)
var/toggled = FALSE
var/obj/effect/heart/heart
/datum/action/item_action/zanderlocket/Trigger()
new/obj/effect/temp_visual/souldeath(owner.loc, owner)
playsound(owner, 'modular_citadel/sound/misc/souldeath.ogg', 100, FALSE)
/obj/item/clothing/neck/undertale/Initialize()
..()
AddComponent(/datum/component/souldeath/neck)