@adatechnology/game-terrain 0.3.1 → 0.4.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
@@ -12,7 +12,7 @@ terrain.heightAt(x, z) // what things stand on
12
12
 
13
13
  ## What it does
14
14
 
15
- - **Profiles** (`TERRAIN_PROFILES`, replace or add through `profiles`): `lawn` (turf 5 cm, soil 1.5 m, rock), `dirt`, `sand`, `road` (asphalt 5 cm, gravel, soil), `concrete_slab` (12 cm with rebar at 3 cm), `tile_floor` (tile, mortar, slab), `wood_floor`, `stone_paving`, `mud`, `gravel_bed`, `dry_clay`, `snow`, `cobblestone`, `paver_floor`, `shallow_water`.
15
+ - **Profiles** (`TERRAIN_PROFILES`, replace or add through `profiles`): `lawn` (turf 5 cm, soil 1.5 m, rock), `dirt`, `sand`, `road` (asphalt 5 cm, gravel, soil), `concrete_slab` (12 cm with rebar at 3 cm), `tile_floor` (tile, mortar, slab), `wood_floor`, `stone_paving`, `mud`, `gravel_bed`, `dry_clay`, `snow`, `cobblestone`, `paver_floor`, `shallow_water`, `bedrock` (bare rock).
16
16
  - **Digging**: a blow removes `energy / specificEnergy` cubic metres (`TERRAIN_MATERIALS`, per blow type: ballistic, blunt, slash, explosive) as a bowl with the shape of the material. It takes the top stratum and spends what is left on the next. The strata end at the digging limit: **a slab is never pierced**, and a crater has a floor.
17
17
  - **Bars**: bare bars bend with each blow and give way at `yieldJoules`. A slab on the ground stays the floor; `suspended_slab` (`TerrainProfile.drop`) opens onto the floor below.
18
18
  - **Fine marks**: a bowl under 1.5 cells stays a mark, not a change of the height field. Blows on the same mark grow it until it is dug in.
package/dist/index.d.ts CHANGED
@@ -86,7 +86,7 @@ interface TerrainFireResponse {
86
86
  /** Catches and carries the fire to the next cells on its own. */
87
87
  readonly flammable?: boolean;
88
88
  }
89
- declare const TERRAIN_PATTERNS: readonly ["plain", "grass", "soil", "sand", "asphalt", "concrete", "tile", "planks", "stone", "mud", "gravel", "clay", "snow", "cobble", "paver"];
89
+ declare const TERRAIN_PATTERNS: readonly ["plain", "grass", "soil", "sand", "asphalt", "concrete", "tile", "planks", "stone", "mud", "gravel", "clay", "snow", "cobble", "paver", "rock"];
90
90
  type TerrainPattern = (typeof TERRAIN_PATTERNS)[number];
91
91
  /** One layer of a column, from the top down. */
92
92
  interface TerrainStratum {
@@ -110,6 +110,8 @@ interface TerrainProfile {
110
110
  readonly strata: readonly TerrainStratum[];
111
111
  /** A slab with nothing under it: where its bars give way the floor opens, and the ground is this many metres further down (the floor below). Without it the ground under the slab holds it up. */
112
112
  readonly drop?: number;
113
+ /** How the untouched top layer is drawn when it is not its material's way: bare rock is stone, but not laid as paving. Dug, the material's own shows. */
114
+ readonly surfacePattern?: TerrainPattern;
113
115
  /** Water standing over the column: the strata are its bed. */
114
116
  readonly water?: TerrainWater;
115
117
  }
@@ -274,6 +274,8 @@ var GameTerrain = (() => {
274
274
  { id: "dry_clay", strata: [{ material: "clay", thickness: 0.35 }, { material: "soil", thickness: 1.5 }, { material: "stone", thickness: 0.5 }] },
275
275
  { id: "snow", strata: [{ material: "snow", thickness: 0.3 }, { material: "soil", thickness: 1.5 }, { material: "stone", thickness: 0.5 }] },
276
276
  { id: "cobblestone", strata: [{ material: "cobble", thickness: 0.12 }, { material: "sand", thickness: 0.06 }, { material: "gravel", thickness: 0.2 }, { material: "soil", thickness: 1.2 }] },
277
+ // rock at the surface (an outcrop, a quarry floor): a blast only spalls it and a shot chips it
278
+ { id: "bedrock", surfacePattern: "rock", strata: [{ material: "stone", thickness: 3 }] },
277
279
  { id: "paver_floor", strata: [{ material: "paver", thickness: 0.08 }, { material: "sand", thickness: 0.05 }, { material: "gravel", thickness: 0.15 }, { material: "soil", thickness: 1.2 }] },
278
280
  { id: "shallow_water", water: { liquid: "water", depth: 0.3, drag: 0.65, blowShare: WATER_BLOW_SHARE }, strata: [{ material: "mud", thickness: 0.15 }, { material: "soil", thickness: 1.5 }, { material: "stone", thickness: 0.5 }] }
279
281
  ];
@@ -1522,7 +1524,7 @@ var GameTerrain = (() => {
1522
1524
  }
1523
1525
 
1524
1526
  // src/types.ts
1525
- var TERRAIN_PATTERNS = ["plain", "grass", "soil", "sand", "asphalt", "concrete", "tile", "planks", "stone", "mud", "gravel", "clay", "snow", "cobble", "paver"];
1527
+ var TERRAIN_PATTERNS = ["plain", "grass", "soil", "sand", "asphalt", "concrete", "tile", "planks", "stone", "mud", "gravel", "clay", "snow", "cobble", "paver", "rock"];
1526
1528
 
1527
1529
  // src/footprints.ts
1528
1530
  var STRIDE = 0.72;