This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 66
/
cigs_cigars.dm
711 lines (626 loc) · 25.5 KB
/
cigs_cigars.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
// / / / / / / / / / / / / / / / //
/// // WHITESANDS SMOKEABLES // ///
// / / / / / / / / / / / / / / / //
#define CIGARETTE 3.6
#define CIGAR 6
#define SMOKEMINUTE SECONDS*6
//Cigarettes - PACKETS
/obj/item/storage/fancy/cigarettes
name = "\improper Nanotransen packet"
desc = "A standard packet of six Nanotransen approved coping sticks. A label on the packaging reads, \"A loyalists best friend! Now 46% more cancer free!\""
icon = 'whitesands/icons/obj/boxes.dmi'
icon_state = "nt"
icon_type = "cigarette"
w_class = WEIGHT_CLASS_TINY
gender = PLURAL
throwforce = 0
slot_flags = ITEM_SLOT_BELT
spawn_type = /obj/item/clothing/mask/cigarette/nanotransen
custom_price = 75
age_restricted = TRUE
var/othertype = FALSE
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 6
STR.set_holdable(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter, /obj/item/match))
/obj/item/storage/fancy/cigarettes/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to extract contents.</span>"
/obj/item/storage/fancy/cigarettes/AltClick(mob/living/carbon/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
if(W && contents.len > 0)
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
user.put_in_hands(W)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/update_icon_state()
if(fancy_open || !contents.len)
if(!contents.len)
icon_state = "[initial(icon_state)]_empty"
else
icon_state = initial(icon_state)
/obj/item/storage/fancy/cigarettes/update_overlays()
. = ..()
var/obj/item/clothing/mask/cigarette/A = locate(/obj/item/clothing/mask/cigarette) in contents
if(fancy_open && contents.len && !othertype)
. += "[icon_state]_open"
var/cig_position = 1
for(var/C in contents)
var/mutable_appearance/inserted_overlay = mutable_appearance('whitesands/icons/obj/cigarettes.dmi')
if(istype(C, /obj/item/clothing/mask/cigarette))
inserted_overlay.icon_state = "overlay_[A.smoke_type]"
else if(istype(C, /obj/item/reagent_containers/food/snacks/donkpocket))
inserted_overlay.icon_state = "overlay_pocket"
else
inserted_overlay.icon_state = "overlay_other"
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
. += inserted_overlay
cig_position++
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = cig
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, M)
M.equip_to_slot_if_possible(W, ITEM_SLOT_MASK)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
..()
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
//brands
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
name = "\improper Syndicate packet"
desc = "A badass packet of operative healing smokes. A label on the packaging reads, \"You goddamn know who to smoke.\""
icon_state = "syndi"
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_donkco
name = "\improper Donk-Co packet"
desc = "A well packaged fancy box containing the favourite smokes/snack of every hard working spacefarer. A label on the packaging reads, \"Buy now and have a chance to find one free donk pocket duty-free! (Refund not included).\""
icon_state = "donk"
spawn_type = /obj/item/clothing/mask/cigarette/donkco
/obj/item/storage/fancy/cigarettes/cigpack_donkco/Initialize()
. = ..()
if(prob(7))
new /obj/item/storage/fancy/cigarettes/cigpack_donkco/pocket(get_turf(src))
qdel(src)
/obj/item/storage/fancy/cigarettes/cigpack_donkco/pocket
spawn_type = /obj/item/reagent_containers/food/snacks/donkpocket/warm
/obj/item/storage/fancy/cigarettes/cigpack_donkco/pocket/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 1
STR.set_holdable(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter, /obj/item/match, /obj/item/reagent_containers/food/snacks/donkpocket))
/obj/item/storage/fancy/cigarettes/cigpack_waffleco
name = "\improper Waffle-Co packet"
desc = "An irresistable pack of mouth-watering nicotine infusing heavenly sweet goodness."
icon_state = "waffle"
spawn_type = /obj/item/clothing/mask/cigarette/waffleco
/obj/item/storage/fancy/cigarettes/cigpack_solgov
name = "\improper SolGov packet"
desc = "A 6 pack of invigorating duty-free SolGov cigarettes. A label on the packaging reads, \"Move Today! Contact your nearest representative to find out more!\""
icon_state = "solgov"
spawn_type = /obj/item/clothing/mask/cigarette/solgov
/obj/item/storage/fancy/cigarettes/cigpack_superfresh
name = "\improper Superfresh packet"
desc = "The label on the packaging is composed of gibberish and covered in an yellow insulative rubber, one word stands clear to you: \"Superfresh\"."
icon_state = "superfresh"
spawn_type = /obj/item/clothing/mask/cigarette/superfresh
/obj/item/storage/fancy/cigarettes/cigpack_loko
name = "\improper Loko packet"
desc = "A 6 pack of off-the-market space gamer charts! A wicked label on the packaging reads, \"DRINK, GAME, WIN!\""
icon_state = "loko"
spawn_type = /obj/item/clothing/mask/cigarette/loko
/obj/item/storage/fancy/cigarettes/cigpack_xeno
name = "\improper Xeno Filtered packet"
desc = "Loaded with 100% pure slime. And also nicotine."
icon_state = "slime"
spawn_type = /obj/item/clothing/mask/cigarette/xeno
//Rollies - PACKETS
/obj/item/storage/fancy/cigarettes/cigpack_turbo
name = "\improper Turbo packet"
desc = "A 6-pack of turbo brand rollies, guaranteed to make you trip shit like no tommorrow."
icon_state = "turbo"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/turbo
//Cigars - PACKETS
/obj/item/storage/fancy/cigarettes/cigars
name = "\improper Premium cigar case"
desc = "A case of premium cigars. Very expensive."
icon_state = "cigar"
w_class = WEIGHT_CLASS_NORMAL
icon_type = "cigar"
spawn_type = /obj/item/clothing/mask/cigarette/cigar
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 4
STR.set_holdable(list(/obj/item/clothing/mask/cigarette/cigar))
/obj/item/storage/fancy/cigarettes/cigars/update_icon_state()
if(fancy_open)
icon_state = "[initial(icon_state)]_open"
else
icon_state = "[initial(icon_state)]"
/obj/item/storage/fancy/cigarettes/cigars/robusto
name = "\improper Robusto cigar case"
desc = "A case of premium robusto cigars. Smoked by the truly robust."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/robusto
/obj/item/storage/fancy/cigarettes/cigars/gold
name = "\improper Robusto Gold cigar case"
icon_state = "gold"
desc = "A case of the elitist cigars in the known universe."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/gold
/obj/item/storage/fancy/cigarettes/cigars/havana
name = "\improper Cocubana Havana cigar case"
icon_state = "gold"
desc = "The finest empire building, crack smoking cigars. Honchos Only."
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
//Cigarettes - ITEMS
/obj/item/clothing/mask/cigarette
name = "cigarette"
desc = "A roll of tobacco and nicotine."
icon = 'whitesands/icons/obj/cigarettes.dmi'
mob_overlay_icon = 'whitesands/icons/mob/clothing/cigarettes.dmi'
mob_overlay_state = "standard"
lefthand_file = 'whitesands/icons/mob/inhands/equipment/cigarettes_lefthand.dmi'
righthand_file = 'whitesands/icons/mob/inhands/equipment/cigarettes_righthand.dmi'
icon_state = "standard"
item_state = "standard"
throw_speed = 0.5
w_class = WEIGHT_CLASS_TINY
gender = PLURAL
body_parts_covered = null
grind_results = list()
heat = 1000
var/dragtime = 100
var/nextdragtime = 0
var/smoke_all = FALSE
var/lit = FALSE
var/starts_lit = FALSE
var/type_butt = /obj/item/cigbutt
var/lastHolder = null
var/smoketime = 6 SMOKEMINUTE
var/chem_volume = 30
var/list_reagents = list(/datum/reagent/drug/nicotine = 15)
var/lung_harm = 0
var/chain_smoking_damage = 0.01
var/lit_type = "cigarette" //USE FOR LIT OVERLAYS
var/smoke_type = null // USE THIS FOR OVERLAYS, IN PACKET, SHORTENING, AND CUSTOM UNIVERSAL CIGBUTT
/obj/item/clothing/mask/cigarette/test/damage
chain_smoking_damage = 0.1
/obj/item/clothing/mask/cigarette/nanotransen
desc = "A nanotransen generic branded cigarette."
icon_state = "standard"
list_reagents = list(/datum/reagent/drug/nicotine = 15)
smoke_type = "standard"
/obj/item/clothing/mask/cigarette/syndicate
desc = "A suspicious looking, unbranded cigarette."
icon_state = "syndi"
list_reagents = list(/datum/reagent/drug/nicotine = 10, /datum/reagent/medicine/omnizine = 15)
smoke_all = TRUE
smoke_type = "syndi"
/obj/item/clothing/mask/cigarette/donkco
desc = "A donk-co branded cigarette, hunger for those without time or hands."
icon_state = "donk"
list_reagents = list(/datum/reagent/drug/nicotine = 10, /datum/reagent/consumable/nutriment/stabilized = 5, /datum/reagent/medicine/omnizine = 2)
smoke_type = "donk"
/obj/item/clothing/mask/cigarette/waffleco
desc = "A waffle-co branded cigarette, it smells amazing."
icon_state = "waffle"
list_reagents = list(/datum/reagent/drug/nicotine = 10, /datum/reagent/consumable/corn_syrup = 14, /datum/reagent/consumable/honey = 1)
smoke_type = "waffle"
/obj/item/clothing/mask/cigarette/waffleco/Initialize()
if(prob(25))
list_reagents += list(/datum/reagent/consumable/secretsauce = 5)
. = ..()
/obj/item/clothing/mask/cigarette/solgov
desc = "A duty-free solgov cigarette, refreshing."
icon_state = "solgov"
list_reagents = list(/datum/reagent/drug/nicotine = 10, /datum/reagent/consumable/tonic = 10) //straight from sol itself!
smoke_type = "solgov"
/obj/item/clothing/mask/cigarette/superfresh
desc = "A mysterious maintenance cigarette, legends say only true greytiders know whats within."
icon_state = "superfresh"
smoke_type = "superfresh"
/obj/item/clothing/mask/cigarette/superfresh/Initialize()
list_reagents = list(/datum/reagent/drug/nicotine = 10, get_random_reagent_id() = rand(5,20))
. = ..()
/obj/item/clothing/mask/cigarette/loko
desc = "A potentially highly dangerous and super sweet space gamer cigarette, Rumored to have been taken off the market for \"Safety Concerns\" years ago."
icon_state = "loko"
list_reagents = list(/datum/reagent/drug/nicotine = 20, /datum/reagent/toxin/mutagen/mutagenvirusfood/sugar = 5, /datum/reagent/toxin/mindbreaker = 10, /datum/reagent/consumable/ethanol/thirteenloko = 3)
smoke_type = "loko"
/obj/item/clothing/mask/cigarette/xeno
desc = "A Xeno Filtered brand cigarette."
icon_state = "slime"
list_reagents = list (/datum/reagent/drug/nicotine = 20, /datum/reagent/medicine/regen_jelly = 15, /datum/reagent/drug/krokodil = 4)
smoke_all = TRUE
smoke_type = "slime"
//Rollies - ITEMS
/obj/item/clothing/mask/cigarette/rollie
name = "rollie"
desc = "A roll of dried plant matter wrapped in thin paper."
icon_state = "boof"
smoke_type = "boof"
chem_volume = 50
lit_type = "joint"
list_reagents = list(/datum/reagent/drug/space_drugs = 35)
/obj/item/clothing/mask/cigarette/rollie/Initialize()
. = ..()
pixel_x = rand(-3, 3)
pixel_y = rand(-3, 3)
/obj/item/clothing/mask/cigarette/rollie/custom
chain_smoking_damage = 0
smoketime = 4 SMOKEMINUTE
/obj/item/clothing/mask/cigarette/rollie/turbo
desc = "A turbo branded rollie, for the good times."
list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/drug/space_drugs = 10, /datum/reagent/drug/happiness = 10)
/obj/item/clothing/mask/cigarette/rollie/trippy
list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/drug/mushroomhallucinogen = 35)
starts_lit = TRUE
/obj/item/clothing/mask/cigarette/rollie/cannabis
list_reagents = list(/datum/reagent/drug/space_drugs = 15, /datum/reagent/toxin/lipolicide = 35)
//Cigars - ITEMS
/obj/item/clothing/mask/cigarette/cigar
name = "premium cigar"
desc = "A brown roll of tobacco and... well, you're not quite sure. This thing's huge!"
icon_state = "cigar"
smoketime = 10 SMOKEMINUTE
chem_volume = 40
list_reagents = list(/datum/reagent/drug/nicotine = 35)
lit_type = "cigar"
smoke_type = "cigar"
/obj/item/clothing/mask/cigarette/cigar/robusto
name = "robusto cigar"
desc = "A hefty wad of nicotine and robusting goodness."
icon_state = "robusto"
smoketime = 20 SMOKEMINUTE
chem_volume = 60
list_reagents = list(/datum/reagent/drug/nicotine = 30, /datum/reagent/consumable/grey_bull = 10)
smoke_type = "robusto"
/obj/item/clothing/mask/cigarette/cigar/gold
name = "robusto gold cigar"
desc = "The Elite Cigar, for the truly robust."
icon_state = "gold"
smoketime = 30 SMOKEMINUTE
chem_volume = 80
chain_smoking_damage = 0.005 //15 minutes of smoke damage
list_reagents = list(/datum/reagent/drug/nicotine = 60, /datum/reagent/gold = 10)
smoke_type = "gold"
/obj/item/clothing/mask/cigarette/cigar/havana
name = "premium Havanian cigar"
desc = "A cigar fit for only the best of the best."
icon_state = "gold"
smoketime = 30 SMOKEMINUTE
chain_smoking_damage = 0 //badass antag only cigar, no cancer
list_reagents = list(/datum/reagent/drug/nicotine = 35)
smoke_type = "gold"
/obj/item/clothing/mask/cigarette/cigar/cohiba
name = "robusto Cohiba cigar"
desc = "A cigar fit for only the robustest of the robust."
icon_state = "robusto"
smoketime = 30 SMOKEMINUTE
list_reagents = list(/datum/reagent/drug/nicotine = 30, /datum/reagent/consumable/grey_bull = 10)
smoke_type = "robusto"
//Vapes - ITEMS
/obj/item/clothing/mask/vape/cigar
name = "\improper E-Cigar"
desc = "The latest recreational device developed by a small tech startup, Shadow Tech, the E-Cigar has all the uses of a normal E-Cigarette, with the classiness of short fat cigar. Must be lit via interfacing with a PDA."
icon_state = "ecigar_vapeoff"
item_state = "ecigar_vapeoff"
vapecolor = "ecigar"
overlayname = "ecigar"
chem_volume = 150
custom_premium_price = 300
//Cigbutt - ITEM
/obj/item/cigbutt
name = "cigarette butt"
desc = "A manky old cigarette butt."
icon = 'whitesands/icons/obj/cigarettes.dmi'
icon_state = "butt"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
grind_results = list(/datum/reagent/carbon = 2)
/obj/item/cigbutt/Initialize()
. = ..()
if(prob(7))
qdel(src)
new /obj/item/cigbutt/cigar(src)
/obj/item/cigbutt/cigar
name = "cigar butt"
desc = "A manky old cigar butt."
icon_state = "butt_alt"
grind_results = list(/datum/reagent/carbon = 10)
//Cigarettes - CODE
/obj/item/clothing/mask/cigarette/proc/light() //removes lit and unlit states
if(lit)
return
START_PROCESSING(SSobj, src)
lit = TRUE
update_overlays()
item_state = "[initial(lit_type)]_lit"
mob_overlay_state = "[initial(lit_type)]_lit"
name = "lit [name]"
attack_verb = list("burnt", "singed")
hitsound = 'sound/items/welder.ogg'
damtype = "fire"
force = 4
if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma))
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount(/datum/reagent/toxin/plasma) / 2.5, 1), get_turf(src), 0, 0)
e.start()
qdel(src)
return
if(reagents.get_reagent_amount(/datum/reagent/fuel))
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount(/datum/reagent/fuel) / 5, 1), get_turf(src), 0, 0)
e.start()
qdel(src)
return
// allowing reagents to react after being lit
reagents.flags &= ~(NO_REACT)
reagents.handle_reactions()
if(ismob(loc))
var/mob/M = loc
M.update_inv_wear_mask()
M.update_inv_hands()
playsound(src, 'sound/items/cig_light.ogg', 25, 1)
/obj/item/clothing/mask/cigarette/extinguish() //removes lit and unlit states
if(!lit)
return
name = copytext_char(name, 5)
attack_verb = null
hitsound = null
damtype = BRUTE
force = 0
STOP_PROCESSING(SSobj, src)
reagents.flags |= NO_REACT
lit = FALSE
update_overlays()
item_state = "[initial(lit_type)]_extinguished"
mob_overlay_state = "[initial(lit_type)]_extinguished"
if(ismob(loc))
var/mob/living/M = loc
var/obj/item/organ/lungs/L = M.getorganslot(ORGAN_SLOT_LUNGS)
L.smoking = FALSE
to_chat(M, "<span class='notice'>Your [name] goes out.</span>")
M.update_inv_wear_mask()
M.update_inv_hands()
/obj/item/clothing/mask/cigarette/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is huffing [src] as quickly as [user.p_they()] can! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer.</span>")
return (TOXLOSS|OXYLOSS)
/obj/item/clothing/mask/cigarette/Initialize()
. = ..()
mob_overlay_state = lit_type
item_state = lit_type
create_reagents(chem_volume, INJECTABLE | NO_REACT)
if(list_reagents)
reagents.add_reagent_list(list_reagents)
if(starts_lit)
light()
AddComponent(/datum/component/knockoff,90,list(BODY_ZONE_PRECISE_MOUTH),list(ITEM_SLOT_MASK))//90% to knock off when wearing a mask
/obj/item/clothing/mask/cigarette/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/clothing/mask/cigarette/attackby(obj/item/W, mob/user, params)
if(!lit && smoketime > 0)
var/lighting_text = W.ignition_effect(src, user)
if(lighting_text)
light(lighting_text)
else
return ..()
/obj/item/clothing/mask/cigarette/afterattack(obj/item/reagent_containers/glass/glass, mob/user, proximity)
. = ..()
if(!proximity || lit) //can't dip if cigarette is lit (it will heat the reagents in the glass instead)
return
if(istype(glass)) //you can dip cigarettes into beakers
if(glass.reagents.trans_to(src, chem_volume, transfered_by = user)) //if reagents were transfered, show the message
to_chat(user, "<span class='notice'>You dip \the [src] into \the [glass].</span>")
else //if not, either the beaker was empty, or the cigarette was full
if(!glass.reagents.total_volume)
to_chat(user, "<span class='warning'>[glass] is empty!</span>")
else
to_chat(user, "<span class='warning'>[src] is full!</span>")
/obj/item/clothing/mask/cigarette/process()
var/mob/living/M = loc
if(isliving(loc))
M.IgniteMob()
smoketime--
if(smoketime < 1)
var/obj/butt
butt = new type_butt(get_turf(src))
butt.pixel_x = rand(-10, 2)
butt.pixel_y = rand(-10, 2)
butt.icon_state = "[smoke_type]_4"
butt.add_overlay(image(icon, icon_state = "[lit_type]_extinguished", pixel_x = 6, pixel_y = 6))
butt.name = "[lit_type] butt"
if(ismob(loc))
to_chat(M, "<span class='notice'>Your [name] goes out.</span>")
playsound(src, 'sound/items/cig_snuff.ogg', 25, 1)
qdel(src)
return
open_flame()
shmoke()
switch(smoketime)
if(288)
icon_state = "[smoke_type]_1"
update_overlays()
if(215)
icon_state = "[smoke_type]_2"
update_overlays()
if(143)
icon_state = "[smoke_type]_3"
update_overlays()
if(71)
icon_state = "[smoke_type]_4"
update_overlays()
if((reagents && reagents.total_volume) && (nextdragtime <= world.time))
nextdragtime = world.time + dragtime
handle_reagents()
/obj/item/clothing/mask/cigarette/proc/handle_reagents()
if(reagents.total_volume)
var/to_smoke = REAGENTS_METABOLISM
if(iscarbon(loc))
var/mob/living/carbon/C = loc
if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob
var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1)
/*
* Given the amount of time the cig will last, and how often we take a hit, find the number
* of chems to give them each time so they'll have smoked it all by the end.
*/
if (smoke_all)
to_smoke = reagents.total_volume/((smoketime * 2) / (dragtime / 10))
reagents.expose(C, INGEST, fraction)
var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS)
if(L && !(L.organ_flags & ORGAN_SYNTHETIC))
C.adjustOrganLoss(ORGAN_SLOT_LUNGS, lung_harm)
if(!reagents.trans_to(C, to_smoke))
reagents.remove_any(to_smoke)
return
reagents.remove_any(to_smoke)
/obj/item/clothing/mask/cigarette/attack_self(mob/user)
if(lit)
user.visible_message("<span class='notice'>[user] calmly drops and treads on \the [src], putting it out instantly.</span>")
playsound(src, 'sound/items/cig_snuff.ogg', 25, 1)
var/obj/butt
butt = new type_butt(get_turf(src))
butt.pixel_x = rand(-10, 2)
butt.pixel_y = rand(-10, 2)
butt.icon_state = "[smoke_type]_4"
butt.add_overlay(image(icon, icon_state = "[lit_type]_extinguished", pixel_x = 6, pixel_y = 6))
butt.name = "[lit_type] butt"
new /obj/effect/decal/cleanable/ash(user.loc)
qdel(src)
. = ..()
/obj/item/clothing/mask/cigarette/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!istype(M))
return ..()
if(M.on_fire && !lit)
light("<span class='notice'>[user] lights [src] with [M]'s burning body. What a cold-blooded badass.</span>")
return
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && user.a_intent == INTENT_HELP)
if(cig.lit)
to_chat(user, "<span class='warning'>The [cig.name] is already lit!</span>")
if(M == user)
cig.attackby(src, user)
else
cig.light("<span class='notice'>[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name].</span>")
else
return ..()
/obj/item/clothing/mask/cigarette/fire_act(exposed_temperature, exposed_volume)
light()
/obj/item/clothing/mask/cigarette/get_temperature()
return lit * heat
/obj/item/clothing/mask/cigarette/update_overlays()
var/lit_or_extinguished
if(lit)
lit_or_extinguished = "lit"
if(!lit)
lit_or_extinguished = "extinguished"
if(lit || !lit)
cut_overlays()
var/mutable_appearance/LT = mutable_appearance(icon_state = "[lit_type]_[lit_or_extinguished]")
switch(smoketime)
if(289 to 1800)
add_overlay(LT)
if(216 to 288)
LT.pixel_x = 2
LT.pixel_y = 2
add_overlay(LT)
if(144 to 215)
LT.pixel_x = 4
LT.pixel_y = 4
add_overlay(LT)
if(72 to 143)
LT.pixel_x = 5
LT.pixel_y = 5
add_overlay(LT)
if(0 to 71)
LT.pixel_x = 6
LT.pixel_y = 6
add_overlay(LT)
. = ..()
/obj/item/clothing/mask/cigarette/proc/shmoke()
if(iscarbon(loc))
var/mob/living/carbon/C = loc
var/obj/item/organ/lungs/L = C.getorganslot(ORGAN_SLOT_LUNGS)
if(src == C.wear_mask)
L.smoking = TRUE
if(L && !(L.organ_flags & ORGAN_SYNTHETIC) && L.chain_smokah < 100)
L.chain_smokah += chain_smoking_damage
if(!(src == C.wear_mask))
L.smoking = FALSE
/obj/item/organ/lungs
var/chain_smokah = 0
var/smoking = FALSE
/obj/item/organ/lungs/on_life()
. = ..()
if(!smoking && (chain_smokah) >= (7.2)) //no cigarette in mouth, has smoked at least 2 cigarette
chain_smokah -= 0.06 //dissipates 1 cigarette smoked a minute
switch(chain_smokah)
if(10.8 to 14.3) //3 cigarettes
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.01)
if(prob(1))
to_chat(owner, "<span class='danger'>[pick("You're having difficulty breathing.", "Your breathing becomes heavy.")]</span>")
if(prob(5))
owner.emote(pick("cough","yawn"))
if(14.4 to 17.9) //4 cigarettes
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.02)
if(prob(1))
to_chat(owner, "<span class='danger'>[pick("You're having difficulty breathing.", "Your breathing becomes heavy.")]</span>")
if(prob(5))
owner.emote(pick("cough","yawn","twitch_s"))
if(prob(1))
owner.Jitter(8)
if(18 to 21.5) //5 cigarettes
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.03)
if(prob(1))
to_chat(owner, "<span class='userdanger'>[pick("Your throat itches with dryness, it is very hard to breathe!", "Your eyes water and throat fills with smog!")]</span>")
owner.emote("cough")
if(prob(7))
owner.emote(pick("cough","yawn","twitch_s","sway"))
if(prob(2))
owner.Jitter(8)
if(prob(1))
owner.blur_eyes(10)
if(21.6 to 25.1) //6 cigarettes
var/list/screens = list(owner.hud_used.plane_masters["[FLOOR_PLANE]"], owner.hud_used.plane_masters["[GAME_PLANE]"], owner.hud_used.plane_masters["[LIGHTING_PLANE]"])
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 0.04)
if(prob(1))
to_chat(owner, "<span class='userdanger'>[pick("Your throat itches with dryness, it is very hard to breathe!", "Your eyes water and throat fills with smog!")]</span>")
if(prob(10))
owner.emote(pick("cough","yawn","twitch_s","sway","gasp"))
if(prob(5))
owner.Jitter(8)
if(prob(3))
owner.blur_eyes(10)
if(owner.hud_used)
for(var/whole_screen in screens)
animate(whole_screen, transform = matrix(5, MATRIX_ROTATE), time = 5, easing = QUAD_EASING, loop = -1)
animate(transform = matrix(-5, MATRIX_ROTATE), time = 5, easing = QUAD_EASING)
if(25.2 to 100) //7 cigarettes
var/list/screens = list(owner.hud_used.plane_masters["[FLOOR_PLANE]"], owner.hud_used.plane_masters["[GAME_PLANE]"], owner.hud_used.plane_masters["[LIGHTING_PLANE]"])
owner.adjustOrganLoss(ORGAN_SLOT_LUNGS, 1)
if(prob(1))
to_chat(owner, "<span class='userdanger'>[pick("You take a hearty gasp! Finding it near impossible to breathe!")]</span>")
owner.emote("gasp")
if(prob(15))
owner.emote(pick("cough","yawn","twitch_s","sway","gasp"))
if(prob(10))
owner.Jitter(8)
if(prob(10))
owner.blur_eyes(10)
if(prob(3))
owner.vomit(20)
if(owner.hud_used)
for(var/whole_screen in screens)
animate(whole_screen, transform = matrix(10, MATRIX_ROTATE), time = 5, easing = QUAD_EASING, loop = -1)
animate(transform = matrix(-10, MATRIX_ROTATE), time = 5, easing = QUAD_EASING)