-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathcigs_lighters.dm
981 lines (864 loc) · 31.3 KB
/
cigs_lighters.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
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
//cleansed 9/15/2012 17:48
/*
CONTAINS:
MATCHES
CIGARETTES
CIGARS
SMOKING PIPES
CHEAP LIGHTERS
ZIPPO
CIGARETTE PACKETS ARE IN FANCY.DM
*/
///////////
//MATCHES//
///////////
/obj/item/match
name = "match"
desc = "A simple match stick, used for lighting fine smokables."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "match_unlit"
var/lit = FALSE
var/burnt = FALSE
var/smoketime = 10
w_class = WEIGHT_CLASS_TINY
heat = 1000
grind_results = list(/datum/reagent/phosphorus = 2)
/obj/item/match/process(delta_time)
smoketime -= delta_time
if(smoketime <= 0)
matchburnout()
else
open_flame(heat)
/obj/item/match/fire_act(exposed_temperature, exposed_volume)
matchignite()
/obj/item/match/proc/matchignite()
if(!lit && !burnt)
playsound(src, "sound/items/match_strike.ogg", 15, TRUE)
lit = TRUE
icon_state = "match_lit"
damtype = BURN
force = 3
hitsound = 'sound/items/welder.ogg'
item_state = "cigon"
name = "lit [initial(name)]"
desc = "A [initial(name)]. This one is lit."
attack_verb = list("burnt","singed")
START_PROCESSING(SSobj, src)
update_appearance(UPDATE_ICON)
/obj/item/match/proc/matchburnout()
if(lit)
lit = FALSE
burnt = TRUE
damtype = "brute"
force = initial(force)
icon_state = "match_burnt"
item_state = "cigoff"
name = "burnt [initial(name)]"
desc = "A [initial(name)]. This one has seen better days."
attack_verb = list("flicked")
STOP_PROCESSING(SSobj, src)
/obj/item/match/extinguish()
matchburnout()
/obj/item/match/dropped(mob/user)
matchburnout()
. = ..()
/obj/item/match/attack(mob/living/carbon/M, mob/living/carbon/user)
if(!isliving(M))
return
if(lit && M.ignite_mob())
message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]")
log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]")
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && !user.combat_mode)
if(cig.lit)
to_chat(user, span_notice("[cig] is already lit."))
if(M == user)
cig.attackby(src, user)
else
cig.light(span_notice("[user] holds [src] out for [M], and lights [cig]."))
playsound(src, 'sound/items/lighter/light.ogg', 50, 2)
else
..()
/obj/item/proc/help_light_cig(mob/living/M)
var/mask_item = M.get_item_by_slot(ITEM_SLOT_MASK)
if(istype(mask_item, /obj/item/clothing/mask/cigarette))
return mask_item
/obj/item/match/is_hot()
return lit * heat
/obj/item/match/firebrand
name = "firebrand"
desc = "An unlit firebrand. It makes you wonder why it's not just called a stick."
smoketime = 40
grind_results = list(/datum/reagent/carbon = 2)
/obj/item/match/firebrand/Initialize(mapload)
. = ..()
matchignite()
//////////////////
//FINE SMOKABLES//
//////////////////
/obj/item/clothing/mask/cigarette
name = "cigarette"
desc = "A roll of tobacco and nicotine."
icon_state = "cigoff"
throw_speed = 0.5
item_state = "cigoff"
w_class = WEIGHT_CLASS_TINY
body_parts_covered = null
grind_results = list()
heat = 1000
var/dragtime = 10
var/nextdragtime = 0
var/lit = FALSE
var/starts_lit = FALSE
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
var/icon_off = "cigoff"
var/type_butt = /obj/item/cigbutt
var/lastHolder = null
var/smoketime = 360 // how long a smoke lasts in seconds.
var/chem_volume = 30
var/list/list_reagents = list(/datum/reagent/drug/nicotine = 15)
/obj/item/clothing/mask/cigarette/suicide_act(mob/user)
user.visible_message(span_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."))
return (TOXLOSS|OXYLOSS)
/obj/item/clothing/mask/cigarette/Initialize(mapload)
. = ..()
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/attack_hand(mob/user, modifiers)
if(!lit && isethereal(user) && user.combat_mode)
light("With a snap of [user.p_their()] fingers, [user] lights [src].")
return
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_notice("You dip \the [src] into \the [glass]."))
else //if not, either the beaker was empty, or the cigarette was full
if(!glass.reagents.total_volume)
to_chat(user, span_notice("[glass] is empty."))
else
to_chat(user, span_notice("[src] is full."))
/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null)
if(lit)
return
if(!(flags_1 & INITIALIZED_1))
icon_state = icon_on
item_state = icon_on
return
var/exploded = FALSE
var/face_explodable = FALSE
lit = TRUE
name = "lit [name]"
attack_verb = list("burnt", "singed")
hitsound = 'sound/items/welder.ogg'
damtype = BURN
force = 4
var/mob/living/carbon/C = null
if(iscarbon(loc))
C = loc
if(src == C.wear_mask)
face_explodable = TRUE
if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma)) // the plasma explodes when exposed to fire
explosion(get_turf(src),-1,0,2,2)
exploded = TRUE
reagents.clear_reagents()
if(reagents.get_reagent_amount(/datum/reagent/fuel)) // the fuel explodes, too, but much less violently
explosion(get_turf(src),-1,0,1,2)
exploded = TRUE
reagents.clear_reagents()
if(reagents.get_reagent_amount(/datum/reagent/nitroglycerin)) // nitrogylcerin explodes a little more
explosion(get_turf(src),-1,0,3,3)
exploded = TRUE
reagents.clear_reagents()
if(exploded)
if(C && face_explodable)
C.apply_damage(150,BRUTE,BODY_ZONE_HEAD)
to_chat(C, span_userdanger("Your [name] explodes in your face!"))
qdel(src)
return
// allowing reagents to react after being lit
DISABLE_BITFIELD(reagents.flags, NO_REACT)
reagents.handle_reactions()
icon_state = icon_on
item_state = icon_on
if(flavor_text)
var/turf/T = get_turf(src)
T.visible_message(flavor_text)
START_PROCESSING(SSobj, src)
//can't think of any other way to update the overlays :<
if(C)
C.update_inv_wear_mask()
C.update_inv_hands()
/obj/item/clothing/mask/cigarette/extinguish()
if(!lit)
return
name = copytext_char(name, 5) //5 == length_char("lit ") + 1
attack_verb = null
hitsound = null
damtype = BRUTE
force = 0
icon_state = icon_off
item_state = icon_off
STOP_PROCESSING(SSobj, src)
ENABLE_BITFIELD(reagents.flags, NO_REACT)
lit = FALSE
if(ismob(loc))
var/mob/living/M = loc
to_chat(M, span_notice("Your [name] goes out."))
M.update_inv_wear_mask()
M.update_inv_hands()
/obj/item/clothing/mask/cigarette/proc/handle_reagents()
if(reagents.total_volume)
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)
reagents.reaction(C, INGEST, fraction)
if(!reagents.trans_to(C, REAGENTS_METABOLISM))
reagents.remove_any(REAGENTS_METABOLISM)
return
reagents.remove_any(REAGENTS_METABOLISM)
/obj/item/clothing/mask/cigarette/process(delta_time)
var/turf/location = get_turf(src)
var/mob/living/M = loc
if(isliving(loc))
M.ignite_mob()
smoketime -= delta_time
if(smoketime <= 0)
new type_butt(location)
if(ismob(loc))
to_chat(M, span_notice("Your [name] goes out."))
qdel(src)
return
open_flame()
if((reagents && reagents.total_volume) && (nextdragtime <= world.time))
nextdragtime = world.time + dragtime SECONDS
handle_reagents()
/obj/item/clothing/mask/cigarette/attack_self(mob/user)
if(lit)
user.visible_message(span_notice("[user] calmly drops and treads on \the [src], putting it out instantly."))
new type_butt(user.loc)
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_notice("[user] lights [src] with [M]'s burning body. What a cold-blooded badass."))
return
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && !user.combat_mode)
if(cig.lit)
to_chat(user, span_notice("The [cig.name] is already lit."))
if(M == user)
cig.attackby(src, user)
else
cig.light(span_notice("[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name]."))
playsound(src, 'sound/items/lighter/light.ogg', 50, 2)
else
return ..()
/obj/item/clothing/mask/cigarette/fire_act(exposed_temperature, exposed_volume)
light()
/obj/item/clothing/mask/cigarette/is_hot()
return lit * heat
// Cigarette brands.
/obj/item/clothing/mask/cigarette/space_cigarette
desc = "A Space Cigarette brand cigarette."
/obj/item/clothing/mask/cigarette/dromedary
desc = "A DromedaryCo brand cigarette."
/obj/item/clothing/mask/cigarette/uplift
desc = "An Uplift Smooth brand cigarette."
list_reagents = list(/datum/reagent/drug/nicotine = 13, /datum/reagent/consumable/menthol = 5)
/obj/item/clothing/mask/cigarette/robust
desc = "A Robust brand cigarette."
/obj/item/clothing/mask/cigarette/robustgold
desc = "A Robust Gold brand cigarette."
list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/gold = 3) // Just enough to taste a hint of expensive metal.
/obj/item/clothing/mask/cigarette/carp
desc = "A Carp Classic brand cigarette."
/obj/item/clothing/mask/cigarette/syndicate
desc = "An unknown brand cigarette."
list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/medicine/omnizine = 15)
/obj/item/clothing/mask/cigarette/shadyjims
desc = "A Shady Jim's Super Slims cigarette."
list_reagents = list(/datum/reagent/drug/nicotine = 15, /datum/reagent/toxin/lipolicide = 4, /datum/reagent/ammonia = 2, /datum/reagent/toxin/plantbgone = 1, /datum/reagent/toxin = 1.5)
/obj/item/clothing/mask/cigarette/xeno
desc = "A Xeno Filtered brand cigarette."
list_reagents = list(/datum/reagent/drug/nicotine = 20, /datum/reagent/medicine/regen_jelly = 15, /datum/reagent/drug/krokodil = 4)
/obj/item/clothing/mask/cigarette/nonico
desc = "A tobacco-free cigarette, it contains chamomile, lemon balm, and catnip."
list_reagents = list(/datum/reagent/carbon = 15)
// Rollies.
/obj/item/clothing/mask/cigarette/rollie
name = "rollie"
desc = "A roll of dried plant matter wrapped in thin paper."
icon_state = "spliffoff"
icon_on = "spliffon"
icon_off = "spliffoff"
type_butt = /obj/item/cigbutt/roach
throw_speed = 0.5
item_state = "spliffoff"
smoketime = 4 * 60
chem_volume = 50
list_reagents = null
/obj/item/clothing/mask/cigarette/rollie/Initialize(mapload)
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
/obj/item/clothing/mask/cigarette/rollie/nicotine
list_reagents = list(/datum/reagent/drug/nicotine = 15)
/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)
/obj/item/clothing/mask/cigarette/rollie/mindbreaker
list_reagents = list(/datum/reagent/toxin/mindbreaker = 35, /datum/reagent/toxin/lipolicide = 15)
/obj/item/cigbutt/roach
name = "roach"
desc = "A manky old roach, or for non-stoners, a used rollup."
icon_state = "roach"
/obj/item/cigbutt/roach/Initialize(mapload)
. = ..()
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
////////////
// CIGARS //
////////////
/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 = "cigaroff"
icon_on = "cigaron"
icon_off = "cigaroff" //make sure to add positional sprites in icons/obj/cigarettes.dmi if you add more.
type_butt = /obj/item/cigbutt/cigarbutt
throw_speed = 0.5
item_state = "cigaroff"
smoketime = 11 * 60 // 11 minutes
chem_volume = 40
list_reagents = list(/datum/reagent/drug/nicotine = 25)
/obj/item/clothing/mask/cigarette/cigar/cohiba
name = "\improper Cohiba Robusto cigar"
desc = "There's little more you could want from a cigar."
icon_state = "cigar2off"
icon_on = "cigar2on"
icon_off = "cigar2off"
smoketime = 20 * 60 // 20 minutes
chem_volume = 80
list_reagents =list(/datum/reagent/drug/nicotine = 40)
/obj/item/clothing/mask/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 = 30 * 60 // 30 minutes
chem_volume = 50
list_reagents =list(/datum/reagent/drug/nicotine = 15)
/obj/item/cigbutt
name = "cigarette butt"
desc = "A manky old cigarette butt."
icon = 'icons/obj/clothing/masks.dmi'
icon_state = "cigbutt"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
grind_results = list(/datum/reagent/carbon = 2)
/obj/item/cigbutt/cigarbutt
name = "cigar butt"
desc = "A manky old cigar butt."
icon_state = "cigarbutt"
/////////////////
//SMOKING PIPES//
/////////////////
/obj/item/clothing/mask/cigarette/pipe
name = "smoking pipe"
desc = "A pipe, for smoking. Probably made of meerschaum or something."
icon_state = "pipeoff"
item_state = "pipeoff"
icon_on = "pipeon" //Note - these are in masks.dmi
icon_off = "pipeoff"
smoketime = 0
chem_volume = 100
list_reagents = null
var/packeditem = 0
/obj/item/clothing/mask/cigarette/pipe/Initialize(mapload)
. = ..()
name = "empty [initial(name)]"
/obj/item/clothing/mask/cigarette/pipe/Destroy()
STOP_PROCESSING(SSobj, src)
. = ..()
/obj/item/clothing/mask/cigarette/pipe/process(delta_time)
var/turf/location = get_turf(src)
smoketime -= delta_time
if(smoketime <= 0)
new /obj/effect/decal/cleanable/ash(location)
if(ismob(loc))
var/mob/living/M = loc
to_chat(M, span_notice("Your [name] goes out."))
lit = 0
icon_state = icon_off
item_state = icon_off
M.update_inv_wear_mask()
packeditem = 0
name = "empty [initial(name)]"
STOP_PROCESSING(SSobj, src)
return
open_flame()
if(reagents && reagents.total_volume) // check if it has any reagents at all
handle_reagents()
/obj/item/clothing/mask/cigarette/pipe/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/reagent_containers/food/snacks/grown))
var/obj/item/reagent_containers/food/snacks/grown/G = O
if(!packeditem)
if(G.dry == 1)
to_chat(user, span_notice("You stuff [O] into [src]."))
smoketime = 13 * 60
packeditem = 1
name = "[O.name]-packed [initial(name)]"
if(O.reagents)
O.reagents.trans_to(src, O.reagents.total_volume, transfered_by = user)
qdel(O)
else
to_chat(user, span_warning("It has to be dried first!"))
else
to_chat(user, span_warning("It is already packed!"))
else
var/lighting_text = O.ignition_effect(src,user)
if(lighting_text)
if(smoketime > 0)
light(lighting_text)
else
to_chat(user, span_warning("There is nothing to smoke!"))
else
return ..()
/obj/item/clothing/mask/cigarette/pipe/attack_self(mob/user)
var/turf/location = get_turf(user)
if(lit)
user.visible_message(span_notice("[user] puts out [src]."), span_notice("You put out [src]."))
lit = 0
icon_state = icon_off
item_state = icon_off
STOP_PROCESSING(SSobj, src)
return
if(!lit && smoketime > 0)
to_chat(user, span_notice("You empty [src] onto [location]."))
new /obj/effect/decal/cleanable/ash(location)
packeditem = 0
smoketime = 0
reagents.clear_reagents()
name = "empty [initial(name)]"
return
/obj/item/clothing/mask/cigarette/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. Can be loaded with objects."
icon_state = "cobpipeoff"
item_state = "cobpipeoff"
icon_on = "cobpipeon" //Note - these are in masks.dmi
icon_off = "cobpipeoff"
smoketime = 0
/////////
//ZIPPO//
/////////
/obj/item/lighter
name = "\improper Zippo lighter"
desc = "The zippo."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "zippo"
item_state = "zippo"
w_class = WEIGHT_CLASS_TINY
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
light_system = MOVABLE_LIGHT
light_range = 2
light_power = 0.6
light_on = FALSE
var/lit = 0
var/fancy = TRUE
var/overlay_state
var/overlay_list = list(
"plain",
"dame",
"thirteen",
"snake"
)
heat = 1500
resistance_flags = FIRE_PROOF
light_color = LIGHT_COLOR_FIRE
grind_results = list(/datum/reagent/iron = 1, /datum/reagent/fuel = 5, /datum/reagent/oil = 5)
/obj/item/lighter/Initialize(mapload)
. = ..()
if(!overlay_state)
overlay_state = pick(overlay_list)
update_appearance(UPDATE_ICON)
/obj/item/lighter/cyborg_unequip(mob/user)
if(!lit)
return
set_lit(FALSE)
/obj/item/lighter/suicide_act(mob/living/carbon/user)
if (lit)
user.visible_message(span_suicide("[user] begins holding \the [src]'s flame up to [user.p_their()] face! It looks like [user.p_theyre()] trying to commit suicide!"))
playsound(src, 'sound/items/welder.ogg', 50, 1)
return FIRELOSS
else
user.visible_message(span_suicide("[user] begins whacking [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/lighter/update_overlays()
. = ..()
var/mutable_appearance/lighter_overlay = mutable_appearance(icon,"lighter_overlay_[overlay_state][lit ? "-on" : ""]")
icon_state = "[initial(icon_state)][lit ? "-on" : ""]"
. += lighter_overlay
/obj/item/lighter/ignition_effect(atom/A, mob/user)
if(is_hot())
. = span_rose("With a single flick of [user.p_their()] wrist, [user] smoothly lights [A] with [src]. Damn [user.p_theyre()] cool.")
playsound(src, 'sound/items/lighter/light.ogg', 50, 2)
/obj/item/lighter/proc/set_lit(new_lit)
if(lit == new_lit)
return
lit = new_lit
if(lit)
force = 5
damtype = BURN
hitsound = 'sound/items/welder.ogg'
attack_verb = list("burnt", "singed")
START_PROCESSING(SSobj, src)
else
hitsound = "swing_hit"
force = 0
attack_verb = null //human_defense.dm takes care of it
STOP_PROCESSING(SSobj, src)
set_light_on(lit)
update_appearance(UPDATE_ICON)
/obj/item/lighter/extinguish()
set_lit(FALSE)
/obj/item/lighter/attack_self(mob/living/user)
if(user.is_holding(src))
if(!lit)
set_lit(TRUE)
if(fancy)
user.visible_message("Without even breaking stride, [user] flips open and lights [src] in one smooth movement.", span_notice("Without even breaking stride, you flip open and light [src] in one smooth movement."))
playsound(src, 'sound/items/lighter/strike.ogg', 50, 2)
else
var/prot = FALSE
var/mob/living/carbon/human/H = user
if(istype(H) && H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.max_heat_protection_temperature)
prot = (G.max_heat_protection_temperature > 360)
else
prot = TRUE
if(prot || prob(75))
user.visible_message("After a few attempts, [user] manages to light [src].", span_notice("After a few attempts, you manage to light [src]."))
playsound(src, 'sound/items/lighter/plastic_strike.ogg', 40, 2)
else
var/hitzone = user.held_index_to_dir(user.active_hand_index) == "r" ? BODY_ZONE_PRECISE_R_HAND : BODY_ZONE_PRECISE_L_HAND
user.apply_damage(5, BURN, hitzone)
user.visible_message(span_warning("After a few attempts, [user] manages to light [src] - however, [user.p_they()] burn [user.p_their()] finger in the process."), span_warning("You burn yourself while lighting the lighter!"))
SEND_SIGNAL(user, COMSIG_ADD_MOOD_EVENT, "burnt_thumb", /datum/mood_event/burnt_thumb)
else
set_lit(FALSE)
if(fancy)
user.visible_message("You hear a quiet click, as [user] shuts off [src] without even looking at what [user.p_theyre()] doing. Wow.", span_notice("You quietly shut off [src] without even looking at what you're doing. Wow."))
playsound(src, 'sound/items/lighter/close.ogg', 50, 1)
else
user.visible_message("[user] quietly shuts off [src].", span_notice("You quietly shut off [src]."))
playsound(src, 'sound/items/lighter/plastic_close.ogg', 40, 2)
else
. = ..()
/obj/item/lighter/attack(mob/living/carbon/M, mob/living/carbon/user)
if(lit && M.ignite_mob())
message_admins("[ADMIN_LOOKUPFLW(user)] set [key_name_admin(M)] on fire with [src] at [AREACOORD(user)]")
log_game("[key_name(user)] set [key_name(M)] on fire with [src] at [AREACOORD(user)]")
var/obj/item/clothing/mask/cigarette/cig = help_light_cig(M)
if(lit && cig && !user.combat_mode)
if(cig.lit)
to_chat(user, span_notice("The [cig.name] is already lit."))
if(M == user)
cig.attackby(src, user)
else
if(fancy)
cig.light(span_rose("[user] whips the [name] out and holds it for [M]. [user.p_their(TRUE)] arm is as steady as the unflickering flame [user.p_they()] light[user.p_s()] \the [cig] with."))
playsound(src, 'sound/items/lighter/light.ogg', 50, 2)
else
cig.light(span_notice("[user] holds the [name] out for [M], and lights [M.p_their()] [cig.name]."))
playsound(src, 'sound/items/lighter/light.ogg', 50, 2)
else
..()
/obj/item/lighter/process()
open_flame()
/obj/item/lighter/is_hot()
return lit * heat
/obj/item/lighter/greyscale
name = "cheap lighter"
desc = "A cheap lighter."
icon_state = "lighter"
fancy = FALSE
overlay_list = list(
"transp",
"tall",
"matte",
"zoppo" //u cant stoppo th zoppo
)
var/lighter_color
var/list/color_list = list( //Same 16 color selection as electronic assemblies
COLOR_ASSEMBLY_BLACK,
COLOR_FLOORTILE_GRAY,
COLOR_ASSEMBLY_BGRAY,
COLOR_ASSEMBLY_WHITE,
COLOR_ASSEMBLY_RED,
COLOR_ASSEMBLY_ORANGE,
COLOR_ASSEMBLY_BEIGE,
COLOR_ASSEMBLY_BROWN,
COLOR_ASSEMBLY_GOLD,
COLOR_ASSEMBLY_YELLOW,
COLOR_ASSEMBLY_GURKHA,
COLOR_ASSEMBLY_LGREEN,
COLOR_ASSEMBLY_GREEN,
COLOR_ASSEMBLY_LBLUE,
COLOR_ASSEMBLY_BLUE,
COLOR_ASSEMBLY_PURPLE
)
/obj/item/lighter/greyscale/Initialize(mapload)
. = ..()
if(!lighter_color)
lighter_color = pick(color_list)
update_appearance(UPDATE_ICON)
/obj/item/lighter/greyscale/update_overlays()
. = ..()
var/mutable_appearance/lighter_overlay = mutable_appearance(icon,"lighter_overlay_[overlay_state][lit ? "-on" : ""]")
icon_state = "[initial(icon_state)][lit ? "-on" : ""]"
lighter_overlay.color = lighter_color
. += lighter_overlay
/obj/item/lighter/greyscale/ignition_effect(atom/A, mob/user)
if(is_hot())
. = span_notice("After some fiddling, [user] manages to light [A] with [src].")
playsound(src, 'sound/items/lighter/light.ogg', 50, 2)
/obj/item/lighter/slime
name = "slime zippo"
desc = "A specialty zippo made from slimes and industry. Has a much hotter flame than normal."
icon_state = "slighter"
heat = 3000 //Blue flame!
light_color = LIGHT_COLOR_CYAN
overlay_state = "slime"
grind_results = list(/datum/reagent/iron = 1, /datum/reagent/fuel = 5, /datum/reagent/medicine/pyroxadone = 5)
/obj/item/lighter/badass //black lighter for donator item, Nightmare1234
name = "badass lighter"
desc = "A custom blacked out slime zippo lighter with a red flame. You can see clear lettering on the side that says it burns at exactly 1499K."
heat = 1499 //lol
icon_state = "blighter"
light_color = LIGHT_COLOR_RED
overlay_state = "badass_sus"
/obj/item/lighter/gold //gold lighter for donator item, Ynot01
name = "golden lighter"
desc = "A golden lighter."
overlay_list = list(
"plaingold",
"damegold",
"thirteengold",
"snakegold"
)
///////////
//ROLLING//
///////////
/obj/item/rollingpaper
name = "rolling paper"
desc = "A thin piece of paper used to make fine smokeables."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig_paper"
w_class = WEIGHT_CLASS_TINY
/obj/item/rollingpaper/afterattack(atom/target, mob/user, proximity)
. = ..()
if(!proximity)
return
if(istype(target, /obj/item/reagent_containers/food/snacks/grown))
var/obj/item/reagent_containers/food/snacks/grown/O = target
if(O.dry)
var/obj/item/clothing/mask/cigarette/rollie/R = new /obj/item/clothing/mask/cigarette/rollie(user.loc)
R.chem_volume = target.reagents.total_volume
target.reagents.trans_to(R, R.chem_volume, transfered_by = user)
qdel(target)
qdel(src)
user.put_in_active_hand(R)
to_chat(user, span_notice("You roll the [target.name] into a rolling paper."))
R.desc = "Dried [target.name] rolled up in a thin piece of paper."
else
to_chat(user, span_warning("You need to dry this first!"))
///////////////
//VAPE NATION//
///////////////
/obj/item/clothing/mask/vape
name = "\improper E-Cigarette"
desc = "A classy and highly sophisticated electronic cigarette, for classy and dignified gentlemen. A warning label reads \"Warning: Do not fill with flammable materials.\""//<<< i'd vape to that.
icon = 'icons/obj/clothing/masks.dmi'
icon_state = "red_vape"
item_state = null
w_class = WEIGHT_CLASS_TINY
var/chem_volume = 100
var/vapetime = 0 //this so it won't puff out clouds every tick
/// How often we take a drag in seconds
var/vapedelay = 8
var/screw = 0 // kinky
var/super = 0 //for the fattest vapes dude.
/obj/item/clothing/mask/vape/suicide_act(mob/user)
user.visible_message(span_suicide("[user] is puffin hard on dat vape, [user.p_they()] trying to join the vape life on a whole notha plane!"))//it doesn't give you cancer, it is cancer
return (TOXLOSS|OXYLOSS)
/obj/item/clothing/mask/vape/Initialize(mapload, param_color)
. = ..()
create_reagents(chem_volume, NO_REACT)
reagents.add_reagent(/datum/reagent/drug/nicotine, 50)
if(!param_color)
param_color = pick("red","blue","black","white","green","purple","yellow","orange")
icon_state = "[param_color]_vape"
item_state = "[param_color]_vape"
/obj/item/clothing/mask/vape/attackby(obj/item/O, mob/user, params)
if(O.tool_behaviour == TOOL_SCREWDRIVER)
if(!screw)
screw = TRUE
to_chat(user, span_notice("You open the cap on [src]."))
ENABLE_BITFIELD(reagents.flags, OPENCONTAINER)
if(obj_flags & EMAGGED)
add_overlay("vapeopen_high")
else if(super)
add_overlay("vapeopen_med")
else
add_overlay("vapeopen_low")
else
screw = FALSE
to_chat(user, span_notice("You close the cap on [src]."))
DISABLE_BITFIELD(reagents.flags, OPENCONTAINER)
cut_overlays()
if(O.tool_behaviour == TOOL_MULTITOOL)
if(screw && !(obj_flags & EMAGGED))//also kinky
if(!super)
cut_overlays()
super = 1
to_chat(user, span_notice("You increase the voltage of [src]."))
add_overlay("vapeopen_med")
else
cut_overlays()
super = 0
to_chat(user, span_notice("You decrease the voltage of [src]."))
add_overlay("vapeopen_low")
if(screw && (obj_flags & EMAGGED))
to_chat(user, span_notice("[src] can't be modified!"))
else
..()
/obj/item/clothing/mask/vape/emag_act(mob/user, obj/item/card/emag/emag_card)// I WON'T REGRET WRITTING THIS, SURLY.
if(!screw)
to_chat(user, span_notice("You need to open the cap to do that."))
return FALSE
if(obj_flags & EMAGGED)
to_chat(user, span_warning("[src] is already emagged!"))
return FALSE
cut_overlays()
obj_flags |= EMAGGED
super = 0
to_chat(user, span_warning("You maximize the voltage of [src]."))
add_overlay("vapeopen_high")
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread //for effect
sp.set_up(5, 1, src)
sp.start()
/obj/item/clothing/mask/vape/attack_self(mob/user)
if(reagents.total_volume > 0)
to_chat(user, span_notice("You empty [src] of all reagents."))
reagents.clear_reagents()
/obj/item/clothing/mask/vape/equipped(mob/user, slot)
. = ..()
if(slot == ITEM_SLOT_MASK)
if(!screw)
to_chat(user, span_notice("You start puffing on the vape."))
DISABLE_BITFIELD(reagents.flags, NO_REACT)
START_PROCESSING(SSobj, src)
else //it will not start if the vape is opened.
to_chat(user, span_warning("You need to close the cap first!"))
/obj/item/clothing/mask/vape/dropped(mob/user)
. = ..()
if(user.get_item_by_slot(ITEM_SLOT_MASK) == src)
ENABLE_BITFIELD(reagents.flags, NO_REACT)
STOP_PROCESSING(SSobj, src)
/obj/item/clothing/mask/vape/proc/hand_reagents()//had to rename to avoid duplicate error
if(reagents.total_volume)
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) //this will react instantly, making them a little more dangerous than cigarettes
reagents.reaction(C, INGEST, fraction)
if(!reagents.trans_to(C, REAGENTS_METABOLISM))
reagents.remove_any(REAGENTS_METABOLISM)
if(reagents.get_reagent_amount(/datum/reagent/fuel))
//HOT STUFF
C.fire_stacks = 2
C.ignite_mob()
if(reagents.get_reagent_amount(/datum/reagent/toxin/plasma)) // the plasma explodes when exposed to fire
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)) // the fuel explodes, too, but much less violently
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
if(reagents.get_reagent_amount(/datum/reagent/nitroglycerin)) // nitrogylcerin explodes with a whole lot more strength
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount(/datum/reagent/nitroglycerin), 1), get_turf(src), 0, 0)
e.start()
qdel(src)
return
reagents.remove_any(REAGENTS_METABOLISM)
/obj/item/clothing/mask/vape/process(delta_time)
var/mob/living/M = loc
if(isliving(loc))
M.ignite_mob()
vapetime += delta_time
if(!reagents.total_volume)
if(ismob(loc))
to_chat(M, span_notice("[src] is empty!"))
STOP_PROCESSING(SSobj, src)
//it's reusable so it won't unequip when empty
return
//open flame removed because vapes are a closed system, they wont light anything on fire
if(super && vapetime >= vapedelay)//Time to start puffing those fat vapes, yo.
var/datum/effect_system/fluid_spread/smoke/chem/smoke_machine/puff = new
puff.set_up(1, location = loc, carry = reagents, efficiency = 24)
puff.start()
vapetime -= vapedelay
if((obj_flags & EMAGGED) && vapetime >= vapedelay)
var/datum/effect_system/fluid_spread/smoke/chem/smoke_machine/puff = new
puff.set_up(4, location = loc, carry = reagents, efficiency = 24)
puff.start()
vapetime -= vapedelay
if(prob(5))//small chance for the vape to break and deal damage if it's emagged
playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0)
M.apply_damage(20, BURN, BODY_ZONE_HEAD)
M.Paralyze(300, 1, 0)
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread
sp.set_up(5, 1, src)
sp.start()
to_chat(M, span_userdanger("[src] suddenly explodes in your mouth!"))
qdel(src)
return
if(reagents && reagents.total_volume)
hand_reagents()
/obj/item/clothing/mask/cigarette/lit/Initialize(mapload)
. = ..()
light() // These cigarettes start lit.