diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm index de67e6a8985..c5670e57553 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm @@ -1177,7 +1177,7 @@ /* mental */ -#define MEDICATION_MESSAGE_DELAY 10 MINUTES +#define MEDICATION_MESSAGE_DELAY 10 SECONDS /singleton/reagent/mental name = null //Just like alcohol @@ -1191,9 +1191,29 @@ od_minimum_dose = 0.02 taste_description = "bugs" ingest_mul = 1 - var/alchohol_affected = 1 + /// Imparts hallucination effects scaling with bac. + var/alchohol_affected = TRUE var/messagedelay = MEDICATION_MESSAGE_DELAY - var/list/goodmessage = list() //Fluff messages + /// Generic fluff messages for anyone who takes it. + var/list/goodmessage = list() + /// Species-specific fluff messages- will override the generic version for the given species. See following comment/example for implementation details. + var/list/goodmessage_species + + /** + * We leave goodmessage_species null so no unnecessary checks are performed for most reagents. However, if we want a given reagent to have unique + * messages for consumers of a given species, its value can be set as below within the singleton/reagent/mental: + * + * goodmessage_species = list( + * SPECIES_HUMAN = list("Damn you're high.","You're totally zooted!"), + * SPECIES_HUMAN_OFFWORLD = list("Damn you're WAY higher than normal humans. Like, you might even say outside the gravity well high.", "Zooted bo booted boyyy."), + * SPECIES_UNATHI = list("You feel like shit and want to die.","Why the fuck did you smoke that shitty human stuff."), + * SPECIES_SKRELL = list("Aaaaaaaaaaaa!","Aaaauuuuaaaa!","Waaaoouuuuaaaaahhh!"), + * SPECIES_SKRELL_AXIORI = list("If you weren't axiori you'd probably be having a bad time but you're pretty zooted.") + * ) + * + * No, there's not support right now for things like ALL_DIONA_SPECIES. Once somebody wants to make Vaurca-only drugs, they will probably + * implement support for it out of sheer annoyance though. + */ fallback_specific_heat = 1.5 @@ -1206,15 +1226,36 @@ if(!istype(H) || world.time < holder.reagent_data[type]["last_tick_time"] || messagedelay == -1) return + var/message var/bac = H.get_blood_alcohol() if(alchohol_affected && bac > 0.03) H.hallucination = max(H.hallucination, bac * 400) if(H.chem_doses[type] < overdose && H.shock_stage < 5) //Don't want feel-good messages when we're suffering an OD or particularly hurt/injured - to_chat(H, SPAN_GOOD("[pick(goodmessage)]")) + message = feedback_message(H) + to_chat(H, SPAN_GOOD("[message]")) LAZYSET(holder.reagent_data[type], "last_tick_time", world.time + (messagedelay)) +/** + * Holds logic for returning feedback message strings based on race. + * 'goodmessage' is your generic catch-all list of message strings. + * 'goodmessage_species', if set, will override the 'goodmessage' list only for that species. + */ +/singleton/reagent/mental/proc/feedback_message(var/mob/living/carbon/human/mob) + var/mob_species = mob.get_species() + var/message + + if(length(goodmessage)) + message = pick(goodmessage) + + if(length(goodmessage_species)) + for(var/species in goodmessage_species) + if(mob_species == species) + message = pick(goodmessage_species[species]) + + return message + /singleton/reagent/mental/overdose(var/mob/living/carbon/M, var/alien, var/datum/reagents/holder) M.add_chemical_effect(CE_EMETIC, M.chem_doses[type] / 6) @@ -1400,7 +1441,9 @@ overdose = 5 od_minimum_dose = 3 taste_description = "sugar" - goodmessage = list("You feel pleasantly warm.","You feel like you've been basking in the sun.","You feel focused and warm...") + goodmessage_species = list( + SPECIES_UNATHI = list("You feel pleasantly warm.","You feel like you've been basking in the sun.","You feel focused and warm...") + ) /singleton/reagent/mental/kokoreed/affect_blood(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) . = ..() diff --git a/html/changelogs/Batrachophreno-DrugMessages.yml b/html/changelogs/Batrachophreno-DrugMessages.yml new file mode 100644 index 00000000000..8e08ca3f3e8 --- /dev/null +++ b/html/changelogs/Batrachophreno-DrugMessages.yml @@ -0,0 +1,59 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: Batrachophrenoboocosmomachia + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - code_imp: "Added support for reagent/mental to return different feedback text strings based on species." + - bugfix: "Koko Reed Juice now only returns drug feedback messages to Unathi."