@adatechnology/game-vfx 0.12.0 → 0.14.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 CHANGED
@@ -69,8 +69,12 @@ flash stays on the muzzle the view turns), and the smoke it throws stays in the
69
69
  `vfx.burst(kind, point, normal, count, speed?)` and `vfx.spawn(kind, point, velocity)` are the **sprite kinds** that destruction, fluids and weapons share
70
70
  (debris, sparks, ash, steam, drips, leaks...: `data/sprite-kinds.json`, `patchSpriteKinds`), with `onLand(owner, ...)` to hear where a drop touched the ground.
71
71
 
72
- `effectForEvent(event)` maps the destruction events to effects (`data/event-effects.json`): `spall` plays `impact_<material>`, the stages `stage_crack`,
73
- `breach_dust` and `collapse_dust`, `expose` `rebar_expose`, a fracture of glass `glass_burst`; `muzzle_*` and `casing_*` are the weapon slices. `GAME_EFFECTS`
72
+ `effectForEvent(event)` maps the destruction events to effects (`data/event-effects.json`): `spall` plays `impact_<material>`, the stages
73
+ `stage_crack_<family>`, `breach_dust_<family>` and `collapse_dust_<family>` (and a collapse `collapse_dust_<family>`), `expose` `rebar_expose` (concrete
74
+ chips and rust), a fracture of glass `glass_burst`; `muzzle_*` and `casing_*` are the weapon slices. The family is the `material` of the event
75
+ (`DEBRIS_EFFECT_FAMILIES`: `wood` splinters, `masonry` chips and dust, `glass` shards, `metal` sparks and no dust, `soft` flakes, `soil` clods and dust), and
76
+ the host draws them in the colour of the material that broke by passing `values: { debrisColor, dustColor }` to `play`. A stage with no family plays nothing.
77
+ `GAME_EFFECTS`
74
78
  is the recipes plus these, what a world plays by default. Texts of every recipe (name, cost, when, look, budget, network) are in `locales` (`en`, `pt-BR`).
75
79
 
76
80
  ## Vehicle effects
@@ -79,6 +83,27 @@ is the recipes plus these, what a world plays by default. Texts of every recipe
79
83
  `vehicle_leak` is the page's pool and drips without the fire and the explosion (`FUEL_LEAK_ONLY`: the same `decal` and `emit` steps); `vehicle_leak_ignited` is the whole sequence (the spark, the fire running along
80
84
  the pool to the tank and the blast at 7.2 s), played when the leak catches fire.
81
85
 
86
+ ## Water: rounds and blasts on water
87
+
88
+ `createWaterEffects({ levelAt, limits, seed })` draws what a round or a charge does to water, renderer-free (`createWaterEffectsLayer` of game-vfx-three draws it).
89
+
90
+ - `shot({ point, direction, profile, speed, depth })`: the splash of a class of round where it meets the surface. The classes are data
91
+ (`WATER_SHOT_PROFILES`, `patchWaterShotProfiles`): `rimfire`, `pistol`, `magnum`, `rifle` (5.56, 7.62x39: a tall thin spout, many fast drops),
92
+ `battle_rifle`, `sniper` (.338, .50: a tall wide column, a wide ring), `buckshot` (a small spout and a lot of shallow foam per pellet), `birdshot`,
93
+ `slug`, `arrow`, `fragment` and `object` (a thrown thing falling in). `WATER_SHOT_BY_CALIBER` gives the class of every calibre of `game-weapons`;
94
+ `waterShotClassOf` classes an unknown round by mass and speed. A round below `ricochetBelowDeg` skips off (`plan.ricochet`: the new direction and
95
+ the share of speed kept) with a low spout leaning its way; a steeper one throws a column, a crown of drops, rings and foam, and leaves a trail of
96
+ bubbles that stops where it is spent (`slowing`: metres to lose 1/e of its speed) or at the bed.
97
+ - `blast({ point, level, depth, explosive | tnt, kind })`: a charge by Hopkinson scaling (lengths go with the cube root of the TNT): the tallest column
98
+ a little under the surface, a lower one and the fireball at the surface, a dome of white water and a boil of bubbles deep under (`plan.underwater`:
99
+ no fireball), only the shock ring and spray high over it (`airburst`); a shallow pool cannot throw a full column. Every blast sends a fast shock
100
+ ring, three wave crests, a rain of drops that falls back and rings where it lands, mist and a slick of foam; a fragmentation charge at the surface
101
+ peppers the water around. `WATER_BLASTS` (TNT and kind of each explosive of `game-weapons`) and `WATER_BLAST_KINDS` (`brisance`, column width,
102
+ fragments, mist) are the data.
103
+ - `waveAt(x, z)`: the height and the push (m/s) of the waves there, for what floats and for a body standing in the water.
104
+ - Every record has a life and every pool a limit (`WATER_LIMITS`, `limits`); far from the camera (`setCamera`, `LOD_GAME`) fewer drops and bubbles
105
+ are made. `levelAt` keeps rings, foam and waves inside the water (they stop at the shore) and rings only the drops that fall back on water.
106
+
82
107
  ## Closed spaces (a shut car keeps the smoke out)
83
108
 
84
109
  `world.enclose(id, { center, halfSize, orientation, openings, leak })` declares a closed space: a turned box the smoke, dust, steam and gas do not
package/dist/index.d.ts CHANGED
@@ -1870,6 +1870,18 @@ declare function patchEffects(base: Readonly<Record<string, EffectDef>>, changes
1870
1870
  */
1871
1871
  declare const EVENT_EFFECTS: readonly EffectDef[];
1872
1872
 
1873
+ /**
1874
+ * The families of material a destruction event plays its effect by (the `{material}` of the stage and collapse entries of `data/event-effects.json`): the
1875
+ * same names as `DebrisFamily` of `game-destruction`, kept as strings so this package does not depend on it.
1876
+ */
1877
+ declare const DEBRIS_EFFECT_FAMILIES: readonly ["wood", "masonry", "glass", "metal", "soft", "soil"];
1878
+ type DebrisEffectFamily = (typeof DEBRIS_EFFECT_FAMILIES)[number];
1879
+ /** The variables a host sets (`PlayOptions.values`) to draw the debris and the dust in the colour of the material that broke. */
1880
+ declare const DEBRIS_COLOR_VARIABLE = "debrisColor";
1881
+ declare const DUST_COLOR_VARIABLE = "dustColor";
1882
+ /** The stage, breach and collapse effects of every family, and the rebar laid bare. */
1883
+ declare const MATERIAL_EVENT_EFFECTS: readonly EffectDef[];
1884
+
1873
1885
  declare const VIEWMODEL_EFFECTS: readonly EffectDef[];
1874
1886
 
1875
1887
  /** What a game event looks like to the map: the kind of event and the little that picks its effect. */
@@ -1878,14 +1890,17 @@ interface GameEvent {
1878
1890
  readonly kind: string;
1879
1891
  /** The stage of a `stage` event (1, 2 or 3). */
1880
1892
  readonly stage?: number;
1881
- /** The material of a `spall` or `fracture` event. */
1893
+ /**
1894
+ * The material of a `spall` or `fracture` event; for a `stage`, `collapse` or `expose` event the family of the material that broke (`DEBRIS_EFFECT_FAMILIES`:
1895
+ * `wood`, `masonry`, `glass`, `metal`, `soft`, `soil`), so the stone dust of a breach is not raised by a wooden wall.
1896
+ */
1882
1897
  readonly material?: string;
1883
1898
  }
1884
1899
  type EventMap = Readonly<Record<string, string | Readonly<Record<string, string>>>>;
1885
1900
  declare const EVENT_EFFECTS_MAP: EventMap;
1886
1901
  /**
1887
1902
  * The effect id that plays for an event (`undefined` when the map has none). A string entry may use `{material}`; an object entry is chosen by the event's
1888
- * stage or material. A game passes its own map to add or change entries.
1903
+ * stage or material, and its value may use `{material}` too. A game passes its own map to add or change entries.
1889
1904
  */
1890
1905
  declare function effectForEvent(event: GameEvent, map?: EventMap): string | undefined;
1891
1906
 
@@ -2038,4 +2053,345 @@ declare const SMOKE_COLORS: {
2038
2053
  readonly gas: Rgb;
2039
2054
  };
2040
2055
 
2041
- export { AREA_CAP_GAME, type AreaCap, type AreaCapTracker, type Behavior, type BehaviorHost, type BlastLight, type BloodMark, type Carrier, type Chunk, type ConfineResult, type Confiner, type CueRequest, type DebrisSpawn, type Decal, type DecalOptions, type DirtMark, EVENT_BUDGET, EVENT_EFFECTS, EVENT_EFFECTS_MAP, EXPLOSIONS, EXPLOSION_ALIASES, EffectCamera, type EffectDef, EffectInstance, type EffectPlayer, type EffectPlayerOptions, EffectRunner, type EffectRunnerOptions, type EffectStep, type EffectTexts, type EffectTrack, type EffectView, Enclosures, type ExplosionCall, type ExplosionDef, type ExplosionOptions, type Fire, type FireLight, type FireOptions, type FireSpec, type Follow, GAME_EFFECTS, type GameEvent, type Glow, type GroundField, type GroundFieldOptions, type InstanceDeps, type InstanceSetup, type KindPoolHost, LOD_GAME, LOD_LAB, type LandListener, type LensBlob, type LightGlow, type LightPool, type LodBands, type Mark, type MarkEvent, type MarkStore, type MeshParticle, MeshPool, type MeshShape, type MeshSpawn, type MushroomSpec, type MutableVec3, OrderedPool, PROFILES, type Placement, type PlayOptions, type PostProcess, type Puddle, type Puff, type Quaternion, RAIN_CAPACITY, RainField, type RandomStream, type Rgb, type Ring, type RockMark, SCRAPE_LIMIT, SMOKE_COLORS, SPRITE_KINDS, type Schedule, type ScorchMark, type ScrapeMark, type ScreenState, type SheetLabels, type Shock, type Spark, type SpriteGround, type SpriteKind, type SpriteKindDef, SpriteKindPool, SpriteKindSystem, type SpriteKindSystemOptions, type SpriteSpawn, type SpriteSpawnOptions, type SpriteSystem, VFX_LAYERS, VIEWMODEL_EFFECTS, type Vec3Like, type Vec3Tuple, type VfxEnclosure, type VfxEnclosureBox, type VfxLayer, type VfxLocale, type VfxOptions, type VfxPoolsView, type VfxProfile, type VfxProfileName, type VfxSideRequest, type VfxStats, type VfxStrings, type VfxTrace, type VfxWorld, WORKSHOP_BEHAVIORS, WORKSHOP_EFFECTS, WORKSHOP_PUDDLES, type WorkshopContext, WorkshopEngine, type WorkshopOptions, type WorkshopTrace, colorOfChunk, composeExplosion, createAreaCap, createEffectPlayer, createGroundField, createSchedule, createScreenState, createVfx, createWorkshopBehaviors, effectForEvent, estimateCost, hexToLinearRgb, hexToRgb, inPuddle, lcg, lehmer, locales, lodScale, patchEffects, patchExplosions, patchSpriteKinds, resolveStrings, slideAlong, streamFor, updateScreen, workshopGround };
2056
+ /** A point or a vector as plain numbers, metres (y up). */
2057
+ type WaterVec3 = readonly [number, number, number];
2058
+ /** How one class of round meets the water, for a round that enters straight down at `speed`. Numbers are metres, seconds and metres per second. */
2059
+ interface WaterShotProfile {
2060
+ /** Speed the numbers are for: a slower round throws less, a faster one a little more. */
2061
+ readonly speed: number;
2062
+ /** Height of the column of water a round entering straight down throws up. */
2063
+ readonly columnHeight: number;
2064
+ /** Radius of that column at its foot. */
2065
+ readonly columnRadius: number;
2066
+ /** Drops of the crown thrown out around the column. */
2067
+ readonly drops: number;
2068
+ /** Speed the crown's drops leave at, slowest and fastest. */
2069
+ readonly dropSpeed: readonly [number, number];
2070
+ /** Radius of one drop. */
2071
+ readonly dropSize: number;
2072
+ /** Radius the widest ring reaches before it is gone. */
2073
+ readonly ringRadius: number;
2074
+ /** Rings that follow one another out from the point. */
2075
+ readonly rings: number;
2076
+ /** Seconds a ring lives. */
2077
+ readonly ringLife: number;
2078
+ /** Radius of the patch of foam left at the point. */
2079
+ readonly foamRadius: number;
2080
+ /** Seconds the foam lasts. */
2081
+ readonly foamLife: number;
2082
+ /** Metres of water the round crosses to lose 1/e of its speed (a rifle bullet yaws and breaks up within a few tens of centimetres). */
2083
+ readonly slowing: number;
2084
+ /** Bubbles left per metre of the trail under the water. */
2085
+ readonly bubblesPerMetre: number;
2086
+ /** Below this angle to the surface, in degrees, the round skips off the water instead of going in. */
2087
+ readonly ricochetBelowDeg: number;
2088
+ }
2089
+ /** The ids of `WATER_SHOT_PROFILES`; a host may add its own (`patchWaterShotProfiles`). */
2090
+ type WaterShotClass = 'rimfire' | 'pistol' | 'magnum' | 'rifle' | 'battle_rifle' | 'sniper' | 'buckshot' | 'birdshot' | 'slug' | 'arrow' | 'fragment' | 'object';
2091
+ /** How a kind of charge works on water. */
2092
+ interface WaterBlastKind {
2093
+ /** Share of the charge that acts on the water like a high explosive: 1 for a high explosive, little for a gas or fuel that only burns fast. */
2094
+ readonly brisance: number;
2095
+ /** Width of the column against a high explosive's (a shaped charge throws a narrow jet). */
2096
+ readonly columnWidth: number;
2097
+ /** Fragments that pepper the water around a charge that bursts at or over the surface. */
2098
+ readonly fragments: number;
2099
+ /** Steam and spray against a high explosive's (a fuel fire boils a lot of water into mist). */
2100
+ readonly mist: number;
2101
+ /** The fireball still shows under the water (never for a real charge; a host may want it). */
2102
+ readonly fireballUnderwater: boolean;
2103
+ }
2104
+ /** The kinds of `WATER_BLAST_KINDS`, as `@adatechnology/game-weapons` names them. */
2105
+ type WaterBlastKindId = 'blast' | 'fragmentation' | 'shaped_charge' | 'fuel' | 'flash' | 'directional' | 'incendiary';
2106
+ /** One explosive of the table: its TNT equivalent in kilograms and its kind. */
2107
+ interface WaterBlastCharge {
2108
+ readonly tnt: number;
2109
+ readonly kind: string;
2110
+ }
2111
+ /** A round meeting the water. */
2112
+ interface WaterShotParams {
2113
+ /** Where the round meets the surface. */
2114
+ readonly point: WaterVec3;
2115
+ /** Unit vector the round travels along. */
2116
+ readonly direction: WaterVec3;
2117
+ /** The class of round (`WATER_SHOT_PROFILES` id) or a profile of its own. */
2118
+ readonly profile: string | WaterShotProfile;
2119
+ /** Speed of the round at the surface; the profile's own when left out. */
2120
+ readonly speed?: number;
2121
+ /** Metres of water under the point (the trail stops at the bed). Default 2. */
2122
+ readonly depth?: number;
2123
+ }
2124
+ /** A charge going off in or over the water. */
2125
+ interface WaterBlastParams {
2126
+ /** The centre of the burst. */
2127
+ readonly point: WaterVec3;
2128
+ /** Height of the water surface over the point. */
2129
+ readonly level: number;
2130
+ /** Metres of water from the bed to the surface there. */
2131
+ readonly depth: number;
2132
+ /** Id of an explosive of `WATER_BLASTS`; `tnt` and `kind` win over it. */
2133
+ readonly explosive?: string;
2134
+ /** Kilograms of TNT equivalent. */
2135
+ readonly tnt?: number;
2136
+ /** Kind of charge (`WATER_BLAST_KINDS` id). Default `blast`. */
2137
+ readonly kind?: string;
2138
+ }
2139
+ /** What a round did at the water, as `planWaterShot` worked it out. */
2140
+ interface WaterShotPlan {
2141
+ readonly profile: WaterShotProfile;
2142
+ /** Degrees between the round's path and the surface. */
2143
+ readonly angleDeg: number;
2144
+ /** The round skipped off: its new direction and the share of its speed it kept. */
2145
+ readonly ricochet: {
2146
+ readonly direction: WaterVec3;
2147
+ readonly speedShare: number;
2148
+ } | null;
2149
+ readonly columnHeight: number;
2150
+ readonly columnRadius: number;
2151
+ /** Horizontal lean of the column, metres of top offset per metre of height. */
2152
+ readonly tilt: readonly [number, number];
2153
+ readonly drops: number;
2154
+ readonly ringRadius: number;
2155
+ readonly rings: number;
2156
+ readonly foamRadius: number;
2157
+ /** Where the round stopped under the water, or met the bed. */
2158
+ readonly trailEnd: WaterVec3;
2159
+ readonly trailLength: number;
2160
+ /** The round reached the bed with this speed (0 when it stopped in the water or skipped off). */
2161
+ readonly bedSpeed: number;
2162
+ }
2163
+ /** What a charge did at the water, as `planWaterBlast` worked it out. */
2164
+ interface WaterBlastPlan {
2165
+ readonly tnt: number;
2166
+ readonly kind: WaterBlastKind;
2167
+ /** Metres under the surface the charge went off (negative over it). */
2168
+ readonly burstDepth: number;
2169
+ /** The charge went off under the water: no fireball, the water takes the blast. */
2170
+ readonly underwater: boolean;
2171
+ /** The burst was too high over the water to throw any: only the shock ring and the spray. */
2172
+ readonly airburst: boolean;
2173
+ readonly columnHeight: number;
2174
+ readonly columnRadius: number;
2175
+ /** Radius of the dome of white water a burst under the surface lifts (0 over it). */
2176
+ readonly domeRadius: number;
2177
+ readonly domeHeight: number;
2178
+ readonly shockRadius: number;
2179
+ readonly waveAmplitude: number;
2180
+ readonly waveSpeed: number;
2181
+ readonly drops: number;
2182
+ readonly mist: number;
2183
+ readonly fragments: number;
2184
+ readonly foamRadius: number;
2185
+ readonly bubbles: number;
2186
+ }
2187
+ /** Upper bound of each pool: past it the oldest record goes. */
2188
+ interface WaterEffectsLimits {
2189
+ readonly drops: number;
2190
+ readonly rings: number;
2191
+ readonly foam: number;
2192
+ readonly columns: number;
2193
+ readonly bubbles: number;
2194
+ readonly mist: number;
2195
+ readonly waves: number;
2196
+ }
2197
+ /** The water's response at a point to the waves going through it. */
2198
+ interface WaterWaveSample {
2199
+ /** Metres the surface stands over its level. */
2200
+ readonly height: number;
2201
+ /** Metres per second a floating body there is pushed with, along x and z. */
2202
+ readonly push: readonly [number, number];
2203
+ }
2204
+
2205
+ /** A drop thrown out of the water: it flies under gravity and, where it falls back on water, leaves a small ring. */
2206
+ interface WaterDrop {
2207
+ x: number;
2208
+ y: number;
2209
+ z: number;
2210
+ vx: number;
2211
+ vy: number;
2212
+ vz: number;
2213
+ size: number;
2214
+ age: number;
2215
+ life: number;
2216
+ /** The surface it was thrown from: it is gone once it falls back under it. */
2217
+ level: number;
2218
+ }
2219
+ /** A ring on the surface. `kind` 0: a ripple that slows as it spreads; 1: the fast shock ring of a blast; 2: a wave crest going out at its speed. */
2220
+ interface WaterRing {
2221
+ x: number;
2222
+ y: number;
2223
+ z: number;
2224
+ kind: 0 | 1 | 2;
2225
+ radius: number;
2226
+ startRadius: number;
2227
+ maxRadius: number;
2228
+ /** Seconds before it shows. */
2229
+ delay: number;
2230
+ age: number;
2231
+ life: number;
2232
+ /** Opacity it starts with. */
2233
+ strength: number;
2234
+ /** Opacity now, 0 while it waits. */
2235
+ alpha: number;
2236
+ }
2237
+ /** A patch of white foam on the surface. */
2238
+ interface WaterFoam {
2239
+ x: number;
2240
+ y: number;
2241
+ z: number;
2242
+ radius: number;
2243
+ startRadius: number;
2244
+ maxRadius: number;
2245
+ age: number;
2246
+ life: number;
2247
+ alpha: number;
2248
+ }
2249
+ /** A column of water thrown up (`dome` false: it rises, holds and falls back) or the dome a burst under the surface lifts. */
2250
+ interface WaterColumn {
2251
+ x: number;
2252
+ y: number;
2253
+ z: number;
2254
+ dome: boolean;
2255
+ peak: number;
2256
+ baseRadius: number;
2257
+ /** Top offset per metre of height, along x and z. */
2258
+ tiltX: number;
2259
+ tiltZ: number;
2260
+ rise: number;
2261
+ delay: number;
2262
+ age: number;
2263
+ life: number;
2264
+ height: number;
2265
+ radius: number;
2266
+ alpha: number;
2267
+ }
2268
+ /** A bubble rising under the water: the trail of a round, the boil of a burst. */
2269
+ interface WaterBubble {
2270
+ x: number;
2271
+ y: number;
2272
+ z: number;
2273
+ size: number;
2274
+ rise: number;
2275
+ delay: number;
2276
+ age: number;
2277
+ life: number;
2278
+ level: number;
2279
+ alpha: number;
2280
+ }
2281
+ /** A puff of spray and steam over the water. */
2282
+ interface WaterMist {
2283
+ x: number;
2284
+ y: number;
2285
+ z: number;
2286
+ vx: number;
2287
+ vy: number;
2288
+ vz: number;
2289
+ size: number;
2290
+ age: number;
2291
+ life: number;
2292
+ alpha: number;
2293
+ }
2294
+ /** A wave going out from a blast: it lifts and pushes what floats where its crest passes. */
2295
+ interface WaterWave {
2296
+ x: number;
2297
+ z: number;
2298
+ speed: number;
2299
+ amplitude: number;
2300
+ width: number;
2301
+ /** Metres it can go before the shore. */
2302
+ reach: number;
2303
+ delay: number;
2304
+ age: number;
2305
+ life: number;
2306
+ }
2307
+ /** The default limits: enough for a rifle on full auto and a few blasts at once in the same pond. */
2308
+ declare const WATER_LIMITS: WaterEffectsLimits;
2309
+
2310
+ interface WaterEffectsOptions {
2311
+ readonly seed?: number;
2312
+ /** Upper bound of each pool (the default `WATER_LIMITS`). */
2313
+ readonly limits?: Partial<WaterEffectsLimits>;
2314
+ /** The water surface at (x, z), or null where there is none: rings, foam and waves stop at the shore, and only drops falling on water ring. */
2315
+ readonly levelAt?: (x: number, z: number) => number | null;
2316
+ /** Distance bands for fewer drops and bubbles far from the camera (default `LOD_GAME`). */
2317
+ readonly lod?: LodBands;
2318
+ /** The shot profiles by class (default `WATER_SHOT_PROFILES`; `patchWaterShotProfiles` to change them). */
2319
+ readonly profiles?: Readonly<Record<string, WaterShotProfile>>;
2320
+ }
2321
+ interface WaterEffectsStats {
2322
+ readonly drops: number;
2323
+ readonly rings: number;
2324
+ readonly foam: number;
2325
+ readonly columns: number;
2326
+ readonly bubbles: number;
2327
+ readonly mist: number;
2328
+ readonly waves: number;
2329
+ }
2330
+ /** Splashes of rounds and blasts on water, renderer-free: plain pools a renderer draws (`createWaterEffectsLayer` of game-vfx-three). */
2331
+ interface WaterEffects {
2332
+ /** A round meets the water at `point`. */
2333
+ shot(params: WaterShotParams): WaterShotPlan;
2334
+ /** A charge goes off in or over the water. */
2335
+ blast(params: WaterBlastParams): WaterBlastPlan;
2336
+ update(dt: number): void;
2337
+ setCamera(position: WaterVec3): void;
2338
+ /** The waves going through (x, z): how high they lift the surface and how hard they push what floats there. */
2339
+ waveAt(x: number, z: number): WaterWaveSample;
2340
+ readonly drops: readonly WaterDrop[];
2341
+ readonly rings: readonly WaterRing[];
2342
+ readonly foam: readonly WaterFoam[];
2343
+ readonly columns: readonly WaterColumn[];
2344
+ readonly bubbles: readonly WaterBubble[];
2345
+ readonly mist: readonly WaterMist[];
2346
+ readonly waves: readonly WaterWave[];
2347
+ readonly limits: WaterEffectsLimits;
2348
+ stats(): WaterEffectsStats;
2349
+ clear(): void;
2350
+ }
2351
+ declare function createWaterEffects(options?: WaterEffectsOptions): WaterEffects;
2352
+
2353
+ /** What a round does as it meets the water: the size of the splash for its class, angle and speed, a skip off a grazing surface, the trail under. */
2354
+ declare function planWaterShot(params: WaterShotParams, random: RandomStream, table?: Readonly<Record<string, WaterShotProfile>>): WaterShotPlan;
2355
+ /** The charge and kind a host names, from its own numbers or the table. */
2356
+ declare function resolveWaterBlast(params: WaterBlastParams): {
2357
+ tnt: number;
2358
+ kind: WaterBlastKind;
2359
+ };
2360
+ /**
2361
+ * What a charge does to the water, by Hopkinson scaling (lengths go with the cube root of the charge): a burst a little under the surface throws the
2362
+ * tallest column; at the surface a lower one and a ring of spray; deep under, the water holds it down to a dome of white water and a boil of bubbles;
2363
+ * high over it, only the shock ring and the spray. A shallow pool has not the water to throw a full column.
2364
+ */
2365
+ declare function planWaterBlast(params: WaterBlastParams): WaterBlastPlan;
2366
+
2367
+ /**
2368
+ * How each class of round meets water, entering straight down at its usual speed. A rifle bullet throws a tall thin spout and yaws and breaks up
2369
+ * within a few tens of centimetres; a pistol round a short one and goes on longer; a heavy rifle (.338, .50) a tall wide column; a buckshot pellet a
2370
+ * small spout and a lot of shallow foam; an arrow slips in with little splash and goes far.
2371
+ */
2372
+ declare const WATER_SHOT_PROFILES: Readonly<Record<WaterShotClass, WaterShotProfile>>;
2373
+ /** The class of round of each calibre of `@adatechnology/game-weapons` (its `calibers.json` ids). A calibre not here is classed by `waterShotClassOf`. */
2374
+ declare const WATER_SHOT_BY_CALIBER: Readonly<Record<string, WaterShotClass>>;
2375
+ /** What is known of a round that has no calibre in the table: its mass in grams, speed in m/s and diameter in millimetres. */
2376
+ interface WaterRound {
2377
+ readonly grams: number;
2378
+ readonly speed: number;
2379
+ readonly diameter?: number;
2380
+ /** One of several pellets of a shell. */
2381
+ readonly pellet?: boolean;
2382
+ }
2383
+ /** The class of a round from what it weighs and how fast it goes, for a calibre the table does not know. */
2384
+ declare function waterShotClassOf(round: WaterRound): WaterShotClass;
2385
+ /**
2386
+ * How each kind of charge works on water. A high explosive throws the water; a shaped charge a narrow jet; a fragmentation charge over the surface
2387
+ * also peppers it with fragments; a gas or fuel deflagration mostly boils it into steam.
2388
+ */
2389
+ declare const WATER_BLAST_KINDS: Readonly<Record<WaterBlastKindId, WaterBlastKind>>;
2390
+ /** The explosives of `@adatechnology/game-weapons` (`explosives.json`): TNT equivalent in kilograms and kind. */
2391
+ declare const WATER_BLASTS: Readonly<Record<string, WaterBlastCharge>>;
2392
+ /** The profile a host asks for by class id, or the profile it gives; an unknown id falls back to `pistol`. */
2393
+ declare function resolveWaterShotProfile(profile: string | WaterShotProfile, table?: Readonly<Record<string, WaterShotProfile>>): WaterShotProfile;
2394
+ /** Changes a profile table without touching the kit's: `null` removes an entry, a partial entry is merged over the old one. */
2395
+ declare function patchWaterShotProfiles(base: Readonly<Record<string, WaterShotProfile>>, changes: Readonly<Record<string, Partial<WaterShotProfile> | null>>): Record<string, WaterShotProfile>;
2396
+
2397
+ export { AREA_CAP_GAME, type AreaCap, type AreaCapTracker, type Behavior, type BehaviorHost, type BlastLight, type BloodMark, type Carrier, type Chunk, type ConfineResult, type Confiner, type CueRequest, DEBRIS_COLOR_VARIABLE, DEBRIS_EFFECT_FAMILIES, DUST_COLOR_VARIABLE, type DebrisEffectFamily, type DebrisSpawn, type Decal, type DecalOptions, type DirtMark, EVENT_BUDGET, EVENT_EFFECTS, EVENT_EFFECTS_MAP, EXPLOSIONS, EXPLOSION_ALIASES, EffectCamera, type EffectDef, EffectInstance, type EffectPlayer, type EffectPlayerOptions, EffectRunner, type EffectRunnerOptions, type EffectStep, type EffectTexts, type EffectTrack, type EffectView, Enclosures, type ExplosionCall, type ExplosionDef, type ExplosionOptions, type Fire, type FireLight, type FireOptions, type FireSpec, type Follow, GAME_EFFECTS, type GameEvent, type Glow, type GroundField, type GroundFieldOptions, type InstanceDeps, type InstanceSetup, type KindPoolHost, LOD_GAME, LOD_LAB, type LandListener, type LensBlob, type LightGlow, type LightPool, type LodBands, MATERIAL_EVENT_EFFECTS, type Mark, type MarkEvent, type MarkStore, type MeshParticle, MeshPool, type MeshShape, type MeshSpawn, type MushroomSpec, type MutableVec3, OrderedPool, PROFILES, type Placement, type PlayOptions, type PostProcess, type Puddle, type Puff, type Quaternion, RAIN_CAPACITY, RainField, type RandomStream, type Rgb, type Ring, type RockMark, SCRAPE_LIMIT, SMOKE_COLORS, SPRITE_KINDS, type Schedule, type ScorchMark, type ScrapeMark, type ScreenState, type SheetLabels, type Shock, type Spark, type SpriteGround, type SpriteKind, type SpriteKindDef, SpriteKindPool, SpriteKindSystem, type SpriteKindSystemOptions, type SpriteSpawn, type SpriteSpawnOptions, type SpriteSystem, VFX_LAYERS, VIEWMODEL_EFFECTS, type Vec3Like, type Vec3Tuple, type VfxEnclosure, type VfxEnclosureBox, type VfxLayer, type VfxLocale, type VfxOptions, type VfxPoolsView, type VfxProfile, type VfxProfileName, type VfxSideRequest, type VfxStats, type VfxStrings, type VfxTrace, type VfxWorld, WATER_BLASTS, WATER_BLAST_KINDS, WATER_LIMITS, WATER_SHOT_BY_CALIBER, WATER_SHOT_PROFILES, WORKSHOP_BEHAVIORS, WORKSHOP_EFFECTS, WORKSHOP_PUDDLES, type WaterBlastCharge, type WaterBlastKind, type WaterBlastKindId, type WaterBlastParams, type WaterBlastPlan, type WaterBubble, type WaterColumn, type WaterDrop, type WaterEffects, type WaterEffectsLimits, type WaterEffectsOptions, type WaterEffectsStats, type WaterFoam, type WaterMist, type WaterRing, type WaterRound, type WaterShotClass, type WaterShotParams, type WaterShotPlan, type WaterShotProfile, type WaterVec3, type WaterWave, type WaterWaveSample, type WorkshopContext, WorkshopEngine, type WorkshopOptions, type WorkshopTrace, colorOfChunk, composeExplosion, createAreaCap, createEffectPlayer, createGroundField, createSchedule, createScreenState, createVfx, createWaterEffects, createWorkshopBehaviors, effectForEvent, estimateCost, hexToLinearRgb, hexToRgb, inPuddle, lcg, lehmer, locales, lodScale, patchEffects, patchExplosions, patchSpriteKinds, patchWaterShotProfiles, planWaterBlast, planWaterShot, resolveStrings, resolveWaterBlast, resolveWaterShotProfile, slideAlong, streamFor, updateScreen, waterShotClassOf, workshopGround };