@adatechnology/game-test-room 0.21.0 → 0.23.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/dist/index.d.ts CHANGED
@@ -4,9 +4,9 @@ import { AudioEngine } from '@adatechnology/game-audio';
4
4
  import { Vec3 as Vec3$1, DestructionWorld, BlastOptions, DestructibleSpec, DestructionOptions, DestructionEvent } from '@adatechnology/game-destruction';
5
5
  export { DestructionEvent, Vec3 } from '@adatechnology/game-destruction';
6
6
  import { DoorUsePhase, FurniturePushPhase, FurniturePushBlock, FurniturePushRules, DoorUseRules } from '@adatechnology/game-player';
7
- import { BusySink, ItemSeat, Vec3, HandTargets, ModuleControl, ControlValue, ModuleLayer, EnvironmentBus, BusyTask, BusyOptions, TestableModule, ModuleItemSeal, DestructibleImpl, AnimationClipSpec, GroundLayout, BlastShoveOptions } from '@adatechnology/game-contracts';
7
+ import { BusySink, ItemSeat, Vec3, HandTargets, ModuleControl, ControlValue, ModuleLayer, EnvironmentBus, Knock, BusyTask, BusyOptions, TestableModule, ModuleItemSeal, DestructibleImpl, AnimationClipSpec, ItemSounds, GroundLayout, BlastShoveOptions } from '@adatechnology/game-contracts';
8
8
  export { AnimationClipSpec, DestructibleImpl, ItemAnimationContract, ModuleScenario, TestableItem, TestableModule } from '@adatechnology/game-contracts';
9
- import { DestructionRenderer, SpecFromObjectOptions, Quality, FragmentLifeRule } from '@adatechnology/game-destruction-three';
9
+ import { DestructionRenderer, SpecFromObjectOptions, Quality, SoundDetail, FragmentLifeRule } from '@adatechnology/game-destruction-three';
10
10
  import { StorageLike, GraphicsController } from '@adatechnology/game-graphics';
11
11
  import { GraphicsScreen } from '@adatechnology/game-graphics/screen';
12
12
  import { Arsenal, WeaponState, TriggerResult, WeaponDef } from '@adatechnology/game-weapons';
@@ -406,6 +406,8 @@ interface RoomAvatarState {
406
406
  running: boolean;
407
407
  crouch: boolean;
408
408
  down: boolean;
409
+ /** Which way the body falls while `down`: true face down, false on its back; left out, the avatar picks. A blast falls it the way it pushed. */
410
+ fallForward?: boolean;
409
411
  /** A firearm is the tool in hand. */
410
412
  armed: boolean;
411
413
  /** Camera pitch, radians, positive looking up (the room's own convention). */
@@ -596,6 +598,8 @@ interface TestRoomItem {
596
598
  animations?: AnimationClipSpec[];
597
599
  /** Where the player can sit or lie on it (see `TestRoom.sit`). */
598
600
  seats?: readonly ItemSeat[];
601
+ /** What it sounds like in the hand and the sound set of its doors and lids (`TestableItem.sounds`). */
602
+ sounds?: ItemSounds;
599
603
  /** Picture for the catalogue, the search results and the aimed-item label: an image URL or inline `<svg…>` markup (see `TestableItem.thumbnail`). */
600
604
  thumbnail?: string;
601
605
  /** Author and licence of the thumbnail, shown as the tooltip of the picture in the inspector. */
@@ -738,12 +742,15 @@ interface TestRoomOptions {
738
742
  area?: string;
739
743
  /** Called for every destruction event (to log, play sounds, sync over LAN). Fluid events reach the log too. */
740
744
  onEvent?: (event: DestructionEvent) => void;
741
- onSound?: (key: string, point: Vec3$1, volume: number) => void;
745
+ /** Every sound key the room plays, with its detail: the more specific keys of an impact, the named explosion, a leak's seconds (`SoundDetail` of game-destruction-three). */
746
+ onSound?: (key: string, point: Vec3$1, volume: number, detail?: SoundDetail) => void;
742
747
  /**
743
748
  * The sound engine of the room (@adatechnology/game-audio): the destruction renderer's sound keys play on it, and modules get it as `host.audio`.
744
749
  * Default: a new engine of the room's own (it makes no AudioContext until the first sound); `false` for a silent room.
745
750
  */
746
751
  audio?: AudioEngine | false;
752
+ /** Where the kit's recorded sound files (game-audio `assets/sfx/`) are served, for the room's engine (default `./sfx/`); `null` plays the recipes only. */
753
+ samplesBaseUrl?: string | null;
747
754
  /** The environment store modules get as `host.environment` (the weather module writes it, the others read it). Default: a new one with a calm dry day. */
748
755
  environment?: EnvironmentBus;
749
756
  /** Show the built-in HUD and panels (default true). */
@@ -820,6 +827,8 @@ interface TestRoomOptions {
820
827
  * Default: the SDK's (`DEFAULT_BLAST_SHOVE` of game-contracts: 2 % of the energy becomes speed, 20 m/s at most, falloff `(1 - d / r)^2`).
821
828
  */
822
829
  blastShove?: BlastShoveOptions;
830
+ /** Mass of the player's body in kg: how far a blast throws it and whether it knocks it down (default 70, the `bodyMass` of 1.75 m). */
831
+ playerMass?: number;
823
832
  /**
824
833
  * Module bench state. `state` maps a module id to its encoded state, restored when that module is first loaded (a module reloaded
825
834
  * keeps its live state instead) before its first changes are sent; ids are per module, so two modules may share a control id.
@@ -908,6 +917,8 @@ interface TestRoom {
908
917
  use(hold?: number): UseStatus;
909
918
  /** Where the player's feet are. */
910
919
  readonly playerPosition: Vec3$1;
920
+ /** The knock of a blast on the player while it lasts (thrown, down, getting up), or null on its feet. */
921
+ readonly playerKnock: Readonly<Knock> | null;
911
922
  /** Grab what the camera looks at (or drop what is held). */
912
923
  grab(): boolean;
913
924
  /**
@@ -1205,10 +1216,6 @@ interface ScenarioReport {
1205
1216
  /** What the trigger answered to `TestRoom.use`: the status of the weapons package's trigger. */
1206
1217
  type UseStatus = TriggerResult['status'];
1207
1218
 
1208
- /**
1209
- * Create the test room. See `TestRoomOptions`. The room owns a renderer, scene and camera unless you pass them; with your own renderer you call
1210
- * `room.update(dt)` every frame and render yourself.
1211
- */
1212
1219
  declare function createTestRoom(options: TestRoomOptions): TestRoom;
1213
1220
 
1214
1221
  /** Spec of the brick target wall: `cols` x `rows` brick panels, the bottom row anchored, mortar joints between neighbours. */