mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Pipe fix/tweak (#25431)
* Pipe fixes and tweaks. Allows refilling of pipes using dried plants, removes their ability to conjure nicotine, and applies the May 22, 2015 pipe tweak to cob pipes, and make them start empty(corn has no nicotine). * refilling pipes now sets smoketime * oops * Adding spaces to comments
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#define REAGENT_TIME_RATIO 2.5
|
||||
|
||||
/*
|
||||
CONTAINS:
|
||||
CIGARETTES
|
||||
@@ -502,7 +504,7 @@ LIGHTERS ARE IN LIGHTERS.DM
|
||||
return
|
||||
smoke()
|
||||
|
||||
/obj/item/clothing/mask/cigarette/pipe/attack_self(mob/user) //Refills the pipe. Can be changed to an attackby later, if loose tobacco is added to vendors or something.
|
||||
/obj/item/clothing/mask/cigarette/pipe/attack_self(mob/user) // Extinguishes the pipe.
|
||||
if(lit)
|
||||
user.visible_message("<span class='notice'>[user] puts out [src].</span>")
|
||||
lit = FALSE
|
||||
@@ -510,17 +512,27 @@ LIGHTERS ARE IN LIGHTERS.DM
|
||||
item_state = icon_off
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
if(smoketime <= 0)
|
||||
to_chat(user, "<span class='notice'>You refill the pipe with tobacco.</span>")
|
||||
reagents.add_reagent("nicotine", chem_volume)
|
||||
smoketime = initial(smoketime)
|
||||
first_puff = TRUE
|
||||
|
||||
/obj/item/clothing/mask/cigarette/pipe/try_light(obj/item/cigar, obj/item/lighting_item)
|
||||
if(can_light_fancy(lighting_item))
|
||||
return ..()
|
||||
|
||||
// Refill or light the pipe
|
||||
/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/food/snacks/grown))
|
||||
var/obj/item/food/snacks/grown/O = I
|
||||
if(O.dry)
|
||||
if(reagents.total_volume == reagents.maximum_volume)
|
||||
to_chat(user, "<span class='warning'>[src] is full!</span>")
|
||||
return
|
||||
O.reagents.trans_to(src, chem_volume)
|
||||
to_chat(user, "<span class='notice'>You stuff the [O.name] into the pipe.</span>")
|
||||
smoketime = max(reagents.total_volume * REAGENT_TIME_RATIO, smoketime)
|
||||
qdel(O)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need to dry this first!</span>")
|
||||
return
|
||||
|
||||
if(!is_type_in_typecache(I, things_that_light))
|
||||
return
|
||||
if(can_light_fancy(I))
|
||||
@@ -535,8 +547,9 @@ LIGHTERS ARE IN LIGHTERS.DM
|
||||
item_state = "cobpipeoff"
|
||||
icon_on = "cobpipeon" //Note - these are in masks.dmi
|
||||
icon_off = "cobpipeoff"
|
||||
smoketime = 800
|
||||
chem_volume = 40
|
||||
smoketime = 0 //there is nothing to smoke initially
|
||||
chem_volume = 160
|
||||
list_reagents = list()
|
||||
|
||||
///////////
|
||||
//ROLLING//
|
||||
@@ -569,3 +582,5 @@ LIGHTERS ARE IN LIGHTERS.DM
|
||||
to_chat(user, "<span class='warning'>You need to dry this first!</span>")
|
||||
else
|
||||
..()
|
||||
|
||||
#undef REAGENT_TIME_RATIO
|
||||
|
||||
Reference in New Issue
Block a user