@adatechnology/game-test-room 0.28.2 → 0.29.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
@@ -145,7 +145,8 @@ An `explosion` moves the loose items, the heavy furniture that is not fixed, and
145
145
  The room makes **one** effects world (`game-vfx` and its `game-vfx-three` layer) and steps it once per frame, after the destruction renderer. The destruction
146
146
  renderer draws into it, every module gets it as `host.effects` (an `EffectSink`: `play({ effect: 'm67', point })`, `catalog()`), grenades and rockets play the
147
147
  profile of their explosive (`explosive` is on the `explosion` host event), the camera shakes and the screen flashes through an overlay in the container, and the
148
- `particles` metric counts its pools. Without a DOM nothing is drawn on the screen. `TestRoom.applyCamera()` wraps a host's own `render`; the room's loop does it itself.
148
+ `particles` metric counts its pools. The same sink is `room.effects`, for what a page builds before its module loads (the vehicle kit's `effects`); `room.vfx` is the
149
+ world under it, whose `play` takes an id and a point, so a request given to it plays nothing. Without a DOM nothing is drawn on the screen. `TestRoom.applyCamera()` wraps a host's own `render`; the room's loop does it itself.
149
150
  `craters: true` swaps the floor for a deformable patch that big explosions dig into.
150
151
 
151
152
  A module that declares `controls`, `layers` or `metrics` (see `@adatechnology/game-contracts`) gets a bench: `loadModule` checks it with
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ 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, Knock, BusyTask, BusyOptions, TestableModule, WarmUpProbes, ModuleItemSeal, DestructibleImpl, AnimationClipSpec, ItemSounds, GroundLayout, BlastImpulseOptions, BlastShoveOptions } from '@adatechnology/game-contracts';
7
+ import { BusySink, ItemSeat, Vec3, HandTargets, ModuleControl, ControlValue, ModuleLayer, EnvironmentBus, EffectSink, Knock, BusyTask, BusyOptions, TestableModule, WarmUpProbes, ModuleItemSeal, DestructibleImpl, AnimationClipSpec, ItemSounds, GroundLayout, BlastImpulseOptions, BlastShoveOptions } from '@adatechnology/game-contracts';
8
8
  export { AnimationClipSpec, DestructibleImpl, ItemAnimationContract, ModuleScenario, TestableItem, TestableModule } from '@adatechnology/game-contracts';
9
9
  import { DestructionRenderer, SpecFromObjectOptions, Quality, SoundDetail, FragmentLifeRule } from '@adatechnology/game-destruction-three';
10
10
  import { StorageLike, GraphicsController } from '@adatechnology/game-graphics';
@@ -835,7 +835,7 @@ interface TestRoomOptions {
835
835
  };
836
836
  /** Which hand throws the one-handed strikes (`punchTools`): `alternate` (default) swaps at each punch starting with the right, or always `left` or `right`. */
837
837
  punchHand?: PunchHand;
838
- /** The tools whose strike is thrown with one hand, so `punchHand` picks it (default `['hand', 'fists']`); the shove and the kick are not. */
838
+ /** The tools whose strike is thrown with one hand, so `punchHand` picks it (default `['hand', 'fists', 'brass_knuckles']`); the shove and the kick are not. */
839
839
  punchTools?: readonly string[];
840
840
  /**
841
841
  * A strike combo the player has (an ability, such as `PUNCH_COMBO` of game-characters-people): while it is on (N, the combo button or `setStrikeCombo`), each blow of its
@@ -963,9 +963,25 @@ interface TestRoom {
963
963
  readonly film: FilmBridge;
964
964
  /** The room's one effects world (what `host.effects` draws into): the weather moves its wind. */
965
965
  readonly vfx: VfxWorld;
966
+ /**
967
+ * The room's effect sink, the same one modules get as `host.effects`: an effect asked for by request (`play({ id, at, ... })`). Give this, not `vfx`, to whatever is
968
+ * built before the module loads and wants an `EffectSink` (the vehicle kit's `effects`): `vfx.play` takes an id and a point, so a request there plays nothing.
969
+ */
970
+ readonly effects: EffectSink;
966
971
  /** Equip a weapon or tool of the loadout (or any arsenal id). */
967
972
  setTool(weaponId: string): void;
968
973
  readonly tool: WeaponState;
974
+ /**
975
+ * Puts one of a weapon in the left hand beside the tool in hand (a pistol in each hand: the left mouse button fires the right one, the right button the left one, and neither aims).
976
+ * False, and nothing changes, when the arsenal's `rules.dualWield` does not take the weapon or the tool in hand; `null` lets the left hand go. `setTool` also lets it go.
977
+ */
978
+ setOffTool(weaponId: string | null): boolean;
979
+ /** The tool in the left hand (its own rounds and reload), or null with one tool. */
980
+ readonly offTool: WeaponState | null;
981
+ /** `use` for the tool in the left hand, as the right mouse button does with a tool in each hand; `cooldown` with nothing there. */
982
+ useOff(hold?: number): UseStatus;
983
+ /** The R key: reloads the tool in hand and, with one in each hand, the left one after the right one (one hand holds the other weapon meanwhile). */
984
+ reload(): void;
969
985
  /** Play an item use on the held item (`drink`, `pour`...). Returns false when nothing is held or the use does not apply. */
970
986
  useItem(useId: string): boolean;
971
987
  /**