[MIRROR] Refactors the Light Eater and gives it some flavortext. Some minor behavior changes included. (#3415)

* Refactors the Light Eater and gives it some flavortext. Some minor behavior changes included. (#55551)

Converts the effects of the nightmares light eater into a component and a couple elements
Adds some flavor text to the light eater
Makes the effects of the nightmare's light eater dispel if the armblade is destroyed
Probably a net increase in code quality
More flavortext
The nightmare's light eater effect can be dispelled if you are willing to sacrifice the armblade

* Refactors the Light Eater and gives it some flavortext. Some minor behavior changes included.

Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
This commit is contained in:
SkyratBot
2021-02-16 00:45:39 +00:00
committed by GitHub
co-authored by TemporalOroboros
parent f81de64c5b
commit 63de7b4b0d
24 changed files with 652 additions and 310 deletions
+1 -1
View File
@@ -451,7 +451,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
// afterattack() and attack() prototypes moved to _onclick/item_attack.dm for consistency
/obj/item/proc/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, args)
SEND_SIGNAL(src, COMSIG_ITEM_HIT_REACT, owner, hitby, attack_text, final_block_chance, damage, attack_type)
if(prob(final_block_chance))
owner.visible_message("<span class='danger'>[owner] blocks [attack_text] with [src]!</span>")
return 1
@@ -116,6 +116,7 @@ GLOBAL_LIST_EMPTY(PDAs)
inserted_item = new inserted_item(src)
else
inserted_item = new /obj/item/pen(src)
RegisterSignal(src, COMSIG_LIGHT_EATER_ACT, .proc/on_light_eater)
update_icon()
/obj/item/pda/equipped(mob/user, slot)
@@ -890,6 +891,15 @@ GLOBAL_LIST_EMPTY(PDAs)
var/datum/action/A = X
A.UpdateButtonIcon()
/// Special light eater handling
/obj/item/pda/proc/on_light_eater(obj/item/pda/source, datum/light_eater)
SIGNAL_HANDLER
set_light_on(FALSE)
set_light_range(0) //We won't be turning on again.
update_icon()
visible_message("<span class='danger'>The light in [src] shorts out!</span>")
return COMPONENT_BLOCK_LIGHT_EATER
/obj/item/pda/proc/remove_pen(mob/user)
if(issilicon(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK)) //TK doesn't work even with this removed but here for readability