@adatechnology/game-weapons 0.12.1 → 0.12.2
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 +8 -1
- package/dist/index.global.js +93 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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. */
|
package/dist/index.global.js
CHANGED
|
@@ -2248,15 +2248,37 @@ var GameWeapons = (() => {
|
|
|
2248
2248
|
var DEFERRED_QUEUE_ID = {
|
|
2249
2249
|
DESTRUCTION_EVENTS: "destruction.events",
|
|
2250
2250
|
BREACH_PAINT: "floorplan.breach-paint",
|
|
2251
|
+
BREACH_CUT: "floorplan.breach-cut",
|
|
2251
2252
|
AUDIO_VOICES: "audio.voices",
|
|
2252
|
-
VEHICLE_CREASE: "vehicles.crease"
|
|
2253
|
+
VEHICLE_CREASE: "vehicles.crease",
|
|
2254
|
+
AUDIO_OCCLUSION: "audio.occlusion",
|
|
2255
|
+
FLUID_FILM: "fluids.film",
|
|
2256
|
+
VEHICLE_LOD_BATCH: "vehicles.lod-batch",
|
|
2257
|
+
SETTLED_BATCH: "destruction.settled-batch",
|
|
2258
|
+
STATIC_BATCH: "render.static-batch",
|
|
2259
|
+
ANIMALS_STATIC_BATCH: "animals.static-batch",
|
|
2260
|
+
CHARACTERS_STATIC_BATCH: "characters.static-batch",
|
|
2261
|
+
HOUSE_SHADOW_BATCH: "floorplan.shadow-batch",
|
|
2262
|
+
DESTRUCTION_PREFIT: "destruction.prefit"
|
|
2253
2263
|
};
|
|
2254
2264
|
var DEFERRED_PRIORITY = {
|
|
2255
2265
|
[DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS]: { priority: 300, phase: "present" },
|
|
2256
|
-
|
|
2266
|
+
// every frame: the walls cut since the last frame are painted once each, and a hole must show in the frame of the blast
|
|
2267
|
+
[DEFERRED_QUEUE_ID.BREACH_CUT]: { priority: 260, phase: "present", minEveryFrames: 1 },
|
|
2268
|
+
[DEFERRED_QUEUE_ID.BREACH_PAINT]: { priority: 250, phase: "present", minEveryFrames: 1 },
|
|
2257
2269
|
[DEFERRED_QUEUE_ID.AUDIO_VOICES]: { priority: 200, phase: "idle", reserveMs: 1 },
|
|
2258
|
-
[DEFERRED_QUEUE_ID.
|
|
2270
|
+
[DEFERRED_QUEUE_ID.AUDIO_OCCLUSION]: { priority: 190, phase: "idle", minEveryFrames: 8 },
|
|
2271
|
+
[DEFERRED_QUEUE_ID.FLUID_FILM]: { priority: 120, phase: "idle", minEveryFrames: 2 },
|
|
2272
|
+
[DEFERRED_QUEUE_ID.VEHICLE_CREASE]: { priority: 100, phase: "idle" },
|
|
2273
|
+
[DEFERRED_QUEUE_ID.VEHICLE_LOD_BATCH]: { priority: 90, phase: "idle", minEveryFrames: 4 },
|
|
2274
|
+
[DEFERRED_QUEUE_ID.SETTLED_BATCH]: { priority: 70, phase: "idle", minEveryFrames: 8 },
|
|
2275
|
+
[DEFERRED_QUEUE_ID.STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
2276
|
+
[DEFERRED_QUEUE_ID.ANIMALS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
2277
|
+
[DEFERRED_QUEUE_ID.CHARACTERS_STATIC_BATCH]: { priority: 60, phase: "idle", minEveryFrames: 8 },
|
|
2278
|
+
[DEFERRED_QUEUE_ID.HOUSE_SHADOW_BATCH]: { priority: 50, phase: "idle", minEveryFrames: 8 },
|
|
2279
|
+
[DEFERRED_QUEUE_ID.DESTRUCTION_PREFIT]: { priority: 40, phase: "idle", minEveryFrames: 30 }
|
|
2259
2280
|
};
|
|
2281
|
+
var MUST_DRAIN_QUEUE_IDS = /* @__PURE__ */ new Set([DEFERRED_QUEUE_ID.DESTRUCTION_EVENTS, DEFERRED_QUEUE_ID.BREACH_CUT]);
|
|
2260
2282
|
var WARNED_KEY = /* @__PURE__ */ Symbol.for("@adatechnology/game-contracts.warned");
|
|
2261
2283
|
var warnedKeys = () => {
|
|
2262
2284
|
const holder = globalThis;
|
|
@@ -2342,6 +2364,22 @@ var GameWeapons = (() => {
|
|
|
2342
2364
|
var FOOTSTEP_SOUND_IDS = SURFACE_IDS.flatMap((surface) => GAIT_IDS.map((gait) => footstepSoundId(surface, gait)));
|
|
2343
2365
|
var LAND_SOUND_IDS = SURFACE_IDS.flatMap((surface) => LANDING_IDS.map((landing) => `land_${surface}_${landing}`));
|
|
2344
2366
|
var BODY_FOLEY_IDS = [...FOOTSTEP_SOUND_IDS, ...LAND_SOUND_IDS, ...BODY_SOUND_IDS];
|
|
2367
|
+
var WORKER_KIND_ID = {
|
|
2368
|
+
GROUND_TILES: "destruction.ground-tiles",
|
|
2369
|
+
CROWD_PHYSICS: "crowd.physics",
|
|
2370
|
+
PIECE_BOXES: "destruction.piece-boxes",
|
|
2371
|
+
STATIC_COLLIDERS: "destruction.static-colliders",
|
|
2372
|
+
SHAPES_GENERATE: "shapes.generate",
|
|
2373
|
+
WORLD_REGION: "world.region"
|
|
2374
|
+
};
|
|
2375
|
+
var WORKER_KIND_DEFAULTS = {
|
|
2376
|
+
[WORKER_KIND_ID.GROUND_TILES]: { lane: "sim", priority: 300, latencyFrames: 2, late: "sync" },
|
|
2377
|
+
[WORKER_KIND_ID.CROWD_PHYSICS]: { lane: "sim", priority: 250, latencyFrames: 1, late: "sync" },
|
|
2378
|
+
[WORKER_KIND_ID.PIECE_BOXES]: { lane: "sim", priority: 200, latencyFrames: 2, late: "sync" },
|
|
2379
|
+
[WORKER_KIND_ID.STATIC_COLLIDERS]: { lane: "build", priority: 150, late: "sync" },
|
|
2380
|
+
[WORKER_KIND_ID.SHAPES_GENERATE]: { lane: "build", priority: 100, late: "sync" },
|
|
2381
|
+
[WORKER_KIND_ID.WORLD_REGION]: { lane: "background", priority: 10, latencyFrames: 10, late: "drop" }
|
|
2382
|
+
};
|
|
2345
2383
|
|
|
2346
2384
|
// src/data/archetypes.json
|
|
2347
2385
|
var archetypes_default = [
|
|
@@ -2911,6 +2949,26 @@ var GameWeapons = (() => {
|
|
|
2911
2949
|
"heavy"
|
|
2912
2950
|
]
|
|
2913
2951
|
},
|
|
2952
|
+
{
|
|
2953
|
+
id: "shovel",
|
|
2954
|
+
name: "Shovel",
|
|
2955
|
+
category: "melee_blunt",
|
|
2956
|
+
action: {
|
|
2957
|
+
kind: "melee",
|
|
2958
|
+
damage: "blunt",
|
|
2959
|
+
energy: 160,
|
|
2960
|
+
radius: 0.12,
|
|
2961
|
+
reach: 1.25,
|
|
2962
|
+
rpm: 35,
|
|
2963
|
+
noise: 5
|
|
2964
|
+
},
|
|
2965
|
+
mass: 2,
|
|
2966
|
+
tags: [
|
|
2967
|
+
"heavy",
|
|
2968
|
+
"two_handed",
|
|
2969
|
+
"digs"
|
|
2970
|
+
]
|
|
2971
|
+
},
|
|
2914
2972
|
{
|
|
2915
2973
|
id: "baseball_bat",
|
|
2916
2974
|
name: "Baseball bat",
|
|
@@ -3983,6 +4041,13 @@ var GameWeapons = (() => {
|
|
|
3983
4041
|
injuryRadius: 15,
|
|
3984
4042
|
energy: 2e5,
|
|
3985
4043
|
tnt: 0.24,
|
|
4044
|
+
casing: {
|
|
4045
|
+
mass: 0.19,
|
|
4046
|
+
material: "steel",
|
|
4047
|
+
fragments: 1e3,
|
|
4048
|
+
chargeMass: 0.18,
|
|
4049
|
+
gurneyVelocity: 2700
|
|
4050
|
+
},
|
|
3986
4051
|
destructionLevel: 2,
|
|
3987
4052
|
noise: 500,
|
|
3988
4053
|
fuse: 4,
|
|
@@ -4029,6 +4094,14 @@ var GameWeapons = (() => {
|
|
|
4029
4094
|
injuryRadius: 10,
|
|
4030
4095
|
energy: 43200,
|
|
4031
4096
|
tnt: 0.15,
|
|
4097
|
+
casing: {
|
|
4098
|
+
mass: 0.35,
|
|
4099
|
+
material: "steel",
|
|
4100
|
+
fragments: 60,
|
|
4101
|
+
chargeMass: 0.15,
|
|
4102
|
+
gurneyVelocity: 2e3,
|
|
4103
|
+
geometry: "cylinder"
|
|
4104
|
+
},
|
|
4032
4105
|
destructionLevel: 2,
|
|
4033
4106
|
noise: 450,
|
|
4034
4107
|
fuse: 3,
|
|
@@ -4192,6 +4265,13 @@ var GameWeapons = (() => {
|
|
|
4192
4265
|
injuryRadius: 12,
|
|
4193
4266
|
energy: 102400,
|
|
4194
4267
|
tnt: 0.045,
|
|
4268
|
+
casing: {
|
|
4269
|
+
mass: 0.09,
|
|
4270
|
+
material: "steel",
|
|
4271
|
+
fragments: 250,
|
|
4272
|
+
chargeMass: 0.032,
|
|
4273
|
+
gurneyVelocity: 2700
|
|
4274
|
+
},
|
|
4195
4275
|
destructionLevel: 2,
|
|
4196
4276
|
noise: 450,
|
|
4197
4277
|
armRange: [
|
|
@@ -4422,6 +4502,13 @@ var GameWeapons = (() => {
|
|
|
4422
4502
|
injuryRadius: 12,
|
|
4423
4503
|
energy: 102400,
|
|
4424
4504
|
tnt: 0.045,
|
|
4505
|
+
casing: {
|
|
4506
|
+
mass: 0.1,
|
|
4507
|
+
material: "steel",
|
|
4508
|
+
fragments: 300,
|
|
4509
|
+
chargeMass: 0.037,
|
|
4510
|
+
gurneyVelocity: 2650
|
|
4511
|
+
},
|
|
4425
4512
|
destructionLevel: 2,
|
|
4426
4513
|
noise: 450,
|
|
4427
4514
|
armRange: [
|
|
@@ -14475,6 +14562,7 @@ var GameWeapons = (() => {
|
|
|
14475
14562
|
crossbow: "Crossbow",
|
|
14476
14563
|
hammer: "Hammer",
|
|
14477
14564
|
sledgehammer: "Sledgehammer",
|
|
14565
|
+
shovel: "Shovel",
|
|
14478
14566
|
baseball_bat: "Baseball bat",
|
|
14479
14567
|
crowbar: "Crowbar",
|
|
14480
14568
|
machete: "Machete",
|
|
@@ -14576,6 +14664,7 @@ var GameWeapons = (() => {
|
|
|
14576
14664
|
crossbow: "besta",
|
|
14577
14665
|
hammer: "martelo",
|
|
14578
14666
|
sledgehammer: "marreta",
|
|
14667
|
+
shovel: "p\xE1",
|
|
14579
14668
|
baseball_bat: "taco de beisebol",
|
|
14580
14669
|
crowbar: "p\xE9 de cabra",
|
|
14581
14670
|
machete: "fac\xE3o",
|
|
@@ -14971,6 +15060,7 @@ var GameWeapons = (() => {
|
|
|
14971
15060
|
at,
|
|
14972
15061
|
energy: def.energy,
|
|
14973
15062
|
...def.tnt !== void 0 ? { tnt: def.tnt } : {},
|
|
15063
|
+
...def.casing ? { casing: def.casing } : {},
|
|
14974
15064
|
lethalRadius: def.lethalRadius,
|
|
14975
15065
|
injuryRadius: def.injuryRadius,
|
|
14976
15066
|
noise: def.noise,
|