Merge pull request #3013 from Anewbe/lung_cancer

Minor smoking update
This commit is contained in:
Neerti
2017-02-28 21:28:27 -05:00
committed by GitHub
2 changed files with 90 additions and 39 deletions

View File

@@ -85,10 +85,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM
body_parts_covered = 0
var/lit = 0
var/icon_on
var/icon_off
var/type_butt = null
var/chem_volume = 0
var/smoketime = 0
var/is_pipe = 0 //Prevents a runtime with pipes
var/matchmes = "USER lights NAME with FLAME"
var/lightermes = "USER lights NAME with FLAME"
var/zippomes = "USER lights NAME with FLAME"
@@ -106,6 +106,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM
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)
@@ -119,19 +122,20 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/examine(mob/user)
..()
if(lit == 1)
var/smoke_percent = round((smoketime / initial(smoketime)) * 100)
switch(smoke_percent)
if(90 to INFINITY)
user << "[src] has just begun to burn."
if(60 to 90)
user << "[src] has a good amount of burn time remaining."
if(30 to 60)
user << "[src] is about half finished."
if(10 to 30)
user << "[src] is starting to burn low."
else
user << "[src] is nearly burnt out!"
if(is_pipe)
return
var/smoke_percent = round((smoketime / initial(smoketime)) * 100)
switch(smoke_percent)
if(90 to INFINITY)
user << "[src] is still fresh."
if(60 to 90)
user << "[src] has a good amount of burn time remaining."
if(30 to 60)
user << "[src] is about half finished."
if(10 to 30)
user << "[src] is starting to burn low."
else
user << "[src] is nearly burnt out!"
/obj/item/clothing/mask/smokable/proc/light(var/flavor_text = "[usr] lights the [name].")
@@ -167,6 +171,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/proc/die(var/nomessage = 0)
var/turf/T = get_turf(src)
set_light(0)
processing_objects.Remove(src)
if (type_butt)
var/obj/item/butt = new type_butt(T)
transfer_fingerprints_to(butt)
@@ -175,12 +180,11 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(ismob(loc))
var/mob/living/M = loc
if (!nomessage)
M << "<span class='notice'>Your [name] goes out.</span>"
to_chat(M, "<span class='notice'>Your [name] goes out.</span>")
M.remove_from_mob(src) //un-equip it so the overlays can update
M.update_inv_wear_mask(0)
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
processing_objects.Remove(src)
qdel(src)
else
new /obj/effect/decal/cleanable/ash(T)
@@ -189,12 +193,26 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if (!nomessage)
M << "<span class='notice'>Your [name] goes out, and you empty the ash.</span>"
lit = 0
icon_state = icon_off
item_state = icon_off
icon_state = initial(icon_state)
item_state = initial(item_state)
M.update_inv_wear_mask(0)
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
processing_objects.Remove(src)
smoketime = 0
reagents.clear_reagents()
name = "empty [initial(name)]"
/obj/item/clothing/mask/smokable/proc/quench()
lit = 0
processing_objects.Remove(src)
icon_state = initial(icon_state)
item_state = initial(item_state)
if(ismob(loc))
var/mob/living/M = loc
M.update_inv_wear_mask(0)
M.update_inv_l_hand(0)
M.update_inv_r_hand(1)
/obj/item/clothing/mask/smokable/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
@@ -223,6 +241,10 @@ CIGARETTE PACKETS ARE IN FANCY.DM
else
return ..()
/obj/item/clothing/mask/smokable/water_act(amount)
if(amount >= 5)
quench()
/obj/item/clothing/mask/smokable/cigarette
name = "cigarette"
desc = "A roll of tobacco and nicotine."
@@ -233,7 +255,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
slot_flags = SLOT_EARS | SLOT_MASK
attack_verb = list("burnt", "singed")
icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
icon_off = "cigoff"
type_butt = /obj/item/weapon/cigbutt
chem_volume = 15
smoketime = 300
@@ -269,8 +290,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/cigarette/attack_self(mob/user as mob)
if(lit == 1)
user.visible_message("<span class='notice'>[user] calmly drops and treads on the lit [src], putting it out instantly.</span>")
die(1)
if(user.a_intent == I_HURT)
user.visible_message("<span class='notice'>[user] drops and treads on the lit [src], putting it out instantly.</span>")
die(1)
else
user.visible_message("<span class='notice'>[user] puts out \the [src].</span>")
quench()
return ..()
////////////
@@ -281,7 +306,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
desc = "A brown roll of tobacco and... well, you're not quite sure. This thing's huge!"
icon_state = "cigar2off"
icon_on = "cigar2on"
icon_off = "cigar2off"
type_butt = /obj/item/weapon/cigbutt/cigarbutt
throw_speed = 0.5
item_state = "cigaroff"
@@ -298,14 +322,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
desc = "There's little more you could want from a cigar."
icon_state = "cigar2off"
icon_on = "cigar2on"
icon_off = "cigar2off"
/obj/item/clothing/mask/smokable/cigarette/cigar/havana
name = "premium Havanian cigar"
desc = "A cigar fit for only the best of the best."
icon_state = "cigar2off"
icon_on = "cigar2on"
icon_off = "cigar2off"
smoketime = 7200
chem_volume = 30
@@ -345,7 +367,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = "pipeoff"
item_state = "pipeoff"
icon_on = "pipeon" //Note - these are in masks.dmi
icon_off = "pipeoff"
smoketime = 0
chem_volume = 50
matchmes = "<span class='notice'>USER lights their NAME with their FLAME.</span>"
@@ -353,6 +374,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
zippomes = "<span class='rose'>With much care, USER lights their NAME with their FLAME.</span>"
weldermes = "<span class='notice'>USER recklessly lights NAME with FLAME.</span>"
ignitermes = "<span class='notice'>USER fiddles with FLAME, and manages to light their NAME with the power of science.</span>"
is_pipe = 1
/obj/item/clothing/mask/smokable/pipe/New()
..()
@@ -375,18 +397,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/pipe/attack_self(mob/user as mob)
if(lit == 1)
user.visible_message("<span class='notice'>[user] puts out [src].</span>", "<span class='notice'>You put out [src].</span>")
lit = 0
icon_state = icon_off
item_state = icon_off
processing_objects.Remove(src)
else if (smoketime)
var/turf/location = get_turf(user)
user.visible_message("<span class='notice'>[user] empties out [src].</span>", "<span class='notice'>You empty out [src].</span>")
new /obj/effect/decal/cleanable/ash(location)
smoketime = 0
reagents.clear_reagents()
name = "empty [initial(name)]"
if(user.a_intent == I_HURT)
user.visible_message("<span class='notice'>[user] empties the lit [src] on the floor!.</span>")
die(1)
else
user.visible_message("<span class='notice'>[user] puts out \the [src].</span>")
quench()
/obj/item/clothing/mask/smokable/pipe/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/melee/energy/sword))
@@ -431,7 +447,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
icon_state = "cobpipeoff"
item_state = "cobpipeoff"
icon_on = "cobpipeon" //Note - these are in masks.dmi
icon_off = "cobpipeoff"
chem_volume = 35
/////////

View File

@@ -0,0 +1,36 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
#################################
# Your name.
author: Anewbe
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- tweak: "Extinguishing a smokable on non-Harm intents no longer destroys it."