diff --git a/code/__DEFINES/dcs/signals/signals_bitrunning.dm b/code/__DEFINES/dcs/signals/signals_bitrunning.dm index 74d418182d5..57bf5af1422 100644 --- a/code/__DEFINES/dcs/signals/signals_bitrunning.dm +++ b/code/__DEFINES/dcs/signals/signals_bitrunning.dm @@ -4,6 +4,9 @@ /// from /obj/effect/bitrunning/loot_signal: (points) #define COMSIG_BITRUNNER_GOAL_POINT "bitrunner_goal_point" +/// from /obj/item/reagent_containers/pill +#define COMSIG_BITRUNNER_RED_PILL_SEVER "bitrunner_red_pill_sever" + // Netpods /// from /obj/machinery/netpod/sever_connection() diff --git a/code/modules/bitrunning/components/avatar_connection.dm b/code/modules/bitrunning/components/avatar_connection.dm index 129ef63423a..7f1eed97baa 100644 --- a/code/modules/bitrunning/components/avatar_connection.dm +++ b/code/modules/bitrunning/components/avatar_connection.dm @@ -82,7 +82,7 @@ * - Mailed in a cache * - Click / Stand on the ladder */ - RegisterSignals(parent, list(COMSIG_BITRUNNER_ALERT_SEVER, COMSIG_BITRUNNER_CACHE_SEVER, COMSIG_BITRUNNER_LADDER_SEVER), PROC_REF(on_safe_disconnect)) + RegisterSignals(parent, list(COMSIG_BITRUNNER_ALERT_SEVER, COMSIG_BITRUNNER_CACHE_SEVER, COMSIG_BITRUNNER_LADDER_SEVER, COMSIG_BITRUNNER_RED_PILL_SEVER), PROC_REF(on_safe_disconnect)) RegisterSignal(parent, COMSIG_LIVING_DEATH, PROC_REF(on_sever_connection)) RegisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE, PROC_REF(on_linked_damage)) @@ -91,6 +91,7 @@ UnregisterSignal(parent, COMSIG_BITRUNNER_ALERT_SEVER) UnregisterSignal(parent, COMSIG_BITRUNNER_CACHE_SEVER) UnregisterSignal(parent, COMSIG_BITRUNNER_LADDER_SEVER) + UnregisterSignal(parent, COMSIG_BITRUNNER_RED_PILL_SEVER) UnregisterSignal(parent, COMSIG_LIVING_DEATH) UnregisterSignal(parent, COMSIG_MOB_APPLY_DAMAGE) diff --git a/code/modules/reagents/reagent_containers/pill.dm b/code/modules/reagents/reagent_containers/pill.dm index 7c7f97f0cc7..3ba094fb781 100644 --- a/code/modules/reagents/reagent_containers/pill.dm +++ b/code/modules/reagents/reagent_containers/pill.dm @@ -47,13 +47,15 @@ return on_consumption(M, user) ///Runs the consumption code, can be overriden for special effects -/obj/item/reagent_containers/pill/proc/on_consumption(mob/M, mob/user) - if(icon_state == "pill4" && prob(5)) //you take the red pill - you stay in Wonderland, and I show you how deep the rabbit hole goes - addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), M, span_notice("[pick(strings(REDPILL_FILE, "redpill_questions"))]")), 50) +/obj/item/reagent_containers/pill/proc/on_consumption(mob/consumer, mob/giver) + if(icon_state == "pill4") //you take the red pill - you stay in Wonderland, and I show you how deep the rabbit hole goes + SEND_SIGNAL(consumer, COMSIG_BITRUNNER_RED_PILL_SEVER) //if your bitrunning avatar somehow manages to acquire and consume a red pill, they will be ejected from the Matrix + if(prob(5)) //the other kind of red pill + addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(to_chat), consumer, span_notice("[pick(strings(REDPILL_FILE, "redpill_questions"))]")), 50) if(apply_type == INGEST) - SEND_SIGNAL(src, COMSIG_PILL_CONSUMED, eater = M, feeder = user) + SEND_SIGNAL(src, COMSIG_PILL_CONSUMED, eater = consumer, feeder = giver) if(reagents.total_volume) - reagents.trans_to(M, reagents.total_volume, transferred_by = user, methods = apply_type) + reagents.trans_to(consumer, reagents.total_volume, transferred_by = giver, methods = apply_type) qdel(src) return TRUE