diff --git a/code/defines/obj/clothing.dm b/code/defines/obj/clothing.dm index db184ea0537..40abf9adead 100644 --- a/code/defines/obj/clothing.dm +++ b/code/defines/obj/clothing.dm @@ -461,7 +461,7 @@ permeability_coefficient = 0.25 /obj/item/clothing/shoes/sandal - desc = "A pair of rather plain sandals, wooden sandals." + desc = "A pair of rather plain, wooden sandals." name = "sandals" icon_state = "wizard" diff --git a/code/defines/obj/vending.dm b/code/defines/obj/vending.dm index 1baeedbccac..f8524b1da7a 100644 --- a/code/defines/obj/vending.dm +++ b/code/defines/obj/vending.dm @@ -82,8 +82,8 @@ name = "cigarette machine" desc = "If you want to get cancer, might as well do it in style" icon_state = "cigs" - product_paths = "/obj/item/weapon/cigpacket" - product_amounts = "10" + product_paths = "/obj/item/weapon/cigpacket;/obj/item/weapon/matchbox" + product_amounts = "10;2" product_slogans = "Space cigs taste good like a cigarette should.;I'd rather toolbox than switch.;Smoke!;Don't believe the reports - smoke today!" vend_delay = 34 product_hidden = "/obj/item/weapon/zippo" diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index ffd6f6c4c77..9e28714f2c7 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -19,6 +19,21 @@ g_amt = 7500 m_amt = 1000 +/obj/item/weapon/match + name = "Match" + desc = "A simple match stick, used for lighting tobacco" + icon = 'cigarettes.dmi' + icon_state = "match_unlit" + var/lit = 0 + var/smoketime = 5 + +/obj/item/weapon/matchbox + name = "Matchbox" + desc = "A box of matches" + icon = 'cigarettes.dmi' + icon_state = "matchbox" + var/matchcount = 20 + /obj/item/weapon/rcd name = "rapid-construction-device (RCD)" desc = "A device used to rapidly build walls/floor." diff --git a/code/game/objects/items/clothing.dm b/code/game/objects/items/clothing.dm index b62fbea63e0..1daf2e5c913 100644 --- a/code/game/objects/items/clothing.dm +++ b/code/game/objects/items/clothing.dm @@ -4,7 +4,6 @@ ORANGE SHOES MUZZLE CAKEHAT SUNGLASSES -CIGARETTE SWAT SUIT CHAMELEON JUMPSUIT DEATH COMMANDO GAS MASK @@ -91,103 +90,6 @@ DEATH COMMANDO GAS MASK return -/obj/item/clothing/mask/cigarette/attackby(obj/item/weapon/W as obj, mob/user as mob) - if(istype(W, /obj/item/weapon/weldingtool) && W:welding) - if(src.lit == 0) - src.lit = 1 - src.damtype = "fire" - src.icon_state = "cigon" - src.item_state = "cigon" - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red [] casually lights the cigarette with [], what a badass.", user, W), 1) - spawn() //start fires while it's lit - src.process() - else if(istype(W, /obj/item/weapon/zippo) && W:lit) - if(src.lit == 0) - src.lit = 1 - src.icon_state = "cigon" - src.item_state = "cigon" - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red With a single flick of his wrist, [] smoothly lights his cigarette with his []. Damn they're cool.", user, W), 1) - spawn() //start fires while it's lit - src.process() - - - -/obj/item/clothing/mask/cigarette/process() - - var/atom/lastHolder = null - - while(src.lit == 1) - var/turf/location = src.loc - var/atom/holder = loc - var/isHeld = 0 - var/mob/M = null - src.smoketime-- - - if(istype(location, /mob/)) - M = location - if(M.l_hand == src || M.r_hand == src || M.wear_mask == src) - location = M.loc - if(src.smoketime < 1) - var/obj/item/weapon/cigbutt/C = new /obj/item/weapon/cigbutt - if(M != null) - M << "\red Your cigarette goes out." - C.loc = location - del(src) - return - if (istype(location, /turf)) //start a fire if possible - location.hotspot_expose(700, 5) - if (ismob(holder)) - isHeld = 1 - else - - - - - // note remove luminosity processing until can understand how to make this compatible - // with the fire checks, etc. - - isHeld = 0 - if (lastHolder != null) - //lastHolder.sd_SetLuminosity(0) - lastHolder = null - - if (isHeld == 1) - //if (holder != lastHolder && lastHolder != null) - //lastHolder.sd_SetLuminosity(0) - //holder.sd_SetLuminosity(1) - lastHolder = holder - - //sd_SetLuminosity(1) - sleep(10) - - if (lastHolder != null) - //lastHolder.sd_SetLuminosity(0) - lastHolder = null - - //sd_SetLuminosity(0) - - -/obj/item/clothing/mask/cigarette/dropped(mob/user as mob) - if(src.lit == 1) - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red [] calmly drops and treads on the lit cigarette, putting it out instantly.", user), 1) - src.lit = -1 - src.damtype = "brute" - src.icon_state = "cigbutt" - src.item_state = "cigoff" - src.name = "Cigarette butt" - src.desc = "A cigarette butt." - return ..() - else - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red [] drops the []. Guess they've had enough for the day.", user, src), 1) - return ..() - - - - /obj/item/clothing/under/chameleon/New() ..() diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 4a7cd3135c2..39e85ffbd7a 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -1,10 +1,185 @@ /* CONTAINS: +MATCHES +MATCHBOXES +CIGARETTES CIG PACKET ZIPPO - - */ + +/////////// +//MATCHES// +/////////// + +/obj/item/weapon/match/process() + while(src.lit == 1) + src.smoketime-- + sleep(10) + if(src.smoketime < 1) + src.icon_state = "match_burnt" + src.lit = -1 + return + +/obj/item/weapon/match/dropped(mob/user as mob) + if(src.lit == 1) + src.lit = -1 + src.damtype = "brute" + src.icon_state = "match_burnt" + src.item_state = "cigoff" + src.name = "Burnt match" + src.desc = "A match that has been burnt" + return ..() + +////////////// +//MATCHBOXES// +////////////// +/obj/item/weapon/matchbox/attack_hand(mob/user as mob) + if(user.r_hand == src || user.l_hand == src) + if(src.matchcount <= 0) + user << "\red You're out of matches. Shouldn't have wasted so many..." + return + else + src.matchcount-- + var/obj/item/weapon/match/W = new /obj/item/weapon/match(user) + if(user.hand) + user.l_hand = W + else + user.r_hand = W + W.layer = 20 + else + return ..() + if(src.matchcount <= 0) + src.icon_state = "matchbox_e" + else if(src.matchcount <= 5) + src.icon_state = "matchbox_1q" + else if(src.matchcount <= 10) + src.icon_state = "matchbox_h" + else if(src.matchcount <= 15) + src.icon_state = "matchbox_3q" + else + src.icon_state = "matchbox" + src.update_icon() + return + +obj/item/weapon/matchbox.attackby(obj/item/weapon/match/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/match) && W.lit == 0) + W.lit = 1 + W.icon_state = "match_lit" + W.process() + W.update_icon() + return + + +////////////// +//CIGARETTES// +////////////// +/obj/item/clothing/mask/cigarette/attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W, /obj/item/weapon/weldingtool) && W:welding) + if(src.lit == 0) + src.lit = 1 + src.damtype = "fire" + src.icon_state = "cigon" + src.item_state = "cigon" + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [] casually lights the cigarette with [], what a badass.", user, W), 1) + spawn() //start fires while it's lit + src.process() + else if(istype(W, /obj/item/weapon/zippo) && W:lit) + if(src.lit == 0) + src.lit = 1 + src.icon_state = "cigon" + src.item_state = "cigon" + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red With a single flick of his wrist, [] smoothly lights his cigarette with his []. Damn they're cool.", user, W), 1) + spawn() //start fires while it's lit + src.process() + else if(istype(W, /obj/item/weapon/match) && W:lit) + if(src.lit == 0) + src.lit = 1 + src.icon_state = "cigon" + src.item_state = "cigon" + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red With a single flick of his wrist, [] smoothly lights his cigarette with his []. Damn they're cool.", user, W), 1) + spawn() //start fires while it's lit + src.process() + + + +/obj/item/clothing/mask/cigarette/process() + + var/atom/lastHolder = null + + while(src.lit == 1) + var/turf/location = src.loc + var/atom/holder = loc + var/isHeld = 0 + var/mob/M = null + src.smoketime-- + + if(istype(location, /mob/)) + M = location + if(M.l_hand == src || M.r_hand == src || M.wear_mask == src) + location = M.loc + if(src.smoketime < 1) + var/obj/item/weapon/cigbutt/C = new /obj/item/weapon/cigbutt + if(M != null) + M << "\red Your cigarette goes out." + C.loc = location + del(src) + return + if (istype(location, /turf)) //start a fire if possible + location.hotspot_expose(700, 5) + if (ismob(holder)) + isHeld = 1 + else + + + + + // note remove luminosity processing until can understand how to make this compatible + // with the fire checks, etc. + + isHeld = 0 + if (lastHolder != null) + //lastHolder.sd_SetLuminosity(0) + lastHolder = null + + if (isHeld == 1) + //if (holder != lastHolder && lastHolder != null) + //lastHolder.sd_SetLuminosity(0) + //holder.sd_SetLuminosity(1) + lastHolder = holder + + //sd_SetLuminosity(1) + sleep(10) + + if (lastHolder != null) + //lastHolder.sd_SetLuminosity(0) + lastHolder = null + + //sd_SetLuminosity(0) + + +/obj/item/clothing/mask/cigarette/dropped(mob/user as mob) + if(src.lit == 1) + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [] calmly drops and treads on the lit cigarette, putting it out instantly.", user), 1) + src.lit = -1 + src.damtype = "brute" + src.icon_state = "cigbutt" + src.item_state = "cigoff" + src.name = "Cigarette butt" + src.desc = "A cigarette butt." + return ..() + else + for(var/mob/O in viewers(user, null)) + O.show_message(text("\red [] drops the []. Guess they've had enough for the day.", user, src), 1) + return ..() + +//////////// +//CIG PACK// +//////////// + /obj/item/weapon/cigpacket/update_icon() src.icon_state = text("cigpacket[]", src.cigcount) src.desc = text("There are [] cigs\s left!", src.cigcount) @@ -28,7 +203,9 @@ ZIPPO src.update_icon() return - +///////// +//ZIPPO// +///////// #define ZIPPO_LUM 2 /obj/item/weapon/zippo/attack_self(mob/user) diff --git a/icons/obj/cigarettes.dmi b/icons/obj/cigarettes.dmi index c04c516e29d..bdc762803b9 100644 Binary files a/icons/obj/cigarettes.dmi and b/icons/obj/cigarettes.dmi differ