-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
laser.dm
738 lines (647 loc) · 16.7 KB
/
laser.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
/datum/projectile/laser
name = "laser"
icon = 'icons/obj/projectiles.dmi'
icon_state = "laser"
virtual
icon_state = "laser_virtual"
//How much of a punch this has, tends to be seconds/damage before any resist
damage = 45
//How much ammo this costs
cost = 31.25
//How fast the power goes away
dissipation_rate = 5
//How many tiles till it starts to lose power
dissipation_delay = 6
//name of the projectile setting, used when you change a guns setting
sname = "laser"
//file location for the sound you want it to play
shot_sound = 'sound/weapons/Taser.ogg'
//How many projectiles should be fired, each will cost the full cost
shot_number = 1
ie_type = "E"
//What is our damage type
/*
kinetic - raw power
piercing - punches though things
slashing - cuts things
energy - energy (stun)
laser - energy (laser)
burning - hot
radioactive - rips apart cells or some shit
toxic - poisons
*/
damage_type = D_ENERGY // cogwerks - changed from piercing
hit_type = DAMAGE_BURN
//With what % do we hit mobs laying down
hit_ground_chance = 50
//Can we pass windows
window_pass = 1
brightness = 0.8
color_red = 1
color_green = 0
color_blue = 0
impact_image_state = "burn1"
hit_mob_sound = 'sound/impact_sounds/burn_sizzle.ogg'
hit_object_sound = 'sound/impact_sounds/burn_sizzle.ogg'
//Any special things when it hits shit?
on_hit(atom/hit)
return
tick(var/obj/projectile/P)
if (istype(P.loc, /turf) && !(locate(/obj/blob/reflective) in get_turf(P.loc))) //eh, works for me:tm:
var/turf/T = P.loc
T.hotspot_expose(power*20, 5)
/datum/projectile/laser/quad
name = "4 lasers"
icon_state = "laser"
damage = 240
cost = 125
dissipation_rate = 250
dissipation_delay = 0
on_launch(var/obj/projectile/P)
if (!P)
return
var/datum/projectile/laser/L = new()
var/turf/PT = get_turf(P)
var/obj/projectile/P1 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P1.rotateDirection(60)
P1.launch()
var/obj/projectile/P2 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P2.rotateDirection(20)
P2.launch()
var/obj/projectile/P3 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P3.rotateDirection(-20)
P3.launch()
var/obj/projectile/P4 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P4.rotateDirection(-60)
P4.launch()
P.die()
/datum/projectile/laser/heavy
name = "heavy laser"
icon_state = "u_laser"
damage = 80
cost = 50
dissipation_delay = 10
brightness = 0
sname = "heavy laser"
shot_sound = 'sound/weapons/Laser.ogg'
color_red = 0
color_green = 0
color_blue = 1
/datum/projectile/laser/heavy/law_safe //subclass of heavy laser that can't damage the law rack - for AI turrets
name = "heavy laser"
/datum/projectile/laser/diffuse
sname = "diffuse laser"
cost = 30
dissipation_delay = 1
dissipation_rate = 8
max_range = 7
shot_number = 2
/datum/projectile/laser/asslaser // heh
name = "assault laser"
icon_state = "u_laser"
damage = 50
cost = 65
dissipation_delay = 5
dissipation_rate = 0
max_range = 30
projectile_speed = 20
sname = "assault laser"
shot_sound = 'sound/weapons/Laser.ogg'
color_red = 0
color_green = 0
color_blue = 1
on_hit(atom/hit, dir, obj/projectile/P)
fireflash(get_turf(hit), 0)
if((istype(hit, /turf/simulated) || istype(hit, /obj/structure/girder)))
hit.ex_act(2)
else
hit.ex_act(3, src, 1.5) //don't stun humans nearly as much
P.die() //explicitly kill projectile - not a mining laser
/datum/projectile/laser/light // for the drones
name = "phaser bolt"
icon_state = "phaser_energy"
damage = 20
cost = 25
sname = "phaser bolt"
dissipation_delay = 5
shot_sound = 'sound/weapons/laserlight.ogg'
color_red = 1
color_green = 0.2
color_blue = 0.2
tiny
name = "micro phaser bolt"
icon_state = "phaser_light"
sname = "micro phaser bolt"
damage = 10
cost = 10
shot_sound = 'sound/weapons/energy/phaser_tiny.ogg'
color_red = 1
color_green = 0.2
color_blue = 0.2
huge // yes laser/light/huge is pretty dumb
name = "macro phaser blast"
icon_state = "phaser_heavy"
sname = "macro phaser blast"
damage = 50
cost = 62.5
shot_sound = 'sound/weapons/energy/phaser_huge.ogg'
color_red = 1
color_green = 0.2
color_blue = 0.2
on_hit(atom/hit, dir, obj/projectile/P)
hit.ex_act(3, src, 1.5)
P.die()
mining
name = "mining phaser bolt"
damage = 5
cost = 5
dissipation_delay = 3
icon_state = "blue_spark"
color_red = 0.4
color_green = 0.4
color_blue = 1
on_launch(obj/projectile/O)
. = ..()
O.AddComponent(/datum/component/proj_mining, 0.2, 5)
on_hit(atom/hit)
if (istype(hit,/obj/critter)) //MBC : if there was a cleaner way to do this, I couldn't find it.
var/obj/critter/C = hit
C.health -= power * 2
C.on_damaged()
if (C.health <= 0)
C.CritterDeath()
..()
longrange
icon_state = "red_bolt"
dissipation_delay = 10
shot_sound = 'sound/weapons/laser_b.ogg'
color_red = 1
color_green = 0.2
color_blue = 0.2
split
dissipation_rate = 100
damage = 120
dissipation_delay = 2
on_launch(var/obj/projectile/P)
if (!P)
return
var/datum/projectile/laser/light/L = new()
L.power = 40
var/turf/PT = get_turf(P)
var/obj/projectile/P1 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P1.launch()
var/obj/projectile/P2 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P2.rotateDirection(30)
P2.launch()
var/obj/projectile/P3 = initialize_projectile(PT, L, P.xo, P.yo, P.shooter)
P3.rotateDirection(-30)
P3.launch()
P.die()
curver
tick(var/obj/projectile/P)
if (!P)
return
P.rotateDirection(20)
..()
spiral
tick(var/obj/projectile/P)
if (!P)
return
if (P.special_data["angle"] == 0)
return
if (!("angle" in P.special_data))
P.special_data["angle"] = 35
P.rotateDirection(P.special_data["angle"])
P.special_data["angle"] /= 1.1
if (P.special_data["angle"] < 2)
P.special_data["angle"] = 0
..()
upgradeable
icon_state = "phaser_light"
var/datum/projectile/laser/light/launched = new/datum/projectile/laser/light
var/count = 1
on_launch(var/obj/projectile/P)
launched.power = src.power
launched.ks_ratio = src.ks_ratio
launched.generate_inverse_stats()
launched.icon_state = icon_state
if (count > 1)
var/turf/PT = get_turf(P)
if (count == 2)
var/obj/projectile/P1 = initialize_projectile(PT, launched, P.xo, P.yo, P.shooter)
P1.rotateDirection(30)
var/obj/projectile/P2 = initialize_projectile(PT, launched, P.xo, P.yo, P.shooter)
P2.rotateDirection(-30)
P1.launch()
P2.launch()
else
var/cangle = -60
var/angle_step = 120 / (count - 1)
for (var/i = 0, i < count, i++)
var/obj/projectile/PN = initialize_projectile(PT, launched, P.xo, P.yo, P.shooter)
if (cangle != 0)
PN.rotateDirection(cangle)
PN.launch()
cangle += angle_step
P.die()
proc/UpdateIcon()
if (power >= 75)
icon_state = "phaser_ultra"
else if (power >= 50)
icon_state = "phaser_heavy"
else if (power >= 35)
icon_state = "phaser_med"
else
icon_state = "phaser_light"
/datum/projectile/laser/glitter // for the russian pod
name = "prismatic laser"
icon_state = "eyebeam"
damage = 25
cost = 20
sname = "phaser bolt"
dissipation_delay = 10
shot_sound = 'sound/weapons/TaserOLD.ogg'
color_red = 1
color_green = 0
color_blue = 1
impact_image_state = "burn2"
projectile_speed = 42
burst
cost = 50
shot_number = 3
/datum/projectile/laser/precursor // for precursor traps
name = "rydberg-matter bolt"
icon_state = "disrupt"
damage = 24
stun = 6
cost = 30
sname = "rydberg-matter bolt"
dissipation_delay = 10
shot_sound = 'sound/weapons/LaserOLD.ogg'
color_red = 0.1
color_green = 0.3
color_blue = 1
/datum/projectile/laser/plasma //mostly just a reskin
icon_state = "phaser_med"
name = "plasma bolt"
sname = "plasma bolt"
shot_sound = 'sound/weapons/plasma_gun.ogg'
dissipation_delay = 8
dissipation_rate = 5
cost = 25
damage = 35
color_red = 0.4
color_green = 0.5
color_blue = 0.7
// These are for custom antique laser guns repaired with high-quality components.
// See displaycase.dm for details (Convair880).
/datum/projectile/laser/old
icon_state = "proj_thermal"
name = "pulse laser"
sname = "pulse laser"
shot_sound = 'sound/weapons/snipershot.ogg'
dissipation_delay = 7.5
dissipation_rate = 8
cost = 40
damage = 70
color_red = 1
color_green = 0.3
color_blue = 0
/datum/projectile/laser/old_burst
icon_state = "proj_sing"
name = "burst laser"
sname = "burst laser"
shot_sound = 'sound/weapons/snipershot.ogg'
shot_number = 3
cost = 100
damage = 35
color_red = 0.4
color_green = 0
color_blue = 0.7
//Projectile for Azungars NT gun.
/datum/projectile/laser/ntburst
icon_state = "miniphaser_med"
name = "plasma bolt"
sname = "plasma boltburst"
shot_sound = 'sound/weapons/lasersound.ogg'
dissipation_delay = 8
dissipation_rate = 5
cost = 5
damage = 15
color_red = 0.4
color_green = 0.5
color_blue = 0.7
shot_number = 1
// blaster projectiles
/datum/projectile/laser/blaster
icon_state = "bolt"
name = "blaster bolt"
sname = "blaster"
shot_sound = 'sound/weapons/laser_a.ogg'
dissipation_delay = 6
dissipation_rate = 5
cost = 20
damage = 33
color_icon = "#3d9cff"
color_red = 0.2
color_green = 0.5
color_blue = 1
brightness = 1.2
shot_number = 1
on_launch(var/obj/projectile/P)
. = ..()
P.AddComponent(/datum/component/radioactive, 33, FALSE, FALSE, 2)
/*tick(var/obj/projectile/P)
var/obj/effects/ion_trails/I = new /obj/effects/ion_trails
I.set_loc(get_turf(P))
I.set_dir(P.dir)
flick("ion_fade", I)
I.icon_state = "blank"
I.pixel_x = P.pixel_x
I.pixel_y = P.pixel_y
SPAWN( 20 )
if (I && !I.disposed) qdel(I)*/
burst
damage = 15
cost = 30
shot_number = 3
icon_state = "bolt_burst"
shot_sound = 'sound/weapons/laser_c.ogg'
fullauto_valid = 1
blast
shot_sound = 'sound/weapons/laser_e.ogg'
damage = 30
cost = 100
icon_state = "crescent_white"
shot_number = 1
cannon
shot_sound = 'sound/weapons/energy/howitzer_shot.ogg'
damage = 100
cost = 200
icon_state = "crescent"
carbine
shot_sound = 'sound/weapons/laser_b.ogg'
icon_state = "bolt_long"
dissipation_delay = 12
dissipation_rate = 5
projectile_speed = 56
/datum/projectile/laser/blaster/pod_pilot
cost = 20
damage = 33
color_red = 0
color_green = 0
color_blue = 0
override_color = 0
icon_state = "bolt"
damage_type = D_ENERGY
var/turret = 0 //have turret shots do less damage, but slow mobs it hits...
var/team_num = 0 //1 for NT, 2 for SY
on_hit(atom/hit)
..()
//have turret shots slow mobs it hits...
if (turret && isliving(hit))
var/mob/living/L = hit
L.changeStatus("slowed", 2 SECONDS)
//lower power when they hit vehicles by half
get_power(obj/projectile/P, atom/A)
var/mult = 1
if (!turret && istype(A, /obj/machinery/vehicle))
mult = 0.5
return ..(P, A) * mult
/datum/projectile/laser/blaster/pod_pilot/blue_NT
name = "blue blaster bolt"
color_icon = "#3d9cff"
color_red = 0.05
color_green = 0.28
color_blue = 0.51
team_num = 1
turret
turret = 1
damage = 15
/datum/projectile/laser/blaster/pod_pilot/red_SY
name = "red blaster bolt"
color_icon = "#ff4043"
color_red = 0.51
color_green = 0.05
color_blue = 0.28
team_num = 2
turret
turret = 1
damage = 15
/datum/projectile/laser/blaster/pod_pilot/blue_NT/smg
name = "blue blaster bolt"
color_icon = "#3d9cff"
color_red = 0.05
color_green = 0.28
color_blue = 0.51
cost = 10
damage = 12.5
fullauto_valid = 1
icon_state = "bolt_burst"
shot_sound = 'sound/weapons/laser_c.ogg'
/datum/projectile/laser/blaster/pod_pilot/red_SY/smg
name = "red blaster bolt"
color_icon = "#ff4043"
color_red = 0.51
color_green = 0.05
color_blue = 0.28
cost = 10
damage = 12.5
fullauto_valid = 1
icon_state = "bolt_burst"
shot_sound = 'sound/weapons/laser_c.ogg'
/datum/projectile/laser/blaster/pod_pilot/blue_NT/shotgun
name = "blue blaster bolt"
color_icon = "#3d9cff"
color_red = 0.05
color_green = 0.28
color_blue = 0.51
cost = 10
damage = 15
/datum/projectile/laser/blaster/pod_pilot/red_SY/shotgun
name = "red blaster bolt"
color_icon = "#ff4043"
color_red = 0.51
color_green = 0.05
color_blue = 0.28
cost = 10
damage = 15
// cogwerks- mining laser, first attempt
/datum/projectile/laser/mining
name = "Plasma Cutter Bolt"
icon_state = "40mmgatling"
damage = 40
cost = 40
dissipation_delay = 1
dissipation_rate = 8
sname = "mining laser"
shot_sound = 'sound/weapons/cutter.ogg'
shot_volume = 30
damage_type = D_BURNING
brightness = 0.8
window_pass = 0
color_red = 0.9
color_green = 0.6
color_blue = 0
on_launch(obj/projectile/O)
. = ..()
O.AddComponent(/datum/component/proj_mining, 0.2, 2)
/datum/projectile/laser/drill
name = "drill bit"
window_pass = 0
icon_state = ""
damage_type = D_SLASHING
hit_type = DAMAGE_STAB
damage = 45
cost = 1
brightness = 0
sname = "drill bit"
shot_sound = 'sound/machines/rock_drill.ogg'
shot_volume = 20
dissipation_delay = 1
dissipation_rate = 45
impact_image_state = null
var/damtype = DAMAGE_STAB
var/hit_human_sound = 'sound/impact_sounds/Slimy_Splat_1.ogg'
on_launch(obj/projectile/O)
. = ..()
O.AddComponent(/datum/component/proj_mining, 0.15, 0)
on_hit(atom/hit)
if (ishuman(hit))
var/mob/living/carbon/human/M = hit
playsound(M.loc, hit_human_sound, 50, 1)
take_bleeding_damage(M, null, 1, damtype)
cutter
name = "cutter blade"
damage = 30
dissipation_rate = 30
sname = "scrap cutter"
saw_teeth
name = "saw teeth"
damage = 5
dissipation_rate = 5
sname = "saw teeth"
shot_sound = 'sound/machines/chainsaw.ogg'
hit_human_sound = 'sound/impact_sounds/Flesh_Tear_1.ogg'
damtype = DAMAGE_CUT
hit_type = DAMAGE_CUT
on_hit(atom/hit) //do extra damage to pod
..()
if (istype(hit,/obj/machinery/vehicle))
var/obj/machinery/vehicle/V = hit
V.health -= power * 1.8
V.checkhealth()
/datum/projectile/laser/alastor
name = "laser"
icon = 'icons/obj/projectiles.dmi'
icon_state = "alastor"
damage = 35
cost = 25
sname = "laser"
shot_sound = 'sound/weapons/energy/laser_alastor.ogg'
brightness = 1
impact_image_state = "burn1"
on_hit(atom/hit)
var/mob/living/L = hit
if (!istype(L))
return
if(L.getStatusDuration("burning"))
L.changeStatus("burning", 7 SECONDS)
else
L.changeStatus("burning", 3.5 SECONDS)
/datum/projectile/laser/signifer_lethal
name = "signifer bolt"
icon = 'icons/obj/projectiles.dmi'
damage = 15
cost = 40
sname = "lethal"
shot_sound = 'sound/weapons/SigLethal.ogg'
hit_ground_chance = 30
brightness = 1
icon_state = "signifer2_burn"
damage_type = D_ENERGY
color_red = 0.1
color_green = 0.1
color_blue = 0.8
disruption = 8
shot_number = 2
ie_type = "E"
hit_mob_sound = 'sound/effects/sparks6.ogg'
on_hit(atom/hit, angle, var/obj/projectile/O)
hit.setStatus("signified")
..()
brute
icon_state = "signifer2_brute"
damage_type = D_KINETIC
color_red = 0.8
color_green = 0.1
color_blue = 0.1
on_hit(var/atom/hit)
if(hit.hasStatus("signified"))
elecflash(get_turf(hit),radius=0, power=4, exclude_center = 0)
random_brute_damage(hit, rand(5,10), 0)
hit.delStatus("signified")
..()
/datum/projectile/laser/plasma/auto
icon_state = "miniphaser_med"
shot_sound = 'sound/weapons/lasersound.ogg'
dissipation_delay = 4
dissipation_rate = 2
cost = 10
damage = 15
fullauto_valid = 1
shot_volume = 75
/datum/projectile/laser/plasma/burst
cost = 60
damage = 20
shot_number = 4
shot_delay = 1
shot_volume = 75
projectile_speed = 42
on_hit(atom/movable/hit, dir, datum/projectile/P)
. = ..()
if(hit.hasStatus("cornicened2"))
elecflash(get_turf(hit),radius=0, power=6, exclude_center = 0)
random_brute_damage(hit, rand(10,20), 0)
hit.delStatus("cornicened")
hit.delStatus("cornicened2")
else
hit.setStatus("cornicened")
/datum/projectile/laser/ntso_cannon
name = "heavy assault laser"
icon_state = "u_laser"
damage = 80
cost = 65
dissipation_delay = 10
brightness = 0
sname = "heavy laser"
shot_sound = 'sound/weapons/Laser.ogg'
color_red = 0
color_green = 0
color_blue = 1
on_hit(atom/hit, dir, obj/projectile/P)
fireflash(get_turf(hit), 0)
hit.ex_act(2)
P.die() //explicitly kill projectile - not a mining laser
/datum/projectile/laser/makeshift
cost = 1250
shot_sound = 'sound/weapons/laserlight.ogg'
icon_state = "laser_tiny"
damage = 20
/// lower bounds of heat added to the makeshift laser rifle this was fired from
var/heat_low = 10
/// higher bounds of heat added to the makeshift laser rifle this was fired from
var/heat_high = 12
/datum/projectile/laser/lasergat
cost = 5
shot_sound = 'sound/weapons/laser_a.ogg'
icon_state = "lasergat_laser"
shot_volume = 50
name = "single"
sname = "single"
damage = 14
/datum/projectile/laser/lasergat/burst
name = "burst laser"
sname = "burst laser"
cost = 15
shot_number = 3