@modlock/modlock 0.1.78 → 0.1.79
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/cast.d.ts +3 -2
- package/heroes.d.ts +8 -0
- package/index.d.ts +41 -3
- package/index.js +2369 -2301
- package/package.json +6 -6
- package/players.d.ts +7 -1
package/cast.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ import { type Connection, type Pawn, type Player } from './host.gen.js';
|
|
|
2
2
|
/** Want is what a member's hero should be; each field it leaves out is free. */
|
|
3
3
|
export interface Want {
|
|
4
4
|
/**
|
|
5
|
-
* hero seats the member on a hero: its name
|
|
6
|
-
*
|
|
5
|
+
* hero seats the member on a hero: its name as players know it or as the
|
|
6
|
+
* game does, such as 'Calico' or 'hero_nano', its id, or 'any' for the
|
|
7
|
+
* hero they have or else a random one.
|
|
7
8
|
*/
|
|
8
9
|
readonly hero?: string | number;
|
|
9
10
|
/**
|
package/heroes.d.ts
CHANGED
|
@@ -11,6 +11,14 @@ export interface Hero extends Titled {
|
|
|
11
11
|
}
|
|
12
12
|
/** heroes are the released heroes, by title. */
|
|
13
13
|
export declare const heroes: readonly Hero[];
|
|
14
|
+
/**
|
|
15
|
+
* heroNamed returns the released hero that name names exactly: its game
|
|
16
|
+
* name, such as 'hero_nano', that name without 'hero_', such as 'nano', or
|
|
17
|
+
* its title in any case, with or without spaces and punctuation, such as
|
|
18
|
+
* 'Calico' or 'ladygeist'. Unlike findHero it matches no part of a name, so
|
|
19
|
+
* a misspelled name finds no hero rather than another one.
|
|
20
|
+
*/
|
|
21
|
+
export declare function heroNamed(name: string): Hero | undefined;
|
|
14
22
|
/** findHero matches what a player typed to a hero, as findTitled does. */
|
|
15
23
|
export declare function findHero(typed: string): Hero | undefined;
|
|
16
24
|
/**
|
package/index.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference path="./globals.d.ts" />
|
|
2
|
-
import { type DamageEvent, type ChatEvent, type DamagedEvent, type DamageResult, type FrameEvent, type ImpactEvent, type LandedEvent, type LaunchEvent, Player, type PlayerJoinedEvent, type PlayerLeftEvent } from './host.gen.js';
|
|
2
|
+
import { type DamageEvent, type ChatEvent, type Connection, type DamagedEvent, type DamageResult, type FrameEvent, type ImpactEvent, type LandedEvent, type LaunchEvent, type Pawn, Player, type PlayerJoinedEvent, type PlayerLeftEvent } from './host.gen.js';
|
|
3
|
+
import { Cast } from './cast.js';
|
|
3
4
|
export * as vector from './vector.js';
|
|
4
5
|
export { Buttons, Layers } from './bits.js';
|
|
5
6
|
export { after, every, sequence, type Timer } from './timer.js';
|
|
6
7
|
export { type CameraMove, type CameraPlayOptions, cameraPulse, type CameraPulseOptions, cameraShake, type CameraShakeOptions, playCamera, setOrbitCamera, } from './camera.js';
|
|
7
8
|
export * as curve from './curve.js';
|
|
8
9
|
export * as format from './format.js';
|
|
9
|
-
export { findHero, findTitled, type Hero, heroes, type Titled, } from './heroes.js';
|
|
10
|
+
export { findHero, findTitled, type Hero, heroes, heroNamed, type Titled, } from './heroes.js';
|
|
10
11
|
export { item, type Item, itemId, items, type Slot } from './items.js';
|
|
11
12
|
export { Hook, type HookAbility, hookAbility, type HookPlayer, type HookRead, hookUpgrades, type ReadHandle, } from './hook.js';
|
|
12
13
|
export { Banner, type BannerProps, type BoxProps, Pill, Pips, type PipsProps, Plate, Roster, type RosterProps, type RosterRow, rosterKey, rosterRows, Score, type ScoreProps, Tag, type TagProps, Text, type TextProps, TopStrip, type TopStripProps, Action, type ActionProps, Meter, type MeterProps, } from './hud.js';
|
|
@@ -17,7 +18,7 @@ export { Cast, type CastOptions, type Want } from './cast.js';
|
|
|
17
18
|
export { frameClock } from './frameclock.js';
|
|
18
19
|
export { ground, type GroundOptions } from './ground.js';
|
|
19
20
|
export { RaceGate, type RaceGateOptions, raceGateResources, } from './racegate.js';
|
|
20
|
-
export { players } from './players.js';
|
|
21
|
+
export { connection, players } from './players.js';
|
|
21
22
|
export { afterMatch, fewestPlayed, leaderboard, leastUsed, nextMatch, ratingChange, ratingStep, settle, type Standing, Standings, startingRating, } from './rotation.js';
|
|
22
23
|
export { bystanderStates, holdBystander } from './bystander.js';
|
|
23
24
|
export { Strays, strayGraceSeconds } from './strays.js';
|
|
@@ -77,6 +78,43 @@ export declare function onPlayerJoin(handler: (joined: PlayerJoinedEvent) => voi
|
|
|
77
78
|
* mod stops serving leaves too, with disconnected false.
|
|
78
79
|
*/
|
|
79
80
|
export declare function onPlayerLeave(handler: (left: PlayerLeftEvent) => void): void;
|
|
81
|
+
/**
|
|
82
|
+
* onSpawn calls handler each time a player's hero enters play: their first
|
|
83
|
+
* hero after joining, each respawn, and each new hero after a change. The
|
|
84
|
+
* player has a hero to move, equip and read from then on, which onPlayerJoin
|
|
85
|
+
* does not promise. The library reads each player's pawn once a frame while a
|
|
86
|
+
* handler is registered.
|
|
87
|
+
*/
|
|
88
|
+
export declare function onSpawn(handler: (player: Player, pawn: Pawn) => void): void;
|
|
89
|
+
/** Seating is where seatPlayers puts each player who joins. */
|
|
90
|
+
export interface Seating {
|
|
91
|
+
/**
|
|
92
|
+
* hero is each player's hero: its name as players know it or as the game
|
|
93
|
+
* does, such as 'haze' or 'hero_haze', its id, or 'any' for the hero they
|
|
94
|
+
* have or else a random one. 'any' is the default.
|
|
95
|
+
*/
|
|
96
|
+
readonly hero?: string | number;
|
|
97
|
+
/**
|
|
98
|
+
* team is the team, 2 or 3, every player joins, or a function that picks
|
|
99
|
+
* the team for one player as they join. Without one each player joins the
|
|
100
|
+
* side with fewer heroes.
|
|
101
|
+
*/
|
|
102
|
+
readonly team?: number | ((connection: Connection) => number);
|
|
103
|
+
/**
|
|
104
|
+
* respawn is the seconds a fallen hero waits before it comes back. Without
|
|
105
|
+
* one a fallen hero is left to the game.
|
|
106
|
+
*/
|
|
107
|
+
readonly respawn?: number;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* seatPlayers gives every player who joins a hero on a team, skipping the
|
|
111
|
+
* game's team and hero screens, and keeps them seated for the rest of the
|
|
112
|
+
* game: it brings a fallen hero back after the respawn delay and seats a
|
|
113
|
+
* player again after a hero change. It returns the Cast that does the
|
|
114
|
+
* seating, whose members are the players' connections, and runs it each
|
|
115
|
+
* frame itself.
|
|
116
|
+
*/
|
|
117
|
+
export declare function seatPlayers(seating?: Seating): Cast<Connection>;
|
|
80
118
|
/** onFrame calls handler once per server frame. */
|
|
81
119
|
export declare function onFrame(handler: (frame: FrameEvent) => void): void;
|
|
82
120
|
/**
|