mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 03:33:21 +00:00
Merge pull request #3151 from Anewbe/smokings_a_drag
Adds taking drags from smokables
This commit is contained in:
@@ -101,17 +101,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
|||||||
flags |= NOREACT // so it doesn't react until you light it
|
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
|
create_reagents(chem_volume) // making the cigarrete a chemical holder with a maximum volume of 15
|
||||||
|
|
||||||
/obj/item/clothing/mask/smokable/process()
|
/obj/item/clothing/mask/smokable/proc/smoke(amount)
|
||||||
var/turf/location = get_turf(src)
|
smoketime -= amount
|
||||||
smoketime--
|
|
||||||
if(smoketime < 1)
|
|
||||||
die()
|
|
||||||
if(ishuman(loc))
|
|
||||||
var/mob/living/carbon/human/C = loc
|
|
||||||
to_chat(C, "<span class='notice'>Your [name] goes out.</span>")
|
|
||||||
return
|
|
||||||
if(location)
|
|
||||||
location.hotspot_expose(700, 5)
|
|
||||||
if(reagents && reagents.total_volume) // check if it has any reagents at all
|
if(reagents && reagents.total_volume) // check if it has any reagents at all
|
||||||
if(ishuman(loc))
|
if(ishuman(loc))
|
||||||
var/mob/living/carbon/human/C = loc
|
var/mob/living/carbon/human/C = loc
|
||||||
@@ -120,6 +111,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
|||||||
else // else just remove some of the reagents
|
else // else just remove some of the reagents
|
||||||
reagents.remove_any(REM)
|
reagents.remove_any(REM)
|
||||||
|
|
||||||
|
/obj/item/clothing/mask/smokable/process()
|
||||||
|
var/turf/location = get_turf(src)
|
||||||
|
smoke(1)
|
||||||
|
if(smoketime < 1)
|
||||||
|
die()
|
||||||
|
return
|
||||||
|
if(location)
|
||||||
|
location.hotspot_expose(700, 5)
|
||||||
|
|
||||||
/obj/item/clothing/mask/smokable/examine(mob/user)
|
/obj/item/clothing/mask/smokable/examine(mob/user)
|
||||||
..()
|
..()
|
||||||
if(is_pipe)
|
if(is_pipe)
|
||||||
@@ -214,6 +214,17 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
|||||||
M.update_inv_l_hand(0)
|
M.update_inv_l_hand(0)
|
||||||
M.update_inv_r_hand(1)
|
M.update_inv_r_hand(1)
|
||||||
|
|
||||||
|
/obj/item/clothing/mask/smokable/attack(mob/living/carbon/human/H, mob/user, def_zone)
|
||||||
|
if(lit && H == user && istype(H))
|
||||||
|
var/obj/item/blocked = H.check_mouth_coverage()
|
||||||
|
if(blocked)
|
||||||
|
to_chat(H, "<span class='warning'>\The [blocked] is in the way!</span>")
|
||||||
|
return 1
|
||||||
|
to_chat(H, "<span class='notice'>You take a drag on your [name].</span>")
|
||||||
|
smoke(5)
|
||||||
|
return 1
|
||||||
|
return ..()
|
||||||
|
|
||||||
/obj/item/clothing/mask/smokable/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
/obj/item/clothing/mask/smokable/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||||
..()
|
..()
|
||||||
if(isflamesource(W))
|
if(isflamesource(W))
|
||||||
|
|||||||
Reference in New Issue
Block a user