mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 07:33:34 +01:00
TG: Added throwing items over tables, thanks to SkyMarshal.
Improved cigarette code, mostly grammatical fixes. Revision: r3036 Author: petethegoat
This commit is contained in:
@@ -3,6 +3,8 @@ CONTAINS:
|
||||
MATCHES
|
||||
MATCHBOXES
|
||||
CIGARETTES
|
||||
CIGARS
|
||||
SMOKING PIPES
|
||||
CIG PACKET
|
||||
ZIPPO
|
||||
*/
|
||||
@@ -22,10 +24,7 @@ ZIPPO
|
||||
|
||||
|
||||
process()
|
||||
var/turf/location = get_turf(src)
|
||||
if(src.lit == 1)
|
||||
if(location)
|
||||
location.hotspot_expose(700, 5)
|
||||
while(src.lit == 1)
|
||||
src.smoketime--
|
||||
sleep(10)
|
||||
if(src.smoketime < 1)
|
||||
@@ -37,16 +36,12 @@ ZIPPO
|
||||
|
||||
dropped(mob/user as mob)
|
||||
if(src.lit == 1)
|
||||
spawn(10)
|
||||
var/turf/location = get_turf(src)
|
||||
location.hotspot_expose(700, 5)
|
||||
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"
|
||||
processing_objects.Remove(src)
|
||||
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 ..()
|
||||
|
||||
|
||||
@@ -74,7 +69,11 @@ ZIPPO
|
||||
else
|
||||
src.matchcount--
|
||||
var/obj/item/weapon/match/W = new /obj/item/weapon/match(user)
|
||||
user.put_in_hand(W)
|
||||
if(user.hand)
|
||||
user.l_hand = W
|
||||
else
|
||||
user.r_hand = W
|
||||
W.layer = 20
|
||||
else
|
||||
return ..()
|
||||
if(src.matchcount <= 0)
|
||||
@@ -115,13 +114,23 @@ ZIPPO
|
||||
lit = 0
|
||||
icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
|
||||
icon_off = "cigoff"
|
||||
icon_butt = "cigbutt"
|
||||
type_butt = /obj/item/weapon/cigbutt
|
||||
lastHolder = null
|
||||
smoketime = 300
|
||||
var/butt_count = 5 //count of butt sprite variations
|
||||
icon_butt = "cigbutt"
|
||||
butt_count = 5 //count of butt sprite variations
|
||||
proc
|
||||
light(var/flavor_text = "[usr] lights the [name].")
|
||||
|
||||
put_out()
|
||||
if (src.lit == -1)
|
||||
return
|
||||
src.lit = -1
|
||||
src.damtype = "brute"
|
||||
src.icon_state = icon_butt + "[rand(0,butt_count)]"
|
||||
src.item_state = icon_off
|
||||
src.desc = "A [src.name] butt."
|
||||
src.name = "[src.name] butt"
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
@@ -149,29 +158,18 @@ ZIPPO
|
||||
O.show_message(flavor_text, 1)
|
||||
processing_objects.Add(src)
|
||||
|
||||
put_out()
|
||||
if (src.lit == -1)
|
||||
return
|
||||
src.lit = -1
|
||||
src.damtype = "brute"
|
||||
src.icon_state = icon_butt + "[rand(0,butt_count)]"
|
||||
src.item_state = icon_off
|
||||
src.desc = "A [src.name] butt."
|
||||
src.name = "[src.name] butt"
|
||||
|
||||
|
||||
process()
|
||||
var/turf/location = get_turf(src)
|
||||
src.smoketime--
|
||||
if(src.smoketime < 1)
|
||||
new type_butt(location)
|
||||
if(ismob(src.loc))
|
||||
var/mob/living/M = src.loc
|
||||
M << "\red Your [src.name] goes out."
|
||||
put_out()
|
||||
M.update_clothing()
|
||||
else
|
||||
put_out()
|
||||
processing_objects.Remove(src)
|
||||
del(src)
|
||||
return
|
||||
if(location)
|
||||
location.hotspot_expose(700, 5)
|
||||
@@ -180,11 +178,15 @@ ZIPPO
|
||||
|
||||
dropped(mob/user as mob)
|
||||
if(src.lit == 1)
|
||||
src.visible_message("\red [user] calmly drops and treads on the lit [src], putting it out instantly.")
|
||||
put_out()
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] calmly drops and treads on the lit [], putting it out instantly.", user,src.name), 1)
|
||||
new type_butt(loc)
|
||||
processing_objects.Remove(src)
|
||||
del(src)
|
||||
return ..()
|
||||
|
||||
|
||||
|
||||
////////////
|
||||
// CIGARS //
|
||||
////////////
|
||||
@@ -194,11 +196,10 @@ ZIPPO
|
||||
icon_state = "cigaroff"
|
||||
icon_on = "cigaron"
|
||||
icon_off = "cigaroff"
|
||||
icon_butt = "cigarbutt"
|
||||
type_butt = /obj/item/weapon/cigbutt
|
||||
throw_speed = 0.5
|
||||
item_state = "cigaroff"
|
||||
smoketime = 1500
|
||||
butt_count = 0
|
||||
|
||||
/obj/item/clothing/mask/cigarette/cigar/cohiba
|
||||
name = "Cohiba Robusto Cigar"
|
||||
@@ -207,7 +208,7 @@ ZIPPO
|
||||
icon_on = "cigar2on"
|
||||
icon_off = "cigar2off"
|
||||
|
||||
/obj/item/clothing/mask/cigarette/cigar/havanian
|
||||
/obj/item/clothing/mask/cigarette/cigar/havana
|
||||
name = "Premium Havanian Cigar"
|
||||
desc = "A cigar fit for only the best for the best."
|
||||
icon_state = "cigar2off"
|
||||
@@ -218,20 +219,116 @@ ZIPPO
|
||||
/obj/item/weapon/cigbutt
|
||||
name = "cigarette butt"
|
||||
desc = "A manky old cigarette butt."
|
||||
icon = 'cigarettes.dmi'
|
||||
icon = 'masks.dmi'
|
||||
icon_state = "cigbutt"
|
||||
w_class = 1
|
||||
throwforce = 1
|
||||
|
||||
/obj/item/weapon/cigarbutt
|
||||
name = "Cigar butt"
|
||||
/obj/item/weapon/cigbutt/cigarbutt
|
||||
name = "cigar butt"
|
||||
desc = "A manky old cigar butt."
|
||||
icon = 'cigarettes.dmi'
|
||||
icon_state = "cigarbutt"
|
||||
w_class = 1
|
||||
throwforce = 1
|
||||
|
||||
|
||||
/obj/item/clothing/mask/cigarette/cigar/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/match))
|
||||
..()
|
||||
else
|
||||
user << "\red The [src] straight out REFUSES to be lit by such uncivilized means."
|
||||
|
||||
/////////////////
|
||||
//SMOKING PIPES//
|
||||
/////////////////
|
||||
|
||||
/obj/item/clothing/mask/pipe
|
||||
name = "smoking pipe"
|
||||
desc = "A pipe, for smoking. Probably made of meershaum or something."
|
||||
icon_state = "cobpipeoff"
|
||||
throw_speed = 0.5
|
||||
item_state = "cobpipeoff"
|
||||
w_class = 1
|
||||
body_parts_covered = null
|
||||
var
|
||||
lit = 0
|
||||
icon_on = "cobpipeon" //Note - these are in masks.dmi
|
||||
icon_off = "cobpipeoff"
|
||||
lastHolder = null
|
||||
smoketime = 100
|
||||
maxsmoketime = 100 //make sure this is equal to your smoketime
|
||||
proc
|
||||
light(var/flavor_text = "[usr] lights the [name].")
|
||||
|
||||
attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/weldingtool) && W:welding)
|
||||
light("\red [user] casually lights the [name] with [W], what a badass.")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/lighter/zippo) && (W:lit > 0))
|
||||
light("\red With a single flick of their wrist, [user] smoothly lights their [name] with their [W]. Damn they're cool.")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/lighter) && (W:lit > 0))
|
||||
light("\red After some fiddling, [user] manages to light their [name] with [W].")
|
||||
|
||||
else if(istype(W, /obj/item/weapon/match) && (W:lit > 0))
|
||||
light("\red [user] lights \his [name] with \his [W].")
|
||||
return
|
||||
|
||||
light(var/flavor_text = "[usr] lights the [name].")
|
||||
if(!src.lit)
|
||||
src.lit = 1
|
||||
src.damtype = "fire"
|
||||
src.icon_state = icon_on
|
||||
src.item_state = icon_on
|
||||
for(var/mob/O in viewers(usr, null))
|
||||
O.show_message(flavor_text, 1)
|
||||
processing_objects.Add(src)
|
||||
|
||||
process()
|
||||
var/turf/location = get_turf(src)
|
||||
src.smoketime--
|
||||
if(src.smoketime < 1)
|
||||
new /obj/effect/decal/ash(location)
|
||||
if(ismob(src.loc))
|
||||
var/mob/living/M = src.loc
|
||||
M << "\red Your [src.name] goes out, and you empty the ash."
|
||||
src.lit = 0
|
||||
src.icon_state = icon_off
|
||||
src.item_state = icon_off
|
||||
processing_objects.Remove(src)
|
||||
return
|
||||
if(location)
|
||||
location.hotspot_expose(700, 5)
|
||||
return
|
||||
|
||||
dropped(mob/user as mob)
|
||||
if(src.lit == 1)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [] puts out the [].", user,src.name), 1)
|
||||
src.lit = 0
|
||||
src.icon_state = icon_off
|
||||
src.item_state = icon_off
|
||||
processing_objects.Remove(src)
|
||||
return ..()
|
||||
|
||||
/obj/item/clothing/mask/pipe/attack_self(mob/user as mob) //Refills the pipe. Can be changed to an attackby later, if loose tobacco is added to vendors or something.
|
||||
if(src.smoketime <= 0)
|
||||
user << "\blue You refill the pipe with tobacco."
|
||||
smoketime = maxsmoketime
|
||||
return
|
||||
|
||||
/obj/item/clothing/mask/pipe/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W, /obj/item/weapon/match))
|
||||
..()
|
||||
else
|
||||
user << "\red The [src] straight out REFUSES to be lit by such means."
|
||||
|
||||
|
||||
/obj/item/clothing/mask/pipe/cobpipe
|
||||
name = "corn cob pipe"
|
||||
desc = "A nicotine delivery system popularized by folksy backwoodsmen and kept popular in the modern age and beyond by space hipsters."
|
||||
smoketime = 400
|
||||
maxsmoketime = 400
|
||||
|
||||
////////////
|
||||
//CIG PACK//
|
||||
////////////
|
||||
@@ -262,7 +359,11 @@ ZIPPO
|
||||
else
|
||||
src.cigcount--
|
||||
var/obj/item/clothing/mask/cigarette/W = new /obj/item/clothing/mask/cigarette(user)
|
||||
user.put_in_hand(W)
|
||||
if(user.hand)
|
||||
user.l_hand = W
|
||||
else
|
||||
user.r_hand = W
|
||||
W.layer = 20
|
||||
else
|
||||
return ..()
|
||||
src.update_icon()
|
||||
|
||||
Reference in New Issue
Block a user