libram 0.7.10 → 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 +38 -10
  16. package/dist/challengePaths/2015/CommunityService.d.ts +7 -0
  17. package/dist/challengePaths/2015/CommunityService.js +17 -5
  18. package/dist/combat.d.ts +63 -2
  19. package/dist/combat.js +99 -5
  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 +25 -0
  33. package/dist/maximize.js +31 -4
  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 +6 -6
  41. package/dist/propertyTypes.js +6 -6
  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 +30 -0
  77. package/dist/resources/2015/DeckOfEveryCard.js +122 -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 +44 -23
  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 +103 -34
  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 +10 -3
  129. package/dist/resources/index.d.ts +3 -1
  130. package/dist/resources/index.js +3 -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 +96 -5
  138. package/dist/utils.js +106 -11
  139. package/package.json +10 -11
  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,45 +1,69 @@
1
- import { Item, mallPrice, runChoice, use, visitUrl } from "kolmafia";
2
- import maxBy from "lodash/maxBy";
1
+ import { Item, itemAmount, mallPrice, runChoice, use, visitUrl, } from "kolmafia";
3
2
  import { have as haveItem } from "../../lib";
4
3
  import { get, withChoice } from "../../property";
5
4
  import { $item, $items } from "../../template-string";
6
- import { invertMap } from "../../utils";
5
+ import { invertMap, maxBy } from "../../utils";
7
6
  export const item = $item `Guzzlr tablet`;
7
+ /**
8
+ * Determines whether you `have` Guzzlr
9
+ *
10
+ * @returns Whether you `have` Guzzlr
11
+ */
8
12
  export function have() {
9
13
  return haveItem(item);
10
14
  }
15
+ /**
16
+ * Internal function used to navigate the Guzzlr interface
17
+ *
18
+ * @param option Choice option to select
19
+ */
11
20
  function useTabletWithChoice(option) {
12
21
  withChoice(1412, option, () => use(1, item));
13
22
  }
23
+ /**
24
+ * Determines whether you currently have an active Guzzlr quest
25
+ *
26
+ * @returns Whether you currently have an active Guzzlr quest
27
+ */
14
28
  export function isQuestActive() {
15
29
  return get("questGuzzlr") !== "unstarted";
16
30
  }
17
31
  /**
18
- * Platinum deliveries completed overall
32
+ * Determines total number of Platinum deliveries completed
33
+ *
34
+ * @returns Platinum deliveries completed overall
19
35
  */
20
36
  export function getPlatinum() {
21
37
  return get("guzzlrPlatinumDeliveries");
22
38
  }
23
39
  /**
24
- * Platinum deliveries completed today
40
+ * Determines the number of Platinum deliveries completed today
41
+ *
42
+ * @returns Platinum deliveries completed today
25
43
  */
26
44
  export function getPlatinumToday() {
27
45
  return get("_guzzlrPlatinumDeliveries");
28
46
  }
29
47
  /**
30
- * Can do a platinum delivery (haven't done one today)
48
+ * Determines whether you are currently eligible to do a Platinum delivery
49
+ *
50
+ * @returns Whether you are currently eligible to do a Platinum delivery
31
51
  */
32
52
  export function canPlatinum() {
33
53
  return !isQuestActive() && getGold() >= 5 && getPlatinumToday() < 1;
34
54
  }
35
55
  /**
36
- * Have fully unlocked the platinum delivery bonuses (done >= 30)
56
+ * Determines whether you have fully unlocked the Platinum delivery bonuses (done >= 30)
57
+ *
58
+ * @returns Whether you have fully unlocked the Platinum delivery enchantment bonuses
37
59
  */
38
60
  export function haveFullPlatinumBonus() {
39
61
  return getPlatinum() >= 30;
40
62
  }
41
63
  /**
42
- * Accept platinum delivery
64
+ * Accepts a Platinum delivery
65
+ *
66
+ * @returns Whether we succeeded in this endeavor
43
67
  */
44
68
  export function acceptPlatinum() {
45
69
  if (!canPlatinum())
@@ -48,31 +72,41 @@ export function acceptPlatinum() {
48
72
  return true;
49
73
  }
50
74
  /**
51
- * Gold deliveries completed overall
75
+ * Determines total number of Gold deliveries completed
76
+ *
77
+ * @returns Gold deliveries completed overall
52
78
  */
53
79
  export function getGold() {
54
80
  return get("guzzlrGoldDeliveries");
55
81
  }
56
82
  /**
57
- * Gold deliveries completed today
83
+ * Determines the number of Gold deliveries completed today
84
+ *
85
+ * @returns Gold deliveries completed today
58
86
  */
59
87
  export function getGoldToday() {
60
88
  return get("_guzzlrGoldDeliveries");
61
89
  }
62
90
  /**
63
- * Can do a gold delivery (have done fewer than 3 today)
91
+ * Determines whether you are currently eligible to do a Gold delivery
92
+ *
93
+ * @returns Whether you are currently eligible to do a Gold delivery
64
94
  */
65
95
  export function canGold() {
66
96
  return !isQuestActive() && getBronze() >= 5 && getGoldToday() < 3;
67
97
  }
68
98
  /**
69
- * Have fully unlocked the platinum delivery bonuses (done >= 30)
99
+ * Determines whether you have fully unlocked the Gold delivery bonuses (done >= 150)
100
+ *
101
+ * @returns Whether you have fully unlocked the Gold delivery enchantment bonuses
70
102
  */
71
103
  export function haveFullGoldBonus() {
72
104
  return getGold() >= 150;
73
105
  }
74
106
  /**
75
- * Accept gold delivery
107
+ * Accepts a Gold delivery
108
+ *
109
+ * @returns Whether we succeeded in this endeavor
76
110
  */
77
111
  export function acceptGold() {
78
112
  if (!canGold())
@@ -81,13 +115,25 @@ export function acceptGold() {
81
115
  return true;
82
116
  }
83
117
  /**
84
- * Bronze deliveries completed overall
118
+ * Determines total number of Bronze deliveries completed
119
+ *
120
+ * @returns Bronze deliveries completed overall
85
121
  */
86
122
  export function getBronze() {
87
123
  return get("guzzlrBronzeDeliveries");
88
124
  }
89
125
  /**
90
- * Accept bronze delivery
126
+ * Determines whether you have fully unlocked the Bronze delivery bonuses (done >= 196)
127
+ *
128
+ * @returns Whether you have fully unlocked the Bronze delivery enchantment bonuses
129
+ */
130
+ export function haveFullBronzeBonus() {
131
+ return getBronze() >= 196;
132
+ }
133
+ /**
134
+ * Accepts a Bronze delivery
135
+ *
136
+ * @returns Whether we succeeded in this endeavor
91
137
  */
92
138
  export function acceptBronze() {
93
139
  if (isQuestActive())
@@ -96,19 +142,17 @@ export function acceptBronze() {
96
142
  return true;
97
143
  }
98
144
  /**
99
- * Have fully unlocked the platinum delivery bonuses (done >= 30)
100
- */
101
- export function haveFullBronzeBonus() {
102
- return getBronze() >= 196;
103
- }
104
- /**
105
- * Can abandon the current Guzzlr quest
145
+ * Determines whether we can abandon the current Guzzlr quest
146
+ *
147
+ * @returns Whether we are able to abandon our current Guzzlr quest
106
148
  */
107
149
  export function canAbandon() {
108
150
  return isQuestActive() && !get("_guzzlrQuestAbandoned");
109
151
  }
110
152
  /**
111
- * Abandon Guzzlr quest
153
+ * Abandons Guzzlr quest
154
+ *
155
+ * @returns `false` if we were unable to abandon a quest; `true` otherwise
112
156
  */
113
157
  export function abandon() {
114
158
  if (!canAbandon())
@@ -119,20 +163,26 @@ export function abandon() {
119
163
  return true;
120
164
  }
121
165
  /**
122
- * Get current Guzzlr quest location
166
+ * Determines the target location for your current Guzzlr quest
167
+ *
168
+ * @returns The current target location for your Guzzlr quest, if it exists
123
169
  */
124
170
  export function getLocation() {
125
171
  return get("guzzlrQuestLocation");
126
172
  }
127
173
  /**
128
- * Get current Guzzlr quest tier
174
+ * Determines the tier of your current Guzzlr quest
175
+ *
176
+ * @returns The tier of your current Guzzlr quest; `null` if there is no active quest
129
177
  */
130
178
  export function getTier() {
131
179
  const tier = get("guzzlrQuestTier");
132
180
  return tier === "" ? null : tier;
133
181
  }
134
182
  /**
135
- * Get current Guzzlr quest booze
183
+ * Determines the current booze item you need to deliver for your current Guzzlr quest
184
+ *
185
+ * @returns The booze item associated with your Guzzlr quest if it exists; `null` otherwise
136
186
  */
137
187
  export function getBooze() {
138
188
  const booze = get("guzzlrQuestBooze");
@@ -145,15 +195,17 @@ export function getBooze() {
145
195
  */
146
196
  export const Cocktails = $items `Buttery Boy, Steamboat, Ghiaccio Colada, Nog-on-the-Cob, Sourfinger`;
147
197
  /**
148
- * Returns true if the user has a platinum cocktail in their inventory
198
+ * Determines whether you currently have a Platinum cocktail available
199
+ *
200
+ * @returns `true` if you have at least one Platinum cocktail in your inventory; `false` otherwise
149
201
  */
150
202
  export function havePlatinumBooze() {
151
- return Cocktails.some((cock) => haveItem(cock));
203
+ return Cocktails.some((cock) => itemAmount(cock) > 0);
152
204
  }
153
205
  /**
154
- * Returns true if the user has the cocktail that they need for their current quest
206
+ * Determines if you currently have in your inventory the booze necessary to progress your Guzzlr quest
155
207
  *
156
- * If they have no quest, returns false
208
+ * @returns `true` if you have the booze necessary to progress your Guzzlr quest
157
209
  */
158
210
  export function haveBooze() {
159
211
  const booze = getBooze();
@@ -163,7 +215,7 @@ export function haveBooze() {
163
215
  case $item `Guzzlr cocktail set`:
164
216
  return havePlatinumBooze();
165
217
  default:
166
- return haveItem(booze);
218
+ return itemAmount(booze) > 0;
167
219
  }
168
220
  }
169
221
  export const ingredientToPlatinumCocktail = new Map([
@@ -174,21 +226,38 @@ export const ingredientToPlatinumCocktail = new Map([
174
226
  [$item `Dish of Clarified Butter`, $item `Buttery Boy`],
175
227
  ]);
176
228
  export const platinumCocktailToIngredient = invertMap(ingredientToPlatinumCocktail);
229
+ /**
230
+ * Determines the cheapest Platinum cocktail to obtain or produce
231
+ *
232
+ * @param freeCraft Defaults to `true`; if set to `false`, will count the price of any turns spent cocktailcrafting
233
+ * @returns The expected price of the cheapest Platinum cocktail to obtain or produce
234
+ */
177
235
  export function getCheapestPlatinumCocktail(freeCraft = true) {
178
- const defaultCocktail = [$item `Dish of Clarified Butter`, $item `Buttery Boy`];
179
236
  if (freeCraft) {
180
- return (maxBy(Array.from(ingredientToPlatinumCocktail), (ingredientAndCocktail) => Math.max(...ingredientAndCocktail.map((item) => -mallPrice(item)))) ?? defaultCocktail)[1];
237
+ return maxBy(Array.from(ingredientToPlatinumCocktail), (ingredientAndCocktail) => Math.min(...ingredientAndCocktail.map((item) => mallPrice(item))), true)[1];
181
238
  }
182
239
  else {
183
- return (maxBy(Array.from(ingredientToPlatinumCocktail), (ingredientAndCocktail) => -mallPrice(ingredientAndCocktail[1])) ?? defaultCocktail)[1];
240
+ return maxBy(Array.from(ingredientToPlatinumCocktail), ([, cocktail]) => mallPrice(cocktail))[1];
184
241
  }
185
242
  }
243
+ /**
244
+ * Calculates the number of turns remaining for your Guzzlr quest
245
+ *
246
+ * @param useShoes Whether or not the calculation should assume you are using Guzzlr shoes
247
+ * @returns The expected number of turns needed to finish your current delivery
248
+ */
186
249
  export function turnsLeftOnQuest(useShoes = false) {
187
250
  const progressPerTurn = useShoes
188
251
  ? Math.floor((10 - get("_guzzlrDeliveries")) * 1.5)
189
252
  : 10 - get("_guzzlrDeliveries");
190
253
  return Math.ceil((100 - get("guzzlrDeliveryProgress")) / progressPerTurn);
191
254
  }
255
+ /**
256
+ * Calculates the expected Guzzlrbuck reward for completing your current Guzzlr quest
257
+ *
258
+ * @param usePants Whether or not we should account for Guzzlr pants in our calculation
259
+ * @returns The expected Guzzlrbuck reward of our current Guzzlr quest
260
+ */
192
261
  export function expectedReward(usePants = false) {
193
262
  switch (getTier()) {
194
263
  case "platinum":
@@ -3,6 +3,7 @@ import { Modifiers } from "../../modifier";
3
3
  export declare const item: import("kolmafia").Item;
4
4
  /**
5
5
  * Determines whether you have() the Retro Cape.
6
+ *
6
7
  * @returns Whether you have the Retro Cape available.
7
8
  */
8
9
  export declare function have(): boolean;
@@ -27,6 +28,7 @@ export declare const currentHero: () => "vampire" | "heck" | "robot";
27
28
  export declare const currentMode: () => Mode;
28
29
  /**
29
30
  * Tunes retro cape to a given setting
31
+ *
30
32
  * @param hero The Superhero to set it to
31
33
  * @param mode The washing instructions to set it to
32
34
  * @returns Whether we successfully tuned the Retro Cape.
@@ -34,6 +36,7 @@ export declare const currentMode: () => Mode;
34
36
  export declare function set(hero: Hero, mode: Mode): boolean;
35
37
  /**
36
38
  * Returns the expected Modifiers of the Retro Cape for a particular setting
39
+ *
37
40
  * @param hero The Superhero setting
38
41
  * @param mode The washing instructions setting
39
42
  * @returns A Modifiers object describing the Retro Cape were it to be tuned to that setting.
@@ -41,6 +44,7 @@ export declare function set(hero: Hero, mode: Mode): boolean;
41
44
  export declare function getModifier(hero?: "vampire" | "heck" | "robot", mode?: Mode): Modifiers;
42
45
  /**
43
46
  * Tunes the Retro Cape to allow it to grant a particular skill.
47
+ *
44
48
  * @param skill The skill to tune the Retro Cape to.
45
49
  * @returns Whether we successfully tuned the cape.
46
50
  */
@@ -5,6 +5,7 @@ import { $item, $skill } from "../../template-string";
5
5
  export const item = $item `unwrapped knock-off retro superhero cape`;
6
6
  /**
7
7
  * Determines whether you have() the Retro Cape.
8
+ *
8
9
  * @returns Whether you have the Retro Cape available.
9
10
  */
10
11
  export function have() {
@@ -65,6 +66,7 @@ const modeMap = new Map([
65
66
  ]);
66
67
  /**
67
68
  * Tunes retro cape to a given setting
69
+ *
68
70
  * @param hero The Superhero to set it to
69
71
  * @param mode The washing instructions to set it to
70
72
  * @returns Whether we successfully tuned the Retro Cape.
@@ -79,6 +81,7 @@ export function set(hero, mode) {
79
81
  }
80
82
  /**
81
83
  * Returns the expected Modifiers of the Retro Cape for a particular setting
84
+ *
82
85
  * @param hero The Superhero setting
83
86
  * @param mode The washing instructions setting
84
87
  * @returns A Modifiers object describing the Retro Cape were it to be tuned to that setting.
@@ -99,6 +102,7 @@ const skills = new Map([
99
102
  ]);
100
103
  /**
101
104
  * Tunes the Retro Cape to allow it to grant a particular skill.
105
+ *
102
106
  * @param skill The skill to tune the Retro Cape to.
103
107
  * @returns Whether we successfully tuned the cape.
104
108
  */
@@ -1,8 +1,14 @@
1
1
  import { Location, Monster, Item } from "kolmafia";
2
2
  export declare const orb: Item;
3
+ /**
4
+ * Determines whether you `have` the Miniature Crystal Ball
5
+ *
6
+ * @returns Whether you `have` the Miniature Crystal Ball
7
+ */
3
8
  export declare function have(): boolean;
4
9
  /**
5
10
  * Ponders your orb (if it is able to do so safely) and then returns a Map keyed by location consisting of extant predictions
11
+ *
6
12
  * @returns A map of all predictions currently active in an adventurer's miniature crystal ball, after visiting the "ponder" URL to refresh them.
7
13
  */
8
14
  export declare function ponder(): Map<Location, Monster>;
@@ -1,7 +1,13 @@
1
1
  import { toLocation, toMonster, availableAmount, Item, visitUrl, } from "kolmafia";
2
+ import { logger } from "../..";
2
3
  import { canVisitUrl } from "../../lib";
3
4
  import { get } from "../../property";
4
5
  export const orb = Item.get("miniature crystal ball");
6
+ /**
7
+ * Determines whether you `have` the Miniature Crystal Ball
8
+ *
9
+ * @returns Whether you `have` the Miniature Crystal Ball
10
+ */
5
11
  export function have() {
6
12
  return availableAmount(orb) > 0;
7
13
  }
@@ -11,12 +17,18 @@ const parsedProp = () => get("crystalBallPredictions")
11
17
  .map(([, location, monster]) => [toLocation(location), toMonster(monster)]);
12
18
  /**
13
19
  * Ponders your orb (if it is able to do so safely) and then returns a Map keyed by location consisting of extant predictions
20
+ *
14
21
  * @returns A map of all predictions currently active in an adventurer's miniature crystal ball, after visiting the "ponder" URL to refresh them.
15
22
  */
16
23
  export function ponder() {
17
24
  if (!have())
18
25
  return new Map();
19
- if (canVisitUrl())
26
+ if (canVisitUrl()) {
27
+ logger.debug("Now pondering Crystal Ball.");
20
28
  visitUrl("inventory.php?ponder=1", false);
29
+ }
30
+ else {
31
+ logger.debug("Failed to ponder Crystall Ball.");
32
+ }
21
33
  return new Map(parsedProp());
22
34
  }
@@ -2,33 +2,39 @@ import { Effect } from "kolmafia";
2
2
  export declare const helmet: import("kolmafia").Item;
3
3
  /**
4
4
  * Returns whether the player owns an unpackaged Daylight Shavings Helmet, and it's available in either the inventory or other zones as determined by autoSatisfy settings.
5
+ *
5
6
  * @returns whether we have the Daylight Shavings Helmet.
6
7
  */
7
8
  export declare function have(): boolean;
8
9
  export declare const buffs: Effect[];
9
10
  /**
10
11
  * Tells you whether you currently have a beardbuff active. Warning: because of spaghetti, this does not determine buff eligibility.
12
+ *
11
13
  * @returns Whether you currently have a beardbuff active
12
14
  */
13
15
  export declare function hasBuff(): boolean;
14
16
  /**
15
17
  * Checks to see if there are any beardbuffs you have more than 1 turn of, determining whether you are eligible to receive a buff post-combat.
18
+ *
16
19
  * @returns Whether you current are able to get a buff from the Daylight Shaving Helmet.
17
20
  */
18
21
  export declare function buffAvailable(): boolean;
19
22
  /**
20
23
  * Calculates and returns the cycle of buffs that the hat should cycle through.
24
+ *
21
25
  * @param playerclass The class to generate a cycle for
22
26
  * @returns An ordered array consisting of the cycle for this class. The first element of the array will be the first buff a player should expect to get in a given ascension.
23
27
  */
24
28
  export declare function buffCycle(playerclass?: import("kolmafia").Class): Effect[];
25
29
  /**
26
30
  * Returns the next buff we expect to get from the shaving hat.
31
+ *
27
32
  * @returns The next buff we expect to get from the shaving hat.
28
33
  */
29
34
  export declare function nextBuff(): Effect;
30
35
  /**
31
36
  * Returns the number of buffs we expect it'll take to get to a given buff. Returns 1 for the next buff, 2 for the one after that, and so on. Returns 11 for the most recent buff.
37
+ *
32
38
  * @param buff The shaving buff in question
33
39
  * @returns The number of buffs we expect it'll take to get to the inputted buff; null if said buff is not granted by the shaving hat.
34
40
  */
@@ -5,6 +5,7 @@ import { $effects, $item } from "../../template-string";
5
5
  export const helmet = $item `Daylight Shavings Helmet`;
6
6
  /**
7
7
  * Returns whether the player owns an unpackaged Daylight Shavings Helmet, and it's available in either the inventory or other zones as determined by autoSatisfy settings.
8
+ *
8
9
  * @returns whether we have the Daylight Shavings Helmet.
9
10
  */
10
11
  export function have() {
@@ -13,6 +14,7 @@ export function have() {
13
14
  export const buffs = $effects `Spectacle Moustache, Toiletbrush Moustache, Barbell Moustache, Grizzly Beard, Surrealist's Moustache, Musician's Musician's Moustache, Gull-Wing Moustache, Space Warlord's Beard, Pointy Wizard Beard, Cowboy Stache, Friendly Chops`;
14
15
  /**
15
16
  * Tells you whether you currently have a beardbuff active. Warning: because of spaghetti, this does not determine buff eligibility.
17
+ *
16
18
  * @returns Whether you currently have a beardbuff active
17
19
  */
18
20
  export function hasBuff() {
@@ -20,6 +22,7 @@ export function hasBuff() {
20
22
  }
21
23
  /**
22
24
  * Checks to see if there are any beardbuffs you have more than 1 turn of, determining whether you are eligible to receive a buff post-combat.
25
+ *
23
26
  * @returns Whether you current are able to get a buff from the Daylight Shaving Helmet.
24
27
  */
25
28
  export function buffAvailable() {
@@ -27,6 +30,7 @@ export function buffAvailable() {
27
30
  }
28
31
  /**
29
32
  * Calculates and returns the cycle of buffs that the hat should cycle through.
33
+ *
30
34
  * @param playerclass The class to generate a cycle for
31
35
  * @returns An ordered array consisting of the cycle for this class. The first element of the array will be the first buff a player should expect to get in a given ascension.
32
36
  */
@@ -44,6 +48,7 @@ export function buffCycle(playerclass = myClass()) {
44
48
  }
45
49
  /**
46
50
  * Returns the next buff we expect to get from the shaving hat.
51
+ *
47
52
  * @returns The next buff we expect to get from the shaving hat.
48
53
  */
49
54
  export function nextBuff() {
@@ -55,6 +60,7 @@ export function nextBuff() {
55
60
  }
56
61
  /**
57
62
  * Returns the number of buffs we expect it'll take to get to a given buff. Returns 1 for the next buff, 2 for the one after that, and so on. Returns 11 for the most recent buff.
63
+ *
58
64
  * @param buff The shaving buff in question
59
65
  * @returns The number of buffs we expect it'll take to get to the inputted buff; null if said buff is not granted by the shaving hat.
60
66
  */
@@ -2,10 +2,14 @@ import { Item, Location } from "kolmafia";
2
2
  export declare const item: Item;
3
3
  /**
4
4
  * Is the autumn-aton currently in your inventory, available to deploy?
5
+ *
6
+ * @returns The whether the autumn-aton is currently available for deployment
5
7
  */
6
8
  export declare function available(): boolean;
7
9
  /**
8
10
  * Do you own the autumn-aton?
11
+ *
12
+ * @returns Whether you are an autumn-aton `have`r
9
13
  */
10
14
  export declare function have(): boolean;
11
15
  /**
@@ -14,6 +18,7 @@ export declare function have(): boolean;
14
18
  export declare function currentlyIn(): Location | null;
15
19
  /**
16
20
  * Deploy the autumn-aton to a location of your choosing.
21
+ *
17
22
  * @param target A location to send the autumn-aton to, or a prioritized list of locations to send it to, or a function to pick which location to send it to.
18
23
  * @param upgrade Should we apply any upgrades we see available?
19
24
  * @returns Where we ended up sending the autumn-aton; null if we didn't send it off.
@@ -21,6 +26,7 @@ export declare function currentlyIn(): Location | null;
21
26
  export declare function sendTo(target: Location | Location[] | ((locations: Location[]) => Location), upgrade?: boolean): Location | null;
22
27
  /**
23
28
  * Install any available upgrades for the autumn-aton.
29
+ *
24
30
  * @returns Whether there were any upgrades to install.
25
31
  */
26
32
  export declare function upgrade(): boolean;
@@ -41,6 +47,9 @@ export declare function currentUpgrades(): Upgrade[];
41
47
  * @returns The number of turns remaining in your current autumn-aton quest. This number may be negative for any number of reasons.
42
48
  */
43
49
  export declare function turnsLeft(): number;
50
+ /**
51
+ * @returns The number of leg-upgrades your autumn-aton has installed
52
+ */
44
53
  export declare function legs(): number;
45
54
  /**
46
55
  * @returns The number of turns we expect your next autumn-aton quest to take.
@@ -58,6 +67,12 @@ export declare function zoneItems(): 3 | 4 | 5;
58
67
  * @returns The number of seasonal items we expect the autumn-aton to return with given its current upgrade-state.
59
68
  */
60
69
  export declare function seasonalItems(): 1 | 2;
70
+ /**
71
+ * Determines and returns the upgrade and item drop associated with the given location
72
+ *
73
+ * @param location The location to check the expected autumn-aton-unique drops of
74
+ * @returns `null` if the location has no upgrade or drop; otherwise, the upgrade and the autumn-aton item associated with that item
75
+ */
61
76
  export declare function getUniques(location: Location): {
62
77
  upgrade: Upgrade;
63
78
  item: Item;
@@ -5,16 +5,26 @@ import { arrayContains } from "../../utils";
5
5
  export const item = Item.get("autumn-aton");
6
6
  /**
7
7
  * Is the autumn-aton currently in your inventory, available to deploy?
8
+ *
9
+ * @returns The whether the autumn-aton is currently available for deployment
8
10
  */
9
11
  export function available() {
10
12
  return availableAmount(item) > 0;
11
13
  }
12
14
  /**
13
15
  * Do you own the autumn-aton?
16
+ *
17
+ * @returns Whether you are an autumn-aton `have`r
14
18
  */
15
19
  export function have() {
16
20
  return get("hasAutumnaton") || available();
17
21
  }
22
+ /**
23
+ * Internal function used to parse the fallbot's choice adventure to determine which zones are currently available
24
+ *
25
+ * @param html The pagetext of the fallbot's choice adventure
26
+ * @returns The locations currently available to send the fallbot to
27
+ */
18
28
  function checkLocations(html) {
19
29
  return xpath(html, '//select[@name="heythereprogrammer"]//option[position()>1]/text()').map((name) => toLocation(name));
20
30
  }
@@ -27,6 +37,7 @@ export function currentlyIn() {
27
37
  }
28
38
  /**
29
39
  * Deploy the autumn-aton to a location of your choosing.
40
+ *
30
41
  * @param target A location to send the autumn-aton to, or a prioritized list of locations to send it to, or a function to pick which location to send it to.
31
42
  * @param upgrade Should we apply any upgrades we see available?
32
43
  * @returns Where we ended up sending the autumn-aton; null if we didn't send it off.
@@ -56,6 +67,7 @@ export function sendTo(target, upgrade = true) {
56
67
  }
57
68
  /**
58
69
  * Install any available upgrades for the autumn-aton.
70
+ *
59
71
  * @returns Whether there were any upgrades to install.
60
72
  */
61
73
  export function upgrade() {
@@ -102,6 +114,9 @@ export function currentUpgrades() {
102
114
  export function turnsLeft() {
103
115
  return get("autumnatonQuestTurn") - totalTurnsPlayed();
104
116
  }
117
+ /**
118
+ * @returns The number of leg-upgrades your autumn-aton has installed
119
+ */
105
120
  export function legs() {
106
121
  return currentUpgrades().filter((u) => u.includes("leg")).length;
107
122
  }
@@ -149,6 +164,12 @@ const UNIQUES = {
149
164
  high: { index: 8, item: $item `autumn years wisdom` },
150
165
  },
151
166
  };
167
+ /**
168
+ * Determines and returns the upgrade and item drop associated with the given location
169
+ *
170
+ * @param location The location to check the expected autumn-aton-unique drops of
171
+ * @returns `null` if the location has no upgrade or drop; otherwise, the upgrade and the autumn-aton item associated with that item
172
+ */
152
173
  export function getUniques(location) {
153
174
  const env = location.environment;
154
175
  const difficulty = location.difficultyLevel;
@@ -1,34 +1,43 @@
1
1
  import { Monster } from "kolmafia";
2
2
  export declare const locket: import("kolmafia").Item;
3
+ /**
4
+ * @returns Whether you `have` the Combat Lover's Locket
5
+ */
3
6
  export declare function have(): boolean;
4
7
  /**
5
8
  * Filters the set of all unlocked locket monsters to only the ones available to be locketed right now.
9
+ *
6
10
  * @returns An array consisting of all Monsters you can fight with your locket right now.
7
11
  */
8
12
  export declare function availableLocketMonsters(): Monster[];
9
13
  /**
10
14
  * Parses getLocketMonsters and returns the collection of all Monsters as an Array.
15
+ *
11
16
  * @returns An array consisting of all Monsters you can hypothetically fight, regardless of whether they've been fought today.
12
17
  */
13
18
  export declare function unlockedLocketMonsters(): Monster[];
14
19
  /**
15
20
  * Determines how many reminisces remain by parsing the _locketMonstersFought property.
21
+ *
16
22
  * @returns The number of reminisces a player has available; 0 if they lack the Locket.
17
23
  */
18
24
  export declare function reminiscesLeft(): number;
19
25
  /**
20
26
  * Determines which monsters were reminisced today by parsing the _locketMonstersFought property.
27
+ *
21
28
  * @returns An array consisting of the Monsters reminisced today.
22
29
  */
23
30
  export declare function monstersReminisced(): Monster[];
24
31
  /**
25
32
  * Fight a Monster using the Combat Lover's Locket
33
+ *
26
34
  * @param monster The Monster to fight
27
35
  * @returns false if we are unable to reminisce about this monster. Else, returns whether, at the end of all things, we have reminisced about this monster.
28
36
  */
29
37
  export declare function reminisce(monster: Monster): boolean;
30
38
  /**
31
39
  * This function efficiently evaluates all of an adventurer's possibly reminiscable monsters, placing them through a filtering criteria and evaluating them based on a passed function.
40
+ *
32
41
  * @param criteria A filtering function for delineating which monsters are "fair game" for the search, such as "is this monster free".
33
42
  * @param value A function for deciding which monsters are "better" than others.
34
43
  * @returns A singular monster that fulfills the criteria function and maximizes the value function.