@adatechnology/game-contracts 0.1.1 → 0.2.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.
Files changed (2) hide show
  1. package/dist/index.d.ts +7 -2
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -127,7 +127,10 @@ type DamageType =
127
127
  'ballistic'
128
128
  /** hammers, falls, thrown objects, vehicle impacts: `energy`, `radius` of contact */
129
129
  | 'blunt'
130
- /** axes, knives, machetes: `energy`; cuts and splinters, opens fabric */
130
+ /**
131
+ * axes, knives, machetes: `energy`; cuts and splinters, opens fabric. A cut only goes through a slice of the part, so its cost follows the
132
+ * cross-section, not the length: on a part longer than 1 m, slash damage is multiplied by its longest dimension in metres (at most 50).
133
+ */
131
134
  | 'slash'
132
135
  /** blasts: `energy`, `radius`; damage and impulse fall off with distance, joints break, fragments fly */
133
136
  | 'explosive'
@@ -157,6 +160,8 @@ interface Hit {
157
160
  source?: string;
158
161
  }
159
162
  type PartStatus = 'intact' | 'damaged'
163
+ /** the part lost its support path to the ground and fell with its group (reported by a `collapse` event); it still exists as a piece */
164
+ | 'collapsed'
160
165
  /** hp reached 0; the part fractured into fragments (it no longer exists as one piece) */
161
166
  | 'broken'
162
167
  /** melted into a puddle */
@@ -208,7 +213,7 @@ interface PartState {
208
213
  liters?: number;
209
214
  /**
210
215
  * Structural parts only. Load in kg: own mass plus what rests on the part. `stress` = `load / capacity`; above 1 the part takes damage every
211
- * `update` (`(stress - 1) * maxHp * 0.5` per second), which can cascade. Capacity is `structure.capacity`, else `compressive * section` of the
216
+ * `update` (`min(0.6, 0.12 + 0.8 * (stress - 1))` of `maxHp` per second: about 7 s at stress 1.02, 2 s at 1.5, 1.7 s above 1.7), which can cascade. Capacity is `structure.capacity`, else `compressive * section` of the
212
217
  * material, where the section is the product of the two smallest dimensions (columns, beams, roofs, stairs, foundations x10), thickness times longest dimension (slabs) or
213
218
  * thickness times horizontal length (walls). Example: a 0.3 m concrete column carries 40 t, a 0.2 m brick wall 8 t per metre, a 0.1x0.2 m softwood beam 2 t.
214
219
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adatechnology/game-contracts",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "description": "The contracts every game module depends on, and nothing else: destruction (parts, hits, events, DestructibleImpl), weapons (shots), fluids (containers, item uses), item animations and the TestableModule a module hands the test room. Types plus tiny checkers, no runtime dependencies.",
6
6
  "keywords": [