-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathitems.lua
More file actions
693 lines (684 loc) · 15.6 KB
/
Copy pathitems.lua
File metadata and controls
693 lines (684 loc) · 15.6 KB
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
itemclasses = {
m99pis = {
type="weapon",
name="m99 Pistol",
dice=4,
sides=3,
maxammo=12,
ammotype="9mm",
atktime=9,
reltime=18,
tohit=0.9,
sound="pistol",
dmgtype="bullet",
weaptype="sidearm",
desc="An old but very popular handgun. Accurate and reliable. It'll do the trick for now.",
char="}",
color={0.5,0.5,0.5,1}
},
baton = {
type="weapon",
name="Baton",
dice=2,
sides=3,
chrgtime=0,
chrgbonus={1,4,7},
charge=4,
ammotype="no",
atktime=12,
tohit=0.8,
sound="melee",
dmgtype="melee",
weaptype="small",
desc="It's just a baton. Pretty simple and reliable.",
char="/",
color={0.4,0.4,0.5,1}
},
knife = {
type="weapon",
name="Combat Knife",
dice=4,
sides=2,
chrgtime=-2,
chrgbonus={1,1,2},
charge=2,
ammotype="no",
atktime=9,
tohit=0.85,
sound="melee",
dmgtype="melee",
weaptype="small",
desc="Blades have been around for centuries, but this one's mine.",
char="/",
color={0.6,0.6,0.7,1}
},
sawnoff = {
type="weapon",
name="Sawnoff Shotgun",
dice=2,
sides=4,
maxammo=2,
ammotype="12ga",
atktime=3,
reltime=14,
tohit=0.7,
range=4,
sound="shotgun",
dmgtype="spread",
weaptype="sidearm",
desc="A sawed-off double barreled shotgun. Very cheap, but rather ineffective.",
char="}",
color={0.7,0.5,0.45,1}
},
sm40smg = {
type="weapon",
name="sm-40 SMG",
dice=3,
sides=4,
maxammo=30,
ammotype="9mm",
atktime=3.5,
reltime=24,
tohit=0.715,
sound="submachine",
dmgtype="bullet",
weaptype="rapid",
desc="The sm-40 fell out of style some time ago, mainly due to reliability issues. However, it's still a good gun in close range.",
char="}",
color={0.65,0.65,0.7,1}
},
ca12shotty = {
type="weapon",
name="CA12 Shotgun",
dice=3,
sides=4,
maxammo=6,
ammotype="12ga",
atktime=10,
reltime=25,
tohit=0.75,
range=7,
sound="shotgun",
dmgtype="spread",
weaptype="shotgun",
pickupmsg="Groovy.",
desc="Ah, the beloved CA12 \"Whiplash\" pump-action shotgun. Groovy.",
char="}",
color={0.9,0.5,0.5,1}
},
ch7pis = {
type="weapon",
name="CH7 Pistol",
dice=5,
sides=4,
maxammo=15,
ammotype="9mm",
atktime=9,
reltime=18,
tohit=0.9,
sound="pistol",
dmgtype="bullet",
weaptype="sidearm",
desc="The CH7 Handgun is a very popular military service pistol, and with good reason.",
char="}",
color={0.5,0.7,0.6,1}
},
machete = {
type="weapon",
name="Machete",
dice=4,
sides=4,
chrgtime=1,
chrgbonus={3,5,7},
charge=4,
ammotype="no",
atktime=11,
tohit=0.6,
sound="melee",
dmgtype="melee",
weaptype="medium",
desc="The bigger blade. Excellent.",
char="/",
color={0.7,0.5,0.5,1}
},
knuckles = {
type="weapon",
name="Knuckleduster",
dice=4,
sides=3,
chrgtime=-1,
chrgbonus={2,4,8},
charge=5,
ammotype="no",
atktime=11,
tohit=0.6,
sound="melee",
dmgtype="melee",
weaptype="medium",
desc="A versatile melee weapon regulated in some places for its brutality. This one may be blunt, but do not underestimate it.",
char="/",
color={0.6,0.6,0.2,1}
},
sn730rifle = {
type="weapon",
name="SN730 Rifle",
dice=5,
sides=6,
maxammo=30,
ammotype="5mm",
atktime=4,
reltime=29,
tohit=0.633,
sound="rifle",
dmgtype="bullet",
weaptype="rapid",
desc="Truly the bread and butter of any military operation.",
char="}",
color={0.4,0.4,0.8,1}
},
z3rifle = {
type="weapon",
name="z-3 Battlerifle",
dice=7,
sides=6,
maxammo=20,
ammotype="7mm",
atktime=6,
reltime=31,
tohit=0.6,
sound="batrifle",
dmgtype="bullet",
weaptype="rapid",
pickupmsg="Hell yea.",
desc="Firing scarily heavy bullets, the z-3 battle rifle is just what you need to go toe to toe with the biggest baddies out there.",
char="}",
color={0.9,0.8,0.5,1}
},
--energy weapons
blaster = {
type="weapon",
name="Arc Pistol",
dice=2,
sides=4,
maxammo=5,
ammotype="en.",
atktime=10,
reltime=19,
tohit=0.6,
range=5,
sound="batrifle",
dmgtype="spread",
weaptype="sidearm",
pickupmsg="What a strange device.",
desc="This experimental tech I can only assume is a pet project of Nuclear's. Fires small directed blasts of plasma. Feels like it might explode in my hand.",
char="}",
color={0.7,0.3,1.0,1}
},
plasrifle = {
type="weapon",
name="Arc Cannon",
dice=3,
sides=3,
maxammo=10,
ammotype="en.",
atktime=4,
reltime=28,
tohit=0.3,
range=3,
sound="batrifle",
dmgtype="spread",
weaptype="rapid",
pickupmsg="Is this thing even tested?",
desc="This must be some weird evil shit Nuclear's been working on for some weird evil reason. Fires heavy, wide blasts of plasma, very fast. Kicks like a mule.",
char="}",
color={1.0,0.3,0.7,1}
},
sword = {
type="weapon",
name="Arc Blade",
dice=5,
sides=4,
chrgtime=0,
chrgbonus={1,1,2},
charge=1,
ammotype="no",
atktime=13,
tohit=0.8,
sound="pistol",
dmgtype="melee",
weaptype="medium",
pickupmsg="Bzzzt.",
desc="It resembles a machete, with a metal \"blade\" that lights up brightly along the edge and makes a horrid sound when you press the button in the grip.",
char="/",
color={0.7,0.3,1.0,1}
},
--new guns
witchmag = {
type="weapon",
name="Magnum Revolver",
dice=6,
sides=3,
maxammo=6,
ammotype=".35",
atktime=10,
reltime=24,
tohit=0.8,
sound="magnum",
dmgtype="bullet",
weaptype="sidearm",
desc="What an ancient firearm. Kicks like a mule, pretty reliably.",
char="}",
color={0.4,0.65,0.5,1}
},
mk23pis = {
type="weapon",
name="mk21 Handcannon",
dice=3,
sides=5,
maxammo=9,
ammotype=".35",
atktime=9,
reltime=18,
tohit=0.7,
sound="magnum",
dmgtype="bullet",
weaptype="sidearm",
desc="This magnum pistol packs a lovely kick in an almost manageable package. Sadly not the most reliable, as the cartridge is a bit to hefty for the gun.",
char="}",
color={0.1,0.55,0.15,1}
},
huntrifle = {
type="weapon",
name="Hunting Rifle",
dice=7,
sides=4,
maxammo=10,
ammotype=".35",
atktime=10,
reltime=28,
tohit=0.9,
sound="batrifle",
dmgtype="bullet",
weaptype="shotgun",
desc="Nice. Make sure to do a spin with it when you work the lever.",
char="}",
color={0.2,0.6,0.6,1}
},
bossrifle = {
type="weapon",
name="BM9 Rifle",
dice=8,
sides=7,
maxammo=8,
ammotype="7mm",
atktime=13,
reltime=20,
tohit=0.8,
sound="batrifle",
dmgtype="bullet",
weaptype="shotgun",
desc="What a reputation the BM9 Sniper Rifle has. So long as you keep it clean, you can avoid that reputation! It's excellent at delivering pinpoint Fuck You at whatever it's pointed at.",
char="}",
color={0.2,0.6,0.6,1}
},
autopis = {
type="weapon",
name="sm-41 Micro-SMG",
dice=2,
sides=3,
maxammo=20,
ammotype="9mm",
atktime=4,
ammouse=2,
shots=2,
reltime=20,
tohit=0.533,
sound="sm41",
dmgtype="bullet",
weaptype="rapid",
desc="What an odd little piece of junk. This crunched down version of the much better sm-40 is just downright uncontrollable. Fires too fast, if you can believe it.",
char="}",
color={0.3,0.3,0.45,1}
},
--new superweapons
--these are conventional firearms that are very rare and expensive but very effective if you find one
magsmg = {
type="weapon",
name="mk13 SMG",
dice=5,
sides=5,
maxammo=22,
ammotype=".35",
atktime=3.5,
reltime=24,
tohit=0.7,
sound="magnum",
dmgtype="bullet",
weaptype="rapid",
pickupmsg="What a relic.",
desc="The mk13 is a legendary submachinegun chambered in .35 magnum. Sadly it's not still in production, but if you can get your hands on one, it's very easy to use and very powerful.",
char="}",
color={0.8,0.75,0.15,1}
},
machinegun = {
type="weapon",
name="Machinegun",
dice=6,
sides=6,
maxammo=50,
ammotype="7mm",
atktime=5,
ammouse=2,
shots=2,
reltime=38,
tohit=0.5,
sound="machinegun",
dmgtype="bullet",
weaptype="rapid",
pickupmsg="Peace through superior firepower!",
desc="Everyone loves big guns that lay down a lot of lead. The \"Defender\" is just that.",
char="}",
color={0.12,0.12,0.3,1}
},
autoshotty = {
type="weapon",
name="Autoshotgun",
dice=3,
sides=4,
maxammo=12,
ammotype="12ga",
atktime=4,
reltime=38,
tohit=0.7,
range=6,
sound="shotgun",
dmgtype="spread",
weaptype="rapid",
pickupmsg="Mine eyes can but weep!",
desc="What a lovely day! Truly an amazing invention, the AS-19 Autoshotgun is exactly what it says on the tin.",
char="}",
color={0.5,0.1,0.25,1}
},
supershotgun = {
type="weapon",
name="Supershotgun",
dice=4,
sides=5,
maxammo=2,
ammotype="12ga",
atktime=4,
ammouse=2,
shots=2,
reltime=12,
tohit=0.8,
range=4,
sound="ssg",
dmgtype="spread",
weaptype="sidearm",
pickupmsg="This doesn't seem remotely fair.",
desc="Some kinda fuckin' supershotgun. No identifying marks. Something deeply empowering about the way it fits in my hands.",
char="}",
color={1.0,0.0,0.25,1}
},
ch9pis = {
type="weapon",
name="CH9 Pistol",
dice=4,
sides=5,
maxammo=15,
ammotype="9mm",
atktime=12,
ammouse=3,
shots=3,
reltime=18,
tohit=0.85,
sound="ch9",
dmgtype="bullet",
weaptype="sidearm",
desc="This is just a CH7 with a burstfire funswitch. Otherwise identical. Absolutely stellar gun.",
char="}",
color={0.1,0.3,0.2,1}
},
g26rifle = {
type="weapon",
name="G26 Rifle",
dice=4,
sides=5,
maxammo=21,
ammotype="5mm",
atktime=7,
ammouse=3,
shots=3,
reltime=20,
tohit=0.566,
sound="g11",
dmgtype="bullet",
weaptype="rapid",
desc="A forgotten relic, the G26 is. It was a rechamber of another gun, chosen for its lightning fast burstfires.",
char="}",
color={0.4,0.4,0.15,1}
},
secarm = {
type="armor",
name="Security Armor",
shortname="Sec Armor",
maxdurability=60,
protection=1,
painfactor=0.9,
movetime=1.0,
desc="Lightweight security armor that will only really serve to stop small attacks. At least it lasts a while.",
char="[",
color={0.2,0.4,0.6,1}
},
riotarm = {
type="armor",
name="Riot Armor",
shortname="Riot Armor",
maxdurability=70,
protection=2,
painfactor=0.6,
movetime=1.25,
desc="A suit of riot armor that will stop a fair bit of those annoying bullets. It won't hold up long to any heavy fire.",
char="[",
color={0.7,0.7,0.7,1}
},
milarm = {
type="armor",
name="Militia Armor",
shortname="Mil Armor",
maxdurability=100,
protection=3,
painfactor=0.8,
movetime=1.15,
desc="Finally, some quality armor. Easy to move in hybrid armor that's likely to hold up to a lot of punishment.",
char="[",
color={0.2,0.6,0.2,1}
},
balarm = {
type="armor",
name="Ballistic Armor",
shortname="Heavy Armor",
maxdurability=150,
protection=5,
painfactor=0.4,
movetime=1.6,
pickupmsg="It's... REALLY heavy.",
desc="This heavy ballistic armor is prepared for anything from a battle rifle round to a point-blank shotgun shell. Makes it rather hard to move, though...",
char="[",
color={0.1,0.2,0.1,1}
},
nrgarm = {
type="armor",
name="Energy Armor",
shortname="En. Armor",
maxdurability=170,
protection=3,
painfactor=0.4,
movetime=1.0,
pickupmsg="Glorious day it is!",
desc="A chest mounted passive energy shield. Given Nuclear's track record, I don't think I wanna know what kind of radiation this'd pump into you... At least it'll last you ages.",
char="[",
color={0.6,0.4,0.9,1}
},
--new medical items
painkiller = {
type="pain",
name="Painkillers",
minheal=6,
maxheal=8,
stim=10,
desc="Just a bottle of very fast acting painkillers. Will not save you in the middle of getting shot.",
char="+",
color={0.1,0.4,0.08}
},
adrenaline = {
type="pain",
name="Adrenaline",
minheal=11,
maxheal=18,
stim=45,
desc="Yep, that's the good stuff. May or may not be the over the counter kind. Really, I don't know. It'll do the trick, though.",
char="+",
color={0.15,0.8,0.35}
},
combatstim = {
type="pain",
name="Combat Stim",
minheal=23,
maxheal=30,
stim=100,
desc="These don't seem to be a commercial product, they're very vaguely labelled. Where did these even come from?",
char="+",
color={0.5,1.0,0.7}
},
bandage = {
type="aid",
name="Bandages",
usetime=9,
heal=5,
pain=0,
uses=4,
desc="It's small a bandage roll. Quick and painless to apply.",
char="+",
color={0.9,0.5,0.5}
},
medikit = {
type="aid",
name="First Aid Kit",
usetime=42,
heal=10,
pain=40,
uses=3,
desc="There's not much here, but the assortment is wide enough for all sorts of stuff. Unfortunately all the ways to effectively stop gunshot wounds hurt like hell.",
char="+",
color={0.75,0.3,0.225}
},
traumakit = {
type="aid",
name="Trauma Kit",
usetime=80,
heal=20,
pain=75,
uses=2,
desc="This kit is for genuine field medics, those militia guys must have brought it in. Either way, without a field medic handy, this will be very slow and painful to use.",
char="+",
color={0.6,0.0,0.0}
},
}
function inventoryItem(classname,count)
local o = {}
local c = itemclasses[classname]
if c==nil then
print("INVALID ITEM CLASS: \n"..classname)
end
o.type = c.type
if o.type=="weapon" then
o.ammo = count
else
if o.type=="armor" then
o.durability = count
else
o.count = count
end
end
o.name=c.name
o.desc=c.desc
o.pickupmsg=c.pickupmsg
o.char=c.char
o.graphic=c.graphic
o.color=c.color
local attributes = {
weapon = function(o,c)
o.dice=c.dice
o.sides=c.sides
o.maxammo=c.maxammo
if count==nil then
o.ammo=c.maxammo
end
o.ammotype=c.ammotype
o.atktime=c.atktime
o.reltime=c.reltime
o.tohit=c.tohit
o.range=c.range
o.chrgtime=c.chrgtime
o.chrgbonus=c.chrgbonus
o.charge=c.charge
o.sound=c.sound
o.dmgtype=c.dmgtype
o.weaptype=c.weaptype
o.ammouse = c.ammouse
o.shots = c.shots
end,
armor = function(o,c)
o.maxdurability=c.maxdurability
if count==nil then
o.durability=c.maxdurability
end
o.movetime=c.movetime
o.protection=c.protection
o.painfactor=c.painfactor
o.shortname=c.shortname
end,
pain = function(o,c)
o.minheal = c.minheal
o.maxheal = c.maxheal
o.stim = c.stim
end,
aid = function(o,c)
o.usetime = c.usetime
o.heal = c.heal
o.pain = c.pain
o.uses = c.uses
o.maxuses = c.uses
end,
}
attributes[o.type](o,c)
return o
end
function makeItemObj(classname,count,ox,oy)
print("made item obj")
local ioat = objat(ox,oy,iObjs)
if ioat~=-1 then
return
end
local o={pox=ox,poy=oy,item=inventoryItem(classname,count)}
o.char=o.item.char
o.graphic=o.item.graphic
o.color=o.item.color
o.id=#iObjs+1
table.insert(iObjs,o)
end
function makeAmmoObj(ammotype,count,ox,oy)
print("made item obj")
local ioat = objat(ox,oy,iObjs)
if ioat~=-1 then
return
end
local ammocolors={a9mm={0.7,0.7,0.7,1},["a.35"]={0.7,0.7,0.3,1},a5mm={0.6,0.4,0.2,1},a7mm={0.9,0.7,0.2,1},a12ga={1,0.5,0.5,1}}
local o={pox=ox,poy=oy,item={type="ammo",name=ammotype.." ammo",ammotype=ammotype,amount=count,char="*",graphic="ammo",color=ammocolors["a"..ammotype]}}
o.char=o.item.char
o.graphic=o.item.graphic
o.color=o.item.color
o.id=#iObjs+1
table.insert(iObjs,o)
end