@modlock/modlock 0.1.64 → 0.1.67

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/host.gen.d.ts CHANGED
@@ -18,6 +18,11 @@ export type FieldType = 'bool' | 'int8' | 'int16' | 'int32' | 'uint8' | 'uint16'
18
18
  export type PickupKind = 'urn' | 'movementBuff';
19
19
  /** MovementAction is a movement fact the game announced for a hero. */
20
20
  export type MovementAction = 'landed' | 'ziplineAttached' | 'groundDash' | 'slide' | 'bouncePad' | 'dashJump' | 'airJump' | 'wallJump' | 'airDash' | 'meleeStarted' | 'abilityExecuted';
21
+ /**
22
+ * Lane is one of the map's lanes, numbered as the game numbers them. The
23
+ * three-lane map has yellow, blue and purple ziplines and no green.
24
+ */
25
+ export type Lane = 'none' | 'yellow' | 'green' | 'blue' | 'purple';
21
26
  /** TextAlign places text across its position. */
22
27
  export type TextAlign = 'left' | 'center' | 'right';
23
28
  /** TextVerticalAlign places text up and down its position. */
@@ -62,6 +67,8 @@ export interface Ability {
62
67
  * one.
63
68
  */
64
69
  readonly rechargeEnd: number;
70
+ /** imbues names the abilities an imbuing item strengthens. */
71
+ readonly imbues: string[];
65
72
  }
66
73
  /** AbilityOptions changes one ability of a player's hero. */
67
74
  export interface AbilityOptions {
@@ -1316,9 +1323,11 @@ export declare class Player {
1316
1323
  setAbility(options: AbilityOptions): boolean;
1317
1324
  /**
1318
1325
  * giveItem gives the hero an item, enabled and free. A hero that owns it
1319
- * keeps its one copy.
1326
+ * keeps its one copy. With imbue, an imbuing item strengthens the hero's
1327
+ * ability in that slot, 0 to 3, as the shop asks when one is bought; the
1328
+ * call fails, granting nothing, when the ability does not accept it.
1320
1329
  */
1321
- giveItem(item: string): boolean;
1330
+ giveItem(item: string, imbue?: number): boolean;
1322
1331
  /**
1323
1332
  * replaceAbility puts the ability named ability, untrained, in the hero's
1324
1333
  * ability slot index, as Ability.slot, removing the ability there. An
@@ -1329,18 +1338,21 @@ export declare class Player {
1329
1338
  */
1330
1339
  replaceAbility(index: number, ability: string): boolean;
1331
1340
  /**
1332
- * holdModifier keeps an ability's modifier, named "<ability>/<modifier>",
1333
- * on the hero with no expiry, giving it back whenever the game removes it
1334
- * or the hero returns. The hero must own the ability or item. Every hero
1335
- * that gains the modifier from the same ability keeps it until the hold
1336
- * ends. Releasing leaves the hero's current modifier until it dies.
1341
+ * holdModifier keeps a modifier, named as GiveModifier names it, on the
1342
+ * hero with no expiry, giving it back whenever the game removes it or the
1343
+ * hero returns. Every hero that gains the modifier from the same ability
1344
+ * keeps it until the hold ends. Releasing leaves the hero's current
1345
+ * modifier until it dies.
1337
1346
  */
1338
1347
  holdModifier(modifier: string, active?: boolean): boolean;
1339
1348
  /**
1340
- * giveModifier gives the hero an ability's modifier, named
1341
- * "<ability>/<modifier>", for seconds, as if the hero's own ability applied
1342
- * it; a hero without that ability applies it with its first ability. The
1343
- * game may end it sooner, as invisibility ends on a shot.
1349
+ * giveModifier gives the hero a modifier for seconds. An ability's
1350
+ * modifier, named "<ability>/<modifier>", comes as if the hero's own
1351
+ * ability applied it; a hero without that ability, or a modifier named on
1352
+ * its own, such as Street Brawl's zipline boost
1353
+ * modifier_street_brawl_round_start_zipline_boost, applies it with the
1354
+ * hero's first ability. The game may end it sooner, as invisibility ends on
1355
+ * a shot.
1344
1356
  */
1345
1357
  giveModifier(modifier: string, seconds: number): boolean;
1346
1358
  /**
@@ -1349,6 +1361,14 @@ export declare class Player {
1349
1361
  * follows the hero.
1350
1362
  */
1351
1363
  teleport(position: Vector, facing: Angles, velocity?: Vector): boolean;
1364
+ /**
1365
+ * zipline puts the player's hero on a lane's zipline near the hero, riding
1366
+ * it as from the zipline key, with the zipline's intro. It never picks
1367
+ * another lane: it fails when the lane has no zipline the hero's team rides
1368
+ * on this map, or the hero has no zipline ability. For Street Brawl's fast
1369
+ * ride, give the hero modifier_street_brawl_round_start_zipline_boost too.
1370
+ */
1371
+ zipline(lane: Lane): boolean;
1352
1372
  /**
1353
1373
  * move carries the player's hero to a position as continuous motion,
1354
1374
  * as a recording plays back. Unlike Teleport it keeps the hero's animated
@@ -1544,7 +1564,7 @@ export declare function precache(options: PrecacheOptions): boolean;
1544
1564
  * data/. A file in neither reads as unset. Names that leave the mod's
1545
1565
  * directories are refused.
1546
1566
  */
1547
- export declare function readFile(name: string): string | undefined;
1567
+ export declare function readFile(path: string): string | undefined;
1548
1568
  /**
1549
1569
  * writeFile replaces one of the mod's files in the host's copy, which
1550
1570
  * outlives a restart and an update of the mod; the files the mod ships stay
@@ -1552,7 +1572,7 @@ export declare function readFile(name: string): string | undefined;
1552
1572
  * past its quota of 4 MiB per mod. A host that keeps no files refuses every
1553
1573
  * write.
1554
1574
  */
1555
- export declare function writeFile(name: string, text: string): boolean;
1575
+ export declare function writeFile(path: string, text: string): boolean;
1556
1576
  /**
1557
1577
  * holdReload keeps the running build through a reload while held is true,
1558
1578
  * such as while a player is partway through something a new build would
package/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export { type CameraMove, type CameraPlayOptions, cameraPulse, type CameraPulseO
7
7
  export * as curve from './curve.js';
8
8
  export * as format from './format.js';
9
9
  export { findHero, findTitled, type Hero, heroes, type Titled, } from './heroes.js';
10
+ export { item, type Item, itemId, items, type Slot } from './items.js';
10
11
  export { Hook, type HookAbility, hookAbility, type HookPlayer, type HookRead, hookUpgrades, type ReadHandle, } from './hook.js';
11
12
  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';
12
13
  export * as theme from './theme.js';
@@ -22,7 +23,7 @@ export { type HeroSnapshot, restoreHero } from './restore.js';
22
23
  export { type ReplayedHit, replayDamage } from './replayed-damage.js';
23
24
  export { type CatalogEntry, Dropper, dropperButtons } from './dropper.js';
24
25
  export { decodeSpot, encodeSpot, LoadedSpot, loadSpot, type Placed, type Spot, type SpotObject, triggers, } from './spot.js';
25
- export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, type HudPart, type ImageProps, type JSX, jsx, jsxs, type LabelProps, type LayoutProps, type Length, type Overflow, type PanelProps, route, type Scaling, type Shadow, sheet, show, type Style, toast, type Transition, type UiElement, } from './ui.js';
26
+ export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, freeCursor, type HudPart, type ImageProps, type JSX, jsx, jsxs, type LabelProps, type LayoutProps, type Length, type Overflow, type PanelProps, route, type Scaling, type Shadow, sheet, show, type Style, toast, type Transition, type UiElement, } from './ui.js';
26
27
  /** LogPart is a value log writes as text. */
27
28
  export type LogPart = string | number | bigint | boolean | null | undefined;
28
29
  /**