From c1e832760bbeb769512fbb14d8fe55c7fa63e702 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 8 Nov 2021 21:46:46 -0600 Subject: [PATCH] Add smoking quirk realism (#62662) --- code/__DEFINES/traits.dm | 1 + code/_globalvars/traits.dm | 1 + code/datums/quirks/negative.dm | 6 ++++++ code/game/objects/items/cigs_lighters.dm | 12 ++++++++---- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index e424326d7bf..e24091226e1 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -499,6 +499,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_INTROVERT "introvert" #define TRAIT_ANXIOUS "anxious" #define TRAIT_INSANITY "insanity" +#define TRAIT_SMOKER "smoker" /// Gives you the Shifty Eyes quirk, rarely making people who examine you think you examined them back even when you didn't #define TRAIT_SHIFTY_EYES "shifty_eyes" diff --git a/code/_globalvars/traits.dm b/code/_globalvars/traits.dm index 451ef8be5be..152e024ac22 100644 --- a/code/_globalvars/traits.dm +++ b/code/_globalvars/traits.dm @@ -152,6 +152,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_PHOTOGRAPHER" = TRAIT_PHOTOGRAPHER, "TRAIT_MUSICIAN" = TRAIT_MUSICIAN, "TRAIT_LIGHT_DRINKER" = TRAIT_LIGHT_DRINKER, + "TRAIT_SMOKER" = TRAIT_SMOKER, "TRAIT_EMPATH" = TRAIT_EMPATH, "TRAIT_FRIENDLY" = TRAIT_FRIENDLY, "TRAIT_GRABWEAKNESS" = TRAIT_GRABWEAKNESS, diff --git a/code/datums/quirks/negative.dm b/code/datums/quirks/negative.dm index 36bf5a68674..85b931bad02 100644 --- a/code/datums/quirks/negative.dm +++ b/code/datums/quirks/negative.dm @@ -715,6 +715,7 @@ medical_record_text = "Patient is a current smoker." reagent_type = /datum/reagent/drug/nicotine accessory_type = /obj/item/lighter/greyscale + mob_trait = TRAIT_SMOKER hardcore_value = 1 drug_flavour_text = "Make sure you get your favorite brand when you run out." @@ -732,6 +733,11 @@ . = ..() var/brand = initial(drug_container_type.name) quirk_holder.mind.add_memory(MEMORY_QUIRK_DRUG, list(DETAIL_FAV_BRAND = brand), memory_flags = MEMORY_FLAG_NOLOCATION | MEMORY_FLAG_NOPERSISTENCE, story_value = STORY_VALUE_SHIT) + // smoker lungs have 25% less health and healing + var/obj/item/organ/lungs/smoker_lungs = quirk_holder.getorganslot(ORGAN_SLOT_LUNGS) + if (smoker_lungs && !(smoker_lungs.organ_flags & ORGAN_SYNTHETIC)) // robotic lungs aren't affected + smoker_lungs.maxHealth = smoker_lungs.maxHealth * 0.75 + smoker_lungs.healing_factor = smoker_lungs.healing_factor * 0.75 /datum/quirk/item_quirk/junkie/smoker/process(delta_time) . = ..() diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm index a59bb30ebd4..feb91a5aafb 100644 --- a/code/game/objects/items/cigs_lighters.dm +++ b/code/game/objects/items/cigs_lighters.dm @@ -286,11 +286,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM reagents.expose(smoker, INGEST, min(to_smoke / reagents.total_volume, 1)) var/obj/item/organ/lungs/lungs = smoker.getorganslot(ORGAN_SLOT_LUNGS) if(lungs && !(lungs.organ_flags & ORGAN_SYNTHETIC)) - smoker.adjustOrganLoss(ORGAN_SLOT_LUNGS, lung_harm) + var/smoker_resistance = HAS_TRAIT(smoker, TRAIT_SMOKER) ? 0.5 : 1 + smoker.adjustOrganLoss(ORGAN_SLOT_LUNGS, lung_harm*smoker_resistance) if(!reagents.trans_to(smoker, to_smoke, methods = INGEST, ignore_stomach = TRUE)) reagents.remove_any(to_smoke) - /obj/item/clothing/mask/cigarette/process(delta_time) var/turf/location = get_turf(src) var/mob/living/M = loc @@ -383,14 +383,17 @@ CIGARETTE PACKETS ARE IN FANCY.DM chem_volume = 60 smoketime = 2 MINUTES smoke_all = TRUE + lung_harm = 1.5 list_reagents = list(/datum/reagent/drug/nicotine = 10, /datum/reagent/medicine/omnizine = 15) /obj/item/clothing/mask/cigarette/shadyjims desc = "A Shady Jim's Super Slims cigarette." + lung_harm = 1.5 list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/toxin/lipolicide = 4, /datum/reagent/ammonia = 2, /datum/reagent/toxin/plantbgone = 1, /datum/reagent/toxin = 1.5) /obj/item/clothing/mask/cigarette/xeno desc = "A Xeno Filtered brand cigarette." + lung_harm = 2 list_reagents = list (/datum/reagent/drug/nicotine = 20, /datum/reagent/medicine/regen_jelly = 15, /datum/reagent/drug/krokodil = 4) // Rollies. @@ -477,6 +480,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_state = "candyoff" type_butt = /obj/item/food/candy_trash heat = 473.15 // Lowered so that the sugar can be carmalized, but not burnt. + lung_harm = 0.5 list_reagents = list(/datum/reagent/consumable/sugar = 20) /obj/item/clothing/mask/cigarette/candy/nicotine @@ -529,8 +533,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_on = "cigar2on" icon_off = "cigar2off" smoketime = 30 MINUTES - chem_volume = 50 - list_reagents =list(/datum/reagent/drug/nicotine = 15) + chem_volume = 60 + list_reagents =list(/datum/reagent/drug/nicotine = 45) /obj/item/cigbutt name = "cigarette butt"