libram 0.7.11 → 0.7.13

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.
Files changed (147) hide show
  1. package/dist/Clan.d.ts +34 -6
  2. package/dist/Clan.js +33 -6
  3. package/dist/Copier.d.ts +5 -5
  4. package/dist/Dungeon.d.ts +45 -0
  5. package/dist/Dungeon.js +115 -0
  6. package/dist/Kmail.d.ts +8 -5
  7. package/dist/Kmail.js +8 -5
  8. package/dist/actions/ActionSource.d.ts +5 -0
  9. package/dist/actions/ActionSource.js +20 -1
  10. package/dist/actions/FreeKill.d.ts +2 -0
  11. package/dist/actions/FreeKill.js +2 -0
  12. package/dist/actions/FreeRun.d.ts +2 -0
  13. package/dist/actions/FreeRun.js +2 -0
  14. package/dist/ascend.d.ts +20 -4
  15. package/dist/ascend.js +32 -4
  16. package/dist/challengePaths/2015/CommunityService.d.ts +7 -0
  17. package/dist/challengePaths/2015/CommunityService.js +12 -1
  18. package/dist/combat.d.ts +55 -0
  19. package/dist/combat.js +85 -0
  20. package/dist/counter.d.ts +3 -0
  21. package/dist/counter.js +3 -0
  22. package/dist/diet/index.d.ts +2 -0
  23. package/dist/diet/index.js +27 -8
  24. package/dist/diet/knapsack.d.ts +1 -0
  25. package/dist/diet/knapsack.js +11 -3
  26. package/dist/index.d.ts +2 -4
  27. package/dist/index.js +1 -3
  28. package/dist/lib.d.ts +101 -34
  29. package/dist/lib.js +133 -42
  30. package/dist/logger.d.ts +24 -11
  31. package/dist/logger.js +38 -12
  32. package/dist/maximize.d.ts +20 -1
  33. package/dist/maximize.js +30 -3
  34. package/dist/modifier.d.ts +1 -1
  35. package/dist/modifier.js +9 -1
  36. package/dist/mood.d.ts +15 -1
  37. package/dist/mood.js +15 -1
  38. package/dist/property.d.ts +52 -17
  39. package/dist/property.js +64 -7
  40. package/dist/propertyTypes.d.ts +5 -5
  41. package/dist/propertyTypes.js +5 -5
  42. package/dist/propertyTyping.d.ts +54 -0
  43. package/dist/propertyTyping.js +54 -0
  44. package/dist/resources/2008/Stickers.d.ts +28 -0
  45. package/dist/resources/2008/Stickers.js +28 -0
  46. package/dist/resources/2009/Bandersnatch.d.ts +17 -7
  47. package/dist/resources/2009/Bandersnatch.js +17 -7
  48. package/dist/resources/2009/SpookyPutty.d.ts +25 -0
  49. package/dist/resources/2009/SpookyPutty.js +25 -0
  50. package/dist/resources/2010/CrownOfThrones.d.ts +23 -0
  51. package/dist/resources/2010/CrownOfThrones.js +31 -15
  52. package/dist/resources/2010/LookingGlass.d.ts +4 -0
  53. package/dist/resources/2010/LookingGlass.js +5 -0
  54. package/dist/resources/2011/ObtuseAngel.d.ts +8 -6
  55. package/dist/resources/2011/ObtuseAngel.js +8 -6
  56. package/dist/resources/2011/StompingBoots.d.ts +9 -15
  57. package/dist/resources/2011/StompingBoots.js +9 -15
  58. package/dist/resources/2012/RainDoh.d.ts +20 -0
  59. package/dist/resources/2012/RainDoh.js +20 -0
  60. package/dist/resources/2012/ReagnimatedGnome.d.ts +18 -0
  61. package/dist/resources/2012/ReagnimatedGnome.js +18 -0
  62. package/dist/resources/2012/Resolutions.d.ts +2 -2
  63. package/dist/resources/2012/Resolutions.js +2 -2
  64. package/dist/resources/2013/Florist.d.ts +15 -0
  65. package/dist/resources/2013/Florist.js +21 -0
  66. package/dist/resources/2014/CrimboShrub.d.ts +12 -0
  67. package/dist/resources/2014/CrimboShrub.js +22 -1
  68. package/dist/resources/2014/DNALab.d.ts +10 -2
  69. package/dist/resources/2014/DNALab.js +10 -2
  70. package/dist/resources/2014/WinterGarden.d.ts +15 -0
  71. package/dist/resources/2014/WinterGarden.js +15 -0
  72. package/dist/resources/2015/BarrelShrine.d.ts +6 -0
  73. package/dist/resources/2015/BarrelShrine.js +6 -0
  74. package/dist/resources/2015/ChateauMantegna.d.ts +35 -0
  75. package/dist/resources/2015/ChateauMantegna.js +35 -0
  76. package/dist/resources/2015/DeckOfEveryCard.d.ts +23 -1
  77. package/dist/resources/2015/DeckOfEveryCard.js +24 -0
  78. package/dist/resources/2015/Dinseylandfill.d.ts +1 -0
  79. package/dist/resources/2015/Dinseylandfill.js +2 -0
  80. package/dist/resources/2015/MayoClinic.d.ts +8 -1
  81. package/dist/resources/2015/MayoClinic.js +8 -1
  82. package/dist/resources/2016/SourceTerminal.d.ts +42 -21
  83. package/dist/resources/2016/SourceTerminal.js +42 -21
  84. package/dist/resources/2016/Witchess.d.ts +12 -0
  85. package/dist/resources/2016/Witchess.js +12 -0
  86. package/dist/resources/2017/AsdonMartin.d.ts +11 -3
  87. package/dist/resources/2017/AsdonMartin.js +44 -7
  88. package/dist/resources/2017/MummingTrunk.d.ts +1 -0
  89. package/dist/resources/2017/MummingTrunk.js +8 -1
  90. package/dist/resources/2017/Pantogram.d.ts +9 -0
  91. package/dist/resources/2017/Pantogram.js +33 -0
  92. package/dist/resources/2017/Robortender.d.ts +1 -0
  93. package/dist/resources/2017/Robortender.js +1 -0
  94. package/dist/resources/2017/Spacegate.js +1 -0
  95. package/dist/resources/2017/TunnelOfLove.d.ts +19 -0
  96. package/dist/resources/2017/TunnelOfLove.js +37 -0
  97. package/dist/resources/2018/LatteLoversMembersMug.d.ts +9 -0
  98. package/dist/resources/2018/LatteLoversMembersMug.js +9 -0
  99. package/dist/resources/2018/SongBoom.d.ts +9 -4
  100. package/dist/resources/2018/SongBoom.js +9 -4
  101. package/dist/resources/2019/BeachComb.d.ts +38 -1
  102. package/dist/resources/2019/BeachComb.js +39 -2
  103. package/dist/resources/2019/Snapper.d.ts +4 -0
  104. package/dist/resources/2019/Snapper.js +4 -0
  105. package/dist/resources/2020/Cartography.d.ts +13 -0
  106. package/dist/resources/2020/Cartography.js +13 -0
  107. package/dist/resources/2020/Guzzlr.d.ts +89 -23
  108. package/dist/resources/2020/Guzzlr.js +100 -29
  109. package/dist/resources/2020/RetroCape.d.ts +4 -0
  110. package/dist/resources/2020/RetroCape.js +4 -0
  111. package/dist/resources/2021/CrystalBall.d.ts +6 -0
  112. package/dist/resources/2021/CrystalBall.js +13 -1
  113. package/dist/resources/2021/DaylightShavings.d.ts +6 -0
  114. package/dist/resources/2021/DaylightShavings.js +6 -0
  115. package/dist/resources/2022/AutumnAton.d.ts +15 -0
  116. package/dist/resources/2022/AutumnAton.js +21 -0
  117. package/dist/resources/2022/CombatLoversLocket.d.ts +9 -0
  118. package/dist/resources/2022/CombatLoversLocket.js +10 -2
  119. package/dist/resources/2022/GreyGoose.d.ts +46 -0
  120. package/dist/resources/2022/GreyGoose.js +47 -1
  121. package/dist/resources/2022/JuneCleaver.d.ts +20 -0
  122. package/dist/resources/2022/JuneCleaver.js +20 -0
  123. package/dist/resources/2022/TrainSet.d.ts +48 -0
  124. package/dist/resources/2022/TrainSet.js +54 -0
  125. package/dist/resources/2023/ClosedCircuitPayphone.d.ts +75 -0
  126. package/dist/resources/2023/ClosedCircuitPayphone.js +117 -0
  127. package/dist/resources/LibramSummon.d.ts +5 -0
  128. package/dist/resources/LibramSummon.js +5 -0
  129. package/dist/resources/index.d.ts +2 -1
  130. package/dist/resources/index.js +2 -1
  131. package/dist/resources/putty-likes.d.ts +15 -0
  132. package/dist/resources/putty-likes.js +15 -0
  133. package/dist/session.d.ts +12 -0
  134. package/dist/session.js +20 -17
  135. package/dist/since.d.ts +3 -2
  136. package/dist/since.js +4 -2
  137. package/dist/utils.d.ts +82 -6
  138. package/dist/utils.js +88 -0
  139. package/package.json +6 -4
  140. package/dist/dungeons/Dreadsylvania.d.ts +0 -5
  141. package/dist/dungeons/Dreadsylvania.js +0 -14
  142. package/dist/dungeons/Dungeon.d.ts +0 -29
  143. package/dist/dungeons/Dungeon.js +0 -99
  144. package/dist/dungeons/Hobopolis.d.ts +0 -5
  145. package/dist/dungeons/Hobopolis.js +0 -14
  146. package/dist/dungeons/SlimeTube.d.ts +0 -5
  147. package/dist/dungeons/SlimeTube.js +0 -14
@@ -1,14 +1,28 @@
1
1
  import { buy, getChateau, Item, runCombat, visitUrl } from "kolmafia";
2
2
  import { get } from "../../property";
3
+ /**
4
+ * @returns Whether we own the Chateau Mantegna
5
+ */
3
6
  export function have() {
4
7
  return get("chateauAvailable");
5
8
  }
9
+ /**
10
+ * @returns `null` for an empty painting; otherwise, the monster trapped in our painting
11
+ */
6
12
  export function paintingMonster() {
7
13
  return get("chateauMonster");
8
14
  }
15
+ /**
16
+ * @returns Whether or not we've fought our painted monster today
17
+ */
9
18
  export function paintingFought() {
10
19
  return get("_chateauMonsterFought");
11
20
  }
21
+ /**
22
+ * Fights your currently installed painting monster if able
23
+ *
24
+ * @returns The result of `runCombat`, which is the page html of the final round of combat
25
+ */
12
26
  export function fightPainting() {
13
27
  visitUrl("place.php?whichplace=chateau&action=chateau_painting", false);
14
28
  return runCombat();
@@ -28,16 +42,29 @@ export const nightstands = [
28
42
  "bowl of potpourri",
29
43
  "electric muscle stimulator",
30
44
  ];
45
+ /**
46
+ * @returns The currently installed desk in your chateau; `null` for none
47
+ */
31
48
  export function getDesk() {
32
49
  return desks.find((desk) => Object.keys(getChateau()).includes(desk)) ?? null;
33
50
  }
51
+ /**
52
+ * @returns The currently installed ceiling in your chateau; `null` for none
53
+ */
34
54
  export function getCeiling() {
35
55
  return (ceilings.find((ceiling) => Object.keys(getChateau()).includes(ceiling)) ??
36
56
  null);
37
57
  }
58
+ /**
59
+ * @returns The currently installed nightstand in your chateau; `null` for none
60
+ */
38
61
  export function getNightstand() {
39
62
  return (nightstands.find((nightstand) => Object.keys(getChateau()).includes(nightstand)) ?? null);
40
63
  }
64
+ /**
65
+ * @param desk The desk to change to
66
+ * @returns Whether our desk currently matches the one requested
67
+ */
41
68
  export function changeDesk(desk) {
42
69
  if (getDesk() === desk)
43
70
  return true;
@@ -46,6 +73,10 @@ export function changeDesk(desk) {
46
73
  buy(Item.get(desk));
47
74
  return getDesk() === desk;
48
75
  }
76
+ /**
77
+ * @param ceiling The ceiling to change to
78
+ * @returns Whether our ceiling currently matches the one requested
79
+ */
49
80
  export function changeCeiling(ceiling) {
50
81
  if (getCeiling() === ceiling)
51
82
  return true;
@@ -54,6 +85,10 @@ export function changeCeiling(ceiling) {
54
85
  buy(Item.get(ceiling));
55
86
  return getCeiling() === ceiling;
56
87
  }
88
+ /**
89
+ * @param nightstand The nightstand to change to
90
+ * @returns Whether our nightstand currently matches the one requested
91
+ */
57
92
  export function changeNightstand(nightstand) {
58
93
  if (getNightstand() === nightstand)
59
94
  return true;
@@ -1,8 +1,30 @@
1
+ /**
2
+ * @returns Do we `have` the Deck of Every Card?
3
+ */
1
4
  export declare function have(): boolean;
2
5
  declare const cards: readonly ["X of Clubs", "X of Diamonds", "X of Hearts", "X of Spades", "X of Papayas", "X of Kumquats", "X of Salads", "X of Cups", "X of Coins", "X of Swords", "X of Wands", "XVI - The Tower", "Professor Plum", "Spare Tire", "Extra Tank", "Sheep", "Year of Plenty", "Mine", "Laboratory", "Plains", "Swamp", "Mountain", "Forest", "Island", "Lead Pipe", "Rope", "Wrench", "Candlestick", "Knife", "Revolver", "Gift Card", "1952 Mickey Mantle", "XXI - The World", "III - The Empress", "VI - The Lovers", "Healing Salve", "Dark Ritual", "Lightning Bolt", "Giant Growth", "Ancestral Recall", "XI - Strength", "I - The Magician", "0 - The Fool", "X - The Wheel of Fortune", "The Race Card", "Green Card", "IV - The Emperor", "IX - The Hermit", "Werewolf", "The Hive", "XVII - The Star", "VII - The Chariot", "XV - The Devil", "V - The Hierophant", "Fire Elemental", "Christmas Card", "Go Fish", "Goblin Sapper", "II - The High Priestess", "XIV - Temperance", "XVIII - The Moon", "Hunky Fireman Card", "Aquarius Horoscope", "XII - The Hanged Man", "Suit Warehouse Discount Card", "Pirate Birthday Card", "Plantable Greeting Card", "Slimer Trading Card", "XIII - Death", "Unstable Portal"];
3
- declare type Card = keyof typeof cards;
6
+ declare type Card = typeof cards[number];
7
+ /**
8
+ * @returns The number of cards we've drawn so far today--remember, cheating counts as 5
9
+ */
4
10
  export declare function getCardsDrawn(): number;
11
+ /**
12
+ * @returns The number of draws we have remaining today--remember, cheating counts as 5
13
+ */
5
14
  export declare function getRemainingDraws(): number;
15
+ /**
16
+ * @returns The number of additional cards we can cheat today
17
+ */
18
+ export declare function getRemainingCheats(): number;
19
+ /**
20
+ * @returns An array of the Cards we've seen today
21
+ */
6
22
  export declare function getCardsSeen(): Card[];
23
+ /**
24
+ * Cheat a card of your choice from the Deck
25
+ *
26
+ * @param card The card in question
27
+ * @returns `true` if we succeed or if we've already cheated that card today; `false` if we fail or are out of draws/cheats for the day.
28
+ */
7
29
  export declare function cheatCard(card: Card): boolean;
8
30
  export {};
@@ -3,6 +3,9 @@ import { have as have_ } from "../../lib";
3
3
  import { get } from "../../property";
4
4
  import { $item } from "../../template-string";
5
5
  import { clamp } from "../../utils";
6
+ /**
7
+ * @returns Do we `have` the Deck of Every Card?
8
+ */
6
9
  export function have() {
7
10
  return have_($item `Deck of Every Card`);
8
11
  }
@@ -78,17 +81,38 @@ const cards = [
78
81
  "XIII - Death",
79
82
  "Unstable Portal",
80
83
  ];
84
+ /**
85
+ * @returns The number of cards we've drawn so far today--remember, cheating counts as 5
86
+ */
81
87
  export function getCardsDrawn() {
82
88
  return clamp(get("_deckCardsDrawn"), 0, 15);
83
89
  }
90
+ /**
91
+ * @returns The number of draws we have remaining today--remember, cheating counts as 5
92
+ */
84
93
  export function getRemainingDraws() {
85
94
  return 15 - getCardsDrawn();
86
95
  }
96
+ /**
97
+ * @returns The number of additional cards we can cheat today
98
+ */
99
+ export function getRemainingCheats() {
100
+ return Math.floor(getRemainingDraws() / 5);
101
+ }
102
+ /**
103
+ * @returns An array of the Cards we've seen today
104
+ */
87
105
  export function getCardsSeen() {
88
106
  return get("_deckCardsSeen")
89
107
  ? get("_deckCardsSeen").split("|")
90
108
  : [];
91
109
  }
110
+ /**
111
+ * Cheat a card of your choice from the Deck
112
+ *
113
+ * @param card The card in question
114
+ * @returns `true` if we succeed or if we've already cheated that card today; `false` if we fail or are out of draws/cheats for the day.
115
+ */
92
116
  export function cheatCard(card) {
93
117
  if (getCardsSeen().includes(card))
94
118
  return true;
@@ -14,6 +14,7 @@ declare class QuestData {
14
14
  questLocation: Location;
15
15
  /**
16
16
  * Process for determining where to put a wanderer to extract additional value from it
17
+ *
17
18
  * @param name easy to refer to name of the quest
18
19
  * @param priority ranked preference of quests
19
20
  * @param questNameKiosk returns the name of the quest as found at the dinseylandfill Job Kiosk
@@ -1,3 +1,4 @@
1
+ /* eslint "jsdoc/require-jsdoc": "warn" */
1
2
  import { indexOf, myAdventures, myAscensions, runChoice, visitUrl, } from "kolmafia";
2
3
  import { getRemainingLiver, have as haveItem } from "../../lib";
3
4
  import { get, set } from "../../property";
@@ -21,6 +22,7 @@ class QuestData {
21
22
  questLocation;
22
23
  /**
23
24
  * Process for determining where to put a wanderer to extract additional value from it
25
+ *
24
26
  * @param name easy to refer to name of the quest
25
27
  * @param priority ranked preference of quests
26
28
  * @param questNameKiosk returns the name of the quest as found at the dinseylandfill Job Kiosk
@@ -1,4 +1,3 @@
1
- import "core-js/modules/es.object.values";
2
1
  import { Item } from "kolmafia";
3
2
  export declare const Mayo: {
4
3
  nex: Item;
@@ -6,11 +5,19 @@ export declare const Mayo: {
6
5
  zapine: Item;
7
6
  flex: Item;
8
7
  };
8
+ /**
9
+ * @returns Whether the Mayo Clinic is our current active workshed
10
+ */
9
11
  export declare function installed(): boolean;
12
+ /**
13
+ * @returns Whether we `have` the Mayo Clinic, or it's installed
14
+ */
10
15
  export declare function have(): boolean;
11
16
  /**
12
17
  * Sets mayo minder to a particular mayo, and ensures you have enough of it.
18
+ *
13
19
  * @param mayo Mayo to use
14
20
  * @param quantity Quantity to ensure
21
+ * @returns Whether we succeeded in this endeavor; a trivial `false` for people without the clinic `installed`
15
22
  */
16
23
  export declare function setMayoMinder(mayo: Item, quantity?: number): boolean;
@@ -1,4 +1,3 @@
1
- import "core-js/modules/es.object.values";
2
1
  import { buy, getWorkshed, retrieveItem, toInt, use } from "kolmafia";
3
2
  import { have as haveItem } from "../../lib";
4
3
  import logger from "../../logger";
@@ -10,16 +9,24 @@ export const Mayo = {
10
9
  zapine: $item `Mayozapine`,
11
10
  flex: $item `Mayoflex`,
12
11
  };
12
+ /**
13
+ * @returns Whether the Mayo Clinic is our current active workshed
14
+ */
13
15
  export function installed() {
14
16
  return getWorkshed() === $item `portable Mayo Clinic`;
15
17
  }
18
+ /**
19
+ * @returns Whether we `have` the Mayo Clinic, or it's installed
20
+ */
16
21
  export function have() {
17
22
  return haveItem($item `portable Mayo Clinic`) || installed();
18
23
  }
19
24
  /**
20
25
  * Sets mayo minder to a particular mayo, and ensures you have enough of it.
26
+ *
21
27
  * @param mayo Mayo to use
22
28
  * @param quantity Quantity to ensure
29
+ * @returns Whether we succeeded in this endeavor; a trivial `false` for people without the clinic `installed`
23
30
  */
24
31
  export function setMayoMinder(mayo, quantity = 1) {
25
32
  if (getWorkshed() !== $item `portable Mayo Clinic`)
@@ -1,7 +1,9 @@
1
- import "core-js/modules/es.object.values";
2
1
  import { Effect, Item, Monster, Skill } from "kolmafia";
3
2
  import { Copier } from "../../Copier";
4
3
  export declare const item: Item;
4
+ /**
5
+ * @returns Is the terminal currently installed & available in our campground?
6
+ */
5
7
  export declare function have(): boolean;
6
8
  /**
7
9
  * Buffs that can be acquired from Enhance
@@ -23,8 +25,10 @@ export declare const Buffs: {
23
25
  };
24
26
  /**
25
27
  * Acquire a buff from the Source Terminal
28
+ *
26
29
  * @param buff The buff to acquire
27
30
  * @see Buffs
31
+ * @returns Whether we successfully acquired the buff
28
32
  */
29
33
  export declare function enhance(buff: Effect): boolean;
30
34
  /**
@@ -42,8 +46,10 @@ export declare const RolloverBuffs: {
42
46
  };
43
47
  /**
44
48
  * Acquire a buff from the Source Terminal
45
- * @param buff The buff to acquire
49
+ *
50
+ * @param rolloverBuff The buff to acquire
46
51
  * @see RolloverBuffs
52
+ * @returns Whether we successfully `enquire`d the terminal for our rollover buff
47
53
  */
48
54
  export declare function enquiry(rolloverBuff: Effect): boolean;
49
55
  /**
@@ -66,14 +72,20 @@ export declare const Skills: {
66
72
  /**
67
73
  * Make a skill available.
68
74
  * The Source Terminal can give the player access to two skills at any time
69
- * @param skill Skill to learn
75
+ *
76
+ * @param skills Skill or 2-tuple of Skills to learn
70
77
  * @see Skills
78
+ * @returns Whether our current skills match the ones we asked for
71
79
  */
72
80
  export declare function educate(skills: Skill | [Skill, Skill]): boolean;
73
81
  /**
74
- * Return the Skills currently available from Source Terminal
82
+ * @returns The Skills currently available from Source Terminal
75
83
  */
76
84
  export declare function getSkills(): Skill[];
85
+ /**
86
+ * @param skills A Skill or 2-tuple of Skills to check if we currently have active
87
+ * @returns Whether the input agrees with our current skills
88
+ */
77
89
  export declare function isCurrentSkill(skills: Skill | [Skill, Skill]): boolean;
78
90
  /**
79
91
  * Items that can be generated by the Source Terminal
@@ -81,81 +93,90 @@ export declare function isCurrentSkill(skills: Skill | [Skill, Skill]): boolean;
81
93
  export declare const Items: Map<Item, string>;
82
94
  /**
83
95
  * Collect an item from the Source Terminal (up to three times a day)
96
+ *
84
97
  * @param item Item to collect
85
98
  * @see Items
99
+ * @returns Whether the `cliExecute` succeeded
86
100
  */
87
101
  export declare function extrude(item: Item): boolean;
88
102
  declare type Chip = "INGRAM" | "DIAGRAM" | "ASHRAM" | "SCRAM" | "TRIGRAM" | "CRAM" | "DRAM" | "TRAM";
89
103
  /**
90
- * Return chips currently installed to player's Source Terminal
104
+ * @returns chips currently installed to player's Source Terminal
91
105
  */
92
106
  export declare function getChips(): Chip[];
93
107
  /**
94
- * Return number of times digitize was cast today
108
+ * @returns number of times digitize was cast today
95
109
  */
96
110
  export declare function getDigitizeUses(): number;
97
111
  /**
98
- * Return Monster that is currently digitized, else null
112
+ * @returns Monster that is currently digitized, else `null`
99
113
  */
100
114
  export declare function getDigitizeMonster(): Monster | null;
101
115
  /**
102
- * Return number of digitized monsters encountered since it was last cast
116
+ * @returns number of digitized monsters encountered since it was last cast
103
117
  */
104
118
  export declare function getDigitizeMonsterCount(): number;
105
119
  /**
106
- * Return maximum number of digitizes player can cast
120
+ * @returns maximum number of digitizes player can cast
107
121
  */
108
122
  export declare function getMaximumDigitizeUses(): number;
109
123
  /**
110
- * Returns the current day's number of remaining digitize uses
124
+ * @returns the current day's number of remaining digitize uses
111
125
  */
112
126
  export declare function getDigitizeUsesRemaining(): number;
113
127
  /**
114
- * Returns whether the player could theoretically cast Digitize
128
+ * @returns whether the player could theoretically cast Digitize
115
129
  */
116
130
  export declare function couldDigitize(): boolean;
131
+ /**
132
+ * Sets Digitize to be one of our skilsl if it currently isn't
133
+ *
134
+ * @returns Whether we expect that Digitize is one of our active skills now
135
+ */
117
136
  export declare function prepareDigitize(): boolean;
118
137
  /**
119
- * Returns whether the player can cast Digitize immediately
138
+ * Determines whether the player can cast Digitize immediately
120
139
  * This only considers whether the player has learned the skill
121
140
  * and has sufficient daily casts remaining, not whether they have sufficient MP
141
+ *
142
+ * @returns Whether the player can currently cast digitize, ignoring the MP cost but accounting for other factors
122
143
  */
123
144
  export declare function canDigitize(): boolean;
124
145
  export declare const Digitize: Copier;
125
146
  /**
126
- * Return number of times duplicate was cast today
147
+ * @returns number of times duplicate was cast today
127
148
  */
128
149
  export declare function getDuplicateUses(): number;
129
150
  /**
130
- * Return number of times enhance was cast today
151
+ * @returns number of times enhance was cast today
131
152
  */
132
153
  export declare function getEnhanceUses(): number;
133
154
  /**
134
- * Return number of times portscan was cast today
155
+ * @returns number of times portscan was cast today
135
156
  */
136
157
  export declare function getPortscanUses(): number;
137
158
  /**
138
- * Returns maximum number of times duplicate can be used
159
+ * @returns maximum number of times duplicate can be used
139
160
  */
140
161
  export declare function maximumDuplicateUses(): number;
141
162
  /**
142
- * Returns number of remaining times duplicate can be used today
163
+ * @returns number of remaining times duplicate can be used today
143
164
  */
144
165
  export declare function duplicateUsesRemaining(): number;
145
166
  /**
146
- * Return number of times enhance can be used per day
167
+ * @returns number of times enhance can be used per day
147
168
  */
148
169
  export declare function maximumEnhanceUses(): number;
149
170
  /**
150
- * Returns number of remaining times enahce can be used today
171
+ * @returns number of remaining times enahce can be used today
151
172
  */
152
173
  export declare function enhanceUsesRemaining(): number;
153
174
  /**
154
- * Returns expected duration of an enhance buff
175
+ * @returns expected duration of an enhance buff
155
176
  */
156
177
  export declare function enhanceBuffDuration(): number;
157
178
  /**
158
- * Returns expected duration of an enquiry buff
179
+ * @returns expected duration of an enquiry buff
159
180
  */
160
181
  export declare function enquiryBuffDuration(): number;
161
182
  export {};
@@ -1,4 +1,3 @@
1
- import "core-js/modules/es.object.values";
2
1
  import { cliExecute, Path, myPath, Skill, } from "kolmafia";
3
2
  import { Copier } from "../../Copier";
4
3
  import { haveInCampground } from "../../lib";
@@ -6,6 +5,9 @@ import { get } from "../../property";
6
5
  import { $effect, $item, $skill } from "../../template-string";
7
6
  import { arrayEquals } from "../../utils";
8
7
  export const item = $item `Source terminal`;
8
+ /**
9
+ * @returns Is the terminal currently installed & available in our campground?
10
+ */
9
11
  export function have() {
10
12
  return haveInCampground(item);
11
13
  }
@@ -29,8 +31,10 @@ export const Buffs = {
29
31
  };
30
32
  /**
31
33
  * Acquire a buff from the Source Terminal
34
+ *
32
35
  * @param buff The buff to acquire
33
36
  * @see Buffs
37
+ * @returns Whether we successfully acquired the buff
34
38
  */
35
39
  export function enhance(buff) {
36
40
  if (!Object.values(Buffs).includes(buff)) {
@@ -53,8 +57,10 @@ export const RolloverBuffs = {
53
57
  };
54
58
  /**
55
59
  * Acquire a buff from the Source Terminal
56
- * @param buff The buff to acquire
60
+ *
61
+ * @param rolloverBuff The buff to acquire
57
62
  * @see RolloverBuffs
63
+ * @returns Whether we successfully `enquire`d the terminal for our rollover buff
58
64
  */
59
65
  export function enquiry(rolloverBuff) {
60
66
  if (!Object.values(RolloverBuffs).includes(rolloverBuff)) {
@@ -82,8 +88,10 @@ export const Skills = {
82
88
  /**
83
89
  * Make a skill available.
84
90
  * The Source Terminal can give the player access to two skills at any time
85
- * @param skill Skill to learn
91
+ *
92
+ * @param skills Skill or 2-tuple of Skills to learn
86
93
  * @see Skills
94
+ * @returns Whether our current skills match the ones we asked for
87
95
  */
88
96
  export function educate(skills) {
89
97
  const skillsArray = Array.isArray(skills) ? skills.slice(0, 2) : [skills];
@@ -97,7 +105,7 @@ export function educate(skills) {
97
105
  return true;
98
106
  }
99
107
  /**
100
- * Return the Skills currently available from Source Terminal
108
+ * @returns The Skills currently available from Source Terminal
101
109
  */
102
110
  export function getSkills() {
103
111
  return ["sourceTerminalEducate1", "sourceTerminalEducate2"]
@@ -105,6 +113,10 @@ export function getSkills() {
105
113
  .filter((s) => s !== "")
106
114
  .map((s) => Skill.get(s.slice(0, -4)));
107
115
  }
116
+ /**
117
+ * @param skills A Skill or 2-tuple of Skills to check if we currently have active
118
+ * @returns Whether the input agrees with our current skills
119
+ */
108
120
  export function isCurrentSkill(skills) {
109
121
  const currentSkills = getSkills();
110
122
  const skillsArray = Array.isArray(skills) ? skills.slice(0, 2) : [skills];
@@ -127,8 +139,10 @@ export const Items = new Map([
127
139
  ]);
128
140
  /**
129
141
  * Collect an item from the Source Terminal (up to three times a day)
142
+ *
130
143
  * @param item Item to collect
131
144
  * @see Items
145
+ * @returns Whether the `cliExecute` succeeded
132
146
  */
133
147
  export function extrude(item) {
134
148
  const fileName = Items.get(item);
@@ -137,48 +151,53 @@ export function extrude(item) {
137
151
  return cliExecute(`terminal extrude ${fileName}`);
138
152
  }
139
153
  /**
140
- * Return chips currently installed to player's Source Terminal
154
+ * @returns chips currently installed to player's Source Terminal
141
155
  */
142
156
  export function getChips() {
143
157
  return get("sourceTerminalChips").split(",");
144
158
  }
145
159
  /**
146
- * Return number of times digitize was cast today
160
+ * @returns number of times digitize was cast today
147
161
  */
148
162
  export function getDigitizeUses() {
149
163
  return get("_sourceTerminalDigitizeUses");
150
164
  }
151
165
  /**
152
- * Return Monster that is currently digitized, else null
166
+ * @returns Monster that is currently digitized, else `null`
153
167
  */
154
168
  export function getDigitizeMonster() {
155
169
  return get("_sourceTerminalDigitizeMonster");
156
170
  }
157
171
  /**
158
- * Return number of digitized monsters encountered since it was last cast
172
+ * @returns number of digitized monsters encountered since it was last cast
159
173
  */
160
174
  export function getDigitizeMonsterCount() {
161
175
  return get("_sourceTerminalDigitizeMonsterCount");
162
176
  }
163
177
  /**
164
- * Return maximum number of digitizes player can cast
178
+ * @returns maximum number of digitizes player can cast
165
179
  */
166
180
  export function getMaximumDigitizeUses() {
167
181
  const chips = getChips();
168
182
  return (1 + (chips.includes("TRAM") ? 1 : 0) + (chips.includes("TRIGRAM") ? 1 : 0));
169
183
  }
170
184
  /**
171
- * Returns the current day's number of remaining digitize uses
185
+ * @returns the current day's number of remaining digitize uses
172
186
  */
173
187
  export function getDigitizeUsesRemaining() {
174
188
  return getMaximumDigitizeUses() - getDigitizeUses();
175
189
  }
176
190
  /**
177
- * Returns whether the player could theoretically cast Digitize
191
+ * @returns whether the player could theoretically cast Digitize
178
192
  */
179
193
  export function couldDigitize() {
180
194
  return getDigitizeUses() < getMaximumDigitizeUses();
181
195
  }
196
+ /**
197
+ * Sets Digitize to be one of our skilsl if it currently isn't
198
+ *
199
+ * @returns Whether we expect that Digitize is one of our active skills now
200
+ */
182
201
  export function prepareDigitize() {
183
202
  if (!isCurrentSkill(Skills.Digitize)) {
184
203
  return educate(Skills.Digitize);
@@ -186,58 +205,60 @@ export function prepareDigitize() {
186
205
  return true;
187
206
  }
188
207
  /**
189
- * Returns whether the player can cast Digitize immediately
208
+ * Determines whether the player can cast Digitize immediately
190
209
  * This only considers whether the player has learned the skill
191
210
  * and has sufficient daily casts remaining, not whether they have sufficient MP
211
+ *
212
+ * @returns Whether the player can currently cast digitize, ignoring the MP cost but accounting for other factors
192
213
  */
193
214
  export function canDigitize() {
194
215
  return couldDigitize() && getSkills().includes(Skills.Digitize);
195
216
  }
196
217
  export const Digitize = new Copier(() => couldDigitize(), () => prepareDigitize(), () => canDigitize(), () => getDigitizeMonster());
197
218
  /**
198
- * Return number of times duplicate was cast today
219
+ * @returns number of times duplicate was cast today
199
220
  */
200
221
  export function getDuplicateUses() {
201
222
  return get("_sourceTerminalDuplicateUses");
202
223
  }
203
224
  /**
204
- * Return number of times enhance was cast today
225
+ * @returns number of times enhance was cast today
205
226
  */
206
227
  export function getEnhanceUses() {
207
228
  return get("_sourceTerminalEnhanceUses");
208
229
  }
209
230
  /**
210
- * Return number of times portscan was cast today
231
+ * @returns number of times portscan was cast today
211
232
  */
212
233
  export function getPortscanUses() {
213
234
  return get("_sourceTerminalPortscanUses");
214
235
  }
215
236
  /**
216
- * Returns maximum number of times duplicate can be used
237
+ * @returns maximum number of times duplicate can be used
217
238
  */
218
239
  export function maximumDuplicateUses() {
219
240
  return myPath() === Path.get("The Source") ? 5 : 1;
220
241
  }
221
242
  /**
222
- * Returns number of remaining times duplicate can be used today
243
+ * @returns number of remaining times duplicate can be used today
223
244
  */
224
245
  export function duplicateUsesRemaining() {
225
246
  return maximumDuplicateUses() - getDuplicateUses();
226
247
  }
227
248
  /**
228
- * Return number of times enhance can be used per day
249
+ * @returns number of times enhance can be used per day
229
250
  */
230
251
  export function maximumEnhanceUses() {
231
252
  return (1 + getChips().filter((chip) => ["CRAM", "SCRAM"].includes(chip)).length);
232
253
  }
233
254
  /**
234
- * Returns number of remaining times enahce can be used today
255
+ * @returns number of remaining times enahce can be used today
235
256
  */
236
257
  export function enhanceUsesRemaining() {
237
258
  return maximumEnhanceUses() - getEnhanceUses();
238
259
  }
239
260
  /**
240
- * Returns expected duration of an enhance buff
261
+ * @returns expected duration of an enhance buff
241
262
  */
242
263
  export function enhanceBuffDuration() {
243
264
  return (25 +
@@ -245,7 +266,7 @@ export function enhanceBuffDuration() {
245
266
  (getChips().includes("INGRAM") ? 25 : 0));
246
267
  }
247
268
  /**
248
- * Returns expected duration of an enquiry buff
269
+ * @returns expected duration of an enquiry buff
249
270
  */
250
271
  export function enquiryBuffDuration() {
251
272
  return (50 +
@@ -1,6 +1,18 @@
1
1
  import { Monster } from "kolmafia";
2
2
  export declare const item: import("kolmafia").Item;
3
+ /**
4
+ * @returns Is the Witchess installed and available in our campground?
5
+ */
3
6
  export declare function have(): boolean;
7
+ /**
8
+ * @returns How many Witchess fights have we done so far today?
9
+ */
4
10
  export declare function fightsDone(): number;
5
11
  export declare const pieces: Monster[];
12
+ /**
13
+ * Fight a Witchess piece of your choice
14
+ *
15
+ * @param piece The piece to fight
16
+ * @returns The value of `runCombat()`, which is the page html of the final round
17
+ */
6
18
  export declare function fightPiece(piece: Monster): string;
@@ -3,9 +3,15 @@ import { haveInCampground } from "../../lib";
3
3
  import { get } from "../../property";
4
4
  import { $item } from "../../template-string";
5
5
  export const item = $item `Witchess Set`;
6
+ /**
7
+ * @returns Is the Witchess installed and available in our campground?
8
+ */
6
9
  export function have() {
7
10
  return haveInCampground(item);
8
11
  }
12
+ /**
13
+ * @returns How many Witchess fights have we done so far today?
14
+ */
9
15
  export function fightsDone() {
10
16
  return get("_witchessFights");
11
17
  }
@@ -19,6 +25,12 @@ export const pieces = Monster.get([
19
25
  "Witchess Witch",
20
26
  "Witchess Ox",
21
27
  ]);
28
+ /**
29
+ * Fight a Witchess piece of your choice
30
+ *
31
+ * @param piece The piece to fight
32
+ * @returns The value of `runCombat()`, which is the page html of the final round
33
+ */
22
34
  export function fightPiece(piece) {
23
35
  if (!pieces.includes(piece))
24
36
  throw new Error("That is not a valid piece.");