@modlock/modlock 0.1.73 → 0.1.75

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
@@ -874,11 +874,20 @@ export interface Connection {
874
874
  */
875
875
  readonly roles: ModRole[];
876
876
  }
877
- /** Pawn is one player's hero this frame. */
877
+ /**
878
+ * Pawn is one player's pawn this frame: their hero, or the game's placeholder
879
+ * before a hero is selected.
880
+ */
878
881
  export interface Pawn {
879
- /** entity is the hero's entity handle, which ReadField reads. */
882
+ /**
883
+ * entity is the pawn's entity handle, which ReadField reads. It changes
884
+ * whenever the game replaces the pawn.
885
+ */
880
886
  readonly entity: number;
881
- /** hero identifies the hero, as SelectHero returns it. */
887
+ /**
888
+ * hero identifies the hero, as SelectHero returns it, or is 0 for a
889
+ * placeholder pawn that has none yet.
890
+ */
882
891
  readonly hero: number;
883
892
  /** team is the hero's team number. */
884
893
  readonly team: number;
@@ -929,6 +938,10 @@ export interface Pawn {
929
938
  * from items included. Absent when the game's own reading is unavailable.
930
939
  */
931
940
  readonly effectiveMaxHealth?: number;
941
+ /** abilityPoints is the ability points the player holds unspent. */
942
+ readonly abilityPoints: number;
943
+ /** abilityUnlocks is the ability unlocks the player holds unspent. */
944
+ readonly abilityUnlocks: number;
932
945
  }
933
946
  /**
934
947
  * Score is one player's scoreboard counters since the match began, as the
@@ -1261,7 +1274,10 @@ export interface FrameEvent {
1261
1274
  export interface CommandEvent {
1262
1275
  /** player is the player who typed the command. */
1263
1276
  readonly player: Player;
1264
- /** line is the complete command line, starting with the command name. */
1277
+ /**
1278
+ * line is the complete command line, starting with the command name in
1279
+ * lower case, whatever case the player typed; the arguments keep theirs.
1280
+ */
1265
1281
  readonly line: string;
1266
1282
  }
1267
1283
  /**
@@ -1346,7 +1362,12 @@ export declare class Player {
1346
1362
  centerText(text: string): boolean;
1347
1363
  /** announce shows a game announcement with a title to the player. */
1348
1364
  announce(title: string, text: string): boolean;
1349
- /** pawn returns the player's hero this frame, or nothing without one. */
1365
+ /**
1366
+ * pawn returns the player's pawn this frame: the hero, or the game's
1367
+ * placeholder with hero 0 that a player joining on a team holds until a hero
1368
+ * is selected. It returns nothing for a spectator and before the game has
1369
+ * made a pawn. The pawn's entity changes whenever the game replaces it.
1370
+ */
1350
1371
  pawn(): Pawn | undefined;
1351
1372
  /**
1352
1373
  * setting returns the player's value of a setting the manifest
@@ -1378,7 +1399,9 @@ export declare class Player {
1378
1399
  /**
1379
1400
  * selectHero gives the player a hero on a team, 2 or 3, and returns the
1380
1401
  * hero's identifier as Pawn.hero reports it. The hero appears on a later
1381
- * frame.
1402
+ * frame. A hero the player picked through the game's Change Hero wins: the
1403
+ * game removes the old hero before it spawns the pick, and a call in that
1404
+ * gap, up to 5 seconds, fails and leaves the pick to land.
1382
1405
  */
1383
1406
  selectHero(hero: string | number, team: number): number | undefined;
1384
1407
  /**
@@ -1417,7 +1440,10 @@ export declare class Player {
1417
1440
  * hero back to it. Stopping the mod returns every such player.
1418
1441
  */
1419
1442
  unwatch(): boolean;
1420
- /** respawn revives the player's dead hero. */
1443
+ /**
1444
+ * respawn revives the player's dead hero. A pawn with hero 0 has no hero to
1445
+ * revive; the call fails until SelectHero gives it one.
1446
+ */
1421
1447
  respawn(): boolean;
1422
1448
  /**
1423
1449
  * changeTeam moves the player's hero, living or dead, to team 2 or 3 where
@@ -1466,14 +1492,19 @@ export declare class Player {
1466
1492
  */
1467
1493
  giveItem(item: string, imbue?: number): boolean;
1468
1494
  /**
1469
- * replaceAbility puts the ability named ability, untrained, in the hero's
1470
- * ability slot index, as Ability.slot, removing the ability there. An
1471
- * ability from another hero loads its models and particles only if
1472
- * Precache named that hero and those resources before the world loaded;
1473
- * otherwise its first effect stalls the game on a blocking load and the
1474
- * game reports an assertion.
1495
+ * replaceAbility puts the ability named ability, untrained unless keep
1496
+ * carries the old one's progress, in the hero's ability slot index, as
1497
+ * Ability.slot, removing the ability there. The game trains and upgrades an
1498
+ * ability in slots 0 to 3 by its slot, so a player holds the upgrade key and
1499
+ * presses the slot's ability key to spend ability points on it, and training
1500
+ * an untrained one costs an ability unlock. A hero change or ResetHero gives
1501
+ * the hero its own abilities again, so a mod that keeps a swap replaces
1502
+ * again then. An ability from another hero loads its models and particles
1503
+ * only if Precache named that hero and those resources before the world
1504
+ * loaded; otherwise its first effect stalls the game on a blocking load and
1505
+ * the game reports an assertion.
1475
1506
  */
1476
- replaceAbility(index: number, ability: string): boolean;
1507
+ replaceAbility(index: number, ability: string, keep?: boolean): boolean;
1477
1508
  /**
1478
1509
  * holdModifier keeps a modifier, named as GiveModifier names it, on the
1479
1510
  * hero with no expiry, giving it back whenever the game removes it or the
@@ -1537,6 +1568,13 @@ export declare class Player {
1537
1568
  * nothing. Silent skips the pickup's sound and number.
1538
1569
  */
1539
1570
  adjustSouls(delta: number, silent?: boolean): boolean;
1571
+ /**
1572
+ * adjustAbilityPoints gives the player ability points and ability unlocks,
1573
+ * or takes them when negative, as Pawn.ability_points and
1574
+ * Pawn.ability_unlocks read them. A spend larger than the player holds
1575
+ * fails and spends nothing.
1576
+ */
1577
+ adjustAbilityPoints(points: number, unlocks: number): boolean;
1540
1578
  /** startingSouls sets the souls the player's hero spawns with. */
1541
1579
  startingSouls(souls: number): boolean;
1542
1580
  /**
@@ -1556,7 +1594,8 @@ export declare class Player {
1556
1594
  * seconds: the build first, then health, stamina and pose once it settles,
1557
1595
  * then charges and cooldowns. A Restored event reports when the result has
1558
1596
  * held for a second, or why it could not. A new call replaces the running
1559
- * one.
1597
+ * one. A pawn with hero 0 has no hero to restore; the call fails until
1598
+ * SelectHero gives it one.
1560
1599
  */
1561
1600
  restoreHero(target: HeroTarget): boolean;
1562
1601
  /**
package/index.d.ts CHANGED
@@ -47,8 +47,9 @@ export declare function serve(service: string, handler: Service): void;
47
47
  * command calls handler when a player types /name in chat or their client
48
48
  * sends the console command name to the server. The handler runs with the
49
49
  * next server frame, before the frame handlers, and receives the text after
50
- * the name, trimmed of surrounding spaces. Registering a name again replaces
51
- * its handler.
50
+ * the name, trimmed of surrounding spaces. Names are lower case and match
51
+ * whatever case the player types. Registering a name again replaces its
52
+ * handler.
52
53
  */
53
54
  export declare function command(name: string, handler: (player: Player, args: string) => void): void;
54
55
  /**
package/index.js CHANGED
@@ -3648,7 +3648,8 @@ var ReplaceAbilityRequest = /* @__PURE__ */ createMessageType(
3648
3648
  () => [
3649
3649
  [1, "player", 5],
3650
3650
  [2, "index", 13],
3651
- [3, "ability", 9]
3651
+ [3, "ability", 9],
3652
+ [4, "keep", 8, 4]
3652
3653
  ],
3653
3654
  {
3654
3655
  decode: (r, end, m) => {
@@ -3665,6 +3666,9 @@ var ReplaceAbilityRequest = /* @__PURE__ */ createMessageType(
3665
3666
  case 3:
3666
3667
  m.ability = r.string();
3667
3668
  break;
3669
+ case 4:
3670
+ m.keep = r.bool();
3671
+ break;
3668
3672
  default:
3669
3673
  r.skip(t);
3670
3674
  }
@@ -3684,6 +3688,10 @@ var ReplaceAbilityRequest = /* @__PURE__ */ createMessageType(
3684
3688
  const v = m.ability;
3685
3689
  if (v) w.uint32(26).string(v);
3686
3690
  }
3691
+ {
3692
+ const v = m.keep;
3693
+ if (v != null) w.uint32(32).bool(v);
3694
+ }
3687
3695
  }
3688
3696
  }
3689
3697
  );
@@ -6272,9 +6280,9 @@ var CountResponse = /* @__PURE__ */ createMessageType(
6272
6280
  }
6273
6281
  );
6274
6282
 
6275
- // src/wasm/files/files.pb.ts
6283
+ // src/wasm/files.pb.ts
6276
6284
  var ReadFileRequest = /* @__PURE__ */ createMessageType(
6277
- "modlock.wasm.files.ReadFileRequest",
6285
+ "modlock.wasm.ReadFileRequest",
6278
6286
  () => [[1, "path", 9]],
6279
6287
  {
6280
6288
  decode: (r, end, m) => {
@@ -6300,7 +6308,7 @@ var ReadFileRequest = /* @__PURE__ */ createMessageType(
6300
6308
  }
6301
6309
  );
6302
6310
  var ReadFileResponse = /* @__PURE__ */ createMessageType(
6303
- "modlock.wasm.files.ReadFileResponse",
6311
+ "modlock.wasm.ReadFileResponse",
6304
6312
  () => [[1, "text", 9, 4]],
6305
6313
  {
6306
6314
  decode: (r, end, m) => {
@@ -6326,7 +6334,7 @@ var ReadFileResponse = /* @__PURE__ */ createMessageType(
6326
6334
  }
6327
6335
  );
6328
6336
  var WriteFileRequest = /* @__PURE__ */ createMessageType(
6329
- "modlock.wasm.files.WriteFileRequest",
6337
+ "modlock.wasm.WriteFileRequest",
6330
6338
  () => [
6331
6339
  [1, "path", 9],
6332
6340
  [2, "text", 9]
@@ -6362,9 +6370,9 @@ var WriteFileRequest = /* @__PURE__ */ createMessageType(
6362
6370
  }
6363
6371
  );
6364
6372
 
6365
- // src/wasm/handoff/handoff.pb.ts
6373
+ // src/wasm/handoff.pb.ts
6366
6374
  var HandoffRequest = /* @__PURE__ */ createMessageType(
6367
- "modlock.wasm.handoff.HandoffRequest",
6375
+ "modlock.wasm.HandoffRequest",
6368
6376
  () => [[1, "text", 9]],
6369
6377
  {
6370
6378
  decode: (r, end, m) => {
@@ -6390,7 +6398,7 @@ var HandoffRequest = /* @__PURE__ */ createMessageType(
6390
6398
  }
6391
6399
  );
6392
6400
  var HandoffPlayerRequest = /* @__PURE__ */ createMessageType(
6393
- "modlock.wasm.handoff.HandoffPlayerRequest",
6401
+ "modlock.wasm.HandoffPlayerRequest",
6394
6402
  () => [
6395
6403
  [1, "player", 5],
6396
6404
  [2, "text", 9]
@@ -6426,7 +6434,7 @@ var HandoffPlayerRequest = /* @__PURE__ */ createMessageType(
6426
6434
  }
6427
6435
  );
6428
6436
  var HandedOffResponse = /* @__PURE__ */ createMessageType(
6429
- "modlock.wasm.handoff.HandedOffResponse",
6437
+ "modlock.wasm.HandedOffResponse",
6430
6438
  () => [[1, "text", 9]],
6431
6439
  {
6432
6440
  decode: (r, end, m) => {
@@ -6452,9 +6460,9 @@ var HandedOffResponse = /* @__PURE__ */ createMessageType(
6452
6460
  }
6453
6461
  );
6454
6462
 
6455
- // src/wasm/input/input.pb.ts
6463
+ // src/wasm/input.pb.ts
6456
6464
  var InputEvent = /* @__PURE__ */ createMessageType(
6457
- "modlock.wasm.input.InputEvent",
6465
+ "modlock.wasm.InputEvent",
6458
6466
  () => [
6459
6467
  [1, "player", 5],
6460
6468
  [2, "pressed", 4],
@@ -6498,7 +6506,7 @@ var InputEvent = /* @__PURE__ */ createMessageType(
6498
6506
  }
6499
6507
  );
6500
6508
  var ButtonsResponse = /* @__PURE__ */ createMessageType(
6501
- "modlock.wasm.input.ButtonsResponse",
6509
+ "modlock.wasm.ButtonsResponse",
6502
6510
  () => [[1, "buttons", 4]],
6503
6511
  {
6504
6512
  decode: (r, end, m) => {
@@ -6524,7 +6532,7 @@ var ButtonsResponse = /* @__PURE__ */ createMessageType(
6524
6532
  }
6525
6533
  );
6526
6534
  var InputRequest = /* @__PURE__ */ createMessageType(
6527
- "modlock.wasm.input.InputRequest",
6535
+ "modlock.wasm.InputRequest",
6528
6536
  () => [[1, "buttons", 4]],
6529
6537
  {
6530
6538
  decode: (r, end, m) => {
@@ -6550,7 +6558,7 @@ var InputRequest = /* @__PURE__ */ createMessageType(
6550
6558
  }
6551
6559
  );
6552
6560
  var PlayerInputRequest = /* @__PURE__ */ createMessageType(
6553
- "modlock.wasm.input.PlayerInputRequest",
6561
+ "modlock.wasm.PlayerInputRequest",
6554
6562
  () => [
6555
6563
  [1, "player", 5],
6556
6564
  [2, "buttons", 4]
@@ -6586,7 +6594,7 @@ var PlayerInputRequest = /* @__PURE__ */ createMessageType(
6586
6594
  }
6587
6595
  );
6588
6596
  var RemapInputRequest = /* @__PURE__ */ createMessageType(
6589
- "modlock.wasm.input.RemapInputRequest",
6597
+ "modlock.wasm.RemapInputRequest",
6590
6598
  () => [
6591
6599
  [1, "from", 4],
6592
6600
  [2, "to", 4],
@@ -6630,9 +6638,9 @@ var RemapInputRequest = /* @__PURE__ */ createMessageType(
6630
6638
  }
6631
6639
  );
6632
6640
 
6633
- // src/wasm/match/match.pb.ts
6641
+ // src/wasm/match.pb.ts
6634
6642
  var SetFreeForAllRequest = /* @__PURE__ */ createMessageType(
6635
- "modlock.wasm.match.SetFreeForAllRequest",
6643
+ "modlock.wasm.SetFreeForAllRequest",
6636
6644
  () => [[1, "enabled", 8]],
6637
6645
  {
6638
6646
  decode: (r, end, m) => {
@@ -6658,7 +6666,7 @@ var SetFreeForAllRequest = /* @__PURE__ */ createMessageType(
6658
6666
  }
6659
6667
  );
6660
6668
  var SetTeamSeatingRequest = /* @__PURE__ */ createMessageType(
6661
- "modlock.wasm.match.SetTeamSeatingRequest",
6669
+ "modlock.wasm.SetTeamSeatingRequest",
6662
6670
  () => [[1, "enabled", 8]],
6663
6671
  {
6664
6672
  decode: (r, end, m) => {
@@ -6684,7 +6692,7 @@ var SetTeamSeatingRequest = /* @__PURE__ */ createMessageType(
6684
6692
  }
6685
6693
  );
6686
6694
  var PauseRequest = /* @__PURE__ */ createMessageType(
6687
- "modlock.wasm.match.PauseRequest",
6695
+ "modlock.wasm.PauseRequest",
6688
6696
  () => [[1, "paused", 8]],
6689
6697
  {
6690
6698
  decode: (r, end, m) => {
@@ -6710,7 +6718,7 @@ var PauseRequest = /* @__PURE__ */ createMessageType(
6710
6718
  }
6711
6719
  );
6712
6720
  var MatchClockResponse = /* @__PURE__ */ createMessageType(
6713
- "modlock.wasm.match.MatchClockResponse",
6721
+ "modlock.wasm.MatchClockResponse",
6714
6722
  () => [[1, "seconds", 2]],
6715
6723
  {
6716
6724
  decode: (r, end, m) => {
@@ -6736,7 +6744,7 @@ var MatchClockResponse = /* @__PURE__ */ createMessageType(
6736
6744
  }
6737
6745
  );
6738
6746
  var HoldMatchClockRequest = /* @__PURE__ */ createMessageType(
6739
- "modlock.wasm.match.HoldMatchClockRequest",
6747
+ "modlock.wasm.HoldMatchClockRequest",
6740
6748
  () => [[1, "seconds", 2, 4]],
6741
6749
  {
6742
6750
  decode: (r, end, m) => {
@@ -6762,7 +6770,7 @@ var HoldMatchClockRequest = /* @__PURE__ */ createMessageType(
6762
6770
  }
6763
6771
  );
6764
6772
  var RiftResponse = /* @__PURE__ */ createMessageType(
6765
- "modlock.wasm.match.RiftResponse",
6773
+ "modlock.wasm.RiftResponse",
6766
6774
  () => [[1, "state", 11, 0, RiftState.codec]],
6767
6775
  {
6768
6776
  decode: (r, end, m) => {
@@ -6788,7 +6796,7 @@ var RiftResponse = /* @__PURE__ */ createMessageType(
6788
6796
  }
6789
6797
  );
6790
6798
  var RiftState = /* @__PURE__ */ createMessageType(
6791
- "modlock.wasm.match.RiftState",
6799
+ "modlock.wasm.RiftState",
6792
6800
  () => [
6793
6801
  [1, "scoring_team", 5],
6794
6802
  [2, "scoring_time", 2],
@@ -6856,7 +6864,7 @@ var RiftState = /* @__PURE__ */ createMessageType(
6856
6864
  }
6857
6865
  );
6858
6866
  var StartRiftRequest = /* @__PURE__ */ createMessageType(
6859
- "modlock.wasm.match.StartRiftRequest",
6867
+ "modlock.wasm.StartRiftRequest",
6860
6868
  () => [[1, "position", 11, 0, Vec3.codec]],
6861
6869
  {
6862
6870
  decode: (r, end, m) => {
@@ -8514,7 +8522,9 @@ var Pawn = /* @__PURE__ */ createMessageType(
8514
8522
  [15, "carrying_urn", 8, 4],
8515
8523
  [16, "score", 11, 0, Score.codec],
8516
8524
  [17, "camera_position", 11, 0, Vec3.codec],
8517
- [18, "effective_max_health", 5, 4]
8525
+ [18, "effective_max_health", 5, 4],
8526
+ [19, "ability_points", 5],
8527
+ [20, "ability_unlocks", 5]
8518
8528
  ],
8519
8529
  {
8520
8530
  decode: (r, end, m) => {
@@ -8588,6 +8598,12 @@ var Pawn = /* @__PURE__ */ createMessageType(
8588
8598
  case 18:
8589
8599
  m.effectiveMaxHealth = r.int32();
8590
8600
  break;
8601
+ case 19:
8602
+ m.abilityPoints = r.int32();
8603
+ break;
8604
+ case 20:
8605
+ m.abilityUnlocks = r.int32();
8606
+ break;
8591
8607
  default:
8592
8608
  r.skip(t);
8593
8609
  }
@@ -8667,6 +8683,14 @@ var Pawn = /* @__PURE__ */ createMessageType(
8667
8683
  const v = m.effectiveMaxHealth;
8668
8684
  if (v != null) w.uint32(144).int32(v);
8669
8685
  }
8686
+ {
8687
+ const v = m.abilityPoints;
8688
+ if (v) w.uint32(152).int32(v);
8689
+ }
8690
+ {
8691
+ const v = m.abilityUnlocks;
8692
+ if (v) w.uint32(160).int32(v);
8693
+ }
8670
8694
  }
8671
8695
  }
8672
8696
  );
@@ -9577,6 +9601,50 @@ var AdjustSoulsRequest = /* @__PURE__ */ createMessageType(
9577
9601
  }
9578
9602
  }
9579
9603
  );
9604
+ var AdjustAbilityPointsRequest = /* @__PURE__ */ createMessageType(
9605
+ "modlock.wasm.players.AdjustAbilityPointsRequest",
9606
+ () => [
9607
+ [1, "player", 5],
9608
+ [2, "points", 5],
9609
+ [3, "unlocks", 5]
9610
+ ],
9611
+ {
9612
+ decode: (r, end, m) => {
9613
+ while (r.pos < end) {
9614
+ const t = r.tag();
9615
+ if ((t & 7) === 4) return m;
9616
+ switch (t >>> 3) {
9617
+ case 1:
9618
+ m.player = r.int32();
9619
+ break;
9620
+ case 2:
9621
+ m.points = r.int32();
9622
+ break;
9623
+ case 3:
9624
+ m.unlocks = r.int32();
9625
+ break;
9626
+ default:
9627
+ r.skip(t);
9628
+ }
9629
+ }
9630
+ return m;
9631
+ },
9632
+ encode: (m, w) => {
9633
+ {
9634
+ const v = m.player;
9635
+ if (v) w.uint32(8).int32(v);
9636
+ }
9637
+ {
9638
+ const v = m.points;
9639
+ if (v) w.uint32(16).int32(v);
9640
+ }
9641
+ {
9642
+ const v = m.unlocks;
9643
+ if (v) w.uint32(24).int32(v);
9644
+ }
9645
+ }
9646
+ }
9647
+ );
9580
9648
  var StartingSoulsRequest = /* @__PURE__ */ createMessageType(
9581
9649
  "modlock.wasm.players.StartingSoulsRequest",
9582
9650
  () => [
@@ -12518,7 +12586,9 @@ function fromPawn(message) {
12518
12586
  carryingUrn: message.carryingUrn,
12519
12587
  score: message.score === void 0 ? void 0 : fromScore(message.score),
12520
12588
  cameraPosition: message.cameraPosition === void 0 ? void 0 : vector(message.cameraPosition),
12521
- effectiveMaxHealth: message.effectiveMaxHealth
12589
+ effectiveMaxHealth: message.effectiveMaxHealth,
12590
+ abilityPoints: message.abilityPoints ?? 0,
12591
+ abilityUnlocks: message.abilityUnlocks ?? 0
12522
12592
  };
12523
12593
  }
12524
12594
  function fromScore(message) {
@@ -12735,7 +12805,12 @@ var Player = class _Player {
12735
12805
  announce(title, text2) {
12736
12806
  return call("Announce", AnnounceRequest.toBinary({ player: this.slot, title, text: text2 })) !== void 0;
12737
12807
  }
12738
- /** pawn returns the player's hero this frame, or nothing without one. */
12808
+ /**
12809
+ * pawn returns the player's pawn this frame: the hero, or the game's
12810
+ * placeholder with hero 0 that a player joining on a team holds until a hero
12811
+ * is selected. It returns nothing for a spectator and before the game has
12812
+ * made a pawn. The pawn's entity changes whenever the game replaces it.
12813
+ */
12739
12814
  pawn() {
12740
12815
  const reply2 = call("Pawn", PlayerRequest.toBinary({ player: this.slot }));
12741
12816
  if (reply2 === void 0) return void 0;
@@ -12788,7 +12863,9 @@ var Player = class _Player {
12788
12863
  /**
12789
12864
  * selectHero gives the player a hero on a team, 2 or 3, and returns the
12790
12865
  * hero's identifier as Pawn.hero reports it. The hero appears on a later
12791
- * frame.
12866
+ * frame. A hero the player picked through the game's Change Hero wins: the
12867
+ * game removes the old hero before it spawns the pick, and a call in that
12868
+ * gap, up to 5 seconds, fails and leaves the pick to land.
12792
12869
  */
12793
12870
  selectHero(hero, team) {
12794
12871
  const reply2 = call("SelectHero", SelectHeroRequest.toBinary({ player: this.slot, hero: typeof hero === "string" ? { case: "heroName", value: hero } : typeof hero === "number" ? { case: "heroId", value: hero } : void 0, team: int32(team) }));
@@ -12844,7 +12921,10 @@ var Player = class _Player {
12844
12921
  unwatch() {
12845
12922
  return call("Unwatch", PlayerRequest.toBinary({ player: this.slot })) !== void 0;
12846
12923
  }
12847
- /** respawn revives the player's dead hero. */
12924
+ /**
12925
+ * respawn revives the player's dead hero. A pawn with hero 0 has no hero to
12926
+ * revive; the call fails until SelectHero gives it one.
12927
+ */
12848
12928
  respawn() {
12849
12929
  return call("Respawn", PlayerRequest.toBinary({ player: this.slot })) !== void 0;
12850
12930
  }
@@ -12916,15 +12996,20 @@ var Player = class _Player {
12916
12996
  return call("GiveItem", GiveItemRequest.toBinary({ player: this.slot, item: item2, imbue })) !== void 0;
12917
12997
  }
12918
12998
  /**
12919
- * replaceAbility puts the ability named ability, untrained, in the hero's
12920
- * ability slot index, as Ability.slot, removing the ability there. An
12921
- * ability from another hero loads its models and particles only if
12922
- * Precache named that hero and those resources before the world loaded;
12923
- * otherwise its first effect stalls the game on a blocking load and the
12924
- * game reports an assertion.
12999
+ * replaceAbility puts the ability named ability, untrained unless keep
13000
+ * carries the old one's progress, in the hero's ability slot index, as
13001
+ * Ability.slot, removing the ability there. The game trains and upgrades an
13002
+ * ability in slots 0 to 3 by its slot, so a player holds the upgrade key and
13003
+ * presses the slot's ability key to spend ability points on it, and training
13004
+ * an untrained one costs an ability unlock. A hero change or ResetHero gives
13005
+ * the hero its own abilities again, so a mod that keeps a swap replaces
13006
+ * again then. An ability from another hero loads its models and particles
13007
+ * only if Precache named that hero and those resources before the world
13008
+ * loaded; otherwise its first effect stalls the game on a blocking load and
13009
+ * the game reports an assertion.
12925
13010
  */
12926
- replaceAbility(index, ability) {
12927
- return call("ReplaceAbility", ReplaceAbilityRequest.toBinary({ player: this.slot, index, ability })) !== void 0;
13011
+ replaceAbility(index, ability, keep) {
13012
+ return call("ReplaceAbility", ReplaceAbilityRequest.toBinary({ player: this.slot, index, ability, keep })) !== void 0;
12928
13013
  }
12929
13014
  /**
12930
13015
  * holdModifier keeps a modifier, named as GiveModifier names it, on the
@@ -13005,6 +13090,15 @@ var Player = class _Player {
13005
13090
  adjustSouls(delta, silent) {
13006
13091
  return call("AdjustSouls", AdjustSoulsRequest.toBinary({ player: this.slot, delta: int32(delta), silent })) !== void 0;
13007
13092
  }
13093
+ /**
13094
+ * adjustAbilityPoints gives the player ability points and ability unlocks,
13095
+ * or takes them when negative, as Pawn.ability_points and
13096
+ * Pawn.ability_unlocks read them. A spend larger than the player holds
13097
+ * fails and spends nothing.
13098
+ */
13099
+ adjustAbilityPoints(points, unlocks) {
13100
+ return call("AdjustAbilityPoints", AdjustAbilityPointsRequest.toBinary({ player: this.slot, points: int32(points), unlocks: int32(unlocks) })) !== void 0;
13101
+ }
13008
13102
  /** startingSouls sets the souls the player's hero spawns with. */
13009
13103
  startingSouls(souls) {
13010
13104
  return call("StartingSouls", StartingSoulsRequest.toBinary({ player: this.slot, souls: int32(souls) })) !== void 0;
@@ -13032,7 +13126,8 @@ var Player = class _Player {
13032
13126
  * seconds: the build first, then health, stamina and pose once it settles,
13033
13127
  * then charges and cooldowns. A Restored event reports when the result has
13034
13128
  * held for a second, or why it could not. A new call replaces the running
13035
- * one.
13129
+ * one. A pawn with hero 0 has no hero to restore; the call fails until
13130
+ * SelectHero gives it one.
13036
13131
  */
13037
13132
  restoreHero(target) {
13038
13133
  return call("RestoreHero", RestoreHeroRequest.toBinary({ player: this.slot, target: toHeroTarget(target) })) !== void 0;
package/package.json CHANGED
@@ -7,11 +7,11 @@
7
7
  "license": "MIT",
8
8
  "name": "@modlock/modlock",
9
9
  "optionalDependencies": {
10
- "@modlock/darwin-arm64": "0.1.73",
11
- "@modlock/darwin-x64": "0.1.73",
12
- "@modlock/linux-arm64": "0.1.73",
13
- "@modlock/linux-x64": "0.1.73",
14
- "@modlock/win32-x64": "0.1.73"
10
+ "@modlock/darwin-arm64": "0.1.75",
11
+ "@modlock/darwin-x64": "0.1.75",
12
+ "@modlock/linux-arm64": "0.1.75",
13
+ "@modlock/linux-x64": "0.1.75",
14
+ "@modlock/win32-x64": "0.1.75"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",
@@ -20,5 +20,5 @@
20
20
  "sideEffects": false,
21
21
  "type": "module",
22
22
  "types": "index.d.ts",
23
- "version": "0.1.73"
23
+ "version": "0.1.75"
24
24
  }