From be39ae62535be5102743eaa184604791a62eeb76 Mon Sep 17 00:00:00 2001 From: Alan Date: Fri, 17 Jul 2026 02:14:45 -0400 Subject: [PATCH] Add IPC knockout chem and hunger hallucination. (#32177) * Add IPC knockout chem and hunger hallucination. * Apply suggestions from CRUNCH review Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> Signed-off-by: Alan --------- Signed-off-by: Alan Co-authored-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com> --- code/__DEFINES/mob_defines.dm | 10 +++++ code/modules/hallucinations/effects/minor.dm | 24 +++++++++++ code/modules/hallucinations/hallucinations.dm | 3 +- .../mob/living/carbon/human/human_life.dm | 3 ++ code/modules/mob/mob_vars.dm | 2 + .../reagents/chemistry/reagents/toxins.dm | 43 +++++++++++++++++++ .../chemistry/recipes/toxins_reactions.dm | 8 ++++ strings/chemistry_tools.json | 3 +- 8 files changed, 94 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/mob_defines.dm b/code/__DEFINES/mob_defines.dm index a7e2513ad5b..03ffda10681 100644 --- a/code/__DEFINES/mob_defines.dm +++ b/code/__DEFINES/mob_defines.dm @@ -327,6 +327,16 @@ #define HEALTH_HUD_OVERRIDE_CRIT 1 #define HEALTH_HUD_OVERRIDE_DEAD 2 #define HEALTH_HUD_OVERRIDE_HEALTHY 3 + +// Defines icon states used in `/mob/living/carbon/human/proc/handle_nutrition_alerts` to override nutrition status. +#define NUTRITION_HUD_OVERRIDE_NONE null +#define NUTRITION_HUD_OVERRIDE_FAT "fat" +#define NUTRITION_HUD_OVERRIDE_FULL "full" +#define NUTRITION_HUD_OVERRIDE_WELL_FED "well_fed" +#define NUTRITION_HUD_OVERRIDE_FED "fed" +#define NUTRITION_HUD_OVERRIDE_HUNGRY "hungry" +#define NUTRITION_HUD_OVERRIDE_STARVING "starving" + // Eye protection #define FLASH_PROTECTION_VERYVUNERABLE -4 #define FLASH_PROTECTION_EXTRA_SENSITIVE -2 diff --git a/code/modules/hallucinations/effects/minor.dm b/code/modules/hallucinations/effects/minor.dm index d0f0b3bdd81..4af8547be85 100644 --- a/code/modules/hallucinations/effects/minor.dm +++ b/code/modules/hallucinations/effects/minor.dm @@ -196,6 +196,30 @@ target?.update_health_hud() return ..() +/** + * # Hallucination - Fake Hunger + * + * Visually changes the target's nutrition status to something it shouldn't be. + */ +/obj/effect/hallucination/fake_nutrition + duration = list(10 SECONDS, 25 SECONDS) + +/obj/effect/hallucination/fake_nutrition/Initialize(mapload, mob/living/carbon/human/target) + . = ..() + if(target.nutrition > NUTRITION_LEVEL_FED) + target.nutrition_hud_override = pick(NUTRITION_HUD_OVERRIDE_HUNGRY, NUTRITION_HUD_OVERRIDE_STARVING) + else + target.nutrition_hud_override = pick(NUTRITION_HUD_OVERRIDE_FAT, NUTRITION_HUD_OVERRIDE_FULL) // You think you're full, but you're not. + if(istype(target)) + target.handle_nutrition_alerts() + +/obj/effect/hallucination/fake_nutrition/Destroy() + target?.nutrition_hud_override = NUTRITION_HUD_OVERRIDE_NONE + if(ishuman(target)) + var/mob/living/carbon/human/human_target = target + human_target?.handle_nutrition_alerts() + return ..() + /** * # Hallucination - Examine Hallucination * diff --git a/code/modules/hallucinations/hallucinations.dm b/code/modules/hallucinations/hallucinations.dm index 8498463ad43..8646a4993a4 100644 --- a/code/modules/hallucinations/hallucinations.dm +++ b/code/modules/hallucinations/hallucinations.dm @@ -2,7 +2,8 @@ GLOBAL_LIST_INIT(hallucinations, alist( HALLUCINATE_MINOR = list( /obj/effect/hallucination/bolts = 10, /obj/effect/hallucination/fake_danger = 10, - /obj/effect/hallucination/fake_health = 15, + /obj/effect/hallucination/fake_health = 10, + /obj/effect/hallucination/fake_nutrition = 10, /obj/effect/hallucination/speech = 15, /obj/effect/hallucination/audio/localized = 25, /obj/effect/hallucination/trait_applier/medical_machinery = 25, diff --git a/code/modules/mob/living/carbon/human/human_life.dm b/code/modules/mob/living/carbon/human/human_life.dm index 5215b3638d2..d330b0fa6eb 100644 --- a/code/modules/mob/living/carbon/human/human_life.dm +++ b/code/modules/mob/living/carbon/human/human_life.dm @@ -782,6 +782,9 @@ nutrition_display.icon_state = null return nutrition_display.icon = dna.species.hunger_icon + if(nutrition_hud_override) + nutrition_display.icon_state = nutrition_hud_override + return switch(nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) nutrition_display.icon_state = "fat" diff --git a/code/modules/mob/mob_vars.dm b/code/modules/mob/mob_vars.dm index 059f57e9118..8dcc3c7b4a8 100644 --- a/code/modules/mob/mob_vars.dm +++ b/code/modules/mob/mob_vars.dm @@ -205,6 +205,8 @@ /// Overrides the health HUD element state if set. var/health_hud_override = HEALTH_HUD_OVERRIDE_NONE + /// Overrides the nutrition HUD element state if set. + var/nutrition_hud_override = NUTRITION_HUD_OVERRIDE_NONE /// A soft reference to the location where this mob's runechat message will appear. Uses `UID()`. var/runechat_msg_location /// The datum receiving keyboard input. parent mob by default. diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 1ae4c923a16..b92e8ac5ec9 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -956,6 +956,49 @@ M.Paralyse(50 SECONDS) return ..() | update_flags +/datum/reagent/frigidi + name = "Frigidi" + id = "frigidi" + description = "Budget industrial coolant appropriate for large spacecraft and detrimental to smaller machines. May cause microbattery damage." + reagent_state = LIQUID + color = "#444E90" + metabolization_rate = 0.8 + penetrates_skin = TRUE + process_flags = ORGANIC | SYNTHETIC + taste_mult = 0 + +/datum/reagent/frigidi/on_mob_life(mob/living/M) + if(!ismachineperson(M)) + var/update_flags = STATUS_UPDATE_NONE | M.adjustFireLoss(1 * REAGENTS_EFFECT_MULTIPLIER, FALSE) + return ..() | update_flags + var/mob/living/carbon/human/target = M + switch(current_cycle) + if(1 to 5) + if(M.nutrition > NUTRITION_LEVEL_HUNGRY) + M.nutrition_hud_override = NUTRITION_HUD_OVERRIDE_HUNGRY + target.handle_nutrition_alerts() + if(6 to 9) + M.AdjustEyeBlurry(10 SECONDS) + M.nutrition_hud_override = NUTRITION_HUD_OVERRIDE_STARVING + target.handle_nutrition_alerts() + if(10) + M.emote("faint") + M.Weaken(10 SECONDS) + if(11 to INFINITY) + M.Paralyse(50 SECONDS) + if(prob(10)) + var/obj/item/organ/internal/cell/microbattery = M.get_organ_slot("heart") + if(istype(microbattery)) + microbattery.receive_damage(2, TRUE) + var/update_flags = STATUS_UPDATE_NONE + return ..() | update_flags + +/datum/reagent/frigidi/on_mob_delete(mob/living/M) + if(ismachineperson(M)) + var/mob/living/carbon/human/target = M + M.nutrition_hud_override = NUTRITION_HUD_OVERRIDE_NONE + target.handle_nutrition_alerts() + /datum/reagent/sulfonal name = "Sulfonal" id = "sulfonal" diff --git a/code/modules/reagents/chemistry/recipes/toxins_reactions.dm b/code/modules/reagents/chemistry/recipes/toxins_reactions.dm index d333e6aa7dd..b96b307a011 100644 --- a/code/modules/reagents/chemistry/recipes/toxins_reactions.dm +++ b/code/modules/reagents/chemistry/recipes/toxins_reactions.dm @@ -177,3 +177,11 @@ required_reagents = list("lsd" = 1, "teslium" = 1, "methamphetamine" = 1) result_amount = 3 mix_message = SPAN_DANGER("After sparks, fire, and the smell of LSD, the mix is constantly spinning with no stop in sight.") + +/datum/chemical_reaction/frigidi + name = "Frigidi" + id = "frigidi" + result = "frigidi" + required_reagents = list("cryostylane" = 1, "w33d" = 1, "lube" = 1) + result_amount = 3 + mix_message = "The mixture makes the container cool to the touch." diff --git a/strings/chemistry_tools.json b/strings/chemistry_tools.json index f2ce0773bf0..b61dccc5c8e 100644 --- a/strings/chemistry_tools.json +++ b/strings/chemistry_tools.json @@ -469,6 +469,7 @@ "concentrated_initro", "heartworms", "bacon_grease", - "lexorin" + "lexorin", + "frigidi" ] }