@modlock/modlock 0.0.0-stage → 0.1.64

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 ADDED
@@ -0,0 +1,1927 @@
1
+ /** Vector is a position or direction in the world, in game units. */
2
+ export interface Vector {
3
+ x: number;
4
+ y: number;
5
+ z: number;
6
+ }
7
+ /** Angles is a rotation in degrees. */
8
+ export interface Angles {
9
+ pitch: number;
10
+ yaw: number;
11
+ roll: number;
12
+ }
13
+ /** ScreenEffect is a stock full-screen view effect. */
14
+ export type ScreenEffect = 'killed' | 'black' | 'blinded' | 'darkness' | 'matchIntro';
15
+ /** FieldType is how ReadField and WriteField interpret a field's storage. */
16
+ export type FieldType = 'bool' | 'int8' | 'int16' | 'int32' | 'uint8' | 'uint16' | 'uint32' | 'int64' | 'uint64' | 'float32' | 'float64' | 'vector' | 'handle' | 'string';
17
+ /** PickupKind is a kind of item players collect by walking over it. */
18
+ export type PickupKind = 'urn' | 'movementBuff';
19
+ /** MovementAction is a movement fact the game announced for a hero. */
20
+ export type MovementAction = 'landed' | 'ziplineAttached' | 'groundDash' | 'slide' | 'bouncePad' | 'dashJump' | 'airJump' | 'wallJump' | 'airDash' | 'meleeStarted' | 'abilityExecuted';
21
+ /** TextAlign places text across its position. */
22
+ export type TextAlign = 'left' | 'center' | 'right';
23
+ /** TextVerticalAlign places text up and down its position. */
24
+ export type TextVerticalAlign = 'bottom' | 'center' | 'top';
25
+ /** ModRole is what a player is to the running mods. */
26
+ export type ModRole = 'unspecified' | 'developer' | 'tester';
27
+ /**
28
+ * CameraParam is one value of the camera that follows a hero, which the
29
+ * game's abilities move as Mirage's Tornado pulls the camera back.
30
+ */
31
+ export type CameraParam = 'distance' | 'fieldOfView' | 'target' | 'verticalOffset' | 'horizontalOffset';
32
+ /** Ability is one ability a hero owns. */
33
+ export interface Ability {
34
+ /** name is the ability's name, such as citadel_ability_hornet_snipe. */
35
+ readonly name: string;
36
+ /** slot is the ability's place on the hero: 0 to 3 are the ability keys. */
37
+ readonly slot: number;
38
+ /**
39
+ * entity is the ability's entity handle, as DamageEvent.ability reports
40
+ * it.
41
+ */
42
+ readonly entity: number;
43
+ /**
44
+ * upgrades holds the bought tiers: bit 0 unlocks it and bits 1 to 3 are
45
+ * its upgrades.
46
+ */
47
+ readonly upgrades: number;
48
+ /** charges is the charges the ability holds. */
49
+ readonly charges: number;
50
+ /** cooldownEnd is the game time its cooldown ends, or zero without one. */
51
+ readonly cooldownEnd: number;
52
+ /** id identifies the ability's definition, as replays record it. */
53
+ readonly id: number;
54
+ /** state is the packed upgrade word; its high half is upgrades. */
55
+ readonly state: number;
56
+ /** cooldownStart is the game time its cooldown began. */
57
+ readonly cooldownStart: number;
58
+ /** rechargeStart is the game time its next charge began recovering. */
59
+ readonly rechargeStart: number;
60
+ /**
61
+ * rechargeEnd is the game time its next charge returns, or zero without
62
+ * one.
63
+ */
64
+ readonly rechargeEnd: number;
65
+ }
66
+ /** AbilityOptions changes one ability of a player's hero. */
67
+ export interface AbilityOptions {
68
+ /** ability is the ability's name. */
69
+ ability: string;
70
+ /**
71
+ * upgrades replaces the bought tiers, as ability.upgrades: 0b1111 unlocks
72
+ * it with all three upgrades.
73
+ */
74
+ upgrades?: number;
75
+ /** charges replaces the charges the ability holds, keeping its timers. */
76
+ charges?: number;
77
+ /** cooldownEnd replaces the game time its cooldown ends. */
78
+ cooldownEnd?: number;
79
+ /** rechargeEnd replaces the game time its next charge returns. */
80
+ rechargeEnd?: number;
81
+ /**
82
+ * maxCharges replaces the most charges the ability can hold, from 1 to 100;
83
+ * 0 returns it to the game's own. The server applies it, so the hero's
84
+ * screen can still show the game's maximum. charges above the new maximum
85
+ * are not removed; set them with charges.
86
+ */
87
+ maxCharges?: number;
88
+ }
89
+ /** BuildCategory is one named group of a build's items. */
90
+ export interface BuildCategory {
91
+ /** name is the category's title. */
92
+ readonly name: string;
93
+ /** description is the author's note on the category. */
94
+ readonly description: string;
95
+ /**
96
+ * items lists the category's items in buying order. An item this game
97
+ * version does not define is left out.
98
+ */
99
+ readonly items: BuildItem[];
100
+ }
101
+ /** BuildItem is one item of a build. */
102
+ export interface BuildItem {
103
+ /** item is the item's name, as GiveItem takes it. */
104
+ readonly item: string;
105
+ /** annotation is the author's note on the item. */
106
+ readonly annotation: string;
107
+ }
108
+ /**
109
+ * DamageEvent is one hit before the game applies it. Handles are zero when
110
+ * the game names no such entity.
111
+ */
112
+ export interface DamageEvent {
113
+ /** victim is the entity taking the hit. */
114
+ readonly victim: number;
115
+ /**
116
+ * attacker is the entity credited with the hit. Zero makes the hit a
117
+ * hazard, such as poison gas, which credits no one and ignores the
118
+ * inflictor and hit group.
119
+ */
120
+ readonly attacker: number;
121
+ /** inflictor is what delivered the hit, such as a projectile. */
122
+ readonly inflictor: number;
123
+ /** ability is the ability that dealt the hit. */
124
+ readonly ability: number;
125
+ /** flags are the game's damage flags. */
126
+ readonly flags: bigint;
127
+ /** hitGroup is the body part hit; 1 is the head and -1 means none. */
128
+ readonly hitGroup: number;
129
+ /** amount is the hit's damage before resistances. */
130
+ readonly amount: number;
131
+ }
132
+ /**
133
+ * DamageResult answers a DamageEvent. An empty result lets the hit through.
134
+ */
135
+ export interface DamageResult {
136
+ /** block cancels the hit's health loss, force, effects and procs. */
137
+ block?: boolean;
138
+ /** amount replaces the hit's damage when present. */
139
+ amount?: number;
140
+ }
141
+ /** DamagedEvent reports one hit the game applied. */
142
+ export interface DamagedEvent {
143
+ /** victim is the entity that took the hit. */
144
+ readonly victim: number;
145
+ /** attacker is the entity credited with the hit, or zero for a hazard. */
146
+ readonly attacker: number;
147
+ /** ability is the ability that dealt the hit. */
148
+ readonly ability: number;
149
+ /** healthLost is the health the hit removed, after resistances. */
150
+ readonly healthLost: number;
151
+ /**
152
+ * healthBefore is the victim's health before the hit; a hit that removes
153
+ * all of it kills.
154
+ */
155
+ readonly healthBefore: number;
156
+ /**
157
+ * dealt is the hit's damage after resistances, before the victim's health
158
+ * capped it.
159
+ */
160
+ readonly dealt: number;
161
+ }
162
+ /** LaunchEvent is a watched projectile's first frame. */
163
+ export interface LaunchEvent {
164
+ /** entity is the projectile's entity handle. */
165
+ readonly entity: number;
166
+ /** name is the projectile's designer name. */
167
+ readonly name: string;
168
+ /** owner is the entity that fired it, or zero. */
169
+ readonly owner: number;
170
+ /** player is the slot of the player whose hero fired it, or -1. */
171
+ readonly player: Player;
172
+ /** position is where the projectile is. */
173
+ readonly position: Vector;
174
+ }
175
+ /** ImpactEvent is a watched projectile striking something. */
176
+ export interface ImpactEvent {
177
+ /** entity is the projectile's entity handle. */
178
+ readonly entity: number;
179
+ /** name is the projectile's designer name. */
180
+ readonly name: string;
181
+ /** owner is the entity that fired it, or zero. */
182
+ readonly owner: number;
183
+ /** player is the slot of the player whose hero fired it, or -1. */
184
+ readonly player: Player;
185
+ /**
186
+ * start and end are the projectile's movement this frame, which ended in
187
+ * the strike.
188
+ */
189
+ readonly start: Vector;
190
+ readonly end: Vector;
191
+ /** position is where it struck. */
192
+ readonly position: Vector;
193
+ /** hit is the entity struck, or zero for the world. */
194
+ readonly hit: number;
195
+ }
196
+ /** ProjectileOptions selects the projectiles a mod watches. */
197
+ export interface ProjectileOptions {
198
+ /** names lists designer names, such as rocket_launcher_rocket_projectile. */
199
+ names?: readonly string[];
200
+ /**
201
+ * keepMomentum gives each live hero back the motion it had before a
202
+ * watched projectile's explosion, so the mod's Impact handler sets the
203
+ * push.
204
+ */
205
+ keepMomentum?: boolean;
206
+ }
207
+ /** HitOptions describes damage the mod deals. */
208
+ export interface HitOptions {
209
+ /**
210
+ * victim is the hero or unit to hurt. The world, props and buildings are
211
+ * refused: the client crashes on their damage events.
212
+ */
213
+ victim: number;
214
+ /**
215
+ * attacker is the entity credited with the hit. Without one the hit is a
216
+ * hazard, such as poison gas, which credits no one and ignores the
217
+ * inflictor and hit group.
218
+ */
219
+ attacker?: number;
220
+ /** inflictor is what delivered the hit; the default is the attacker. */
221
+ inflictor?: number;
222
+ /** amount is the damage before resistances. */
223
+ amount: number;
224
+ /**
225
+ * hitGroup is the body part hit; 1 is the head. The default is the game's
226
+ * choice.
227
+ */
228
+ hitGroup?: number;
229
+ /**
230
+ * ability is the entity handle of the ability that dealt the hit, as
231
+ * ability.entity reports it.
232
+ */
233
+ ability?: number;
234
+ }
235
+ /**
236
+ * TraceOptions describes a line to test against the world. Layers are bits
237
+ * of the game's collision layers: bit 0 is solid, 2 trigger, 4 player clip,
238
+ * 18 player and 19 NPC.
239
+ */
240
+ export interface TraceOptions {
241
+ /** start is where the line begins. */
242
+ start: Vector;
243
+ /** end is where the line ends. */
244
+ end: Vector;
245
+ /**
246
+ * layers selects what the line can hit; the default is solid and
247
+ * hitboxes.
248
+ */
249
+ layers?: bigint;
250
+ /** exclude removes things in these layers from the hits. */
251
+ exclude?: bigint;
252
+ /** ignore lists entity handles the line passes through. */
253
+ ignore?: readonly number[];
254
+ }
255
+ /** TraceHit is where a traced line first hit something. */
256
+ export interface TraceHit {
257
+ /** position is the hit point. */
258
+ readonly position: Vector;
259
+ /** normal is the surface's direction at the hit point. */
260
+ readonly normal: Vector;
261
+ /** startSolid is true when the line began inside something solid. */
262
+ readonly startSolid: boolean;
263
+ /** entity is the entity hit, or zero for the world. */
264
+ readonly entity: number;
265
+ }
266
+ /** ScreenTiming is a screen effect's timing in seconds. */
267
+ export interface ScreenTiming {
268
+ /** delay is the time before the effect starts. */
269
+ delay?: number;
270
+ /** fadeIn is the time the effect takes to reach full strength. */
271
+ fadeIn?: number;
272
+ /** hold is the time the effect stays at full strength. */
273
+ hold?: number;
274
+ /** fadeOut is the time the effect takes to end. */
275
+ fadeOut?: number;
276
+ }
277
+ /**
278
+ * FieldValue is one field's value. The host accepts any numeric case for a
279
+ * numeric type and answers with the case its type reads as: a boolean, a
280
+ * number for a type of 32 bits or less and a handle, an integer for a 64-bit
281
+ * type, a vector or text.
282
+ */
283
+ export type FieldValue = boolean | number | bigint | string | Vector;
284
+ /** FieldWrite writes one schema field of an entity the host creates. */
285
+ export interface FieldWrite {
286
+ /** className is the server class that declares the field, or a subclass. */
287
+ className: string;
288
+ /**
289
+ * field is the field's schema name, such as m_iLane. A dotted path, such as
290
+ * m_Collision.m_CollisionGroup, names a field inside an embedded structure.
291
+ */
292
+ field: string;
293
+ /** type is how to write the field. */
294
+ type: FieldType;
295
+ /** value is the field's value. */
296
+ value: FieldValue;
297
+ }
298
+ /** EntityClassName names one entity's class two ways. */
299
+ export interface EntityClassName {
300
+ /** className is the server schema class, such as CCitadelPlayerPawn. */
301
+ readonly className: string;
302
+ /** designerName is the name maps and spawns use, such as npc_trooper. */
303
+ readonly designerName: string;
304
+ }
305
+ /** EntityPlacement is an entity's place in the world. */
306
+ export interface EntityPlacement {
307
+ /** position is the entity's absolute origin. */
308
+ readonly position: Vector;
309
+ /** facing is the entity's absolute angles. */
310
+ readonly facing: Angles;
311
+ /**
312
+ * velocity is the entity's motion in units per second. For a body the
313
+ * physics simulates, such as a prop_physics, it is the body's.
314
+ */
315
+ readonly velocity?: Vector;
316
+ }
317
+ /** EntityOptions describes an entity to create. */
318
+ export interface EntityOptions {
319
+ /** designerName is the entity's designer name, such as npc_trooper_boss. */
320
+ designerName: string;
321
+ /**
322
+ * subclass names the entity's game data entry, such as npc_boss_tier1 for
323
+ * the lane Guardian, for an entity that reads one while spawning. Without
324
+ * one, the entity uses the entry named for its class when the game has one,
325
+ * and a class whose entries all have other names, such as npc_trooper, is
326
+ * refused.
327
+ */
328
+ subclass: string;
329
+ /** team is the entity's team number; 4 is neutral. */
330
+ team: number;
331
+ /** position is the entity's origin. */
332
+ position: Vector;
333
+ /** facing is where the entity faces. */
334
+ facing?: Angles;
335
+ /**
336
+ * keyValues are the entity's spawn key values, as a map sets them, such as
337
+ * model or rendercolor.
338
+ */
339
+ keyValues?: readonly KeyValue[];
340
+ /**
341
+ * fields are schema fields the host writes after it creates the entity and
342
+ * before the entity spawns. A write that fails cancels the creation.
343
+ */
344
+ fields?: readonly FieldWrite[];
345
+ /**
346
+ * transmitAlways sends the entity to every client, past the game's own
347
+ * rule, which never sends one without a model, such as a
348
+ * point_clientui_dialog.
349
+ */
350
+ transmitAlways?: boolean;
351
+ }
352
+ /** KeyValue is one spawn key value. */
353
+ export interface KeyValue {
354
+ /** key is the key value's name, such as skin. */
355
+ key: string;
356
+ /** value is the key value's value. */
357
+ value: EntityValue;
358
+ }
359
+ /**
360
+ * EntityValue is a value a map gives an entity: a spawn key value or an
361
+ * input's parameter. An input reads its parameter as the type it takes, such
362
+ * as an integer for Skin or a color, as 0xRRGGBBAA, for Color, and does not
363
+ * convert text.
364
+ */
365
+ export type EntityValue = {
366
+ readonly boolean: boolean;
367
+ } | {
368
+ readonly integer: number;
369
+ } | {
370
+ readonly number: number;
371
+ } | {
372
+ readonly text: string;
373
+ } | {
374
+ readonly vector: Vector;
375
+ } | {
376
+ readonly color: number;
377
+ };
378
+ /** InputEvent is one player's watched buttons that went down or up. */
379
+ export interface InputEvent {
380
+ /** player is the player who pressed. */
381
+ readonly player: Player;
382
+ /** pressed holds one bit per button that went down. */
383
+ readonly pressed: bigint;
384
+ /** released holds one bit per button that went up. */
385
+ readonly released: bigint;
386
+ }
387
+ /**
388
+ * RiftState is the Rift objective's timing as the game holds it. Times are
389
+ * game times in seconds, or zero when unset.
390
+ */
391
+ export interface RiftState {
392
+ /** scoringTeam is the team holding the Rift, or zero. */
393
+ readonly scoringTeam: number;
394
+ readonly scoringTime: number;
395
+ readonly cashInStarted: number;
396
+ readonly giveUpTime: number;
397
+ /** nextSpawn is when the Rift next opens. */
398
+ readonly nextSpawn: number;
399
+ readonly spawnWindow: number;
400
+ }
401
+ /**
402
+ * MovementSample is one watched hero's movement on one tick, as the game keeps
403
+ * it. A hero whose position, velocity or ground the game does not provide has
404
+ * no sample; another field the game did not provide is absent or zero.
405
+ */
406
+ export interface MovementSample {
407
+ /** player is the hero's player slot. */
408
+ readonly player: Player;
409
+ /** pawn is the hero's entity handle. */
410
+ readonly pawn: number;
411
+ /** position is the hero's origin, at its feet. */
412
+ readonly position: Vector;
413
+ /** velocity is the hero's motion in units per second. */
414
+ readonly velocity: Vector;
415
+ /**
416
+ * grounded is true while the hero stands on something. sliding, mantling,
417
+ * climbing and dashing are the game's movement states.
418
+ */
419
+ readonly grounded: boolean;
420
+ readonly sliding: boolean;
421
+ readonly mantling: boolean;
422
+ readonly climbing: boolean;
423
+ readonly dashing: boolean;
424
+ /**
425
+ * jumpAbility is the hero's jump ability, and wallJumps the game's count of
426
+ * consecutive wall jumps on it.
427
+ */
428
+ readonly jumpAbility: number;
429
+ readonly wallJumps: number;
430
+ /**
431
+ * mantleAbility is the hero's mantle ability, and mantleStart the game time
432
+ * its latest mantle began.
433
+ */
434
+ readonly mantleAbility: number;
435
+ readonly mantleStart: number;
436
+ /**
437
+ * wallContact is where the hero was when the jump ability last found a wall
438
+ * to jump off; it holds still once no wall qualifies.
439
+ */
440
+ readonly wallContact: Vector;
441
+ /** wallNormal is the last wall touched, never cleared. */
442
+ readonly wallNormal: Vector;
443
+ /** wallJumpNormal is the normal the latest wall jump used. */
444
+ readonly wallJumpNormal: Vector;
445
+ /** wallJumpFacing is the game's EWallJumpFacing, zero when not on a wall. */
446
+ readonly wallJumpFacing: number;
447
+ /**
448
+ * ziplineTime is the game time the hero last rode a zipline; it advances on
449
+ * every tick of a ride.
450
+ */
451
+ readonly ziplineTime?: number;
452
+ /** actions are the movement facts the game announced since the last tick. */
453
+ readonly actions: MovementAction[];
454
+ /**
455
+ * casts are the abilities the hero cast since the last tick, one per
456
+ * MOVEMENT_ACTION_ABILITY_EXECUTED, by entity handle as Ability.entity
457
+ * reports it; Abilities names each one's slot.
458
+ */
459
+ readonly casts: number[];
460
+ /**
461
+ * command is the movement the hero's player commanded since the last
462
+ * sample, absent before the game ran any of it.
463
+ */
464
+ readonly command?: MovementCommand;
465
+ }
466
+ /**
467
+ * MovementCommand is the movement a player commanded over one tick. The
468
+ * server runs a player's commands as they arrive, so a tick may run several
469
+ * or none: every press among them is kept once, and a tick that ran none
470
+ * holds the last buttons without pressing them again.
471
+ */
472
+ export interface MovementCommand {
473
+ /**
474
+ * held, changed and scroll are the game's InButtonState masks as Buttons
475
+ * bits: the buttons down, the buttons that went down or up, and the
476
+ * presses of scroll-wheel buttons.
477
+ */
478
+ held: bigint;
479
+ changed: bigint;
480
+ scroll: bigint;
481
+ /** forward, left and up are the movement axes, from -1 to 1. */
482
+ forward: number;
483
+ left: number;
484
+ up: number;
485
+ /** grounded is true when the hero stood on something as the tick began. */
486
+ grounded: boolean;
487
+ }
488
+ /** LandedEvent is one hero landing. */
489
+ export interface LandedEvent {
490
+ /** player is the slot of the player who landed. */
491
+ readonly player: Player;
492
+ /** on is the slot of the player landed on, or -1 for the world. */
493
+ readonly on: number;
494
+ /** speed is the downward speed just before landing, in units per second. */
495
+ readonly speed: number;
496
+ }
497
+ /** Steering is one recorded movement command and the pose its step ends on. */
498
+ export interface Steering {
499
+ command: MovementCommand;
500
+ /**
501
+ * position, velocity and grounded are the pose the next step ends on; the
502
+ * steps after it move on from there.
503
+ */
504
+ position: Vector;
505
+ velocity: Vector;
506
+ grounded: boolean;
507
+ /**
508
+ * facing is where the command looks, which aims the hero and its animation.
509
+ */
510
+ facing: Angles;
511
+ }
512
+ /** DriveCommand is a player's controls for one tick and the ticks after it. */
513
+ export interface DriveCommand {
514
+ /**
515
+ * facing is where the hero looks and aims; its yaw turns the body, as the
516
+ * camera turns a player's hero.
517
+ */
518
+ facing: Angles;
519
+ /**
520
+ * forward and left are the movement axes, from -1 to 1, relative to the
521
+ * facing's yaw.
522
+ */
523
+ forward: number;
524
+ left: number;
525
+ /** held holds down these buttons on every tick. */
526
+ held: bigint;
527
+ /** pressed presses these buttons on the next tick only, as a tap. */
528
+ pressed: bigint;
529
+ }
530
+ /** NpcsRestoredEvent reports how a RestoreNpcs ended. */
531
+ export interface NpcsRestoredEvent {
532
+ /**
533
+ * error describes the unit that does not match its target, or is empty
534
+ * when every target was found in place.
535
+ */
536
+ readonly error: string;
537
+ }
538
+ /** NpcOptions describes a unit that is not a player, such as a trooper. */
539
+ export interface NpcOptions {
540
+ /**
541
+ * className is the unit's entity class, such as npc_trooper or
542
+ * npc_trooper_boss.
543
+ */
544
+ className: string;
545
+ /**
546
+ * unit names the unit's game data entry, such as trooper_melee, or is empty
547
+ * for a unit that needs none.
548
+ */
549
+ unit: string;
550
+ /** team is the unit's team number; 4 is neutral. */
551
+ team: number;
552
+ /** position is the unit's origin, at its feet. */
553
+ position: Vector;
554
+ /** facing is where the unit faces. */
555
+ facing?: Angles;
556
+ /** health is the unit's health; the default is the unit's own. */
557
+ health?: number;
558
+ /** maxHealth is the unit's maximum health; the default is health. */
559
+ maxHealth?: number;
560
+ /**
561
+ * lane is the lane the unit walks. A unit whose class walks none, unlike a
562
+ * trooper, refuses it.
563
+ */
564
+ lane?: number;
565
+ /**
566
+ * fields are schema fields the host writes after it creates the unit and
567
+ * before the unit spawns, such as m_iInitialTeamNum, which the game reads
568
+ * only while spawning. A write that fails cancels the spawn.
569
+ */
570
+ fields?: readonly FieldWrite[];
571
+ }
572
+ /** NpcState is a unit's state this frame. */
573
+ export interface NpcState {
574
+ /** position is the unit's origin. */
575
+ readonly position: Vector;
576
+ /** facing is where the unit faces. */
577
+ readonly facing: Angles;
578
+ /** health is the unit's health. */
579
+ readonly health: number;
580
+ /** maxHealth is the unit's maximum health. */
581
+ readonly maxHealth: number;
582
+ /** team is the unit's team number. */
583
+ readonly team: number;
584
+ }
585
+ /**
586
+ * NpcTarget is one unit or objective RestoreNpcs places, as replays record
587
+ * it.
588
+ */
589
+ export interface NpcTarget {
590
+ /**
591
+ * className is the unit's entity class: npc_trooper, npc_trooper_neutral,
592
+ * npc_boss_tier2, npc_boss_tier3, npc_barrack_boss,
593
+ * npc_base_defense_sentry, npc_super_neutral or
594
+ * npc_neutral_sinners_sacrifice.
595
+ */
596
+ className: string;
597
+ /** id identifies the unit's game data entry. */
598
+ id: number;
599
+ /** team is the unit's team number; 4 is neutral. */
600
+ team: number;
601
+ /** position is the unit's origin, at its feet. */
602
+ position: Vector;
603
+ /** facing is where the unit faces. */
604
+ facing: Angles;
605
+ /** velocity is the unit's motion in units per second. */
606
+ velocity?: Vector;
607
+ /** health and maxHealth are the unit's health. */
608
+ health: number;
609
+ maxHealth: number;
610
+ /** lane is the lane a trooper walks; troopers need one. */
611
+ lane?: number;
612
+ }
613
+ /** ModelOptions describes a model placed in the world. */
614
+ export interface ModelOptions {
615
+ /**
616
+ * resource is the model's path, which the mod precached, with {addon} for
617
+ * the mod's content addon, as in models/{addon}/pawn.vmdl.
618
+ */
619
+ resource: string;
620
+ /** position is the model's origin. */
621
+ position: Vector;
622
+ /** facing is the model's rotation. */
623
+ facing?: Angles;
624
+ /** scale multiplies the model's size; the default is 1. */
625
+ scale?: number;
626
+ /**
627
+ * color tints the model as 0xRRGGBBAA; an alpha below 0xff draws it
628
+ * translucent.
629
+ */
630
+ color?: number;
631
+ /** glow outlines the model through walls. */
632
+ glow?: boolean;
633
+ /**
634
+ * solid makes heroes and traces collide with the model's physics shape,
635
+ * scaled with the model. Without it, everything passes through.
636
+ */
637
+ solid?: boolean;
638
+ }
639
+ /** TextOptions describes text that floats in the world. */
640
+ export interface TextOptions {
641
+ /** text is the words to show; a newline starts a second line. */
642
+ text: string;
643
+ /** position is the text's origin. */
644
+ position: Vector;
645
+ /**
646
+ * facing is the text's rotation. When the text faces the camera it stands
647
+ * upright and ignores this; otherwise it lies flat, face up, at zero angles
648
+ * and stands with roll 90.
649
+ */
650
+ facing?: Angles;
651
+ /** fontSize is the text's size; the default is 100. */
652
+ fontSize?: number;
653
+ /** color is the text's color as 0xRRGGBBAA; the default is white. */
654
+ color?: number;
655
+ /** faceCamera turns the text toward each viewer. */
656
+ faceCamera?: boolean;
657
+ /** scale multiplies the text's size in the world; the default is 1. */
658
+ scale?: number;
659
+ /**
660
+ * align is where the text sits across its position; the default is left,
661
+ * with the text starting there.
662
+ */
663
+ align?: TextAlign;
664
+ /**
665
+ * verticalAlign is where the text sits up and down its position; the
666
+ * default is bottom, with the text standing on it.
667
+ */
668
+ verticalAlign?: TextVerticalAlign;
669
+ }
670
+ /** ParticleOptions describes a particle effect. */
671
+ export interface ParticleOptions {
672
+ /**
673
+ * resource is the particle system's path, which the mod precached, such
674
+ * as particles/abilities/assassinate_laser_targetting.vpcf, with {addon}
675
+ * for the mod's content addon, as in particles/{addon}/glow.vpcf.
676
+ */
677
+ resource: string;
678
+ /** position is the effect's origin. */
679
+ position: Vector;
680
+ /** facing is the effect's rotation. */
681
+ facing?: Angles;
682
+ /** color tints the effect as 0xRRGGBBAA. */
683
+ color?: number;
684
+ /** tintPoint is the control point the color sets. */
685
+ tintPoint?: number;
686
+ /** point sets one control point to a position, such as a beam's far end. */
687
+ point?: ParticlePoint;
688
+ /**
689
+ * parent is the handle of an entity the effect follows, such as a hero's.
690
+ */
691
+ parent?: number;
692
+ /**
693
+ * anchors tie control points to entities, which the points follow as the
694
+ * entities move, such as both ends of a beam.
695
+ */
696
+ anchors?: readonly ParticleAnchor[];
697
+ /**
698
+ * inactive spawns the effect without starting it: it draws nothing, but
699
+ * other effects' anchors can follow it as it moves.
700
+ */
701
+ inactive?: boolean;
702
+ }
703
+ /** ParticleAnchor ties one control point of a particle effect to an entity. */
704
+ export interface ParticleAnchor {
705
+ /** index is the control point's number. */
706
+ index: number;
707
+ /** entity is the handle of the entity the control point follows. */
708
+ entity: number;
709
+ }
710
+ /** ParticlePoint places one control point of a particle effect. */
711
+ export interface ParticlePoint {
712
+ /** index is the control point's number. */
713
+ index: number;
714
+ /** position is the control point's value. */
715
+ position: Vector;
716
+ }
717
+ /** FogOptions describes an oriented box of tinted fog. */
718
+ export interface FogOptions {
719
+ /** position is the box's origin. */
720
+ position: Vector;
721
+ /** facing is the box's rotation. */
722
+ facing?: Angles;
723
+ /** mins is the box's lower corner, relative to position. */
724
+ mins: Vector;
725
+ /** maxs is the box's upper corner, relative to position. */
726
+ maxs: Vector;
727
+ /** strength is the fog's density. */
728
+ strength: number;
729
+ /** color tints the fog as 0xRRGGBBAA; alpha is ignored. */
730
+ color: number;
731
+ }
732
+ /** RestoredEvent reports how a RestoreHero ended. */
733
+ export interface RestoredEvent {
734
+ /** player is the player whose hero was restored. */
735
+ readonly player: Player;
736
+ /**
737
+ * error describes why the hero does not match its target, or is empty when
738
+ * it held the target for a second.
739
+ */
740
+ readonly error: string;
741
+ }
742
+ /**
743
+ * PlayersChangedEvent holds every occupied player slot, as Players lists them.
744
+ */
745
+ export interface PlayersChangedEvent {
746
+ readonly players: Connection[];
747
+ }
748
+ /** Connection is one occupied player slot. */
749
+ export interface Connection {
750
+ /** player is the connection's server slot. */
751
+ readonly player: Player;
752
+ /** steamId identifies a human's account, or is zero for a bot. */
753
+ readonly steamId: bigint;
754
+ /** name is the player's name. */
755
+ readonly name: string;
756
+ /** bot is true for a bot player. */
757
+ readonly bot: boolean;
758
+ /**
759
+ * ready is true once a human has finished joining; bots are always ready.
760
+ */
761
+ readonly ready: boolean;
762
+ /** generation changes each time a new connection takes the slot. */
763
+ readonly generation: number;
764
+ /**
765
+ * roles are what the player is to the running mods, as the program that
766
+ * runs the host grants them. A role decides what a mod shows, such as an
767
+ * unfinished feature for its testers; the platform that keeps a mod's
768
+ * shared data checks its own writers.
769
+ */
770
+ readonly roles: ModRole[];
771
+ }
772
+ /** Pawn is one player's hero this frame. */
773
+ export interface Pawn {
774
+ /** entity is the hero's entity handle, which ReadField reads. */
775
+ readonly entity: number;
776
+ /** hero identifies the hero, as SelectHero returns it. */
777
+ readonly hero: number;
778
+ /** team is the hero's team number. */
779
+ readonly team: number;
780
+ /** health is the hero's health; zero or less is dead. */
781
+ readonly health: number;
782
+ /**
783
+ * maxHealth is the hero's networked maximum health, which leaves out
784
+ * health from items until the hero respawns.
785
+ */
786
+ readonly maxHealth: number;
787
+ /** position is the hero's origin, at its feet. */
788
+ readonly position: Vector;
789
+ /** eyeAngles is where the hero aims. */
790
+ readonly eyeAngles: Angles;
791
+ /** cameraAngles is where the player's camera looks. */
792
+ readonly cameraAngles: Angles;
793
+ /** stamina is the hero's stamina, absent until it has spawned fully. */
794
+ readonly stamina?: number;
795
+ /** maxStamina is the hero's maximum stamina, present with stamina. */
796
+ readonly maxStamina?: number;
797
+ /** generation is the connection generation the hero belongs to. */
798
+ readonly generation: number;
799
+ /** souls is the souls the player holds. */
800
+ readonly souls: number;
801
+ /** eyePosition is where the hero's view starts, for aiming traces. */
802
+ readonly eyePosition: Vector;
803
+ /** velocity is the hero's motion in units per second. */
804
+ readonly velocity: Vector;
805
+ /**
806
+ * carryingUrn is whether the hero carries the soul urn, absent when the
807
+ * game's modifier states cannot be read.
808
+ */
809
+ readonly carryingUrn?: boolean;
810
+ /**
811
+ * score is the player's scoreboard, absent when the game's scoreboard
812
+ * cannot be read.
813
+ */
814
+ readonly score?: Score;
815
+ /**
816
+ * cameraPosition is where the player's camera was in their latest command,
817
+ * shoulder offset included; a ray from it along camera_angles passes
818
+ * through the reticle. Absent for a bot and on hosts that cannot read
819
+ * commands.
820
+ */
821
+ readonly cameraPosition?: Vector;
822
+ /**
823
+ * effectiveMaxHealth is the maximum the hero's health bar shows, health
824
+ * from items included. Absent when the game's own reading is unavailable.
825
+ */
826
+ readonly effectiveMaxHealth?: number;
827
+ }
828
+ /**
829
+ * Score is one player's scoreboard counters since the match began, as the
830
+ * game counts them.
831
+ */
832
+ export interface Score {
833
+ readonly kills: number;
834
+ readonly deaths: number;
835
+ readonly assists: number;
836
+ /** lastHits counts enemy troopers and neutrals the player finished. */
837
+ readonly lastHits: number;
838
+ /**
839
+ * denies counts allied troopers the player finished before an enemy could.
840
+ */
841
+ readonly denies: number;
842
+ /** heroDamage is the damage the player dealt to enemy heroes. */
843
+ readonly heroDamage: number;
844
+ /** heroHealing is the healing the player gave other heroes. */
845
+ readonly heroHealing: number;
846
+ /** netWorth is the souls the player has earned, spent or not. */
847
+ readonly netWorth: number;
848
+ }
849
+ /**
850
+ * CameraValue is a value for a camera param: a number for every param but
851
+ * the target, which takes a position.
852
+ */
853
+ export type CameraValue = number | Vector;
854
+ /** CameraMotion is how an operation moves its param. */
855
+ export type CameraMotion = {
856
+ readonly hold: CameraHold;
857
+ } | {
858
+ readonly approach: CameraApproach;
859
+ } | {
860
+ readonly spring: CameraSpring;
861
+ } | {
862
+ readonly lerp: CameraLerp;
863
+ } | {
864
+ readonly lag: CameraLag;
865
+ };
866
+ /** CameraHold keeps a param where it is. */
867
+ export interface CameraHold {
868
+ /** duration is how long it holds, in seconds. */
869
+ duration?: number;
870
+ }
871
+ /** CameraApproach moves a param toward a value. */
872
+ export interface CameraApproach {
873
+ /** value is the value it approaches. */
874
+ value?: CameraValue;
875
+ /** speed is the most the param moves each second; omitted, 600. */
876
+ speed?: number;
877
+ /**
878
+ * defaultSpeed is the speed of the return to the usual value; omitted, 600.
879
+ */
880
+ defaultSpeed?: number;
881
+ /** acceleration is how fast the speed builds each second; omitted, 1000. */
882
+ acceleration?: number;
883
+ /** minDuration is the least time it runs, in seconds. */
884
+ minDuration?: number;
885
+ /** chaseDefault approaches the param's usual value instead of value. */
886
+ chaseDefault?: boolean;
887
+ }
888
+ /** CameraSpring pulls a param toward a value. */
889
+ export interface CameraSpring {
890
+ /** value is the value the spring pulls toward. */
891
+ value?: CameraValue;
892
+ /** strength is the spring's strength; omitted, 10. */
893
+ strength?: number;
894
+ /** minSpeed is the least the param moves each second. */
895
+ minSpeed?: number;
896
+ /**
897
+ * maxDuration ends the spring after this many seconds, or never when zero.
898
+ */
899
+ maxDuration?: number;
900
+ }
901
+ /** CameraLerp moves a param from one value to another over a time. */
902
+ export interface CameraLerp {
903
+ /** start is the value it starts from. */
904
+ start: CameraValue;
905
+ /** end is the value it ends at. */
906
+ end: CameraValue;
907
+ /** bias and gain shape the curve between them. */
908
+ bias?: number;
909
+ gain?: number;
910
+ /** duration is the time it takes, in seconds; omitted, 1. */
911
+ duration?: number;
912
+ }
913
+ /** CameraLag lets a param trail its usual value. */
914
+ export interface CameraLag {
915
+ /** minDuration is the least time it runs, in seconds. */
916
+ minDuration?: number;
917
+ /** lagTime is how far behind the param trails, in seconds. */
918
+ lagTime?: number;
919
+ /** maxSpeed is the most the param moves each second. */
920
+ maxSpeed?: number;
921
+ /** springStrength is the strength of the pull back to the usual value. */
922
+ springStrength?: number;
923
+ /**
924
+ * keepTargetOnScreen strengthens the pull when the target would leave the
925
+ * screen; omitted, true.
926
+ */
927
+ keepTargetOnScreen?: boolean;
928
+ }
929
+ /** CameraOptions adds one operation to a player's camera. */
930
+ export interface CameraOptions {
931
+ /**
932
+ * context names a group of operations, which ClearCamera removes together.
933
+ * Operations on one param in one context run in order, each after the one
934
+ * before it ends, so a mod sends a whole sequence at once.
935
+ */
936
+ context?: string;
937
+ /** param is the camera value the operation moves. */
938
+ param: CameraParam;
939
+ /**
940
+ * motion is how it moves. Each motion ends once it reaches its value or
941
+ * its duration, and the param returns to its usual value unless another
942
+ * operation follows.
943
+ */
944
+ motion: CameraMotion;
945
+ /** delay starts the operation after this many seconds. */
946
+ delay?: number;
947
+ /**
948
+ * relative adds the operation's values to the param's usual value instead
949
+ * of replacing it.
950
+ */
951
+ relative?: boolean;
952
+ /**
953
+ * priority decides between contexts moving one param: a higher operation
954
+ * takes over from a running lower one, which resumes when it ends, and a
955
+ * lower one does not show while a higher one runs. Omitted, 1.
956
+ */
957
+ priority?: number;
958
+ /**
959
+ * shared lets operations of other contexts move the param at the same time.
960
+ */
961
+ shared?: boolean;
962
+ /**
963
+ * target is the entity handle of the hero whose camera moves, as
964
+ * Pawn.entity reports it; omitted, the player's own hero.
965
+ */
966
+ target?: number;
967
+ }
968
+ /**
969
+ * HeroTarget is the state RestoreHero gives one hero. Omitted parts keep the
970
+ * hero's own.
971
+ */
972
+ export interface HeroTarget {
973
+ /** position is the hero's origin. */
974
+ position: Vector;
975
+ /** facing is where the camera faces; a bot's hero faces it. */
976
+ facing: Angles;
977
+ /**
978
+ * fresh gives full health and stamina and readies every ability, in place
979
+ * of health, max health, upgrade bonuses and timers. A bot's ability
980
+ * upgrades may grow while the restore runs.
981
+ */
982
+ fresh?: boolean;
983
+ /** level sets the hero's level. */
984
+ level?: number;
985
+ /**
986
+ * health and maxHealth set the hero's health and its base maximum. Both
987
+ * are required unless the target is fresh.
988
+ */
989
+ health?: number;
990
+ maxHealth?: number;
991
+ /**
992
+ * upgradeBonuses are the three stat bonuses purchases add, as replays
993
+ * record them.
994
+ */
995
+ upgradeBonuses?: readonly number[];
996
+ /** abilities sets the hero's abilities in their slots. */
997
+ abilities?: readonly EquipmentTarget[];
998
+ /**
999
+ * items lists the items that replace the hero's when replaceItems is set.
1000
+ */
1001
+ items?: readonly EquipmentTarget[];
1002
+ /**
1003
+ * replaceItems replaces every item the hero owns with items; an empty list
1004
+ * removes them.
1005
+ */
1006
+ replaceItems?: boolean;
1007
+ /** timers sets the charges and cooldowns of owned abilities and items. */
1008
+ timers?: readonly TimerTarget[];
1009
+ }
1010
+ /** EquipmentTarget is one ability or item a HeroTarget gives the hero. */
1011
+ export interface EquipmentTarget {
1012
+ /** id identifies the definition, as Ability.id. */
1013
+ id: number;
1014
+ /**
1015
+ * slot is its place on the hero, as Ability.slot; abilities need one, and
1016
+ * an item without one goes where the game puts it.
1017
+ */
1018
+ slot?: number;
1019
+ /** state is the packed upgrade word, as Ability.state. */
1020
+ state: number;
1021
+ }
1022
+ /**
1023
+ * TimerTarget sets one owned ability's or item's charges and cooldowns.
1024
+ * Times are seconds from the moment the host writes them; an omitted start
1025
+ * and end mean no timer.
1026
+ */
1027
+ export interface TimerTarget {
1028
+ /** id identifies the ability, as Ability.id. */
1029
+ id: number;
1030
+ /** charges is the charges it holds. */
1031
+ charges: number;
1032
+ /** cooldownStart and cooldownEnd bound its cooldown. */
1033
+ cooldownStart?: number;
1034
+ cooldownEnd?: number;
1035
+ /** rechargeStart and rechargeEnd bound the recovery of its next charge. */
1036
+ rechargeStart?: number;
1037
+ rechargeEnd?: number;
1038
+ }
1039
+ /** BotOptions describes a bot player. */
1040
+ export interface BotOptions {
1041
+ /** name is the bot's player name. */
1042
+ name: string;
1043
+ /** team is the team number to join: 2 or 3. */
1044
+ team: number;
1045
+ /**
1046
+ * hero names the bot's hero, such as hero_wraith, or gives its identifier
1047
+ * as Pawn.hero reports it.
1048
+ */
1049
+ hero?: string | number;
1050
+ /** position is where the bot appears. */
1051
+ position?: Vector;
1052
+ }
1053
+ /** SettingChangedEvent is one player's new value of one setting. */
1054
+ export interface SettingChangedEvent {
1055
+ /** player is the player's server slot. */
1056
+ readonly player: Player;
1057
+ /** key names the setting. */
1058
+ readonly key: string;
1059
+ /** value is the new value. */
1060
+ readonly value: string;
1061
+ }
1062
+ /** UiPressEvent reports a press on a button in a player's interface. */
1063
+ export interface UiPressEvent {
1064
+ /** player is the player who pressed. */
1065
+ readonly player: Player;
1066
+ /** node is the id of the pressed button. */
1067
+ readonly node: string;
1068
+ }
1069
+ /**
1070
+ * UiInputEvent reports a change the player made to an input in their
1071
+ * interface, with the value as the host checked it.
1072
+ */
1073
+ export interface UiInputEvent {
1074
+ /** player is the player who changed it. */
1075
+ readonly player: Player;
1076
+ /** node is the id of the input. */
1077
+ readonly node: string;
1078
+ /** value is the input's new value, in the kind its control holds. */
1079
+ readonly value?: string | number | boolean | number;
1080
+ }
1081
+ /** StartEvent describes the server the mod starts in. */
1082
+ export interface StartEvent {
1083
+ /** args holds the arguments that follow -- on the host command line. */
1084
+ readonly args: string[];
1085
+ /**
1086
+ * checkOnly is true when the host checks the mod without starting a game.
1087
+ * The mod then hears no game events, and a call that needs the game fails;
1088
+ * logging, the host's services, settings, metrics, files, interfaces and
1089
+ * the reload hold still answer.
1090
+ */
1091
+ readonly checkOnly: boolean;
1092
+ /**
1093
+ * source holds an interpreted mod's entry, which the interpreter module
1094
+ * evaluates during start. It is empty for a compiled mod.
1095
+ */
1096
+ readonly source: Uint8Array;
1097
+ }
1098
+ /** StartResult declares which events the mod consumes. */
1099
+ export interface StartResult {
1100
+ /** frames asks for a Frame event every server frame. */
1101
+ frames: boolean;
1102
+ /** damage asks for a damage event before each hit. */
1103
+ damage: boolean;
1104
+ /** damaged asks for a damaged event after each hit. */
1105
+ damaged: boolean;
1106
+ /** chat asks for a chat event for each chat line. */
1107
+ chat: boolean;
1108
+ }
1109
+ /** FrameEvent identifies one server frame. */
1110
+ export interface FrameEvent {
1111
+ /** tick is the server tick, or zero when the clock is unavailable. */
1112
+ readonly tick: bigint;
1113
+ /** timeSeconds is the game clock at this frame, in seconds. */
1114
+ readonly timeSeconds: number;
1115
+ /**
1116
+ * movement holds one sample per watched, live hero when this frame starts a
1117
+ * new tick, and is empty otherwise.
1118
+ */
1119
+ readonly movement: MovementSample[];
1120
+ }
1121
+ /**
1122
+ * CommandEvent carries one command line from a player: a chat line that
1123
+ * starts with a slash (or ".", "+" or "-"), without that prefix, or a console
1124
+ * command the server received.
1125
+ */
1126
+ export interface CommandEvent {
1127
+ /** player is the player who typed the command. */
1128
+ readonly player: Player;
1129
+ /** line is the complete command line, starting with the command name. */
1130
+ readonly line: string;
1131
+ }
1132
+ /**
1133
+ * ChatEvent carries one chat line as the server accepted it, commands
1134
+ * included.
1135
+ */
1136
+ export interface ChatEvent {
1137
+ /** player is the player who wrote the line. */
1138
+ readonly player: Player;
1139
+ /** text is the line as written. */
1140
+ readonly text: string;
1141
+ /** all is true for chat every player reads, false for team chat. */
1142
+ readonly all: boolean;
1143
+ /**
1144
+ * lane is the CMsgLaneColor of the lane the line pings: 1 yellow, 3
1145
+ * green, 4 blue, 6 purple, or 0 for none.
1146
+ */
1147
+ readonly lane: number;
1148
+ }
1149
+ /** CommandResult answers whether the mod handled a command. */
1150
+ export interface CommandResult {
1151
+ /**
1152
+ * claimed ends the command's dispatch; the game and later mods do not see
1153
+ * it.
1154
+ */
1155
+ claimed: boolean;
1156
+ }
1157
+ /** WorldEvent announces a loaded world. */
1158
+ export interface WorldEvent {
1159
+ /** map names the world's map. */
1160
+ readonly map: string;
1161
+ }
1162
+ /**
1163
+ * ServiceCall calls one method of a service outside Modlock. A host that
1164
+ * embeds Modlock provides services of its own, such as a game mode's match,
1165
+ * and a mod may serve one to the host. The service and its caller agree on
1166
+ * the payload's encoding.
1167
+ */
1168
+ export interface ServiceCall {
1169
+ /** service names the service, such as "arena.match". */
1170
+ readonly service: string;
1171
+ /** method names the method within the service. */
1172
+ readonly method: string;
1173
+ /** payload is the call's argument. */
1174
+ readonly payload: Uint8Array;
1175
+ }
1176
+ /** ServiceReply is a service's answer. */
1177
+ export interface ServiceReply {
1178
+ /** payload is the answer. */
1179
+ payload: Uint8Array;
1180
+ }
1181
+ /** PrecacheOptions names what the next world loads ahead of use. */
1182
+ export interface PrecacheOptions {
1183
+ /** heroes are hero names, such as hero_wraith. */
1184
+ heroes?: readonly string[];
1185
+ /**
1186
+ * resources are model and particle paths, such as models/props/crate.vmdl,
1187
+ * with {addon} for the mod's content addon, as in models/{addon}/pawn.vmdl.
1188
+ */
1189
+ resources?: readonly string[];
1190
+ }
1191
+ /** Player addresses one connected player by their server slot. */
1192
+ export declare class Player {
1193
+ /** slot identifies the player on the server. */
1194
+ readonly slot: number;
1195
+ constructor(slot: number);
1196
+ /** chat sends a server chat line to the player. */
1197
+ chat(text: string): boolean;
1198
+ /**
1199
+ * centerText shows text in the middle of the player's screen until it is
1200
+ * replaced. Empty text clears it.
1201
+ */
1202
+ centerText(text: string): boolean;
1203
+ /** announce shows a game announcement with a title to the player. */
1204
+ announce(title: string, text: string): boolean;
1205
+ /** pawn returns the player's hero this frame, or nothing without one. */
1206
+ pawn(): Pawn | undefined;
1207
+ /**
1208
+ * setting returns the player's value of a setting the manifest
1209
+ * declares: the value they chose, or the setting's default. A bot has the
1210
+ * defaults.
1211
+ */
1212
+ setting(key: string): string | undefined;
1213
+ /**
1214
+ * setSetting changes the player's value of a setting the manifest
1215
+ * declares. The value follows the player to later games and other mods'
1216
+ * servers of the same mod; a bot keeps the defaults.
1217
+ */
1218
+ setSetting(key: string, value: string): boolean;
1219
+ /**
1220
+ * addMetric adds to the player's total of a metric the manifest declares.
1221
+ * The host keeps each player's totals in memory and hands them on once,
1222
+ * when the player leaves or the mod stops; a bot keeps none.
1223
+ */
1224
+ addMetric(name: string, value: number, label?: string): boolean;
1225
+ /**
1226
+ * handoff replaces the handoff state for the player, such as the
1227
+ * panels their HUD shows. It lasts only through a reload of the mod in the
1228
+ * same game, in memory, as the game's does, and ends early when the player
1229
+ * leaves; only that player reads it back, and a bot keeps none.
1230
+ */
1231
+ handoff(text: string): boolean;
1232
+ /** handedOff returns the player's handoff state, or empty. */
1233
+ handedOff(): string | undefined;
1234
+ /**
1235
+ * selectHero gives the player a hero on a team, 2 or 3, and returns the
1236
+ * hero's identifier as Pawn.hero reports it. The hero appears on a later
1237
+ * frame.
1238
+ */
1239
+ selectHero(hero: string | number, team: number): number | undefined;
1240
+ /**
1241
+ * spectate moves the player to the spectators, without a hero. The player
1242
+ * watches until a hero selection seats them again.
1243
+ */
1244
+ spectate(): boolean;
1245
+ /**
1246
+ * watch points the player's camera at a hero, through the hero's own view
1247
+ * or chasing it, as the game's spectator camera follows it. A spectator watches through
1248
+ * their spectator camera, once it exists. A player with a hero watches
1249
+ * while the hero stays where it stands, keeping its level, souls and items,
1250
+ * until Unwatch returns them to it.
1251
+ */
1252
+ watch(target: number, chase?: boolean): boolean;
1253
+ /**
1254
+ * freeCamera lets the player fly their camera from a position, with the
1255
+ * movement keys and the mouse, as the game's roaming spectator camera does.
1256
+ * A player with a hero leaves it where it stands, as Watch does, until
1257
+ * Unwatch returns them to it; Watch follows a hero again.
1258
+ */
1259
+ freeCamera(position: Vector, facing: Angles): boolean;
1260
+ /**
1261
+ * moveCamera adds one operation to the player's camera, as the game's
1262
+ * abilities pull it back, widen its view or swing it to a point. Operations
1263
+ * run alongside the game's own until they end or ClearCamera removes them.
1264
+ */
1265
+ moveCamera(options: CameraOptions): boolean;
1266
+ /**
1267
+ * clearCamera removes a context's camera operations from the player's
1268
+ * camera, or every operation, and the camera returns to its usual place.
1269
+ */
1270
+ clearCamera(context?: string): boolean;
1271
+ /**
1272
+ * unwatch returns a player watching or flying the free camera from their
1273
+ * hero back to it. Stopping the mod returns every such player.
1274
+ */
1275
+ unwatch(): boolean;
1276
+ /** respawn revives the player's dead hero. */
1277
+ respawn(): boolean;
1278
+ /**
1279
+ * changeTeam moves the player's hero, living or dead, to team 2 or 3 where
1280
+ * it stands, for a human or a bot alike. The hero keeps its hero,
1281
+ * abilities, items and health, and the player keeps their connection; a
1282
+ * dead hero respawns on its new team, on its timer or through Respawn. A
1283
+ * living hero moved inside the other team's base dies to the base's
1284
+ * defense. A player without a hero joins a team through SelectHero
1285
+ * instead.
1286
+ */
1287
+ changeTeam(team: number): boolean;
1288
+ /** clearItems removes every item the player's hero owns. */
1289
+ clearItems(): boolean;
1290
+ /**
1291
+ * freeze holds the player's hero in place, without input or damage, until
1292
+ * it is released. Stopping the mod releases it.
1293
+ */
1294
+ freeze(frozen?: boolean): boolean;
1295
+ /** restoreStamina refills the player's stamina. */
1296
+ restoreStamina(): boolean;
1297
+ /**
1298
+ * setStamina sets the player's stamina, as Pawn.stamina reads it. The game
1299
+ * regenerates it as usual afterwards.
1300
+ */
1301
+ setStamina(stamina: number): boolean;
1302
+ /**
1303
+ * refreshAbility ends the cooldown of the hero's ability named ability,
1304
+ * such as citadel_ability_melee_parry.
1305
+ */
1306
+ refreshAbility(ability: string): boolean;
1307
+ /**
1308
+ * abilities lists the abilities of the player's hero in the hero's order,
1309
+ * or none without a live hero.
1310
+ */
1311
+ abilities(): Ability[];
1312
+ /**
1313
+ * setAbility changes the upgrades, charges or timers of one of the hero's
1314
+ * abilities. An omitted option stays as it is.
1315
+ */
1316
+ setAbility(options: AbilityOptions): boolean;
1317
+ /**
1318
+ * giveItem gives the hero an item, enabled and free. A hero that owns it
1319
+ * keeps its one copy.
1320
+ */
1321
+ giveItem(item: string): boolean;
1322
+ /**
1323
+ * replaceAbility puts the ability named ability, untrained, in the hero's
1324
+ * ability slot index, as Ability.slot, removing the ability there. An
1325
+ * ability from another hero loads its models and particles only if
1326
+ * Precache named that hero and those resources before the world loaded;
1327
+ * otherwise its first effect stalls the game on a blocking load and the
1328
+ * game reports an assertion.
1329
+ */
1330
+ replaceAbility(index: number, ability: string): boolean;
1331
+ /**
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.
1337
+ */
1338
+ holdModifier(modifier: string, active?: boolean): boolean;
1339
+ /**
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.
1344
+ */
1345
+ giveModifier(modifier: string, seconds: number): boolean;
1346
+ /**
1347
+ * teleport moves the player's hero and turns it and the camera. With a
1348
+ * velocity it also sets the hero's motion, as a launch, and the camera
1349
+ * follows the hero.
1350
+ */
1351
+ teleport(position: Vector, facing: Angles, velocity?: Vector): boolean;
1352
+ /**
1353
+ * move carries the player's hero to a position as continuous motion,
1354
+ * as a recording plays back. Unlike Teleport it keeps the hero's animated
1355
+ * model drawn when repeated every tick, and leaves the camera alone.
1356
+ */
1357
+ move(position: Vector, facing: Angles, velocity?: Vector): boolean;
1358
+ /**
1359
+ * steer replays a recorded movement command on the player's hero, usually a
1360
+ * bot: the game runs the command's buttons and axes, so the hero crouches,
1361
+ * slides, jumps and mantles with its own animation, and the step then ends
1362
+ * on the recorded pose. The steering stays until the next Steer replaces
1363
+ * it, its presses and its pose counting once: on the ticks between, the
1364
+ * game's own movement carries the held command on from the pose. A Steer
1365
+ * without one releases the hero.
1366
+ */
1367
+ steer(steering?: Steering): boolean;
1368
+ /**
1369
+ * drive gives a bot the controls a player has, where it looks, the
1370
+ * movement axes and the buttons, as its input on every tick until the next
1371
+ * Drive replaces it. The game runs that input as a player's own, so the
1372
+ * hero accelerates, turns, jumps, dashes, slides and casts with its own
1373
+ * movement and animation; the bot's own brain no longer moves it. Presses
1374
+ * count once. A Drive without a command returns the bot to its brain.
1375
+ */
1376
+ drive(command?: DriveCommand): boolean;
1377
+ /**
1378
+ * adjustSouls gives the player delta souls, or takes them when delta is
1379
+ * negative. A spend larger than the player's souls fails and spends
1380
+ * nothing. Silent skips the pickup's sound and number.
1381
+ */
1382
+ adjustSouls(delta: number, silent?: boolean): boolean;
1383
+ /** startingSouls sets the souls the player's hero spawns with. */
1384
+ startingSouls(souls: number): boolean;
1385
+ /**
1386
+ * resetHero rebuilds the player's hero as it first spawned, without items,
1387
+ * ability upgrades, levels or ability points, holding souls.
1388
+ */
1389
+ resetHero(souls: number): boolean;
1390
+ /** heal restores health to the player's hero, up to its maximum. */
1391
+ heal(amount: number): boolean;
1392
+ /**
1393
+ * sound plays a game sound event, such as Damage.Send.Crit, on the
1394
+ * player's hero.
1395
+ */
1396
+ sound(sound: string): boolean;
1397
+ /**
1398
+ * restoreHero gives the player's live hero target over the next few
1399
+ * seconds: the build first, then health, stamina and pose once it settles,
1400
+ * then charges and cooldowns. A Restored event reports when the result has
1401
+ * held for a second, or why it could not. A new call replaces the running
1402
+ * one.
1403
+ */
1404
+ restoreHero(target: HeroTarget): boolean;
1405
+ /**
1406
+ * screenEffect plays a full-screen effect on the player's view. Effects of
1407
+ * one kind stack. The player's hero must be alive.
1408
+ */
1409
+ screenEffect(effect: ScreenEffect, timing?: ScreenTiming): boolean;
1410
+ /**
1411
+ * clearScreenEffect ends every running instance of effect on the player's
1412
+ * view.
1413
+ */
1414
+ clearScreenEffect(effect: ScreenEffect): boolean;
1415
+ /** removeBot removes a bot the mod added. */
1416
+ removeBot(): boolean;
1417
+ /**
1418
+ * blockInput withholds buttons from the player's hero until called
1419
+ * again, on top of the block on everyone. Zero releases the player.
1420
+ */
1421
+ blockInput(buttons: bigint): boolean;
1422
+ /**
1423
+ * press presses buttons at the player's next input, even through a block.
1424
+ * A bot presses them as a player would.
1425
+ */
1426
+ press(buttons: bigint): boolean;
1427
+ /** kill kills a player's hero, crediting no one. */
1428
+ kill(): boolean;
1429
+ /** setVelocity replaces the motion of a player's hero without moving it. */
1430
+ setVelocity(velocity: Vector): boolean;
1431
+ /**
1432
+ * buttons returns the buttons a player holds, as Buttons bits, while the
1433
+ * player is alive or dead.
1434
+ */
1435
+ buttons(): bigint | undefined;
1436
+ /**
1437
+ * watchMovement adds a player's hero to the movement samples of each Frame
1438
+ * event on a new tick, or removes it.
1439
+ */
1440
+ watchMovement(watch: boolean): boolean;
1441
+ }
1442
+ /** WorldObject is one object the mod placed in the world. */
1443
+ export declare class WorldObject {
1444
+ /** id identifies the object among the mod's objects. */
1445
+ readonly id: number;
1446
+ constructor(id: number);
1447
+ /**
1448
+ * move places the object at position, turning it to facing. The
1449
+ * physics step pulls a solid model to its new place over one tick, so a
1450
+ * model moved each frame strikes physics props such as the Hideout ball
1451
+ * with its speed instead of passing through them.
1452
+ */
1453
+ move(position: Vector, facing?: Angles): boolean;
1454
+ /** setText replaces a text object's words. */
1455
+ setText(text: string): boolean;
1456
+ /**
1457
+ * setHidden hides the object from one player or shows it again.
1458
+ * Other players still see it. A player who leaves sees every object when
1459
+ * they return.
1460
+ */
1461
+ setHidden(player: Player, hidden: boolean): boolean;
1462
+ /**
1463
+ * showOnlyTo sends the object only to the players with the listed
1464
+ * server slots; every other client drops it, or never receives it when the
1465
+ * call follows its creation in the same frame. With no players no client
1466
+ * receives it. The list replaces any earlier one and follows the object
1467
+ * when its entity changes. A player who leaves is taken off every list, so
1468
+ * whoever joins in their slot does not receive the object. A removed object
1469
+ * reaches no client while the engine retires its entity.
1470
+ */
1471
+ showOnlyTo(players?: readonly number[]): boolean;
1472
+ /**
1473
+ * showToAll sends the object to every player again, undoing
1474
+ * ShowObjectOnlyTo.
1475
+ */
1476
+ showToAll(): boolean;
1477
+ /** remove takes the object out of the world. */
1478
+ remove(): boolean;
1479
+ /**
1480
+ * entity returns the entity handle of a model or particle, as traces
1481
+ * report it and particle anchors take it.
1482
+ */
1483
+ entity(): number | undefined;
1484
+ }
1485
+ /** Npc is one unit the mod spawned. */
1486
+ export declare class Npc {
1487
+ /** entity is the unit's entity handle, as damage events report it. */
1488
+ readonly entity: number;
1489
+ constructor(entity: number);
1490
+ /** read returns the unit's state, or nothing once it is gone. */
1491
+ read(): NpcState | undefined;
1492
+ /**
1493
+ * move places the unit and sets its velocity, which drives its walk
1494
+ * animation. It reports false once the unit is gone.
1495
+ */
1496
+ move(position: Vector, facing?: Angles, velocity?: Vector): boolean;
1497
+ /**
1498
+ * setHealth sets the unit's health, and its maximum when given. It
1499
+ * reports false once the unit is gone.
1500
+ */
1501
+ setHealth(health: number, maxHealth?: number): boolean;
1502
+ /**
1503
+ * remove takes a unit the mod spawned out of the world without rewards.
1504
+ * It reports false when the unit was already gone.
1505
+ */
1506
+ remove(): boolean;
1507
+ }
1508
+ /** Pickup is one pickup the mod placed. */
1509
+ export declare class Pickup {
1510
+ /** entity is the pickup's entity handle. */
1511
+ readonly entity: number;
1512
+ constructor(entity: number);
1513
+ /**
1514
+ * present reports whether the pickup still lies in the world,
1515
+ * uncollected.
1516
+ */
1517
+ present(): boolean;
1518
+ /**
1519
+ * remove takes the pickup out of the world. It reports false when a
1520
+ * player had collected it.
1521
+ */
1522
+ remove(): boolean;
1523
+ }
1524
+ /** log writes one line to the server log under the mod's name. */
1525
+ export declare function log(message: string): boolean;
1526
+ /**
1527
+ * serverCommand runs one line at the server console, as if typed there. A
1528
+ * line that sets a variable may set a development-only or cheat-protected
1529
+ * one. A line that reaches the engine's controls for files, logging, the
1530
+ * network or the process, or stores a command to run later, is refused with
1531
+ * the name of the command.
1532
+ */
1533
+ export declare function serverCommand(command: string): boolean;
1534
+ /**
1535
+ * precache loads heroes and resources with the next world. Call it during
1536
+ * start, before the first world loads; a call after that, such as from a
1537
+ * reload, prepares only the world after the next map change. Name every
1538
+ * hero whose abilities ReplaceAbility gives, with their particles.
1539
+ */
1540
+ export declare function precache(options: PrecacheOptions): boolean;
1541
+ /**
1542
+ * readFile reads one of the mod's files: the host's copy, which the mod
1543
+ * wrote or the server's operator placed, else the one the mod ships under
1544
+ * data/. A file in neither reads as unset. Names that leave the mod's
1545
+ * directories are refused.
1546
+ */
1547
+ export declare function readFile(name: string): string | undefined;
1548
+ /**
1549
+ * writeFile replaces one of the mod's files in the host's copy, which
1550
+ * outlives a restart and an update of the mod; the files the mod ships stay
1551
+ * as they are. The write is whole or not at all, and the host refuses one
1552
+ * past its quota of 4 MiB per mod. A host that keeps no files refuses every
1553
+ * write.
1554
+ */
1555
+ export declare function writeFile(name: string, text: string): boolean;
1556
+ /**
1557
+ * holdReload keeps the running build through a reload while held is true,
1558
+ * such as while a player is partway through something a new build would
1559
+ * lose. A reload that arrives meanwhile waits, and the newest one applies
1560
+ * on the first frame after the mod releases the hold. A new build starts
1561
+ * without a hold.
1562
+ */
1563
+ export declare function holdReload(held: boolean): boolean;
1564
+ /**
1565
+ * handoff replaces the handoff state for the game: what the running build
1566
+ * hands the next build when the mod reloads, such as which round it plays.
1567
+ * It lasts only through a reload of the mod in the same game, such as an
1568
+ * update, whose new build reads it back with HandedOff. The host holds it
1569
+ * in memory and never writes it to disk, so it ends when the mod stops or
1570
+ * the server restarts. The host refuses state past 64 KiB.
1571
+ */
1572
+ export declare function handoff(text: string): boolean;
1573
+ /** handedOff returns the game's handoff state, or empty. */
1574
+ export declare function handedOff(): string | undefined;
1575
+ /**
1576
+ * heroBuild reads a hero's recommended build from the host's game data:
1577
+ * its categories of items in buying order. Items the game does not define
1578
+ * are left out, so every item returned is one GiveItem accepts. A hero
1579
+ * without a build answers with no categories. The call needs a loaded
1580
+ * world.
1581
+ */
1582
+ export declare function heroBuild(hero: string): BuildCategory[];
1583
+ /**
1584
+ * readField reads one schema field of a live entity, such as the int32
1585
+ * m_iHealth of CBaseEntity. The host finds the field by name, so it
1586
+ * survives game updates that move it, and refuses an entity that is not of
1587
+ * the named class or a subclass. The match's state, such as the gold of each
1588
+ * team or the winning team, is a field of CCitadelGameRules, which the
1589
+ * citadel_gamerules entity reads. The parts of an entity's model that its
1590
+ * body component holds read through the entity too: CGameSceneNode, and for
1591
+ * a model entity CSkeletonInstance and CModelState, such as the uint64
1592
+ * m_MeshGroupMask of CModelState that chooses which mesh groups draw.
1593
+ */
1594
+ export declare function readField(entity: number, className: string, field: string, type: FieldType): FieldValue | undefined;
1595
+ /**
1596
+ * readModifierField reads one schema field of a modifier the entity holds,
1597
+ * such as the int32 m_nCameraLevel of CCitadel_Modifier_OrbitCamera on a
1598
+ * pawn holding modifier_citadel_orbit_camera. The answer holds no value
1599
+ * while the entity lacks the modifier. The host cannot check the modifier's
1600
+ * class, so a wrong class reads the wrong bytes, though never past readable
1601
+ * memory.
1602
+ */
1603
+ export declare function readModifierField(entity: number, modifier: string, className: string, field: string, type: FieldType): FieldValue | undefined;
1604
+ /**
1605
+ * writeField writes one schema field of a live entity and sends the change
1606
+ * to the players. The value takes the form ReadField returns for the type.
1607
+ * Text goes only to a symbol field (string_t, such as the m_DialogXMLName of
1608
+ * a point_clientui_world_panel), with {addon} replaced by the mod's content
1609
+ * addon as in an entity's key values; a CUtlString field owns its text and
1610
+ * cannot be written. A write to the match's state sends all of it, so
1611
+ * players already in the match see the change, and a write to a model part,
1612
+ * as ReadField names them, sends the entity. A client builds a client UI
1613
+ * entity's panel only when it creates the entity, so a write to
1614
+ * m_DialogXMLName sends every client a full update on the next frame, which
1615
+ * creates every entity again; the players' game stalls briefly, so write a
1616
+ * layout when it changes, not every frame.
1617
+ */
1618
+ export declare function writeField(entity: number, className: string, field: string, type: FieldType, value: FieldValue): boolean;
1619
+ /**
1620
+ * readFieldList reads a field that holds a list, such as the m_vecBannedHeroes
1621
+ * of CCitadelGameRules. The type is the type of one element: a number, a
1622
+ * handle, a boolean or a vector. A list of structures cannot be read.
1623
+ */
1624
+ export declare function readFieldList(entity: number, className: string, field: string, type: FieldType): FieldValue[];
1625
+ /**
1626
+ * writeFieldList replaces the elements of a list field and sends the change
1627
+ * to the players, growing the list when it holds fewer elements than the
1628
+ * new ones.
1629
+ */
1630
+ export declare function writeFieldList(entity: number, className: string, field: string, type: FieldType, values?: readonly FieldValue[]): boolean;
1631
+ /**
1632
+ * entityClass returns a live entity's schema class, such as
1633
+ * CCitadelPlayerPawn, whose fields ReadField reads, and its designer name.
1634
+ */
1635
+ export declare function entityClass(entity: number): EntityClassName | undefined;
1636
+ /**
1637
+ * entityName returns a live entity's name, the targetname a map or a spawn
1638
+ * key value gave it, or an empty name for an unnamed entity.
1639
+ */
1640
+ export declare function entityName(entity: number): string | undefined;
1641
+ /**
1642
+ * entityPosition returns where a live entity stands, its absolute origin
1643
+ * and angles, as MoveEntity places it, and its velocity. Any entity with a
1644
+ * place in the world has one, such as one of the map's boxes.
1645
+ */
1646
+ export declare function entityPosition(entity: number): EntityPlacement | undefined;
1647
+ /**
1648
+ * modifierState reports whether an entity has a modifier state, such as
1649
+ * MODIFIER_STATE_PARRY_ACTIVE.
1650
+ */
1651
+ export declare function modifierState(entity: number, state: string): boolean;
1652
+ /**
1653
+ * holdModifierState holds a modifier state, such as
1654
+ * MODIFIER_STATE_FRIENDLY_FIRE_ENABLED, on an entity while the mod runs, or
1655
+ * releases the hold. The hold ends with the entity.
1656
+ */
1657
+ export declare function holdModifierState(entity: number, state: string, active?: boolean): boolean;
1658
+ /**
1659
+ * setFreeForAll turns free-for-all on or off for the running mod, over the
1660
+ * Manifest's free_for_all default. While on, the host seats each new player
1661
+ * on the smaller team with no team screen, holds friendly fire on every
1662
+ * hero, makes teammates enemies to abilities, projectiles and target
1663
+ * checks, and ignores changeteam commands. The stock hero picker does not
1664
+ * open for a seated player, so the mod gives each seated player whose pawn
1665
+ * has hero 0 a hero with SelectHero. Turning it off releases the friendly
1666
+ * fire holds and restores stock team relations; players keep their teams.
1667
+ * Clients still draw teammates as allies.
1668
+ */
1669
+ export declare function setFreeForAll(enabled: boolean): boolean;
1670
+ /**
1671
+ * setTeamSeating turns team seating on or off for the running mod. While
1672
+ * on, the host seats each player who joins with no team on the smaller
1673
+ * team with no team screen; friendly fire and changeteam stay as the game
1674
+ * has them. The stock hero picker does not open for a seated player, so
1675
+ * the mod gives each seated player whose pawn has hero 0 a hero with
1676
+ * SelectHero. Free-for-all seats players this
1677
+ * way whatever this says. Turning it off leaves players on their teams.
1678
+ */
1679
+ export declare function setTeamSeating(enabled: boolean): boolean;
1680
+ /**
1681
+ * createModel places a model in the world, solid when the options ask.
1682
+ * The world removes it when the world ends; stopping the mod removes it
1683
+ * too.
1684
+ */
1685
+ export declare function createModel(options: ModelOptions): WorldObject | undefined;
1686
+ /** createText places text that floats in the world. */
1687
+ export declare function createText(options: TextOptions): WorldObject | undefined;
1688
+ /**
1689
+ * createParticle starts a particle effect. Removing the object stops it
1690
+ * and lets its end cap play out, unless the mod already stopped it, such as
1691
+ * with the DestroyImmediately input; moving it moves the effect.
1692
+ */
1693
+ export declare function createParticle(options: ParticleOptions): WorldObject | undefined;
1694
+ /**
1695
+ * createFog fills a box with tinted fog whose density fades across the
1696
+ * box's boundary. Removing the object clears it; moving it moves the box.
1697
+ */
1698
+ export declare function createFog(options: FogOptions): WorldObject | undefined;
1699
+ /**
1700
+ * addBot adds a bot player and returns it. The bot leaves when the world
1701
+ * ends or the mod stops.
1702
+ */
1703
+ export declare function addBot(options: BotOptions): Player | undefined;
1704
+ /**
1705
+ * blockInput withholds buttons from every player's hero until called
1706
+ * again. Stopping the mod releases them.
1707
+ */
1708
+ export declare function blockInput(buttons: bigint): boolean;
1709
+ /**
1710
+ * watchInput replaces the buttons whose presses and releases arrive as
1711
+ * Input events. Watching does not withhold a press; block it with
1712
+ * BlockInput.
1713
+ */
1714
+ export declare function watchInput(buttons: bigint): boolean;
1715
+ /**
1716
+ * remapInput makes the from buttons act as the to buttons for every
1717
+ * player's hero until called again; from reads as up. With repeat, a held
1718
+ * from button uses the to ability again as soon as it is ready. A zero from
1719
+ * stops remapping, and stopping the mod does too. BlockInput applies after
1720
+ * the remap.
1721
+ */
1722
+ export declare function remapInput(from: bigint, to: bigint, repeat?: boolean): boolean;
1723
+ /**
1724
+ * callService calls method of a service the host provides outside Modlock,
1725
+ * such as a game mode's match, and returns the service's answer. The
1726
+ * service defines the payload's encoding.
1727
+ */
1728
+ export declare function callService(service: string, method: string, payload: Uint8Array): Uint8Array | undefined;
1729
+ /**
1730
+ * createEntity creates any entity the server knows by its designer name,
1731
+ * such as npc_trooper_boss or prop_dynamic, with spawn key values and fields
1732
+ * written before it spawns. The world removes it when the world ends;
1733
+ * stopping the mod removes it too. It refuses an ability, item or weapon,
1734
+ * which only a hero holds: GiveItem and ReplaceAbility give one.
1735
+ */
1736
+ export declare function createEntity(options: EntityOptions): number | undefined;
1737
+ /**
1738
+ * fireInput sends an input to a live entity, as a map's output would, such
1739
+ * as Skin with the integer 1. The value must have the type the input reads.
1740
+ * It reports false once the entity is gone.
1741
+ */
1742
+ export declare function fireInput(entity: number, input: string, value?: EntityValue, activator?: number): boolean;
1743
+ /**
1744
+ * removeEntity takes an entity the mod created out of the world without
1745
+ * rewards. It reports false when the entity was already gone.
1746
+ */
1747
+ export declare function removeEntity(entity: number): boolean;
1748
+ /**
1749
+ * showEntityOnlyTo sends an entity the mod created only to the players with
1750
+ * the listed server slots; every other client drops it, or never receives
1751
+ * it when the call follows its creation in the same frame. With no players
1752
+ * no client receives it. The list replaces any earlier one. A player who
1753
+ * leaves is taken off every list, so whoever joins in their slot does not
1754
+ * receive the entity. The rule holds for an entity created with
1755
+ * TransmitAlways too, but not for entities parented to it, which need their
1756
+ * own call. Removing the entity, the world ending or the mod stopping drops
1757
+ * the rule.
1758
+ */
1759
+ export declare function showEntityOnlyTo(entity: number, players?: readonly number[]): boolean;
1760
+ /**
1761
+ * showEntityToAll sends an entity the mod created to every player the game
1762
+ * would send it to again, undoing ShowEntityOnlyTo.
1763
+ */
1764
+ export declare function showEntityToAll(entity: number): boolean;
1765
+ /**
1766
+ * spawnNpc adds a unit that is not a player, such as a trooper, as
1767
+ * CreateEntity does, then sets its health and lane. It thinks from the next
1768
+ * frame. The world removes it when the world ends; stopping
1769
+ * the mod removes it too.
1770
+ */
1771
+ export declare function spawnNpc(options: NpcOptions): Npc | undefined;
1772
+ /**
1773
+ * createPickup places an urn, which a hero carries once collected, or a
1774
+ * movement buff. Stopping the mod removes it.
1775
+ */
1776
+ export declare function createPickup(kind: PickupKind, position: Vector): Pickup | undefined;
1777
+ /**
1778
+ * findEntities returns the handle of every live entity of a class, such as
1779
+ * zip_line_node.
1780
+ */
1781
+ export declare function findEntities(className: string): number[];
1782
+ /**
1783
+ * findEntitiesByName returns the handle of every live entity with a name,
1784
+ * the targetname a map or the targetname key value of CreateEntity gave it.
1785
+ */
1786
+ export declare function findEntitiesByName(name: string): number[];
1787
+ /**
1788
+ * removeEntities removes every entity of a class, such as npc_trooper,
1789
+ * without rewards, and returns how many it removed.
1790
+ */
1791
+ export declare function removeEntities(className: string): number | undefined;
1792
+ /**
1793
+ * clearMap removes the map's own units and objectives, such as troopers,
1794
+ * guardians and walkers, so a mode can use the map as an arena.
1795
+ */
1796
+ export declare function clearMap(): boolean;
1797
+ /**
1798
+ * damage deals a hit as the game would. The mod's Damage events do not
1799
+ * include its own hits.
1800
+ */
1801
+ export declare function damage(options: HitOptions): boolean;
1802
+ /**
1803
+ * trace returns where a line first hits something, or nothing when it hits
1804
+ * nothing or the world's collision is not ready.
1805
+ */
1806
+ export declare function trace(options: TraceOptions): TraceHit | undefined;
1807
+ /**
1808
+ * restoreNpcs replaces the map's lane units and objectives with targets
1809
+ * over the next frames. Units of these classes not in the list are
1810
+ * removed, structures that match are kept, and moving units are spawned
1811
+ * again in place. An NpcsRestored event reports when every target stands
1812
+ * as its own unit, or why not. A new call replaces the running one.
1813
+ */
1814
+ export declare function restoreNpcs(npcs?: readonly NpcTarget[]): boolean;
1815
+ /**
1816
+ * pause stops or resumes the game clock, as the pause command would.
1817
+ * Stopping the mod resumes it.
1818
+ */
1819
+ export declare function pause(paused: boolean): boolean;
1820
+ /** matchClock returns the match time in seconds that the scoreboard shows. */
1821
+ export declare function matchClock(): number | undefined;
1822
+ /**
1823
+ * holdMatchClock keeps the match time at seconds every frame until called
1824
+ * again; omitted seconds let it run.
1825
+ */
1826
+ export declare function holdMatchClock(seconds?: number): boolean;
1827
+ /** rift reads the Rift objective's state. */
1828
+ export declare function rift(): RiftState | undefined;
1829
+ /** startRift opens the Rift objective at position now. */
1830
+ export declare function startRift(position: Vector): boolean;
1831
+ /**
1832
+ * moveEntity places any entity, such as a projectile, and replaces its
1833
+ * facing and motion when given. Without a position it leaves the entity
1834
+ * where it is, so a velocity alone steers a body the physics simulates, such
1835
+ * as a prop_physics, which carries the motion on against the world.
1836
+ */
1837
+ export declare function moveEntity(entity: number, position?: Vector, facing?: Angles, velocity?: Vector): boolean;
1838
+ /**
1839
+ * pushEntity adds a velocity and an angular velocity to any entity. On a
1840
+ * body the physics simulates, such as a prop_physics, it acts like an
1841
+ * impulse that the simulation carries on.
1842
+ */
1843
+ export declare function pushEntity(entity: number, velocity: Vector, spin?: Vector): boolean;
1844
+ /** emitSound plays one game sound on any entity, such as a projectile. */
1845
+ export declare function emitSound(entity: number, sound: string): boolean;
1846
+ /**
1847
+ * watchProjectiles reports the projectiles with these designer names, such
1848
+ * as rocket_launcher_rocket_projectile, in Launch and Impact events. A new
1849
+ * call replaces the list; an empty list stops watching.
1850
+ */
1851
+ export declare function watchProjectiles(options: ProjectileOptions): boolean;
1852
+ /** ModHandlers handles the events the game delivers to the mod. */
1853
+ export interface ModHandlers {
1854
+ /** start begins the mod's active lifetime, once, before any other event. */
1855
+ start(event: StartEvent): StartResult;
1856
+ /** frame runs once per server frame while the mod asked for frames. */
1857
+ frame(event: FrameEvent): void;
1858
+ /** command offers one command a player typed. */
1859
+ command(event: CommandEvent): CommandResult;
1860
+ /**
1861
+ * chat reports each chat line the server accepted from a player the mod
1862
+ * serves, while the mod asked for chat, before the line's command.
1863
+ */
1864
+ chat(event: ChatEvent): void;
1865
+ /**
1866
+ * world follows each world load, and start when a world has already
1867
+ * loaded. Objects and bots from an earlier world are gone by then.
1868
+ */
1869
+ world(event: WorldEvent): void;
1870
+ /** uiPress reports a press on a button in a player's interface. */
1871
+ uiPress(event: UiPressEvent): void;
1872
+ /** uiInput reports a change to an input in a player's interface. */
1873
+ uiInput(event: UiInputEvent): void;
1874
+ /** serve calls a service the mod serves from the host. */
1875
+ serve(event: ServiceCall): ServiceReply;
1876
+ /**
1877
+ * damage offers one hit before the game applies it, while the mod asked
1878
+ * for damage. The mod's answer may block the hit or change its amount.
1879
+ */
1880
+ damage(event: DamageEvent): DamageResult;
1881
+ /**
1882
+ * damaged reports one hit the game applied, while the mod asked for
1883
+ * damage reports. Hits arrive before the next frame.
1884
+ */
1885
+ damaged(event: DamagedEvent): void;
1886
+ /**
1887
+ * input reports one player's presses of watched buttons, before the next
1888
+ * frame. A block in place still withholds them from the hero.
1889
+ */
1890
+ input(event: InputEvent): void;
1891
+ /** restored ends one RestoreHero, before the next frame. */
1892
+ restored(event: RestoredEvent): void;
1893
+ /** npcsRestored ends one RestoreNpcs, before the next frame. */
1894
+ npcsRestored(event: NpcsRestoredEvent): void;
1895
+ /**
1896
+ * launch reports a watched projectile's first frame, before the next frame.
1897
+ */
1898
+ launch(event: LaunchEvent): void;
1899
+ /**
1900
+ * impact reports a watched projectile striking something, inside the
1901
+ * game's impact and after its own explosion. The mod's calls apply before
1902
+ * the game continues.
1903
+ */
1904
+ impact(event: ImpactEvent): void;
1905
+ /**
1906
+ * landed reports a hero landing under the manifest's QuakeWorld movement,
1907
+ * before the next frame.
1908
+ */
1909
+ landed(event: LandedEvent): void;
1910
+ /**
1911
+ * settingChanged reports a player's setting that changed outside the mod,
1912
+ * such as on the player's profile. A mod's own SetPlayerSetting reports
1913
+ * nothing.
1914
+ */
1915
+ settingChanged(event: SettingChangedEvent): void;
1916
+ /**
1917
+ * playersChanged reports the occupied player slots before the first event
1918
+ * after Start, and again before the next event whenever a player joins,
1919
+ * finishes joining or leaves, so a mod lists players without a call.
1920
+ */
1921
+ playersChanged(event: PlayersChangedEvent): void;
1922
+ }
1923
+ /**
1924
+ * serveMod runs the encoded Call in bytes on handlers and returns the encoded
1925
+ * Reply. A handler that throws answers with its error.
1926
+ */
1927
+ export declare function serveMod(handlers: ModHandlers, bytes: Uint8Array): Uint8Array;