Files
Bubberstation/code/game/objects/items/drug_items.dm
necromanceranne f5099185c8 Adds a new INHALE reagent transfer method and applies it to smoking and smoke inhalation. Nitrous oxide (the reagent version) inhalation causes brain damage. (#87306)
## About The Pull Request

Adds the ``INHALE`` transfer method. Smoking and smoke exposure now uses
this method.

Makes a few sensible inhalation effects for current behaviours.

Adds a unit test amongst the rest of the exposure method tests.

Nitrous oxide does brain damage on inhalation based on volume inhaled.

## Why It's Good For The Game

Smoke and smoking being based on ingestion rather than inhaling was
always weird to me. It'd be nice to have a specific method for smoking
instead of a method shared by drinking. Many of our smokables make sense
as indigestibles, obviously, but maybe we'd like a chem you can ONLY
smoke.

~~Also, I walked out of a job interview and up the street to see a guy
throwing his empty nitrous canisters around and yelling at passerbys, so
shout out to that fucking guy with this PR.~~

## Changelog
🆑
code: Introduces a INHALE method for reagent transfer. Cigarettes and
smoke reactions use this new method.
balance: Nitrous oxide now brain damage if you inhale it. So don't do
that.
/🆑

---------

Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-10-30 12:24:43 +00:00

84 lines
3.2 KiB
Plaintext

/obj/item/food/drug
name = "generic drug"
desc = "I am error"
icon = 'icons/obj/medical/drugs.dmi'
foodtypes = GROSS
food_flags = FOOD_FINGER_FOOD
max_volume = 50
eat_time = 1 SECONDS
tastes = list("drugs" = 2, "chemicals" = 1)
eatverbs = list("gnaw" = 1)
bite_consumption = 10
w_class = WEIGHT_CLASS_TINY
preserved_food = TRUE
/obj/item/food/drug/saturnx
name = "saturnX glob"
desc = "A congealed glob of pure saturnX.\nThis compound was first discovered during the infancy of cloaking technology and at the time thought to be a promising candidate agent. It was withdrawn for consideration after the researchers discovered a slew of associated safety issues including thought disorders and hepatoxicity.\nIt has since attained some limited popularity as a street drug."
icon_state = "saturnx_glob" //tell kryson to sprite two more variants in the future.
food_reagents = list(/datum/reagent/drug/saturnx = 10)
/obj/item/food/drug/saturnx/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)
/obj/item/food/drug/moon_rock
name = "moon rock"
desc = "A small hard lump of kronkaine freebase.\nIt is said the average kronkaine addict causes as much criminal damage as four cat burglars, two arsonists and one rabid pit bull terrier combined."
icon_state = "moon_rock1"
food_reagents = list(/datum/reagent/drug/kronkaine = 10)
/obj/item/food/drug/moon_rock/Initialize(mapload)
. = ..()
icon_state = pick("moon_rock1", "moon_rock2", "moon_rock3")
AddElement(/datum/element/swabable, CELL_LINE_TABLE_MOONICORN, CELL_VIRUS_TABLE_GENERIC_MOB, 1, 5)
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)
/obj/item/reagent_containers/cup/blastoff_ampoule
name = "bLaSToFF ampoule" //stylized name
desc = "A small ampoule. The liquid inside appears to be boiling violently.\nYou suspect it contains bLasSToFF; the drug thought to be the cause of the infamous Luna nightclub mass casualty incident."
icon = 'icons/obj/medical/drugs.dmi'
icon_state = "blastoff_ampoule"
base_icon_state = "blastoff_ampoule"
volume = 20
reagent_flags = TRANSPARENT
spillable = FALSE
list_reagents = list(/datum/reagent/drug/blastoff = 10)
reagent_consumption_method = INHALE
consumption_sound = 'sound/effects/spray2.ogg'
/obj/item/reagent_containers/cup/blastoff_ampoule/update_icon_state()
. = ..()
if(!reagents.total_volume)
icon_state = "[base_icon_state]_empty"
else if(spillable)
icon_state = "[base_icon_state]_open"
else
icon_state = base_icon_state
/obj/item/reagent_containers/cup/blastoff_ampoule/attack_self(mob/user)
if(!user.can_perform_action(src, NEED_DEXTERITY) || spillable)
return ..()
reagent_flags |= OPENCONTAINER
spillable = TRUE
playsound(src, 'sound/items/ampoule_snap.ogg', 40)
update_appearance()
/obj/item/reagent_containers/cup/blastoff_ampoule/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..()
if(.)
return
if(QDELING(src) || !hit_atom) //Invalid loc
return
var/obj/item/shard/ampoule_shard = new(drop_location())
playsound(src, SFX_SHATTER, 40, TRUE)
transfer_fingerprints_to(ampoule_shard)
spillable = TRUE
SplashReagents(hit_atom, TRUE)
qdel(src)
hit_atom.Bumped(ampoule_shard)
/obj/item/reagent_containers/cup/blastoff_ampoule/Initialize(mapload, vol)
. = ..()
ADD_TRAIT(src, TRAIT_CONTRABAND, INNATE_TRAIT)