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,125 @@
1
+ import { availableAmount, runChoice, runCombat, toMonster, visitUrl, xpath, } from "kolmafia";
2
+ import { directlyUse, examine, have as have_ } from "../../lib";
3
+ import { get } from "../../property";
4
+ import { $familiar, $item } from "../../template-string";
5
+ import { clamp } from "../../utils";
6
+ const familiar = $familiar `Chest Mimic`;
7
+ /**
8
+ * @returns Whether you `have` the Chest Mimic familiar.
9
+ */
10
+ export function have() {
11
+ return have_(familiar);
12
+ }
13
+ const visitBank = () => visitUrl("place.php?whichplace=town_right&action=townright_dna", false);
14
+ const canDonate = () => have_($item `mimic egg`) && get("_mimicEggsDonated") < 3;
15
+ const canReceive = () => familiar.experience >= 100 && get("_mimicEggsObtained") < 11;
16
+ const makeXpath = (selectNumber, disabled) => `//select[@name="mid"][${selectNumber}]/option[position()>0]${disabled ? "[@disabled]" : ""}/@value`;
17
+ function getMonsters(selectNumber, page) {
18
+ const total = xpath(page, makeXpath(selectNumber, false));
19
+ const disabled = new Set(xpath(page, makeXpath(selectNumber, true)));
20
+ return total.filter((m) => !disabled.has(m)).map((id) => toMonster(id));
21
+ }
22
+ /**
23
+ * @returns List of monsters available for donation at this time
24
+ */
25
+ export function getDonableMonsters() {
26
+ if (!canDonate())
27
+ return [];
28
+ const selectNumber = canReceive() ? 2 : 1;
29
+ try {
30
+ const page = visitBank();
31
+ return getMonsters(selectNumber, page);
32
+ }
33
+ finally {
34
+ visitUrl("main.php");
35
+ }
36
+ }
37
+ /**
38
+ * @returns List of monsters available to receive as an egg at this time
39
+ */
40
+ export function getReceivableMonsters() {
41
+ if (!canReceive())
42
+ return [];
43
+ try {
44
+ const page = visitBank();
45
+ return getMonsters(1, page);
46
+ }
47
+ finally {
48
+ visitUrl("main.php");
49
+ }
50
+ }
51
+ /**
52
+ * Donate an egg to the DNA bank
53
+ *
54
+ * @param monster The monster whose egg you want to donate
55
+ * @returns Whether we succeeded in our endeavor
56
+ */
57
+ export function donate(monster) {
58
+ if (!canDonate())
59
+ return false;
60
+ try {
61
+ const selectNumber = canReceive() ? 2 : 1;
62
+ const page = visitBank();
63
+ const available = getMonsters(selectNumber, page);
64
+ if (!available.includes(monster))
65
+ return false;
66
+ return runChoice(1, `mid=${monster.id}`).includes("You donate your egg to science.");
67
+ }
68
+ finally {
69
+ visitUrl("main.php");
70
+ }
71
+ }
72
+ /**
73
+ * Receive an egg from the DNA bank
74
+ *
75
+ * @param monster The monster whose egg you want to receive
76
+ * @returns Whether we succeeded in our endeavor
77
+ */
78
+ export function receive(monster) {
79
+ if (!canReceive())
80
+ return false;
81
+ try {
82
+ const page = visitBank();
83
+ const available = getMonsters(1, page);
84
+ if (!available.includes(monster))
85
+ return false;
86
+ return runChoice(2, `mid=${monster.id}`).includes("Your mimic pops into a backroom and returns a few moments later with a fresh mimic egg!");
87
+ }
88
+ finally {
89
+ visitUrl("main.php");
90
+ }
91
+ }
92
+ /**
93
+ * Differentiate a Mimic egg into a monster, and fight it!
94
+ *
95
+ * @param monster The monster to differentiate your egg into
96
+ * @param combatParams Any parameters you'd like to pass to `runCombat`
97
+ * @returns Whether we successfully differentiated our egg
98
+ */
99
+ export function differentiate(monster, ...combatParams) {
100
+ const page = directlyUse($item `mimic egg`);
101
+ const monsters = getMonsters(1, page);
102
+ if (!monsters.includes(monster)) {
103
+ visitUrl("main.php");
104
+ return false;
105
+ }
106
+ runChoice(1, `mid=${monster.id}`);
107
+ runCombat(...combatParams);
108
+ return true;
109
+ }
110
+ /**
111
+ * Check how many of a monster is available to differentiate into
112
+ *
113
+ * @param monster The monster to differentiate your egg into; may behave weirdly with name collisions
114
+ * @returns How many of a Monster we can differentiate
115
+ */
116
+ export function differentiableQuantity(monster) {
117
+ if (!have_($item `mimic egg`))
118
+ return 0;
119
+ const regex = new RegExp(`${monster.name}\\s*(?:\\((\\d+)\\))?`);
120
+ const page = examine($item `mimic egg`);
121
+ const match = page.match(regex);
122
+ if (!match)
123
+ return 0;
124
+ return clamp(parseInt(match[1]), 0, availableAmount($item `mimic egg`)) || 1;
125
+ }
@@ -0,0 +1,18 @@
1
+ import { Skill, Item } from "kolmafia";
2
+ /**
3
+ *
4
+ * @param summonSkill The libram summoning skill
5
+ * @returns map containing the chance of an item to be summoned
6
+ */
7
+ export declare function expectedLibramSummon(summonSkill: Skill): Map<Item, number>;
8
+ /**
9
+ *
10
+ * @returns map containing the chance of items to be summoned for each libram summoning skill available
11
+ */
12
+ export declare function possibleLibramSummons(): Map<Skill, Map<Item, number>>;
13
+ /**
14
+ * Determines the best libram to cast, based on expected meat value in mall
15
+ *
16
+ * @returns The best libram to cast, based on expected meat value in mall
17
+ */
18
+ export declare function bestLibramToCast(): Skill | null;
@@ -0,0 +1,74 @@
1
+ import { getSaleValue } from "../lib";
2
+ import { $skill } from "../template-string";
3
+ import { sum, maxBy } from "../utils";
4
+ import { expected as candyHeartsExpected, have as candyHeartsHave, } from "./2007/CandyHearts";
5
+ import { expected as divineFavorsExpected, have as divineFavorsHave, } from "./2008/DivineFavors";
6
+ import { expected as loveSongsExpected, have as loveSongsHave, } from "./2009/LoveSongs";
7
+ import { expected as brickosExpected, have as brickosHave, } from "./2010/Brickos";
8
+ import { expected as diceExpected, have as diceHave } from "./2011/Gygaxian";
9
+ import { expected as resolutionsExpected, have as resolutionsHave, } from "./2012/Resolutions";
10
+ import { expected as taffyExpected, have as taffyHave, } from "./2013/PulledTaffy";
11
+ /**
12
+ *
13
+ * @param summonSkill The libram summoning skill
14
+ * @returns map containing the chance of an item to be summoned
15
+ */
16
+ export function expectedLibramSummon(summonSkill) {
17
+ switch (summonSkill) {
18
+ case $skill `Summon Candy Heart`:
19
+ return candyHeartsExpected();
20
+ case $skill `Summon Party Favor`:
21
+ return divineFavorsExpected();
22
+ case $skill `Summon Love Song`:
23
+ return loveSongsExpected();
24
+ case $skill `Summon BRICKOs`:
25
+ return brickosExpected();
26
+ case $skill `Summon Dice`:
27
+ return diceExpected();
28
+ case $skill `Summon Resolutions`:
29
+ return resolutionsExpected();
30
+ case $skill `Summon Taffy`:
31
+ return taffyExpected();
32
+ }
33
+ return new Map();
34
+ }
35
+ /**
36
+ *
37
+ * @returns map containing the chance of items to be summoned for each libram summoning skill available
38
+ */
39
+ export function possibleLibramSummons() {
40
+ const results = new Map();
41
+ if (candyHeartsHave()) {
42
+ results.set($skill `Summon Candy Heart`, candyHeartsExpected());
43
+ }
44
+ if (divineFavorsHave()) {
45
+ results.set($skill `Summon Party Favor`, divineFavorsExpected());
46
+ }
47
+ if (loveSongsHave()) {
48
+ results.set($skill `Summon Love Song`, loveSongsExpected());
49
+ }
50
+ if (brickosHave()) {
51
+ results.set($skill `Summon BRICKOs`, brickosExpected());
52
+ }
53
+ if (diceHave()) {
54
+ results.set($skill `Summon Dice`, diceExpected());
55
+ }
56
+ if (resolutionsHave()) {
57
+ results.set($skill `Summon Resolutions`, resolutionsExpected());
58
+ }
59
+ if (taffyHave()) {
60
+ results.set($skill `Summon Taffy`, taffyExpected());
61
+ }
62
+ return results;
63
+ }
64
+ /**
65
+ * Determines the best libram to cast, based on expected meat value in mall
66
+ *
67
+ * @returns The best libram to cast, based on expected meat value in mall
68
+ */
69
+ export function bestLibramToCast() {
70
+ const arr = Array.from(possibleLibramSummons().entries());
71
+ if (!arr.length)
72
+ return null;
73
+ return maxBy(arr, ([, itemMap]) => sum(Array.from(itemMap.entries()), ([item, weight]) => weight * getSaleValue(item)))[0];
74
+ }
@@ -0,0 +1,54 @@
1
+ import * as Stickers from "./2008/Stickers";
2
+ import * as Bandersnatch from "./2009/Bandersnatch";
3
+ import * as SpookyPutty from "./2009/SpookyPutty";
4
+ import * as CrownOfThrones from "./2010/CrownOfThrones";
5
+ import * as LookingGlass from "./2010/LookingGlass";
6
+ import * as ObtuseAngel from "./2011/ObtuseAngel";
7
+ import * as StompingBoots from "./2011/StompingBoots";
8
+ import * as RainDoh from "./2012/RainDoh";
9
+ import * as ReagnimatedGnome from "./2012/ReagnimatedGnome";
10
+ import * as FloristFriar from "./2013/Florist";
11
+ import * as JungMan from "./2013/JungMan";
12
+ import * as CrimboShrub from "./2014/CrimboShrub";
13
+ import * as DNALab from "./2014/DNALab";
14
+ import * as WinterGarden from "./2014/WinterGarden";
15
+ import * as BarrelShrine from "./2015/BarrelShrine";
16
+ import * as ChateauMantegna from "./2015/ChateauMantegna";
17
+ import * as DeckOfEveryCard from "./2015/DeckOfEveryCard";
18
+ import * as Dinseylandfill from "./2015/Dinseylandfill";
19
+ import * as MayoClinic from "./2015/MayoClinic";
20
+ import * as GingerBread from "./2016/GingerBread";
21
+ import * as SourceTerminal from "./2016/SourceTerminal";
22
+ import * as Witchess from "./2016/Witchess";
23
+ import * as AsdonMartin from "./2017/AsdonMartin";
24
+ import * as Horsery from "./2017/Horsery";
25
+ import * as MummingTrunk from "./2017/MummingTrunk";
26
+ import * as Pantogram from "./2017/Pantogram";
27
+ import * as Robortender from "./2017/Robortender";
28
+ import * as Spacegate from "./2017/Spacegate";
29
+ import * as TunnelOfLove from "./2017/TunnelOfLove";
30
+ import * as Latte from "./2018/LatteLoversMembersMug";
31
+ import * as SongBoom from "./2018/SongBoom";
32
+ import * as BeachComb from "./2019/BeachComb";
33
+ import * as CampAway from "./2019/CampAway";
34
+ import * as Snapper from "./2019/Snapper";
35
+ import * as Cartography from "./2020/Cartography";
36
+ import * as Guzzlr from "./2020/Guzzlr";
37
+ import * as RetroCape from "./2020/RetroCape";
38
+ import * as CrystalBall from "./2021/CrystalBall";
39
+ import * as DaylightShavings from "./2021/DaylightShavings";
40
+ import * as AutumnAton from "./2022/AutumnAton";
41
+ import * as CombatLoversLocket from "./2022/CombatLoversLocket";
42
+ import * as GreyGoose from "./2022/GreyGoose";
43
+ import * as JuneCleaver from "./2022/JuneCleaver";
44
+ import * as TrainSet from "./2022/TrainSet";
45
+ import * as AugustScepter from "./2023/AugustScepter";
46
+ import * as BurningLeaves from "./2023/BurningLeaves";
47
+ import * as CinchoDeMayo from "./2023/CinchoDeMayo";
48
+ import * as ClosedCircuitPayphone from "./2023/ClosedCircuitPayphone";
49
+ import * as CursedMonkeyPaw from "./2023/CursedMonkeyPaw";
50
+ import * as AprilingBandHelmet from "./2024/AprilingBandHelmet";
51
+ import * as ChestMimic from "./2024/ChestMimic";
52
+ export { AprilingBandHelmet, AugustScepter, AutumnAton, AsdonMartin, Bandersnatch, BarrelShrine, BeachComb, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, DaylightShavings, DeckOfEveryCard, Dinseylandfill, DNALab, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LookingGlass, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, RainDoh, ReagnimatedGnome, RetroCape, Robortender, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StompingBoots, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
53
+ export * from "./putty-likes";
54
+ export * from "./LibramSummon";
@@ -0,0 +1,54 @@
1
+ import * as Stickers from "./2008/Stickers";
2
+ import * as Bandersnatch from "./2009/Bandersnatch";
3
+ import * as SpookyPutty from "./2009/SpookyPutty";
4
+ import * as CrownOfThrones from "./2010/CrownOfThrones";
5
+ import * as LookingGlass from "./2010/LookingGlass";
6
+ import * as ObtuseAngel from "./2011/ObtuseAngel";
7
+ import * as StompingBoots from "./2011/StompingBoots";
8
+ import * as RainDoh from "./2012/RainDoh";
9
+ import * as ReagnimatedGnome from "./2012/ReagnimatedGnome";
10
+ import * as FloristFriar from "./2013/Florist";
11
+ import * as JungMan from "./2013/JungMan";
12
+ import * as CrimboShrub from "./2014/CrimboShrub";
13
+ import * as DNALab from "./2014/DNALab";
14
+ import * as WinterGarden from "./2014/WinterGarden";
15
+ import * as BarrelShrine from "./2015/BarrelShrine";
16
+ import * as ChateauMantegna from "./2015/ChateauMantegna";
17
+ import * as DeckOfEveryCard from "./2015/DeckOfEveryCard";
18
+ import * as Dinseylandfill from "./2015/Dinseylandfill";
19
+ import * as MayoClinic from "./2015/MayoClinic";
20
+ import * as GingerBread from "./2016/GingerBread";
21
+ import * as SourceTerminal from "./2016/SourceTerminal";
22
+ import * as Witchess from "./2016/Witchess";
23
+ import * as AsdonMartin from "./2017/AsdonMartin";
24
+ import * as Horsery from "./2017/Horsery";
25
+ import * as MummingTrunk from "./2017/MummingTrunk";
26
+ import * as Pantogram from "./2017/Pantogram";
27
+ import * as Robortender from "./2017/Robortender";
28
+ import * as Spacegate from "./2017/Spacegate";
29
+ import * as TunnelOfLove from "./2017/TunnelOfLove";
30
+ import * as Latte from "./2018/LatteLoversMembersMug";
31
+ import * as SongBoom from "./2018/SongBoom";
32
+ import * as BeachComb from "./2019/BeachComb";
33
+ import * as CampAway from "./2019/CampAway";
34
+ import * as Snapper from "./2019/Snapper";
35
+ import * as Cartography from "./2020/Cartography";
36
+ import * as Guzzlr from "./2020/Guzzlr";
37
+ import * as RetroCape from "./2020/RetroCape";
38
+ import * as CrystalBall from "./2021/CrystalBall";
39
+ import * as DaylightShavings from "./2021/DaylightShavings";
40
+ import * as AutumnAton from "./2022/AutumnAton";
41
+ import * as CombatLoversLocket from "./2022/CombatLoversLocket";
42
+ import * as GreyGoose from "./2022/GreyGoose";
43
+ import * as JuneCleaver from "./2022/JuneCleaver";
44
+ import * as TrainSet from "./2022/TrainSet";
45
+ import * as AugustScepter from "./2023/AugustScepter";
46
+ import * as BurningLeaves from "./2023/BurningLeaves";
47
+ import * as CinchoDeMayo from "./2023/CinchoDeMayo";
48
+ import * as ClosedCircuitPayphone from "./2023/ClosedCircuitPayphone";
49
+ import * as CursedMonkeyPaw from "./2023/CursedMonkeyPaw";
50
+ import * as AprilingBandHelmet from "./2024/AprilingBandHelmet";
51
+ import * as ChestMimic from "./2024/ChestMimic";
52
+ export { AprilingBandHelmet, AugustScepter, AutumnAton, AsdonMartin, Bandersnatch, BarrelShrine, BeachComb, BurningLeaves, CampAway, Cartography, ChateauMantegna, ChestMimic, CinchoDeMayo, ClosedCircuitPayphone, CombatLoversLocket, CrimboShrub, CrownOfThrones, CrystalBall, CursedMonkeyPaw, DaylightShavings, DeckOfEveryCard, Dinseylandfill, DNALab, FloristFriar, GingerBread, GreyGoose, Guzzlr, Horsery, JuneCleaver, JungMan, Latte, LookingGlass, MayoClinic, MummingTrunk, ObtuseAngel, Pantogram, RainDoh, ReagnimatedGnome, RetroCape, Robortender, Snapper, SongBoom, SourceTerminal, Spacegate, SpookyPutty, Stickers, StompingBoots, TrainSet, TunnelOfLove, WinterGarden, Witchess, };
53
+ export * from "./putty-likes";
54
+ export * from "./LibramSummon";
@@ -0,0 +1,21 @@
1
+ import { Copier } from "../Copier";
2
+ /**
3
+ * Get total putty-like copies made
4
+ *
5
+ * @returns Total copies made
6
+ */
7
+ export declare function getTotalPuttyLikeCopiesMade(): number;
8
+ /**
9
+ * Determine if Rain-Doh black box can be used
10
+ *
11
+ * @returns Whether it can be used
12
+ */
13
+ export declare function couldUseRainDohBlackBox(): boolean;
14
+ export declare const RainDohBlackBox: Copier;
15
+ /**
16
+ * Determines whether you can still use a spooky putty sheet
17
+ *
18
+ * @returns Whether you can still use a spooky putty sheet
19
+ */
20
+ export declare function couldUseSpookyPuttySheet(): boolean;
21
+ export declare const SpookyPuttySheet: Copier;
@@ -0,0 +1,33 @@
1
+ import { Copier } from "../Copier";
2
+ import { getSpookyPuttySheetCopiesMade, getSpookyPuttySheetMonster, have as haveSpookyPutty, prepareSpookyPuttySheet, useSpookyPuttySheet, } from "./2009/SpookyPutty";
3
+ import { getRainDohBlackBoxCopiesMade, getRainDohBlackBoxMonster, have as haveRainDoh, useRainDohBlackBox, } from "./2012/RainDoh";
4
+ /**
5
+ * Get total putty-like copies made
6
+ *
7
+ * @returns Total copies made
8
+ */
9
+ export function getTotalPuttyLikeCopiesMade() {
10
+ return getSpookyPuttySheetCopiesMade() + getRainDohBlackBoxCopiesMade();
11
+ }
12
+ /**
13
+ * Determine if Rain-Doh black box can be used
14
+ *
15
+ * @returns Whether it can be used
16
+ */
17
+ export function couldUseRainDohBlackBox() {
18
+ return (haveRainDoh() &&
19
+ getRainDohBlackBoxCopiesMade() < 5 &&
20
+ getTotalPuttyLikeCopiesMade() < 6);
21
+ }
22
+ export const RainDohBlackBox = new Copier(() => couldUseRainDohBlackBox(), null, () => couldUseRainDohBlackBox(), () => getRainDohBlackBoxMonster(), () => useRainDohBlackBox());
23
+ /**
24
+ * Determines whether you can still use a spooky putty sheet
25
+ *
26
+ * @returns Whether you can still use a spooky putty sheet
27
+ */
28
+ export function couldUseSpookyPuttySheet() {
29
+ return (haveSpookyPutty() &&
30
+ getSpookyPuttySheetCopiesMade() < 5 &&
31
+ getTotalPuttyLikeCopiesMade() < 6);
32
+ }
33
+ export const SpookyPuttySheet = new Copier(() => couldUseSpookyPuttySheet(), () => prepareSpookyPuttySheet(), () => couldUseSpookyPuttySheet(), () => getSpookyPuttySheetMonster(), () => useSpookyPuttySheet());
@@ -0,0 +1,169 @@
1
+ import { Item } from "kolmafia";
2
+ /**
3
+ * An entry showing the value of each Item in a session
4
+ *
5
+ * @member item the item associated with this detail
6
+ * @member value the numeric value of the full quantity of items (to get value of each item, do value / quantity) (can be negative)
7
+ * @member quantity the number of items for this detail
8
+ */
9
+ export interface ItemDetail {
10
+ item: Item;
11
+ value: number;
12
+ quantity: number;
13
+ }
14
+ /**
15
+ * The full value (in meat) results of a session
16
+ *
17
+ * @member meat the value of this session in pure meat
18
+ * @member items the value of the items in this session in meat
19
+ * @member total sum of meat and items
20
+ * @member itemDetails a list of the detailed accounting for each item in this session
21
+ * @member turns the number of turns associated with this session
22
+ */
23
+ export interface ItemResult {
24
+ meat: number;
25
+ items: number;
26
+ total: number;
27
+ itemDetails: ItemDetail[];
28
+ turns: number;
29
+ }
30
+ export interface MeatPerAdventureAnalysis {
31
+ mpa: {
32
+ effective: number;
33
+ meat: number;
34
+ items: number;
35
+ total: number;
36
+ };
37
+ values: {
38
+ effective: number;
39
+ meat: number;
40
+ items: number;
41
+ total: number;
42
+ };
43
+ outlierItems: ItemDetail[];
44
+ turns: number;
45
+ }
46
+ /**
47
+ * A wrapper around tracking items and meat gained from this session
48
+ * Smartly handles foldables being added/removed based on their state
49
+ * Provides operations to add sessions and subtract Sessions so you can isolate the value of each Session using a baseline
50
+ *
51
+ * @member meat the raw meat associated with this Session
52
+ * @member items a map representing the items gained/lost during this Session
53
+ */
54
+ export declare class Session {
55
+ meat: number;
56
+ items: Map<Item, number>;
57
+ totalTurns: number;
58
+ /**
59
+ * Construct a new session
60
+ *
61
+ * @param meat the amount of meat associated with this session
62
+ * @param items the items associated with this session
63
+ * @param totalTurns the number of turns associated with this session
64
+ */
65
+ private constructor();
66
+ /**
67
+ * Register session results that do not get tracked natively
68
+ *
69
+ * @param target either the Item or a string saying "meat" of what quantity to modify
70
+ * @param quantity How much to modify the tracked amount by
71
+ */
72
+ register(target: Item | "meat", quantity: number): void;
73
+ /**
74
+ * Value this session
75
+ *
76
+ * @param itemValue a function that, when given an item, will give a meat value of the item
77
+ * @returns ItemResult with the full value of this session given the input function
78
+ */
79
+ value(itemValue: (item: Item) => number): ItemResult;
80
+ /**
81
+ * Subtract the contents of another session from this one, removing any items that have a resulting quantity of 0
82
+ * (this will ignore elements in b but not in a)
83
+ *
84
+ * @param other the session from which to pull values to remove from this session
85
+ * @returns a new session representing the difference between this session and the other session
86
+ */
87
+ diff(other: Session): Session;
88
+ /**
89
+ * Subtract the contents of snasphot b from session a, removing any items that have a resulting quantity of 0
90
+ * (this will ignore elements in b but not in a)
91
+ *
92
+ * @param a the session from which to subtract elements
93
+ * @param b the session from which to add elements
94
+ * @returns a new session representing the difference between a and b
95
+ */
96
+ static diff(a: Session, b: Session): Session;
97
+ /**
98
+ * Generate a new session combining multiple sessions together
99
+ *
100
+ * @param other the session from which to add elements to this set
101
+ * @returns a new session representing the addition of other to this
102
+ */
103
+ add(other: Session): Session;
104
+ /**
105
+ * Combine the contents of sessions
106
+ *
107
+ * @param sessions the set of sessions to combine together
108
+ * @returns a new session representing the difference between a and b
109
+ */
110
+ static add(...sessions: Session[]): Session;
111
+ static getFilepath(filename: string): string;
112
+ /**
113
+ * Export this session to a file in the data/ directory. Conventionally this file should end in ".json"
114
+ *
115
+ * @param filename The file into which to export
116
+ */
117
+ toFile(filename: string): void;
118
+ /**
119
+ * Import a session from a file in the data/ directory. Conventionally the file should end in ".json"
120
+ *
121
+ * @param filename The file from which to import
122
+ * @returns the session represented by the file
123
+ */
124
+ static fromFile(filename: string): Session;
125
+ /**
126
+ * Return the meat and items for the current session
127
+ *
128
+ * @param sessionOnly should closet, DC, and storage be ignored for the session calculation
129
+ * @returns current session
130
+ */
131
+ static current(sessionOnly?: boolean): Session;
132
+ /**
133
+ * @param baseline the base session to use when computing MPA
134
+ * @param full the full session to use when computing MPA
135
+ * @param options options for computing MPA
136
+ * @param options.value a function to compute the meat value of a given item
137
+ * @param options.isOutlier a function to compute if an item is considered an outlier. By default, no items are outliers
138
+ * @param options.excludeValue meat values to exclude when calculating specific portions of the MPA
139
+ * @param options.excludeValue.meat how much meat to exclude when calculating the meat portion of MPA
140
+ * @param options.excludeValue.item how much meat to exclude when calculating hte item portion of MPA
141
+ * @returns an analysis of the effective MPA for the given session
142
+ */
143
+ static computeMPA(baseline: Session, full: Session, options: {
144
+ value: (item: Item) => number;
145
+ isOutlier?: (item: ItemDetail) => boolean;
146
+ excludeValue?: {
147
+ meat?: number;
148
+ item?: number;
149
+ };
150
+ }): MeatPerAdventureAnalysis;
151
+ /**
152
+ * @param other the session to diff against this session when computing MPA
153
+ * @param options options for computing MPA
154
+ * @param options.value a function to compute the meat value of a given item
155
+ * @param options.isOutlier a function to compute if an item is considered an outlier. By default, no items are outliers
156
+ * @param options.excludeValue meat values to exclude when calculating specific portions of the MPA
157
+ * @param options.excludeValue.meat how much meat to exclude when calculating the meat portion of MPA
158
+ * @param options.excludeValue.item how much meat to exclude when calculating hte item portion of MPA
159
+ * @returns an analysis of the effective MPA for the given session
160
+ */
161
+ computeMPA(other: Session, options: {
162
+ value: (item: Item) => number;
163
+ isOutlier?: (item: ItemDetail) => boolean;
164
+ excludeValue?: {
165
+ meat?: number;
166
+ item?: number;
167
+ };
168
+ }): MeatPerAdventureAnalysis;
169
+ }