@modlock/modlock 0.1.75 → 0.1.77

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
@@ -300,6 +300,21 @@ export interface TraceHit {
300
300
  /** entity is the entity hit, or zero for the world. */
301
301
  readonly entity: number;
302
302
  }
303
+ /**
304
+ * SoundOptions shape one sound; the zero value plays it to every player as
305
+ * the game made it.
306
+ */
307
+ export interface SoundOptions {
308
+ /** volume scales the sound's loudness; 1 plays it as the game made it. */
309
+ volume?: number;
310
+ /** pitch scales the sound's pitch; 1 plays it as the game made it. */
311
+ pitch?: number;
312
+ /**
313
+ * listeners are the player slots that hear the sound; empty means every
314
+ * player.
315
+ */
316
+ listeners?: readonly number[];
317
+ }
303
318
  /** ScreenTiming is a screen effect's timing in seconds. */
304
319
  export interface ScreenTiming {
305
320
  /** delay is the time before the effect starts. */
@@ -1491,6 +1506,26 @@ export declare class Player {
1491
1506
  * call fails, granting nothing, when the ability does not accept it.
1492
1507
  */
1493
1508
  giveItem(item: string, imbue?: number): boolean;
1509
+ /**
1510
+ * buyItem buys an item for the hero as the shop does, under the shop's own
1511
+ * rules and for the souls it charges, or fails and charges nothing when the
1512
+ * shop refuses, as away from the shop or without the souls. With imbue, an
1513
+ * imbuing item strengthens whatever ability the hero holds in that slot, 0
1514
+ * to 3, including one ReplaceAbility put there, which the game's own
1515
+ * buydependentitem refuses; the call fails, buying nothing, when the
1516
+ * ability does not accept it.
1517
+ */
1518
+ buyItem(item: string, imbue?: number, source?: number): boolean;
1519
+ /**
1520
+ * trainAbility trains or upgrades whatever ability the hero holds in a
1521
+ * slot, 0 to 3, as the player holding the upgrade key and pressing the
1522
+ * slot's ability key does: an untrained ability trains for an ability
1523
+ * unlock, and a trained one buys its next tier for ability points. It works
1524
+ * on an ability ReplaceAbility put there, which the game's own commands for
1525
+ * a slot do not reach. When the game refuses, as without an unlock or the
1526
+ * points, the call fails and nothing is spent.
1527
+ */
1528
+ trainAbility(slot: number): boolean;
1494
1529
  /**
1495
1530
  * replaceAbility puts the ability named ability, untrained unless keep
1496
1531
  * carries the old one's progress, in the hero's ability slot index, as
@@ -1586,9 +1621,10 @@ export declare class Player {
1586
1621
  heal(amount: number): boolean;
1587
1622
  /**
1588
1623
  * sound plays a game sound event, such as Damage.Send.Crit, on the
1589
- * player's hero.
1624
+ * player's hero, and returns its ID. It follows the hero as it moves.
1625
+ * Volume and pitch scale the sound, and listeners limit who hears it.
1590
1626
  */
1591
- sound(sound: string): boolean;
1627
+ sound(sound: string, options?: SoundOptions): number | undefined;
1592
1628
  /**
1593
1629
  * restoreHero gives the player's live hero target over the next few
1594
1630
  * seconds: the build first, then health, stamina and pose once it settles,
@@ -1608,6 +1644,11 @@ export declare class Player {
1608
1644
  * view.
1609
1645
  */
1610
1646
  clearScreenEffect(effect: ScreenEffect): boolean;
1647
+ /**
1648
+ * silenceVoice keeps the player's hero from speaking the named voice
1649
+ * concepts until called again, on top of those silenced for everyone.
1650
+ */
1651
+ silenceVoice(concepts?: readonly string[]): boolean;
1611
1652
  /** removeBot removes a bot the mod added. */
1612
1653
  removeBot(): boolean;
1613
1654
  /**
@@ -1778,6 +1819,13 @@ export declare function handedOff(): string | undefined;
1778
1819
  * world.
1779
1820
  */
1780
1821
  export declare function heroBuild(hero: string): BuildCategory[];
1822
+ /**
1823
+ * silenceVoice keeps every hero from speaking the named voice concepts,
1824
+ * until called again. A hero still hears the game's other sounds. Stopping
1825
+ * the mod lets them speak; a name the game does not know fails the call
1826
+ * and the known ones still apply.
1827
+ */
1828
+ export declare function silenceVoice(concepts?: readonly string[]): boolean;
1781
1829
  /**
1782
1830
  * readField reads one schema field of a live entity, such as the int32
1783
1831
  * m_iHealth of CBaseEntity. The host finds the field by name, so it
@@ -1811,7 +1859,9 @@ export declare function readModifierField(entity: number, modifier: string, clas
1811
1859
  * entity's panel only when it creates the entity, so a write to
1812
1860
  * m_DialogXMLName sends every client a full update on the next frame, which
1813
1861
  * creates every entity again; the players' game stalls briefly, so write a
1814
- * layout when it changes, not every frame.
1862
+ * layout when it changes, not every frame. It refuses the fields that
1863
+ * name a console line or a script, such as m_iszPrivateVScripts, here and
1864
+ * among the fields CreateEntity writes before spawn.
1815
1865
  */
1816
1866
  export declare function writeField(entity: number, className: string, field: string, type: FieldType, value: FieldValue): boolean;
1817
1867
  /**
@@ -1925,17 +1975,22 @@ export declare function remapInput(from: bigint, to: bigint, repeat?: boolean):
1925
1975
  */
1926
1976
  export declare function callService(service: string, method: string, payload: Uint8Array): Uint8Array | undefined;
1927
1977
  /**
1928
- * createEntity creates any entity the server knows by its designer name,
1978
+ * createEntity creates an entity the server knows by its designer name,
1929
1979
  * such as npc_trooper_boss or prop_dynamic, with spawn key values and fields
1930
1980
  * written before it spawns. The world removes it when the world ends;
1931
1981
  * stopping the mod removes it too. It refuses an ability, item or weapon,
1932
- * which only a hero holds: GiveItem and ReplaceAbility give one.
1982
+ * which only a hero holds: GiveItem and ReplaceAbility give one. It refuses
1983
+ * a class that runs console lines or loads scripts or entities past a mod's
1984
+ * checks, such as point_servercommand, and key values that name a console
1985
+ * line or a script, such as vscripts.
1933
1986
  */
1934
1987
  export declare function createEntity(options: EntityOptions): number | undefined;
1935
1988
  /**
1936
1989
  * fireInput sends an input to a live entity, as a map's output would, such
1937
1990
  * as Skin with the integer 1. The value must have the type the input reads.
1938
- * It reports false once the entity is gone.
1991
+ * It reports false once the entity is gone. It refuses AddOutput and the
1992
+ * script inputs on every entity, and any input to an entity of a class
1993
+ * CreateEntity refuses.
1939
1994
  */
1940
1995
  export declare function fireInput(entity: number, input: string, value?: EntityValue, activator?: number): boolean;
1941
1996
  /**
@@ -2044,8 +2099,22 @@ export declare function moveEntity(entity: number, position?: Vector, facing?: A
2044
2099
  * impulse that the simulation carries on.
2045
2100
  */
2046
2101
  export declare function pushEntity(entity: number, velocity: Vector, spin?: Vector): boolean;
2047
- /** emitSound plays one game sound on any entity, such as a projectile. */
2048
- export declare function emitSound(entity: number, sound: string): boolean;
2102
+ /**
2103
+ * emitSound plays one game sound on any entity, such as a projectile, and
2104
+ * returns its ID. Volume and pitch scale the sound, and listeners limit who
2105
+ * hears it.
2106
+ */
2107
+ export declare function emitSound(entity: number, sound: string, options?: SoundOptions): number | undefined;
2108
+ /**
2109
+ * adjustSound changes the volume or pitch of a sound Sound or EmitSound
2110
+ * started, while it plays.
2111
+ */
2112
+ export declare function adjustSound(id: number, volume?: number, pitch?: number): boolean;
2113
+ /**
2114
+ * stopSound stops a sound Sound or EmitSound started. A sound that already
2115
+ * ended is not an error.
2116
+ */
2117
+ export declare function stopSound(id: number): boolean;
2049
2118
  /**
2050
2119
  * watchProjectiles reports the projectiles with these designer names, such
2051
2120
  * as rocket_launcher_rocket_projectile, in Launch and Impact events. A new
package/index.d.ts CHANGED
@@ -16,6 +16,7 @@ export * from './host.gen.js';
16
16
  export { Cast, type CastOptions, type Want } from './cast.js';
17
17
  export { frameClock } from './frameclock.js';
18
18
  export { ground, type GroundOptions } from './ground.js';
19
+ export { RaceGate, type RaceGateOptions, raceGateResources, } from './racegate.js';
19
20
  export { players } from './players.js';
20
21
  export { afterMatch, fewestPlayed, leaderboard, leastUsed, nextMatch, ratingChange, ratingStep, settle, type Standing, Standings, startingRating, } from './rotation.js';
21
22
  export { bystanderStates, holdBystander } from './bystander.js';
@@ -27,7 +28,7 @@ export { type ReplayedHit, replayDamage } from './replayed-damage.js';
27
28
  export { type CatalogEntry, Dropper, dropperButtons } from './dropper.js';
28
29
  export { type BoardPage, type BoardRead, type BoardRow, type BoardWindow, type MatchPlace, readBoard, reportMatch, reportScore, type ScoreOptions, } from './scores.js';
29
30
  export { decodeSpot, encodeSpot, LoadedSpot, loadSpot, type Placed, type Spot, type SpotObject, triggers, } from './spot.js';
30
- export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, cursorFree, 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';
31
+ export { type ButtonProps, type Child, type Component, type Edges, type ElementProps, Fragment, type Gradient, type HeroLookName, type HeroProps, hide, hideHud, cursorFree, freeCursor, abilityBarPresses, type AbilityBarHandler, abilityDisplay, type AbilityRow, type ShownAbility, 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, uiSound, } from './ui.js';
31
32
  /** LogPart is a value log writes as text. */
32
33
  export type LogPart = string | number | bigint | boolean | null | undefined;
33
34
  /**