diff --git a/code/modules/antagonists/nightmare/nightmare_equipment.dm b/code/modules/antagonists/nightmare/nightmare_equipment.dm index 530f39bea62..965b95ca6e8 100644 --- a/code/modules/antagonists/nightmare/nightmare_equipment.dm +++ b/code/modules/antagonists/nightmare/nightmare_equipment.dm @@ -18,6 +18,10 @@ hitsound = 'sound/weapons/bladeslice.ogg' wound_bonus = -30 bare_wound_bonus = 20 + ///If this is true, our next hit will be critcal, temporarily stunning our target + var/has_crit = FALSE + ///The timer which controls our next crit + var/crit_timer /obj/item/light_eater/Initialize(mapload) . = ..() @@ -27,3 +31,55 @@ effectiveness = 70, \ ) AddComponent(/datum/component/light_eater) + +/obj/item/light_eater/equipped(mob/user, slot, initial = FALSE) + . = ..() + if(!user?.mind?.has_antag_datum(/datum/antagonist/nightmare)) + return + RegisterSignal(user, COMSIG_MOB_ENTER_JAUNT, PROC_REF(prepare_crit_timer)) + RegisterSignal(user, COMSIG_MOB_AFTER_EXIT_JAUNT, PROC_REF(stop_crit_timer)) + +/obj/item/light_eater/dropped(mob/user, silent = FALSE) + . = ..() + if(!user?.mind?.has_antag_datum(/datum/antagonist/nightmare)) + return + UnregisterSignal(user, COMSIG_MOB_ENTER_JAUNT) + UnregisterSignal(user, COMSIG_MOB_AFTER_EXIT_JAUNT) + remove_crit() + +/obj/item/light_eater/attack(mob/living/target, mob/living/user, params) + . = ..() + if(!has_crit) + return + playsound(target, 'sound/effects/wounds/crackandbleed.ogg', 100, TRUE) + var/datum/dna/target_dna = target.has_dna() + if(target.stat == DEAD) + user.visible_message(span_warning("[user] gores [target] with [src]!"), span_warning("You gore [target] with [src], which doesn't accomplish much, but it does make you feel a little better.")) + else if(!target_dna?.check_mutation(/datum/mutation/human/hulk) && (iscarbon(target) || issilicon(target))) + user.visible_message(span_boldwarning("[user] gores [target] with [src], bringing them to a halt!"), span_userdanger("You gore [target] with [src], bringing them to a halt!")) + target.Paralyze(issilicon(target) ? 2 SECONDS : 1 SECONDS) + else + user.visible_message(span_boldwarning("[user] gores [target] with [src], ripping into them!"), span_userdanger("You gore [target] with [src], ripping into them!")) + target.apply_damage(damage = force, forced = TRUE) + remove_crit() + +/obj/item/light_eater/proc/prepare_crit_timer() + crit_timer = addtimer(CALLBACK(src, PROC_REF(add_crit)), 15 SECONDS, TIMER_DELETE_ME | TIMER_STOPPABLE) + +/obj/item/light_eater/proc/stop_crit_timer() + deltimer(crit_timer) + +/obj/item/light_eater/proc/add_crit() + if(has_crit) + return + has_crit = TRUE + add_filter("crit_glow", 3, list("type" = "outline", "color" = "#ff330030", "size" = 5)) + if(ismob(loc)) + loc.balloon_alert(loc, "critical strike ready") + +/obj/item/light_eater/proc/remove_crit() + if(!has_crit) + return + has_crit = FALSE + remove_filter("crit_glow") + stop_crit_timer() diff --git a/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx b/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx index dd3729477d8..2552bf4b86e 100644 --- a/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx +++ b/tgui/packages/tgui/interfaces/AntagInfoNightmare.tsx @@ -11,7 +11,7 @@ const noticestyle = { export const AntagInfoNightmare = (props) => { return ( - + @@ -63,7 +63,8 @@ export const AntagInfoNightmare = (props) => { Your twisted appendage. It will consume the light of what it - touches, be it victim or object. + touches, be it victim or object. After 15 seconds of being in + jaunt, stabbing a foe will stun them or do extra damage.