Chem scanning removes achievements from maint pills (#95397)

## About The Pull Request

Chem scanning a maint pill now removes the achievement for eating it.

## Why It's Good For The Game

cheater.

You can still scour maints for pills with stuff you'd like, but you lose
the achievement for doing so.

## Changelog

🆑
fix: Chem scanning a maintenance pill removes the achievement value.
/🆑
This commit is contained in:
John Willard
2026-03-15 12:12:57 +01:00
committed by GitHub
parent 33e951ff92
commit 2eb0776ebe
4 changed files with 35 additions and 4 deletions
@@ -26,3 +26,6 @@
#define COMSIG_LIVING_OPERATING_ON "living_operating_on"
/// Sent from /mob/living/perform_surgery: (mob/living/surgeon, list/possible_operations)
#define COMSIG_ATOM_BEING_OPERATED_ON "atom_being_operated_on"
/// From /obj/item/ph_meter/interact_with_atom(): (atom/source, mob/user)
#define COMSIG_ON_REAGENT_SCAN "on_reagent_scan"
+1
View File
@@ -142,6 +142,7 @@
log_entry.add_data_entry(DETSCAN_CATEGORY_FINGERS, atom_fingerprints.Copy())
// Only get reagents from non-mobs.
SEND_SIGNAL(scanned_atom, COMSIG_ON_REAGENT_SCAN, user)
for(var/datum/reagent/present_reagent as anything in scanned_atom.reagents?.reagent_list)
log_entry.add_data_entry(DETSCAN_CATEGORY_REAGENTS, list(present_reagent.name = present_reagent.volume))
+1
View File
@@ -119,6 +119,7 @@
var/obj/item/reagent_containers/cont = interacting_with
if(!LAZYLEN(cont.reagents.reagent_list))
return NONE
SEND_SIGNAL(interacting_with, COMSIG_ON_REAGENT_SCAN, user)
var/list/out_message = list()
to_chat(user, "<i>The chemistry meter beeps and displays:</i>")
out_message += "<b>Total volume: [round(cont.volume, 0.01)] Current temperature: [round(cont.reagents.chem_temp, 0.1)]K Total pH: [round(cont.reagents.ph, 0.01)]\n"
@@ -355,9 +355,23 @@
icon_state = "pill21"
/// From which randomisation pool to pull reagents from
var/random_reagent_flag = REAGENT_SPAWN_RANDOM_PRODUCERS
var/static/list/names = list("maintenance pill", "floor pill", "mystery pill", "suspicious pill", "strange pill", "lucky pill", "ominous pill", "eerie pill")
var/static/list/descs = list("Your feeling is telling you no, but...","Drugs are expensive, you can't afford not to eat any pills that you find."\
, "Surely, there's no way this could go bad.", "Winners don't do dr- oh what the heck!", "Free pills? At no cost, how could I lose?")
var/static/list/names = list(
"maintenance pill",
"floor pill",
"mystery pill",
"suspicious pill",
"strange pill",
"lucky pill",
"ominous pill",
"eerie pill",
)
var/static/list/descs = list(
"Your feeling is telling you no, but...",
"Drugs are expensive, you can't afford not to eat any pills that you find.",
"Surely, there's no way this could go bad.",
"Winners don't do dr- oh what the heck!",
"Free pills? At no cost, how could I lose?",
)
/obj/item/reagent_containers/applicator/pill/maintenance/Initialize(mapload)
list_reagents = list(get_random_reagent_id(random_reagent_flag) = rand(10,50)) //list_reagents is called before init, because init generates the reagents using list_reagents
@@ -368,10 +382,22 @@
/obj/item/reagent_containers/applicator/pill/maintenance/achievement
random_reagent_flag = REAGENT_SPAWN_MAINTENANCE_PILL //none of that fake shit
///Boolean on whether this will count towards your achievement score if you consume it.
var/count_towards_achievement = TRUE
/obj/item/reagent_containers/applicator/pill/maintenance/achievement/Initialize(mapload)
. = ..()
RegisterSignal(src, COMSIG_ON_REAGENT_SCAN, PROC_REF(on_chemical_scan))
/obj/item/reagent_containers/applicator/pill/maintenance/achievement/on_consumption(mob/consumer, mob/user)
. = ..()
consumer.client?.give_award(/datum/award/score/maintenance_pill, consumer)
if(count_towards_achievement)
consumer.client?.give_award(/datum/award/score/maintenance_pill, consumer)
///called when we are chemically scanned, we no longer grant an achievement.
/obj/item/reagent_containers/applicator/pill/maintenance/achievement/proc/on_chemical_scan(atom/source, mob/user)
SIGNAL_HANDLER
count_towards_achievement = FALSE
/obj/item/reagent_containers/applicator/pill/potassiodide
name = "potassium iodide pill"