@adatechnology/game-contracts 0.11.0 → 0.13.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 +14 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1085,6 +1085,10 @@ interface EffectRequest {
|
|
|
1085
1085
|
readonly param?: number | string;
|
|
1086
1086
|
/** Multiplies the effect's size and amount. */
|
|
1087
1087
|
readonly scale?: number;
|
|
1088
|
+
/** Which way a thing the effect belongs to is turned, as a unit quaternion `[x, y, z, w]` (the barrel of a weapon, pitch and roll included): an effect written around the thing's own axes follows it. A host that cannot turn an effect fully uses `direction`. */
|
|
1089
|
+
readonly orientation?: readonly [number, number, number, number];
|
|
1090
|
+
/** Named numbers the effect reads (a size, a length of time, a rate): which ones belong to the effect, and an effect that does not read one ignores it. */
|
|
1091
|
+
readonly values?: Readonly<Record<string, number>>;
|
|
1088
1092
|
}
|
|
1089
1093
|
/** Identifies a running effect so it can be stopped. */
|
|
1090
1094
|
type EffectHandle = number;
|
|
@@ -1518,6 +1522,11 @@ interface ModuleHost {
|
|
|
1518
1522
|
on(listener: (event: HostEvent) => void): () => void;
|
|
1519
1523
|
/** Run every simulated frame with the frame's seconds. Returns the unsubscribe function. */
|
|
1520
1524
|
onFrame(update: (dt: number) => void): () => void;
|
|
1525
|
+
/**
|
|
1526
|
+
* Follow the host clearing its area (`clear()`, opening an area, running scenarios): everything the module put in the world on its own (not as items) is to be taken away or put back. Returns the
|
|
1527
|
+
* unsubscribe function. A host that never clears leaves it out.
|
|
1528
|
+
*/
|
|
1529
|
+
onClear?(listener: () => void): () => void;
|
|
1521
1530
|
/** Write a line to the host's behaviour log. */
|
|
1522
1531
|
log(text: string, data?: Record<string, unknown>): void;
|
|
1523
1532
|
/**
|
|
@@ -1525,6 +1534,11 @@ interface ModuleHost {
|
|
|
1525
1534
|
* ones taken later start that way. A host applies the ids it knows and ignores the rest. The test room knows `condition` (how worn the tools are) and `ammo_quality` (how good what they load is).
|
|
1526
1535
|
*/
|
|
1527
1536
|
configureTool?(settings: Readonly<Record<string, string>>): void;
|
|
1537
|
+
/**
|
|
1538
|
+
* Adds a place the walking player cannot enter: `blocked(x, z, radius)` answers for a disc of the player's `radius` centred on the world point (x, z). A module with walls of its own (a house) uses it so the
|
|
1539
|
+
* player stops at them; the function is asked on every step, so it may follow a door that opens. Returns the function that takes it away. A host without a walking player leaves it out.
|
|
1540
|
+
*/
|
|
1541
|
+
addBlocker?(blocked: (x: number, z: number, radius: number) => boolean): () => void;
|
|
1528
1542
|
/** Asks the tool in hand to do something (see `ToolCommand`). A host without accessories leaves it out. */
|
|
1529
1543
|
command?(command: ToolCommand): ToolCommandResult;
|
|
1530
1544
|
/** Lent only to a module that declares controls, layers or metrics. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adatechnology/game-contracts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.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": [
|