@crowdedkingdoms/crowdyjs 8.2.0 → 8.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.
Files changed (135) hide show
  1. package/README.md +81 -3
  2. package/dist/crowdy-client.d.ts.map +1 -1
  3. package/dist/crowdy-client.js +5 -1
  4. package/dist/index.d.ts +3 -2
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -2
  7. package/dist/kit/blueprints/combat.d.ts +75 -0
  8. package/dist/kit/blueprints/combat.d.ts.map +1 -0
  9. package/dist/kit/blueprints/combat.js +351 -0
  10. package/dist/kit/blueprints/core.d.ts +222 -0
  11. package/dist/kit/blueprints/core.d.ts.map +1 -0
  12. package/dist/kit/blueprints/core.js +185 -0
  13. package/dist/kit/blueprints/decks.d.ts +50 -0
  14. package/dist/kit/blueprints/decks.d.ts.map +1 -0
  15. package/dist/kit/blueprints/decks.js +163 -0
  16. package/dist/kit/blueprints/economy.d.ts +88 -0
  17. package/dist/kit/blueprints/economy.d.ts.map +1 -0
  18. package/dist/kit/blueprints/economy.js +533 -0
  19. package/dist/kit/blueprints/guild.d.ts +51 -0
  20. package/dist/kit/blueprints/guild.d.ts.map +1 -0
  21. package/dist/kit/blueprints/guild.js +50 -0
  22. package/dist/kit/blueprints/index.d.ts +21 -0
  23. package/dist/kit/blueprints/index.d.ts.map +1 -0
  24. package/dist/kit/blueprints/index.js +20 -0
  25. package/dist/kit/blueprints/inventory.d.ts +38 -0
  26. package/dist/kit/blueprints/inventory.d.ts.map +1 -0
  27. package/dist/kit/blueprints/inventory.js +157 -0
  28. package/dist/kit/blueprints/leaderboards.d.ts +49 -0
  29. package/dist/kit/blueprints/leaderboards.d.ts.map +1 -0
  30. package/dist/kit/blueprints/leaderboards.js +126 -0
  31. package/dist/kit/blueprints/locks.d.ts +82 -0
  32. package/dist/kit/blueprints/locks.d.ts.map +1 -0
  33. package/dist/kit/blueprints/locks.js +155 -0
  34. package/dist/kit/blueprints/loot.d.ts +84 -0
  35. package/dist/kit/blueprints/loot.d.ts.map +1 -0
  36. package/dist/kit/blueprints/loot.js +228 -0
  37. package/dist/kit/blueprints/matches.d.ts +59 -0
  38. package/dist/kit/blueprints/matches.d.ts.map +1 -0
  39. package/dist/kit/blueprints/matches.js +246 -0
  40. package/dist/kit/blueprints/npcs.d.ts +71 -0
  41. package/dist/kit/blueprints/npcs.d.ts.map +1 -0
  42. package/dist/kit/blueprints/npcs.js +122 -0
  43. package/dist/kit/blueprints/plots.d.ts +54 -0
  44. package/dist/kit/blueprints/plots.d.ts.map +1 -0
  45. package/dist/kit/blueprints/plots.js +146 -0
  46. package/dist/kit/blueprints/progression.d.ts +68 -0
  47. package/dist/kit/blueprints/progression.d.ts.map +1 -0
  48. package/dist/kit/blueprints/progression.js +324 -0
  49. package/dist/kit/blueprints/quests.d.ts +65 -0
  50. package/dist/kit/blueprints/quests.d.ts.map +1 -0
  51. package/dist/kit/blueprints/quests.js +284 -0
  52. package/dist/kit/blueprints/worldsim.d.ts +84 -0
  53. package/dist/kit/blueprints/worldsim.d.ts.map +1 -0
  54. package/dist/kit/blueprints/worldsim.js +461 -0
  55. package/dist/kit/combat.d.ts +103 -0
  56. package/dist/kit/combat.d.ts.map +1 -0
  57. package/dist/kit/combat.js +151 -0
  58. package/dist/kit/decks.d.ts +123 -0
  59. package/dist/kit/decks.d.ts.map +1 -0
  60. package/dist/kit/decks.js +138 -0
  61. package/dist/kit/economy.d.ts +244 -0
  62. package/dist/kit/economy.d.ts.map +1 -0
  63. package/dist/kit/economy.js +365 -0
  64. package/dist/kit/features.d.ts +60 -0
  65. package/dist/kit/features.d.ts.map +1 -0
  66. package/dist/kit/features.js +65 -0
  67. package/dist/kit/index.d.ts +13 -2
  68. package/dist/kit/index.d.ts.map +1 -1
  69. package/dist/kit/index.js +12 -1
  70. package/dist/kit/inventory.d.ts +5 -0
  71. package/dist/kit/inventory.d.ts.map +1 -1
  72. package/dist/kit/inventory.js +14 -1
  73. package/dist/kit/kit.d.ts +58 -2
  74. package/dist/kit/kit.d.ts.map +1 -1
  75. package/dist/kit/kit.js +24 -2
  76. package/dist/kit/leaderboards.d.ts +66 -0
  77. package/dist/kit/leaderboards.d.ts.map +1 -0
  78. package/dist/kit/leaderboards.js +94 -0
  79. package/dist/kit/loot.d.ts +106 -0
  80. package/dist/kit/loot.d.ts.map +1 -0
  81. package/dist/kit/loot.js +120 -0
  82. package/dist/kit/matches.d.ts +140 -0
  83. package/dist/kit/matches.d.ts.map +1 -0
  84. package/dist/kit/matches.js +253 -0
  85. package/dist/kit/objects.js +1 -1
  86. package/dist/kit/plots.js +1 -1
  87. package/dist/kit/progression.d.ts +181 -0
  88. package/dist/kit/progression.d.ts.map +1 -0
  89. package/dist/kit/progression.js +265 -0
  90. package/dist/kit/quests.d.ts +110 -0
  91. package/dist/kit/quests.d.ts.map +1 -0
  92. package/dist/kit/quests.js +158 -0
  93. package/dist/kit/social.d.ts +267 -0
  94. package/dist/kit/social.d.ts.map +1 -0
  95. package/dist/kit/social.js +230 -0
  96. package/dist/kit/worldsim.d.ts +225 -0
  97. package/dist/kit/worldsim.d.ts.map +1 -0
  98. package/dist/kit/worldsim.js +231 -0
  99. package/dist/stores/actors.d.ts +316 -0
  100. package/dist/stores/actors.d.ts.map +1 -0
  101. package/dist/stores/actors.js +506 -0
  102. package/dist/stores/chunks.d.ts +180 -0
  103. package/dist/stores/chunks.d.ts.map +1 -0
  104. package/dist/stores/chunks.js +378 -0
  105. package/dist/stores/codec.d.ts +109 -0
  106. package/dist/stores/codec.d.ts.map +1 -0
  107. package/dist/stores/codec.js +186 -0
  108. package/dist/stores/durable.d.ts +144 -0
  109. package/dist/stores/durable.d.ts.map +1 -0
  110. package/dist/stores/durable.js +246 -0
  111. package/dist/stores/errors.d.ts +69 -0
  112. package/dist/stores/errors.d.ts.map +1 -0
  113. package/dist/stores/errors.js +87 -0
  114. package/dist/stores/inbox.d.ts +184 -0
  115. package/dist/stores/inbox.d.ts.map +1 -0
  116. package/dist/stores/inbox.js +326 -0
  117. package/dist/stores/index.d.ts +186 -0
  118. package/dist/stores/index.d.ts.map +1 -0
  119. package/dist/stores/index.js +109 -0
  120. package/dist/stores/keys.d.ts +52 -0
  121. package/dist/stores/keys.d.ts.map +1 -0
  122. package/dist/stores/keys.js +76 -0
  123. package/dist/stores/model.d.ts +81 -0
  124. package/dist/stores/model.d.ts.map +1 -0
  125. package/dist/stores/model.js +163 -0
  126. package/dist/stores/session.d.ts +119 -0
  127. package/dist/stores/session.d.ts.map +1 -0
  128. package/dist/stores/session.js +116 -0
  129. package/dist/stores/ticker.d.ts +44 -0
  130. package/dist/stores/ticker.d.ts.map +1 -0
  131. package/dist/stores/ticker.js +127 -0
  132. package/package.json +6 -1
  133. package/dist/kit/blueprints.d.ts +0 -370
  134. package/dist/kit/blueprints.d.ts.map +0 -1
  135. package/dist/kit/blueprints.js +0 -643
package/README.md CHANGED
@@ -106,7 +106,8 @@ If `managementUrl` is omitted, the SDK falls back to `httpUrl` for backwards-com
106
106
  | `client.udp` | UDP proxy subscriptions + spatial mutations (`sendActorUpdate`, `sendVoxelUpdate`, `sendAudioPacket`, `sendTextPacket`, `sendClientEvent`). |
107
107
  | `client.realtime` | Connection status, manual `connect()` / `disconnect()`, `onStatus()` listener. |
108
108
  | `client.world(appId)` | Higher-level helpers for browser games (`actor.join`, `actor.sendState`, `actor.sendText`). |
109
- | `client.kit(appId)` | Game Kit: ready-made mappings of game concepts onto the game model `kit.inventory`, `kit.objects` (lockable doors/chests with custom permissions), `kit.npcs`, `kit.plots` (buy/rent land with transactional, replication-enforced grid grants), plus blueprint builders + `kit.deploy(...)` for the admin "load the rules" step. |
109
+ | `createWorldSession(client, appId, config)` (from `@crowdedkingdoms/crowdyjs/stores`) | World Stores: opt-in, SDK-managed game state typed codecs (`structCodec` binary DSL), your own actor with a 5 Hz send loop (`session.self`), a remote-actor registry with lanes/history/staleness (`session.actors`), attributed send errors (`session.errors`), a chunk/voxel cache with realtime merge + worldgen write-back (`session.chunks`), channel/direct-message inboxes + a typed event router, host tracking, typed save/avatar state, and a game-model container mirror. Only configured stores exist (compile-time + runtime); unimported stores tree-shake away. |
110
+ | `client.kit(appId)` | Game Kit: ready-made mappings of game concepts onto the game model — `kit.inventory`, `kit.objects` (lockable doors/chests with custom permissions), `kit.npcs`, `kit.plots` (buy/rent land with transactional, replication-enforced grid grants), and the genre layers `kit.economy` (wallets/shops/trades/market), `kit.progression` (xp/skills/achievements/rating), `kit.loot`, `kit.quests`, `kit.combat`, `kit.matches` (session lobbies/turns/scores with notify-to-pull channels), `kit.decks` (hidden hands), `kit.worldsim` (clock/nodes/crops/waves), `kit.social` (parties/guilds/chat over teams+channels), `kit.leaderboards`, `kit.features` (tier gates) — plus blueprint builders + `kit.deploy(...)` for the admin "load the rules" step. |
110
111
 
111
112
  **Studio-admin surface** (privileged; drive with a server-side / studio token, grouped under `client.admin`):
112
113
 
@@ -269,6 +270,65 @@ await actor.sendToActor(
269
270
 
270
271
  The world helpers are thin wrappers over `client.udp.*` with the appId pre-bound — convenient for browser games. Advanced callers can always use `client.udp.*` with the generated GraphQL input types directly.
271
272
 
273
+ ## World Stores
274
+
275
+ The core client is a thin transport; the **World Stores** layer
276
+ (`@crowdedkingdoms/crowdyjs/stores`, 8.4+) adds the source-of-truth data
277
+ structures every game otherwise hand-writes: actor registries, chunk/voxel
278
+ caches, error attribution, message inboxes, host tracking, and typed
279
+ durable-state wrappers — all driven by ONE shared `udpNotifications`
280
+ subscription and ONE scheduler.
281
+
282
+ ```ts
283
+ import {
284
+ createWorldSession, structCodec, f32, u8, jsonCodec, workerTicker,
285
+ } from '@crowdedkingdoms/crowdyjs/stores';
286
+
287
+ // Describe your replication state ONCE (48-byte binary layouts, declaratively):
288
+ const poseCodec = structCodec({
289
+ x: f32(), y: f32(), z: f32(), yaw: f32(),
290
+ flags: u8(), held: u8(),
291
+ });
292
+
293
+ const session = createWorldSession(game, appId, {
294
+ ticker: workerTicker(), // keep 5 Hz sends even in backgrounded tabs
295
+ self: { codec: poseCodec, initialState: { x: 0, y: 0, z: 0, yaw: 0, flags: 0, held: 0 } },
296
+ actors: { codec: poseCodec, staleAfterMs: 12_000, historySize: 2 },
297
+ errors: true,
298
+ chunks: { voxelStateCodec: jsonCodec<MyVoxelMeta>() },
299
+ });
300
+
301
+ // Your actor: uuid minted + persisted, presence sent at 5 Hz with
302
+ // send-on-change dedup; just update the typed state from your game loop.
303
+ await session.self.join({ x: '0', y: '0', z: '0' });
304
+ session.self.patchState({ x: 12.5, yaw: 1.57 });
305
+ console.log(session.self.status, session.self.lastAck?.state);
306
+
307
+ // Everyone else: typed, self-filtered, staleness-managed — render from it.
308
+ for (const actor of session.actors.list()) {
309
+ render(actor.uuid, actor.state, actor.samples); // samples → interpolation
310
+ }
311
+
312
+ // Terrain: cached, hydrated, realtime-merged, optimistically editable.
313
+ await session.chunks.ensureAround({ x: 0, y: 0, z: 0 }, 3);
314
+ await session.chunks.setVoxel({ chunk: { x: 0, y: 0, z: 0 }, x: 1, y: 2, z: 3, voxelType: 7 });
315
+
316
+ // Server-reported send errors, attributed to what you sent:
317
+ session.errors.onError((e) => console.warn(e.errorCode, e.send?.kind));
318
+
319
+ session.dispose();
320
+ ```
321
+
322
+ Every store is **opt-in twice over**: only configured stores are constructed
323
+ (and only they exist on the session's TYPE — `session.host` without
324
+ `host: ...` in the config is a compile error), and the layer lives behind the
325
+ `./stores` subpath with `"sideEffects": false`, so unimported stores never
326
+ reach your bundle. Reads are synchronous snapshots and writes happen on
327
+ WebSocket events (not `requestAnimationFrame`), so render loops read freely
328
+ and a backgrounded tab keeps ingesting updates; pass `workerTicker()` to also
329
+ keep timer-driven sends at full rate while hidden. See the
330
+ [World Stores guide](https://docs.crowdedkingdoms.com/crowdyjs/stores).
331
+
272
332
  ## Game Kit
273
333
 
274
334
  `client.kit(appId)` maps traditional game concepts onto the abstract game
@@ -325,9 +385,27 @@ selector has `candidatePermissionWhere: [{ userFrom: { property: 'owner_user_id'
325
385
  op: 'lacks', key: 'access', grid: { property: 'grid_id' } }]` reacts only to
326
386
  intruders.
327
387
 
388
+ As of 8.3.0 the kit covers the common genre staples end to end — every layer
389
+ is a blueprint builder + typed runtime helper:
390
+
391
+ | Layer | Builder → helper | Highlights |
392
+ | --- | --- | --- |
393
+ | Economy | `economyBlueprint` → `kit.economy` | multi-currency wallets, atomic shop buys, escrow trades, player market, restock automation |
394
+ | Progression | `progressionBlueprint` → `kit.progression` | xp/levels via the `fn:` curve helper, skill prerequisite chains, achievements, host-gated rating |
395
+ | Loot | `lootBlueprint` → `kit.loot` | weighted tables unrolled into seed-driven expressions, atomic single-claim, event-triggered drops |
396
+ | Quests | `questsBlueprint` → `kit.quests` | event-automation progress, atomic claim into stack+wallet, cron daily resets |
397
+ | Combat | `combatBlueprint` → `kit.combat` | server-side damage/death, status-effect tick automation (selector join), `turnBased`/`hostSynced` |
398
+ | Matches | `matchesBlueprint` → `kit.matches` | session lobbies/rounds/turns/scores, per-match channel + `onMatchChanged` (notify-to-pull) |
399
+ | Decks | `decksBlueprint` → `kit.decks` | hidden hands via owner-visibility `card_id`, shuffle-by-position automation |
400
+ | World sim | `worldsimBlueprint` → `kit.worldsim` | day/night clock with spatial notify, node regen + atomic gather, crops, wave counters |
401
+ | Social | `guildBlueprint` → `kit.social` | parties/guilds/chat over teams+channels, grid territory grants, guild hall + bank composite |
402
+ | Leaderboards | `leaderboardsBlueprint` → `kit.leaderboards` | trusted keep-best submits, client-side ranking, cron seasons |
403
+ | Monetization | `featureGate` → `kit.features` | feature keys, tier grants, `*policyExtra` gating on builders |
404
+
328
405
  See the docs guides [Modeling game concepts](https://docs.crowdedkingdoms.com/game-api/modeling-game-concepts)
329
- (the underlying model) and [Game Kit](https://docs.crowdedkingdoms.com/crowdyjs/game-kit)
330
- (the SDK surface).
406
+ (the underlying model + genre map) and [Game Kit](https://docs.crowdedkingdoms.com/crowdyjs/game-kit)
407
+ (the SDK surface + the simulation-tier / notify-to-pull / timer / hidden-info
408
+ / anti-cheat patterns).
331
409
 
332
410
  ## Errors
333
411
 
@@ -1 +1 @@
1
- {"version":3,"file":"crowdy-client.d.ts","sourceRoot":"","sources":["../src/crowdy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,M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C;IACrB,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;gBAEnB,MAAM,GAAE,kBAAuB;IAuF3C,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC,0DAA0D;IAC1D,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAIjC;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa;IAQ3D,gEAAgE;IAChE,KAAK,IAAI,IAAI;CAId;AAED,wBAAgB,kBAAkB,CAChC,MAAM,GAAE,kBAAuB,GAC9B,YAAY,CAEd"}
@@ -155,7 +155,11 @@ export class CrowdyClient {
155
155
  * non-default type names/prefixes.
156
156
  */
157
157
  kit(appId, options) {
158
- return new GameKitClient(appId, this.gameModel, this.gameApps, options);
158
+ return new GameKitClient(appId, this.gameModel, this.gameApps, options, {
159
+ channels: this.channels,
160
+ teams: this.teams,
161
+ udp: this.udp,
162
+ });
159
163
  }
160
164
  /** Closes the WebSocket and clears the in-memory auth token. */
161
165
  close() {
package/dist/index.d.ts CHANGED
@@ -45,14 +45,15 @@
45
45
  * or internal tooling, never an untrusted browser.
46
46
  */
47
47
  /** The published package version. Mirrors `package.json`. */
48
- export declare const VERSION = "8.2.0";
48
+ export declare const VERSION = "8.4.0";
49
49
  export { LbCookieStore } from './lb-cookie-store.js';
50
50
  export { CrowdyClient, createCrowdyClient, type CrowdyClientConfig, } from './crowdy-client.js';
51
51
  export { BrowserLocalStorageTokenStore, SessionStore, type SessionListener, type TokenStore, } from './session.js';
52
52
  export { GraphQLClient, GraphQLTransport, type GraphQLClientConfig, } from './client.js';
53
53
  export { RealtimeClient, type RealtimeConfig, type RealtimeStatus, type SpatialNotification, type UdpNotification, type UdpNotificationHandlers, } from './realtime.js';
54
54
  export { WorldClient, ActorClient, type ActorOptions } from './world.js';
55
- export { GameKitClient, InventoryKit, NpcsKit, ObjectsKit, PlotsKit, inventoryBlueprint, inventoryNames, kitInvoke, kitPolicyJson, lockBlueprint, lockNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, plotBlueprint, plotNames, toKitInvokeResult, type GameKitOptions, type InventoryBlueprintOptions, type InventoryKitOptions, type InventoryNames, type KitAutomationSpec, type KitAutomationTriggerSpec, type KitBlueprint, type KitDeployResult, type KitInvokePolicy, type KitInvokeResult, type KitItemStack, type KitNpc, type KitPlot, type KitSelectorSpec, type LockAuthority, type LockBlueprintOptions, type LockNames, type MergedBlueprints, type NpcBehaviorSpec, type NpcBehaviorTrigger, type NpcBlueprintOptions, type NpcsKitOptions, type ObjectsKitOptions, type PlotBlueprintOptions, type PlotNames, type PlotsKitOptions, type SelectorPermissionPredicate, } from './kit/index.js';
55
+ export { CombatKit, DecksKit, EconomyKit, FeaturesKit, GameKitClient, InventoryKit, LeaderboardsKit, LootKit, MatchesKit, NpcsKit, ObjectsKit, PlotsKit, ProgressionKit, QuestsKit, SocialKit, WorldsimKit, andPolicies, combatBlueprint, combatNames, composeBlueprints, decksBlueprint, decksNames, economyBlueprint, economyCurrencyFn, economyNames, featureGate, guildBlueprint, guildNames, inventoryBlueprint, inventoryNames, kitInvoke, kitPolicyJson, leaderboardsBlueprint, leaderboardsNames, lockBlueprint, lockNames, lootBlueprint, lootNames, lootRollFn, matchesBlueprint, matchesNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, ownerEqualsCaller, ownerMirrorProperty, ownerEquals, plotBlueprint, plotNames, progressionBlueprint, progressionNames, questsBlueprint, questsNames, toKitInvokeResult, trustedAuthorityFields, worldsimBlueprint, worldsimNames, type CombatBlueprintOptions, type CombatKitOptions, type CombatNames, type DecksBlueprintOptions, type DecksKitOptions, type DecksNames, type EconomyBlueprintOptions, type EconomyKitOptions, type EconomyNames, type GameKitDomains, type GameKitOptions, type GuildBlueprintOptions, type GuildNames, type InventoryBlueprintOptions, type InventoryKitOptions, type InventoryNames, type KitAchievementDef, type KitAchievementUnlock, type KitAutomationSpec, type KitAutomationTriggerSpec, type KitBlueprint, type KitCard, type KitChatMessage, type KitCombatant, type KitCrop, type KitGroupWithChannel, type KitDeployResult, type KitInvokePolicy, type KitInvokeResult, type KitItemStack, type KitLeaderboardEntry, type KitLootRoll, type KitMarketListing, type KitMatch, type KitMatchScore, type KitNpc, type KitOwnerIdKind, type KitPlot, type KitProgress, type KitQuestDef, type KitQuestProgress, type KitResourceNode, type KitSelectorSpec, type KitShopListing, type KitSkillDef, type KitSkillRank, type KitStatusEffect, type KitTradeOffer, type KitTrustedAuthority, type KitWallet, type KitWaveSpawner, type LeaderboardsBlueprintOptions, type LeaderboardsKitOptions, type LeaderboardsNames, type KitWorldState, type LockAuthority, type LockBlueprintOptions, type LockNames, type LootBlueprintOptions, type LootDropSpec, type LootEntrySpec, type LootKitOptions, type LootNames, type LootTableSpec, type MatchesBlueprintOptions, type MatchesKitOptions, type MatchesNames, type MergedBlueprints, type NpcBehaviorSpec, type NpcBehaviorTrigger, type NpcBlueprintOptions, type NpcsKitOptions, type ObjectsKitOptions, type PlotBlueprintOptions, type PlotNames, type PlotsKitOptions, type ProgressionBlueprintOptions, type ProgressionKitOptions, type ProgressionNames, type QuestAdvanceSpec, type QuestsBlueprintOptions, type QuestsKitOptions, type QuestsNames, type SelectorPermissionPredicate, type SocialKitOptions, type WorldsimBlueprintOptions, type WorldsimKitOptions, type WorldsimNames, } from './kit/index.js';
56
+ export type { StateCodec, Ticker, WorldSession, WorldSessionConfig, WorldStoresClient, } from './stores/index.js';
56
57
  export { CrowdyError, CrowdyGraphQLError, CrowdyHttpError, CrowdyNetworkError, CrowdyProtocolError, CrowdyRealtimeError, CrowdyTimeoutError, } from './errors.js';
57
58
  export { SequenceAllocator, decodeBase64, encodeBase64, generateCrowdyUuid, validateChunkCoordinates, validateCrowdyUuid, } from './utils.js';
58
59
  export type { BigInt, ChunkCoordinates, VoxelCoordinates, ActorUpdateNotification, ActorUpdateResponse, VoxelUpdateNotification, VoxelUpdateResponse, ClientAudioNotification, ClientTextNotification, ClientEventNotification, ServerEventNotification, GenericErrorResponse, ActorUpdateHandler, ActorUpdateResponseHandler, VoxelUpdateHandler, VoxelUpdateResponseHandler, ClientAudioHandler, ClientTextHandler, ClientEventHandler, ServerEventHandler, GenericErrorHandler, UnsubscribeFn, } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,6BAA6B,EAC7B,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,KAAK,mBAAmB,GACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,uBAAuB,GAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EACL,aAAa,EACb,YAAY,EAC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EAC9B,uBAAuB,EACvB,wBAAwB,EACxB,KAAK,EACL,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,4BAA4B,EAG5B,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EAEvB,OAAO,GACR,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAEH,6DAA6D;AAC7D,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,OAA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AQ,EACR,4BAA4B,EAG5B,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,SAAS,EACT,oBAAoB,EACpB,MAAM,EACN,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EAEvB,OAAO,GACR,MAAM,wBAAwB,CAAC;AAMhC,YAAY,EACV,cAAc,EACd,cAAc,EACd,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -45,14 +45,14 @@
45
45
  * or internal tooling, never an untrusted browser.
46
46
  */
47
47
  /** The published package version. Mirrors `package.json`. */
48
- export const VERSION = '8.2.0';
48
+ export const VERSION = '8.4.0';
49
49
  export { LbCookieStore } from './lb-cookie-store.js';
50
50
  export { CrowdyClient, createCrowdyClient, } from './crowdy-client.js';
51
51
  export { BrowserLocalStorageTokenStore, SessionStore, } from './session.js';
52
52
  export { GraphQLClient, GraphQLTransport, } from './client.js';
53
53
  export { RealtimeClient, } from './realtime.js';
54
54
  export { WorldClient, ActorClient } from './world.js';
55
- export { GameKitClient, InventoryKit, NpcsKit, ObjectsKit, PlotsKit, inventoryBlueprint, inventoryNames, kitInvoke, kitPolicyJson, lockBlueprint, lockNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, plotBlueprint, plotNames, toKitInvokeResult, } from './kit/index.js';
55
+ export { CombatKit, DecksKit, EconomyKit, FeaturesKit, GameKitClient, InventoryKit, LeaderboardsKit, LootKit, MatchesKit, NpcsKit, ObjectsKit, PlotsKit, ProgressionKit, QuestsKit, SocialKit, WorldsimKit, andPolicies, combatBlueprint, combatNames, composeBlueprints, decksBlueprint, decksNames, economyBlueprint, economyCurrencyFn, economyNames, featureGate, guildBlueprint, guildNames, inventoryBlueprint, inventoryNames, kitInvoke, kitPolicyJson, leaderboardsBlueprint, leaderboardsNames, lockBlueprint, lockNames, lootBlueprint, lootNames, lootRollFn, matchesBlueprint, matchesNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, ownerEqualsCaller, ownerMirrorProperty, ownerEquals, plotBlueprint, plotNames, progressionBlueprint, progressionNames, questsBlueprint, questsNames, toKitInvokeResult, trustedAuthorityFields, worldsimBlueprint, worldsimNames, } from './kit/index.js';
56
56
  export { CrowdyError, CrowdyGraphQLError, CrowdyHttpError, CrowdyNetworkError, CrowdyProtocolError, CrowdyRealtimeError, CrowdyTimeoutError, } from './errors.js';
57
57
  export { SequenceAllocator, decodeBase64, encodeBase64, generateCrowdyUuid, validateChunkCoordinates, validateCrowdyUuid, } from './utils.js';
58
58
  export { UdpErrorCode } from './types.js';
@@ -0,0 +1,75 @@
1
+ import { type KitBlueprint, type KitOwnerIdKind } from './core.js';
2
+ /** Options for {@link combatBlueprint}. */
3
+ export interface CombatBlueprintOptions {
4
+ /** Prefix for the type/function names. Defaults to none. */
5
+ typePrefix?: string;
6
+ /**
7
+ * Turn-based mode: adds `is_current_turn` to the attack/apply_effect
8
+ * policies, so only the player whose session turn it is may act. Defaults
9
+ * to false.
10
+ */
11
+ turnBased?: boolean;
12
+ /**
13
+ * Host-synced mode for **fast** combat: adds a `sync_combatant` function
14
+ * gated `is_host` so the elected host client can run smooth per-frame
15
+ * combat on the replication plane and periodically write the durable hp
16
+ * back (the Blocks-with-Friends `mob_update` precedent, with the policy
17
+ * actually enforced). Defaults to false.
18
+ */
19
+ hostSynced?: boolean;
20
+ /**
21
+ * Interval of the status-effect tick automation, in ms (dispatcher floor
22
+ * is seconds). Defaults to 5000.
23
+ */
24
+ effectTickIntervalMs?: number;
25
+ /**
26
+ * Who may instantiate combatants: `'member'` (player characters; the
27
+ * default) or `'admin'` (studio-spawned mobs).
28
+ */
29
+ combatantInstantiableBy?: 'member' | 'admin';
30
+ /**
31
+ * When set, adds a `revive` function gated on this team/group permission
32
+ * (e.g. a healer role), usable on any downed combatant.
33
+ */
34
+ reviveGroup?: {
35
+ groupId: string;
36
+ permission?: string;
37
+ };
38
+ /** Owner-mirror typing (see the kit convention). Defaults to `'int'`. */
39
+ ownerIdKind?: KitOwnerIdKind;
40
+ }
41
+ /** Names derived by {@link combatBlueprint} for a given prefix. */
42
+ export interface CombatNames {
43
+ combatantType: string;
44
+ effectType: string;
45
+ attackFn: string;
46
+ applyEffectFn: string;
47
+ effectTickFn: string;
48
+ respawnFn: string;
49
+ reviveFn: string;
50
+ syncFn: string;
51
+ effectTickAutomation: string;
52
+ }
53
+ /** Compute the type/function names a combat blueprint (and its runtime helper) uses. */
54
+ export declare function combatNames(typePrefix?: string): CombatNames;
55
+ /**
56
+ * Blueprint for **server-authoritative combat** (the turn-based / MMO-durable
57
+ * tier): `Combatant` containers (hp / attack / defense / alive), an `attack`
58
+ * function whose damage formula and death flip run entirely server-side,
59
+ * status effects as `StatusEffect` containers ticked by an interval
60
+ * automation (damage-over-time with no client online), and respawn/revive.
61
+ *
62
+ * The effect tick uses the selector **join** pattern: each combatant carries
63
+ * a unique `combat_key`, effects record a `target_key`, and the automation's
64
+ * selector binds the matching combatant as a `$target` ref param
65
+ * (`where combat_key == self.target_key`) — automations cannot follow
66
+ * property refs directly.
67
+ *
68
+ * For fast-twitch combat keep the per-frame simulation on the replication
69
+ * plane under host authority and set `hostSynced: true` to get the
70
+ * `is_host`-gated durable sync function.
71
+ *
72
+ * Runtime counterpart: `client.kit(appId).combat`.
73
+ */
74
+ export declare function combatBlueprint(options?: CombatBlueprintOptions): KitBlueprint;
75
+ //# sourceMappingURL=combat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combat.d.ts","sourceRoot":"","sources":["../../../src/kit/blueprints/combat.ts"],"names":[],"mappings":"AAIA,OAAO,EAKL,KAAK,YAAY,EAEjB,KAAK,cAAc,EACpB,MAAM,WAAW,CAAC;AAEnB,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,uBAAuB,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC7C;;;OAGG;IACH,WAAW,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,yEAAyE;IACzE,WAAW,CAAC,EAAE,cAAc,CAAC;CAC9B;AAED,mEAAmE;AACnE,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,wFAAwF;AACxF,wBAAgB,WAAW,CAAC,UAAU,SAAK,GAAG,WAAW,CAaxD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,YAAY,CAmVlF"}
@@ -0,0 +1,351 @@
1
+ import { kitPolicyJson, ownerMirrorProperty, toSnakeCase, } from './core.js';
2
+ /** Compute the type/function names a combat blueprint (and its runtime helper) uses. */
3
+ export function combatNames(typePrefix = '') {
4
+ const fnPrefix = typePrefix ? `${toSnakeCase(typePrefix)}_` : '';
5
+ return {
6
+ combatantType: `${typePrefix}Combatant`,
7
+ effectType: `${typePrefix}StatusEffect`,
8
+ attackFn: `${fnPrefix}attack`,
9
+ applyEffectFn: `${fnPrefix}apply_effect`,
10
+ effectTickFn: `${fnPrefix}effect_tick`,
11
+ respawnFn: `${fnPrefix}respawn`,
12
+ reviveFn: `${fnPrefix}revive`,
13
+ syncFn: `${fnPrefix}sync_combatant`,
14
+ effectTickAutomation: `${fnPrefix.replace(/_/g, '-')}effect-tick`,
15
+ };
16
+ }
17
+ /**
18
+ * Blueprint for **server-authoritative combat** (the turn-based / MMO-durable
19
+ * tier): `Combatant` containers (hp / attack / defense / alive), an `attack`
20
+ * function whose damage formula and death flip run entirely server-side,
21
+ * status effects as `StatusEffect` containers ticked by an interval
22
+ * automation (damage-over-time with no client online), and respawn/revive.
23
+ *
24
+ * The effect tick uses the selector **join** pattern: each combatant carries
25
+ * a unique `combat_key`, effects record a `target_key`, and the automation's
26
+ * selector binds the matching combatant as a `$target` ref param
27
+ * (`where combat_key == self.target_key`) — automations cannot follow
28
+ * property refs directly.
29
+ *
30
+ * For fast-twitch combat keep the per-frame simulation on the replication
31
+ * plane under host authority and set `hostSynced: true` to get the
32
+ * `is_host`-gated durable sync function.
33
+ *
34
+ * Runtime counterpart: `client.kit(appId).combat`.
35
+ */
36
+ export function combatBlueprint(options = {}) {
37
+ const { typePrefix = '', turnBased = false, hostSynced = false, effectTickIntervalMs = 5000, combatantInstantiableBy = 'member', reviveGroup, ownerIdKind: kind = 'int', } = options;
38
+ const names = combatNames(typePrefix);
39
+ const actorPolicy = (condition) => {
40
+ const rules = [
41
+ { type: 'owner_of_self' },
42
+ ...(turnBased ? [{ type: 'is_current_turn' }] : []),
43
+ { type: 'condition', expression: condition },
44
+ ];
45
+ return kitPolicyJson({ type: 'and', rules });
46
+ };
47
+ const propertyDefinitions = [
48
+ ownerMirrorProperty(names.combatantType, kind),
49
+ {
50
+ containerTypeName: names.combatantType,
51
+ key: 'combat_key',
52
+ valueType: 'string',
53
+ defaultValueJson: '""',
54
+ description: 'Unique join key the status-effect automation selector matches against effect target_key.',
55
+ },
56
+ {
57
+ containerTypeName: names.combatantType,
58
+ key: 'hp',
59
+ valueType: 'int',
60
+ defaultValueJson: '100',
61
+ description: 'Current hit points (never below 0).',
62
+ },
63
+ {
64
+ containerTypeName: names.combatantType,
65
+ key: 'max_hp',
66
+ valueType: 'int',
67
+ defaultValueJson: '100',
68
+ description: 'Hit point ceiling (respawn/heal target).',
69
+ },
70
+ {
71
+ containerTypeName: names.combatantType,
72
+ key: 'attack',
73
+ valueType: 'int',
74
+ defaultValueJson: '10',
75
+ description: 'Attack stat fed into the damage formula.',
76
+ },
77
+ {
78
+ containerTypeName: names.combatantType,
79
+ key: 'defense',
80
+ valueType: 'int',
81
+ defaultValueJson: '0',
82
+ description: 'Damage reduction stat.',
83
+ },
84
+ {
85
+ containerTypeName: names.combatantType,
86
+ key: 'alive',
87
+ valueType: 'bool',
88
+ defaultValueJson: 'true',
89
+ description: 'Flipped server-side when hp reaches 0.',
90
+ },
91
+ {
92
+ containerTypeName: names.combatantType,
93
+ key: 'respawn_x',
94
+ valueType: 'float',
95
+ defaultValueJson: '0',
96
+ description: 'Respawn anchor (informational; movement is the replication plane).',
97
+ },
98
+ {
99
+ containerTypeName: names.combatantType,
100
+ key: 'respawn_y',
101
+ valueType: 'float',
102
+ defaultValueJson: '0',
103
+ description: 'Respawn anchor.',
104
+ },
105
+ {
106
+ containerTypeName: names.combatantType,
107
+ key: 'respawn_z',
108
+ valueType: 'float',
109
+ defaultValueJson: '0',
110
+ description: 'Respawn anchor.',
111
+ },
112
+ ownerMirrorProperty(names.effectType, kind),
113
+ {
114
+ containerTypeName: names.effectType,
115
+ key: 'effect_id',
116
+ valueType: 'string',
117
+ defaultValueJson: '""',
118
+ description: "Effect identifier (e.g. 'poison', 'burn').",
119
+ },
120
+ {
121
+ containerTypeName: names.effectType,
122
+ key: 'target_key',
123
+ valueType: 'string',
124
+ defaultValueJson: '""',
125
+ description: "The target combatant's combat_key (selector join key).",
126
+ },
127
+ {
128
+ containerTypeName: names.effectType,
129
+ key: 'magnitude',
130
+ valueType: 'int',
131
+ defaultValueJson: '0',
132
+ description: 'Damage applied per tick.',
133
+ },
134
+ {
135
+ containerTypeName: names.effectType,
136
+ key: 'ticks_left',
137
+ valueType: 'int',
138
+ defaultValueJson: '0',
139
+ description: 'Remaining ticks; the automation only selects effects above 0.',
140
+ },
141
+ ];
142
+ const functions = [
143
+ {
144
+ name: names.attackFn,
145
+ containerTypeName: names.combatantType,
146
+ returnType: 'int',
147
+ parameters: [
148
+ {
149
+ name: 'target_id',
150
+ valueType: 'container_ref',
151
+ required: true,
152
+ description: 'The combatant being attacked.',
153
+ },
154
+ ],
155
+ mutations: [
156
+ {
157
+ target: 'ref($target_id)',
158
+ property: 'hp',
159
+ expression: 'max(0, ref($target_id).hp - max(1, self.attack - ref($target_id).defense))',
160
+ },
161
+ {
162
+ target: 'ref($target_id)',
163
+ property: 'alive',
164
+ expression: 'ref($target_id).hp > 0',
165
+ },
166
+ ],
167
+ returnExpression: 'ref($target_id).hp',
168
+ invokePolicyJson: actorPolicy('self.alive && ref($target_id).alive'),
169
+ description: 'Attack a target: the damage formula (attack vs defense, min 1) and the death flip run server-side in one transaction.',
170
+ },
171
+ {
172
+ name: names.applyEffectFn,
173
+ containerTypeName: names.effectType,
174
+ returnType: 'int',
175
+ parameters: [
176
+ {
177
+ name: 'target_key',
178
+ valueType: 'string',
179
+ required: true,
180
+ description: "The target combatant's combat_key.",
181
+ },
182
+ {
183
+ name: 'effect_id',
184
+ valueType: 'string',
185
+ required: true,
186
+ description: 'Effect identifier.',
187
+ },
188
+ {
189
+ name: 'magnitude',
190
+ valueType: 'int',
191
+ required: true,
192
+ description: 'Damage per tick.',
193
+ },
194
+ {
195
+ name: 'ticks',
196
+ valueType: 'int',
197
+ required: true,
198
+ description: 'Number of ticks the effect lasts.',
199
+ },
200
+ ],
201
+ mutations: [
202
+ { target: 'self', property: 'effect_id', expression: '$effect_id' },
203
+ { target: 'self', property: 'target_key', expression: '$target_key' },
204
+ { target: 'self', property: 'magnitude', expression: 'max(0, $magnitude)' },
205
+ { target: 'self', property: 'ticks_left', expression: '$ticks' },
206
+ ],
207
+ returnExpression: 'self.ticks_left',
208
+ invokePolicyJson: actorPolicy('$ticks > 0 && self.ticks_left == 0'),
209
+ description: 'Arm a status effect against a target combat_key; the interval automation applies it tick by tick.',
210
+ },
211
+ {
212
+ name: names.effectTickFn,
213
+ containerTypeName: names.effectType,
214
+ returnType: 'int',
215
+ parameters: [
216
+ {
217
+ name: 'target',
218
+ valueType: 'container_ref',
219
+ required: true,
220
+ description: 'The affected combatant — bound by the automation selector join (combat_key == target_key).',
221
+ },
222
+ ],
223
+ mutations: [
224
+ {
225
+ target: 'ref($target)',
226
+ property: 'hp',
227
+ expression: 'max(0, ref($target).hp - self.magnitude)',
228
+ },
229
+ {
230
+ target: 'ref($target)',
231
+ property: 'alive',
232
+ expression: 'ref($target).hp > 0',
233
+ },
234
+ {
235
+ target: 'self',
236
+ property: 'ticks_left',
237
+ expression: 'self.ticks_left - 1',
238
+ },
239
+ ],
240
+ returnExpression: 'self.ticks_left',
241
+ invokePolicyJson: kitPolicyJson({ type: 'is_automation' }),
242
+ autonomousInvocable: true,
243
+ description: 'Server-driven damage-over-time tick (automation-only): applies magnitude to the joined target and decrements ticks_left.',
244
+ },
245
+ {
246
+ name: names.respawnFn,
247
+ containerTypeName: names.combatantType,
248
+ returnType: 'int',
249
+ mutations: [
250
+ { target: 'self', property: 'hp', expression: 'self.max_hp' },
251
+ { target: 'self', property: 'alive', expression: 'true' },
252
+ ],
253
+ returnExpression: 'self.hp',
254
+ invokePolicyJson: kitPolicyJson({
255
+ type: 'and',
256
+ rules: [
257
+ { type: 'owner_of_self' },
258
+ { type: 'condition', expression: 'not(self.alive)' },
259
+ ],
260
+ }),
261
+ description: 'Respawn your downed combatant at full hp (move the actor to the respawn anchor client-side).',
262
+ },
263
+ ];
264
+ if (reviveGroup) {
265
+ functions.push({
266
+ name: names.reviveFn,
267
+ containerTypeName: names.combatantType,
268
+ returnType: 'int',
269
+ mutations: [
270
+ { target: 'self', property: 'hp', expression: 'self.max_hp' },
271
+ { target: 'self', property: 'alive', expression: 'true' },
272
+ ],
273
+ returnExpression: 'self.hp',
274
+ invokePolicyJson: kitPolicyJson({
275
+ type: 'and',
276
+ rules: [
277
+ {
278
+ type: 'group_permission',
279
+ groupId: reviveGroup.groupId,
280
+ ...(reviveGroup.permission !== undefined
281
+ ? { permission: reviveGroup.permission }
282
+ : {}),
283
+ },
284
+ { type: 'condition', expression: 'not(self.alive)' },
285
+ ],
286
+ }),
287
+ description: 'Revive any downed combatant (team/group-permission gated).',
288
+ });
289
+ }
290
+ if (hostSynced) {
291
+ functions.push({
292
+ name: names.syncFn,
293
+ containerTypeName: names.combatantType,
294
+ returnType: 'int',
295
+ parameters: [
296
+ {
297
+ name: 'hp',
298
+ valueType: 'int',
299
+ required: true,
300
+ description: 'The host-simulated hp to persist (clamped to 0..max_hp).',
301
+ },
302
+ ],
303
+ mutations: [
304
+ { target: 'self', property: 'hp', expression: 'clamp($hp, 0, self.max_hp)' },
305
+ { target: 'self', property: 'alive', expression: 'self.hp > 0' },
306
+ ],
307
+ returnExpression: 'self.hp',
308
+ invokePolicyJson: kitPolicyJson({ type: 'is_host' }),
309
+ description: 'Persist host-simulated combat state (is_host enforced): the fast tier runs on the replication plane, durable hp syncs here at low frequency.',
310
+ });
311
+ }
312
+ const automations = [
313
+ {
314
+ name: names.effectTickAutomation,
315
+ functionName: names.effectTickFn,
316
+ targetMode: 'type',
317
+ targetTypeName: names.effectType,
318
+ triggerType: 'schedule',
319
+ scheduleKind: 'interval',
320
+ intervalMs: effectTickIntervalMs,
321
+ maxTargets: 32,
322
+ selectorJson: JSON.stringify({
323
+ selfWhere: [{ key: 'ticks_left', op: '>', value: 0 }],
324
+ ofType: names.combatantType,
325
+ where: [{ key: 'combat_key', op: '==', value: 'self.target_key' }],
326
+ bindAs: { ref: 'target' },
327
+ }),
328
+ description: 'Ticks active status effects: joins each effect to its target combatant and applies damage-over-time.',
329
+ },
330
+ ];
331
+ return {
332
+ name: names.combatantType,
333
+ containerTypes: [
334
+ {
335
+ typeName: names.combatantType,
336
+ displayName: names.combatantType,
337
+ instantiableBy: combatantInstantiableBy,
338
+ description: 'A combat participant with server-authoritative hp/stats.',
339
+ },
340
+ {
341
+ typeName: names.effectType,
342
+ displayName: names.effectType,
343
+ instantiableBy: 'member',
344
+ description: 'An armed status effect ticked by the server automation.',
345
+ },
346
+ ],
347
+ propertyDefinitions,
348
+ functions,
349
+ automations,
350
+ };
351
+ }