diff --git a/code/datums/uplink_item.dm b/code/datums/uplink_item.dm index 1db0e95da0d..8ba5f8677d5 100644 --- a/code/datums/uplink_item.dm +++ b/code/datums/uplink_item.dm @@ -543,7 +543,7 @@ var/list/uplink_items = list() /datum/uplink_item/badass/syndiecigs name = "Syndicate Smokes" - desc = "Strong flavor, dense smoke, infused with Doctor's Delight." + desc = "Strong flavor, dense smoke, infused with omnizine." item = /obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate cost = 4 diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 27e3b00b489..aacdc9c6e37 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -67,13 +67,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM var/type_butt = /obj/item/weapon/cigbutt var/lastHolder = null var/smoketime = 300 - var/chem_volume = 15 + var/chem_volume = 30 /obj/item/clothing/mask/cigarette/New() ..() flags |= NOREACT // so it doesn't react until you light it - create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15 - reagents.add_reagent("nicotine", 15) + create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 30 /obj/item/clothing/mask/cigarette/Destroy() ..() @@ -162,7 +161,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/clothing/mask/cigarette/process() - var/turf/location = get_turf(src) var/mob/living/M = loc if(isliving(loc)) M.IgniteMob() @@ -170,29 +168,39 @@ CIGARETTE PACKETS ARE IN FANCY.DM if(smoketime < 1) die() return - if(location) - location.hotspot_expose(700, 5) - if(reagents && reagents.total_volume) // check if it has any reagents at all - if(iscarbon(loc) && (src == loc:wear_mask)) // if it's in the human/monkey mouth, transfer reagents to the mob - if(istype(loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = loc - if(H.species.flags & IS_SYNTHETIC) - return - var/mob/living/carbon/C = loc - if(prob(15)) // so it's not an instarape in case of acid - reagents.reaction(C, INGEST) - reagents.trans_to(C, REAGENTS_METABOLISM) - else // else just remove some of the reagents - reagents.remove_any(REAGENTS_METABOLISM) + smoke() return /obj/item/clothing/mask/cigarette/attack_self(mob/user as mob) - if(lit == 1) + if(lit) user.visible_message("[user] calmly drops and treads on the lit [src], putting it out instantly.") die() return ..() +/obj/item/clothing/mask/cigarette/proc/smoke() + var/turf/location = get_turf(src) + var/is_being_smoked = 0 + // Check whether this is actually in a mouth, being smoked + if(iscarbon(loc)) + var/mob/living/carbon/C = loc + if(src == C.wear_mask) + // There used to be a species check here, but synthetics can smoke now + is_being_smoked = 1 + if(location) + location.hotspot_expose(700, 5) + if(reagents && reagents.total_volume) // check if it has any reagents at all + if(is_being_smoked) // if it's being smoked, transfer reagents to the mob + var/mob/living/carbon/C = loc + if(prob(15)) // so it's not an instarape in case of acid + reagents.reaction(C, INGEST) + reagents.trans_to(C, REAGENTS_METABOLISM) + if(!reagents.total_volume) // There were reagents, but now they're gone + C << "Your [name] loses its flavor." + else // else just remove some of the reagents + reagents.remove_any(REAGENTS_METABOLISM) + return + /obj/item/clothing/mask/cigarette/proc/die() var/turf/T = get_turf(src) var/obj/item/butt = new type_butt(T) @@ -250,7 +258,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM throw_speed = 0.5 item_state = "cigaroff" smoketime = 1500 - chem_volume = 20 + chem_volume = 40 + +/obj/item/clothing/mask/cigarette/cigar/New() + ..() + reagents.add_reagent("nicotine", chem_volume/2) /obj/item/clothing/mask/cigarette/cigar/cohiba name = "Cohiba Robusto Cigar" @@ -266,7 +278,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM icon_on = "cigar2on" icon_off = "cigar2off" smoketime = 7200 - chem_volume = 30 + chem_volume = 60 /obj/item/weapon/cigbutt name = "cigarette butt" @@ -307,6 +319,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM smoketime = 1000 chem_volume = 50 +/obj/item/clothing/mask/cigarette/pipe/New() + ..() + reagents.add_reagent("nicotine", chem_volume) + /obj/item/clothing/mask/cigarette/pipe/light(var/flavor_text = "[usr] lights the [name].") if(!src.lit) src.lit = 1 @@ -331,24 +347,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM M.update_inv_wear_mask(0) processing_objects.Remove(src) return - if(location) - location.hotspot_expose(700, 5) - if(reagents && reagents.total_volume) // check if it has any reagents at all - if(iscarbon(loc) && (src == loc:wear_mask)) // if it's in the human/monkey mouth, transfer reagents to the mob - if(istype(loc, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = loc - if(H.species.flags & IS_SYNTHETIC) - return - var/mob/living/carbon/C = loc - if(prob(15)) // so it's not an instarape in case of acid - reagents.reaction(C, INGEST) - reagents.trans_to(C, REAGENTS_METABOLISM) - else // else just remove some of the reagents - reagents.remove_any(REAGENTS_METABOLISM) + smoke() return /obj/item/clothing/mask/cigarette/pipe/attack_self(mob/user as mob) //Refills the pipe. Can be changed to an attackby later, if loose tobacco is added to vendors or something. - if(lit == 1) + if(lit) user.visible_message("[user] puts out [src].") lit = 0 icon_state = icon_off diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm index 3dc18e532ca..94db07084a2 100644 --- a/code/game/objects/items/weapons/storage/fancy.dm +++ b/code/game/objects/items/weapons/storage/fancy.dm @@ -154,14 +154,22 @@ slot_flags = SLOT_BELT storage_slots = 6 can_hold = list("/obj/item/clothing/mask/cigarette") + cant_hold = list("/obj/item/clothing/mask/cigarette/cigar", + "/obj/item/clothing/mask/cigarette/pipe") icon_type = "cigarette" + var/list/unlaced_cigarettes = list() // Cigarettes that haven't received reagents yet + var/default_reagents = list("nicotine" = 15) // List of reagents to pre-generate for each cigarette /obj/item/weapon/storage/fancy/cigarettes/New() ..() flags |= NOREACT + create_reagents(30 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one for(var/i = 1 to storage_slots) - new /obj/item/clothing/mask/cigarette(src) - create_reagents(15 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one + var/obj/item/clothing/mask/cigarette/C = new /obj/item/clothing/mask/cigarette(src) + unlaced_cigarettes += C + for(var/R in default_reagents) + reagents.add_reagent(R, default_reagents[R]) + /obj/item/weapon/storage/fancy/cigarettes/Destroy() del(reagents) @@ -173,22 +181,25 @@ desc = "There are [contents.len] cig\s left!" return +/obj/item/weapon/storage/fancy/cigarettes/proc/lace_cigarette(var/obj/item/clothing/mask/cigarette/C as obj) + if(istype(C) && (C in unlaced_cigarettes)) // Only transfer reagents to each cigarette once + reagents.trans_to(C, (reagents.total_volume/unlaced_cigarettes.len)) + unlaced_cigarettes -= C + reagents.maximum_volume = 30 * unlaced_cigarettes.len + /obj/item/weapon/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location) - var/obj/item/clothing/mask/cigarette/C = W - if(!istype(C)) return // what - reagents.trans_to(C, (reagents.total_volume/contents.len)) - ..() + lace_cigarette(W) + ..() /obj/item/weapon/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M, /mob)) return - if(M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask) - var/obj/item/clothing/mask/cigarette/W = new /obj/item/clothing/mask/cigarette(user) - reagents.trans_to(W, (reagents.total_volume/contents.len)) - user.equip_to_slot_if_possible(W, slot_wear_mask) - reagents.maximum_volume = 15 * contents.len - contents.len-- + if(istype(M) && M == user && user.zone_sel.selecting == "mouth" && contents.len > 0 && !user.wear_mask) + var/obj/item/clothing/mask/cigarette/C = contents[contents.len] + if(!istype(C)) return + lace_cigarette(C) + user.equip_to_slot_if_possible(C, slot_wear_mask) user << "You take a cigarette out of the pack." update_icon() else @@ -217,11 +228,7 @@ desc = "An obscure brand of cigarettes." icon_state = "syndiepacket" item_state = "cigpacket" - -/obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate/New() - ..() - for(var/i = 1 to storage_slots) - reagents.add_reagent("omnizine",15) + default_reagents = list("nicotine" = 15, "omnizine" = 15) /obj/item/weapon/storage/fancy/cigarettes/cigpack_uplift name = "\improper Uplift Smooth packet" @@ -240,11 +247,7 @@ desc = "Smoked by the truly robust." icon_state = "robustgpacket" item_state = "cigpacket" - -/obj/item/weapon/storage/fancy/cigarettes/cigpack_robustgold/New() - ..() - for(var/i = 1 to storage_slots) - reagents.add_reagent("gold",1) + default_reagents = list("nicotine" = 15, "gold" = 1) /obj/item/weapon/storage/fancy/cigarettes/cigpack_carp name = "\improper Carp Classic packet" @@ -263,14 +266,11 @@ desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!" icon_state = "shadyjimpacket" item_state = "cigpacket" - -/obj/item/weapon/storage/fancy/cigarettes/cigpack_shadyjims/New() - ..() - for(var/i = 1 to storage_slots) - reagents.add_reagent("lipolicide",4) - reagents.add_reagent("ammonia",2) - reagents.add_reagent("atrazine",1) - reagents.add_reagent("toxin",1.5) + default_reagents = list("nicotine" = 15, + "lipolicide" = 7.5, + "ammonia" = 2, + "atrazine" = 1, + "toxin" = 1.5) /* * Vial Box diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 5c05909becd..e0064fec12e 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -63,7 +63,7 @@ datum if(current_list_element > reagent_list.len) current_list_element = 1 var/datum/reagent/current_reagent = reagent_list[current_list_element] - src.remove_reagent(current_reagent.id, 1) + src.remove_reagent(current_reagent.id, min(1, amount - total_transfered)) current_list_element++ total_transfered++ diff --git a/code/modules/reagents/reagent_containers/syringes.dm b/code/modules/reagents/reagent_containers/syringes.dm index e3e8bfe4e0a..564207dacca 100644 --- a/code/modules/reagents/reagent_containers/syringes.dm +++ b/code/modules/reagents/reagent_containers/syringes.dm @@ -162,6 +162,11 @@ if(!target.is_open_container() && !ismob(target) && !istype(target, /obj/item/weapon/reagent_containers/food) && !istype(target, /obj/item/slime_extract) && !istype(target, /obj/item/clothing/mask/cigarette) && !istype(target, /obj/item/weapon/storage/fancy/cigarettes)) user << "\red You cannot directly fill this object." return + if(istype(target, /obj/item/clothing/mask/cigarette)) + var/obj/item/clothing/mask/cigarette/C = target + if(istype(C.loc, /obj/item/weapon/storage/fancy/cigarettes)) + user << "\red You cannot inject a cigarette while it's still in the pack." + return if(target.reagents.total_volume >= target.reagents.maximum_volume) user << "\red [target] is full." return