@crowdedkingdoms/crowdyjs 18.11.0-dev.1 → 18.12.0-dev.1
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/MIGRATION.md +26 -0
- package/README.md +12 -0
- package/dist/generated/graphql-schema.d.ts +2 -2
- package/dist/generated/graphql-schema.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/kit/index.d.ts +9 -0
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +9 -0
- package/dist/kit/kit.d.ts +60 -2
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +58 -2
- package/dist/kit/modules/arenas.d.ts +87 -0
- package/dist/kit/modules/arenas.d.ts.map +1 -0
- package/dist/kit/modules/arenas.js +66 -0
- package/dist/kit/modules/encounters.d.ts +75 -0
- package/dist/kit/modules/encounters.d.ts.map +1 -0
- package/dist/kit/modules/encounters.js +57 -0
- package/dist/kit/modules/instances.d.ts +78 -0
- package/dist/kit/modules/instances.d.ts.map +1 -0
- package/dist/kit/modules/instances.js +72 -0
- package/dist/kit/modules/leaderboards.d.ts +79 -0
- package/dist/kit/modules/leaderboards.d.ts.map +1 -0
- package/dist/kit/modules/leaderboards.js +69 -0
- package/dist/kit/modules/minigames.d.ts +59 -0
- package/dist/kit/modules/minigames.d.ts.map +1 -0
- package/dist/kit/modules/minigames.js +55 -0
- package/dist/kit/modules/racing.d.ts +131 -0
- package/dist/kit/modules/racing.d.ts.map +1 -0
- package/dist/kit/modules/racing.js +113 -0
- package/dist/kit/modules/tables.d.ts +76 -0
- package/dist/kit/modules/tables.d.ts.map +1 -0
- package/dist/kit/modules/tables.js +73 -0
- package/dist/kit/modules/tactics.d.ts +79 -0
- package/dist/kit/modules/tactics.d.ts.map +1 -0
- package/dist/kit/modules/tactics.js +67 -0
- package/dist/kit/modules/territory.d.ts +92 -0
- package/dist/kit/modules/territory.d.ts.map +1 -0
- package/dist/kit/modules/territory.js +84 -0
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +3302 -145
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* never an untrusted browser.
|
|
47
47
|
*/
|
|
48
48
|
/** The published package version. Mirrors `package.json`. */
|
|
49
|
-
export declare const VERSION = "18.
|
|
49
|
+
export declare const VERSION = "18.12.0-dev.1";
|
|
50
50
|
export { LbCookieStore } from './lb-cookie-store.js';
|
|
51
51
|
export { CrowdyClient, createCrowdyClient, type CrowdyClientConfig, } from './crowdy-client.js';
|
|
52
52
|
export { CROWDY_DEFAULT_TIER, CROWDY_DEFAULT_HOST, CROWDY_DEFAULT_HTTP_ORIGIN, CROWDY_DEFAULT_WS_ORIGIN, } from './default-origin.js';
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* never an untrusted browser.
|
|
47
47
|
*/
|
|
48
48
|
/** The published package version. Mirrors `package.json`. */
|
|
49
|
-
export const VERSION = '18.
|
|
49
|
+
export const VERSION = '18.12.0-dev.1';
|
|
50
50
|
export { LbCookieStore } from './lb-cookie-store.js';
|
|
51
51
|
export { CrowdyClient, createCrowdyClient, } from './crowdy-client.js';
|
|
52
52
|
// The tier this build defaults to, exported so a consumer can PRINT what it is
|
package/dist/kit/index.d.ts
CHANGED
|
@@ -13,4 +13,13 @@ export { NpcArea, NpcsKit, type KitPetView, type NpcsKitOptions } from './module
|
|
|
13
13
|
export { EmotesKit, SpectateKit, SpectatorHeartbeat, type EmoteSend, type KitChunk, type SpectateOptions, } from './modules/presence.js';
|
|
14
14
|
export { EVENT_ABILITY, EVENT_APP_FIRST, EVENT_CONTACT_DAMAGE, EVENT_CONTROL_POINT, EVENT_EMOTE, EVENT_ENCOUNTER, EVENT_MOVEMENT_VIOLATION, EVENT_POSSESSION, EVENT_PROPOSAL, EVENT_RACE_TIMING, EVENT_SCORE, EVENT_TURN, EVENT_WEATHER, EVENT_ZONE_CHANGE, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseAbilityEvent, parseContactDamage, parseControlPointEvent, parseEmoteEvent, parseEncounterEvent, parseEngineEvent, parseMovementViolation, parsePossessionEvent, parseProposalEvent, parseRaceTimingEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, parseZoneChangeEvent, poseSuffix, type AbilityEvent, type ContactDamageEvent, type ControlPointEvent, type EmoteEvent, type EncounterEvent, type EnginePose, type MovementViolationEvent, type PossessionEvent, type ProposalEvent, type RaceTimingEvent, type ScoreEvent, type TurnEvent, type WeatherEvent, type ZoneChangeEvent, } from './wire.js';
|
|
15
15
|
export { SocialKit, type KitChatMessage, type KitGroupWithChannel, type SocialKitOptions, } from './social.js';
|
|
16
|
+
export { LeaderboardHandle, LeaderboardsKit, type LeaderboardConfig, type LeaderboardRank, type LeaderboardSeason, type LeaderboardView, } from './modules/leaderboards.js';
|
|
17
|
+
export { CardTable, TablesKit, type CardHand, type CardPlayed, type CardTableView } from './modules/tables.js';
|
|
18
|
+
export { TacticsBattle, TacticsKit, type TacticsBattleView, type TacticsUnit, type TacticsUnitStats, } from './modules/tactics.js';
|
|
19
|
+
export { Encounter, EncountersKit, type EncounterEnemy, type EncounterTower, type EncounterView, } from './modules/encounters.js';
|
|
20
|
+
export { Duel, MinigamesKit, type DuelReveal, type DuelSeat, type DuelView } from './modules/minigames.js';
|
|
21
|
+
export { InstanceRun, InstancesKit, type InstanceMember, type InstanceRoom, type InstanceRunView, } from './modules/instances.js';
|
|
22
|
+
export { ArenaMatch, ArenasKit, type ArenaBlast, type ArenaFighter, type ArenaShot, type ArenaView, } from './modules/arenas.js';
|
|
23
|
+
export { BallMatch, Race, RacingKit, type BallPlayer, type BallState, type BallView, type RaceGate, type RaceGhost, type RaceRacer, type RaceView, } from './modules/racing.js';
|
|
24
|
+
export { TerritoryKit, TerritoryMap, ZoneMatch, type TerritoryPoint, type TerritoryView, type ZoneContender, type ZoneView, } from './modules/territory.js';
|
|
16
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/kit/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EACf,eAAe,EACf,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EACL,gBAAgB,EAChB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,cAAc,EACd,mBAAmB,E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eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,aAAa,EACb,QAAQ,EACR,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,mBAAmB,EACnB,QAAQ,EACR,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,WAAW,EACX,QAAQ,EACR,eAAe,EACf,eAAe,EACf,YAAY,EACZ,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,qBAAqB,EACrB,UAAU,EACV,KAAK,cAAc,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EACV,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EACL,WAAW,EACX,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,UAAU,EACV,SAAS,EACT,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,GACf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,IAAI,EACJ,SAAS,EACT,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,QAAQ,GACd,MAAM,wBAAwB,CAAC"}
|
package/dist/kit/index.js
CHANGED
|
@@ -13,3 +13,12 @@ export { NpcArea, NpcsKit } from './modules/npcs.js';
|
|
|
13
13
|
export { EmotesKit, SpectateKit, SpectatorHeartbeat, } from './modules/presence.js';
|
|
14
14
|
export { EVENT_ABILITY, EVENT_APP_FIRST, EVENT_CONTACT_DAMAGE, EVENT_CONTROL_POINT, EVENT_EMOTE, EVENT_ENCOUNTER, EVENT_MOVEMENT_VIOLATION, EVENT_POSSESSION, EVENT_PROPOSAL, EVENT_RACE_TIMING, EVENT_SCORE, EVENT_TURN, EVENT_WEATHER, EVENT_ZONE_CHANGE, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseAbilityEvent, parseContactDamage, parseControlPointEvent, parseEmoteEvent, parseEncounterEvent, parseEngineEvent, parseMovementViolation, parsePossessionEvent, parseProposalEvent, parseRaceTimingEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, parseZoneChangeEvent, poseSuffix, } from './wire.js';
|
|
15
15
|
export { SocialKit, } from './social.js';
|
|
16
|
+
export { LeaderboardHandle, LeaderboardsKit, } from './modules/leaderboards.js';
|
|
17
|
+
export { CardTable, TablesKit } from './modules/tables.js';
|
|
18
|
+
export { TacticsBattle, TacticsKit, } from './modules/tactics.js';
|
|
19
|
+
export { Encounter, EncountersKit, } from './modules/encounters.js';
|
|
20
|
+
export { Duel, MinigamesKit } from './modules/minigames.js';
|
|
21
|
+
export { InstanceRun, InstancesKit, } from './modules/instances.js';
|
|
22
|
+
export { ArenaMatch, ArenasKit, } from './modules/arenas.js';
|
|
23
|
+
export { BallMatch, Race, RacingKit, } from './modules/racing.js';
|
|
24
|
+
export { TerritoryKit, TerritoryMap, ZoneMatch, } from './modules/territory.js';
|
package/dist/kit/kit.d.ts
CHANGED
|
@@ -4,10 +4,19 @@ import type { GameAppsAPI } from '../domains/gameApps.js';
|
|
|
4
4
|
import type { TeamsAPI } from '../domains/teams.js';
|
|
5
5
|
import type { UdpAPI } from '../domains/udp.js';
|
|
6
6
|
import type { Scalars } from '../generated/graphql.js';
|
|
7
|
+
import { ArenasKit } from './modules/arenas.js';
|
|
8
|
+
import { EncountersKit } from './modules/encounters.js';
|
|
9
|
+
import { InstancesKit } from './modules/instances.js';
|
|
10
|
+
import { LeaderboardsKit } from './modules/leaderboards.js';
|
|
7
11
|
import { MatchmakingKit } from './modules/matchmaking.js';
|
|
12
|
+
import { MinigamesKit } from './modules/minigames.js';
|
|
8
13
|
import { NpcsKit } from './modules/npcs.js';
|
|
9
14
|
import { EmotesKit, SpectateKit } from './modules/presence.js';
|
|
15
|
+
import { RacingKit } from './modules/racing.js';
|
|
10
16
|
import { SessionsKit } from './modules/sessions.js';
|
|
17
|
+
import { TablesKit } from './modules/tables.js';
|
|
18
|
+
import { TacticsKit } from './modules/tactics.js';
|
|
19
|
+
import { TerritoryKit } from './modules/territory.js';
|
|
11
20
|
import { WorldKit } from './modules/world.js';
|
|
12
21
|
import { KitRuntime, type KitRuntimeOptions } from './runtime.js';
|
|
13
22
|
import { SocialKit, type SocialKitOptions } from './social.js';
|
|
@@ -25,6 +34,26 @@ export interface GameKitNodeTypes {
|
|
|
25
34
|
session?: string;
|
|
26
35
|
/** Areas of mobs, NPCs and pets (`npcs`). */
|
|
27
36
|
npcs?: string;
|
|
37
|
+
/** Leaderboards (`leaderboard`). */
|
|
38
|
+
leaderboard?: string;
|
|
39
|
+
/** Card tables (`deck`). */
|
|
40
|
+
deck?: string;
|
|
41
|
+
/** Grid battles (`tactics`). */
|
|
42
|
+
tactics?: string;
|
|
43
|
+
/** Waves and bosses (`director`). */
|
|
44
|
+
director?: string;
|
|
45
|
+
/** Duels (`minigame`). */
|
|
46
|
+
minigame?: string;
|
|
47
|
+
/** Private runs (`instance`). */
|
|
48
|
+
instance?: string;
|
|
49
|
+
/** Arenas (`arena`). */
|
|
50
|
+
arena?: string;
|
|
51
|
+
/** Races (`race`) and ball games (`ball`). */
|
|
52
|
+
race?: string;
|
|
53
|
+
ball?: string;
|
|
54
|
+
/** Control points (`territory`) and shrinking circles (`zone`). */
|
|
55
|
+
territory?: string;
|
|
56
|
+
zone?: string;
|
|
28
57
|
}
|
|
29
58
|
/** Options for {@link GameKitClient}. */
|
|
30
59
|
export interface GameKitOptions extends KitRuntimeOptions {
|
|
@@ -58,8 +87,10 @@ export declare class ShardKit {
|
|
|
58
87
|
/**
|
|
59
88
|
* The app-scoped **Game Kit** that `client.kit(appId)` returns: typed clients for the ck-exec
|
|
60
89
|
* starter hubs (the root {@link world} with liveops, {@link matchmaking} queues with parties,
|
|
61
|
-
* game {@link sessions}, areas of {@link npcs} with mobs and pets
|
|
62
|
-
*
|
|
90
|
+
* game {@link sessions}, areas of {@link npcs} with mobs and pets, {@link leaderboards}, card
|
|
91
|
+
* {@link tables}, {@link tactics} battles, {@link encounters}, {@link minigames}, private
|
|
92
|
+
* {@link instances}, {@link arenas}, {@link racing}, {@link territory}), the {@link topology}
|
|
93
|
+
* that deploys them, the client-side conventions ({@link spectate}, {@link emotes},
|
|
63
94
|
* {@link shards}), and {@link social} (parties, guilds, chat over teams and channels).
|
|
64
95
|
*
|
|
65
96
|
* The hub modules share one connection ({@link runtime}), opened when first needed, which
|
|
@@ -84,6 +115,15 @@ export declare class GameKitClient {
|
|
|
84
115
|
private spectateKit;
|
|
85
116
|
private emotesKit;
|
|
86
117
|
private shardKit;
|
|
118
|
+
private leaderboardsKit;
|
|
119
|
+
private tablesKit;
|
|
120
|
+
private tacticsKit;
|
|
121
|
+
private encountersKit;
|
|
122
|
+
private minigamesKit;
|
|
123
|
+
private instancesKit;
|
|
124
|
+
private arenasKit;
|
|
125
|
+
private racingKit;
|
|
126
|
+
private territoryKit;
|
|
87
127
|
constructor(appId: Scalars['BigInt']['input'], gameApps: GameAppsAPI, options?: GameKitOptions, domains?: GameKitDomains);
|
|
88
128
|
/** The root world hub: conditions, resource nodes, liveops. */
|
|
89
129
|
get world(): WorldKit;
|
|
@@ -93,6 +133,24 @@ export declare class GameKitClient {
|
|
|
93
133
|
get sessions(): SessionsKit;
|
|
94
134
|
/** Areas of mobs, NPCs and players' pets. */
|
|
95
135
|
get npcs(): NpcsKit;
|
|
136
|
+
/** Leaderboards the hubs rank (a client never submits its own score). */
|
|
137
|
+
get leaderboards(): LeaderboardsKit;
|
|
138
|
+
/** Card tables with hidden hands the hub holds. */
|
|
139
|
+
get tables(): TablesKit;
|
|
140
|
+
/** Grid battles in turns, against the hub's units. */
|
|
141
|
+
get tactics(): TacticsKit;
|
|
142
|
+
/** Encounters: waves down a lane, towers, a boss with phases. */
|
|
143
|
+
get encounters(): EncountersKit;
|
|
144
|
+
/** Duels of hidden throws, revealed together. */
|
|
145
|
+
get minigames(): MinigamesKit;
|
|
146
|
+
/** Private runs for one party: seeded floors, permadeath, expiry. */
|
|
147
|
+
get instances(): InstancesKit;
|
|
148
|
+
/** Real-time arenas: classes, abilities, the hub's referee. */
|
|
149
|
+
get arenas(): ArenasKit;
|
|
150
|
+
/** Races and ball games, on positions the hub's warden keeps. */
|
|
151
|
+
get racing(): RacingKit;
|
|
152
|
+
/** Control points factions capture, and shrinking circles. */
|
|
153
|
+
get territory(): TerritoryKit;
|
|
96
154
|
/** Composing and deploying the app's tree of starter hubs (developers). */
|
|
97
155
|
get topology(): KitTopology;
|
|
98
156
|
/** Keeping a viewer with no avatar where the world's messages reach it. */
|
package/dist/kit/kit.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../src/kit/kit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,cAAc,EAA8B,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAE,OAAO,EAAuB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAA2B,MAAM,uB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it.js
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { ArenasKit } from './modules/arenas.js';
|
|
2
|
+
import { EncountersKit } from './modules/encounters.js';
|
|
3
|
+
import { InstancesKit } from './modules/instances.js';
|
|
4
|
+
import { LeaderboardsKit } from './modules/leaderboards.js';
|
|
1
5
|
import { MatchmakingKit } from './modules/matchmaking.js';
|
|
6
|
+
import { MinigamesKit } from './modules/minigames.js';
|
|
2
7
|
import { NpcsKit } from './modules/npcs.js';
|
|
3
8
|
import { EmotesKit, SpectateKit } from './modules/presence.js';
|
|
9
|
+
import { RacingKit } from './modules/racing.js';
|
|
4
10
|
import { SessionsKit } from './modules/sessions.js';
|
|
11
|
+
import { TablesKit } from './modules/tables.js';
|
|
12
|
+
import { TacticsKit } from './modules/tactics.js';
|
|
13
|
+
import { TerritoryKit } from './modules/territory.js';
|
|
5
14
|
import { WorldKit } from './modules/world.js';
|
|
6
15
|
import { shardKey, shardKeysAround } from './protocol.js';
|
|
7
16
|
import { KitRuntime } from './runtime.js';
|
|
@@ -21,8 +30,10 @@ export class ShardKit {
|
|
|
21
30
|
/**
|
|
22
31
|
* The app-scoped **Game Kit** that `client.kit(appId)` returns: typed clients for the ck-exec
|
|
23
32
|
* starter hubs (the root {@link world} with liveops, {@link matchmaking} queues with parties,
|
|
24
|
-
* game {@link sessions}, areas of {@link npcs} with mobs and pets
|
|
25
|
-
*
|
|
33
|
+
* game {@link sessions}, areas of {@link npcs} with mobs and pets, {@link leaderboards}, card
|
|
34
|
+
* {@link tables}, {@link tactics} battles, {@link encounters}, {@link minigames}, private
|
|
35
|
+
* {@link instances}, {@link arenas}, {@link racing}, {@link territory}), the {@link topology}
|
|
36
|
+
* that deploys them, the client-side conventions ({@link spectate}, {@link emotes},
|
|
26
37
|
* {@link shards}), and {@link social} (parties, guilds, chat over teams and channels).
|
|
27
38
|
*
|
|
28
39
|
* The hub modules share one connection ({@link runtime}), opened when first needed, which
|
|
@@ -44,6 +55,15 @@ export class GameKitClient {
|
|
|
44
55
|
this.spectateKit = null;
|
|
45
56
|
this.emotesKit = null;
|
|
46
57
|
this.shardKit = null;
|
|
58
|
+
this.leaderboardsKit = null;
|
|
59
|
+
this.tablesKit = null;
|
|
60
|
+
this.tacticsKit = null;
|
|
61
|
+
this.encountersKit = null;
|
|
62
|
+
this.minigamesKit = null;
|
|
63
|
+
this.instancesKit = null;
|
|
64
|
+
this.arenasKit = null;
|
|
65
|
+
this.racingKit = null;
|
|
66
|
+
this.territoryKit = null;
|
|
47
67
|
this.social = new SocialKit(appId, domains.teams, domains.channels, domains.udp, gameApps, options.social);
|
|
48
68
|
this.runtime = new KitRuntime(String(appId), domains.exec, options, domains.whoAmI);
|
|
49
69
|
}
|
|
@@ -67,6 +87,42 @@ export class GameKitClient {
|
|
|
67
87
|
const opts = { nodeType: this.options.nodes?.npcs, areaSize: this.options.areaSize };
|
|
68
88
|
return (this.npcsKit ?? (this.npcsKit = new NpcsKit(this.runtime, opts)));
|
|
69
89
|
}
|
|
90
|
+
/** Leaderboards the hubs rank (a client never submits its own score). */
|
|
91
|
+
get leaderboards() {
|
|
92
|
+
return (this.leaderboardsKit ?? (this.leaderboardsKit = new LeaderboardsKit(this.runtime, this.options.nodes?.leaderboard)));
|
|
93
|
+
}
|
|
94
|
+
/** Card tables with hidden hands the hub holds. */
|
|
95
|
+
get tables() {
|
|
96
|
+
return (this.tablesKit ?? (this.tablesKit = new TablesKit(this.runtime, this.options.nodes?.deck)));
|
|
97
|
+
}
|
|
98
|
+
/** Grid battles in turns, against the hub's units. */
|
|
99
|
+
get tactics() {
|
|
100
|
+
return (this.tacticsKit ?? (this.tacticsKit = new TacticsKit(this.runtime, this.options.nodes?.tactics)));
|
|
101
|
+
}
|
|
102
|
+
/** Encounters: waves down a lane, towers, a boss with phases. */
|
|
103
|
+
get encounters() {
|
|
104
|
+
return (this.encountersKit ?? (this.encountersKit = new EncountersKit(this.runtime, this.options.nodes?.director)));
|
|
105
|
+
}
|
|
106
|
+
/** Duels of hidden throws, revealed together. */
|
|
107
|
+
get minigames() {
|
|
108
|
+
return (this.minigamesKit ?? (this.minigamesKit = new MinigamesKit(this.runtime, this.options.nodes?.minigame)));
|
|
109
|
+
}
|
|
110
|
+
/** Private runs for one party: seeded floors, permadeath, expiry. */
|
|
111
|
+
get instances() {
|
|
112
|
+
return (this.instancesKit ?? (this.instancesKit = new InstancesKit(this.runtime, this.options.nodes?.instance)));
|
|
113
|
+
}
|
|
114
|
+
/** Real-time arenas: classes, abilities, the hub's referee. */
|
|
115
|
+
get arenas() {
|
|
116
|
+
return (this.arenasKit ?? (this.arenasKit = new ArenasKit(this.runtime, this.options.nodes?.arena)));
|
|
117
|
+
}
|
|
118
|
+
/** Races and ball games, on positions the hub's warden keeps. */
|
|
119
|
+
get racing() {
|
|
120
|
+
return (this.racingKit ?? (this.racingKit = new RacingKit(this.runtime, this.options.nodes?.race, this.options.nodes?.ball)));
|
|
121
|
+
}
|
|
122
|
+
/** Control points factions capture, and shrinking circles. */
|
|
123
|
+
get territory() {
|
|
124
|
+
return (this.territoryKit ?? (this.territoryKit = new TerritoryKit(this.runtime, this.options.nodes?.territory, this.options.nodes?.zone)));
|
|
125
|
+
}
|
|
70
126
|
/** Composing and deploying the app's tree of starter hubs (developers). */
|
|
71
127
|
get topology() {
|
|
72
128
|
return (this.topologyKit ?? (this.topologyKit = new KitTopology(String(this.appId), this.domains.exec)));
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { HubState } from '../mirror.js';
|
|
2
|
+
import type { KitRuntime } from '../runtime.js';
|
|
3
|
+
export interface ArenaFighter {
|
|
4
|
+
player: number;
|
|
5
|
+
class: string;
|
|
6
|
+
x: number;
|
|
7
|
+
z: number;
|
|
8
|
+
hp: number;
|
|
9
|
+
max_hp: number;
|
|
10
|
+
/** What casts spend; it regenerates. */
|
|
11
|
+
resource: number;
|
|
12
|
+
statuses: string[];
|
|
13
|
+
kills: number;
|
|
14
|
+
deaths: number;
|
|
15
|
+
/** Down, until the respawn. */
|
|
16
|
+
down: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ArenaShot {
|
|
19
|
+
ability: string;
|
|
20
|
+
caster: number;
|
|
21
|
+
x: number;
|
|
22
|
+
z: number;
|
|
23
|
+
}
|
|
24
|
+
export interface ArenaBlast {
|
|
25
|
+
ability: string;
|
|
26
|
+
caster: number;
|
|
27
|
+
x: number;
|
|
28
|
+
z: number;
|
|
29
|
+
radius: number;
|
|
30
|
+
/** When it goes off (Unix ms). */
|
|
31
|
+
at: number;
|
|
32
|
+
}
|
|
33
|
+
/** What the `arena` topic's snapshots carry. */
|
|
34
|
+
export interface ArenaView {
|
|
35
|
+
phase: 'waiting' | 'running' | 'finished';
|
|
36
|
+
width: number;
|
|
37
|
+
depth: number;
|
|
38
|
+
fighters: ArenaFighter[];
|
|
39
|
+
projectiles: ArenaShot[];
|
|
40
|
+
areas: ArenaBlast[];
|
|
41
|
+
kill_target: number;
|
|
42
|
+
ends_at: number | null;
|
|
43
|
+
winner: number | null;
|
|
44
|
+
}
|
|
45
|
+
/** Real-time arenas (the `arena` starter): {@link arena} by key. */
|
|
46
|
+
export declare class ArenasKit {
|
|
47
|
+
private readonly runtime;
|
|
48
|
+
private readonly nodeType;
|
|
49
|
+
private readonly arenas;
|
|
50
|
+
constructor(runtime: KitRuntime, nodeType?: string);
|
|
51
|
+
arena(key: string): ArenaMatch;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* One arena: players fight with their class's abilities and the hub referees every hit. A
|
|
55
|
+
* client reports where its player is ({@link move}, a few times a second) and the hub keeps what
|
|
56
|
+
* the class's speed allows; casts are checked for cooldown, resource and range, and land as the hub
|
|
57
|
+
* decides. {@link view} mirrors the `arena` topic (up to five snapshots a second); its `event`
|
|
58
|
+
* messages (`type`: `cast`, `impact`, `kill`, `respawn`, `violation`, `removed`, `finished`) come
|
|
59
|
+
* through `view.onEvent`.
|
|
60
|
+
*/
|
|
61
|
+
export declare class ArenaMatch {
|
|
62
|
+
private readonly runtime;
|
|
63
|
+
readonly nodeType: string;
|
|
64
|
+
readonly key: string;
|
|
65
|
+
readonly view: HubState<ArenaView>;
|
|
66
|
+
constructor(runtime: KitRuntime, nodeType: string, key: string);
|
|
67
|
+
watch(): Promise<ArenaView>;
|
|
68
|
+
unwatch(): Promise<void>;
|
|
69
|
+
/** Joins as `heroClass` (the starter's are `warrior` and `mage`). @throws {KitError} `bad_request`, `full`, `started`. */
|
|
70
|
+
join(heroClass: string): Promise<boolean>;
|
|
71
|
+
leave(): Promise<boolean>;
|
|
72
|
+
/** The first to join, or a developer. @throws {KitError} `forbidden`, `not_ready` (one fighter), `started`. */
|
|
73
|
+
start(): Promise<boolean>;
|
|
74
|
+
/**
|
|
75
|
+
* Reports where the player is; resolves with the position the hub kept (a move too fast is cut
|
|
76
|
+
* short, a jump refused). Not sent with an action id: the next report replaces it.
|
|
77
|
+
* @throws {KitError} `forbidden` (removed for movement the warden refused), `conflict` (down).
|
|
78
|
+
*/
|
|
79
|
+
move(x: number, z: number): Promise<[number, number]>;
|
|
80
|
+
/**
|
|
81
|
+
* Casts `ability` aimed at `(x, z)`; resolves with whether a hit-scan strike hit someone at once
|
|
82
|
+
* (a projectile or an area lands later, as an `impact` event).
|
|
83
|
+
* @throws {KitError} `cooldown`, `insufficient` (resource), `out_of_reach`, `not_found` (not the class's).
|
|
84
|
+
*/
|
|
85
|
+
cast(ability: string, x: number, z: number): Promise<boolean>;
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=arenas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arenas.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/arenas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAA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rC,OAAO,EAAE,UAAU,EACnB,QAAQ,SAAU;IAGrC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;CAQ/B;AAED;;;;;;;GAOG;AACH,qBAAa,UAAU;IAInB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM;IALtB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;gBAGhB,OAAO,EAAE,UAAU,EAC3B,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM;IAKtB,KAAK,IAAI,OAAO,CAAC,SAAS,CAAC;IAI3B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIxB,0HAA0H;IAC1H,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzC,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzB,+GAA+G;IAC/G,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;IAIzB;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAIrD;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAG9D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { HubState } from '../mirror.js';
|
|
2
|
+
/** Real-time arenas (the `arena` starter): {@link arena} by key. */
|
|
3
|
+
export class ArenasKit {
|
|
4
|
+
constructor(runtime, nodeType = 'arena') {
|
|
5
|
+
this.runtime = runtime;
|
|
6
|
+
this.nodeType = nodeType;
|
|
7
|
+
this.arenas = new Map();
|
|
8
|
+
}
|
|
9
|
+
arena(key) {
|
|
10
|
+
let a = this.arenas.get(key);
|
|
11
|
+
if (!a) {
|
|
12
|
+
a = new ArenaMatch(this.runtime, this.nodeType, key);
|
|
13
|
+
this.arenas.set(key, a);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One arena: players fight with their class's abilities and the hub referees every hit. A
|
|
20
|
+
* client reports where its player is ({@link move}, a few times a second) and the hub keeps what
|
|
21
|
+
* the class's speed allows; casts are checked for cooldown, resource and range, and land as the hub
|
|
22
|
+
* decides. {@link view} mirrors the `arena` topic (up to five snapshots a second); its `event`
|
|
23
|
+
* messages (`type`: `cast`, `impact`, `kill`, `respawn`, `violation`, `removed`, `finished`) come
|
|
24
|
+
* through `view.onEvent`.
|
|
25
|
+
*/
|
|
26
|
+
export class ArenaMatch {
|
|
27
|
+
constructor(runtime, nodeType, key) {
|
|
28
|
+
this.runtime = runtime;
|
|
29
|
+
this.nodeType = nodeType;
|
|
30
|
+
this.key = key;
|
|
31
|
+
this.view = new HubState(runtime, nodeType, key, 'arena');
|
|
32
|
+
}
|
|
33
|
+
watch() {
|
|
34
|
+
return this.view.start();
|
|
35
|
+
}
|
|
36
|
+
unwatch() {
|
|
37
|
+
return this.view.stop();
|
|
38
|
+
}
|
|
39
|
+
/** Joins as `heroClass` (the starter's are `warrior` and `mage`). @throws {KitError} `bad_request`, `full`, `started`. */
|
|
40
|
+
join(heroClass) {
|
|
41
|
+
return this.runtime.call(this.nodeType, this.key, 'join', { class: heroClass }, { action: true });
|
|
42
|
+
}
|
|
43
|
+
leave() {
|
|
44
|
+
return this.runtime.call(this.nodeType, this.key, 'leave', null, { action: true });
|
|
45
|
+
}
|
|
46
|
+
/** The first to join, or a developer. @throws {KitError} `forbidden`, `not_ready` (one fighter), `started`. */
|
|
47
|
+
start() {
|
|
48
|
+
return this.runtime.call(this.nodeType, this.key, 'start', null, { action: true });
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Reports where the player is; resolves with the position the hub kept (a move too fast is cut
|
|
52
|
+
* short, a jump refused). Not sent with an action id: the next report replaces it.
|
|
53
|
+
* @throws {KitError} `forbidden` (removed for movement the warden refused), `conflict` (down).
|
|
54
|
+
*/
|
|
55
|
+
move(x, z) {
|
|
56
|
+
return this.runtime.call(this.nodeType, this.key, 'move', { x, z });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Casts `ability` aimed at `(x, z)`; resolves with whether a hit-scan strike hit someone at once
|
|
60
|
+
* (a projectile or an area lands later, as an `impact` event).
|
|
61
|
+
* @throws {KitError} `cooldown`, `insufficient` (resource), `out_of_reach`, `not_found` (not the class's).
|
|
62
|
+
*/
|
|
63
|
+
cast(ability, x, z) {
|
|
64
|
+
return this.runtime.call(this.nodeType, this.key, 'cast', { ability, x, z }, { action: true });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { HubState } from '../mirror.js';
|
|
2
|
+
import type { KitRuntime } from '../runtime.js';
|
|
3
|
+
export interface EncounterEnemy {
|
|
4
|
+
id: number;
|
|
5
|
+
kind: string;
|
|
6
|
+
x: number;
|
|
7
|
+
z: number;
|
|
8
|
+
hp: number;
|
|
9
|
+
max_hp: number;
|
|
10
|
+
boss: boolean;
|
|
11
|
+
/** Ticks until its next step. */
|
|
12
|
+
wait: number;
|
|
13
|
+
}
|
|
14
|
+
export interface EncounterTower {
|
|
15
|
+
x: number;
|
|
16
|
+
z: number;
|
|
17
|
+
owner: number;
|
|
18
|
+
}
|
|
19
|
+
/** What the `encounter` topic's snapshots carry. */
|
|
20
|
+
export interface EncounterView {
|
|
21
|
+
phase: 'lobby' | 'running' | 'won' | 'lost';
|
|
22
|
+
players: number[];
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
spawn: [number, number];
|
|
26
|
+
base: [number, number];
|
|
27
|
+
base_hp: number;
|
|
28
|
+
gold: number;
|
|
29
|
+
/** The wave under way. */
|
|
30
|
+
wave: number | null;
|
|
31
|
+
waves: number;
|
|
32
|
+
/** When the next wave starts, while one counts down (Unix ms). */
|
|
33
|
+
next_wave_at: number | null;
|
|
34
|
+
enemies: EncounterEnemy[];
|
|
35
|
+
towers: EncounterTower[];
|
|
36
|
+
boss_phase: number;
|
|
37
|
+
/** Kills by player id (the keys are the ids as text). */
|
|
38
|
+
kills: Record<string, number>;
|
|
39
|
+
}
|
|
40
|
+
/** Waves, towers and bosses (the `director` starter): {@link encounter} by key. */
|
|
41
|
+
export declare class EncountersKit {
|
|
42
|
+
private readonly runtime;
|
|
43
|
+
private readonly nodeType;
|
|
44
|
+
private readonly encounters;
|
|
45
|
+
constructor(runtime: KitRuntime, nodeType?: string);
|
|
46
|
+
encounter(key: string): Encounter;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* One encounter: waves of enemies down a lane to the players' base, towers the players build (a
|
|
50
|
+
* tower may not cut the lane), strikes on a cooldown, kills that pay gold, and a boss that changes
|
|
51
|
+
* phase as it weakens. {@link view} mirrors the `encounter` topic: snapshots once a second while it
|
|
52
|
+
* runs, and `event` messages (`type`: `wave_started`, `wave_cleared`, `boss_phase`, `won`, `lost`)
|
|
53
|
+
* through `view.onEvent`.
|
|
54
|
+
*/
|
|
55
|
+
export declare class Encounter {
|
|
56
|
+
private readonly runtime;
|
|
57
|
+
readonly nodeType: string;
|
|
58
|
+
readonly key: string;
|
|
59
|
+
readonly view: HubState<EncounterView>;
|
|
60
|
+
constructor(runtime: KitRuntime, nodeType: string, key: string);
|
|
61
|
+
watch(): Promise<EncounterView>;
|
|
62
|
+
unwatch(): Promise<void>;
|
|
63
|
+
/** @throws {KitError} `full`. */
|
|
64
|
+
join(): Promise<boolean>;
|
|
65
|
+
/** The first to join, or a developer. @throws {KitError} `forbidden`, `started`, `bad_request` (no way to the base). */
|
|
66
|
+
start(): Promise<boolean>;
|
|
67
|
+
/**
|
|
68
|
+
* Builds a tower at `(x, z)`; resolves with the gold left.
|
|
69
|
+
* @throws {KitError} `blocks_lane`, `insufficient` (gold), `conflict` (taken), `bad_request`, `not_member`.
|
|
70
|
+
*/
|
|
71
|
+
build(x: number, z: number): Promise<number>;
|
|
72
|
+
/** Strikes enemy `enemy`; resolves with its hp left. @throws {KitError} `cooldown`, `not_found`, `not_member`. */
|
|
73
|
+
hit(enemy: number): Promise<number>;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=encounters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encounters.d.ts","sourceRoot":"","sources":["../../../src/kit/modules/encounters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf;AAED,oDAAoD;AACpD,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,CAAC;IAC5C,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE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K,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGpC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HubState } from '../mirror.js';
|
|
2
|
+
/** Waves, towers and bosses (the `director` starter): {@link encounter} by key. */
|
|
3
|
+
export class EncountersKit {
|
|
4
|
+
constructor(runtime, nodeType = 'director') {
|
|
5
|
+
this.runtime = runtime;
|
|
6
|
+
this.nodeType = nodeType;
|
|
7
|
+
this.encounters = new Map();
|
|
8
|
+
}
|
|
9
|
+
encounter(key) {
|
|
10
|
+
let e = this.encounters.get(key);
|
|
11
|
+
if (!e) {
|
|
12
|
+
e = new Encounter(this.runtime, this.nodeType, key);
|
|
13
|
+
this.encounters.set(key, e);
|
|
14
|
+
}
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* One encounter: waves of enemies down a lane to the players' base, towers the players build (a
|
|
20
|
+
* tower may not cut the lane), strikes on a cooldown, kills that pay gold, and a boss that changes
|
|
21
|
+
* phase as it weakens. {@link view} mirrors the `encounter` topic: snapshots once a second while it
|
|
22
|
+
* runs, and `event` messages (`type`: `wave_started`, `wave_cleared`, `boss_phase`, `won`, `lost`)
|
|
23
|
+
* through `view.onEvent`.
|
|
24
|
+
*/
|
|
25
|
+
export class Encounter {
|
|
26
|
+
constructor(runtime, nodeType, key) {
|
|
27
|
+
this.runtime = runtime;
|
|
28
|
+
this.nodeType = nodeType;
|
|
29
|
+
this.key = key;
|
|
30
|
+
this.view = new HubState(runtime, nodeType, key, 'encounter');
|
|
31
|
+
}
|
|
32
|
+
watch() {
|
|
33
|
+
return this.view.start();
|
|
34
|
+
}
|
|
35
|
+
unwatch() {
|
|
36
|
+
return this.view.stop();
|
|
37
|
+
}
|
|
38
|
+
/** @throws {KitError} `full`. */
|
|
39
|
+
join() {
|
|
40
|
+
return this.runtime.call(this.nodeType, this.key, 'join', null, { action: true });
|
|
41
|
+
}
|
|
42
|
+
/** The first to join, or a developer. @throws {KitError} `forbidden`, `started`, `bad_request` (no way to the base). */
|
|
43
|
+
start() {
|
|
44
|
+
return this.runtime.call(this.nodeType, this.key, 'start', null, { action: true });
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Builds a tower at `(x, z)`; resolves with the gold left.
|
|
48
|
+
* @throws {KitError} `blocks_lane`, `insufficient` (gold), `conflict` (taken), `bad_request`, `not_member`.
|
|
49
|
+
*/
|
|
50
|
+
build(x, z) {
|
|
51
|
+
return this.runtime.call(this.nodeType, this.key, 'build', { x, z }, { action: true });
|
|
52
|
+
}
|
|
53
|
+
/** Strikes enemy `enemy`; resolves with its hp left. @throws {KitError} `cooldown`, `not_found`, `not_member`. */
|
|
54
|
+
hit(enemy) {
|
|
55
|
+
return this.runtime.call(this.nodeType, this.key, 'hit', { enemy }, { action: true });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { HubState } from '../mirror.js';
|
|
2
|
+
import type { KitRuntime } from '../runtime.js';
|
|
3
|
+
export interface InstanceRoom {
|
|
4
|
+
kind: 'fight' | 'treasure' | 'rest' | 'boss';
|
|
5
|
+
/** What a fight here takes. */
|
|
6
|
+
power: number;
|
|
7
|
+
done: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface InstanceMember {
|
|
10
|
+
player: number;
|
|
11
|
+
hp: number;
|
|
12
|
+
max_hp: number;
|
|
13
|
+
power: number;
|
|
14
|
+
}
|
|
15
|
+
/** What the `run` topic carries. */
|
|
16
|
+
export interface InstanceRunView {
|
|
17
|
+
phase: 'unopened' | 'running' | 'cleared' | 'wiped' | 'abandoned' | 'expired';
|
|
18
|
+
owner: number | null;
|
|
19
|
+
/** The run's seed: the same seed lays out the same floors. */
|
|
20
|
+
seed: number;
|
|
21
|
+
floor: number;
|
|
22
|
+
floors: number;
|
|
23
|
+
/** The room the party is at on this floor. */
|
|
24
|
+
room: number;
|
|
25
|
+
rooms: InstanceRoom[];
|
|
26
|
+
members: InstanceMember[];
|
|
27
|
+
invited: number[];
|
|
28
|
+
gold: number;
|
|
29
|
+
relics: string[];
|
|
30
|
+
/** The grid reserved for the run, when the hub's config has a volume. */
|
|
31
|
+
grid: number | null;
|
|
32
|
+
log: string[];
|
|
33
|
+
}
|
|
34
|
+
/** Private runs for one party (the `instance` starter): {@link run} by key. */
|
|
35
|
+
export declare class InstancesKit {
|
|
36
|
+
private readonly runtime;
|
|
37
|
+
private readonly nodeType;
|
|
38
|
+
private readonly runs;
|
|
39
|
+
constructor(runtime: KitRuntime, nodeType?: string);
|
|
40
|
+
/** The run with key `key` (a key the game makes up, one per run). */
|
|
41
|
+
run(key: string): InstanceRun;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* One run: a party plays down floors the hub generates from the run's seed, the hub resolves each
|
|
45
|
+
* room, a party with nobody standing is wiped (permadeath), and a run nobody touches expires. A
|
|
46
|
+
* cleared or wiped run posts each member's depth to a leaderboard when the hub's config names one.
|
|
47
|
+
*/
|
|
48
|
+
export declare class InstanceRun {
|
|
49
|
+
private readonly runtime;
|
|
50
|
+
readonly nodeType: string;
|
|
51
|
+
readonly key: string;
|
|
52
|
+
readonly view: HubState<InstanceRunView>;
|
|
53
|
+
constructor(runtime: KitRuntime, nodeType: string, key: string);
|
|
54
|
+
watch(): Promise<InstanceRunView>;
|
|
55
|
+
unwatch(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Opens the run as its owner (a developer kit opens one for `party`); resolves with its seed.
|
|
58
|
+
* @throws {KitError} `started`, `bad_request` (party size), `conflict` (its grid could not be reserved).
|
|
59
|
+
*/
|
|
60
|
+
open(options?: {
|
|
61
|
+
seed?: number;
|
|
62
|
+
party?: ReadonlyArray<number | string>;
|
|
63
|
+
}): Promise<number>;
|
|
64
|
+
/** The owner invites a player. @throws {KitError} `forbidden`, `full`. */
|
|
65
|
+
invite(player: number | string): Promise<boolean>;
|
|
66
|
+
/** An invited player joins. @throws {KitError} `forbidden`. */
|
|
67
|
+
join(): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Resolves the room the party is at; resolves with what happened, as the log has it.
|
|
70
|
+
* @throws {KitError} `not_member`, `forbidden` (the caller is down), `conflict` (descend first), `finished`.
|
|
71
|
+
*/
|
|
72
|
+
enter(): Promise<string>;
|
|
73
|
+
/** The owner leads the party to the next floor; resolves with it. @throws {KitError} `not_ready` (rooms left), `forbidden`. */
|
|
74
|
+
descend(): Promise<number>;
|
|
75
|
+
/** The owner (or a developer) ends the run. */
|
|
76
|
+
abandon(): Promise<boolean>;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=instances.d.ts.map
|