libram 0.8.28 → 0.8.30

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 (195) hide show
  1. package/dist/Clan.d.ts +128 -0
  2. package/dist/Clan.js +300 -0
  3. package/dist/Copier.d.ts +9 -0
  4. package/dist/Copier.js +15 -0
  5. package/dist/Dungeon.d.ts +45 -0
  6. package/dist/Dungeon.js +115 -0
  7. package/dist/Kmail.d.ts +133 -0
  8. package/dist/Kmail.js +259 -0
  9. package/dist/actions/ActionSource.d.ts +131 -0
  10. package/dist/actions/ActionSource.js +178 -0
  11. package/dist/actions/Banish.d.ts +16 -0
  12. package/dist/actions/Banish.js +121 -0
  13. package/dist/actions/FreeKill.d.ts +16 -0
  14. package/dist/actions/FreeKill.js +94 -0
  15. package/dist/actions/FreeRun.d.ts +16 -0
  16. package/dist/actions/FreeRun.js +81 -0
  17. package/dist/actions/index.d.ts +4 -0
  18. package/dist/actions/index.js +4 -0
  19. package/dist/ascend.d.ts +83 -0
  20. package/dist/ascend.js +268 -0
  21. package/dist/challengePaths/2014/HeavyRains.d.ts +22 -0
  22. package/dist/challengePaths/2014/HeavyRains.js +75 -0
  23. package/dist/challengePaths/2015/CommunityService.d.ts +125 -0
  24. package/dist/challengePaths/2015/CommunityService.js +334 -0
  25. package/dist/challengePaths/2016/NuclearAutumn.d.ts +13 -0
  26. package/dist/challengePaths/2016/NuclearAutumn.js +21 -0
  27. package/dist/challengePaths/index.d.ts +4 -0
  28. package/dist/challengePaths/index.js +4 -0
  29. package/dist/combat.d.ts +414 -0
  30. package/dist/combat.js +711 -0
  31. package/dist/console.d.ts +12 -0
  32. package/dist/console.js +14 -0
  33. package/dist/counter.d.ts +22 -0
  34. package/dist/counter.js +37 -0
  35. package/dist/diet/index.d.ts +80 -0
  36. package/dist/diet/index.js +682 -0
  37. package/dist/diet/knapsack.d.ts +8 -0
  38. package/dist/diet/knapsack.js +128 -0
  39. package/dist/index.d.ts +29 -0
  40. package/dist/index.js +26 -0
  41. package/dist/lib.d.ts +508 -0
  42. package/dist/lib.js +970 -0
  43. package/dist/logger.d.ts +35 -0
  44. package/dist/logger.js +62 -0
  45. package/dist/maximize.d.ts +122 -0
  46. package/dist/maximize.js +531 -0
  47. package/dist/modifier.d.ts +41 -0
  48. package/dist/modifier.js +160 -0
  49. package/dist/modifierTypes.d.ts +16 -0
  50. package/dist/modifierTypes.js +9 -0
  51. package/dist/mood.d.ts +105 -0
  52. package/dist/mood.js +349 -0
  53. package/dist/moonSign.d.ts +13 -0
  54. package/dist/moonSign.js +25 -0
  55. package/dist/overlappingNames.d.ts +3 -0
  56. package/dist/overlappingNames.js +42 -0
  57. package/dist/property.d.ts +222 -0
  58. package/dist/property.js +385 -0
  59. package/dist/propertyTypes.d.ts +19 -0
  60. package/dist/propertyTypes.js +10 -0
  61. package/dist/propertyTyping.d.ts +65 -0
  62. package/dist/propertyTyping.js +91 -0
  63. package/dist/resources/2007/CandyHearts.d.ts +9 -0
  64. package/dist/resources/2007/CandyHearts.js +24 -0
  65. package/dist/resources/2008/DivineFavors.d.ts +9 -0
  66. package/dist/resources/2008/DivineFavors.js +27 -0
  67. package/dist/resources/2008/Stickers.d.ts +49 -0
  68. package/dist/resources/2008/Stickers.js +84 -0
  69. package/dist/resources/2009/Bandersnatch.d.ts +56 -0
  70. package/dist/resources/2009/Bandersnatch.js +93 -0
  71. package/dist/resources/2009/LoveSongs.d.ts +9 -0
  72. package/dist/resources/2009/LoveSongs.js +24 -0
  73. package/dist/resources/2009/SpookyPutty.d.ts +31 -0
  74. package/dist/resources/2009/SpookyPutty.js +49 -0
  75. package/dist/resources/2010/Brickos.d.ts +9 -0
  76. package/dist/resources/2010/Brickos.js +21 -0
  77. package/dist/resources/2010/CrownOfThrones.d.ts +68 -0
  78. package/dist/resources/2010/CrownOfThrones.js +418 -0
  79. package/dist/resources/2010/LookingGlass.d.ts +29 -0
  80. package/dist/resources/2010/LookingGlass.js +89 -0
  81. package/dist/resources/2011/Gygaxian.d.ts +9 -0
  82. package/dist/resources/2011/Gygaxian.js +24 -0
  83. package/dist/resources/2011/ObtuseAngel.d.ts +33 -0
  84. package/dist/resources/2011/ObtuseAngel.js +51 -0
  85. package/dist/resources/2011/StompingBoots.d.ts +37 -0
  86. package/dist/resources/2011/StompingBoots.js +57 -0
  87. package/dist/resources/2012/RainDoh.d.ts +25 -0
  88. package/dist/resources/2012/RainDoh.js +37 -0
  89. package/dist/resources/2012/ReagnimatedGnome.d.ts +31 -0
  90. package/dist/resources/2012/ReagnimatedGnome.js +46 -0
  91. package/dist/resources/2012/Resolutions.d.ts +9 -0
  92. package/dist/resources/2012/Resolutions.js +28 -0
  93. package/dist/resources/2013/Florist.d.ts +81 -0
  94. package/dist/resources/2013/Florist.js +245 -0
  95. package/dist/resources/2013/JungMan.d.ts +33 -0
  96. package/dist/resources/2013/JungMan.js +69 -0
  97. package/dist/resources/2013/PulledTaffy.d.ts +9 -0
  98. package/dist/resources/2013/PulledTaffy.js +33 -0
  99. package/dist/resources/2014/CrimboShrub.d.ts +42 -0
  100. package/dist/resources/2014/CrimboShrub.js +89 -0
  101. package/dist/resources/2014/DNALab.d.ts +56 -0
  102. package/dist/resources/2014/DNALab.js +162 -0
  103. package/dist/resources/2014/WinterGarden.d.ts +23 -0
  104. package/dist/resources/2014/WinterGarden.js +35 -0
  105. package/dist/resources/2015/BarrelShrine.d.ts +8 -0
  106. package/dist/resources/2015/BarrelShrine.js +25 -0
  107. package/dist/resources/2015/ChateauMantegna.d.ts +54 -0
  108. package/dist/resources/2015/ChateauMantegna.js +100 -0
  109. package/dist/resources/2015/DeckOfEveryCard.d.ts +29 -0
  110. package/dist/resources/2015/DeckOfEveryCard.js +122 -0
  111. package/dist/resources/2015/Dinseylandfill.d.ts +89 -0
  112. package/dist/resources/2015/Dinseylandfill.js +205 -0
  113. package/dist/resources/2015/MayoClinic.d.ts +23 -0
  114. package/dist/resources/2015/MayoClinic.js +49 -0
  115. package/dist/resources/2016/GingerBread.d.ts +32 -0
  116. package/dist/resources/2016/GingerBread.js +73 -0
  117. package/dist/resources/2016/SourceTerminal.d.ts +181 -0
  118. package/dist/resources/2016/SourceTerminal.js +275 -0
  119. package/dist/resources/2016/Witchess.d.ts +19 -0
  120. package/dist/resources/2016/Witchess.js +48 -0
  121. package/dist/resources/2017/AsdonMartin.d.ts +59 -0
  122. package/dist/resources/2017/AsdonMartin.js +238 -0
  123. package/dist/resources/2017/Horsery.d.ts +19 -0
  124. package/dist/resources/2017/Horsery.js +42 -0
  125. package/dist/resources/2017/MummingTrunk.d.ts +8 -0
  126. package/dist/resources/2017/MummingTrunk.js +33 -0
  127. package/dist/resources/2017/Pantogram.d.ts +92 -0
  128. package/dist/resources/2017/Pantogram.js +174 -0
  129. package/dist/resources/2017/Robortender.d.ts +30 -0
  130. package/dist/resources/2017/Robortender.js +90 -0
  131. package/dist/resources/2017/Spacegate.d.ts +86 -0
  132. package/dist/resources/2017/Spacegate.js +178 -0
  133. package/dist/resources/2017/TunnelOfLove.d.ts +39 -0
  134. package/dist/resources/2017/TunnelOfLove.js +120 -0
  135. package/dist/resources/2018/LatteLoversMembersMug.d.ts +392 -0
  136. package/dist/resources/2018/LatteLoversMembersMug.js +303 -0
  137. package/dist/resources/2018/SongBoom.d.ts +33 -0
  138. package/dist/resources/2018/SongBoom.js +55 -0
  139. package/dist/resources/2019/BeachComb.d.ts +72 -0
  140. package/dist/resources/2019/BeachComb.js +118 -0
  141. package/dist/resources/2019/CampAway.d.ts +39 -0
  142. package/dist/resources/2019/CampAway.js +72 -0
  143. package/dist/resources/2019/Snapper.d.ts +33 -0
  144. package/dist/resources/2019/Snapper.js +73 -0
  145. package/dist/resources/2020/Cartography.d.ts +16 -0
  146. package/dist/resources/2020/Cartography.js +48 -0
  147. package/dist/resources/2020/Guzzlr.d.ts +160 -0
  148. package/dist/resources/2020/Guzzlr.js +275 -0
  149. package/dist/resources/2020/RetroCape.d.ts +51 -0
  150. package/dist/resources/2020/RetroCape.js +115 -0
  151. package/dist/resources/2021/CrystalBall.d.ts +14 -0
  152. package/dist/resources/2021/CrystalBall.js +41 -0
  153. package/dist/resources/2021/DaylightShavings.d.ts +40 -0
  154. package/dist/resources/2021/DaylightShavings.js +74 -0
  155. package/dist/resources/2022/AutumnAton.d.ts +78 -0
  156. package/dist/resources/2022/AutumnAton.js +182 -0
  157. package/dist/resources/2022/CombatLoversLocket.d.ts +46 -0
  158. package/dist/resources/2022/CombatLoversLocket.js +83 -0
  159. package/dist/resources/2022/GreyGoose.d.ts +59 -0
  160. package/dist/resources/2022/GreyGoose.js +90 -0
  161. package/dist/resources/2022/JuneCleaver.d.ts +47 -0
  162. package/dist/resources/2022/JuneCleaver.js +69 -0
  163. package/dist/resources/2022/TrainSet.d.ts +146 -0
  164. package/dist/resources/2022/TrainSet.js +228 -0
  165. package/dist/resources/2023/AugustScepter.d.ts +25 -0
  166. package/dist/resources/2023/AugustScepter.js +40 -0
  167. package/dist/resources/2023/BurningLeaves.d.ts +25 -0
  168. package/dist/resources/2023/BurningLeaves.js +74 -0
  169. package/dist/resources/2023/CinchoDeMayo.d.ts +25 -0
  170. package/dist/resources/2023/CinchoDeMayo.js +45 -0
  171. package/dist/resources/2023/ClosedCircuitPayphone.d.ts +80 -0
  172. package/dist/resources/2023/ClosedCircuitPayphone.js +129 -0
  173. package/dist/resources/2023/CursedMonkeyPaw.d.ts +46 -0
  174. package/dist/resources/2023/CursedMonkeyPaw.js +113 -0
  175. package/dist/resources/2024/AprilingBandHelmet.d.ts +57 -0
  176. package/dist/resources/2024/AprilingBandHelmet.js +118 -0
  177. package/dist/resources/2024/ChestMimic.d.ts +43 -0
  178. package/dist/resources/2024/ChestMimic.js +125 -0
  179. package/dist/resources/LibramSummon.d.ts +18 -0
  180. package/dist/resources/LibramSummon.js +74 -0
  181. package/dist/resources/index.d.ts +54 -0
  182. package/dist/resources/index.js +54 -0
  183. package/dist/resources/putty-likes.d.ts +21 -0
  184. package/dist/resources/putty-likes.js +33 -0
  185. package/dist/session.d.ts +169 -0
  186. package/dist/session.js +284 -0
  187. package/dist/since.d.ts +51 -0
  188. package/dist/since.js +108 -0
  189. package/dist/template-string.d.ts +324 -0
  190. package/dist/template-string.js +265 -0
  191. package/dist/url.d.ts +35 -0
  192. package/dist/url.js +67 -0
  193. package/dist/utils.d.ts +185 -0
  194. package/dist/utils.js +264 -0
  195. package/package.json +2 -2
@@ -0,0 +1,16 @@
1
+ import { ActionSource, FindActionSourceConstraints } from "./ActionSource";
2
+ /**
3
+ * Find an available banish source subject to constraints.
4
+ *
5
+ * @param constraints Preexisting constraints that restrict possible sources.
6
+ * @returns Banish source satisfying constraints, or null.
7
+ */
8
+ export declare function tryFindBanish(constraints?: FindActionSourceConstraints): ActionSource | null;
9
+ /**
10
+ * Ensure an available banish source subject to constraints.
11
+ * Throws an error if no source can be found.
12
+ *
13
+ * @param constraints Preexisting constraints that restrict possible sources.
14
+ * @returns Banish source satisfying constraints.
15
+ */
16
+ export declare function ensureBanish(constraints?: FindActionSourceConstraints): ActionSource;
@@ -0,0 +1,121 @@
1
+ import { canEquip, cliExecute, myTurncount, restoreMp, retrieveItem, visitUrl, } from "kolmafia";
2
+ import { Macro } from "../combat";
3
+ import { getFoldGroup, have } from "../lib";
4
+ import { Requirement } from "../maximize";
5
+ import { get } from "../property";
6
+ import * as AsdonMartin from "../resources/2017/AsdonMartin";
7
+ import { $item, $items, $skill } from "../template-string";
8
+ import { ActionSource, findActionSource, } from "./ActionSource";
9
+ // Value of _lastCombatStarted the last time we updated scrapbook charges.
10
+ let scrapbookChargesLastUpdated = get("_lastCombatStarted");
11
+ // Free unlimited source every 30 turns.
12
+ // Does not work on special monsters so needs a backup, see tryFindFreeRun.
13
+ // banishedMonsters isn't updated if the banish succeeds on an unbanishable monster
14
+ const asdonMartinSource = new ActionSource($skill `Asdon Martin: Spring-Loaded Front Bumper`, () => {
15
+ if (!AsdonMartin.installed())
16
+ return 0;
17
+ const banishes = get("banishedMonsters").split(":");
18
+ const bumperIndex = banishes
19
+ .map((string) => string.toLowerCase())
20
+ .indexOf("spring-loaded front bumper");
21
+ if (bumperIndex === -1)
22
+ return 1;
23
+ return myTurncount() - parseInt(banishes[bumperIndex + 1]) > 30 ? 1 : 0;
24
+ }, Macro.trySkill($skill `Asdon Martin: Spring-Loaded Front Bumper`), {
25
+ preparation: () => AsdonMartin.fillTo(50),
26
+ });
27
+ const banishSources = [
28
+ // Free limited sources
29
+ new ActionSource($skill `Snokebomb`, () => (have($skill `Snokebomb`) ? 3 - get("_snokebombUsed") : 0), Macro.skill($skill `Snokebomb`), {
30
+ preparation: () => restoreMp(50),
31
+ }),
32
+ new ActionSource($skill `Emotionally Chipped`, () => (have($skill `Emotionally Chipped`) ? 3 - get("_feelHatredUsed") : 0), Macro.skill($skill `Feel Hatred`)),
33
+ new ActionSource($item `Kremlin's Greatest Briefcase`, () => have($item `Kremlin's Greatest Briefcase`)
34
+ ? 3 - get("_kgbTranquilizerDartUses")
35
+ : 0, Macro.skill($skill `KGB tranquilizer dart`), {
36
+ equipmentRequirements: () => new Requirement([], {
37
+ forceEquip: $items `Kremlin's Greatest Briefcase`,
38
+ }),
39
+ }),
40
+ new ActionSource($item `latte lovers member's mug`, () => have($item `latte lovers member's mug`) && !get("_latteBanishUsed")
41
+ ? 1
42
+ : 0, Macro.skill($skill `Throw Latte on Opponent`), {
43
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `latte lovers member's mug` }),
44
+ }),
45
+ new ActionSource($item `Lil' Doctor™ bag`, () => (have($item `Lil' Doctor™ bag`) ? 3 - get("_reflexHammerUsed") : 0), Macro.skill($skill `Reflex Hammer`), {
46
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `Lil' Doctor™ bag` }),
47
+ }),
48
+ new ActionSource($item `mafia middle finger ring`, () => have($item `mafia middle finger ring`) &&
49
+ canEquip($item `mafia middle finger ring`) &&
50
+ !get("_mafiaMiddleFingerRingUsed")
51
+ ? 1
52
+ : 0, Macro.skill($skill `Show them your ring`), {
53
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `mafia middle finger ring` }),
54
+ }),
55
+ new ActionSource($item `V for Vivala mask`, () => have($item `V for Vivala mask`) && !get("_vmaskBanisherUsed") ? 1 : 0, Macro.skill($skill `Creepy Grin`), {
56
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `V for Vivala mask` }),
57
+ preparation: () => restoreMp(30),
58
+ }),
59
+ new ActionSource($item `stinky cheese eye`, () => getFoldGroup($item `stinky cheese eye`).some((item) => have(item)) &&
60
+ !get("_stinkyCheeseBanisherUsed")
61
+ ? 1
62
+ : 0, Macro.skill($skill `Give Your Opponent the Stinkeye`), {
63
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `stinky cheese eye` }),
64
+ preparation: () => {
65
+ if (!have($item `stinky cheese eye`)) {
66
+ cliExecute(`fold stinky cheese eye`);
67
+ }
68
+ return have($item `stinky cheese eye`);
69
+ },
70
+ }),
71
+ new ActionSource($skill `Show your boring familiar pictures`, () => {
72
+ if (have($item `familiar scrapbook`)) {
73
+ if (scrapbookChargesLastUpdated !== get("_lastCombatStarted")) {
74
+ visitUrl("desc_item.php?whichitem=463063785");
75
+ scrapbookChargesLastUpdated = get("_lastCombatStarted");
76
+ }
77
+ return Math.floor(get("scrapbookCharges") / 100);
78
+ }
79
+ return 0;
80
+ }, Macro.skill($skill `Show your boring familiar pictures`), {
81
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `familiar scrapbook` }),
82
+ }),
83
+ new ActionSource($item `human musk`, () => Math.max(0, 3 - get("_humanMuskUses")), Macro.item($item `human musk`), {
84
+ preparation: () => retrieveItem($item `human musk`),
85
+ cost: () => ActionSource.defaultPriceFunction($item `human musk`),
86
+ }),
87
+ // Expensive unlimited sources
88
+ ...$items `Louder Than Bomb, divine champagne popper, tennis ball`.map((item) => new ActionSource(item, () => Infinity, Macro.item(item), {
89
+ preparation: () => retrieveItem(item),
90
+ cost: () => ActionSource.defaultPriceFunction(item),
91
+ })),
92
+ ];
93
+ /**
94
+ * Find an available banish source subject to constraints.
95
+ *
96
+ * @param constraints Preexisting constraints that restrict possible sources.
97
+ * @returns Banish source satisfying constraints, or null.
98
+ */
99
+ export function tryFindBanish(constraints) {
100
+ let source = findActionSource(banishSources, constraints);
101
+ // Always try to use Asdon Martin: Spring-Loaded Front Bumper first,
102
+ // but only if another source has been found.
103
+ if (source && asdonMartinSource.available()) {
104
+ source = asdonMartinSource.merge(source);
105
+ }
106
+ return source;
107
+ }
108
+ /**
109
+ * Ensure an available banish source subject to constraints.
110
+ * Throws an error if no source can be found.
111
+ *
112
+ * @param constraints Preexisting constraints that restrict possible sources.
113
+ * @returns Banish source satisfying constraints.
114
+ */
115
+ export function ensureBanish(constraints) {
116
+ const source = tryFindBanish(constraints);
117
+ if (!source) {
118
+ throw new Error("Failed to ensure Banish source");
119
+ }
120
+ return source;
121
+ }
@@ -0,0 +1,16 @@
1
+ import { ActionSource, FindActionSourceConstraints } from "./ActionSource";
2
+ /**
3
+ * Find an available free kill source subject to constraints.
4
+ *
5
+ * @param constraints Preexisting constraints that restrict possible sources.
6
+ * @returns Free kill source satisfying constraints, or null.
7
+ */
8
+ export declare function tryFindFreeKill(constraints?: FindActionSourceConstraints): ActionSource | null;
9
+ /**
10
+ * Ensure an available free kill source subject to constraints.
11
+ * Throws an error if no source can be found.
12
+ *
13
+ * @param constraints Preexisting constraints that restrict possible sources.
14
+ * @returns Free kill source satisfying constraints.
15
+ */
16
+ export declare function ensureFreeKill(constraints?: FindActionSourceConstraints): ActionSource;
@@ -0,0 +1,94 @@
1
+ import { canEquip, myLightning, restoreMp, retrieveItem, use } from "kolmafia";
2
+ import { Macro } from "../combat";
3
+ import { have } from "../lib";
4
+ import { Requirement } from "../maximize";
5
+ import { get } from "../property";
6
+ import * as AsdonMartin from "../resources/2017/AsdonMartin";
7
+ import { $familiar, $item, $items, $skill } from "../template-string";
8
+ import { ActionSource, findActionSource, } from "./ActionSource";
9
+ const freeKillSources = [
10
+ // Free limited sources
11
+ new ActionSource($skill `Gingerbread Mob Hit`, () => !get("_gingerbreadMobHitUsed") && have($skill `Gingerbread Mob Hit`)
12
+ ? 1
13
+ : 0, Macro.skill($skill `Gingerbread Mob Hit`), {
14
+ preparation: () => restoreMp(30),
15
+ }),
16
+ new ActionSource($skill `Shattering Punch`, () => have($skill `Shattering Punch`) ? 3 - get("_shatteringPunchUsed") : 0, Macro.skill($skill `Shattering Punch`), {
17
+ preparation: () => restoreMp(30),
18
+ }),
19
+ new ActionSource($item `replica bat-oomerang`, () => have($item `replica bat-oomerang`)
20
+ ? 3 - get("_usedReplicaBatoomerang")
21
+ : 0, Macro.item($item `replica bat-oomerang`)),
22
+ new ActionSource($item `The Jokester's gun`, () => !get("_firedJokestersGun") &&
23
+ have($item `The Jokester's gun`) &&
24
+ canEquip($item `The Jokester's gun`)
25
+ ? 1
26
+ : 0, Macro.skill($skill `Fire the Jokester's Gun`), {
27
+ equipmentRequirements: () => new Requirement([], {
28
+ forceEquip: $items `The Jokester's gun`,
29
+ }),
30
+ }),
31
+ new ActionSource($item `Lil' Doctor™ bag`, () => (have($item `Lil' Doctor™ bag`) ? 3 - get("_chestXRayUsed") : 0), Macro.skill($skill `Chest X-Ray`), {
32
+ equipmentRequirements: () => new Requirement([], {
33
+ forceEquip: $items `Lil' Doctor™ bag`,
34
+ }),
35
+ }),
36
+ new ActionSource($skill `Asdon Martin: Missile Launcher`, () => (!get("_missileLauncherUsed") && AsdonMartin.installed() ? 1 : 0), Macro.skill($skill `Asdon Martin: Missile Launcher`), {
37
+ preparation: () => AsdonMartin.fillTo(100),
38
+ }),
39
+ // Heavy Rains
40
+ new ActionSource($skill `Lightning Strike`, () => (have($skill `Lightning Strike`) ? Math.floor(myLightning() / 20) : 0), Macro.skill($skill `Lightning Strike`)),
41
+ // Expensive limited sources
42
+ new ActionSource($item `powdered madness`, () => 5 - get("_powderedMadnessUses"), Macro.item($item `powdered madness`), {
43
+ preparation: () => retrieveItem($item `powdered madness`),
44
+ cost: () => ActionSource.defaultPriceFunction($item `powdered madness`),
45
+ }),
46
+ new ActionSource($familiar `Puck Man`, () => (have($familiar `Puck Man`) ? 20 - get("_powerPillUses") : 0), Macro.item($item `power pill`), {
47
+ familiar: () => $familiar `Puck Man`,
48
+ preparation: () => retrieveItem($item `power pill`),
49
+ cost: () => ActionSource.defaultPriceFunction($item `power pill`),
50
+ }),
51
+ new ActionSource($familiar `Ms. Puck Man`, () => (have($familiar `Ms. Puck Man`) ? 20 - get("_powerPillUses") : 0), Macro.item($item `power pill`), {
52
+ familiar: () => $familiar `Ms. Puck Man`,
53
+ preparation: () => retrieveItem($item `power pill`),
54
+ cost: () => ActionSource.defaultPriceFunction($item `power pill`),
55
+ }),
56
+ // Expensive unlimited sources
57
+ new ActionSource($skill `Shocking Lick`, () => Infinity, Macro.skill($skill `Shocking Lick`), {
58
+ preparation: () => {
59
+ if (get("shockingLickCharges") === 0 &&
60
+ retrieveItem($item `battery (9-Volt)`)) {
61
+ use($item `battery (9-Volt)`);
62
+ }
63
+ return get("shockingLickCharges") > 0;
64
+ },
65
+ cost: () => ActionSource.defaultPriceFunction($item `battery (AAA)`) * 4,
66
+ }),
67
+ ...$items `Daily Affirmation: Think Win-Lose, superduperheated metal`.map((item) => new ActionSource(item, () => Infinity, Macro.item(item), {
68
+ preparation: () => retrieveItem(item),
69
+ cost: () => ActionSource.defaultPriceFunction(item),
70
+ })),
71
+ ];
72
+ /**
73
+ * Find an available free kill source subject to constraints.
74
+ *
75
+ * @param constraints Preexisting constraints that restrict possible sources.
76
+ * @returns Free kill source satisfying constraints, or null.
77
+ */
78
+ export function tryFindFreeKill(constraints) {
79
+ return findActionSource(freeKillSources, constraints);
80
+ }
81
+ /**
82
+ * Ensure an available free kill source subject to constraints.
83
+ * Throws an error if no source can be found.
84
+ *
85
+ * @param constraints Preexisting constraints that restrict possible sources.
86
+ * @returns Free kill source satisfying constraints.
87
+ */
88
+ export function ensureFreeKill(constraints) {
89
+ const source = tryFindFreeKill(constraints);
90
+ if (!source) {
91
+ throw new Error("Failed to ensure Free Kill source");
92
+ }
93
+ return source;
94
+ }
@@ -0,0 +1,16 @@
1
+ import { ActionSource, FindActionSourceConstraints } from "./ActionSource";
2
+ /**
3
+ * Find an available free run source subject to constraints.
4
+ *
5
+ * @param constraints Preexisting constraints that restrict possible sources.
6
+ * @returns Free run source satisfying constraints, or null.
7
+ */
8
+ export declare function tryFindFreeRun(constraints?: FindActionSourceConstraints): ActionSource | null;
9
+ /**
10
+ * Ensure an available free run source subject to constraints.
11
+ * Throws an error if no source can be found.
12
+ *
13
+ * @param constraints Preexisting constraints that restrict possible sources.
14
+ * @returns Free run source satisfying constraints.
15
+ */
16
+ export declare function ensureFreeRun(constraints?: FindActionSourceConstraints): ActionSource;
@@ -0,0 +1,81 @@
1
+ import { retrieveItem } from "kolmafia";
2
+ import { Macro } from "../combat";
3
+ import { ensureEffect, getSongCount, getSongLimit, have } from "../lib";
4
+ import { Requirement } from "../maximize";
5
+ import { get } from "../property";
6
+ import * as Bandersnatch from "../resources/2009/Bandersnatch";
7
+ import * as StompingBoots from "../resources/2011/StompingBoots";
8
+ import { $effect, $familiar, $item, $items, $skill } from "../template-string";
9
+ import { ActionSource, findActionSource, } from "./ActionSource";
10
+ // eslint-disable-next-line libram/verify-constants
11
+ const EVERYTHING_LOOKS_GREEN = $effect `Everything Looks Green`;
12
+ const freeRunSources = [
13
+ // Free unlimited source
14
+ new ActionSource($item `spring shoes`, () => (have(EVERYTHING_LOOKS_GREEN) ? 1 : 0), Macro.skill($skill `Spring Away`), {
15
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `spring shoes` }),
16
+ }),
17
+ // Free limited sources
18
+ new ActionSource($familiar `Frumious Bandersnatch`, () => (have($effect `Ode to Booze`) || getSongCount() < getSongLimit()) &&
19
+ Bandersnatch.couldRunaway()
20
+ ? Bandersnatch.getRemainingRunaways()
21
+ : 0, Macro.step("runaway"), {
22
+ equipmentRequirements: () => new Requirement(["Familiar Weight"], {}),
23
+ preparation: () => {
24
+ ensureEffect($effect `Ode to Booze`);
25
+ return have($effect `Ode to Booze`);
26
+ },
27
+ familiar: () => $familiar `Frumious Bandersnatch`,
28
+ }),
29
+ new ActionSource($familiar `Pair of Stomping Boots`, () => StompingBoots.couldRunaway() ? StompingBoots.getRemainingRunaways() : 0, Macro.step("runaway"), {
30
+ equipmentRequirements: () => new Requirement(["Familiar Weight"], {}),
31
+ familiar: () => $familiar `Pair of Stomping Boots`,
32
+ }),
33
+ new ActionSource($item `navel ring of navel gazing`, () => have($item `navel ring of navel gazing`)
34
+ ? Math.max(0, 3 - get("_navelRunaways"))
35
+ : 0, Macro.step("runaway"), {
36
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `navel ring of navel gazing` }),
37
+ }),
38
+ new ActionSource($item `Greatest American Pants`, () => have($item `Greatest American Pants`)
39
+ ? Math.max(0, 3 - get("_navelRunaways"))
40
+ : 0, Macro.step("runaway"), {
41
+ equipmentRequirements: () => new Requirement([], { forceEquip: $items `Greatest American Pants` }),
42
+ }),
43
+ new ActionSource($item `peppermint parasol`, () => Math.max(0, 3 - get("_navelRunaways")), Macro.item($item `peppermint parasol`), {
44
+ preparation: () => retrieveItem($item `peppermint parasol`),
45
+ cost: () => Math.min(ActionSource.defaultPriceFunction($item `peppermint sprout`) * 5, ActionSource.defaultPriceFunction($item `peppermint parasol`)) / 10, // Breaks after 10 successful runaways.
46
+ }),
47
+ // unlimited items that trigger everything looks green
48
+ ...$items `green smoke bomb, tattered scrap of paper, GOTO, T.U.R.D.S. Key`.map((item) => new ActionSource(item, () => (have(EVERYTHING_LOOKS_GREEN) ? 0 : 1), Macro.item(item), {
49
+ preparation: () => retrieveItem(item),
50
+ cost: () => ActionSource.defaultPriceFunction(item),
51
+ })),
52
+ // limited quest items
53
+ ...$items `fish-oil smoke bomb, giant eraser`.map((item) => new ActionSource(item, () => (!have(item) ? 0 : 1), Macro.item(item), {
54
+ preparation: () => have(item),
55
+ cost: () => 0,
56
+ })),
57
+ ];
58
+ /**
59
+ * Find an available free run source subject to constraints.
60
+ *
61
+ * @param constraints Preexisting constraints that restrict possible sources.
62
+ * @returns Free run source satisfying constraints, or null.
63
+ */
64
+ export function tryFindFreeRun(constraints) {
65
+ const source = findActionSource(freeRunSources, constraints);
66
+ return source;
67
+ }
68
+ /**
69
+ * Ensure an available free run source subject to constraints.
70
+ * Throws an error if no source can be found.
71
+ *
72
+ * @param constraints Preexisting constraints that restrict possible sources.
73
+ * @returns Free run source satisfying constraints.
74
+ */
75
+ export function ensureFreeRun(constraints) {
76
+ const source = tryFindFreeRun(constraints);
77
+ if (!source) {
78
+ throw new Error("Failed to ensure Free Run source");
79
+ }
80
+ return source;
81
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./ActionSource";
2
+ export * from "./Banish";
3
+ export * from "./FreeKill";
4
+ export * from "./FreeRun";
@@ -0,0 +1,4 @@
1
+ export * from "./ActionSource";
2
+ export * from "./Banish";
3
+ export * from "./FreeKill";
4
+ export * from "./FreeRun";
@@ -0,0 +1,83 @@
1
+ import { Skill, Class, Item, Path, MafiaClass } from "kolmafia";
2
+ import { MoonSign } from "./moonSign";
3
+ import { ChateauMantegna } from "./resources";
4
+ export declare enum Lifestyle {
5
+ casual = 1,
6
+ softcore = 2,
7
+ normal = 2,
8
+ hardcore = 3
9
+ }
10
+ export declare enum KolGender {
11
+ male = 1,
12
+ female = 2
13
+ }
14
+ /**
15
+ * Get a mapping of permed skills to the extent to which they're permed.
16
+ *
17
+ * If a skill is not permed at all, it will not appear in the mapping.
18
+ *
19
+ * @returns Permed skills mapping
20
+ */
21
+ export declare function permedSkills(): Map<Skill, Lifestyle>;
22
+ export declare class AscendError extends Error {
23
+ }
24
+ declare const gardens: readonly ["packet of pumpkin seeds", "Peppermint Pip Packet", "packet of dragon's teeth", "packet of beer seeds", "packet of winter seeds", "packet of thanksgarden seeds", "packet of tall grass seeds", "packet of mushroom spores", "packet of rock seeds"];
25
+ declare type Garden = typeof gardens[number];
26
+ declare const eudorae: readonly ["My Own Pen Pal kit", "GameInformPowerDailyPro subscription card", "Xi Receiver Unit", "New-You Club Membership Form", "Our Daily Candles™ order form"];
27
+ declare type Eudora = typeof eudorae[number];
28
+ export declare class AscensionPrepError extends Error {
29
+ cause: string;
30
+ constructor(cause: string, original?: MafiaClass | string);
31
+ }
32
+ declare type InputMoonSign = number | Lowercase<MoonSign> | "degrassi" | "degrassi knoll" | "friendly degrassi knoll" | "knoll" | "canada" | "canadia" | "little canadia" | "gnomads" | "gnomish" | "gnomish gnomads camp";
33
+ /**
34
+ * Hops the gash, perming no skills by default
35
+ *
36
+ * @param options Configuration for the ascension
37
+ * @param options.path Your path of choice for this ascension
38
+ * @param options.playerClass Your class of choice for this ascension
39
+ * @param options.lifestyle 1 for casual, 2 for softcore, 3 for hardcore. Alternately, use the Lifestyle enum
40
+ * @param options.kolGender An entry from the KolGender enum: 1 for male, 2 for female (sorry that it's limited to those). Defaults to 2 or the corresponding value for defaultGenderOverride pref (which should be 'male' or 'female')
41
+ * @param options.moon Your moon sign as a string, or the zone you're looking for as a string
42
+ * @param options.consumable From the astral deli. Pick the container item, not the product. Defaults to astral six-pack, provide $item`none` for nothing.
43
+ * @param options.pet From the astral pet store.
44
+ * @param options.permOptions Options for perming during a player's stay in Valhalla
45
+ * @param options.permOptions.permSkills A Map<Skill, Lifestyle> of skills you'd like to perm, ordered by priority.
46
+ * @param options.permOptions.neverAbort Whether the ascension should abort on failure
47
+ */
48
+ export declare function ascend(options: {
49
+ path: Path;
50
+ playerClass: Class;
51
+ lifestyle: Lifestyle;
52
+ kolGender?: KolGender;
53
+ moon: InputMoonSign;
54
+ consumable?: Item;
55
+ pet?: Item;
56
+ permOptions?: {
57
+ permSkills: Map<Skill, Lifestyle>;
58
+ neverAbort: boolean;
59
+ };
60
+ }): void;
61
+ /**
62
+ * Sets up various iotms you may want to use in the coming ascension
63
+ *
64
+ * @param ascensionPrep Configuration for various ascension prep settings. Any ommitted key will be kept as-is
65
+ * @param ascensionPrep.garden Garden to which to switch
66
+ * @param ascensionPrep.eudora Eudora to which to switch
67
+ * @param ascensionPrep.chateau Chateau configuration
68
+ * @param ascensionPrep.chateau.desk Chateau desk configuration
69
+ * @param ascensionPrep.chateau.ceiling Chateau ceiling configuration
70
+ * @param ascensionPrep.chateau.nightstand Chateau nightstand configuration
71
+ * @param ascensionPrep.throwOnFail If true, this will throw an error when it fails to switch something
72
+ */
73
+ export declare function prepareAscension({ garden, eudora, chateau, throwOnFail, }?: {
74
+ garden?: Garden;
75
+ eudora?: Eudora;
76
+ chateau?: {
77
+ desk?: ChateauMantegna.Desk;
78
+ ceiling?: ChateauMantegna.Ceiling;
79
+ nightstand?: ChateauMantegna.Nightstand;
80
+ };
81
+ throwOnFail?: boolean;
82
+ }): void;
83
+ export {};