@modlock/modlock 0.1.73 → 0.1.74

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
@@ -1417,7 +1438,10 @@ export declare class Player {
1417
1438
  * hero back to it. Stopping the mod returns every such player.
1418
1439
  */
1419
1440
  unwatch(): boolean;
1420
- /** respawn revives the player's dead hero. */
1441
+ /**
1442
+ * respawn revives the player's dead hero. A pawn with hero 0 has no hero to
1443
+ * revive; the call fails until SelectHero gives it one.
1444
+ */
1421
1445
  respawn(): boolean;
1422
1446
  /**
1423
1447
  * changeTeam moves the player's hero, living or dead, to team 2 or 3 where
@@ -1466,14 +1490,19 @@ export declare class Player {
1466
1490
  */
1467
1491
  giveItem(item: string, imbue?: number): boolean;
1468
1492
  /**
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.
1493
+ * replaceAbility puts the ability named ability, untrained unless keep
1494
+ * carries the old one's progress, in the hero's ability slot index, as
1495
+ * Ability.slot, removing the ability there. The game trains and upgrades an
1496
+ * ability in slots 0 to 3 by its slot, so a player holds the upgrade key and
1497
+ * presses the slot's ability key to spend ability points on it, and training
1498
+ * an untrained one costs an ability unlock. A hero change or ResetHero gives
1499
+ * the hero its own abilities again, so a mod that keeps a swap replaces
1500
+ * again then. An ability from another hero loads its models and particles
1501
+ * only if Precache named that hero and those resources before the world
1502
+ * loaded; otherwise its first effect stalls the game on a blocking load and
1503
+ * the game reports an assertion.
1475
1504
  */
1476
- replaceAbility(index: number, ability: string): boolean;
1505
+ replaceAbility(index: number, ability: string, keep?: boolean): boolean;
1477
1506
  /**
1478
1507
  * holdModifier keeps a modifier, named as GiveModifier names it, on the
1479
1508
  * hero with no expiry, giving it back whenever the game removes it or the
@@ -1537,6 +1566,13 @@ export declare class Player {
1537
1566
  * nothing. Silent skips the pickup's sound and number.
1538
1567
  */
1539
1568
  adjustSouls(delta: number, silent?: boolean): boolean;
1569
+ /**
1570
+ * adjustAbilityPoints gives the player ability points and ability unlocks,
1571
+ * or takes them when negative, as Pawn.ability_points and
1572
+ * Pawn.ability_unlocks read them. A spend larger than the player holds
1573
+ * fails and spends nothing.
1574
+ */
1575
+ adjustAbilityPoints(points: number, unlocks: number): boolean;
1540
1576
  /** startingSouls sets the souls the player's hero spawns with. */
1541
1577
  startingSouls(souls: number): boolean;
1542
1578
  /**
@@ -1556,7 +1592,8 @@ export declare class Player {
1556
1592
  * seconds: the build first, then health, stamina and pose once it settles,
1557
1593
  * then charges and cooldowns. A Restored event reports when the result has
1558
1594
  * held for a second, or why it could not. A new call replaces the running
1559
- * one.
1595
+ * one. A pawn with hero 0 has no hero to restore; the call fails until
1596
+ * SelectHero gives it one.
1560
1597
  */
1561
1598
  restoreHero(target: HeroTarget): boolean;
1562
1599
  /**
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;
@@ -12844,7 +12919,10 @@ var Player = class _Player {
12844
12919
  unwatch() {
12845
12920
  return call("Unwatch", PlayerRequest.toBinary({ player: this.slot })) !== void 0;
12846
12921
  }
12847
- /** respawn revives the player's dead hero. */
12922
+ /**
12923
+ * respawn revives the player's dead hero. A pawn with hero 0 has no hero to
12924
+ * revive; the call fails until SelectHero gives it one.
12925
+ */
12848
12926
  respawn() {
12849
12927
  return call("Respawn", PlayerRequest.toBinary({ player: this.slot })) !== void 0;
12850
12928
  }
@@ -12916,15 +12994,20 @@ var Player = class _Player {
12916
12994
  return call("GiveItem", GiveItemRequest.toBinary({ player: this.slot, item: item2, imbue })) !== void 0;
12917
12995
  }
12918
12996
  /**
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.
12997
+ * replaceAbility puts the ability named ability, untrained unless keep
12998
+ * carries the old one's progress, in the hero's ability slot index, as
12999
+ * Ability.slot, removing the ability there. The game trains and upgrades an
13000
+ * ability in slots 0 to 3 by its slot, so a player holds the upgrade key and
13001
+ * presses the slot's ability key to spend ability points on it, and training
13002
+ * an untrained one costs an ability unlock. A hero change or ResetHero gives
13003
+ * the hero its own abilities again, so a mod that keeps a swap replaces
13004
+ * again then. An ability from another hero loads its models and particles
13005
+ * only if Precache named that hero and those resources before the world
13006
+ * loaded; otherwise its first effect stalls the game on a blocking load and
13007
+ * the game reports an assertion.
12925
13008
  */
12926
- replaceAbility(index, ability) {
12927
- return call("ReplaceAbility", ReplaceAbilityRequest.toBinary({ player: this.slot, index, ability })) !== void 0;
13009
+ replaceAbility(index, ability, keep) {
13010
+ return call("ReplaceAbility", ReplaceAbilityRequest.toBinary({ player: this.slot, index, ability, keep })) !== void 0;
12928
13011
  }
12929
13012
  /**
12930
13013
  * holdModifier keeps a modifier, named as GiveModifier names it, on the
@@ -13005,6 +13088,15 @@ var Player = class _Player {
13005
13088
  adjustSouls(delta, silent) {
13006
13089
  return call("AdjustSouls", AdjustSoulsRequest.toBinary({ player: this.slot, delta: int32(delta), silent })) !== void 0;
13007
13090
  }
13091
+ /**
13092
+ * adjustAbilityPoints gives the player ability points and ability unlocks,
13093
+ * or takes them when negative, as Pawn.ability_points and
13094
+ * Pawn.ability_unlocks read them. A spend larger than the player holds
13095
+ * fails and spends nothing.
13096
+ */
13097
+ adjustAbilityPoints(points, unlocks) {
13098
+ return call("AdjustAbilityPoints", AdjustAbilityPointsRequest.toBinary({ player: this.slot, points: int32(points), unlocks: int32(unlocks) })) !== void 0;
13099
+ }
13008
13100
  /** startingSouls sets the souls the player's hero spawns with. */
13009
13101
  startingSouls(souls) {
13010
13102
  return call("StartingSouls", StartingSoulsRequest.toBinary({ player: this.slot, souls: int32(souls) })) !== void 0;
@@ -13032,7 +13124,8 @@ var Player = class _Player {
13032
13124
  * seconds: the build first, then health, stamina and pose once it settles,
13033
13125
  * then charges and cooldowns. A Restored event reports when the result has
13034
13126
  * held for a second, or why it could not. A new call replaces the running
13035
- * one.
13127
+ * one. A pawn with hero 0 has no hero to restore; the call fails until
13128
+ * SelectHero gives it one.
13036
13129
  */
13037
13130
  restoreHero(target) {
13038
13131
  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.74",
11
+ "@modlock/darwin-x64": "0.1.74",
12
+ "@modlock/linux-arm64": "0.1.74",
13
+ "@modlock/linux-x64": "0.1.74",
14
+ "@modlock/win32-x64": "0.1.74"
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.74"
24
24
  }