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,57 @@
1
+ import { familiarWeight, useFamiliar, weightAdjustment } from "kolmafia";
2
+ import { have as _have, isCurrentFamiliar } from "../../lib";
3
+ import { get } from "../../property";
4
+ import { $familiar } from "../../template-string";
5
+ const familiar = $familiar `Pair of Stomping Boots`;
6
+ /**
7
+ * @returns whether the player has the Pair of Stomping Boots in their terrarium
8
+ */
9
+ export function have() {
10
+ return _have(familiar);
11
+ }
12
+ /**
13
+ * @returns number of free runaways that have already been used today
14
+ * @see Bandersnatch with which the Stomping Boots shares a counter
15
+ */
16
+ export function getRunaways() {
17
+ return get("_banderRunaways");
18
+ }
19
+ /**
20
+ * @param considerWeightAdjustment Include familiar weight modifiers
21
+ * @returns total number of free runaways that the player can get from their Stomping Boots
22
+ */
23
+ export function getMaxRunaways(considerWeightAdjustment = true) {
24
+ const weightBuffs = considerWeightAdjustment ? weightAdjustment() : 0;
25
+ return Math.floor((familiarWeight(familiar) + weightBuffs) / 5);
26
+ }
27
+ /**
28
+ * @param considerWeightAdjustment Whether to consider weight adjustment in free run calculation
29
+ * @returns the number of remaining free runaways the player can get from their Stomping Boots
30
+ */
31
+ export function getRemainingRunaways(considerWeightAdjustment = true) {
32
+ return Math.max(0, getMaxRunaways(considerWeightAdjustment) - getRunaways());
33
+ }
34
+ /**
35
+ * @param considerWeightAdjustment Include familiar weight modifiers
36
+ * @returns whether the player could use their Stomping Boots to get a free run in theory
37
+ */
38
+ export function couldRunaway(considerWeightAdjustment = true) {
39
+ return have() && getRemainingRunaways(considerWeightAdjustment) > 0;
40
+ }
41
+ /**
42
+ * @returns whether the player can use their Stomping Boots to get a free run right now
43
+ */
44
+ export function canRunaway() {
45
+ return isCurrentFamiliar(familiar) && couldRunaway();
46
+ }
47
+ /**
48
+ * Prepare a Stomping Boots runaway.
49
+ *
50
+ * This will take your Stomping Boots with you.
51
+ * If any of those steps fail, it will return false.
52
+ *
53
+ * @returns Success
54
+ */
55
+ export function prepareRunaway() {
56
+ return useFamiliar(familiar);
57
+ }
@@ -0,0 +1,25 @@
1
+ import { Monster } from "kolmafia";
2
+ /**
3
+ * See whether the player has a Rain-Doh item in some form
4
+ *
5
+ * @returns Whether the player has any Rain-Doh item
6
+ */
7
+ export declare function have(): boolean;
8
+ /**
9
+ * Get Rain-Doh black box copies made today
10
+ *
11
+ * @returns Number of Rain-Doh black box copies made
12
+ */
13
+ export declare function getRainDohBlackBoxCopiesMade(): number;
14
+ /**
15
+ * Get the current Rain-doh box monster
16
+ *
17
+ * @returns Current Rain-doh box monster
18
+ */
19
+ export declare function getRainDohBlackBoxMonster(): Monster | null;
20
+ /**
21
+ * Use the Rain-Doh box full of monster (i.e. fight the monster probably)
22
+ *
23
+ * @returns Success
24
+ */
25
+ export declare function useRainDohBlackBox(): boolean;
@@ -0,0 +1,37 @@
1
+ import { use } from "kolmafia";
2
+ import { getFoldGroup, have as haveItem } from "../../lib";
3
+ import { get } from "../../property";
4
+ import { $item } from "../../template-string";
5
+ const box = $item `Rain-Doh black box`;
6
+ /**
7
+ * See whether the player has a Rain-Doh item in some form
8
+ *
9
+ * @returns Whether the player has any Rain-Doh item
10
+ */
11
+ export function have() {
12
+ return getFoldGroup(box).some((item) => haveItem(item));
13
+ }
14
+ /**
15
+ * Get Rain-Doh black box copies made today
16
+ *
17
+ * @returns Number of Rain-Doh black box copies made
18
+ */
19
+ export function getRainDohBlackBoxCopiesMade() {
20
+ return Math.max(0, get("_raindohCopiesMade"));
21
+ }
22
+ /**
23
+ * Get the current Rain-doh box monster
24
+ *
25
+ * @returns Current Rain-doh box monster
26
+ */
27
+ export function getRainDohBlackBoxMonster() {
28
+ return get("rainDohMonster");
29
+ }
30
+ /**
31
+ * Use the Rain-Doh box full of monster (i.e. fight the monster probably)
32
+ *
33
+ * @returns Success
34
+ */
35
+ export function useRainDohBlackBox() {
36
+ return use(box);
37
+ }
@@ -0,0 +1,31 @@
1
+ import { Item } from "kolmafia";
2
+ /**
3
+ * @returns Whether the player has a Reagnimated Gnome in their terrarium
4
+ */
5
+ export declare function have(): boolean;
6
+ export declare const bodyParts: {
7
+ readonly ears: Item;
8
+ readonly lung: Item;
9
+ readonly elbow: Item;
10
+ readonly kgnee: Item;
11
+ readonly foot: Item;
12
+ };
13
+ export declare type BodyPart = keyof typeof bodyParts;
14
+ /**
15
+ * @returns Reagnimated Gnome parts that have already been retrieved from the arena
16
+ */
17
+ export declare function chosenParts(): Item[];
18
+ /**
19
+ * Fetch Reagnimated Gnome part from the arena
20
+ *
21
+ * @param part Reagnimated Gnome body part
22
+ * @returns Success
23
+ */
24
+ export declare function choosePart(part: BodyPart): boolean;
25
+ /**
26
+ * Calculate expected adventures from a given combat for a Reagnimated Gnome at a given weight
27
+ *
28
+ * @param weight Weight with which to calculuate
29
+ * @returns Expected adventures
30
+ */
31
+ export declare function expectedAdvsPerCombat(weight: number): number;
@@ -0,0 +1,46 @@
1
+ import { runChoice, visitUrl } from "kolmafia";
2
+ import { have as _have } from "../../lib";
3
+ import { $familiar, $item } from "../../template-string";
4
+ /**
5
+ * @returns Whether the player has a Reagnimated Gnome in their terrarium
6
+ */
7
+ export function have() {
8
+ return _have($familiar `Reagnimated Gnome`);
9
+ }
10
+ export const bodyParts = {
11
+ ears: $item `gnomish swimmer's ears`,
12
+ lung: $item `gnomish coal miner's lung`,
13
+ elbow: $item `gnomish tennis elbow`,
14
+ kgnee: $item `gnomish housemaid's kgnee`,
15
+ foot: $item `gnomish athlete's foot`,
16
+ };
17
+ /**
18
+ * @returns Reagnimated Gnome parts that have already been retrieved from the arena
19
+ */
20
+ export function chosenParts() {
21
+ return Object.values(bodyParts).filter((part) => _have(part));
22
+ }
23
+ /**
24
+ * Fetch Reagnimated Gnome part from the arena
25
+ *
26
+ * @param part Reagnimated Gnome body part
27
+ * @returns Success
28
+ */
29
+ export function choosePart(part) {
30
+ if (!have())
31
+ return false;
32
+ if (_have(bodyParts[part]))
33
+ return true;
34
+ visitUrl("arena.php");
35
+ runChoice(4);
36
+ return chosenParts().includes(bodyParts[part]);
37
+ }
38
+ /**
39
+ * Calculate expected adventures from a given combat for a Reagnimated Gnome at a given weight
40
+ *
41
+ * @param weight Weight with which to calculuate
42
+ * @returns Expected adventures
43
+ */
44
+ export function expectedAdvsPerCombat(weight) {
45
+ return Math.min(0.01 + (weight / 1000) * 0.99, 1);
46
+ }
@@ -0,0 +1,9 @@
1
+ import { Item } from "kolmafia";
2
+ /**
3
+ * @returns Whether the player can Summon Resolutions
4
+ */
5
+ export declare function have(): boolean;
6
+ /**
7
+ * @returns Map containing the chance of an item to be summoned
8
+ */
9
+ export declare function expected(): Map<Item, number>;
@@ -0,0 +1,28 @@
1
+ import { have as _have } from "../../lib";
2
+ import { $item, $skill } from "../../template-string";
3
+ const summonSkill = $skill `Summon Resolutions`;
4
+ const commonChance = 0.98 / 6;
5
+ const rareChance = 0.02 / 3;
6
+ const libramExpected = new Map([
7
+ [$item `resolution: be feistier`, commonChance],
8
+ [$item `resolution: be happier`, commonChance],
9
+ [$item `resolution: be sexier`, commonChance],
10
+ [$item `resolution: be smarter`, commonChance],
11
+ [$item `resolution: be stronger`, commonChance],
12
+ [$item `resolution: be wealthier`, commonChance],
13
+ [$item `resolution: be kinder`, rareChance],
14
+ [$item `resolution: be luckier`, rareChance],
15
+ [$item `resolution: be more adventurous`, rareChance],
16
+ ]);
17
+ /**
18
+ * @returns Whether the player can Summon Resolutions
19
+ */
20
+ export function have() {
21
+ return _have(summonSkill);
22
+ }
23
+ /**
24
+ * @returns Map containing the chance of an item to be summoned
25
+ */
26
+ export function expected() {
27
+ return libramExpected;
28
+ }
@@ -0,0 +1,81 @@
1
+ import { Location } from "kolmafia";
2
+ import { EnvironmentType } from "../../lib";
3
+ import { Modifiers } from "../../modifier";
4
+ declare type SpecialFlowerAbility = "Delevels Enemy" | "Blocks Attacks" | "Poison";
5
+ declare class Flower {
6
+ name: string;
7
+ id: number;
8
+ environment: EnvironmentType;
9
+ modifier: Modifiers | SpecialFlowerAbility;
10
+ territorial: boolean;
11
+ constructor(name: string, id: number, environment: EnvironmentType, modifier: Modifiers | SpecialFlowerAbility, territorial?: boolean);
12
+ private static visit;
13
+ static plantNamesInZone(location?: Location): string[];
14
+ static plantsInZone(location?: Location): Flower[];
15
+ static modifiersInZone(location?: Location): Modifiers;
16
+ isPlantedHere(location?: Location): boolean;
17
+ available(location?: Location): boolean;
18
+ dig(): boolean;
19
+ plant(): boolean;
20
+ }
21
+ /**
22
+ * @returns Whether or not the Florist is currently available
23
+ */
24
+ export declare function have(): boolean;
25
+ /**
26
+ * @param location The location to check
27
+ * @returns an array of the Flowers in that location
28
+ */
29
+ export declare function flowersIn(location: Location): Flower[];
30
+ /**
31
+ * @param location The location to check
32
+ * @returns an array of the Flowers we can plant in that location
33
+ */
34
+ export declare function flowersAvailableFor(location?: Location): Flower[];
35
+ /**
36
+ * @param location The location to check
37
+ * @returns `true` if the location has 3 flowers in it; `false` otherwise
38
+ */
39
+ export declare function isFull(location?: Location): boolean;
40
+ export declare const RabidDogwood: Flower;
41
+ export declare const Rutabeggar: Flower;
42
+ export declare const RadishRadish: Flower;
43
+ export declare const Artichoker: Flower;
44
+ export declare const SmokeRa: Flower;
45
+ export declare const SkunkCabbage: Flower;
46
+ export declare const DeadlyCinnamon: Flower;
47
+ export declare const CeleryStalker: Flower;
48
+ export declare const LettuceSpray: Flower;
49
+ export declare const SeltzerWatercress: Flower;
50
+ export declare const WarLily: Flower;
51
+ export declare const StealingMagnolia: Flower;
52
+ export declare const CannedSpinach: Flower;
53
+ export declare const Impatiens: Flower;
54
+ export declare const SpiderPlant: Flower;
55
+ export declare const RedFern: Flower;
56
+ export declare const BamBoo: Flower;
57
+ export declare const ArcticMoss: Flower;
58
+ export declare const AloeGuvnor: Flower;
59
+ export declare const PitcherPlant: Flower;
60
+ export declare const BlusteryPuffball: Flower;
61
+ export declare const HornOfPlenty: Flower;
62
+ export declare const WizardsWig: Flower;
63
+ export declare const ShuffleTruffle: Flower;
64
+ export declare const DisLichen: Flower;
65
+ export declare const LooseMorels: Flower;
66
+ export declare const FoulToadstool: Flower;
67
+ export declare const Chillterelle: Flower;
68
+ export declare const Portlybella: Flower;
69
+ export declare const MaxHeadshroom: Flower;
70
+ export declare const Spankton: Flower;
71
+ export declare const Kelptomaniac: Flower;
72
+ export declare const Crookweed: Flower;
73
+ export declare const ElectricEelgrass: Flower;
74
+ export declare const Duckweed: Flower;
75
+ export declare const OrcaOrchid: Flower;
76
+ export declare const Sargassum: Flower;
77
+ export declare const SubSeaRose: Flower;
78
+ export declare const Snori: Flower;
79
+ export declare const UpSeaDaisy: Flower;
80
+ export declare const all: readonly Flower[];
81
+ export {};
@@ -0,0 +1,245 @@
1
+ import { floristAvailable, getFloristPlants, runChoice, visitUrl, } from "kolmafia";
2
+ import { mergeModifiers } from "../../modifier";
3
+ import { get } from "../../property";
4
+ import { $location } from "../../template-string";
5
+ import { notNull } from "../../utils";
6
+ class Flower {
7
+ name;
8
+ id;
9
+ environment;
10
+ modifier;
11
+ territorial;
12
+ constructor(name, id, environment, modifier, territorial = false) {
13
+ this.name = name;
14
+ this.id = id;
15
+ this.environment = environment;
16
+ this.modifier = modifier;
17
+ this.territorial = territorial;
18
+ }
19
+ static visit() {
20
+ visitUrl("place.php?whichplace=forestvillage&action=fv_friar");
21
+ }
22
+ static plantNamesInZone(location = get("lastAdventure") ?? $location.none) {
23
+ return getFloristPlants()[location.toString()] ?? [];
24
+ }
25
+ static plantsInZone(location = get("lastAdventure") ?? $location.none) {
26
+ return this.plantNamesInZone(location)
27
+ .map((flowerName) => toFlower(flowerName))
28
+ .filter(notNull);
29
+ }
30
+ static modifiersInZone(location = get("lastAdventure") ?? $location.none) {
31
+ const plants = this.plantsInZone(location);
32
+ if (!plants)
33
+ return {};
34
+ const modifiers = plants
35
+ .map((plant) => plant.modifier)
36
+ .map((modifier) => (typeof modifier === "string" ? {} : modifier));
37
+ return mergeModifiers(...modifiers);
38
+ }
39
+ isPlantedHere(location = get("lastAdventure") ?? $location.none) {
40
+ const plantedHere = Flower.plantNamesInZone(location)?.includes(this.name);
41
+ return plantedHere !== undefined && plantedHere;
42
+ }
43
+ available(location = get("lastAdventure") ?? $location.none) {
44
+ return (this.environment === location.environment &&
45
+ !get("_floristPlantsUsed").includes(this.name) &&
46
+ !this.isPlantedHere(location));
47
+ }
48
+ dig() {
49
+ if (!this.isPlantedHere())
50
+ return false;
51
+ const flowers = Flower.plantNamesInZone();
52
+ if (!flowers[2])
53
+ return false;
54
+ const plantNumber = flowers.indexOf(this.name);
55
+ Flower.visit();
56
+ runChoice(2, `plnti=${plantNumber}`);
57
+ return !this.isPlantedHere();
58
+ }
59
+ plant() {
60
+ if (this.isPlantedHere())
61
+ return true;
62
+ if (isFull())
63
+ return false;
64
+ Flower.visit();
65
+ runChoice(1, `plant=${this.id}`);
66
+ return this.isPlantedHere();
67
+ }
68
+ }
69
+ /**
70
+ * @returns Whether or not the Florist is currently available
71
+ */
72
+ export function have() {
73
+ return floristAvailable();
74
+ }
75
+ /**
76
+ * Internal function used to convert strings to Flower instances
77
+ *
78
+ * @param name The flower name
79
+ * @returns a Flower instance
80
+ */
81
+ function toFlower(name) {
82
+ return all.find((flower) => name === flower.name) ?? null;
83
+ }
84
+ /**
85
+ * @param location The location to check
86
+ * @returns an array of the Flowers in that location
87
+ */
88
+ export function flowersIn(location) {
89
+ const returnValue = [];
90
+ Flower.plantNamesInZone(location)
91
+ .map(toFlower)
92
+ .forEach((flower) => {
93
+ if (flower)
94
+ returnValue.push(flower);
95
+ });
96
+ return returnValue;
97
+ }
98
+ /**
99
+ * @param location The location to check
100
+ * @returns an array of the Flowers we can plant in that location
101
+ */
102
+ export function flowersAvailableFor(location = get("lastAdventure") ?? $location.none) {
103
+ return all.filter((flower) => flower.available(location));
104
+ }
105
+ /**
106
+ * @param location The location to check
107
+ * @returns `true` if the location has 3 flowers in it; `false` otherwise
108
+ */
109
+ export function isFull(location = get("lastAdventure") ?? $location.none) {
110
+ return flowersIn(location).length === 3;
111
+ }
112
+ export const RabidDogwood = new Flower("Rabid Dogwood", 1, "outdoor", {
113
+ "Monster Level": 30,
114
+ }, true);
115
+ export const Rutabeggar = new Flower("Rutabeggar", 2, "outdoor", {
116
+ "Item Drop": 25,
117
+ }, true);
118
+ export const RadishRadish = new Flower("Rad-ish Radish", 3, "outdoor", { "Moxie Experience": 5 }, true);
119
+ export const Artichoker = new Flower("Artichoker", 4, "outdoor", "Delevels Enemy");
120
+ export const SmokeRa = new Flower("Smoke-ra", 5, "outdoor", "Blocks Attacks");
121
+ export const SkunkCabbage = new Flower("Skunk Cabbage", 6, "outdoor", {
122
+ "Stench Damage": 12.5,
123
+ });
124
+ export const DeadlyCinnamon = new Flower("Deadly Cinnamon", 7, "outdoor", {
125
+ "Hot Damage": 12.5,
126
+ });
127
+ export const CeleryStalker = new Flower("Celery Stalker", 8, "outdoor", {
128
+ "Spooky Damage": 12.5,
129
+ });
130
+ export const LettuceSpray = new Flower("Lettus Spray", 9, "outdoor", {
131
+ "HP Regen Min": 10,
132
+ "HP Regen Max": 29,
133
+ });
134
+ export const SeltzerWatercress = new Flower("Seltzer Watercress", 10, "outdoor", { "MP Regen Min": 5, "MP Regen Max": 15 });
135
+ export const WarLily = new Flower("War Lily", 11, "indoor", { "Monster Level": 30 }, true);
136
+ export const StealingMagnolia = new Flower("Stealing Magnolia", 12, "indoor", { "Item Drop": 25 }, true);
137
+ export const CannedSpinach = new Flower("Canned Spinach", 13, "indoor", { "Muscle Experience": 5 }, true);
138
+ export const Impatiens = new Flower("Impatiens", 14, "indoor", {
139
+ Initiative: 25,
140
+ });
141
+ export const SpiderPlant = new Flower("Spider Plant", 15, "indoor", "Poison");
142
+ export const RedFern = new Flower("Red Fern", 16, "indoor", "Delevels Enemy");
143
+ export const BamBoo = new Flower("BamBOO!", 17, "indoor", {
144
+ "Spooky Damage": 12.5,
145
+ });
146
+ export const ArcticMoss = new Flower("Arctic Moss", 18, "indoor", {
147
+ "Cold Damage": 12.5,
148
+ });
149
+ export const AloeGuvnor = new Flower("Aloe Guv'nor", 19, "indoor", {
150
+ "HP Regen Min": 10,
151
+ "HP Regen Max": 30,
152
+ });
153
+ export const PitcherPlant = new Flower("Pitcher Plant", 20, "indoor", {
154
+ "MP Regen Min": 5,
155
+ "MP Regen Max": 15,
156
+ });
157
+ export const BlusteryPuffball = new Flower("Blustery Puffball", 21, "underground", { "Monster Level": 30 }, true);
158
+ export const HornOfPlenty = new Flower("Horn of Plenty", 22, "underground", { "Item Drop": 25 }, true);
159
+ export const WizardsWig = new Flower("Wizard's Wig", 23, "underground", { "Mysticality Experience": 5 }, true);
160
+ export const ShuffleTruffle = new Flower("Shuffle Truffle", 24, "underground", {
161
+ Initiative: 25,
162
+ });
163
+ export const DisLichen = new Flower("Dis Lichen", 25, "underground", "Delevels Enemy");
164
+ export const LooseMorels = new Flower("Loose Morels", 26, "underground", {
165
+ "Sleaze Damage": 12.5,
166
+ });
167
+ export const FoulToadstool = new Flower("Foul Toadstool", 27, "underground", {
168
+ "Stench Damage": 12.5,
169
+ });
170
+ export const Chillterelle = new Flower("Chillterelle", 28, "underground", {
171
+ "Cold Damage": 12.5,
172
+ });
173
+ export const Portlybella = new Flower("Portlybella", 29, "underground", {
174
+ "HP Regen Min": 10,
175
+ "HP Regen Max": 30,
176
+ });
177
+ export const MaxHeadshroom = new Flower("Max Headshroom", 30, "underground", {
178
+ "MP Regen Min": 5,
179
+ "MP Regen Max": 15,
180
+ });
181
+ export const Spankton = new Flower("Spankton", 31, "underwater", "Delevels Enemy", true);
182
+ export const Kelptomaniac = new Flower("Kelptomaniac", 32, "underwater", { "Item Drop": 40 }, true);
183
+ export const Crookweed = new Flower("Crookweed", 33, "underwater", { "Meat Drop": 60 }, true);
184
+ export const ElectricEelgrass = new Flower("Electric Eelgrass", 34, "underwater", "Blocks Attacks");
185
+ export const Duckweed = new Flower("Duckweed", 35, "underwater", "Blocks Attacks");
186
+ export const OrcaOrchid = new Flower("Orca Orchid", 36, "underwater", {
187
+ "Weapon Damage": 12.5,
188
+ });
189
+ export const Sargassum = new Flower("Sargassum", 37, "underwater", {
190
+ "Stench Damage": 12.5,
191
+ });
192
+ export const SubSeaRose = new Flower("Sub-Sea Rose", 38, "underwater", {
193
+ "Cold Damage": 12.5,
194
+ });
195
+ export const Snori = new Flower("Snori", 39, "underwater", {
196
+ "HP Regen Min": 20,
197
+ "HP Regen Max": 30,
198
+ "MP Regen Min": 10,
199
+ "MP Regen Max": 20,
200
+ });
201
+ export const UpSeaDaisy = new Flower("Up Sea Daisy", 40, "underwater", {
202
+ Experience: 30,
203
+ });
204
+ export const all = Object.freeze([
205
+ RabidDogwood,
206
+ Rutabeggar,
207
+ RadishRadish,
208
+ Artichoker,
209
+ SmokeRa,
210
+ SkunkCabbage,
211
+ DeadlyCinnamon,
212
+ CeleryStalker,
213
+ LettuceSpray,
214
+ SeltzerWatercress,
215
+ WarLily,
216
+ StealingMagnolia,
217
+ CannedSpinach,
218
+ Impatiens,
219
+ SpiderPlant,
220
+ RedFern,
221
+ BamBoo,
222
+ ArcticMoss,
223
+ AloeGuvnor,
224
+ PitcherPlant,
225
+ BlusteryPuffball,
226
+ HornOfPlenty,
227
+ WizardsWig,
228
+ ShuffleTruffle,
229
+ DisLichen,
230
+ LooseMorels,
231
+ FoulToadstool,
232
+ Chillterelle,
233
+ Portlybella,
234
+ MaxHeadshroom,
235
+ Spankton,
236
+ Kelptomaniac,
237
+ Crookweed,
238
+ ElectricEelgrass,
239
+ Duckweed,
240
+ OrcaOrchid,
241
+ Sargassum,
242
+ SubSeaRose,
243
+ Snori,
244
+ UpSeaDaisy,
245
+ ]);
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @returns Whether we `have` the Jung Man
3
+ */
4
+ export declare function have(): boolean;
5
+ export declare enum Jar {
6
+ SUSPICIOUS_GUY = "susguy",
7
+ GOURD_CAPTAIN = "gourdcaptain",
8
+ CRACKPOT_MYSTIC = "mystic",
9
+ OLD_MAN = "oldman",
10
+ PRETENTIOUS_ARTIST = "artist",
11
+ MEATSMITH = "meatsmith",
12
+ JICK = "jick"
13
+ }
14
+ export declare const JAR_ITEMS: {
15
+ susguy: import("kolmafia").Item;
16
+ gourdcaptain: import("kolmafia").Item;
17
+ mystic: import("kolmafia").Item;
18
+ oldman: import("kolmafia").Item;
19
+ artist: import("kolmafia").Item;
20
+ meatsmith: import("kolmafia").Item;
21
+ jick: import("kolmafia").Item;
22
+ };
23
+ /**
24
+ * @returns Whether we can currently make a Jick jar
25
+ */
26
+ export declare function canJickJar(): boolean;
27
+ /**
28
+ * Tries to make a psychoanalytic jar with the chosen target
29
+ *
30
+ * @param jar The character of Loathing to psychoanalyze
31
+ * @returns Whether we successfully crafted the jar
32
+ */
33
+ export declare function makeJar(jar: Jar): boolean;
@@ -0,0 +1,69 @@
1
+ import { haveFamiliar, visitUrl } from "kolmafia";
2
+ import { get } from "../../property";
3
+ import { $familiar, $item } from "../../template-string";
4
+ const familiar = $familiar `Angry Jung Man`;
5
+ /**
6
+ * @returns Whether we `have` the Jung Man
7
+ */
8
+ export function have() {
9
+ return haveFamiliar(familiar);
10
+ }
11
+ export var Jar;
12
+ (function (Jar) {
13
+ Jar["SUSPICIOUS_GUY"] = "susguy";
14
+ Jar["GOURD_CAPTAIN"] = "gourdcaptain";
15
+ Jar["CRACKPOT_MYSTIC"] = "mystic";
16
+ Jar["OLD_MAN"] = "oldman";
17
+ Jar["PRETENTIOUS_ARTIST"] = "artist";
18
+ Jar["MEATSMITH"] = "meatsmith";
19
+ Jar["JICK"] = "jick";
20
+ })(Jar || (Jar = {}));
21
+ const PLACES = {
22
+ [Jar.PRETENTIOUS_ARTIST]: ["place", "town_wrong"],
23
+ [Jar.GOURD_CAPTAIN]: ["place", "town_right"],
24
+ [Jar.CRACKPOT_MYSTIC]: ["shop", "mystic"],
25
+ [Jar.OLD_MAN]: ["place", "sea_oldman"],
26
+ [Jar.MEATSMITH]: ["shop", "meatsmith"],
27
+ [Jar.JICK]: ["showplayer", "1"],
28
+ [Jar.SUSPICIOUS_GUY]: ["tavern"],
29
+ };
30
+ export const JAR_ITEMS = {
31
+ [Jar.SUSPICIOUS_GUY]: $item `jar of psychoses (The Suspicious-Looking Guy)`,
32
+ [Jar.GOURD_CAPTAIN]: $item `jar of psychoses (The Captain of the Gourd)`,
33
+ [Jar.CRACKPOT_MYSTIC]: $item `jar of psychoses (The Crackpot Mystic)`,
34
+ [Jar.OLD_MAN]: $item `jar of psychoses (The Old Man)`,
35
+ [Jar.PRETENTIOUS_ARTIST]: $item `jar of psychoses (The Pretentious Artist)`,
36
+ [Jar.MEATSMITH]: $item `jar of psychoses (The Meatsmith)`,
37
+ [Jar.JICK]: $item `jar of psychoses (Jick)`,
38
+ };
39
+ function getJungUrl(jar) {
40
+ const [page, answer] = PLACES[jar];
41
+ const question = page === "showplayer" ? "who" : `which${page}`;
42
+ const params = [
43
+ ["action", "jung"],
44
+ ["whichperson", jar],
45
+ ];
46
+ if (answer)
47
+ params.push([question, answer]);
48
+ return `${page}.php?${params.map((pair) => pair.join("=")).join("&")}`;
49
+ }
50
+ /**
51
+ * @returns Whether we can currently make a Jick jar
52
+ */
53
+ export function canJickJar() {
54
+ if (get("_jickJarAvailable") === "unknown")
55
+ visitUrl("showplayer.php?who=1");
56
+ return get("_jickJarAvailable") === "true" && !get("_psychoJarFilled");
57
+ }
58
+ /**
59
+ * Tries to make a psychoanalytic jar with the chosen target
60
+ *
61
+ * @param jar The character of Loathing to psychoanalyze
62
+ * @returns Whether we successfully crafted the jar
63
+ */
64
+ export function makeJar(jar) {
65
+ if (jar === Jar.JICK && !canJickJar())
66
+ return false;
67
+ const result = visitUrl(getJungUrl(jar));
68
+ return result.includes("You open up the jar and look into the patient's eyes.");
69
+ }
@@ -0,0 +1,9 @@
1
+ import { Item } from "kolmafia";
2
+ /**
3
+ * @returns true if the player can Summon Taffy
4
+ */
5
+ export declare function have(): boolean;
6
+ /**
7
+ * @returns map containing the chance of an item to be summoned
8
+ */
9
+ export declare function expected(): Map<Item, number>;