Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smokers can now pick what they smoke #2964

Merged
merged 10 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions code/_globalvars/lists/flavor_misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@ GLOBAL_LIST_INIT(exowearlist, list(PREF_NOEXOWEAR, PREF_EXOWEAR, PREF_ALTEXOWEAR
#define UPLINK_PEN "Pen" //like a real spy!
GLOBAL_LIST_INIT(uplink_spawn_loc_list, list(UPLINK_PDA, UPLINK_RADIO, UPLINK_PEN))

//favorite cigarette brand
#define PREF_CIG_SPACE "Space Cigarettes"
#define PREF_CIG_DROMEDARY "DromedaryCo Cigarettes"
#define PREF_CIG_UPLIFT "Uplift Smooth Cigarettes"
#define PREF_CIG_ROBUST "Robust Cigarettes"
#define PREF_CIG_ROBUSTGOLD "Robust Gold Cigarettes"
#define PREF_CIG_CARP "Carp Classic Cigarettes"
#define PREF_CIG_MIDORI "Midori Taboko Rollies"
#define PREF_CIGAR "Premium Cigars"
#define PREF_CIGAR_SOLAR "Solarian Cigars"
#define PREF_CIGAR_COHIBA "Cohiba Cigars"
#define PREF_VAPE "Vape Pen"
#define PREF_PIPE "Fancy Pipe"

GLOBAL_LIST_INIT(valid_smoke_types, sortList(list(PREF_CIG_SPACE, PREF_CIG_DROMEDARY, PREF_CIG_UPLIFT, PREF_CIG_ROBUST, PREF_CIG_ROBUSTGOLD, PREF_CIG_CARP, PREF_CIG_MIDORI, PREF_CIGAR, PREF_CIGAR_SOLAR, PREF_CIGAR_COHIBA, PREF_VAPE, PREF_PIPE)))

//Female Uniforms
GLOBAL_LIST_EMPTY(female_clothing_icons)
//Alternate species icons
Expand Down
4 changes: 2 additions & 2 deletions code/controllers/subsystem/traumas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ SUBSYSTEM_DEF(traumas)
/obj/item/clothing/under/rank/command/captain, /obj/item/clothing/under/rank/security/head_of_security,
/obj/item/clothing/under/rank/engineering/chief_engineer, /obj/item/clothing/under/rank/medical/chief_medical_officer,
/obj/item/clothing/under/rank/command/head_of_personnel, /obj/item/clothing/under/rank/rnd/research_director,
/obj/item/clothing/under/rank/security/head_of_security/alt,//WS Edit - Better security jumpsuit sprites
/obj/item/clothing/under/rank/security/head_of_security/alt,
/obj/item/clothing/under/rank/rnd/research_director/alt, /obj/item/clothing/under/rank/rnd/research_director/turtleneck,
/obj/item/clothing/under/rank/security/head_of_security/parade,
/obj/item/clothing/under/rank/security/head_of_security/parade/female, //WS Edit - Better Command Uniforms
/obj/item/clothing/under/rank/security/head_of_security/parade/female,
/obj/item/clothing/head/helmet/abductor, /obj/item/clothing/suit/armor/abductor/vest, /obj/item/melee/baton/abductor,
/obj/item/storage/belt/military/abductor, /obj/item/gun/energy/alien, /obj/item/abductor/silencer,
/obj/item/abductor/gizmo, /obj/item/clothing/under/rank/centcom/official,
Expand Down
6 changes: 3 additions & 3 deletions code/datums/mood_events/drug_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

/datum/mood_event/smoked
description = "<span class='nicegreen'>I have had a smoke recently.</span>\n"
mood_change = 2
mood_change = 1
timeout = 6 MINUTES

/datum/mood_event/wrong_brand
description = "<span class='warning'>I hate that brand of cigarettes.</span>\n"
mood_change = -2
description = "<span class='warning'>That brand of cigarette just doesn't hit right.</span>\n"
mood_change = -1
timeout = 6 MINUTES

/datum/mood_event/overdose
Expand Down
49 changes: 41 additions & 8 deletions code/datums/traits/negative.dm
Original file line number Diff line number Diff line change
Expand Up @@ -589,24 +589,57 @@
reagent_type = /datum/reagent/drug/nicotine
accessory_type = /obj/item/lighter/greyscale

//I fucking hate prefscode

/datum/quirk/junkie/smoker/on_spawn()
drug_container_type = pick(/obj/item/storage/fancy/cigarettes,
/obj/item/storage/fancy/cigarettes/cigpack_midori,
/obj/item/storage/fancy/cigarettes/cigpack_uplift,
/obj/item/storage/fancy/cigarettes/cigpack_robust,
/obj/item/storage/fancy/cigarettes/cigpack_robustgold,
/obj/item/storage/fancy/cigarettes/cigpack_carp)
var/mob/living/carbon/human/H = quirk_holder
switch (H.client?.prefs.preferred_smoke_brand)
if (PREF_CIG_SPACE)
drug_container_type = /obj/item/storage/fancy/cigarettes
if (PREF_CIG_DROMEDARY)
drug_container_type = /obj/item/storage/fancy/cigarettes/dromedaryco
if (PREF_CIG_UPLIFT)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigpack_uplift
if (PREF_CIG_ROBUST)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigpack_robust
if (PREF_CIG_ROBUSTGOLD)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigpack_robustgold
if (PREF_CIG_CARP)
drug_container_type= /obj/item/storage/fancy/cigarettes/cigpack_carp
if (PREF_CIG_MIDORI)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigpack_midori
if (PREF_CIGAR)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigars
accessory_type = /obj/item/storage/box/matches
if (PREF_CIGAR_SOLAR)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigars/havana
accessory_type = /obj/item/storage/box/matches
if (PREF_CIGAR_COHIBA)
drug_container_type = /obj/item/storage/fancy/cigarettes/cigars/cohiba
accessory_type = /obj/item/storage/box/matches
if (PREF_VAPE)
drug_container_type = /obj/item/clothing/mask/vape
accessory_type = null
if (PREF_PIPE)
drug_container_type = /obj/item/clothing/mask/cigarette/pipe
accessory_type = /obj/item/storage/box/matches
else
CRASH("Someone had an improper cigarette pref on loading")
. = ..()

/datum/quirk/junkie/smoker/announce_drugs()
to_chat(quirk_holder, "<span class='boldnotice'>There is a [initial(drug_container_type.name)] [where_drug], and a lighter [where_accessory]. Make sure you get your favorite brand when you run out.</span>")

if(accessory_type == null)
to_chat(quirk_holder, "<span class='boldnotice'>There is a [initial(drug_container_type.name)] [where_drug], Make sure you get a refill soon.</span>")
return
to_chat(quirk_holder, "<span class='boldnotice'>There is a [initial(drug_container_type.name)] [where_drug], and a [initial(accessory_type.name)] [where_accessory]. Make sure you get your favorite brand when you run out.</span>")

/datum/quirk/junkie/smoker/on_process()
. = ..()
var/mob/living/carbon/human/H = quirk_holder
var/obj/item/I = H.get_item_by_slot(ITEM_SLOT_MASK)
if (istype(I, /obj/item/clothing/mask/cigarette))
if(I == drug_container_type)
return
var/obj/item/storage/fancy/cigarettes/C = drug_container_type
if(istype(I, initial(C.spawn_type)))
SEND_SIGNAL(quirk_holder, COMSIG_CLEAR_MOOD_EVENT, "wrong_cigs")
Expand Down
10 changes: 5 additions & 5 deletions code/game/objects/items/storage/fancy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
////////////
/obj/item/storage/fancy/cigarettes
name = "\improper Space Cigarettes packet"
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
desc = "The most popular brand of cigarettes on the Frontier."
icon = 'icons/obj/cigarettes.dmi'
base_icon_state = "cig"
icon_state = "cig"
Expand Down Expand Up @@ -273,14 +273,14 @@

/obj/item/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
desc = "Since 2313."
desc = "Since 207 FS."
icon_state = "carp"
base_icon_state = "carp"
spawn_type = /obj/item/clothing/mask/cigarette/carp

/obj/item/storage/fancy/cigarettes/cigpack_syndicate
name = "cigarette packet"
desc = "An obscure brand of cigarettes."
desc = "A semi-obscure brand of cigarettes, favored by interstellar miners."
icon_state = "syndie"
base_icon_state = "syndie"
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
Expand Down Expand Up @@ -322,7 +322,7 @@

/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker
name = "\improper Leary's Delight packet"
desc = "Banned in over 36 galaxies."
desc = "Banned in over 36 Sectors."
icon_state = "shadyjim"
base_icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/mindbreaker
Expand Down Expand Up @@ -435,7 +435,7 @@

/obj/item/storage/fancy/cigarettes/cigars/havana
name = "\improper premium Havanian cigar case"
desc = "A case of classy Havanian cigars."
desc = "Even after centuries of Solarian export, Havana smooth is only found in proper terran cigars."
icon_state = "cohibacase"
base_icon_state = "cohibacase"
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
Expand Down
10 changes: 10 additions & 0 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
)
var/fbp = FALSE
var/phobia = "spiders"
var/preferred_smoke_brand = PREF_CIG_SPACE
var/list/alt_titles_preferences = list()
var/list/custom_names = list()
var/preferred_ai_core_display = "Blue"
Expand Down Expand Up @@ -839,6 +840,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)

dat += "<a href='?_src_=prefs;preference=phobia;task=input'>[phobia]</a><BR>"

if("Smoker" in all_quirks)
dat += "<h3>Smoker</h3>"

dat += "<a href='?_src_=prefs;preference=preferred_smoke_brand;task=input'>[preferred_smoke_brand]</a><BR>"

if("body_size" in pref_species.default_features)
if(!mutant_category)
dat += APPEARANCE_CATEGORY_COLUMN
Expand Down Expand Up @@ -2078,6 +2084,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/phobiaType = input(user, "What are you scared of?", "Character Preference", phobia) as null|anything in SStraumas.phobia_types
if(phobiaType)
phobia = phobiaType
if("preferred_smoke_brand")
var/smokeBrand = input(user, "What cigarettes are your favorite?", "Character Preference", preferred_smoke_brand) as null|anything in GLOB.valid_smoke_types
if(smokeBrand)
preferred_smoke_brand = smokeBrand

if("generic_adjective")
var/selectAdj
Expand Down
2 changes: 2 additions & 0 deletions code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
READ_FILE(S["jumpsuit_style"], jumpsuit_style)
READ_FILE(S["uplink_loc"], uplink_spawn_loc)
READ_FILE(S["phobia"], phobia)
READ_FILE(S["preferred_smoke_brand"], preferred_smoke_brand)
READ_FILE(S["generic_adjective"], generic_adjective)
READ_FILE(S["randomise"], randomise)
READ_FILE(S["body_size"], features["body_size"])
Expand Down Expand Up @@ -594,6 +595,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
WRITE_FILE(S["uplink_loc"] , uplink_spawn_loc)
WRITE_FILE(S["randomise"] , randomise)
WRITE_FILE(S["species"] , pref_species.id)
WRITE_FILE(S["preferred_smoke_brand"] , preferred_smoke_brand)
WRITE_FILE(S["phobia"] , phobia)
WRITE_FILE(S["generic_adjective"] , generic_adjective)
WRITE_FILE(S["body_size"] , features["body_size"])
Expand Down
2 changes: 1 addition & 1 deletion code/modules/reagents/chemistry/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@
for(var/addiction in cached_addictions)
var/datum/reagent/A = addiction
if(istype(R, A))
A.addiction_stage = -15 // you're satisfied for a good while.
A.addiction_stage = -30 // you're satisfied for a good while.
need_mob_update += R.on_mob_life(C)

if(can_overdose)
Expand Down
Loading