@adatechnology/game-weapons 0.5.9 → 0.7.0
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/dist/index.d.ts +70 -1
- package/dist/index.global.js +162 -9
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +161 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -156,6 +156,8 @@ interface Detonation {
|
|
|
156
156
|
/** Seconds on the clock of the body. */
|
|
157
157
|
readonly at: number;
|
|
158
158
|
readonly energy: number;
|
|
159
|
+
/** Kilograms of TNT equivalent of the charge (`ExplosiveDef.tnt`), when it says. */
|
|
160
|
+
readonly tnt?: number;
|
|
159
161
|
readonly lethalRadius: number;
|
|
160
162
|
readonly injuryRadius: number;
|
|
161
163
|
readonly noise: number;
|
|
@@ -294,6 +296,11 @@ interface ExplosiveDef {
|
|
|
294
296
|
};
|
|
295
297
|
/** Joules. */
|
|
296
298
|
readonly energy: number;
|
|
299
|
+
/**
|
|
300
|
+
* Kilograms of TNT equivalent of the charge (the explosive's mass times its relative effectiveness; for a gas bottle or a tank, the equivalent of its burst). The blast wave that pushes a
|
|
301
|
+
* body is read from it (`knockOf` of `game-contracts`); without it the body takes the charge from `energy`.
|
|
302
|
+
*/
|
|
303
|
+
readonly tnt?: number;
|
|
297
304
|
/** What the blast tears down: 0 nothing, 1 light, 2 walls, 3 structures. */
|
|
298
305
|
readonly destructionLevel: 0 | 1 | 2 | 3;
|
|
299
306
|
/** Audible distance in metres. */
|
|
@@ -424,6 +431,11 @@ interface WeaponRules {
|
|
|
424
431
|
readonly base: number;
|
|
425
432
|
readonly perKg: number;
|
|
426
433
|
readonly hipSpread: number;
|
|
434
|
+
/**
|
|
435
|
+
* How much the view closes in while aiming down the iron sights, by weapon category (1 no change): the eye settles on the sights and the field narrows. A fitted optic gives its
|
|
436
|
+
* own magnification instead. A category left out does not zoom.
|
|
437
|
+
*/
|
|
438
|
+
readonly ironSightZoom: Readonly<Record<string, number>>;
|
|
427
439
|
};
|
|
428
440
|
/** Folding or sliding in the stock: the seconds it takes and what it does to the weapon while it is in. */
|
|
429
441
|
readonly stock: {
|
|
@@ -1242,4 +1254,61 @@ interface MuzzleSmokeParams {
|
|
|
1242
1254
|
*/
|
|
1243
1255
|
declare function muzzleSmokeOf({ caliber, weapon, suppressed }: MuzzleSmokeParams): MuzzleSmokeProfile;
|
|
1244
1256
|
|
|
1245
|
-
|
|
1257
|
+
/**
|
|
1258
|
+
* How much the view closes in while a weapon aims: the magnification of the optic fitted on it (the lowest of a variable one, the AUG's integral 1.5x), else the iron-sight zoom
|
|
1259
|
+
* of its category (`rules.aim.ironSightZoom`); 1 for a weapon that does not aim (a knife, a grenade).
|
|
1260
|
+
*/
|
|
1261
|
+
declare function aimZoomOf(arsenal: Arsenal, weaponId: WeaponId, attachments?: readonly AttachmentId[]): number;
|
|
1262
|
+
|
|
1263
|
+
/** One group of the weapon menu as a game declares it: the categories it lists, in order, each a section of its own. */
|
|
1264
|
+
interface WeaponMenuGroupDef {
|
|
1265
|
+
readonly id: string;
|
|
1266
|
+
/** Name by locale (`en`, `pt-BR`...); the id when the locale has none. */
|
|
1267
|
+
readonly name: Readonly<Record<string, string>>;
|
|
1268
|
+
readonly categories: readonly string[];
|
|
1269
|
+
}
|
|
1270
|
+
interface WeaponMenuEntry {
|
|
1271
|
+
readonly id: WeaponId;
|
|
1272
|
+
readonly name: string;
|
|
1273
|
+
/** The maker of a brand weapon (Glock, Taurus, Heckler & Koch...), so a search by maker finds it. */
|
|
1274
|
+
readonly maker?: string;
|
|
1275
|
+
/** The tags of the weapon (`pdw`, `explosive`...), so a search by them finds it. */
|
|
1276
|
+
readonly tags?: readonly string[];
|
|
1277
|
+
/** The section it is listed in (its category, or `flame` for a flamethrower filed as a launcher). */
|
|
1278
|
+
readonly category: string;
|
|
1279
|
+
}
|
|
1280
|
+
interface WeaponMenuSection {
|
|
1281
|
+
/** The category. */
|
|
1282
|
+
readonly id: string;
|
|
1283
|
+
readonly name: string;
|
|
1284
|
+
readonly weapons: readonly WeaponMenuEntry[];
|
|
1285
|
+
}
|
|
1286
|
+
interface WeaponMenuGroup {
|
|
1287
|
+
readonly id: string;
|
|
1288
|
+
readonly name: string;
|
|
1289
|
+
readonly sections: readonly WeaponMenuSection[];
|
|
1290
|
+
}
|
|
1291
|
+
interface WeaponMenuOptions {
|
|
1292
|
+
/** Locale of the group names (default `en`); the weapon and category names are the arsenal's own. */
|
|
1293
|
+
readonly locale?: string;
|
|
1294
|
+
/** The groups and their categories (default `WEAPON_MENU_GROUPS`). A category no group lists goes to a last `other` group. */
|
|
1295
|
+
readonly groups?: readonly WeaponMenuGroupDef[];
|
|
1296
|
+
/** Weapons left out of the menu (default none). */
|
|
1297
|
+
readonly exclude?: (def: WeaponDef) => boolean;
|
|
1298
|
+
/** List the generic guns too (`genericWeapons`: the `9 mm service pistol` that wears the Beretta's model); default false, the real weapons stand for them. */
|
|
1299
|
+
readonly generics?: boolean;
|
|
1300
|
+
}
|
|
1301
|
+
/** The groups of the menu: firearms, bladed and blunt weapons, explosives (throwables and launchers), tools (and the flames). */
|
|
1302
|
+
declare const WEAPON_MENU_GROUPS: readonly WeaponMenuGroupDef[];
|
|
1303
|
+
/** The whole arsenal by group and section, each section sorted by name: what a weapon picker lists. */
|
|
1304
|
+
declare function weaponMenu(arsenal: Arsenal, options?: WeaponMenuOptions): WeaponMenuGroup[];
|
|
1305
|
+
|
|
1306
|
+
/**
|
|
1307
|
+
* The generic guns of the arsenal (the `9 mm service pistol`, the `5.56 mm assault rifle`...) and the real weapon that stands for each: the brand weapon of lowest id that names
|
|
1308
|
+
* it as its `archetype` and fires the same way, the one whose model it wears; `undefined` for a generic no real weapon stands for (the `.22 LR pistol`).
|
|
1309
|
+
*/
|
|
1310
|
+
declare function genericWeapons(arsenal: Arsenal): ReadonlyMap<WeaponId, WeaponId | undefined>;
|
|
1311
|
+
/** A loadout with each generic gun swapped for the real weapon that stands for it (dropped when none does), and no id twice. */
|
|
1312
|
+
declare function realLoadout(arsenal: Arsenal, loadout: readonly WeaponId[]): WeaponId[];
|
|
1313
|
+
|
|
1314
|
+
export { AMMO, ARCHETYPE_IDS, ATTACHMENTS, type AmmoCore, type AmmoDef, type AmmoJacket, type AmmoKind, type AmmoLoad, type AmmoPenetration, type AmmoQualityDef, type Arsenal, type ArsenalOptions, type AttachmentDef, type AttachmentId, type AttachmentInstall, type AttachmentKind, type BlastEffect, CALIBERS, type CaliberDef, type CaliberId, type CanFit, type CanFitContext, type CartridgeDims, type CaseType, type ConditionDef, DEFAULT_LOADOUT, DEFAULT_RULES, type DataSource, type Detonation, EXPLOSIVES, type EffectCondition, ExplosiveBody, type ExplosiveBodyInit, type ExplosiveChain, type ExplosiveDef, type ExplosiveEvent, type ExplosiveId, type ExplosiveLeak, type ExplosiveShell, type ExplosiveTrigger, type ExplosiveTripwire, type FaultContext, type FaultId, type FireMode, type FirearmAction, type FitOptions, type FitRefusal, type FitResult, type FittedAttachment, GALLERY_HEAT, type IsCompatible, type Loadout, type LoadoutContext, MUZZLE_SMOKE, type MountDef, type MountKind, type MuzzleSmokeParams, type MuzzleSmokeProfile, type MuzzleSmokeProfileId, RELOAD_STAGES, type ReloadFamily, type ReloadKind, type ReloadRequest, type ReloadStage, type ReloadStageId, type RimType, type StatModifier, type StockDef, type StockState, type SurfaceProbe, type TriggerResult, type TripwireSegment, WEAPONS, WEAPON_MENU_GROUPS, type WeaponAction, type WeaponCategory, type WeaponDef, type WeaponDimensions, type WeaponEvent, type WeaponId, type WeaponMenuEntry, type WeaponMenuGroup, type WeaponMenuGroupDef, type WeaponMenuOptions, type WeaponMenuSection, type WeaponPatch, type WeaponPhase, type WeaponRules, type WeaponSnapshot, type WeaponStance, type WeaponStat, type WeaponState, type WeaponTimings, type WeaponsLocale, type WeaponsStrings, aimZoomOf, ammoId, ammoIgnition, backblastEffect, blastEffect, canFit, canInstallWith, checkArsenal, createArsenal, createExplosiveBody, createRng, genericWeapons, locales, muzzleEnergy, muzzleSmokeOf, nominalFuse, realLoadout, resolveLoad, resolveLoadout, resolveStrings, sampleFuse, tripwireSegment, weaponMenu };
|
package/dist/index.global.js
CHANGED
|
@@ -35,6 +35,8 @@ var GameWeapons = (() => {
|
|
|
35
35
|
MUZZLE_SMOKE: () => MUZZLE_SMOKE,
|
|
36
36
|
RELOAD_STAGES: () => RELOAD_STAGES,
|
|
37
37
|
WEAPONS: () => WEAPONS,
|
|
38
|
+
WEAPON_MENU_GROUPS: () => WEAPON_MENU_GROUPS,
|
|
39
|
+
aimZoomOf: () => aimZoomOf,
|
|
38
40
|
ammoId: () => ammoId,
|
|
39
41
|
ammoIgnition: () => ammoIgnition,
|
|
40
42
|
backblastEffect: () => backblastEffect,
|
|
@@ -45,15 +47,18 @@ var GameWeapons = (() => {
|
|
|
45
47
|
createArsenal: () => createArsenal,
|
|
46
48
|
createExplosiveBody: () => createExplosiveBody,
|
|
47
49
|
createRng: () => createRng,
|
|
50
|
+
genericWeapons: () => genericWeapons,
|
|
48
51
|
locales: () => locales,
|
|
49
52
|
muzzleEnergy: () => muzzleEnergy,
|
|
50
53
|
muzzleSmokeOf: () => muzzleSmokeOf,
|
|
51
54
|
nominalFuse: () => nominalFuse,
|
|
55
|
+
realLoadout: () => realLoadout,
|
|
52
56
|
resolveLoad: () => resolveLoad,
|
|
53
57
|
resolveLoadout: () => resolveLoadout,
|
|
54
58
|
resolveStrings: () => resolveStrings,
|
|
55
59
|
sampleFuse: () => sampleFuse,
|
|
56
|
-
tripwireSegment: () => tripwireSegment
|
|
60
|
+
tripwireSegment: () => tripwireSegment,
|
|
61
|
+
weaponMenu: () => weaponMenu
|
|
57
62
|
});
|
|
58
63
|
|
|
59
64
|
// src/rng.ts
|
|
@@ -2161,6 +2166,7 @@ var GameWeapons = (() => {
|
|
|
2161
2166
|
];
|
|
2162
2167
|
|
|
2163
2168
|
// ../game-contracts/dist/index.js
|
|
2169
|
+
var DEFAULT_BLAST_IMPULSE = { bodyArea: 0.7, lift: 0.15, minSpeed: 0.3, tntPerJoule: 0.24 / 2e5 };
|
|
2164
2170
|
var DEFAULT_COST_ALLOCATION_BYTES = 1024 * 1024;
|
|
2165
2171
|
var DEFAULT_IGNITION_RULES = {
|
|
2166
2172
|
fillCurve: [
|
|
@@ -3849,6 +3855,7 @@ var GameWeapons = (() => {
|
|
|
3849
3855
|
lethalRadius: 5,
|
|
3850
3856
|
injuryRadius: 15,
|
|
3851
3857
|
energy: 2e5,
|
|
3858
|
+
tnt: 0.24,
|
|
3852
3859
|
destructionLevel: 2,
|
|
3853
3860
|
noise: 500,
|
|
3854
3861
|
fuse: 4,
|
|
@@ -3894,6 +3901,7 @@ var GameWeapons = (() => {
|
|
|
3894
3901
|
lethalRadius: 3,
|
|
3895
3902
|
injuryRadius: 10,
|
|
3896
3903
|
energy: 43200,
|
|
3904
|
+
tnt: 0.15,
|
|
3897
3905
|
destructionLevel: 2,
|
|
3898
3906
|
noise: 450,
|
|
3899
3907
|
fuse: 3,
|
|
@@ -3913,6 +3921,7 @@ var GameWeapons = (() => {
|
|
|
3913
3921
|
lethalRadius: 5,
|
|
3914
3922
|
injuryRadius: 14,
|
|
3915
3923
|
energy: 2e5,
|
|
3924
|
+
tnt: 1.5,
|
|
3916
3925
|
destructionLevel: 2,
|
|
3917
3926
|
noise: 550,
|
|
3918
3927
|
fire: {
|
|
@@ -3959,6 +3968,7 @@ var GameWeapons = (() => {
|
|
|
3959
3968
|
lethalRadius: 4,
|
|
3960
3969
|
injuryRadius: 12,
|
|
3961
3970
|
energy: 102400,
|
|
3971
|
+
tnt: 0.25,
|
|
3962
3972
|
destructionLevel: 3,
|
|
3963
3973
|
noise: 600,
|
|
3964
3974
|
fuseLength: 0.03,
|
|
@@ -3981,6 +3991,7 @@ var GameWeapons = (() => {
|
|
|
3981
3991
|
lethalRadius: 6,
|
|
3982
3992
|
injuryRadius: 18,
|
|
3983
3993
|
energy: 345600,
|
|
3994
|
+
tnt: 0.76,
|
|
3984
3995
|
destructionLevel: 3,
|
|
3985
3996
|
noise: 700,
|
|
3986
3997
|
triggers: [
|
|
@@ -4004,6 +4015,7 @@ var GameWeapons = (() => {
|
|
|
4004
4015
|
length: 50
|
|
4005
4016
|
},
|
|
4006
4017
|
energy: 102400,
|
|
4018
|
+
tnt: 0.9,
|
|
4007
4019
|
destructionLevel: 1,
|
|
4008
4020
|
noise: 500,
|
|
4009
4021
|
triggers: [
|
|
@@ -4027,6 +4039,7 @@ var GameWeapons = (() => {
|
|
|
4027
4039
|
lethalRadius: 0,
|
|
4028
4040
|
injuryRadius: 10,
|
|
4029
4041
|
energy: 0,
|
|
4042
|
+
tnt: 0.01,
|
|
4030
4043
|
destructionLevel: 0,
|
|
4031
4044
|
noise: 400,
|
|
4032
4045
|
fuseRange: [
|
|
@@ -4051,6 +4064,7 @@ var GameWeapons = (() => {
|
|
|
4051
4064
|
lethalRadius: 4,
|
|
4052
4065
|
injuryRadius: 12,
|
|
4053
4066
|
energy: 102400,
|
|
4067
|
+
tnt: 0.045,
|
|
4054
4068
|
destructionLevel: 2,
|
|
4055
4069
|
noise: 450,
|
|
4056
4070
|
triggers: [
|
|
@@ -4069,6 +4083,7 @@ var GameWeapons = (() => {
|
|
|
4069
4083
|
lethalRadius: 5,
|
|
4070
4084
|
injuryRadius: 15,
|
|
4071
4085
|
energy: 2e5,
|
|
4086
|
+
tnt: 0.45,
|
|
4072
4087
|
destructionLevel: 3,
|
|
4073
4088
|
noise: 700,
|
|
4074
4089
|
triggers: [
|
|
@@ -4087,6 +4102,7 @@ var GameWeapons = (() => {
|
|
|
4087
4102
|
lethalRadius: 5,
|
|
4088
4103
|
injuryRadius: 16,
|
|
4089
4104
|
energy: 2e5,
|
|
4105
|
+
tnt: 0.7,
|
|
4090
4106
|
destructionLevel: 3,
|
|
4091
4107
|
noise: 750,
|
|
4092
4108
|
triggers: [
|
|
@@ -4105,6 +4121,7 @@ var GameWeapons = (() => {
|
|
|
4105
4121
|
lethalRadius: 5,
|
|
4106
4122
|
injuryRadius: 16,
|
|
4107
4123
|
energy: 2e5,
|
|
4124
|
+
tnt: 0.45,
|
|
4108
4125
|
destructionLevel: 3,
|
|
4109
4126
|
noise: 750,
|
|
4110
4127
|
triggers: [
|
|
@@ -4123,6 +4140,7 @@ var GameWeapons = (() => {
|
|
|
4123
4140
|
lethalRadius: 5,
|
|
4124
4141
|
injuryRadius: 16,
|
|
4125
4142
|
energy: 2e5,
|
|
4143
|
+
tnt: 0.7,
|
|
4126
4144
|
destructionLevel: 3,
|
|
4127
4145
|
noise: 750,
|
|
4128
4146
|
triggers: [
|
|
@@ -4141,6 +4159,7 @@ var GameWeapons = (() => {
|
|
|
4141
4159
|
lethalRadius: 4,
|
|
4142
4160
|
injuryRadius: 12,
|
|
4143
4161
|
energy: 102400,
|
|
4162
|
+
tnt: 1,
|
|
4144
4163
|
destructionLevel: 2,
|
|
4145
4164
|
noise: 550,
|
|
4146
4165
|
fire: {
|
|
@@ -4174,6 +4193,7 @@ var GameWeapons = (() => {
|
|
|
4174
4193
|
lethalRadius: 5,
|
|
4175
4194
|
injuryRadius: 14,
|
|
4176
4195
|
energy: 2e5,
|
|
4196
|
+
tnt: 0.5,
|
|
4177
4197
|
destructionLevel: 2,
|
|
4178
4198
|
noise: 550,
|
|
4179
4199
|
fire: {
|
|
@@ -4211,6 +4231,7 @@ var GameWeapons = (() => {
|
|
|
4211
4231
|
lethalRadius: 4,
|
|
4212
4232
|
injuryRadius: 12,
|
|
4213
4233
|
energy: 102400,
|
|
4234
|
+
tnt: 0.5,
|
|
4214
4235
|
destructionLevel: 3,
|
|
4215
4236
|
noise: 700,
|
|
4216
4237
|
fire: {
|
|
@@ -4240,6 +4261,7 @@ var GameWeapons = (() => {
|
|
|
4240
4261
|
lethalRadius: 12,
|
|
4241
4262
|
injuryRadius: 30,
|
|
4242
4263
|
energy: 2764800,
|
|
4264
|
+
tnt: 20,
|
|
4243
4265
|
destructionLevel: 3,
|
|
4244
4266
|
noise: 700,
|
|
4245
4267
|
fire: {
|
|
@@ -4267,6 +4289,7 @@ var GameWeapons = (() => {
|
|
|
4267
4289
|
lethalRadius: 4,
|
|
4268
4290
|
injuryRadius: 12,
|
|
4269
4291
|
energy: 102400,
|
|
4292
|
+
tnt: 0.045,
|
|
4270
4293
|
destructionLevel: 2,
|
|
4271
4294
|
noise: 450,
|
|
4272
4295
|
triggers: [
|
|
@@ -5670,7 +5693,10 @@ var GameWeapons = (() => {
|
|
|
5670
5693
|
]
|
|
5671
5694
|
}
|
|
5672
5695
|
],
|
|
5673
|
-
fitted: []
|
|
5696
|
+
fitted: [],
|
|
5697
|
+
tags: [
|
|
5698
|
+
"pdw"
|
|
5699
|
+
]
|
|
5674
5700
|
},
|
|
5675
5701
|
{
|
|
5676
5702
|
id: "kriss_vector",
|
|
@@ -10129,7 +10155,9 @@ var GameWeapons = (() => {
|
|
|
10129
10155
|
"arsenal",
|
|
10130
10156
|
"reference",
|
|
10131
10157
|
"derived"
|
|
10132
|
-
]
|
|
10158
|
+
],
|
|
10159
|
+
mounts: [],
|
|
10160
|
+
fitted: []
|
|
10133
10161
|
},
|
|
10134
10162
|
{
|
|
10135
10163
|
id: "hk_mp5sd3",
|
|
@@ -10888,7 +10916,10 @@ var GameWeapons = (() => {
|
|
|
10888
10916
|
fitted: [],
|
|
10889
10917
|
stock: {
|
|
10890
10918
|
kind: "retract"
|
|
10891
|
-
}
|
|
10919
|
+
},
|
|
10920
|
+
tags: [
|
|
10921
|
+
"pdw"
|
|
10922
|
+
]
|
|
10892
10923
|
},
|
|
10893
10924
|
{
|
|
10894
10925
|
id: "hk_g36",
|
|
@@ -12599,7 +12630,8 @@ var GameWeapons = (() => {
|
|
|
12599
12630
|
dmr: "marksman rifle",
|
|
12600
12631
|
hunting: "hunting rifle",
|
|
12601
12632
|
machine_gun: "machine gun",
|
|
12602
|
-
launcher: "launcher"
|
|
12633
|
+
launcher: "launcher",
|
|
12634
|
+
pdw: "PDW (personal defence weapon)"
|
|
12603
12635
|
};
|
|
12604
12636
|
var faultsEn = { misfire: "misfire", stovepipe: "stovepipe", double_feed: "double feed", failure_to_extract: "failure to extract" };
|
|
12605
12637
|
var conditionsEn = { new: "new", used: "used", worn: "worn", rusty: "rusty" };
|
|
@@ -12652,7 +12684,27 @@ var GameWeapons = (() => {
|
|
|
12652
12684
|
hunting_rifle_30_06: ".30-06 hunting rifle",
|
|
12653
12685
|
m2_flamethrower: "M2 flamethrower",
|
|
12654
12686
|
improvised_flamethrower: "Improvised flamethrower",
|
|
12655
|
-
m79: "M79 grenade launcher"
|
|
12687
|
+
m79: "M79 grenade launcher",
|
|
12688
|
+
m203: "M203 grenade launcher",
|
|
12689
|
+
gp_25: "GP-25 grenade launcher",
|
|
12690
|
+
ag36: "AG36 grenade launcher",
|
|
12691
|
+
flashbang: "Flashbang",
|
|
12692
|
+
dynamite: "Dynamite",
|
|
12693
|
+
c4: "C4 charge",
|
|
12694
|
+
claymore: "Claymore mine",
|
|
12695
|
+
tactical_knife: "Tactical knife",
|
|
12696
|
+
meat_cleaver: "Meat cleaver",
|
|
12697
|
+
hatchet: "Hatchet",
|
|
12698
|
+
nail_bat: "Nail bat",
|
|
12699
|
+
iron_pipe: "Iron pipe",
|
|
12700
|
+
pickaxe: "Pickaxe",
|
|
12701
|
+
sickle: "Sickle",
|
|
12702
|
+
police_baton: "Police baton",
|
|
12703
|
+
cast_iron_skillet: "Cast iron skillet",
|
|
12704
|
+
improvised_spear: "Improvised spear",
|
|
12705
|
+
chainsaw: "Chainsaw",
|
|
12706
|
+
recurve_bow: "Recurve bow",
|
|
12707
|
+
m134: "M134 Minigun"
|
|
12656
12708
|
},
|
|
12657
12709
|
modes: modesEn,
|
|
12658
12710
|
categories: categoriesEn,
|
|
@@ -12726,7 +12778,27 @@ var GameWeapons = (() => {
|
|
|
12726
12778
|
hunting_rifle_30_06: "Rifle de ca\xE7a .30-06",
|
|
12727
12779
|
m2_flamethrower: "Lan\xE7a-chamas M2",
|
|
12728
12780
|
improvised_flamethrower: "Lan\xE7a-chamas caseiro",
|
|
12729
|
-
m79: "Lan\xE7a-granadas M79"
|
|
12781
|
+
m79: "Lan\xE7a-granadas M79",
|
|
12782
|
+
m203: "Lan\xE7a-granadas M203",
|
|
12783
|
+
gp_25: "Lan\xE7a-granadas GP-25",
|
|
12784
|
+
ag36: "Lan\xE7a-granadas AG36",
|
|
12785
|
+
flashbang: "granada de luz",
|
|
12786
|
+
dynamite: "dinamite",
|
|
12787
|
+
c4: "C4 com detonador",
|
|
12788
|
+
claymore: "mina Claymore",
|
|
12789
|
+
tactical_knife: "faca t\xE1tica",
|
|
12790
|
+
meat_cleaver: "cutelo",
|
|
12791
|
+
hatchet: "machadinha",
|
|
12792
|
+
nail_bat: "taco com pregos",
|
|
12793
|
+
iron_pipe: "cano de ferro",
|
|
12794
|
+
pickaxe: "picareta",
|
|
12795
|
+
sickle: "foice",
|
|
12796
|
+
police_baton: "cassetete",
|
|
12797
|
+
cast_iron_skillet: "frigideira de ferro",
|
|
12798
|
+
improvised_spear: "lan\xE7a improvisada",
|
|
12799
|
+
chainsaw: "motosserra",
|
|
12800
|
+
recurve_bow: "arco recurvo",
|
|
12801
|
+
m134: "Minigun M134"
|
|
12730
12802
|
},
|
|
12731
12803
|
modes: { single: "tiro \xFAnico", semi: "semiautom\xE1tico", burst: "rajada", auto: "autom\xE1tico", pump: "repeti\xE7\xE3o", bolt: "ferrolho", lever: "alavanca", break: "basculante", volley: "salva" },
|
|
12732
12804
|
categories: {
|
|
@@ -12750,7 +12822,8 @@ var GameWeapons = (() => {
|
|
|
12750
12822
|
dmr: "fuzil de precis\xE3o semiautom\xE1tico",
|
|
12751
12823
|
hunting: "arma de ca\xE7a",
|
|
12752
12824
|
machine_gun: "metralhadora",
|
|
12753
|
-
launcher: "lan\xE7ador"
|
|
12825
|
+
launcher: "lan\xE7ador",
|
|
12826
|
+
pdw: "PDW (arma de defesa pessoal)"
|
|
12754
12827
|
},
|
|
12755
12828
|
explosives: {
|
|
12756
12829
|
m67: "Granada M67",
|
|
@@ -12849,7 +12922,13 @@ var GameWeapons = (() => {
|
|
|
12849
12922
|
// Arsenal §11: montar e desmontar exige chave de fenda ou bancada; 2/15/30 s e a troca do lança-granadas (0,8 s) são padrões aprovados pelo dono (2026-10-24)
|
|
12850
12923
|
attachments: { fitSeconds: { field: 2, tool: 15, bench: 30 }, switchSeconds: 0.8, speedOfSound: 343 },
|
|
12851
12924
|
// Arsenal §08: tempo de mira = 0,15 s + 0,05 s por kg. O quadril do Arsenal é ×6 (o ZombiAdA liga isso por configuração); o SDK é neutro (1)
|
|
12852
|
-
aim: {
|
|
12925
|
+
aim: {
|
|
12926
|
+
base: 0.15,
|
|
12927
|
+
perKg: 0.05,
|
|
12928
|
+
hipSpread: 1,
|
|
12929
|
+
// the iron sights close the view in a little: more for a long gun, whose sights sit farther from the eye, than for a handgun
|
|
12930
|
+
ironSightZoom: { pistol: 1.1, revolver: 1.1, smg: 1.2, carbine: 1.25, shotgun: 1.15, rifle: 1.3, hunting: 1.35, dmr: 1.4, sniper: 1.4, machine_gun: 1.2, launcher: 1.15, bow: 1.15, crossbow: 1.25 }
|
|
12931
|
+
},
|
|
12853
12932
|
// Arsenal §08/§11: coronha retrátil saca mais rápido, mais recuo; os números são padrões aprovados pelo dono (2026-10-24)
|
|
12854
12933
|
stock: {
|
|
12855
12934
|
seconds: 0.6,
|
|
@@ -13009,6 +13088,7 @@ var GameWeapons = (() => {
|
|
|
13009
13088
|
direction: this.facing,
|
|
13010
13089
|
at,
|
|
13011
13090
|
energy: def.energy,
|
|
13091
|
+
...def.tnt !== void 0 ? { tnt: def.tnt } : {},
|
|
13012
13092
|
lethalRadius: def.lethalRadius,
|
|
13013
13093
|
injuryRadius: def.injuryRadius,
|
|
13014
13094
|
noise: def.noise,
|
|
@@ -14558,6 +14638,79 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
14558
14638
|
const id = caliber?.propellant === "black_powder" ? "black_powder" : caliber?.propellant === "none" ? "none" : "smokeless";
|
|
14559
14639
|
return MUZZLE_SMOKE[id];
|
|
14560
14640
|
}
|
|
14641
|
+
|
|
14642
|
+
// src/aim-zoom.ts
|
|
14643
|
+
function aimZoomOf(arsenal, weaponId, attachments = arsenal.weapons.get(weaponId)?.fitted?.map((part) => part.id) ?? []) {
|
|
14644
|
+
const def = arsenal.weapons.get(weaponId);
|
|
14645
|
+
if (!def) return 1;
|
|
14646
|
+
const optic = attachments.map((id) => arsenal.attachments.get(id)?.optic).find((entry) => entry !== void 0);
|
|
14647
|
+
if (optic) return optic.zoom[0];
|
|
14648
|
+
return arsenal.rules.aim.ironSightZoom[def.category] ?? 1;
|
|
14649
|
+
}
|
|
14650
|
+
|
|
14651
|
+
// src/generics.ts
|
|
14652
|
+
var isGenericKind = (kind, category) => kind === "firearm" && category !== "bow" && category !== "crossbow" || kind === "flame";
|
|
14653
|
+
function genericWeapons(arsenal) {
|
|
14654
|
+
const archetypes = new Set(ARCHETYPE_IDS);
|
|
14655
|
+
const generics = /* @__PURE__ */ new Map();
|
|
14656
|
+
for (const def of arsenal.weapons.values()) if (archetypes.has(def.id) && isGenericKind(def.action.kind, def.category) && !def.maker) generics.set(def.id, void 0);
|
|
14657
|
+
for (const def of [...arsenal.weapons.values()].sort((a, b) => a.id < b.id ? -1 : 1)) {
|
|
14658
|
+
const { archetype } = def;
|
|
14659
|
+
if (!archetype || archetypes.has(def.id) || !generics.has(archetype) || generics.get(archetype)) continue;
|
|
14660
|
+
if (arsenal.weapons.get(archetype)?.action.kind === def.action.kind) generics.set(archetype, def.id);
|
|
14661
|
+
}
|
|
14662
|
+
for (const [id, brand] of generics) if (!brand && arsenal.weapons.get(id)?.action.kind === "flame") generics.delete(id);
|
|
14663
|
+
return generics;
|
|
14664
|
+
}
|
|
14665
|
+
function realLoadout(arsenal, loadout) {
|
|
14666
|
+
const generics = genericWeapons(arsenal);
|
|
14667
|
+
const real = loadout.flatMap((id) => generics.has(id) ? [generics.get(id)].filter((brand) => brand !== void 0) : [id]);
|
|
14668
|
+
return [...new Set(real)];
|
|
14669
|
+
}
|
|
14670
|
+
|
|
14671
|
+
// src/menu.ts
|
|
14672
|
+
var WEAPON_MENU_GROUPS = [
|
|
14673
|
+
{
|
|
14674
|
+
id: "firearms",
|
|
14675
|
+
name: { en: "Firearms", "pt-BR": "Armas de fogo" },
|
|
14676
|
+
categories: ["pistol", "revolver", "smg", "pdw", "carbine", "rifle", "dmr", "hunting", "sniper", "shotgun", "machine_gun", "bow", "crossbow"]
|
|
14677
|
+
},
|
|
14678
|
+
{ id: "melee", name: { en: "Melee weapons", "pt-BR": "Armas brancas" }, categories: ["melee_blade", "melee_blunt", "hand"] },
|
|
14679
|
+
{ id: "explosives", name: { en: "Explosives", "pt-BR": "Explosivos" }, categories: ["throwable", "launcher"] },
|
|
14680
|
+
{ id: "tools", name: { en: "Tools", "pt-BR": "Ferramentas" }, categories: ["tool", "heat", "flame", "extinguisher"] }
|
|
14681
|
+
];
|
|
14682
|
+
var OTHER_GROUP = { id: "other", name: { en: "Other", "pt-BR": "Outros" }, categories: [] };
|
|
14683
|
+
var sectionOf = (def) => {
|
|
14684
|
+
if (def.category === "launcher" && def.action.kind === "flame") return "flame";
|
|
14685
|
+
return def.tags?.includes("pdw") ? "pdw" : def.category;
|
|
14686
|
+
};
|
|
14687
|
+
var nameIn = (def, locale) => def.name[locale] ?? def.name.en ?? def.id;
|
|
14688
|
+
var capitalize = (text) => text.charAt(0).toLocaleUpperCase() + text.slice(1);
|
|
14689
|
+
function weaponMenu(arsenal, options = {}) {
|
|
14690
|
+
const locale = options.locale ?? "en";
|
|
14691
|
+
const groups = options.groups ?? WEAPON_MENU_GROUPS;
|
|
14692
|
+
const bySection = /* @__PURE__ */ new Map();
|
|
14693
|
+
const generics = options.generics ? /* @__PURE__ */ new Map() : genericWeapons(arsenal);
|
|
14694
|
+
for (const def of arsenal.weapons.values()) {
|
|
14695
|
+
if (options.exclude?.(def) || generics.has(def.id)) continue;
|
|
14696
|
+
const category = sectionOf(def);
|
|
14697
|
+
const list = bySection.get(category) ?? [];
|
|
14698
|
+
list.push({ id: def.id, name: capitalize(arsenal.name(def.id)), category, ...def.maker ? { maker: def.maker } : {}, ...def.tags?.length ? { tags: def.tags } : {} });
|
|
14699
|
+
bySection.set(category, list);
|
|
14700
|
+
}
|
|
14701
|
+
const listed = new Set(groups.flatMap((group) => group.categories));
|
|
14702
|
+
const other = { ...OTHER_GROUP, categories: [...bySection.keys()].filter((category) => !listed.has(category)) };
|
|
14703
|
+
const sectionsOf = (group) => group.categories.flatMap((category) => {
|
|
14704
|
+
const weapons = bySection.get(category);
|
|
14705
|
+
if (!weapons?.length) return [];
|
|
14706
|
+
const sorted = [...weapons].sort((a, b) => a.name.localeCompare(b.name, locale));
|
|
14707
|
+
return [{ id: category, name: capitalize(arsenal.name(category)), weapons: sorted }];
|
|
14708
|
+
});
|
|
14709
|
+
return [...groups, other].flatMap((group) => {
|
|
14710
|
+
const sections = sectionsOf(group);
|
|
14711
|
+
return sections.length ? [{ id: group.id, name: nameIn(group, locale), sections }] : [];
|
|
14712
|
+
});
|
|
14713
|
+
}
|
|
14561
14714
|
return __toCommonJS(index_exports);
|
|
14562
14715
|
})();
|
|
14563
14716
|
//# sourceMappingURL=index.global.js.map
|