@adatechnology/game-weapons 0.12.1 → 0.13.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/README.md +7 -0
- package/dist/index.d.ts +35 -2
- package/dist/index.global.js +123 -7
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +82 -4
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -271,6 +271,13 @@ optic that is fitted over `aimSeconds`), and only when the click lands on the ro
|
|
|
271
271
|
a throwable) leaves the button to the room, which grabs with it. The bench's **Supported** switch (`supported_stance`) puts the weapon in the supported stance (deployed or prone), so the bipod effect can be exercised;
|
|
272
272
|
it goes back off when another tool is taken. The laser measures its distance at most 30 times a second and ignores hidden nodes (a hidden ancestor counts) and the weapon in the hands.
|
|
273
273
|
|
|
274
|
+
### The hands a weapon takes and where it goes
|
|
275
|
+
|
|
276
|
+
`rules.hands` says how many hands each weapon takes and where on the body it goes when the hands are wanted for something else: `twoHanded` (by category: the SMGs, rifles, carbines,
|
|
277
|
+
shotguns, launchers, bows, the extinguisher; by id: the flamethrower; or a `two_handed` tag) unless it goes one in each hand (`dualWield`), `slots` by category (`hip`: a holster for the
|
|
278
|
+
handguns, knives, tools and throwables; `back`: a sling for the long guns), `weaponSlots` by id over it, and `bare` (the kick, the shove, the fists: nothing in the hand).
|
|
279
|
+
`weaponHandsOf(arsenal, id)` answers `{ hands: 0 | 1 | 2, slot }`; `planHands` of `@adatechnology/game-player` turns it into what happens to the weapon (decision of the owner, 2026-11-24).
|
|
280
|
+
|
|
274
281
|
### A weapon in each hand
|
|
275
282
|
|
|
276
283
|
`rules.dualWield` says which weapons go one in each hand and what that costs: `categories` (`pistol`, `revolver`), `weapons` (the Mini Uzi, Uzi, MAC-10, vz. 61, MP7, the knives, the
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vec3, Use, ExplosionChain, DeepPartial, Shot, HitIgnition } from '@adatechnology/game-contracts';
|
|
1
|
+
import { Vec3, Use, BlastCasing, ExplosionChain, DeepPartial, Shot, HitIgnition } from '@adatechnology/game-contracts';
|
|
2
2
|
export { DeepPartial, Shot, Use, Vec3 } from '@adatechnology/game-contracts';
|
|
3
3
|
|
|
4
4
|
type AttachmentId = string;
|
|
@@ -158,6 +158,8 @@ interface Detonation {
|
|
|
158
158
|
readonly energy: number;
|
|
159
159
|
/** Kilograms of TNT equivalent of the charge (`ExplosiveDef.tnt`), when it says. */
|
|
160
160
|
readonly tnt?: number;
|
|
161
|
+
/** The case that breaks into fragments (`ExplosiveDef.casing`), when the explosive has one. */
|
|
162
|
+
readonly casing?: ExplosiveDef['casing'];
|
|
161
163
|
readonly lethalRadius: number;
|
|
162
164
|
readonly injuryRadius: number;
|
|
163
165
|
readonly noise: number;
|
|
@@ -316,6 +318,11 @@ interface ExplosiveDef {
|
|
|
316
318
|
* body is read from it (`knockOf` of `game-contracts`); without it the body takes the charge from `energy`.
|
|
317
319
|
*/
|
|
318
320
|
readonly tnt?: number;
|
|
321
|
+
/**
|
|
322
|
+
* The metal case that breaks into fragments (the destruction world throws them: Mott's distribution of `mass` in `fragments` pieces, Gurney's first speed from `chargeMass` and the explosive's `gurneyVelocity`).
|
|
323
|
+
* Estimates from the public specifications of each munition (the M67's body is about 190 g round 180 g of Composition B); without it the blast is the wave alone.
|
|
324
|
+
*/
|
|
325
|
+
readonly casing?: BlastCasing;
|
|
319
326
|
/** What the blast tears down: 0 nothing, 1 light, 2 walls, 3 structures. */
|
|
320
327
|
readonly destructionLevel: 0 | 1 | 2 | 3;
|
|
321
328
|
/** Audible distance in metres. */
|
|
@@ -509,6 +516,21 @@ interface WeaponRules {
|
|
|
509
516
|
*/
|
|
510
517
|
readonly stowSeconds: number;
|
|
511
518
|
};
|
|
519
|
+
/**
|
|
520
|
+
* The hands a weapon takes and where it goes when the hands are wanted for something else (`weaponHandsOf`). A weapon is two-handed by its category (`twoHanded.categories`), its
|
|
521
|
+
* id (`twoHanded.weapons`) or a `two_handed` tag, unless it goes one in each hand (`dualWield`). `slots` names, by category, the place on the body that takes it (`hip` a holster,
|
|
522
|
+
* `back` a sling or back slot), and `weaponSlots` by id over it (null: none); a weapon left out of both has none, and goes to the ground when the hands are needed. The ids in
|
|
523
|
+
* `bare` are the body itself (a kick, a shove, the fists): nothing in the hand, nothing to put away.
|
|
524
|
+
*/
|
|
525
|
+
readonly hands: {
|
|
526
|
+
readonly twoHanded: {
|
|
527
|
+
readonly categories: readonly WeaponCategory[];
|
|
528
|
+
readonly weapons: readonly WeaponId[];
|
|
529
|
+
};
|
|
530
|
+
readonly slots: Readonly<Partial<Record<WeaponCategory, string>>>;
|
|
531
|
+
readonly weaponSlots: Readonly<Record<WeaponId, string | null>>;
|
|
532
|
+
readonly bare: readonly WeaponId[];
|
|
533
|
+
};
|
|
512
534
|
/** Folding or sliding in the stock: the seconds it takes and what it does to the weapon while it is in. */
|
|
513
535
|
readonly stock: {
|
|
514
536
|
readonly seconds: number;
|
|
@@ -1386,6 +1408,17 @@ declare function aimZoomOf(arsenal: Arsenal, weaponId: WeaponId, attachments?: r
|
|
|
1386
1408
|
*/
|
|
1387
1409
|
declare function canDualWield(arsenal: Pick<Arsenal, 'weapons' | 'rules'>, weaponId: WeaponId): boolean;
|
|
1388
1410
|
|
|
1411
|
+
/**
|
|
1412
|
+
* The hands a weapon takes (`0` the bare hand, nothing to put away; `1` one hand, the other is free; `2` both) and the place on the body that takes it when the hands are wanted
|
|
1413
|
+
* for something else (`rules.hands.slots`: `hip`, `back`...), or null when it has none and has to go to the ground.
|
|
1414
|
+
*/
|
|
1415
|
+
interface WeaponHands {
|
|
1416
|
+
readonly hands: 0 | 1 | 2;
|
|
1417
|
+
readonly slot: string | null;
|
|
1418
|
+
}
|
|
1419
|
+
/** What `rules.hands` of the arsenal says of a weapon; an unknown id is the bare hand. */
|
|
1420
|
+
declare function weaponHandsOf(arsenal: Pick<Arsenal, 'weapons' | 'rules'>, weaponId: WeaponId): WeaponHands;
|
|
1421
|
+
|
|
1389
1422
|
/** One group of the weapon menu as a game declares it: the categories it lists, in order, each a section of its own. */
|
|
1390
1423
|
interface WeaponMenuGroupDef {
|
|
1391
1424
|
readonly id: string;
|
|
@@ -1437,4 +1470,4 @@ declare function genericWeapons(arsenal: Arsenal): ReadonlyMap<WeaponId, WeaponI
|
|
|
1437
1470
|
/** A loadout with each generic gun swapped for the real weapon that stands for it (dropped when none does), and no id twice. */
|
|
1438
1471
|
declare function realLoadout(arsenal: Arsenal, loadout: readonly WeaponId[]): WeaponId[];
|
|
1439
1472
|
|
|
1440
|
-
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 ExplosiveSmoke, type ExplosiveTrigger, type ExplosiveTripwire, type FaultContext, type FaultId, type FireMode, type FirearmAction, type FitOptions, type FitRefusal, type FitResult, type FittedAttachment, GALLERY_HEAT, type GroundHeight, type GroundSweepHit, type GroundSweepOptions, 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 RoundsToWarningParams, 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, barrelMassOf, blastEffect, canDualWield, canFit, canInstallWith, checkArsenal, coolingTimeConstant, createArsenal, createExplosiveBody, createRng, decayHeat, genericWeapons, locales, muzzleEnergy, muzzleSmokeOf, nominalFuse, realLoadout, resolveLoad, resolveLoadout, resolveStrings, roundsToWarning, roundsToWarningOf, sampleFuse, sweepGround, tripwireSegment, weaponMenu };
|
|
1473
|
+
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 ExplosiveSmoke, type ExplosiveTrigger, type ExplosiveTripwire, type FaultContext, type FaultId, type FireMode, type FirearmAction, type FitOptions, type FitRefusal, type FitResult, type FittedAttachment, GALLERY_HEAT, type GroundHeight, type GroundSweepHit, type GroundSweepOptions, 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 RoundsToWarningParams, 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 WeaponHands, 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, barrelMassOf, blastEffect, canDualWield, canFit, canInstallWith, checkArsenal, coolingTimeConstant, createArsenal, createExplosiveBody, createRng, decayHeat, genericWeapons, locales, muzzleEnergy, muzzleSmokeOf, nominalFuse, realLoadout, resolveLoad, resolveLoadout, resolveStrings, roundsToWarning, roundsToWarningOf, sampleFuse, sweepGround, tripwireSegment, weaponHandsOf, weaponMenu };
|
package/dist/index.global.js
CHANGED
|
@@ -65,6 +65,7 @@ var GameWeapons = (() => {
|
|
|
65
65
|
sampleFuse: () => sampleFuse,
|
|
66
66
|
sweepGround: () => sweepGround,
|
|
67
67
|
tripwireSegment: () => tripwireSegment,
|
|
68
|
+
weaponHandsOf: () => weaponHandsOf,
|
|
68
69
|
weaponMenu: () => weaponMenu
|
|
69
70
|
});
|
|
70
71
|
|
|
@@ -2248,15 +2249,37 @@ var GameWeapons = (() => {
|
|
|
2248
2249
|
var DEFERRED_QUEUE_ID = {
|
|
2249
2250
|
DESTRUCTION_EVENTS: "destruction.events",
|
|
2250
2251
|
BREACH_PAINT: "floorplan.breach-paint",
|
|
2252
|
+
BREACH_CUT: "floorplan.breach-cut",
|
|
2251
2253
|
AUDIO_VOICES: "audio.voices",
|
|
2252
|
-
VEHICLE_CREASE: "vehicles.crease"
|
|
2254
|
+
VEHICLE_CREASE: "vehicles.crease",
|
|
2255
|
+
AUDIO_OCCLUSION: "audio.occlusion",
|
|
2256
|
+
FLUID_FILM: "fluids.film",
|
|
2257
|
+
VEHICLE_LOD_BATCH: "vehicles.lod-batch",
|
|
2258
|
+
SETTLED_BATCH: "destruction.settled-batch",
|
|
2259
|
+
STATIC_BATCH: "render.static-batch",
|
|
2260
|
+
ANIMALS_STATIC_BATCH: "animals.static-batch",
|
|
2261
|
+
CHARACTERS_STATIC_BATCH: "characters.static-batch",
|
|
2262
|
+
HOUSE_SHADOW_BATCH: "floorplan.shadow-batch",
|
|
2263
|
+
DESTRUCTION_PREFIT: "destruction.prefit"
|
|
2253
2264
|
};
|
|
2254
2265
|
var DEFERRED_PRIORITY = {
|
|
2255
2266
|
[DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
|
|
2256
|
-
|
|
2267
|
+
// every frame: the walls cut since the last frame are painted once each, and a hole must show in the frame of the blast
|
|
2268
|
+
[DEFERRED_QUEUE_ID.BREACH_CUT]: { priority: 260, phase: "present", minEveryFrames: 1 },
|
|
2269
|
+
[DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present", minEveryFrames: 1 },
|
|
2257
2270
|
[DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
|
|
2258
|
-
[DEFERRED_QUEUE_ID.
|
|
2271
|
+
[DEFERRED_QUEUE_ID.AUDIO_OCCLUSION]: { priority: 190, phase: "idle", minEveryFrames: 8 },
|
|
2272
|
+
[DEFERRED_QUEUE_ID.FLUID_FILM]: { priority: 120, phase: "idle", minEveryFrames: 2 },
|
|
2273
|
+
[DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" },
|
|
2274
|
+
[DEFERRED_QUEUE_ID.VEHICLE_LOD_BATCH]: { priority: 90, phase: "idle", minEveryFrames: 4 },
|
|
2275
|
+
[DEFERRED_QUEUE_ID.SETTLED_BATCH]: { priority: 70, phase: "idle", minEveryFrames: 8 },
|
|
2276
|
+
[DEFERRED_QUEUE_ID.STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
2277
|
+
[DEFERRED_QUEUE_ID.ANIMALS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
2278
|
+
[DEFERRED_QUEUE_ID.CHARACTERS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
2279
|
+
[DEFERRED_QUEUE_ID.HOUSE_SHADOW_BATCH]: { priority: 50, phase: "idle", minEveryFrames: 8 },
|
|
2280
|
+
[DEFERRED_QUEUE_ID.DESTRUCTION_PREFIT]: { priority: 40, phase: "idle", minEveryFrames: 30 }
|
|
2259
2281
|
};
|
|
2282
|
+
var MUST_DRAIN_QUEUE_IDS = /* @__PURE__ */ new Set([DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS, DEFERRED_QUEUE_ID.BREACH_CUT]);
|
|
2260
2283
|
var WARNED_KEY = /* @__PURE__ */ Symbol.for("@adatechnology/game-contracts.warned");
|
|
2261
2284
|
var warnedKeys = () => {
|
|
2262
2285
|
const holder = globalThis;
|
|
@@ -2342,6 +2365,22 @@ var GameWeapons = (() => {
|
|
|
2342
2365
|
var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
|
|
2343
2366
|
var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing) => `land_${surface}_${landing}`));
|
|
2344
2367
|
var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
|
|
2368
|
+
var WORKER_KIND_ID = {
|
|
2369
|
+
GROUND_TILES: "destruction.ground-tiles",
|
|
2370
|
+
CROWD_PHYSICS: "crowd.physics",
|
|
2371
|
+
PIECE_BOXES: "destruction.piece-boxes",
|
|
2372
|
+
STATIC_COLLIDERS: "destruction.static-colliders",
|
|
2373
|
+
SHAPES_GENERATE: "shapes.generate",
|
|
2374
|
+
WORLD_REGION: "world.region"
|
|
2375
|
+
};
|
|
2376
|
+
var WORKER_KIND_DEFAULTS = {
|
|
2377
|
+
[WORKER_KIND_ID.GROUND_TILES]: { lane: "sim", priority: 300, latencyFrames: 2, late: "sync" },
|
|
2378
|
+
[WORKER_KIND_ID.CROWD_PHYSICS]: { lane: "sim", priority: 250, latencyFrames: 1, late: "sync" },
|
|
2379
|
+
[WORKER_KIND_ID.PIECE_BOXES]: { lane: "sim", priority: 200, latencyFrames: 2, late: "sync" },
|
|
2380
|
+
[WORKER_KIND_ID.STATIC_COLLIDERS]: { lane: "build", priority: 150, late: "sync" },
|
|
2381
|
+
[WORKER_KIND_ID.SHAPES_GENERATE]: { lane: "build", priority: 100, late: "sync" },
|
|
2382
|
+
[WORKER_KIND_ID.WORLD_REGION]: { lane: "background", priority: 10, latencyFrames: 10, late: "drop" }
|
|
2383
|
+
};
|
|
2345
2384
|
|
|
2346
2385
|
// src/data/archetypes.json
|
|
2347
2386
|
var archetypes_default = [
|
|
@@ -2908,7 +2947,28 @@ var GameWeapons = (() => {
|
|
|
2908
2947
|
},
|
|
2909
2948
|
mass: 5.5,
|
|
2910
2949
|
tags: [
|
|
2911
|
-
"heavy"
|
|
2950
|
+
"heavy",
|
|
2951
|
+
"two_handed"
|
|
2952
|
+
]
|
|
2953
|
+
},
|
|
2954
|
+
{
|
|
2955
|
+
id: "shovel",
|
|
2956
|
+
name: "Shovel",
|
|
2957
|
+
category: "melee_blunt",
|
|
2958
|
+
action: {
|
|
2959
|
+
kind: "melee",
|
|
2960
|
+
damage: "blunt",
|
|
2961
|
+
energy: 160,
|
|
2962
|
+
radius: 0.12,
|
|
2963
|
+
reach: 1.25,
|
|
2964
|
+
rpm: 35,
|
|
2965
|
+
noise: 5
|
|
2966
|
+
},
|
|
2967
|
+
mass: 2,
|
|
2968
|
+
tags: [
|
|
2969
|
+
"heavy",
|
|
2970
|
+
"two_handed",
|
|
2971
|
+
"digs"
|
|
2912
2972
|
]
|
|
2913
2973
|
},
|
|
2914
2974
|
{
|
|
@@ -2972,7 +3032,10 @@ var GameWeapons = (() => {
|
|
|
2972
3032
|
rpm: 45,
|
|
2973
3033
|
noise: 8
|
|
2974
3034
|
},
|
|
2975
|
-
mass: 1.6
|
|
3035
|
+
mass: 1.6,
|
|
3036
|
+
tags: [
|
|
3037
|
+
"two_handed"
|
|
3038
|
+
]
|
|
2976
3039
|
},
|
|
2977
3040
|
{
|
|
2978
3041
|
id: "knife",
|
|
@@ -3983,6 +4046,13 @@ var GameWeapons = (() => {
|
|
|
3983
4046
|
injuryRadius: 15,
|
|
3984
4047
|
energy: 2e5,
|
|
3985
4048
|
tnt: 0.24,
|
|
4049
|
+
casing: {
|
|
4050
|
+
mass: 0.19,
|
|
4051
|
+
material: "steel",
|
|
4052
|
+
fragments: 1e3,
|
|
4053
|
+
chargeMass: 0.18,
|
|
4054
|
+
gurneyVelocity: 2700
|
|
4055
|
+
},
|
|
3986
4056
|
destructionLevel: 2,
|
|
3987
4057
|
noise: 500,
|
|
3988
4058
|
fuse: 4,
|
|
@@ -4029,6 +4099,14 @@ var GameWeapons = (() => {
|
|
|
4029
4099
|
injuryRadius: 10,
|
|
4030
4100
|
energy: 43200,
|
|
4031
4101
|
tnt: 0.15,
|
|
4102
|
+
casing: {
|
|
4103
|
+
mass: 0.35,
|
|
4104
|
+
material: "steel",
|
|
4105
|
+
fragments: 60,
|
|
4106
|
+
chargeMass: 0.15,
|
|
4107
|
+
gurneyVelocity: 2e3,
|
|
4108
|
+
geometry: "cylinder"
|
|
4109
|
+
},
|
|
4032
4110
|
destructionLevel: 2,
|
|
4033
4111
|
noise: 450,
|
|
4034
4112
|
fuse: 3,
|
|
@@ -4192,6 +4270,13 @@ var GameWeapons = (() => {
|
|
|
4192
4270
|
injuryRadius: 12,
|
|
4193
4271
|
energy: 102400,
|
|
4194
4272
|
tnt: 0.045,
|
|
4273
|
+
casing: {
|
|
4274
|
+
mass: 0.09,
|
|
4275
|
+
material: "steel",
|
|
4276
|
+
fragments: 250,
|
|
4277
|
+
chargeMass: 0.032,
|
|
4278
|
+
gurneyVelocity: 2700
|
|
4279
|
+
},
|
|
4195
4280
|
destructionLevel: 2,
|
|
4196
4281
|
noise: 450,
|
|
4197
4282
|
armRange: [
|
|
@@ -4422,6 +4507,13 @@ var GameWeapons = (() => {
|
|
|
4422
4507
|
injuryRadius: 12,
|
|
4423
4508
|
energy: 102400,
|
|
4424
4509
|
tnt: 0.045,
|
|
4510
|
+
casing: {
|
|
4511
|
+
mass: 0.1,
|
|
4512
|
+
material: "steel",
|
|
4513
|
+
fragments: 300,
|
|
4514
|
+
chargeMass: 0.037,
|
|
4515
|
+
gurneyVelocity: 2650
|
|
4516
|
+
},
|
|
4425
4517
|
destructionLevel: 2,
|
|
4426
4518
|
noise: 450,
|
|
4427
4519
|
armRange: [
|
|
@@ -14143,7 +14235,8 @@ var GameWeapons = (() => {
|
|
|
14143
14235
|
},
|
|
14144
14236
|
mass: 2.8,
|
|
14145
14237
|
tags: [
|
|
14146
|
-
"heavy"
|
|
14238
|
+
"heavy",
|
|
14239
|
+
"two_handed"
|
|
14147
14240
|
]
|
|
14148
14241
|
},
|
|
14149
14242
|
{
|
|
@@ -14221,7 +14314,8 @@ var GameWeapons = (() => {
|
|
|
14221
14314
|
},
|
|
14222
14315
|
mass: 6,
|
|
14223
14316
|
tags: [
|
|
14224
|
-
"heavy"
|
|
14317
|
+
"heavy",
|
|
14318
|
+
"two_handed"
|
|
14225
14319
|
]
|
|
14226
14320
|
},
|
|
14227
14321
|
{
|
|
@@ -14475,6 +14569,7 @@ var GameWeapons = (() => {
|
|
|
14475
14569
|
crossbow: "Crossbow",
|
|
14476
14570
|
hammer: "Hammer",
|
|
14477
14571
|
sledgehammer: "Sledgehammer",
|
|
14572
|
+
shovel: "Shovel",
|
|
14478
14573
|
baseball_bat: "Baseball bat",
|
|
14479
14574
|
crowbar: "Crowbar",
|
|
14480
14575
|
machete: "Machete",
|
|
@@ -14576,6 +14671,7 @@ var GameWeapons = (() => {
|
|
|
14576
14671
|
crossbow: "besta",
|
|
14577
14672
|
hammer: "martelo",
|
|
14578
14673
|
sledgehammer: "marreta",
|
|
14674
|
+
shovel: "p\xE1",
|
|
14579
14675
|
baseball_bat: "taco de beisebol",
|
|
14580
14676
|
crowbar: "p\xE9 de cabra",
|
|
14581
14677
|
machete: "fac\xE3o",
|
|
@@ -14790,6 +14886,14 @@ var GameWeapons = (() => {
|
|
|
14790
14886
|
// tucking a pistol in the belt and drawing it back is a short motion of one hand
|
|
14791
14887
|
stowSeconds: 0.45
|
|
14792
14888
|
},
|
|
14889
|
+
// as mãos de cada arma e onde ela vai quando as mãos são pedidas (decisão do dono, 2026-11-24): arma longa pede as duas mãos; a de cinto vai no coldre, a longa na bandoleira ou nas costas
|
|
14890
|
+
hands: {
|
|
14891
|
+
twoHanded: { categories: ["smg", "rifle", "carbine", "sniper", "dmr", "hunting", "machine_gun", "launcher", "shotgun", "bow", "crossbow", "extinguisher"], weapons: ["flamethrower"] },
|
|
14892
|
+
slots: { pistol: "hip", revolver: "hip", melee_blade: "hip", melee_blunt: "hip", tool: "hip", throwable: "hip", heat: "hip", smg: "back", rifle: "back", carbine: "back", sniper: "back", dmr: "back", hunting: "back", shotgun: "back", bow: "back", crossbow: "back", machine_gun: "back", launcher: "back" },
|
|
14893
|
+
// the long-handled tools and the long blade hang across the back; a chainsaw has no place on the body
|
|
14894
|
+
weaponSlots: { lighter: "hip", flamethrower: "back", axe: "back", sledgehammer: "back", pickaxe: "back", shovel: "back", katana: "back", chainsaw: null },
|
|
14895
|
+
bare: ["kick", "shove", "fists"]
|
|
14896
|
+
},
|
|
14793
14897
|
// 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)
|
|
14794
14898
|
stock: {
|
|
14795
14899
|
seconds: 0.6,
|
|
@@ -14971,6 +15075,7 @@ var GameWeapons = (() => {
|
|
|
14971
15075
|
at,
|
|
14972
15076
|
energy: def.energy,
|
|
14973
15077
|
...def.tnt !== void 0 ? { tnt: def.tnt } : {},
|
|
15078
|
+
...def.casing ? { casing: def.casing } : {},
|
|
14974
15079
|
lethalRadius: def.lethalRadius,
|
|
14975
15080
|
injuryRadius: def.injuryRadius,
|
|
14976
15081
|
noise: def.noise,
|
|
@@ -16632,6 +16737,17 @@ ${problems.map((problem) => ` - ${problem}`).join("\n")}`);
|
|
|
16632
16737
|
return rule.weapons.includes(weaponId) || rule.categories.includes(category);
|
|
16633
16738
|
};
|
|
16634
16739
|
|
|
16740
|
+
// src/weapon-hands.ts
|
|
16741
|
+
var BARE = { hands: 0, slot: null };
|
|
16742
|
+
function weaponHandsOf(arsenal, weaponId) {
|
|
16743
|
+
const def = arsenal.weapons.get(weaponId);
|
|
16744
|
+
const rule = arsenal.rules.hands;
|
|
16745
|
+
if (!def || def.category === "hand" || rule.bare.includes(weaponId)) return BARE;
|
|
16746
|
+
const isTwoHanded = (rule.twoHanded.categories.includes(def.category) || rule.twoHanded.weapons.includes(weaponId) || (def.tags ?? []).includes("two_handed")) && !canDualWield(arsenal, weaponId);
|
|
16747
|
+
const slot = weaponId in rule.weaponSlots ? rule.weaponSlots[weaponId] : rule.slots[def.category];
|
|
16748
|
+
return { hands: isTwoHanded ? 2 : 1, slot: slot ?? null };
|
|
16749
|
+
}
|
|
16750
|
+
|
|
16635
16751
|
// src/generics.ts
|
|
16636
16752
|
var isGenericKind = (kind, category) => kind === "firearm" && category !== "bow" && category !== "crossbow" || kind === "flame";
|
|
16637
16753
|
function genericWeapons(arsenal) {
|