@adatechnology/game-weapons 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +89 -2
- package/dist/index.d.ts +214 -0
- package/dist/index.global.js +1647 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +1624 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -3
|
@@ -0,0 +1,1647 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var GameWeapons = (() => {
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
|
|
23
|
+
// src/index.ts
|
|
24
|
+
var index_exports = {};
|
|
25
|
+
__export(index_exports, {
|
|
26
|
+
CALIBERS: () => CALIBERS,
|
|
27
|
+
DEFAULT_LOADOUT: () => DEFAULT_LOADOUT,
|
|
28
|
+
WEAPONS: () => WEAPONS,
|
|
29
|
+
createArsenal: () => createArsenal,
|
|
30
|
+
locales: () => locales,
|
|
31
|
+
muzzleEnergy: () => muzzleEnergy,
|
|
32
|
+
resolveStrings: () => resolveStrings
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// src/data/calibers.json
|
|
36
|
+
var calibers_default = [
|
|
37
|
+
{
|
|
38
|
+
id: "22lr",
|
|
39
|
+
label: ".22 LR",
|
|
40
|
+
diameter: 5.7,
|
|
41
|
+
bulletGrams: 2.6,
|
|
42
|
+
muzzleSpeed: 350,
|
|
43
|
+
dragPer100m: 0.15,
|
|
44
|
+
kind: "rimfire"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
id: "9x19",
|
|
48
|
+
label: "9\xD719 mm",
|
|
49
|
+
diameter: 9,
|
|
50
|
+
bulletGrams: 7.5,
|
|
51
|
+
muzzleSpeed: 365,
|
|
52
|
+
dragPer100m: 0.2,
|
|
53
|
+
kind: "fmj"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "38spl",
|
|
57
|
+
label: ".38 Special",
|
|
58
|
+
diameter: 9.1,
|
|
59
|
+
bulletGrams: 10.2,
|
|
60
|
+
muzzleSpeed: 247,
|
|
61
|
+
dragPer100m: 0.2,
|
|
62
|
+
kind: "fmj"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "357mag",
|
|
66
|
+
label: ".357 Magnum",
|
|
67
|
+
diameter: 9.1,
|
|
68
|
+
bulletGrams: 10.2,
|
|
69
|
+
muzzleSpeed: 396,
|
|
70
|
+
dragPer100m: 0.18,
|
|
71
|
+
kind: "hp"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "40sw",
|
|
75
|
+
label: ".40 S&W",
|
|
76
|
+
diameter: 10.2,
|
|
77
|
+
bulletGrams: 11.7,
|
|
78
|
+
muzzleSpeed: 310,
|
|
79
|
+
dragPer100m: 0.2,
|
|
80
|
+
kind: "fmj"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "45acp",
|
|
84
|
+
label: ".45 ACP",
|
|
85
|
+
diameter: 11.5,
|
|
86
|
+
bulletGrams: 14.9,
|
|
87
|
+
muzzleSpeed: 254,
|
|
88
|
+
dragPer100m: 0.2,
|
|
89
|
+
kind: "fmj"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: "380acp",
|
|
93
|
+
label: ".380 ACP",
|
|
94
|
+
diameter: 9,
|
|
95
|
+
bulletGrams: 6.2,
|
|
96
|
+
muzzleSpeed: 295,
|
|
97
|
+
dragPer100m: 0.22,
|
|
98
|
+
kind: "fmj"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "5_56x45",
|
|
102
|
+
label: "5.56\xD745 mm",
|
|
103
|
+
diameter: 5.7,
|
|
104
|
+
bulletGrams: 4,
|
|
105
|
+
muzzleSpeed: 935,
|
|
106
|
+
dragPer100m: 0.1,
|
|
107
|
+
kind: "fmj"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "7_62x39",
|
|
111
|
+
label: "7.62\xD739 mm",
|
|
112
|
+
diameter: 7.9,
|
|
113
|
+
bulletGrams: 8,
|
|
114
|
+
muzzleSpeed: 725,
|
|
115
|
+
dragPer100m: 0.1,
|
|
116
|
+
kind: "fmj"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "7_62x51",
|
|
120
|
+
label: "7.62\xD751 mm (.308)",
|
|
121
|
+
diameter: 7.8,
|
|
122
|
+
bulletGrams: 9.7,
|
|
123
|
+
muzzleSpeed: 850,
|
|
124
|
+
dragPer100m: 0.08,
|
|
125
|
+
kind: "fmj"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "338lapua",
|
|
129
|
+
label: ".338 Lapua Magnum",
|
|
130
|
+
diameter: 8.6,
|
|
131
|
+
bulletGrams: 16.2,
|
|
132
|
+
muzzleSpeed: 903,
|
|
133
|
+
dragPer100m: 0.06,
|
|
134
|
+
kind: "fmj"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "50bmg",
|
|
138
|
+
label: ".50 BMG",
|
|
139
|
+
diameter: 12.7,
|
|
140
|
+
bulletGrams: 42,
|
|
141
|
+
muzzleSpeed: 925,
|
|
142
|
+
dragPer100m: 0.05,
|
|
143
|
+
kind: "ap"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "12ga_00buck",
|
|
147
|
+
label: "12 ga 00 buck",
|
|
148
|
+
diameter: 8.4,
|
|
149
|
+
bulletGrams: 3.5,
|
|
150
|
+
muzzleSpeed: 414,
|
|
151
|
+
pellets: 9,
|
|
152
|
+
dragPer100m: 0.45,
|
|
153
|
+
kind: "buck"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
id: "12ga_slug",
|
|
157
|
+
label: "12 ga slug",
|
|
158
|
+
diameter: 18.5,
|
|
159
|
+
bulletGrams: 28,
|
|
160
|
+
muzzleSpeed: 463,
|
|
161
|
+
dragPer100m: 0.3,
|
|
162
|
+
kind: "slug"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: "12ga_birdshot",
|
|
166
|
+
label: "12 ga birdshot",
|
|
167
|
+
diameter: 2.4,
|
|
168
|
+
bulletGrams: 0.2,
|
|
169
|
+
muzzleSpeed: 400,
|
|
170
|
+
pellets: 90,
|
|
171
|
+
dragPer100m: 0.6,
|
|
172
|
+
kind: "birdshot"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "20ga_buck",
|
|
176
|
+
label: "20 ga buck",
|
|
177
|
+
diameter: 6.9,
|
|
178
|
+
bulletGrams: 1.3,
|
|
179
|
+
muzzleSpeed: 400,
|
|
180
|
+
pellets: 20,
|
|
181
|
+
dragPer100m: 0.5,
|
|
182
|
+
kind: "buck"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: "arrow",
|
|
186
|
+
label: "Arrow (compound bow)",
|
|
187
|
+
diameter: 7,
|
|
188
|
+
bulletGrams: 25,
|
|
189
|
+
muzzleSpeed: 90,
|
|
190
|
+
dragPer100m: 0.12,
|
|
191
|
+
kind: "arrow"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "crossbow_bolt",
|
|
195
|
+
label: "Crossbow bolt",
|
|
196
|
+
diameter: 8,
|
|
197
|
+
bulletGrams: 20,
|
|
198
|
+
muzzleSpeed: 122,
|
|
199
|
+
dragPer100m: 0.12,
|
|
200
|
+
kind: "bolt"
|
|
201
|
+
}
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
// src/data/weapons.json
|
|
205
|
+
var weapons_default = [
|
|
206
|
+
{
|
|
207
|
+
id: "hand",
|
|
208
|
+
name: "Hand",
|
|
209
|
+
category: "hand",
|
|
210
|
+
action: {
|
|
211
|
+
kind: "hand",
|
|
212
|
+
reach: 2
|
|
213
|
+
},
|
|
214
|
+
mass: 0,
|
|
215
|
+
tags: [
|
|
216
|
+
"grab"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "kick",
|
|
221
|
+
name: "Kick",
|
|
222
|
+
category: "melee_blunt",
|
|
223
|
+
action: {
|
|
224
|
+
kind: "melee",
|
|
225
|
+
damage: "blunt",
|
|
226
|
+
energy: 250,
|
|
227
|
+
radius: 0.08,
|
|
228
|
+
reach: 1.1,
|
|
229
|
+
rpm: 60,
|
|
230
|
+
noise: 8
|
|
231
|
+
},
|
|
232
|
+
mass: 0
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "shove",
|
|
236
|
+
name: "Shove",
|
|
237
|
+
category: "melee_blunt",
|
|
238
|
+
action: {
|
|
239
|
+
kind: "melee",
|
|
240
|
+
damage: "blunt",
|
|
241
|
+
energy: 80,
|
|
242
|
+
radius: 0.1,
|
|
243
|
+
reach: 1.5,
|
|
244
|
+
rpm: 90,
|
|
245
|
+
noise: 5
|
|
246
|
+
},
|
|
247
|
+
mass: 0
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "pistol_9mm",
|
|
251
|
+
name: "9 mm service pistol",
|
|
252
|
+
category: "pistol",
|
|
253
|
+
action: {
|
|
254
|
+
kind: "firearm",
|
|
255
|
+
caliber: "9x19",
|
|
256
|
+
rpm: 300,
|
|
257
|
+
modes: [
|
|
258
|
+
"semi"
|
|
259
|
+
],
|
|
260
|
+
magazine: 15,
|
|
261
|
+
reload: 2,
|
|
262
|
+
barrel: 1,
|
|
263
|
+
spreadDeg: 1,
|
|
264
|
+
bloomDeg: 0.6,
|
|
265
|
+
recoveryDegPerS: 4,
|
|
266
|
+
recoil: [
|
|
267
|
+
1.2,
|
|
268
|
+
0.4
|
|
269
|
+
],
|
|
270
|
+
range: 50,
|
|
271
|
+
noise: 150
|
|
272
|
+
},
|
|
273
|
+
mass: 0.9,
|
|
274
|
+
tags: [
|
|
275
|
+
"sidearm"
|
|
276
|
+
]
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
id: "pistol_45",
|
|
280
|
+
name: ".45 ACP pistol",
|
|
281
|
+
category: "pistol",
|
|
282
|
+
action: {
|
|
283
|
+
kind: "firearm",
|
|
284
|
+
caliber: "45acp",
|
|
285
|
+
rpm: 280,
|
|
286
|
+
modes: [
|
|
287
|
+
"semi"
|
|
288
|
+
],
|
|
289
|
+
magazine: 8,
|
|
290
|
+
reload: 2.2,
|
|
291
|
+
barrel: 1,
|
|
292
|
+
spreadDeg: 1.1,
|
|
293
|
+
bloomDeg: 0.8,
|
|
294
|
+
recoveryDegPerS: 4,
|
|
295
|
+
recoil: [
|
|
296
|
+
1.8,
|
|
297
|
+
0.6
|
|
298
|
+
],
|
|
299
|
+
range: 50,
|
|
300
|
+
noise: 160
|
|
301
|
+
},
|
|
302
|
+
mass: 1.1,
|
|
303
|
+
tags: [
|
|
304
|
+
"sidearm"
|
|
305
|
+
]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
id: "pistol_22",
|
|
309
|
+
name: ".22 LR pistol",
|
|
310
|
+
category: "pistol",
|
|
311
|
+
action: {
|
|
312
|
+
kind: "firearm",
|
|
313
|
+
caliber: "22lr",
|
|
314
|
+
rpm: 360,
|
|
315
|
+
modes: [
|
|
316
|
+
"semi"
|
|
317
|
+
],
|
|
318
|
+
magazine: 10,
|
|
319
|
+
reload: 1.8,
|
|
320
|
+
barrel: 1,
|
|
321
|
+
spreadDeg: 0.9,
|
|
322
|
+
bloomDeg: 0.3,
|
|
323
|
+
recoveryDegPerS: 5,
|
|
324
|
+
recoil: [
|
|
325
|
+
0.5,
|
|
326
|
+
0.2
|
|
327
|
+
],
|
|
328
|
+
range: 40,
|
|
329
|
+
noise: 90
|
|
330
|
+
},
|
|
331
|
+
mass: 0.7,
|
|
332
|
+
tags: [
|
|
333
|
+
"sidearm"
|
|
334
|
+
]
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: "revolver_357",
|
|
338
|
+
name: ".357 Magnum revolver",
|
|
339
|
+
category: "revolver",
|
|
340
|
+
action: {
|
|
341
|
+
kind: "firearm",
|
|
342
|
+
caliber: "357mag",
|
|
343
|
+
rpm: 150,
|
|
344
|
+
modes: [
|
|
345
|
+
"single"
|
|
346
|
+
],
|
|
347
|
+
magazine: 6,
|
|
348
|
+
reload: 4,
|
|
349
|
+
barrel: 1.05,
|
|
350
|
+
spreadDeg: 0.8,
|
|
351
|
+
bloomDeg: 1,
|
|
352
|
+
recoveryDegPerS: 3,
|
|
353
|
+
recoil: [
|
|
354
|
+
3,
|
|
355
|
+
0.9
|
|
356
|
+
],
|
|
357
|
+
range: 60,
|
|
358
|
+
noise: 220
|
|
359
|
+
},
|
|
360
|
+
mass: 1.2,
|
|
361
|
+
tags: [
|
|
362
|
+
"sidearm"
|
|
363
|
+
]
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
id: "revolver_38",
|
|
367
|
+
name: ".38 Special revolver",
|
|
368
|
+
category: "revolver",
|
|
369
|
+
action: {
|
|
370
|
+
kind: "firearm",
|
|
371
|
+
caliber: "38spl",
|
|
372
|
+
rpm: 160,
|
|
373
|
+
modes: [
|
|
374
|
+
"single"
|
|
375
|
+
],
|
|
376
|
+
magazine: 6,
|
|
377
|
+
reload: 3.8,
|
|
378
|
+
barrel: 0.95,
|
|
379
|
+
spreadDeg: 0.9,
|
|
380
|
+
bloomDeg: 0.7,
|
|
381
|
+
recoveryDegPerS: 3.5,
|
|
382
|
+
recoil: [
|
|
383
|
+
1.6,
|
|
384
|
+
0.5
|
|
385
|
+
],
|
|
386
|
+
range: 45,
|
|
387
|
+
noise: 170
|
|
388
|
+
},
|
|
389
|
+
mass: 0.9,
|
|
390
|
+
tags: [
|
|
391
|
+
"sidearm"
|
|
392
|
+
]
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
id: "smg_9mm",
|
|
396
|
+
name: "9 mm submachine gun",
|
|
397
|
+
category: "smg",
|
|
398
|
+
action: {
|
|
399
|
+
kind: "firearm",
|
|
400
|
+
caliber: "9x19",
|
|
401
|
+
rpm: 800,
|
|
402
|
+
modes: [
|
|
403
|
+
"auto",
|
|
404
|
+
"burst",
|
|
405
|
+
"semi"
|
|
406
|
+
],
|
|
407
|
+
burst: 3,
|
|
408
|
+
magazine: 30,
|
|
409
|
+
reload: 2.4,
|
|
410
|
+
barrel: 1.1,
|
|
411
|
+
spreadDeg: 1.5,
|
|
412
|
+
bloomDeg: 0.35,
|
|
413
|
+
recoveryDegPerS: 6,
|
|
414
|
+
recoil: [
|
|
415
|
+
0.9,
|
|
416
|
+
0.5
|
|
417
|
+
],
|
|
418
|
+
range: 80,
|
|
419
|
+
noise: 180
|
|
420
|
+
},
|
|
421
|
+
mass: 2.6,
|
|
422
|
+
tags: [
|
|
423
|
+
"automatic"
|
|
424
|
+
]
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
id: "carbine_22",
|
|
428
|
+
name: ".22 LR carbine",
|
|
429
|
+
category: "carbine",
|
|
430
|
+
action: {
|
|
431
|
+
kind: "firearm",
|
|
432
|
+
caliber: "22lr",
|
|
433
|
+
rpm: 300,
|
|
434
|
+
modes: [
|
|
435
|
+
"semi"
|
|
436
|
+
],
|
|
437
|
+
magazine: 10,
|
|
438
|
+
reload: 2.2,
|
|
439
|
+
barrel: 1.4,
|
|
440
|
+
spreadDeg: 0.5,
|
|
441
|
+
bloomDeg: 0.15,
|
|
442
|
+
recoveryDegPerS: 5,
|
|
443
|
+
recoil: [
|
|
444
|
+
0.4,
|
|
445
|
+
0.15
|
|
446
|
+
],
|
|
447
|
+
range: 80,
|
|
448
|
+
noise: 100
|
|
449
|
+
},
|
|
450
|
+
mass: 2.4,
|
|
451
|
+
tags: [
|
|
452
|
+
"small_game"
|
|
453
|
+
]
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
id: "rifle_5_56",
|
|
457
|
+
name: "5.56 mm assault rifle",
|
|
458
|
+
category: "rifle",
|
|
459
|
+
action: {
|
|
460
|
+
kind: "firearm",
|
|
461
|
+
caliber: "5_56x45",
|
|
462
|
+
rpm: 750,
|
|
463
|
+
modes: [
|
|
464
|
+
"auto",
|
|
465
|
+
"burst",
|
|
466
|
+
"semi"
|
|
467
|
+
],
|
|
468
|
+
burst: 3,
|
|
469
|
+
magazine: 30,
|
|
470
|
+
reload: 2.5,
|
|
471
|
+
barrel: 1,
|
|
472
|
+
spreadDeg: 0.6,
|
|
473
|
+
bloomDeg: 0.25,
|
|
474
|
+
recoveryDegPerS: 5,
|
|
475
|
+
recoil: [
|
|
476
|
+
1,
|
|
477
|
+
0.6
|
|
478
|
+
],
|
|
479
|
+
range: 400,
|
|
480
|
+
noise: 300
|
|
481
|
+
},
|
|
482
|
+
mass: 3.4,
|
|
483
|
+
tags: [
|
|
484
|
+
"automatic"
|
|
485
|
+
]
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
id: "rifle_7_62x39",
|
|
489
|
+
name: "7.62\xD739 mm assault rifle",
|
|
490
|
+
category: "rifle",
|
|
491
|
+
action: {
|
|
492
|
+
kind: "firearm",
|
|
493
|
+
caliber: "7_62x39",
|
|
494
|
+
rpm: 600,
|
|
495
|
+
modes: [
|
|
496
|
+
"auto",
|
|
497
|
+
"semi"
|
|
498
|
+
],
|
|
499
|
+
magazine: 30,
|
|
500
|
+
reload: 2.8,
|
|
501
|
+
barrel: 1,
|
|
502
|
+
spreadDeg: 0.8,
|
|
503
|
+
bloomDeg: 0.35,
|
|
504
|
+
recoveryDegPerS: 4.5,
|
|
505
|
+
recoil: [
|
|
506
|
+
1.5,
|
|
507
|
+
0.8
|
|
508
|
+
],
|
|
509
|
+
range: 350,
|
|
510
|
+
noise: 320
|
|
511
|
+
},
|
|
512
|
+
mass: 3.8,
|
|
513
|
+
tags: [
|
|
514
|
+
"automatic"
|
|
515
|
+
]
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
id: "rifle_bolt_308",
|
|
519
|
+
name: ".308 bolt-action rifle",
|
|
520
|
+
category: "rifle",
|
|
521
|
+
action: {
|
|
522
|
+
kind: "firearm",
|
|
523
|
+
caliber: "7_62x51",
|
|
524
|
+
rpm: 40,
|
|
525
|
+
modes: [
|
|
526
|
+
"bolt"
|
|
527
|
+
],
|
|
528
|
+
magazine: 5,
|
|
529
|
+
reload: 3.5,
|
|
530
|
+
barrel: 1.05,
|
|
531
|
+
spreadDeg: 0.25,
|
|
532
|
+
bloomDeg: 0.3,
|
|
533
|
+
recoveryDegPerS: 3,
|
|
534
|
+
recoil: [
|
|
535
|
+
3,
|
|
536
|
+
0.5
|
|
537
|
+
],
|
|
538
|
+
range: 800,
|
|
539
|
+
noise: 350
|
|
540
|
+
},
|
|
541
|
+
mass: 4,
|
|
542
|
+
tags: [
|
|
543
|
+
"hunting"
|
|
544
|
+
]
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
id: "sniper_338",
|
|
548
|
+
name: ".338 Lapua sniper rifle",
|
|
549
|
+
category: "sniper",
|
|
550
|
+
action: {
|
|
551
|
+
kind: "firearm",
|
|
552
|
+
caliber: "338lapua",
|
|
553
|
+
rpm: 35,
|
|
554
|
+
modes: [
|
|
555
|
+
"bolt"
|
|
556
|
+
],
|
|
557
|
+
magazine: 5,
|
|
558
|
+
reload: 4,
|
|
559
|
+
barrel: 1.05,
|
|
560
|
+
spreadDeg: 0.1,
|
|
561
|
+
bloomDeg: 0.3,
|
|
562
|
+
recoveryDegPerS: 2.5,
|
|
563
|
+
recoil: [
|
|
564
|
+
4.5,
|
|
565
|
+
0.7
|
|
566
|
+
],
|
|
567
|
+
range: 1500,
|
|
568
|
+
noise: 450
|
|
569
|
+
},
|
|
570
|
+
mass: 6.5,
|
|
571
|
+
tags: [
|
|
572
|
+
"long_range"
|
|
573
|
+
]
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
id: "anti_materiel_50",
|
|
577
|
+
name: ".50 BMG anti-materiel rifle",
|
|
578
|
+
category: "sniper",
|
|
579
|
+
action: {
|
|
580
|
+
kind: "firearm",
|
|
581
|
+
caliber: "50bmg",
|
|
582
|
+
rpm: 30,
|
|
583
|
+
modes: [
|
|
584
|
+
"semi"
|
|
585
|
+
],
|
|
586
|
+
magazine: 10,
|
|
587
|
+
reload: 4.5,
|
|
588
|
+
barrel: 1.05,
|
|
589
|
+
spreadDeg: 0.15,
|
|
590
|
+
bloomDeg: 0.5,
|
|
591
|
+
recoveryDegPerS: 2,
|
|
592
|
+
recoil: [
|
|
593
|
+
7,
|
|
594
|
+
1.2
|
|
595
|
+
],
|
|
596
|
+
range: 1800,
|
|
597
|
+
noise: 600
|
|
598
|
+
},
|
|
599
|
+
mass: 12.5,
|
|
600
|
+
tags: [
|
|
601
|
+
"long_range",
|
|
602
|
+
"heavy"
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
id: "shotgun_pump_12",
|
|
607
|
+
name: "12 gauge pump-action shotgun",
|
|
608
|
+
category: "shotgun",
|
|
609
|
+
action: {
|
|
610
|
+
kind: "firearm",
|
|
611
|
+
caliber: "12ga_00buck",
|
|
612
|
+
rpm: 60,
|
|
613
|
+
modes: [
|
|
614
|
+
"pump"
|
|
615
|
+
],
|
|
616
|
+
magazine: 6,
|
|
617
|
+
reload: 0.6,
|
|
618
|
+
perRound: true,
|
|
619
|
+
barrel: 1,
|
|
620
|
+
spreadDeg: 1,
|
|
621
|
+
bloomDeg: 0.5,
|
|
622
|
+
recoveryDegPerS: 3,
|
|
623
|
+
pelletSpreadDeg: 3,
|
|
624
|
+
recoil: [
|
|
625
|
+
4,
|
|
626
|
+
1
|
|
627
|
+
],
|
|
628
|
+
range: 40,
|
|
629
|
+
noise: 400
|
|
630
|
+
},
|
|
631
|
+
mass: 3.2,
|
|
632
|
+
tags: [
|
|
633
|
+
"shotgun"
|
|
634
|
+
]
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
id: "shotgun_double_12",
|
|
638
|
+
name: "12 gauge double-barrel shotgun",
|
|
639
|
+
category: "shotgun",
|
|
640
|
+
action: {
|
|
641
|
+
kind: "firearm",
|
|
642
|
+
caliber: "12ga_00buck",
|
|
643
|
+
rpm: 120,
|
|
644
|
+
modes: [
|
|
645
|
+
"break"
|
|
646
|
+
],
|
|
647
|
+
magazine: 2,
|
|
648
|
+
reload: 3.5,
|
|
649
|
+
barrel: 1,
|
|
650
|
+
spreadDeg: 1,
|
|
651
|
+
bloomDeg: 0.5,
|
|
652
|
+
recoveryDegPerS: 3,
|
|
653
|
+
pelletSpreadDeg: 3,
|
|
654
|
+
recoil: [
|
|
655
|
+
4.5,
|
|
656
|
+
1.2
|
|
657
|
+
],
|
|
658
|
+
range: 35,
|
|
659
|
+
noise: 400
|
|
660
|
+
},
|
|
661
|
+
mass: 3,
|
|
662
|
+
tags: [
|
|
663
|
+
"shotgun"
|
|
664
|
+
]
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
id: "shotgun_semi_12",
|
|
668
|
+
name: "12 gauge semi-automatic shotgun",
|
|
669
|
+
category: "shotgun",
|
|
670
|
+
action: {
|
|
671
|
+
kind: "firearm",
|
|
672
|
+
caliber: "12ga_00buck",
|
|
673
|
+
rpm: 180,
|
|
674
|
+
modes: [
|
|
675
|
+
"semi"
|
|
676
|
+
],
|
|
677
|
+
magazine: 5,
|
|
678
|
+
reload: 0.7,
|
|
679
|
+
perRound: true,
|
|
680
|
+
barrel: 1,
|
|
681
|
+
spreadDeg: 1,
|
|
682
|
+
bloomDeg: 0.5,
|
|
683
|
+
recoveryDegPerS: 3,
|
|
684
|
+
pelletSpreadDeg: 3,
|
|
685
|
+
recoil: [
|
|
686
|
+
3.4,
|
|
687
|
+
1
|
|
688
|
+
],
|
|
689
|
+
range: 40,
|
|
690
|
+
noise: 400
|
|
691
|
+
},
|
|
692
|
+
mass: 3.4,
|
|
693
|
+
tags: [
|
|
694
|
+
"shotgun"
|
|
695
|
+
]
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
id: "bow_compound",
|
|
699
|
+
name: "Compound bow",
|
|
700
|
+
category: "bow",
|
|
701
|
+
action: {
|
|
702
|
+
kind: "firearm",
|
|
703
|
+
caliber: "arrow",
|
|
704
|
+
rpm: 20,
|
|
705
|
+
modes: [
|
|
706
|
+
"single"
|
|
707
|
+
],
|
|
708
|
+
magazine: 1,
|
|
709
|
+
reload: 1.5,
|
|
710
|
+
barrel: 1,
|
|
711
|
+
spreadDeg: 0.4,
|
|
712
|
+
bloomDeg: 0.4,
|
|
713
|
+
recoveryDegPerS: 2,
|
|
714
|
+
recoil: [
|
|
715
|
+
0.3,
|
|
716
|
+
0.1
|
|
717
|
+
],
|
|
718
|
+
range: 60,
|
|
719
|
+
noise: 20
|
|
720
|
+
},
|
|
721
|
+
mass: 1.8,
|
|
722
|
+
tags: [
|
|
723
|
+
"silent"
|
|
724
|
+
]
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
id: "crossbow",
|
|
728
|
+
name: "Crossbow",
|
|
729
|
+
category: "crossbow",
|
|
730
|
+
action: {
|
|
731
|
+
kind: "firearm",
|
|
732
|
+
caliber: "crossbow_bolt",
|
|
733
|
+
rpm: 8,
|
|
734
|
+
modes: [
|
|
735
|
+
"single"
|
|
736
|
+
],
|
|
737
|
+
magazine: 1,
|
|
738
|
+
reload: 4,
|
|
739
|
+
barrel: 1,
|
|
740
|
+
spreadDeg: 0.3,
|
|
741
|
+
bloomDeg: 0.3,
|
|
742
|
+
recoveryDegPerS: 2,
|
|
743
|
+
recoil: [
|
|
744
|
+
0.5,
|
|
745
|
+
0.1
|
|
746
|
+
],
|
|
747
|
+
range: 70,
|
|
748
|
+
noise: 25
|
|
749
|
+
},
|
|
750
|
+
mass: 3,
|
|
751
|
+
tags: [
|
|
752
|
+
"silent"
|
|
753
|
+
]
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
id: "hammer",
|
|
757
|
+
name: "Hammer",
|
|
758
|
+
category: "melee_blunt",
|
|
759
|
+
action: {
|
|
760
|
+
kind: "melee",
|
|
761
|
+
damage: "blunt",
|
|
762
|
+
energy: 60,
|
|
763
|
+
radius: 0.08,
|
|
764
|
+
reach: 0.7,
|
|
765
|
+
rpm: 70,
|
|
766
|
+
noise: 6
|
|
767
|
+
},
|
|
768
|
+
mass: 1
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
id: "sledgehammer",
|
|
772
|
+
name: "Sledgehammer",
|
|
773
|
+
category: "melee_blunt",
|
|
774
|
+
action: {
|
|
775
|
+
kind: "melee",
|
|
776
|
+
damage: "blunt",
|
|
777
|
+
energy: 300,
|
|
778
|
+
radius: 0.15,
|
|
779
|
+
reach: 1.1,
|
|
780
|
+
rpm: 30,
|
|
781
|
+
noise: 8
|
|
782
|
+
},
|
|
783
|
+
mass: 5.5,
|
|
784
|
+
tags: [
|
|
785
|
+
"heavy"
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
id: "baseball_bat",
|
|
790
|
+
name: "Baseball bat",
|
|
791
|
+
category: "melee_blunt",
|
|
792
|
+
action: {
|
|
793
|
+
kind: "melee",
|
|
794
|
+
damage: "blunt",
|
|
795
|
+
energy: 150,
|
|
796
|
+
radius: 0.1,
|
|
797
|
+
reach: 1,
|
|
798
|
+
rpm: 60,
|
|
799
|
+
noise: 7
|
|
800
|
+
},
|
|
801
|
+
mass: 0.9
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
id: "crowbar",
|
|
805
|
+
name: "Crowbar",
|
|
806
|
+
category: "melee_blunt",
|
|
807
|
+
action: {
|
|
808
|
+
kind: "melee",
|
|
809
|
+
damage: "blunt",
|
|
810
|
+
energy: 120,
|
|
811
|
+
radius: 0.08,
|
|
812
|
+
reach: 0.9,
|
|
813
|
+
rpm: 60,
|
|
814
|
+
noise: 7
|
|
815
|
+
},
|
|
816
|
+
mass: 2,
|
|
817
|
+
tags: [
|
|
818
|
+
"pry"
|
|
819
|
+
]
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
id: "machete",
|
|
823
|
+
name: "Machete",
|
|
824
|
+
category: "melee_blade",
|
|
825
|
+
action: {
|
|
826
|
+
kind: "melee",
|
|
827
|
+
damage: "slash",
|
|
828
|
+
energy: 140,
|
|
829
|
+
radius: 0.06,
|
|
830
|
+
reach: 0.8,
|
|
831
|
+
rpm: 80,
|
|
832
|
+
noise: 6
|
|
833
|
+
},
|
|
834
|
+
mass: 0.8
|
|
835
|
+
},
|
|
836
|
+
{
|
|
837
|
+
id: "axe",
|
|
838
|
+
name: "Axe",
|
|
839
|
+
category: "melee_blade",
|
|
840
|
+
action: {
|
|
841
|
+
kind: "melee",
|
|
842
|
+
damage: "slash",
|
|
843
|
+
energy: 250,
|
|
844
|
+
radius: 0.08,
|
|
845
|
+
reach: 0.9,
|
|
846
|
+
rpm: 45,
|
|
847
|
+
noise: 8
|
|
848
|
+
},
|
|
849
|
+
mass: 1.6
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
id: "knife",
|
|
853
|
+
name: "Knife",
|
|
854
|
+
category: "melee_blade",
|
|
855
|
+
action: {
|
|
856
|
+
kind: "melee",
|
|
857
|
+
damage: "slash",
|
|
858
|
+
energy: 40,
|
|
859
|
+
radius: 0.03,
|
|
860
|
+
reach: 0.4,
|
|
861
|
+
rpm: 100,
|
|
862
|
+
noise: 5
|
|
863
|
+
},
|
|
864
|
+
mass: 0.2
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
id: "fists",
|
|
868
|
+
name: "Fists",
|
|
869
|
+
category: "melee_blunt",
|
|
870
|
+
action: {
|
|
871
|
+
kind: "melee",
|
|
872
|
+
damage: "blunt",
|
|
873
|
+
energy: 25,
|
|
874
|
+
radius: 0.1,
|
|
875
|
+
reach: 0.6,
|
|
876
|
+
rpm: 120,
|
|
877
|
+
noise: 5
|
|
878
|
+
},
|
|
879
|
+
mass: 0
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
id: "lighter",
|
|
883
|
+
name: "Lighter",
|
|
884
|
+
category: "flame",
|
|
885
|
+
action: {
|
|
886
|
+
kind: "flame",
|
|
887
|
+
temperature: 400,
|
|
888
|
+
radius: 0.03,
|
|
889
|
+
range: 0.15,
|
|
890
|
+
fuelPerSecond: 0.02,
|
|
891
|
+
fuel: 60,
|
|
892
|
+
noise: 0
|
|
893
|
+
},
|
|
894
|
+
mass: 0.05,
|
|
895
|
+
tags: [
|
|
896
|
+
"fire"
|
|
897
|
+
]
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
id: "flamethrower",
|
|
901
|
+
name: "Flamethrower",
|
|
902
|
+
category: "flame",
|
|
903
|
+
action: {
|
|
904
|
+
kind: "flame",
|
|
905
|
+
temperature: 900,
|
|
906
|
+
radius: 0.6,
|
|
907
|
+
range: 6,
|
|
908
|
+
fuelPerSecond: 1,
|
|
909
|
+
fuel: 20,
|
|
910
|
+
cone: true,
|
|
911
|
+
noise: 20
|
|
912
|
+
},
|
|
913
|
+
mass: 15,
|
|
914
|
+
tags: [
|
|
915
|
+
"fire"
|
|
916
|
+
]
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
id: "molotov",
|
|
920
|
+
name: "Molotov cocktail",
|
|
921
|
+
category: "throwable",
|
|
922
|
+
action: {
|
|
923
|
+
kind: "throwable",
|
|
924
|
+
energy: 500,
|
|
925
|
+
radius: 1.5,
|
|
926
|
+
fuse: 0,
|
|
927
|
+
throwSpeed: 12,
|
|
928
|
+
fire: {
|
|
929
|
+
temperature: 700,
|
|
930
|
+
radius: 1.5,
|
|
931
|
+
seconds: 12
|
|
932
|
+
},
|
|
933
|
+
noise: 60
|
|
934
|
+
},
|
|
935
|
+
mass: 0.8,
|
|
936
|
+
tags: [
|
|
937
|
+
"fire",
|
|
938
|
+
"improvised"
|
|
939
|
+
]
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
id: "cutting_torch",
|
|
943
|
+
name: "Oxy-fuel cutting torch",
|
|
944
|
+
category: "heat",
|
|
945
|
+
action: {
|
|
946
|
+
kind: "heat",
|
|
947
|
+
temperature: 3e3,
|
|
948
|
+
radius: 0.02,
|
|
949
|
+
range: 0.25,
|
|
950
|
+
fuelPerSecond: 0.05,
|
|
951
|
+
fuel: 30,
|
|
952
|
+
noise: 15
|
|
953
|
+
},
|
|
954
|
+
mass: 4,
|
|
955
|
+
tags: [
|
|
956
|
+
"fire",
|
|
957
|
+
"cutting"
|
|
958
|
+
]
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
id: "blowtorch",
|
|
962
|
+
name: "Blowtorch",
|
|
963
|
+
category: "heat",
|
|
964
|
+
action: {
|
|
965
|
+
kind: "heat",
|
|
966
|
+
temperature: 1300,
|
|
967
|
+
radius: 0.04,
|
|
968
|
+
range: 0.3,
|
|
969
|
+
fuelPerSecond: 0.04,
|
|
970
|
+
fuel: 30,
|
|
971
|
+
noise: 10
|
|
972
|
+
},
|
|
973
|
+
mass: 0.6,
|
|
974
|
+
tags: [
|
|
975
|
+
"fire"
|
|
976
|
+
]
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
id: "frag_grenade",
|
|
980
|
+
name: "Fragmentation grenade",
|
|
981
|
+
category: "throwable",
|
|
982
|
+
action: {
|
|
983
|
+
kind: "throwable",
|
|
984
|
+
energy: 2e5,
|
|
985
|
+
radius: 6,
|
|
986
|
+
fuse: 4,
|
|
987
|
+
throwSpeed: 15,
|
|
988
|
+
noise: 400
|
|
989
|
+
},
|
|
990
|
+
mass: 0.45,
|
|
991
|
+
tags: [
|
|
992
|
+
"explosive"
|
|
993
|
+
]
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
id: "pipe_bomb",
|
|
997
|
+
name: "Pipe bomb",
|
|
998
|
+
category: "throwable",
|
|
999
|
+
action: {
|
|
1000
|
+
kind: "throwable",
|
|
1001
|
+
energy: 1e5,
|
|
1002
|
+
radius: 4,
|
|
1003
|
+
fuse: 3,
|
|
1004
|
+
throwSpeed: 13,
|
|
1005
|
+
noise: 350
|
|
1006
|
+
},
|
|
1007
|
+
mass: 0.7,
|
|
1008
|
+
tags: [
|
|
1009
|
+
"explosive",
|
|
1010
|
+
"improvised"
|
|
1011
|
+
]
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
id: "screwdriver",
|
|
1015
|
+
name: "Screwdriver",
|
|
1016
|
+
category: "tool",
|
|
1017
|
+
action: {
|
|
1018
|
+
kind: "tool",
|
|
1019
|
+
tool: "screwdriver",
|
|
1020
|
+
reach: 0.5,
|
|
1021
|
+
noise: 5
|
|
1022
|
+
},
|
|
1023
|
+
mass: 0.15
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
id: "wrench",
|
|
1027
|
+
name: "Wrench",
|
|
1028
|
+
category: "tool",
|
|
1029
|
+
action: {
|
|
1030
|
+
kind: "tool",
|
|
1031
|
+
tool: "wrench",
|
|
1032
|
+
reach: 0.6,
|
|
1033
|
+
noise: 6
|
|
1034
|
+
},
|
|
1035
|
+
mass: 0.5
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
id: "pry_bar",
|
|
1039
|
+
name: "Pry bar",
|
|
1040
|
+
category: "tool",
|
|
1041
|
+
action: {
|
|
1042
|
+
kind: "tool",
|
|
1043
|
+
tool: "pry_bar",
|
|
1044
|
+
reach: 0.8,
|
|
1045
|
+
noise: 8
|
|
1046
|
+
},
|
|
1047
|
+
mass: 0.8
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
id: "hacksaw",
|
|
1051
|
+
name: "Hacksaw",
|
|
1052
|
+
category: "tool",
|
|
1053
|
+
action: {
|
|
1054
|
+
kind: "tool",
|
|
1055
|
+
tool: "saw",
|
|
1056
|
+
reach: 0.7,
|
|
1057
|
+
noise: 10
|
|
1058
|
+
},
|
|
1059
|
+
mass: 0.6
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
id: "utility_knife",
|
|
1063
|
+
name: "Utility knife",
|
|
1064
|
+
category: "tool",
|
|
1065
|
+
action: {
|
|
1066
|
+
kind: "tool",
|
|
1067
|
+
tool: "knife",
|
|
1068
|
+
reach: 0.3,
|
|
1069
|
+
noise: 3
|
|
1070
|
+
},
|
|
1071
|
+
mass: 0.1
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
id: "claw_hammer",
|
|
1075
|
+
name: "Claw hammer",
|
|
1076
|
+
category: "tool",
|
|
1077
|
+
action: {
|
|
1078
|
+
kind: "tool",
|
|
1079
|
+
tool: "hammer",
|
|
1080
|
+
reach: 0.5,
|
|
1081
|
+
noise: 8
|
|
1082
|
+
},
|
|
1083
|
+
mass: 0.7
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
id: "extinguisher",
|
|
1087
|
+
name: "Fire extinguisher",
|
|
1088
|
+
category: "extinguisher",
|
|
1089
|
+
action: {
|
|
1090
|
+
kind: "extinguisher",
|
|
1091
|
+
range: 4,
|
|
1092
|
+
coolC: 300,
|
|
1093
|
+
charge: 12,
|
|
1094
|
+
noise: 25
|
|
1095
|
+
},
|
|
1096
|
+
mass: 5,
|
|
1097
|
+
tags: [
|
|
1098
|
+
"safety"
|
|
1099
|
+
]
|
|
1100
|
+
}
|
|
1101
|
+
];
|
|
1102
|
+
|
|
1103
|
+
// src/locale.ts
|
|
1104
|
+
var modesEn = { single: "single action", semi: "semi-automatic", burst: "burst", auto: "automatic", pump: "pump action", bolt: "bolt action", lever: "lever action", break: "break action" };
|
|
1105
|
+
var categoriesEn = {
|
|
1106
|
+
pistol: "pistol",
|
|
1107
|
+
revolver: "revolver",
|
|
1108
|
+
smg: "submachine gun",
|
|
1109
|
+
rifle: "rifle",
|
|
1110
|
+
carbine: "carbine",
|
|
1111
|
+
sniper: "sniper rifle",
|
|
1112
|
+
shotgun: "shotgun",
|
|
1113
|
+
bow: "bow",
|
|
1114
|
+
crossbow: "crossbow",
|
|
1115
|
+
melee_blunt: "blunt melee",
|
|
1116
|
+
melee_blade: "bladed melee",
|
|
1117
|
+
flame: "flame",
|
|
1118
|
+
heat: "heat",
|
|
1119
|
+
throwable: "throwable",
|
|
1120
|
+
tool: "tool",
|
|
1121
|
+
extinguisher: "extinguisher",
|
|
1122
|
+
hand: "hand"
|
|
1123
|
+
};
|
|
1124
|
+
var locales = {
|
|
1125
|
+
en: {
|
|
1126
|
+
weapons: {
|
|
1127
|
+
hand: "Hand",
|
|
1128
|
+
kick: "Kick",
|
|
1129
|
+
shove: "Shove",
|
|
1130
|
+
pistol_9mm: "9 mm service pistol",
|
|
1131
|
+
pistol_45: ".45 ACP pistol",
|
|
1132
|
+
pistol_22: ".22 LR pistol",
|
|
1133
|
+
revolver_357: ".357 Magnum revolver",
|
|
1134
|
+
revolver_38: ".38 Special revolver",
|
|
1135
|
+
smg_9mm: "9 mm submachine gun",
|
|
1136
|
+
carbine_22: ".22 LR carbine",
|
|
1137
|
+
rifle_5_56: "5.56 mm assault rifle",
|
|
1138
|
+
rifle_7_62x39: "7.62\xD739 mm assault rifle",
|
|
1139
|
+
rifle_bolt_308: ".308 bolt-action rifle",
|
|
1140
|
+
sniper_338: ".338 Lapua sniper rifle",
|
|
1141
|
+
anti_materiel_50: ".50 BMG anti-materiel rifle",
|
|
1142
|
+
shotgun_pump_12: "12 gauge pump-action shotgun",
|
|
1143
|
+
shotgun_double_12: "12 gauge double-barrel shotgun",
|
|
1144
|
+
shotgun_semi_12: "12 gauge semi-automatic shotgun",
|
|
1145
|
+
bow_compound: "Compound bow",
|
|
1146
|
+
crossbow: "Crossbow",
|
|
1147
|
+
hammer: "Hammer",
|
|
1148
|
+
sledgehammer: "Sledgehammer",
|
|
1149
|
+
baseball_bat: "Baseball bat",
|
|
1150
|
+
crowbar: "Crowbar",
|
|
1151
|
+
machete: "Machete",
|
|
1152
|
+
axe: "Axe",
|
|
1153
|
+
knife: "Knife",
|
|
1154
|
+
fists: "Fists",
|
|
1155
|
+
lighter: "Lighter",
|
|
1156
|
+
flamethrower: "Flamethrower",
|
|
1157
|
+
molotov: "Molotov cocktail",
|
|
1158
|
+
cutting_torch: "Oxy-fuel cutting torch",
|
|
1159
|
+
blowtorch: "Blowtorch",
|
|
1160
|
+
frag_grenade: "Fragmentation grenade",
|
|
1161
|
+
pipe_bomb: "Pipe bomb",
|
|
1162
|
+
screwdriver: "Screwdriver",
|
|
1163
|
+
wrench: "Wrench",
|
|
1164
|
+
pry_bar: "Pry bar",
|
|
1165
|
+
hacksaw: "Hacksaw",
|
|
1166
|
+
utility_knife: "Utility knife",
|
|
1167
|
+
claw_hammer: "Claw hammer",
|
|
1168
|
+
extinguisher: "Fire extinguisher"
|
|
1169
|
+
},
|
|
1170
|
+
modes: modesEn,
|
|
1171
|
+
categories: categoriesEn
|
|
1172
|
+
},
|
|
1173
|
+
"pt-BR": {
|
|
1174
|
+
weapons: {
|
|
1175
|
+
hand: "m\xE3o",
|
|
1176
|
+
kick: "chute",
|
|
1177
|
+
shove: "empurr\xE3o",
|
|
1178
|
+
pistol_9mm: "pistola 9 mm",
|
|
1179
|
+
pistol_45: "pistola .45",
|
|
1180
|
+
pistol_22: "pistola .22",
|
|
1181
|
+
revolver_357: "rev\xF3lver .357",
|
|
1182
|
+
revolver_38: "rev\xF3lver .38",
|
|
1183
|
+
smg_9mm: "submetralhadora 9 mm",
|
|
1184
|
+
carbine_22: "carabina .22",
|
|
1185
|
+
rifle_5_56: "fuzil 5,56",
|
|
1186
|
+
rifle_7_62x39: "fuzil 7,62\xD739",
|
|
1187
|
+
rifle_bolt_308: "fuzil de ferrolho .308",
|
|
1188
|
+
sniper_338: "fuzil de precis\xE3o .338",
|
|
1189
|
+
anti_materiel_50: "fuzil antimaterial .50",
|
|
1190
|
+
shotgun_pump_12: "espingarda de repeti\xE7\xE3o calibre 12",
|
|
1191
|
+
shotgun_double_12: "espingarda de dois canos calibre 12",
|
|
1192
|
+
shotgun_semi_12: "espingarda semiautom\xE1tica calibre 12",
|
|
1193
|
+
bow_compound: "arco composto",
|
|
1194
|
+
crossbow: "besta",
|
|
1195
|
+
hammer: "martelo",
|
|
1196
|
+
sledgehammer: "marreta",
|
|
1197
|
+
baseball_bat: "taco de beisebol",
|
|
1198
|
+
crowbar: "p\xE9 de cabra",
|
|
1199
|
+
machete: "fac\xE3o",
|
|
1200
|
+
axe: "machado",
|
|
1201
|
+
knife: "faca",
|
|
1202
|
+
fists: "punhos",
|
|
1203
|
+
lighter: "isqueiro",
|
|
1204
|
+
flamethrower: "lan\xE7a-chamas",
|
|
1205
|
+
molotov: "coquetel molotov",
|
|
1206
|
+
cutting_torch: "ma\xE7arico de corte",
|
|
1207
|
+
blowtorch: "ma\xE7arico",
|
|
1208
|
+
frag_grenade: "granada de fragmenta\xE7\xE3o",
|
|
1209
|
+
pipe_bomb: "bomba caseira",
|
|
1210
|
+
screwdriver: "chave de fenda",
|
|
1211
|
+
wrench: "chave inglesa",
|
|
1212
|
+
pry_bar: "alavanca",
|
|
1213
|
+
hacksaw: "serra de arco",
|
|
1214
|
+
utility_knife: "estilete",
|
|
1215
|
+
claw_hammer: "martelo de unha",
|
|
1216
|
+
extinguisher: "extintor"
|
|
1217
|
+
},
|
|
1218
|
+
modes: { single: "tiro \xFAnico", semi: "semiautom\xE1tico", burst: "rajada", auto: "autom\xE1tico", pump: "repeti\xE7\xE3o", bolt: "ferrolho", lever: "alavanca", break: "basculante" },
|
|
1219
|
+
categories: {
|
|
1220
|
+
pistol: "pistola",
|
|
1221
|
+
revolver: "rev\xF3lver",
|
|
1222
|
+
smg: "submetralhadora",
|
|
1223
|
+
rifle: "fuzil",
|
|
1224
|
+
carbine: "carabina",
|
|
1225
|
+
sniper: "fuzil de precis\xE3o",
|
|
1226
|
+
shotgun: "espingarda",
|
|
1227
|
+
bow: "arco",
|
|
1228
|
+
crossbow: "besta",
|
|
1229
|
+
melee_blunt: "corpo a corpo contundente",
|
|
1230
|
+
melee_blade: "corpo a corpo cortante",
|
|
1231
|
+
flame: "chama",
|
|
1232
|
+
heat: "calor",
|
|
1233
|
+
throwable: "arremess\xE1vel",
|
|
1234
|
+
tool: "ferramenta",
|
|
1235
|
+
extinguisher: "extintor",
|
|
1236
|
+
hand: "m\xE3o"
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
var resolveStrings = (locale) => locales[locale ?? "en"] ?? locales.en;
|
|
1241
|
+
|
|
1242
|
+
// src/rng.ts
|
|
1243
|
+
var createRng = (seed) => {
|
|
1244
|
+
let a = seed >>> 0;
|
|
1245
|
+
return () => {
|
|
1246
|
+
a = a + 1831565813 >>> 0;
|
|
1247
|
+
let t = a;
|
|
1248
|
+
t = Math.imul(t ^ t >>> 15, t | 1);
|
|
1249
|
+
t ^= t + Math.imul(t ^ t >>> 7, t | 61);
|
|
1250
|
+
return ((t ^ t >>> 14) >>> 0) / 4294967296;
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
var normalize = (v) => {
|
|
1254
|
+
const l = Math.hypot(v[0], v[1], v[2]);
|
|
1255
|
+
return l > 1e-12 ? [v[0] / l, v[1] / l, v[2] / l] : [0, 0, -1];
|
|
1256
|
+
};
|
|
1257
|
+
var cross = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
|
|
1258
|
+
var sampleCone = (dir, deg, rng) => {
|
|
1259
|
+
if (deg <= 0) return dir;
|
|
1260
|
+
const cosMax = Math.cos(deg * Math.PI / 180);
|
|
1261
|
+
const cosT = 1 - rng() * (1 - cosMax);
|
|
1262
|
+
const sinT = Math.sqrt(Math.max(0, 1 - cosT * cosT));
|
|
1263
|
+
const phi = rng() * Math.PI * 2;
|
|
1264
|
+
const helper = Math.abs(dir[1]) < 0.9 ? [0, 1, 0] : [1, 0, 0];
|
|
1265
|
+
const u = normalize(cross(helper, dir));
|
|
1266
|
+
const v = cross(dir, u);
|
|
1267
|
+
const cx = Math.cos(phi) * sinT;
|
|
1268
|
+
const cy = Math.sin(phi) * sinT;
|
|
1269
|
+
return normalize([
|
|
1270
|
+
u[0] * cx + v[0] * cy + dir[0] * cosT,
|
|
1271
|
+
u[1] * cx + v[1] * cy + dir[1] * cosT,
|
|
1272
|
+
u[2] * cx + v[2] * cy + dir[2] * cosT
|
|
1273
|
+
]);
|
|
1274
|
+
};
|
|
1275
|
+
|
|
1276
|
+
// src/weapon.ts
|
|
1277
|
+
var EPS = 1e-9;
|
|
1278
|
+
var DEFAULT_THROWABLES = 3;
|
|
1279
|
+
var BLOOM_CAP = 4;
|
|
1280
|
+
var THROW_LIFT = 0.15;
|
|
1281
|
+
var muzzleEnergy = (caliber, barrel = 1) => {
|
|
1282
|
+
const v = caliber.muzzleSpeed * barrel;
|
|
1283
|
+
return 0.5 * (caliber.bulletGrams / 1e3) * v * v;
|
|
1284
|
+
};
|
|
1285
|
+
var result = (status, extra = {}) => ({
|
|
1286
|
+
shots: [],
|
|
1287
|
+
uses: [],
|
|
1288
|
+
status,
|
|
1289
|
+
recoil: [0, 0],
|
|
1290
|
+
noise: 0,
|
|
1291
|
+
...extra
|
|
1292
|
+
});
|
|
1293
|
+
var WeaponRuntime = class {
|
|
1294
|
+
constructor(init) {
|
|
1295
|
+
__publicField(this, "def");
|
|
1296
|
+
__publicField(this, "caliber");
|
|
1297
|
+
__publicField(this, "reserve");
|
|
1298
|
+
__publicField(this, "mode");
|
|
1299
|
+
__publicField(this, "_ammo");
|
|
1300
|
+
__publicField(this, "_capacity");
|
|
1301
|
+
__publicField(this, "action");
|
|
1302
|
+
__publicField(this, "rng");
|
|
1303
|
+
__publicField(this, "initialReserve");
|
|
1304
|
+
__publicField(this, "clock", 0);
|
|
1305
|
+
/** Time already advanced by the other of update / trigger in the same frame (so calling both does not count `dt` twice). */
|
|
1306
|
+
__publicField(this, "pend", null);
|
|
1307
|
+
__publicField(this, "readyAt", 0);
|
|
1308
|
+
__publicField(this, "latched", false);
|
|
1309
|
+
__publicField(this, "_reloading", false);
|
|
1310
|
+
__publicField(this, "reloadEnd", 0);
|
|
1311
|
+
/** Bloom degrees at `extraClock`. */
|
|
1312
|
+
__publicField(this, "extra", 0);
|
|
1313
|
+
__publicField(this, "extraClock", 0);
|
|
1314
|
+
this.def = init.def;
|
|
1315
|
+
this.caliber = init.caliber;
|
|
1316
|
+
this.action = init.def.action;
|
|
1317
|
+
this.rng = createRng(init.seed);
|
|
1318
|
+
const a = this.action;
|
|
1319
|
+
this.mode = a.kind === "firearm" ? a.modes[0] ?? "single" : "single";
|
|
1320
|
+
switch (a.kind) {
|
|
1321
|
+
case "firearm":
|
|
1322
|
+
this._capacity = a.magazine;
|
|
1323
|
+
break;
|
|
1324
|
+
case "flame":
|
|
1325
|
+
case "heat":
|
|
1326
|
+
this._capacity = a.fuel;
|
|
1327
|
+
break;
|
|
1328
|
+
case "extinguisher":
|
|
1329
|
+
this._capacity = a.charge;
|
|
1330
|
+
break;
|
|
1331
|
+
case "throwable":
|
|
1332
|
+
this._capacity = a.count ?? DEFAULT_THROWABLES;
|
|
1333
|
+
break;
|
|
1334
|
+
default:
|
|
1335
|
+
this._capacity = 0;
|
|
1336
|
+
}
|
|
1337
|
+
this._ammo = this._capacity;
|
|
1338
|
+
this.initialReserve = init.reserve ?? (a.kind === "firearm" ? a.magazine * 3 : 0);
|
|
1339
|
+
this.reserve = this.initialReserve;
|
|
1340
|
+
}
|
|
1341
|
+
get ammo() {
|
|
1342
|
+
return this._ammo;
|
|
1343
|
+
}
|
|
1344
|
+
get capacity() {
|
|
1345
|
+
return this._capacity;
|
|
1346
|
+
}
|
|
1347
|
+
get reloading() {
|
|
1348
|
+
return this._reloading;
|
|
1349
|
+
}
|
|
1350
|
+
get spread() {
|
|
1351
|
+
if (this.action.kind !== "firearm") return 0;
|
|
1352
|
+
return this.action.spreadDeg + this.extraAt(this.clock);
|
|
1353
|
+
}
|
|
1354
|
+
extraAt(t) {
|
|
1355
|
+
if (this.action.kind !== "firearm") return 0;
|
|
1356
|
+
const rec = this.action.recoveryDegPerS ?? 4;
|
|
1357
|
+
return Math.max(0, this.extra - rec * Math.max(0, t - this.extraClock));
|
|
1358
|
+
}
|
|
1359
|
+
// --- time -----------------------------------------------------------------------------------------------------------------------
|
|
1360
|
+
update(dt) {
|
|
1361
|
+
const d = Math.max(0, dt);
|
|
1362
|
+
let eff = d;
|
|
1363
|
+
if (this.pend && this.pend.src === "trigger") {
|
|
1364
|
+
eff = Math.max(0, d - this.pend.amt);
|
|
1365
|
+
this.pend = null;
|
|
1366
|
+
} else {
|
|
1367
|
+
this.pend = { src: "update", amt: d };
|
|
1368
|
+
}
|
|
1369
|
+
this.clock += eff;
|
|
1370
|
+
this.settle(this.clock);
|
|
1371
|
+
}
|
|
1372
|
+
/** Complete the reload steps that finish at or before `t`. */
|
|
1373
|
+
settle(t) {
|
|
1374
|
+
const a = this.action;
|
|
1375
|
+
if (a.kind !== "firearm") return;
|
|
1376
|
+
while (this._reloading && this.reloadEnd <= t + EPS) {
|
|
1377
|
+
if (a.perRound) {
|
|
1378
|
+
if (this.reserve > 0 && this._ammo < this._capacity) {
|
|
1379
|
+
this._ammo += 1;
|
|
1380
|
+
this.reserve -= 1;
|
|
1381
|
+
}
|
|
1382
|
+
if (this._ammo >= this._capacity || this.reserve <= 0) this._reloading = false;
|
|
1383
|
+
else this.reloadEnd += a.reload;
|
|
1384
|
+
} else {
|
|
1385
|
+
const take = Math.min(this._capacity - this._ammo, this.reserve);
|
|
1386
|
+
this._ammo += take;
|
|
1387
|
+
this.reserve -= take;
|
|
1388
|
+
this._reloading = false;
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
// --- commands -------------------------------------------------------------------------------------------------------------------
|
|
1393
|
+
release() {
|
|
1394
|
+
this.latched = false;
|
|
1395
|
+
}
|
|
1396
|
+
reload() {
|
|
1397
|
+
const a = this.action;
|
|
1398
|
+
if (a.kind === "throwable") {
|
|
1399
|
+
if (this._ammo >= this._capacity || this.reserve <= 0) return false;
|
|
1400
|
+
this._ammo += 1;
|
|
1401
|
+
this.reserve -= 1;
|
|
1402
|
+
return true;
|
|
1403
|
+
}
|
|
1404
|
+
if (a.kind !== "firearm" || this._reloading) return false;
|
|
1405
|
+
if (this._ammo >= this._capacity || this.reserve <= 0) return false;
|
|
1406
|
+
this._reloading = true;
|
|
1407
|
+
this.reloadEnd = this.clock + a.reload;
|
|
1408
|
+
return true;
|
|
1409
|
+
}
|
|
1410
|
+
cycleMode() {
|
|
1411
|
+
if (this.action.kind !== "firearm") return this.mode;
|
|
1412
|
+
const modes = this.action.modes;
|
|
1413
|
+
const i = modes.indexOf(this.mode);
|
|
1414
|
+
this.mode = modes[(i + 1) % modes.length] ?? this.mode;
|
|
1415
|
+
return this.mode;
|
|
1416
|
+
}
|
|
1417
|
+
refill() {
|
|
1418
|
+
this._ammo = this._capacity;
|
|
1419
|
+
this.reserve = this.initialReserve;
|
|
1420
|
+
this._reloading = false;
|
|
1421
|
+
this.readyAt = this.clock;
|
|
1422
|
+
this.latched = false;
|
|
1423
|
+
this.extra = 0;
|
|
1424
|
+
}
|
|
1425
|
+
// --- trigger --------------------------------------------------------------------------------------------------------------------
|
|
1426
|
+
trigger(origin, direction, dt, held = false, source) {
|
|
1427
|
+
const d = Math.max(0, dt);
|
|
1428
|
+
let overlap = 0;
|
|
1429
|
+
if (this.pend && this.pend.src === "update") {
|
|
1430
|
+
overlap = Math.min(this.pend.amt, d);
|
|
1431
|
+
this.pend = null;
|
|
1432
|
+
} else {
|
|
1433
|
+
this.pend = { src: "trigger", amt: d };
|
|
1434
|
+
}
|
|
1435
|
+
const start = this.clock - overlap;
|
|
1436
|
+
const end = start + d;
|
|
1437
|
+
this.settle(start);
|
|
1438
|
+
const dir = normalize(direction);
|
|
1439
|
+
let res;
|
|
1440
|
+
const a = this.action;
|
|
1441
|
+
switch (a.kind) {
|
|
1442
|
+
case "firearm":
|
|
1443
|
+
res = this.fireFirearm(a, origin, dir, start, end, held, source);
|
|
1444
|
+
break;
|
|
1445
|
+
case "melee":
|
|
1446
|
+
res = this.fireMelee(a, origin, dir, start, end);
|
|
1447
|
+
break;
|
|
1448
|
+
case "flame":
|
|
1449
|
+
case "heat":
|
|
1450
|
+
res = this.fireFuel(a, origin, dir, d);
|
|
1451
|
+
break;
|
|
1452
|
+
case "extinguisher":
|
|
1453
|
+
res = this.fireExtinguisher(a, origin, dir, d);
|
|
1454
|
+
break;
|
|
1455
|
+
case "throwable":
|
|
1456
|
+
res = this.fireThrowable(a, origin, dir, held);
|
|
1457
|
+
break;
|
|
1458
|
+
case "tool":
|
|
1459
|
+
res = d > 0 ? result("ok", { uses: [{ kind: "tool", tool: a.tool, reach: a.reach, duration: d, origin, direction: dir }], noise: a.noise }) : result("ok");
|
|
1460
|
+
break;
|
|
1461
|
+
case "hand":
|
|
1462
|
+
res = this.oncePerPull(held) ? result("ok", { uses: [{ kind: "hand", reach: a.reach, origin, direction: dir }] }) : result("cooldown");
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
this.clock = Math.max(this.clock, end);
|
|
1466
|
+
this.settle(this.clock);
|
|
1467
|
+
return res;
|
|
1468
|
+
}
|
|
1469
|
+
/** Semi-style gating: a held trigger that already fired does nothing until `release()` or a new pull (`held` false). */
|
|
1470
|
+
oncePerPull(held) {
|
|
1471
|
+
if (!held) this.latched = false;
|
|
1472
|
+
if (this.latched) return false;
|
|
1473
|
+
this.latched = true;
|
|
1474
|
+
return true;
|
|
1475
|
+
}
|
|
1476
|
+
fireFirearm(a, origin, dir, start, end, held, source) {
|
|
1477
|
+
if (this._reloading) {
|
|
1478
|
+
if (a.perRound && this._ammo > 0) this._reloading = false;
|
|
1479
|
+
else return result("reloading");
|
|
1480
|
+
}
|
|
1481
|
+
const auto = this.mode === "auto";
|
|
1482
|
+
if (!auto && !this.oncePerPull(held)) return result("cooldown");
|
|
1483
|
+
if (this._ammo <= 0) return result("empty");
|
|
1484
|
+
const iv = 60 / a.rpm;
|
|
1485
|
+
const t0 = Math.max(start, this.readyAt);
|
|
1486
|
+
if (t0 > end + EPS) return result("cooldown");
|
|
1487
|
+
const res = result("ok");
|
|
1488
|
+
const fire = (t) => {
|
|
1489
|
+
this.fireOne(a, origin, dir, t, res, source);
|
|
1490
|
+
};
|
|
1491
|
+
if (auto) {
|
|
1492
|
+
for (let t = t0, n = 0; this._ammo > 0 && (n === 0 ? t <= end + EPS : t < end - EPS); t += iv, n++) fire(t);
|
|
1493
|
+
} else if (this.mode === "burst") {
|
|
1494
|
+
const count = Math.min(a.burst ?? 3, this._ammo);
|
|
1495
|
+
for (let k = 0; k < count; k++) fire(t0 + k * iv);
|
|
1496
|
+
} else {
|
|
1497
|
+
fire(t0);
|
|
1498
|
+
}
|
|
1499
|
+
return res;
|
|
1500
|
+
}
|
|
1501
|
+
fireOne(a, origin, dir, t, res, source) {
|
|
1502
|
+
const cal = this.caliber;
|
|
1503
|
+
const barrel = a.barrel ?? 1;
|
|
1504
|
+
const speed = cal.muzzleSpeed * barrel;
|
|
1505
|
+
const energy = muzzleEnergy(cal, barrel);
|
|
1506
|
+
const drag = cal.dragPer100m ?? 0.1;
|
|
1507
|
+
const energyAt = (distance) => {
|
|
1508
|
+
const f = Math.pow(1 - drag, Math.max(0, distance) / 100);
|
|
1509
|
+
return energy * f * f;
|
|
1510
|
+
};
|
|
1511
|
+
const bloomNow = this.extraAt(t);
|
|
1512
|
+
const spread = a.spreadDeg + bloomNow;
|
|
1513
|
+
const aim = sampleCone(dir, spread, this.rng);
|
|
1514
|
+
const pellets = cal.pellets ?? 1;
|
|
1515
|
+
const pelletSpread = pellets > 1 ? a.pelletSpreadDeg ?? 3 : 0;
|
|
1516
|
+
for (let p = 0; p < pellets; p++) {
|
|
1517
|
+
const shot = {
|
|
1518
|
+
origin: [origin[0], origin[1], origin[2]],
|
|
1519
|
+
direction: sampleCone(aim, pelletSpread, this.rng),
|
|
1520
|
+
energy,
|
|
1521
|
+
caliber: cal.diameter,
|
|
1522
|
+
caliberId: cal.id,
|
|
1523
|
+
speed,
|
|
1524
|
+
energyAt,
|
|
1525
|
+
pellet: p,
|
|
1526
|
+
weapon: this.def.id
|
|
1527
|
+
};
|
|
1528
|
+
if (source !== void 0) shot.source = source;
|
|
1529
|
+
res.shots.push(shot);
|
|
1530
|
+
}
|
|
1531
|
+
this._ammo -= 1;
|
|
1532
|
+
this.readyAt = t + 60 / a.rpm;
|
|
1533
|
+
this.extra = Math.min(bloomNow + (a.bloomDeg ?? 0), a.spreadDeg * (BLOOM_CAP - 1));
|
|
1534
|
+
this.extraClock = t;
|
|
1535
|
+
res.recoil = [res.recoil[0] + a.recoil[0], res.recoil[1] + (this.rng() * 2 - 1) * a.recoil[1]];
|
|
1536
|
+
res.noise = a.noise;
|
|
1537
|
+
}
|
|
1538
|
+
fireMelee(a, origin, dir, start, end) {
|
|
1539
|
+
const t0 = Math.max(start, this.readyAt);
|
|
1540
|
+
if (t0 > end + EPS) return result("cooldown");
|
|
1541
|
+
this.readyAt = t0 + 60 / a.rpm;
|
|
1542
|
+
const use = { kind: "melee", damage: a.damage, energy: a.energy, radius: a.radius, reach: a.reach, origin, direction: dir };
|
|
1543
|
+
return result("ok", { uses: [use], noise: a.noise });
|
|
1544
|
+
}
|
|
1545
|
+
fireFuel(a, origin, dir, dt) {
|
|
1546
|
+
if (this._ammo <= EPS) return result("no_fuel");
|
|
1547
|
+
if (dt <= 0) return result("ok");
|
|
1548
|
+
const need = a.fuelPerSecond * dt;
|
|
1549
|
+
let duration = dt;
|
|
1550
|
+
if (need > this._ammo) {
|
|
1551
|
+
duration = dt * (this._ammo / need);
|
|
1552
|
+
this._ammo = 0;
|
|
1553
|
+
} else {
|
|
1554
|
+
this._ammo -= need;
|
|
1555
|
+
}
|
|
1556
|
+
const use = a.kind === "flame" ? { kind: "flame", temperature: a.temperature, radius: a.radius, range: a.range, cone: a.cone ?? false, duration, origin, direction: dir } : { kind: "heat", temperature: a.temperature, radius: a.radius, range: a.range, duration, origin, direction: dir };
|
|
1557
|
+
return result("ok", { uses: [use], noise: a.noise });
|
|
1558
|
+
}
|
|
1559
|
+
fireExtinguisher(a, origin, dir, dt) {
|
|
1560
|
+
if (this._ammo <= EPS) return result("no_fuel");
|
|
1561
|
+
if (dt <= 0) return result("ok");
|
|
1562
|
+
const duration = Math.min(dt, this._ammo);
|
|
1563
|
+
this._ammo -= duration;
|
|
1564
|
+
return result("ok", { uses: [{ kind: "extinguish", range: a.range, coolC: a.coolC, duration, origin, direction: dir }], noise: a.noise });
|
|
1565
|
+
}
|
|
1566
|
+
fireThrowable(a, origin, dir, held) {
|
|
1567
|
+
if (!this.oncePerPull(held)) return result("cooldown");
|
|
1568
|
+
if (this._ammo <= 0) return result("empty");
|
|
1569
|
+
this._ammo -= 1;
|
|
1570
|
+
const velocity = [dir[0] * a.throwSpeed, dir[1] * a.throwSpeed + a.throwSpeed * THROW_LIFT, dir[2] * a.throwSpeed];
|
|
1571
|
+
const use = { kind: "throw", energy: a.energy, radius: a.radius, fuse: a.fuse, velocity, origin };
|
|
1572
|
+
if (a.fire) use.fire = { ...a.fire };
|
|
1573
|
+
return result("ok", { uses: [use], noise: a.noise });
|
|
1574
|
+
}
|
|
1575
|
+
};
|
|
1576
|
+
|
|
1577
|
+
// src/arsenal.ts
|
|
1578
|
+
var CALIBERS = calibers_default;
|
|
1579
|
+
var WEAPONS = weapons_default;
|
|
1580
|
+
var DEFAULT_LOADOUT = [
|
|
1581
|
+
"hand",
|
|
1582
|
+
"kick",
|
|
1583
|
+
"shove",
|
|
1584
|
+
"pistol_9mm",
|
|
1585
|
+
"revolver_357",
|
|
1586
|
+
"shotgun_pump_12",
|
|
1587
|
+
"rifle_5_56",
|
|
1588
|
+
"rifle_bolt_308",
|
|
1589
|
+
"hammer",
|
|
1590
|
+
"axe",
|
|
1591
|
+
"machete",
|
|
1592
|
+
"utility_knife",
|
|
1593
|
+
"crowbar",
|
|
1594
|
+
"lighter",
|
|
1595
|
+
"flamethrower",
|
|
1596
|
+
"cutting_torch",
|
|
1597
|
+
"molotov",
|
|
1598
|
+
"frag_grenade",
|
|
1599
|
+
"screwdriver",
|
|
1600
|
+
"wrench",
|
|
1601
|
+
"pry_bar",
|
|
1602
|
+
"hacksaw",
|
|
1603
|
+
"extinguisher"
|
|
1604
|
+
];
|
|
1605
|
+
var createArsenal = (options = {}) => {
|
|
1606
|
+
const calibers = /* @__PURE__ */ new Map();
|
|
1607
|
+
for (const c of [...CALIBERS, ...options.calibers ?? []]) calibers.set(c.id, c);
|
|
1608
|
+
const weapons = /* @__PURE__ */ new Map();
|
|
1609
|
+
for (const w of [...WEAPONS, ...options.weapons ?? []]) weapons.set(w.id, w);
|
|
1610
|
+
const strings = resolveStrings(options.locale);
|
|
1611
|
+
const baseSeed = options.seed ?? 1;
|
|
1612
|
+
let counter = 0;
|
|
1613
|
+
const create = (id, opts = {}) => {
|
|
1614
|
+
const def = weapons.get(id);
|
|
1615
|
+
if (!def) throw new Error(`game-weapons: unknown weapon "${id}"`);
|
|
1616
|
+
let caliber = null;
|
|
1617
|
+
if (def.action.kind === "firearm") {
|
|
1618
|
+
caliber = calibers.get(def.action.caliber) ?? null;
|
|
1619
|
+
if (!caliber) throw new Error(`game-weapons: weapon "${id}" uses unknown calibre "${def.action.caliber}"`);
|
|
1620
|
+
}
|
|
1621
|
+
counter += 1;
|
|
1622
|
+
const seed = opts.seed ?? baseSeed + Math.imul(counter, 2654435761) >>> 0;
|
|
1623
|
+
return new WeaponRuntime({ def, caliber, seed, reserve: opts.reserve });
|
|
1624
|
+
};
|
|
1625
|
+
return {
|
|
1626
|
+
calibers,
|
|
1627
|
+
weapons,
|
|
1628
|
+
create,
|
|
1629
|
+
muzzleEnergy(caliber, barrel = 1) {
|
|
1630
|
+
const c = calibers.get(caliber);
|
|
1631
|
+
if (!c) throw new Error(`game-weapons: unknown calibre "${caliber}"`);
|
|
1632
|
+
return muzzleEnergy(c, barrel);
|
|
1633
|
+
},
|
|
1634
|
+
name(id) {
|
|
1635
|
+
const w = weapons.get(id);
|
|
1636
|
+
if (w) return strings.weapons[id] ?? w.name ?? id;
|
|
1637
|
+
return strings.modes[id] ?? strings.categories[id] ?? calibers.get(id)?.label ?? id;
|
|
1638
|
+
},
|
|
1639
|
+
list(category) {
|
|
1640
|
+
const all = [...weapons.values()];
|
|
1641
|
+
return category ? all.filter((w) => w.category === category) : all;
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
};
|
|
1645
|
+
return __toCommonJS(index_exports);
|
|
1646
|
+
})();
|
|
1647
|
+
//# sourceMappingURL=index.global.js.map
|