Cigarette Tweaks

This commit is contained in:
Fox McCloud
2020-03-04 00:32:39 -05:00
parent 384a3f7279
commit c059b6ba95
2 changed files with 32 additions and 52 deletions
@@ -169,39 +169,15 @@
/obj/item/clothing/mask/cigarette/pipe,
/obj/item/lighter/zippo)
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
var/cigarette_type = /obj/item/clothing/mask/cigarette
/obj/item/storage/fancy/cigarettes/New()
..()
create_reagents(30 * storage_slots)//so people can inject cigarettes without opening a packet, now with being able to inject the whole one
reagents.set_reacting(FALSE)
for(var/i = 1 to storage_slots)
var/obj/item/clothing/mask/cigarette/C = new cigarette_type(src)
unlaced_cigarettes += C
for(var/R in default_reagents)
reagents.add_reagent(R, default_reagents[R])
/obj/item/storage/fancy/cigarettes/Destroy()
QDEL_NULL(reagents)
return ..()
new cigarette_type(src)
/obj/item/storage/fancy/cigarettes/update_icon()
icon_state = "[initial(icon_state)][contents.len]"
return
/obj/item/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/storage/fancy/cigarettes/remove_from_storage(obj/item/W as obj, atom/new_location)
lace_cigarette(W)
..()
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M, /mob))
@@ -213,7 +189,6 @@
var/obj/item/I = contents[num]
if(istype(I, /obj/item/clothing/mask/cigarette))
var/obj/item/clothing/mask/cigarette/C = I
lace_cigarette(C)
user.equip_to_slot_if_possible(C, slot_wear_mask)
to_chat(user, "<span class='notice'>You take \a [C.name] out of the pack.</span>")
update_icon()
@@ -263,14 +238,14 @@
desc = "An obscure brand of cigarettes."
icon_state = "syndiepacket"
item_state = "cigpacket"
default_reagents = list("nicotine" = 15, "omnizine" = 15)
cigarette_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_med
name = "Medical Marijuana Packet"
desc = "A prescription packet containing six marijuana cigarettes."
icon_state = "medpacket"
item_state = "cigpacket"
default_reagents = list("thc" = 15)
cigarette_type = /obj/item/clothing/mask/cigarette/medical_marijuana
/obj/item/storage/fancy/cigarettes/cigpack_uplift
name = "\improper Uplift Smooth packet"
@@ -289,7 +264,7 @@
desc = "Smoked by the truly robust."
icon_state = "robustgpacket"
item_state = "cigpacket"
default_reagents = list("nicotine" = 15, "gold" = 1)
cigarette_type = /obj/item/clothing/mask/cigarette/robustgold
/obj/item/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
@@ -308,18 +283,14 @@
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"
default_reagents = list("nicotine" = 15,
"lipolicide" = 7.5,
"ammonia" = 2,
"atrazine" = 1,
"toxin" = 1.5)
cigarette_type = /obj/item/clothing/mask/cigarette/shadyjims
/obj/item/storage/fancy/cigarettes/cigpack_random
name ="\improper Embellished Enigma packet"
desc = "For the true connoisseur of exotic flavors."
icon_state = "shadyjimpacket"
item_state = "cigpacket"
cigarette_type = /obj/item/clothing/mask/cigarette/random
cigarette_type = /obj/item/clothing/mask/cigarette/random
/obj/item/storage/fancy/rollingpapers
name = "rolling paper pack"