Changes nicotine pre-generation and fixes lacing

This commit is contained in:
Krausus
2015-05-01 01:41:19 -04:00
parent d2588f64ec
commit e5f0d0bb6a
4 changed files with 42 additions and 35 deletions
+1 -1
View File
@@ -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
@@ -68,14 +68,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/lastHolder = null
var/smoketime = 300
var/chem_volume = 15
var/has_nicotine = 1
/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
if(has_nicotine)
reagents.add_reagent("nicotine", 15)
/obj/item/clothing/mask/cigarette/Destroy()
..()
@@ -231,7 +228,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
item_state = "spliffoff"
smoketime = 180
chem_volume = 50
has_nicotine = 0 // The plants these are made from don't actually contain nicotine
/obj/item/clothing/mask/cigarette/joint/New()
..()
@@ -268,6 +264,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM
smoketime = 1500
chem_volume = 20
/obj/item/clothing/mask/cigarette/cigar/New()
..()
reagents.add_reagent("nicotine", chem_volume)
/obj/item/clothing/mask/cigarette/cigar/cohiba
name = "Cohiba Robusto Cigar"
desc = "There's little more you could want from a cigar."
@@ -323,6 +323,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
@@ -155,13 +155,19 @@
storage_slots = 6
can_hold = list("/obj/item/clothing/mask/cigarette")
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
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
for(var/i = 1 to storage_slots)
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 +179,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 = 15 * 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 << "<span class='notice'>You take a cigarette out of the pack.</span>"
update_icon()
else
@@ -217,11 +226,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("omnizine" = 15)
/obj/item/weapon/storage/fancy/cigarettes/cigpack_uplift
name = "\improper Uplift Smooth packet"
@@ -240,11 +245,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" = 14, "gold" = 1)
/obj/item/weapon/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
@@ -263,14 +264,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" = 6.5,
"lipolicide" = 4,
"ammonia" = 2,
"atrazine" = 1,
"toxin" = 1.5)
/*
* Vial Box
@@ -158,6 +158,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