libram 0.3.2 → 0.4.2

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 (99) hide show
  1. package/dist/Clan.js +268 -485
  2. package/dist/Copier.js +11 -48
  3. package/dist/Dungeon.js +77 -157
  4. package/dist/Kmail.d.ts +13 -7
  5. package/dist/Kmail.js +92 -233
  6. package/dist/Path.js +68 -120
  7. package/dist/ascend.js +153 -172
  8. package/dist/combat.d.ts +86 -1
  9. package/dist/combat.js +295 -387
  10. package/dist/console.js +13 -36
  11. package/dist/diet/index.d.ts +31 -0
  12. package/dist/diet/index.js +333 -0
  13. package/dist/diet/knapsack.d.ts +7 -0
  14. package/dist/diet/knapsack.js +106 -0
  15. package/dist/dungeons/Dreadsylvania.d.ts +4 -0
  16. package/dist/dungeons/Dreadsylvania.js +14 -0
  17. package/dist/dungeons/Dungeon.d.ts +28 -0
  18. package/dist/dungeons/Dungeon.js +99 -0
  19. package/dist/dungeons/Hobopolis.d.ts +4 -0
  20. package/dist/dungeons/Hobopolis.js +14 -0
  21. package/dist/dungeons/SlimeTube.d.ts +4 -0
  22. package/dist/dungeons/SlimeTube.js +14 -0
  23. package/dist/freerun.d.ts +23 -0
  24. package/dist/freerun.js +92 -0
  25. package/dist/index.d.ts +6 -1
  26. package/dist/index.js +21 -263
  27. package/dist/lib.d.ts +43 -0
  28. package/dist/lib.js +296 -405
  29. package/dist/logger.js +23 -63
  30. package/dist/maximize.d.ts +29 -12
  31. package/dist/maximize.js +318 -421
  32. package/dist/modifier.d.ts +13 -0
  33. package/dist/modifier.js +35 -0
  34. package/dist/modifierTypes.d.ts +16 -0
  35. package/dist/modifierTypes.js +9 -0
  36. package/dist/mood.js +220 -531
  37. package/dist/property.d.ts +2 -0
  38. package/dist/property.js +96 -242
  39. package/dist/propertyTypes.d.ts +9 -0
  40. package/dist/propertyTypes.js +1 -0
  41. package/dist/propertyTyping.d.ts +2 -9
  42. package/dist/propertyTyping.js +42 -53
  43. package/dist/resources/2007/CandyHearts.d.ts +9 -0
  44. package/dist/resources/2007/CandyHearts.js +24 -0
  45. package/dist/resources/2008/DivineFavors.d.ts +9 -0
  46. package/dist/resources/2008/DivineFavors.js +27 -0
  47. package/dist/resources/2009/Bandersnatch.js +37 -112
  48. package/dist/resources/2009/LoveSongs.d.ts +9 -0
  49. package/dist/resources/2009/LoveSongs.js +24 -0
  50. package/dist/resources/2009/SpookyPutty.js +20 -46
  51. package/dist/resources/2010/Brickos.d.ts +9 -0
  52. package/dist/resources/2010/Brickos.js +21 -0
  53. package/dist/resources/2010/CrownOfThrones.d.ts +18 -0
  54. package/dist/resources/2010/CrownOfThrones.js +550 -0
  55. package/dist/resources/2011/Gygaxian.d.ts +9 -0
  56. package/dist/resources/2011/Gygaxian.js +24 -0
  57. package/dist/resources/2011/ObtuseAngel.js +21 -63
  58. package/dist/resources/2012/RainDoh.js +14 -40
  59. package/dist/resources/2012/Resolutions.d.ts +9 -0
  60. package/dist/resources/2012/Resolutions.js +28 -0
  61. package/dist/resources/2013/Florist.d.ts +61 -0
  62. package/dist/resources/2013/Florist.js +149 -0
  63. package/dist/resources/2013/PulledTaffy.d.ts +9 -0
  64. package/dist/resources/2013/PulledTaffy.js +33 -0
  65. package/dist/resources/2014/WinterGarden.js +15 -43
  66. package/dist/resources/2015/ChateauMantegna.js +52 -86
  67. package/dist/resources/2015/MayoClinic.d.ts +13 -0
  68. package/dist/resources/2015/MayoClinic.js +36 -0
  69. package/dist/resources/2016/SourceTerminal.d.ts +1 -0
  70. package/dist/resources/2016/SourceTerminal.js +114 -237
  71. package/dist/resources/2016/Witchess.js +33 -59
  72. package/dist/resources/2017/TunnelOfLove.js +62 -111
  73. package/dist/resources/2018/SongBoom.js +32 -68
  74. package/dist/resources/2019/BeachComb.d.ts +2 -0
  75. package/dist/resources/2019/BeachComb.js +26 -0
  76. package/dist/resources/2019/Snapper.d.ts +28 -0
  77. package/dist/resources/2019/Snapper.js +70 -0
  78. package/dist/resources/2020/Guzzlr.js +79 -163
  79. package/dist/resources/LibramSummon.d.ts +12 -0
  80. package/dist/resources/LibramSummon.js +66 -0
  81. package/dist/resources/index.d.ts +18 -11
  82. package/dist/resources/index.js +19 -85
  83. package/dist/resources/putty-likes.js +15 -30
  84. package/dist/ring-buffer.d.ts +24 -0
  85. package/dist/ring-buffer.js +135 -0
  86. package/dist/since.d.ts +1 -0
  87. package/dist/since.js +56 -112
  88. package/dist/template-string.js +40 -132
  89. package/dist/utils.d.ts +14 -0
  90. package/dist/utils.js +50 -114
  91. package/package.json +5 -3
  92. package/dist/libram-example-briefcase.js +0 -16073
  93. package/dist/libram-example-clan.js +0 -8898
  94. package/dist/libram-example-consult.js +0 -6179
  95. package/dist/libram-example-item.js +0 -3248
  96. package/dist/libram-example-kmail.js +0 -2065
  97. package/dist/libram-example-lib.js +0 -7608
  98. package/dist/libram-example-props.js +0 -4770
  99. package/dist/libram-example-resources.js +0 -12226
@@ -1,50 +1,24 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.array.slice.js");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.have = have;
9
- exports.getSpookyPuttySheetCopiesMade = getSpookyPuttySheetCopiesMade;
10
- exports.prepareSpookyPuttySheet = prepareSpookyPuttySheet;
11
- exports.getSpookyPuttySheetMonster = getSpookyPuttySheetMonster;
12
- exports.useSpookyPuttySheet = useSpookyPuttySheet;
13
- exports.sheet = void 0;
14
-
15
- var _kolmafia = require("kolmafia");
16
-
17
- var _lib = require("../../lib");
18
-
19
- var _property = require("../../property");
20
-
21
- var _templateString = require("../../template-string");
22
-
23
- var _templateObject;
24
-
25
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
26
-
27
- var sheet = (0, _templateString.$item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["Spooky Putty sheet"])));
28
- exports.sheet = sheet;
29
-
30
- function have() {
31
- return (0, _lib.getFoldGroup)(sheet).some(item => (0, _lib.have)(item));
1
+ import { cliExecute, use } from "kolmafia";
2
+ import { getFoldGroup, have as haveItem } from "../../lib";
3
+ import { get } from "../../property";
4
+ import { $item } from "../../template-string";
5
+ export const sheet = $item `Spooky Putty sheet`;
6
+ export function have() {
7
+ return getFoldGroup(sheet).some((item) => haveItem(item));
32
8
  }
33
-
34
- function getSpookyPuttySheetCopiesMade() {
35
- return Math.max(0, (0, _property.get)("spookyPuttyCopiesMade"));
9
+ export function getSpookyPuttySheetCopiesMade() {
10
+ return Math.max(0, get("spookyPuttyCopiesMade"));
36
11
  }
37
-
38
- function prepareSpookyPuttySheet() {
39
- if (!have()) return false;
40
- if ((0, _lib.have)(sheet)) return true;
41
- return (0, _kolmafia.cliExecute)("fold Spooky putty sheet");
12
+ export function prepareSpookyPuttySheet() {
13
+ if (!have())
14
+ return false;
15
+ if (haveItem(sheet))
16
+ return true;
17
+ return cliExecute("fold Spooky putty sheet");
42
18
  }
43
-
44
- function getSpookyPuttySheetMonster() {
45
- return (0, _property.get)("spookyPuttyMonster");
19
+ export function getSpookyPuttySheetMonster() {
20
+ return get("spookyPuttyMonster");
21
+ }
22
+ export function useSpookyPuttySheet() {
23
+ return use(sheet);
46
24
  }
47
-
48
- function useSpookyPuttySheet() {
49
- return (0, _kolmafia.use)(sheet);
50
- }
@@ -0,0 +1,9 @@
1
+ export declare const summonSkill: Skill;
2
+ /**
3
+ * @returns true if the player can Summon BRICKOs
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,21 @@
1
+ import { get } from "../../property";
2
+ import { $item, $skill } from "../../template-string";
3
+ import { have as _have } from "../../lib";
4
+ export const summonSkill = $skill `Summon BRICKOs`;
5
+ /**
6
+ * @returns true if the player can Summon BRICKOs
7
+ */
8
+ export function have() {
9
+ return _have(summonSkill);
10
+ }
11
+ /**
12
+ * @returns map containing the chance of an item to be summoned
13
+ */
14
+ export function expected() {
15
+ const eyeSummons = get("_brickoEyeSummons");
16
+ const eyeChance = eyeSummons === 3 ? 0.0 : eyeSummons === 0 ? 0.5 : 1.0 / 3.0;
17
+ return new Map([
18
+ [$item `BRICKO eye brick`, eyeChance],
19
+ [$item `BRICKO brick`, 3.0 - eyeChance],
20
+ ]);
21
+ }
@@ -0,0 +1,18 @@
1
+ import { Modifiers } from "../../modifier";
2
+ export declare type FamiliarRider = {
3
+ familiar: Familiar;
4
+ meatVal: () => number;
5
+ probability: number;
6
+ modifier: Modifiers;
7
+ dropPredicate?: () => boolean;
8
+ };
9
+ export declare const ridingFamiliars: FamiliarRider[];
10
+ export declare function valueRider(rider: FamiliarRider, modifierValueFunction: (modifiers: Modifiers) => number, useLimitedDrops?: boolean): number;
11
+ declare type RiderMode = {
12
+ modifierValueFunction: (modifiers: Modifiers) => number;
13
+ useLimitedDrops: boolean;
14
+ excludeCurrentFamiliar: boolean;
15
+ };
16
+ export declare function createRiderMode(name: string, modifierValueFunction: (modifiers: Modifiers) => number, useLimitedDrops?: boolean, excludeCurrentFamiliar?: boolean): Map<string, RiderMode>;
17
+ export declare function pickRider(mode: string): FamiliarRider | null;
18
+ export {};
@@ -0,0 +1,550 @@
1
+ import { myFamiliar } from "kolmafia";
2
+ import { getSaleValue, have } from "../../lib";
3
+ import { get } from "../../property";
4
+ import { $familiar, $item, $items } from "../../template-string";
5
+ export const ridingFamiliars = [
6
+ {
7
+ familiar: $familiar `Puck Man`,
8
+ meatVal: () => getSaleValue($item `yellow pixel`),
9
+ probability: 0.25,
10
+ modifier: {
11
+ ["Muscle"]: 10,
12
+ ["Mysticality"]: 10,
13
+ ["Moxie"]: 10,
14
+ },
15
+ dropPredicate: () => get("_yellowPixelDropsCrown") < 25,
16
+ },
17
+ {
18
+ familiar: $familiar `Ms. Puck Man`,
19
+ meatVal: () => getSaleValue($item `yellow pixel`),
20
+ probability: 0.25,
21
+ modifier: {
22
+ ["Muscle"]: 10,
23
+ ["Mysticality"]: 10,
24
+ ["Moxie"]: 10,
25
+ },
26
+ dropPredicate: () => get("_yellowPixelDropsCrown") < 25,
27
+ },
28
+ {
29
+ familiar: $familiar `Grimstone Golem`,
30
+ meatVal: () => getSaleValue($item `grimstone mask`),
31
+ probability: 0.5,
32
+ modifier: {
33
+ ["Combat Rate"]: -5,
34
+ },
35
+ dropPredicate: () => get("_grimstoneMaskDropsCrown") < 1,
36
+ },
37
+ {
38
+ familiar: $familiar `Knob Goblin Organ Grinder`,
39
+ meatVal: () => 30,
40
+ probability: 1,
41
+ modifier: {
42
+ ["Meat Drop"]: 25,
43
+ },
44
+ },
45
+ {
46
+ familiar: $familiar `Happy Medium`,
47
+ meatVal: () => 30,
48
+ probability: 1,
49
+ modifier: {
50
+ ["Meat Drop"]: 25,
51
+ },
52
+ },
53
+ {
54
+ familiar: $familiar `Garbage Fire`,
55
+ meatVal: () => getSaleValue($item `burning newspaper`),
56
+ probability: 0.5,
57
+ modifier: {
58
+ ["Hot Spell Damage"]: 25,
59
+ },
60
+ dropPredicate: () => get("_garbageFireDropsCrown") < 3,
61
+ },
62
+ {
63
+ familiar: $familiar `Machine Elf`,
64
+ meatVal: () => getSaleValue(...$items `abstraction: sensation, abstraction: thought, abstraction: action, abstraction: category, abstraction: perception, abstraction: purpose`),
65
+ probability: 0.2,
66
+ modifier: {
67
+ ["Muscle"]: 7,
68
+ ["Mysticality"]: 7,
69
+ ["Moxie"]: 7,
70
+ },
71
+ dropPredicate: () => get("_abstractionDropsCrown") < 25,
72
+ },
73
+ {
74
+ familiar: $familiar `Trick-or-Treating Tot`,
75
+ meatVal: () => getSaleValue($item `hoarded candy wad`),
76
+ probability: 0.5,
77
+ modifier: {
78
+ ["Muscle"]: 10,
79
+ ["Mysticality"]: 10,
80
+ ["Moxie"]: 10,
81
+ },
82
+ dropPredicate: () => get("_hoardedCandyDropsCrown") < 3,
83
+ },
84
+ {
85
+ familiar: $familiar `Warbear Drone`,
86
+ meatVal: () => getSaleValue($item `warbear whosit`),
87
+ probability: 1 / 4.5,
88
+ modifier: {
89
+ ["Maximum HP"]: 15,
90
+ ["Maximum MP"]: 15,
91
+ },
92
+ },
93
+ {
94
+ familiar: $familiar `Li'l Xenomorph`,
95
+ meatVal: () => getSaleValue($item `lunar isotope`),
96
+ probability: 0.05,
97
+ modifier: {
98
+ ["Item Drop"]: 15,
99
+ },
100
+ },
101
+ {
102
+ familiar: $familiar `Pottery Barn Owl`,
103
+ meatVal: () => getSaleValue($item `volcanic ash`),
104
+ probability: 0.1,
105
+ modifier: { ["Hot Damage"]: 10 },
106
+ },
107
+ {
108
+ familiar: $familiar `Grim Brother`,
109
+ meatVal: () => getSaleValue($item `grim fairy tale`),
110
+ probability: 1,
111
+ modifier: { ["Combat Rate"]: 5 },
112
+ dropPredicate: () => get("_grimFairyTaleDropsCrown") < 2,
113
+ },
114
+ {
115
+ familiar: $familiar `Optimistic Candle`,
116
+ meatVal: () => getSaleValue($item `glob of melted wax`),
117
+ probability: 1,
118
+ dropPredicate: () => get("_optimisticCandleDropsCrown") < 3,
119
+ modifier: {
120
+ ["Item Drop"]: 15,
121
+ },
122
+ },
123
+ {
124
+ familiar: $familiar `Adventurous Spelunker`,
125
+ meatVal: () => getSaleValue(...$items `teflon ore, velcro ore, vinyl ore, cardboard ore, styrofoam ore, bubblewrap ore`),
126
+ probability: 1,
127
+ dropPredicate: () => get("_oreDropsCrown") < 6,
128
+ modifier: {
129
+ ["Item Drop"]: 15,
130
+ },
131
+ },
132
+ {
133
+ familiar: $familiar `Twitching Space Critter`,
134
+ meatVal: () => getSaleValue($item `space beast fur`),
135
+ probability: 1,
136
+ modifier: {
137
+ ["Hot Resistance"]: 2,
138
+ ["Cold Resistance"]: 2,
139
+ ["Spooky Resistance"]: 2,
140
+ ["Sleaze Resistance"]: 2,
141
+ ["Stench Resistance"]: 2,
142
+ },
143
+ dropPredicate: () => get("_spaceFurDropsCrown") < 1,
144
+ },
145
+ {
146
+ familiar: $familiar `Party Mouse`,
147
+ meatVal: () => 50,
148
+ /*
149
+ The below code is more accurate. However, party mouse is virtually never going to be worthwhile and this causes so many useless mall hits it isn't funny.
150
+
151
+ getSaleValue(
152
+ ...Item.all().filter(
153
+ (booze) =>
154
+ ["decent", "good"].includes(booze.quality) &&
155
+ booze.inebriety > 0 &&
156
+ booze.tradeable &&
157
+ booze.discardable &&
158
+ !$items`glass of "milk", cup of "tea", thermos of "whiskey", Lucky Lindy, Bee's Knees, Sockdollager, Ish Kabibble, Hot Socks, Phonus Balonus, Flivver, Sloppy Jalopy`.includes(
159
+ booze
160
+ )
161
+ )
162
+ ),
163
+ */
164
+ probability: 0.05,
165
+ modifier: {
166
+ ["Booze Drop"]: 25,
167
+ },
168
+ },
169
+ {
170
+ familiar: $familiar `Yule Hound`,
171
+ meatVal: () => getSaleValue($item `candy cane`),
172
+ probability: 1,
173
+ modifier: { ["Candy Drop"]: 20 },
174
+ },
175
+ {
176
+ familiar: $familiar `Gluttonous Green Ghost`,
177
+ meatVal: () => getSaleValue(...$items `bean burrito, enchanted bean burrito, jumping bean burrito`),
178
+ probability: 1,
179
+ modifier: { ["Food Drop"]: 15 },
180
+ },
181
+ {
182
+ familiar: $familiar `Reassembled Blackbird`,
183
+ meatVal: () => getSaleValue($item `blackberry`),
184
+ probability: 1,
185
+ modifier: {
186
+ ["Item Drop"]: 10,
187
+ },
188
+ },
189
+ {
190
+ familiar: $familiar `Reconstituted Crow`,
191
+ meatVal: () => getSaleValue($item `blackberry`),
192
+ probability: 1,
193
+ modifier: {
194
+ ["Item Drop"]: 10,
195
+ },
196
+ },
197
+ {
198
+ familiar: $familiar `Hunchbacked Minion`,
199
+ meatVal: () => 0.02 * getSaleValue($item `disembodied brain`) +
200
+ 0.98 * getSaleValue($item `skeleton bone`),
201
+ probability: 1,
202
+ modifier: { ["Muscle Experience"]: 2 },
203
+ },
204
+ {
205
+ familiar: $familiar `Reanimated Reanimator`,
206
+ meatVal: () => getSaleValue(...$items `hot wing, broken skull`),
207
+ probability: 1,
208
+ modifier: { ["Mysticality Experience"]: 2 },
209
+ },
210
+ {
211
+ familiar: $familiar `Attention-Deficit Demon`,
212
+ meatVal: () => getSaleValue(...$items `chorizo brownies, white chocolate and tomato pizza, carob chunk noodles`),
213
+ probability: 1,
214
+ modifier: {
215
+ ["Meat Drop"]: 20,
216
+ },
217
+ },
218
+ {
219
+ familiar: $familiar `Piano Cat`,
220
+ meatVal: () => getSaleValue(...$items `beertini, papaya slung, salty slug, tomato daiquiri`),
221
+ probability: 1,
222
+ modifier: {
223
+ ["Meat Drop"]: 20,
224
+ },
225
+ },
226
+ {
227
+ familiar: $familiar `Golden Monkey`,
228
+ meatVal: () => getSaleValue($item `gold nuggets`),
229
+ probability: 0.5,
230
+ modifier: {
231
+ ["Meat Drop"]: 25,
232
+ },
233
+ },
234
+ {
235
+ familiar: $familiar `Robot Reindeer`,
236
+ meatVal: () => getSaleValue(...$items `candy cane, eggnog, fruitcake, gingerbread bugbear`),
237
+ probability: 0.3,
238
+ modifier: {
239
+ ["Muscle"]: 10,
240
+ ["Mysticality"]: 10,
241
+ ["Moxie"]: 10,
242
+ },
243
+ },
244
+ {
245
+ familiar: $familiar `Stocking Mimic`,
246
+ meatVal: () => getSaleValue(...$items `Angry Farmer candy, Cold Hots candy, Rock Pops, Tasty Fun Good rice candy, Wint-O-Fresh mint`),
247
+ probability: 0.3,
248
+ modifier: {
249
+ ["Muscle"]: 10,
250
+ ["Mysticality"]: 10,
251
+ ["Moxie"]: 10,
252
+ },
253
+ },
254
+ {
255
+ familiar: $familiar `BRICKO chick`,
256
+ meatVal: () => getSaleValue($item `BRICKO brick`),
257
+ probability: 1,
258
+ modifier: {
259
+ ["Muscle Percent"]: 10,
260
+ ["Mysticality Percent"]: 10,
261
+ ["Moxie Percent"]: 10,
262
+ },
263
+ },
264
+ {
265
+ familiar: $familiar `Cotton Candy Carnie`,
266
+ meatVal: () => getSaleValue($item `cotton candy pinch`),
267
+ probability: 1,
268
+ modifier: { ["Initiative"]: 20 },
269
+ },
270
+ {
271
+ familiar: $familiar `Untamed Turtle`,
272
+ meatVal: () => getSaleValue(...$items `snailmail bits, turtlemail bits, turtle wax`),
273
+ probability: 0.35,
274
+ modifier: { ["Initiative"]: 20 },
275
+ },
276
+ {
277
+ familiar: $familiar `Astral Badger`,
278
+ meatVal: () => 2 *
279
+ getSaleValue(...$items `spooky mushroom, Knob mushroom, Knoll mushroom`),
280
+ probability: 1,
281
+ modifier: { ["Maximum HP"]: 10, ["Maximum MP"]: 10 },
282
+ },
283
+ {
284
+ familiar: $familiar `Green Pixie`,
285
+ meatVal: () => getSaleValue($item `bottle of tequila`),
286
+ probability: 0.2,
287
+ modifier: { ["Maximum HP"]: 10, ["Maximum MP"]: 10 },
288
+ },
289
+ {
290
+ familiar: $familiar `Angry Goat`,
291
+ meatVal: () => getSaleValue($item `goat cheese pizza`),
292
+ probability: 1,
293
+ modifier: { ["Muscle Percent"]: 15 },
294
+ },
295
+ {
296
+ familiar: $familiar `Adorable Seal Larva`,
297
+ meatVal: () => getSaleValue(...$items `stench nuggets, spooky nuggets, hot nuggets, cold nuggets, sleaze nuggets`),
298
+ probability: 0.35,
299
+ modifier: {
300
+ ["HP Regen Min"]: 2,
301
+ ["MP Regen Min"]: 2,
302
+ ["HP Regen Max"]: 8,
303
+ ["MP Regen Max"]: 8,
304
+ },
305
+ },
306
+ {
307
+ familiar: $familiar `Ancient Yuletide Troll`,
308
+ meatVal: () => getSaleValue(...$items `candy cane, eggnog, fruitcake, gingerbread bugbear`),
309
+ probability: 0.3,
310
+ modifier: {
311
+ ["HP Regen Min"]: 2,
312
+ ["MP Regen Min"]: 2,
313
+ ["HP Regen Max"]: 8,
314
+ ["MP Regen Max"]: 8,
315
+ },
316
+ },
317
+ {
318
+ familiar: $familiar `Sweet Nutcracker`,
319
+ meatVal: () => getSaleValue(...$items `candy cane, eggnog, fruitcake, gingerbread bugbear`),
320
+ probability: 0.3,
321
+ modifier: {
322
+ ["HP Regen Min"]: 2,
323
+ ["MP Regen Min"]: 2,
324
+ ["HP Regen Max"]: 8,
325
+ ["MP Regen Max"]: 8,
326
+ },
327
+ },
328
+ {
329
+ familiar: $familiar `Casagnova Gnome`,
330
+ meatVal: () => 0,
331
+ probability: 0,
332
+ modifier: {
333
+ ["Meat Drop"]: 20,
334
+ },
335
+ },
336
+ {
337
+ familiar: $familiar `Coffee Pixie`,
338
+ meatVal: () => 0,
339
+ probability: 0,
340
+ modifier: {
341
+ ["Meat Drop"]: 20,
342
+ },
343
+ },
344
+ {
345
+ familiar: $familiar `Dancing Frog`,
346
+ meatVal: () => 0,
347
+ probability: 0,
348
+ modifier: {
349
+ ["Meat Drop"]: 20,
350
+ },
351
+ },
352
+ {
353
+ familiar: $familiar `Grouper Groupie`,
354
+ meatVal: () => 0,
355
+ probability: 0,
356
+ modifier: {
357
+ ["Meat Drop"]: 20,
358
+ },
359
+ },
360
+ {
361
+ familiar: $familiar `Hand Turkey`,
362
+ meatVal: () => 30,
363
+ probability: 1,
364
+ modifier: {
365
+ ["Meat Drop"]: 20,
366
+ },
367
+ },
368
+ {
369
+ familiar: $familiar `Hippo Ballerina`,
370
+ meatVal: () => 0,
371
+ probability: 0,
372
+ modifier: {
373
+ ["Meat Drop"]: 20,
374
+ },
375
+ },
376
+ {
377
+ familiar: $familiar `Jitterbug`,
378
+ meatVal: () => 0,
379
+ probability: 0,
380
+ modifier: {
381
+ ["Meat Drop"]: 20,
382
+ },
383
+ },
384
+ {
385
+ familiar: $familiar `Leprechaun`,
386
+ meatVal: () => 30,
387
+ probability: 1,
388
+ modifier: {
389
+ ["Meat Drop"]: 20,
390
+ },
391
+ },
392
+ {
393
+ familiar: $familiar `Obtuse Angel`,
394
+ meatVal: () => 0,
395
+ probability: 0,
396
+ modifier: {
397
+ ["Meat Drop"]: 20,
398
+ },
399
+ },
400
+ {
401
+ familiar: $familiar `Psychedelic Bear`,
402
+ meatVal: () => 0,
403
+ probability: 0,
404
+ modifier: {
405
+ ["Meat Drop"]: 20,
406
+ },
407
+ },
408
+ {
409
+ familiar: $familiar `Robortender`,
410
+ meatVal: () => 0,
411
+ probability: 0,
412
+ modifier: {
413
+ ["Meat Drop"]: 20,
414
+ },
415
+ },
416
+ {
417
+ familiar: $familiar `Ghost of Crimbo Commerce`,
418
+ meatVal: () => 30,
419
+ probability: 1,
420
+ modifier: {
421
+ ["Meat Drop"]: 25,
422
+ },
423
+ },
424
+ {
425
+ familiar: $familiar `Hobo Monkey`,
426
+ meatVal: () => 0,
427
+ probability: 0,
428
+ modifier: {
429
+ ["Meat Drop"]: 25,
430
+ },
431
+ },
432
+ {
433
+ familiar: $familiar `Rockin' Robin`,
434
+ meatVal: () => 60,
435
+ probability: 1,
436
+ modifier: {
437
+ ["Item Drop"]: 15,
438
+ },
439
+ },
440
+ {
441
+ familiar: $familiar `Feral Kobold`,
442
+ meatVal: () => 30,
443
+ probability: 1,
444
+ modifier: {
445
+ ["Item Drop"]: 15,
446
+ },
447
+ },
448
+ {
449
+ familiar: $familiar `Oily Woim`,
450
+ meatVal: () => 30,
451
+ probability: 1,
452
+ modifier: {
453
+ ["Item Drop"]: 10,
454
+ },
455
+ },
456
+ {
457
+ familiar: $familiar `Cat Burglar`,
458
+ meatVal: () => 0,
459
+ probability: 0,
460
+ modifier: {
461
+ ["Item Drop"]: 10,
462
+ },
463
+ },
464
+ {
465
+ familiar: $familiar `Misshapen Animal Skeleton`,
466
+ meatVal: () => 30,
467
+ probability: 1,
468
+ modifier: {
469
+ ["Familiar Weight"]: 5,
470
+ },
471
+ },
472
+ {
473
+ familiar: $familiar `Gelatinous Cubeling`,
474
+ meatVal: () => 0,
475
+ probability: 0,
476
+ modifier: {
477
+ ["Familiar Weight"]: 5,
478
+ },
479
+ },
480
+ {
481
+ familiar: $familiar `Frozen Gravy Fairy`,
482
+ // drops a cold nugget every combat, 5 of which can be used to make a cold wad
483
+ meatVal: () => Math.max(0.2 * getSaleValue($item `cold wad`), getSaleValue($item `cold nuggets`)),
484
+ probability: 1,
485
+ modifier: { ["Cold Damage"]: 20 },
486
+ },
487
+ {
488
+ familiar: $familiar `Stinky Gravy Fairy`,
489
+ // drops a stench nugget every combat, 5 of which can be used to make a stench wad
490
+ meatVal: () => Math.max(0.2 * getSaleValue($item `stench wad`), getSaleValue($item `stench nuggets`)),
491
+ probability: 1,
492
+ modifier: { ["Stench Damage"]: 20 },
493
+ },
494
+ {
495
+ familiar: $familiar `Sleazy Gravy Fairy`,
496
+ // drops a sleaze nugget every combat, 5 of which can be used to make a sleaze wad
497
+ meatVal: () => Math.max(0.2 * getSaleValue($item `sleaze wad`), getSaleValue($item `sleaze nuggets`)),
498
+ probability: 1,
499
+ modifier: { ["Sleaze Damage"]: 20 },
500
+ },
501
+ {
502
+ familiar: $familiar `Spooky Gravy Fairy`,
503
+ // drops a spooky nugget every combat, 5 of which can be used to make a spooky wad
504
+ meatVal: () => Math.max(0.2 * getSaleValue($item `spooky wad`), getSaleValue($item `spooky nuggets`)),
505
+ probability: 1,
506
+ modifier: { ["Spooky Damage"]: 20 },
507
+ },
508
+ {
509
+ familiar: $familiar `Flaming Gravy Fairy`,
510
+ // drops a hot nugget every combat, 5 of which can be used to make a hot wad
511
+ meatVal: () => Math.max(0.2 * getSaleValue($item `hot wad`), getSaleValue($item `hot nuggets`)),
512
+ probability: 1,
513
+ modifier: { ["Hot Damage"]: 20 },
514
+ },
515
+ ];
516
+ export function valueRider(rider, modifierValueFunction, useLimitedDrops = true) {
517
+ const dropValue = !rider.dropPredicate || (rider.dropPredicate() && !useLimitedDrops)
518
+ ? rider.probability * rider.meatVal()
519
+ : 0;
520
+ const modifierValue = modifierValueFunction(rider.modifier);
521
+ return dropValue + modifierValue;
522
+ }
523
+ const riderModes = new Map();
524
+ export function createRiderMode(name, modifierValueFunction, useLimitedDrops = true, excludeCurrentFamiliar = true) {
525
+ return riderModes.set(name, {
526
+ modifierValueFunction: modifierValueFunction,
527
+ useLimitedDrops: useLimitedDrops,
528
+ excludeCurrentFamiliar: excludeCurrentFamiliar,
529
+ });
530
+ }
531
+ const riderLists = new Map();
532
+ export function pickRider(mode) {
533
+ const modeData = riderModes.get(mode);
534
+ if (!modeData)
535
+ return null;
536
+ const { modifierValueFunction, useLimitedDrops, excludeCurrentFamiliar, } = modeData;
537
+ if (!riderLists.has(mode)) {
538
+ riderLists.set(mode, ridingFamiliars
539
+ .filter((rider) => have(rider.familiar))
540
+ .sort((a, b) => valueRider(b, modifierValueFunction, useLimitedDrops) -
541
+ valueRider(a, modifierValueFunction, useLimitedDrops)));
542
+ }
543
+ const list = riderLists.get(mode);
544
+ if (list) {
545
+ const riderToReturn = list.find((rider) => (!rider.dropPredicate || rider.dropPredicate()) &&
546
+ (!excludeCurrentFamiliar || myFamiliar() !== rider.familiar));
547
+ return riderToReturn ?? null;
548
+ }
549
+ return null;
550
+ }
@@ -0,0 +1,9 @@
1
+ export declare const summonSkill: Skill;
2
+ /**
3
+ * @returns true if the player can Summon Dice
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>;