libram 0.4.0 → 0.4.4
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.
- package/dist/Clan.js +268 -485
- package/dist/Copier.js +11 -48
- package/dist/Dungeon.js +77 -157
- package/dist/Kmail.d.ts +3 -1
- package/dist/Kmail.js +92 -243
- package/dist/Path.js +68 -120
- package/dist/ascend.js +153 -172
- package/dist/combat.d.ts +100 -4
- package/dist/combat.js +352 -387
- package/dist/console.js +13 -36
- package/dist/diet/index.d.ts +31 -0
- package/dist/diet/index.js +390 -0
- package/dist/diet/knapsack.d.ts +7 -0
- package/dist/diet/knapsack.js +119 -0
- package/dist/dungeons/Dreadsylvania.d.ts +4 -0
- package/dist/dungeons/Dreadsylvania.js +14 -0
- package/dist/dungeons/Dungeon.d.ts +28 -0
- package/dist/dungeons/Dungeon.js +99 -0
- package/dist/dungeons/Hobopolis.d.ts +4 -0
- package/dist/dungeons/Hobopolis.js +14 -0
- package/dist/dungeons/SlimeTube.d.ts +4 -0
- package/dist/dungeons/SlimeTube.js +14 -0
- package/dist/freerun.d.ts +16 -4
- package/dist/freerun.js +88 -99
- package/dist/index.d.ts +5 -1
- package/dist/index.js +22 -300
- package/dist/lib.d.ts +24 -0
- package/dist/lib.js +304 -488
- package/dist/logger.js +23 -63
- package/dist/maximize.js +289 -556
- package/dist/modifier.d.ts +4 -0
- package/dist/modifier.js +35 -46
- package/dist/modifierTypes.js +8 -22
- package/dist/mood.d.ts +5 -0
- package/dist/mood.js +260 -551
- package/dist/property.d.ts +2 -0
- package/dist/property.js +99 -242
- package/dist/propertyTypes.d.ts +4 -3
- package/dist/propertyTypes.js +1 -0
- package/dist/propertyTyping.d.ts +4 -3
- package/dist/propertyTyping.js +52 -59
- package/dist/resources/2007/CandyHearts.d.ts +9 -0
- package/dist/resources/2007/CandyHearts.js +24 -0
- package/dist/resources/2008/DivineFavors.d.ts +9 -0
- package/dist/resources/2008/DivineFavors.js +27 -0
- package/dist/resources/2009/Bandersnatch.js +37 -112
- package/dist/resources/2009/LoveSongs.d.ts +9 -0
- package/dist/resources/2009/LoveSongs.js +24 -0
- package/dist/resources/2009/SpookyPutty.js +20 -46
- package/dist/resources/2010/Brickos.d.ts +9 -0
- package/dist/resources/2010/Brickos.js +21 -0
- package/dist/resources/2010/CrownOfThrones.d.ts +18 -0
- package/dist/resources/2010/CrownOfThrones.js +550 -0
- package/dist/resources/2011/Gygaxian.d.ts +9 -0
- package/dist/resources/2011/Gygaxian.js +24 -0
- package/dist/resources/2011/ObtuseAngel.js +21 -63
- package/dist/resources/2012/RainDoh.js +14 -40
- package/dist/resources/2012/Resolutions.d.ts +9 -0
- package/dist/resources/2012/Resolutions.js +28 -0
- package/dist/resources/2013/Florist.d.ts +1 -0
- package/dist/resources/2013/Florist.js +137 -207
- package/dist/resources/2013/PulledTaffy.d.ts +9 -0
- package/dist/resources/2013/PulledTaffy.js +33 -0
- package/dist/resources/2014/DNALab.d.ts +47 -0
- package/dist/resources/2014/DNALab.js +154 -0
- package/dist/resources/2014/WinterGarden.js +15 -43
- package/dist/resources/2015/ChateauMantegna.js +52 -86
- package/dist/resources/2015/MayoClinic.d.ts +3 -0
- package/dist/resources/2015/MayoClinic.js +36 -65
- package/dist/resources/2016/SourceTerminal.d.ts +1 -0
- package/dist/resources/2016/SourceTerminal.js +114 -237
- package/dist/resources/2016/Witchess.js +33 -59
- package/dist/resources/2017/AsdonMartin.d.ts +27 -0
- package/dist/resources/2017/AsdonMartin.js +80 -0
- package/dist/resources/2017/TunnelOfLove.js +62 -111
- package/dist/resources/2018/SongBoom.js +32 -68
- package/dist/resources/2019/BeachComb.js +26 -44
- package/dist/resources/2019/Snapper.d.ts +28 -0
- package/dist/resources/2019/Snapper.js +69 -0
- package/dist/resources/2020/Guzzlr.d.ts +3 -0
- package/dist/resources/2020/Guzzlr.js +92 -163
- package/dist/resources/LibramSummon.d.ts +12 -0
- package/dist/resources/LibramSummon.js +66 -0
- package/dist/resources/index.d.ts +20 -14
- package/dist/resources/index.js +21 -100
- package/dist/resources/putty-likes.js +15 -30
- package/dist/ring-buffer.d.ts +24 -0
- package/dist/ring-buffer.js +135 -0
- package/dist/since.d.ts +1 -0
- package/dist/since.js +56 -112
- package/dist/template-string.js +40 -132
- package/dist/utils.d.ts +12 -0
- package/dist/utils.js +54 -123
- package/package.json +8 -3
- package/dist/libram-example-briefcase.js +0 -16073
- package/dist/libram-example-clan.js +0 -7050
- package/dist/libram-example-consult.js +0 -5032
- package/dist/libram-example-item.js +0 -2870
- package/dist/libram-example-kmail.js +0 -2065
- package/dist/libram-example-lib.js +0 -6369
- package/dist/libram-example-modifier.js +0 -4495
- package/dist/libram-example-props.js +0 -3996
- package/dist/libram-example-resources.js +0 -10461
|
@@ -1,250 +1,179 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.getPlatinumToday = getPlatinumToday;
|
|
12
|
-
exports.canPlatinum = canPlatinum;
|
|
13
|
-
exports.haveFullPlatinumBonus = haveFullPlatinumBonus;
|
|
14
|
-
exports.acceptPlatinum = acceptPlatinum;
|
|
15
|
-
exports.getGold = getGold;
|
|
16
|
-
exports.getGoldToday = getGoldToday;
|
|
17
|
-
exports.canGold = canGold;
|
|
18
|
-
exports.haveFullGoldBonus = haveFullGoldBonus;
|
|
19
|
-
exports.acceptGold = acceptGold;
|
|
20
|
-
exports.getBronze = getBronze;
|
|
21
|
-
exports.acceptBronze = acceptBronze;
|
|
22
|
-
exports.haveFullBronzeBonus = haveFullBronzeBonus;
|
|
23
|
-
exports.canAbandon = canAbandon;
|
|
24
|
-
exports.abandon = abandon;
|
|
25
|
-
exports.getLocation = getLocation;
|
|
26
|
-
exports.getTier = getTier;
|
|
27
|
-
exports.getBooze = getBooze;
|
|
28
|
-
exports.havePlatinumBooze = havePlatinumBooze;
|
|
29
|
-
exports.haveBooze = haveBooze;
|
|
30
|
-
exports.Cocktails = exports.item = void 0;
|
|
31
|
-
|
|
32
|
-
var _kolmafia = require("kolmafia");
|
|
33
|
-
|
|
34
|
-
var _lib = require("../../lib");
|
|
35
|
-
|
|
36
|
-
var _property = require("../../property");
|
|
37
|
-
|
|
38
|
-
var _templateString = require("../../template-string");
|
|
39
|
-
|
|
40
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
41
|
-
|
|
42
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
43
|
-
|
|
44
|
-
var item = (0, _templateString.$item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["Guzzlr tablet"])));
|
|
45
|
-
exports.item = item;
|
|
46
|
-
|
|
47
|
-
function have() {
|
|
48
|
-
return (0, _lib.have)(item);
|
|
49
|
-
}
|
|
50
|
-
|
|
1
|
+
import { mallPrice, runChoice, use, visitUrl } from "kolmafia";
|
|
2
|
+
import { maxBy } from "lodash";
|
|
3
|
+
import { have as haveItem } from "../../lib";
|
|
4
|
+
import { get, withChoice } from "../../property";
|
|
5
|
+
import { $item, $items } from "../../template-string";
|
|
6
|
+
import { invertMap } from "../../utils";
|
|
7
|
+
export const item = $item `Guzzlr tablet`;
|
|
8
|
+
export function have() {
|
|
9
|
+
return haveItem(item);
|
|
10
|
+
}
|
|
51
11
|
function useTabletWithChoice(option) {
|
|
52
|
-
|
|
12
|
+
withChoice(1412, option, () => use(1, item));
|
|
53
13
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return (0, _property.get)("questGuzzlr") !== "unstarted";
|
|
14
|
+
export function isQuestActive() {
|
|
15
|
+
return get("questGuzzlr") !== "unstarted";
|
|
57
16
|
}
|
|
58
17
|
/**
|
|
59
18
|
* Platinum deliveries completed overall
|
|
60
19
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function getPlatinum() {
|
|
64
|
-
return (0, _property.get)("guzzlrPlatinumDeliveries");
|
|
20
|
+
export function getPlatinum() {
|
|
21
|
+
return get("guzzlrPlatinumDeliveries");
|
|
65
22
|
}
|
|
66
23
|
/**
|
|
67
24
|
* Platinum deliveries completed today
|
|
68
25
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
function getPlatinumToday() {
|
|
72
|
-
return (0, _property.get)("_guzzlrPlatinumDeliveries");
|
|
26
|
+
export function getPlatinumToday() {
|
|
27
|
+
return get("_guzzlrPlatinumDeliveries");
|
|
73
28
|
}
|
|
74
29
|
/**
|
|
75
30
|
* Can do a platinum delivery (haven't done one today)
|
|
76
31
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
function canPlatinum() {
|
|
80
|
-
return !isQuestActive() && getGold() >= 5 && getPlatinumToday() < 1;
|
|
32
|
+
export function canPlatinum() {
|
|
33
|
+
return !isQuestActive() && getGold() >= 5 && getPlatinumToday() < 1;
|
|
81
34
|
}
|
|
82
35
|
/**
|
|
83
36
|
* Have fully unlocked the platinum delivery bonuses (done >= 30)
|
|
84
37
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
function haveFullPlatinumBonus() {
|
|
88
|
-
return getPlatinum() >= 30;
|
|
38
|
+
export function haveFullPlatinumBonus() {
|
|
39
|
+
return getPlatinum() >= 30;
|
|
89
40
|
}
|
|
90
41
|
/**
|
|
91
42
|
* Accept platinum delivery
|
|
92
43
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return true;
|
|
44
|
+
export function acceptPlatinum() {
|
|
45
|
+
if (!canPlatinum())
|
|
46
|
+
return false;
|
|
47
|
+
useTabletWithChoice(4);
|
|
48
|
+
return true;
|
|
99
49
|
}
|
|
100
50
|
/**
|
|
101
51
|
* Gold deliveries completed overall
|
|
102
52
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
function getGold() {
|
|
106
|
-
return (0, _property.get)("guzzlrGoldDeliveries");
|
|
53
|
+
export function getGold() {
|
|
54
|
+
return get("guzzlrGoldDeliveries");
|
|
107
55
|
}
|
|
108
56
|
/**
|
|
109
57
|
* Gold deliveries completed today
|
|
110
58
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
function getGoldToday() {
|
|
114
|
-
return (0, _property.get)("_guzzlrGoldDeliveries");
|
|
59
|
+
export function getGoldToday() {
|
|
60
|
+
return get("_guzzlrGoldDeliveries");
|
|
115
61
|
}
|
|
116
62
|
/**
|
|
117
63
|
* Can do a gold delivery (have done fewer than 3 today)
|
|
118
64
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
function canGold() {
|
|
122
|
-
return !isQuestActive() && getBronze() >= 5 && getGoldToday() < 3;
|
|
65
|
+
export function canGold() {
|
|
66
|
+
return !isQuestActive() && getBronze() >= 5 && getGoldToday() < 3;
|
|
123
67
|
}
|
|
124
68
|
/**
|
|
125
69
|
* Have fully unlocked the platinum delivery bonuses (done >= 30)
|
|
126
70
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
function haveFullGoldBonus() {
|
|
130
|
-
return getGold() >= 150;
|
|
71
|
+
export function haveFullGoldBonus() {
|
|
72
|
+
return getGold() >= 150;
|
|
131
73
|
}
|
|
132
74
|
/**
|
|
133
75
|
* Accept gold delivery
|
|
134
76
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return true;
|
|
77
|
+
export function acceptGold() {
|
|
78
|
+
if (!canGold())
|
|
79
|
+
return false;
|
|
80
|
+
useTabletWithChoice(3);
|
|
81
|
+
return true;
|
|
141
82
|
}
|
|
142
83
|
/**
|
|
143
84
|
* Bronze deliveries completed overall
|
|
144
85
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
function getBronze() {
|
|
148
|
-
return (0, _property.get)("guzzlrBronzeDeliveries");
|
|
86
|
+
export function getBronze() {
|
|
87
|
+
return get("guzzlrBronzeDeliveries");
|
|
149
88
|
}
|
|
150
89
|
/**
|
|
151
90
|
* Accept bronze delivery
|
|
152
91
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return true;
|
|
92
|
+
export function acceptBronze() {
|
|
93
|
+
if (isQuestActive())
|
|
94
|
+
return false;
|
|
95
|
+
useTabletWithChoice(2);
|
|
96
|
+
return true;
|
|
159
97
|
}
|
|
160
98
|
/**
|
|
161
99
|
* Have fully unlocked the platinum delivery bonuses (done >= 30)
|
|
162
100
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
function haveFullBronzeBonus() {
|
|
166
|
-
return getBronze() >= 196;
|
|
101
|
+
export function haveFullBronzeBonus() {
|
|
102
|
+
return getBronze() >= 196;
|
|
167
103
|
}
|
|
168
104
|
/**
|
|
169
105
|
* Can abandon the current Guzzlr quest
|
|
170
106
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
function canAbandon() {
|
|
174
|
-
return isQuestActive() && !(0, _property.get)("_guzzlrQuestAbandoned");
|
|
107
|
+
export function canAbandon() {
|
|
108
|
+
return isQuestActive() && !get("_guzzlrQuestAbandoned");
|
|
175
109
|
}
|
|
176
110
|
/**
|
|
177
111
|
* Abandon Guzzlr quest
|
|
178
112
|
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return true;
|
|
113
|
+
export function abandon() {
|
|
114
|
+
if (!canAbandon())
|
|
115
|
+
return false;
|
|
116
|
+
visitUrl("inventory.php?tap=guzzlr", false);
|
|
117
|
+
runChoice(1);
|
|
118
|
+
runChoice(5);
|
|
119
|
+
return true;
|
|
187
120
|
}
|
|
188
121
|
/**
|
|
189
122
|
* Get current Guzzlr quest location
|
|
190
123
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
function getLocation() {
|
|
194
|
-
return (0, _property.get)("guzzlrQuestLocation");
|
|
124
|
+
export function getLocation() {
|
|
125
|
+
return get("guzzlrQuestLocation");
|
|
195
126
|
}
|
|
196
127
|
/**
|
|
197
128
|
* Get current Guzzlr quest tier
|
|
198
129
|
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
var tier = (0, _property.get)("guzzlrQuestTier");
|
|
203
|
-
return tier === "" ? null : tier;
|
|
130
|
+
export function getTier() {
|
|
131
|
+
const tier = get("guzzlrQuestTier");
|
|
132
|
+
return tier === "" ? null : tier;
|
|
204
133
|
}
|
|
205
134
|
/**
|
|
206
135
|
* Get current Guzzlr quest booze
|
|
207
136
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return Item.get(booze);
|
|
137
|
+
export function getBooze() {
|
|
138
|
+
const booze = get("guzzlrQuestBooze");
|
|
139
|
+
if (booze === "")
|
|
140
|
+
return null;
|
|
141
|
+
return Item.get(booze);
|
|
214
142
|
}
|
|
215
143
|
/**
|
|
216
144
|
* List of the platinum cocktails
|
|
217
145
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
var Cocktails = (0, _templateString.$items)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Buttery Boy, Steamboat, Ghiaccio Colada, Nog-on-the-Cob, Sourfinger"])));
|
|
146
|
+
export const Cocktails = $items `Buttery Boy, Steamboat, Ghiaccio Colada, Nog-on-the-Cob, Sourfinger`;
|
|
221
147
|
/**
|
|
222
148
|
* Returns true if the user has a platinum cocktail in their inventory
|
|
223
149
|
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
function havePlatinumBooze() {
|
|
228
|
-
return Cocktails.some(cock => (0, _lib.have)(cock));
|
|
150
|
+
export function havePlatinumBooze() {
|
|
151
|
+
return Cocktails.some((cock) => haveItem(cock));
|
|
229
152
|
}
|
|
230
153
|
/**
|
|
231
154
|
* Returns true if the user has the cocktail that they need for their current quest
|
|
232
155
|
*
|
|
233
156
|
* If they have no quest, returns false
|
|
234
157
|
*/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
158
|
+
export function haveBooze() {
|
|
159
|
+
const booze = getBooze();
|
|
160
|
+
switch (booze) {
|
|
161
|
+
case null:
|
|
162
|
+
return false;
|
|
163
|
+
case $item `Guzzlr cocktail set`:
|
|
164
|
+
return havePlatinumBooze();
|
|
165
|
+
default:
|
|
166
|
+
return haveItem(booze);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
export const ingredientToPlatinumCocktail = new Map([
|
|
170
|
+
[$item `miniature boiler`, $item `Steamboat`],
|
|
171
|
+
[$item `cold wad`, $item `Ghiaccio Colada`],
|
|
172
|
+
[$item `robin's egg`, $item `Nog-on-the-Cob`],
|
|
173
|
+
[$item `mangled finger`, $item `Sourfinger`],
|
|
174
|
+
[$item `Dish of Clarified Butter`, $item `Buttery Boy`],
|
|
175
|
+
]);
|
|
176
|
+
export const platinumCocktailToIngredient = invertMap(ingredientToPlatinumCocktail);
|
|
177
|
+
export function getCheapestPlatinumCocktail() {
|
|
178
|
+
return (maxBy(Array.from(ingredientToPlatinumCocktail), (ingredientAndCocktail) => mallPrice(ingredientAndCocktail[0])) ?? [$item `Dish of Clarified Butter`, $item `Buttery Boy`])[1];
|
|
179
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param summonSkill The libram summoning skill
|
|
4
|
+
* @returns map containing the chance of an item to be summoned
|
|
5
|
+
*/
|
|
6
|
+
export declare function expectedLibramSummon(summonSkill: Skill): Map<Item, number>;
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @returns map containing the chance of items to be summoned for each libram summoning skill available
|
|
10
|
+
*/
|
|
11
|
+
export declare function possibleLibramSummons(): Map<Skill, Map<Item, number>>;
|
|
12
|
+
export declare function bestLibramToCast(): Skill | null;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import maxBy from "lodash/maxBy";
|
|
2
|
+
import { getSaleValue } from "../lib";
|
|
3
|
+
import { sumNumbers } from "../utils";
|
|
4
|
+
import { expected as candyHeartsExpected, have as candyHeartsHave, summonSkill as candyHeartsSkill, } from "./2007/CandyHearts";
|
|
5
|
+
import { expected as divineFavorsExpected, have as divineFavorsHave, summonSkill as divineFavorsSkill, } from "./2008/DivineFavors";
|
|
6
|
+
import { expected as loveSongsExpected, have as loveSongsHave, summonSkill as loveSongsSkill, } from "./2009/LoveSongs";
|
|
7
|
+
import { expected as brickosExpected, have as brickosHave, summonSkill as brickosSkill, } from "./2010/Brickos";
|
|
8
|
+
import { expected as diceExpected, have as diceHave, summonSkill as diceSkill, } from "./2011/Gygaxian";
|
|
9
|
+
import { expected as resolutionsExpected, have as resolutionsHave, summonSkill as resolutionsSkill, } from "./2012/Resolutions";
|
|
10
|
+
import { expected as taffyExpected, have as taffyHave, summonSkill as taffySkill, } 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 candyHeartsSkill:
|
|
19
|
+
return candyHeartsExpected();
|
|
20
|
+
case divineFavorsSkill:
|
|
21
|
+
return divineFavorsExpected();
|
|
22
|
+
case loveSongsSkill:
|
|
23
|
+
return loveSongsExpected();
|
|
24
|
+
case brickosSkill:
|
|
25
|
+
return brickosExpected();
|
|
26
|
+
case diceSkill:
|
|
27
|
+
return diceExpected();
|
|
28
|
+
case resolutionsSkill:
|
|
29
|
+
return resolutionsExpected();
|
|
30
|
+
case taffySkill:
|
|
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(candyHeartsSkill, candyHeartsExpected());
|
|
43
|
+
}
|
|
44
|
+
if (divineFavorsHave()) {
|
|
45
|
+
results.set(divineFavorsSkill, divineFavorsExpected());
|
|
46
|
+
}
|
|
47
|
+
if (loveSongsHave()) {
|
|
48
|
+
results.set(loveSongsSkill, loveSongsExpected());
|
|
49
|
+
}
|
|
50
|
+
if (brickosHave()) {
|
|
51
|
+
results.set(brickosSkill, brickosExpected());
|
|
52
|
+
}
|
|
53
|
+
if (diceHave()) {
|
|
54
|
+
results.set(diceSkill, diceExpected());
|
|
55
|
+
}
|
|
56
|
+
if (resolutionsHave()) {
|
|
57
|
+
results.set(resolutionsSkill, resolutionsExpected());
|
|
58
|
+
}
|
|
59
|
+
if (taffyHave()) {
|
|
60
|
+
results.set(taffySkill, taffyExpected());
|
|
61
|
+
}
|
|
62
|
+
return results;
|
|
63
|
+
}
|
|
64
|
+
export function bestLibramToCast() {
|
|
65
|
+
return (maxBy(Array.from(possibleLibramSummons().entries()), ([, itemMap]) => sumNumbers(Array.from(itemMap.entries()).map(([item, weight]) => weight * getSaleValue(item)))) ?? [null])[0];
|
|
66
|
+
}
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import * as AsdonMartin from "./2017/AsdonMartin";
|
|
2
|
+
import * as Bandersnatch from "./2009/Bandersnatch";
|
|
3
|
+
import * as BeachComb from "./2019/BeachComb";
|
|
4
|
+
import * as ChateauMantegna from "./2015/ChateauMantegna";
|
|
5
|
+
import * as CrownOfThrones from "./2010/CrownOfThrones";
|
|
6
|
+
import * as DNALab from "./2014/DNALab";
|
|
7
|
+
import * as FloristFriar from "./2013/Florist";
|
|
8
|
+
import * as Guzzlr from "./2020/Guzzlr";
|
|
9
|
+
import * as MayoClinic from "./2015/MayoClinic";
|
|
10
|
+
import * as ObtuseAngel from "./2011/ObtuseAngel";
|
|
11
|
+
import * as RainDoh from "./2012/RainDoh";
|
|
12
|
+
import * as Snapper from "./2019/Snapper";
|
|
13
|
+
import * as SongBoom from "./2018/SongBoom";
|
|
14
|
+
import * as SourceTerminal from "./2016/SourceTerminal";
|
|
15
|
+
import * as SpookyPutty from "./2009/SpookyPutty";
|
|
16
|
+
import * as TunnelOfLove from "./2017/TunnelOfLove";
|
|
17
|
+
import * as WinterGarden from "./2014/WinterGarden";
|
|
18
|
+
import * as Witchess from "./2016/Witchess";
|
|
19
|
+
export { AsdonMartin, Bandersnatch, BeachComb, ChateauMantegna, CrownOfThrones, DNALab, FloristFriar, Guzzlr, MayoClinic, ObtuseAngel, RainDoh, SongBoom, SourceTerminal, Snapper, SpookyPutty, TunnelOfLove, WinterGarden, Witchess, };
|
|
15
20
|
export * from "./putty-likes";
|
|
21
|
+
export * from "./LibramSummon";
|
package/dist/resources/index.js
CHANGED
|
@@ -1,100 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
BeachComb: true,
|
|
23
|
-
FloristFriar: true,
|
|
24
|
-
MayoClinic: true
|
|
25
|
-
};
|
|
26
|
-
exports.MayoClinic = exports.FloristFriar = exports.BeachComb = exports.Guzzlr = exports.Witchess = exports.WinterGarden = exports.TunnelOfLove = exports.SpookyPutty = exports.SourceTerminal = exports.SongBoom = exports.RainDoh = exports.ObtuseAngel = exports.ChateauMantegna = exports.Bandersnatch = void 0;
|
|
27
|
-
|
|
28
|
-
var _Bandersnatch = _interopRequireWildcard(require("./2009/Bandersnatch"));
|
|
29
|
-
|
|
30
|
-
exports.Bandersnatch = _Bandersnatch;
|
|
31
|
-
|
|
32
|
-
var _ChateauMantegna = _interopRequireWildcard(require("./2015/ChateauMantegna"));
|
|
33
|
-
|
|
34
|
-
exports.ChateauMantegna = _ChateauMantegna;
|
|
35
|
-
|
|
36
|
-
var _ObtuseAngel = _interopRequireWildcard(require("./2011/ObtuseAngel"));
|
|
37
|
-
|
|
38
|
-
exports.ObtuseAngel = _ObtuseAngel;
|
|
39
|
-
|
|
40
|
-
var _RainDoh = _interopRequireWildcard(require("./2012/RainDoh"));
|
|
41
|
-
|
|
42
|
-
exports.RainDoh = _RainDoh;
|
|
43
|
-
|
|
44
|
-
var _SongBoom = _interopRequireWildcard(require("./2018/SongBoom"));
|
|
45
|
-
|
|
46
|
-
exports.SongBoom = _SongBoom;
|
|
47
|
-
|
|
48
|
-
var _SourceTerminal = _interopRequireWildcard(require("./2016/SourceTerminal"));
|
|
49
|
-
|
|
50
|
-
exports.SourceTerminal = _SourceTerminal;
|
|
51
|
-
|
|
52
|
-
var _SpookyPutty = _interopRequireWildcard(require("./2009/SpookyPutty"));
|
|
53
|
-
|
|
54
|
-
exports.SpookyPutty = _SpookyPutty;
|
|
55
|
-
|
|
56
|
-
var _TunnelOfLove = _interopRequireWildcard(require("./2017/TunnelOfLove"));
|
|
57
|
-
|
|
58
|
-
exports.TunnelOfLove = _TunnelOfLove;
|
|
59
|
-
|
|
60
|
-
var _WinterGarden = _interopRequireWildcard(require("./2014/WinterGarden"));
|
|
61
|
-
|
|
62
|
-
exports.WinterGarden = _WinterGarden;
|
|
63
|
-
|
|
64
|
-
var _Witchess = _interopRequireWildcard(require("./2016/Witchess"));
|
|
65
|
-
|
|
66
|
-
exports.Witchess = _Witchess;
|
|
67
|
-
|
|
68
|
-
var _Guzzlr = _interopRequireWildcard(require("./2020/Guzzlr"));
|
|
69
|
-
|
|
70
|
-
exports.Guzzlr = _Guzzlr;
|
|
71
|
-
|
|
72
|
-
var _BeachComb = _interopRequireWildcard(require("./2019/BeachComb"));
|
|
73
|
-
|
|
74
|
-
exports.BeachComb = _BeachComb;
|
|
75
|
-
|
|
76
|
-
var _FloristFriar = _interopRequireWildcard(require("./2013/Florist"));
|
|
77
|
-
|
|
78
|
-
exports.FloristFriar = _FloristFriar;
|
|
79
|
-
|
|
80
|
-
var _MayoClinic = _interopRequireWildcard(require("./2015/MayoClinic"));
|
|
81
|
-
|
|
82
|
-
exports.MayoClinic = _MayoClinic;
|
|
83
|
-
|
|
84
|
-
var _puttyLikes = require("./putty-likes");
|
|
85
|
-
|
|
86
|
-
Object.keys(_puttyLikes).forEach(function (key) {
|
|
87
|
-
if (key === "default" || key === "__esModule") return;
|
|
88
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
89
|
-
if (key in exports && exports[key] === _puttyLikes[key]) return;
|
|
90
|
-
Object.defineProperty(exports, key, {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function get() {
|
|
93
|
-
return _puttyLikes[key];
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
99
|
-
|
|
100
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
1
|
+
import * as AsdonMartin from "./2017/AsdonMartin";
|
|
2
|
+
import * as Bandersnatch from "./2009/Bandersnatch";
|
|
3
|
+
import * as BeachComb from "./2019/BeachComb";
|
|
4
|
+
import * as ChateauMantegna from "./2015/ChateauMantegna";
|
|
5
|
+
import * as CrownOfThrones from "./2010/CrownOfThrones";
|
|
6
|
+
import * as DNALab from "./2014/DNALab";
|
|
7
|
+
import * as FloristFriar from "./2013/Florist";
|
|
8
|
+
import * as Guzzlr from "./2020/Guzzlr";
|
|
9
|
+
import * as MayoClinic from "./2015/MayoClinic";
|
|
10
|
+
import * as ObtuseAngel from "./2011/ObtuseAngel";
|
|
11
|
+
import * as RainDoh from "./2012/RainDoh";
|
|
12
|
+
import * as Snapper from "./2019/Snapper";
|
|
13
|
+
import * as SongBoom from "./2018/SongBoom";
|
|
14
|
+
import * as SourceTerminal from "./2016/SourceTerminal";
|
|
15
|
+
import * as SpookyPutty from "./2009/SpookyPutty";
|
|
16
|
+
import * as TunnelOfLove from "./2017/TunnelOfLove";
|
|
17
|
+
import * as WinterGarden from "./2014/WinterGarden";
|
|
18
|
+
import * as Witchess from "./2016/Witchess";
|
|
19
|
+
export { AsdonMartin, Bandersnatch, BeachComb, ChateauMantegna, CrownOfThrones, DNALab, FloristFriar, Guzzlr, MayoClinic, ObtuseAngel, RainDoh, SongBoom, SourceTerminal, Snapper, SpookyPutty, TunnelOfLove, WinterGarden, Witchess, };
|
|
20
|
+
export * from "./putty-likes";
|
|
21
|
+
export * from "./LibramSummon";
|
|
@@ -1,33 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.getTotalPuttyLikeCopiesMade = getTotalPuttyLikeCopiesMade;
|
|
7
|
-
exports.couldUseRainDohBlackBox = couldUseRainDohBlackBox;
|
|
8
|
-
exports.couldUseSpookyPuttySheet = couldUseSpookyPuttySheet;
|
|
9
|
-
exports.SpookyPuttySheet = exports.RainDohBlackBox = void 0;
|
|
10
|
-
|
|
11
|
-
var _Copier = require("../Copier");
|
|
12
|
-
|
|
13
|
-
var _SpookyPutty = require("./2009/SpookyPutty");
|
|
14
|
-
|
|
15
|
-
var _RainDoh = require("./2012/RainDoh");
|
|
16
|
-
|
|
17
|
-
function getTotalPuttyLikeCopiesMade() {
|
|
18
|
-
return (0, _SpookyPutty.getSpookyPuttySheetCopiesMade)() + (0, _RainDoh.getRainDohBlackBoxCopiesMade)();
|
|
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
|
+
export function getTotalPuttyLikeCopiesMade() {
|
|
5
|
+
return getSpookyPuttySheetCopiesMade() + getRainDohBlackBoxCopiesMade();
|
|
19
6
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
export function couldUseRainDohBlackBox() {
|
|
8
|
+
return (haveRainDoh() &&
|
|
9
|
+
getRainDohBlackBoxCopiesMade() < 5 &&
|
|
10
|
+
getTotalPuttyLikeCopiesMade() < 6);
|
|
23
11
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return (0, _SpookyPutty.have)() && (0, _SpookyPutty.getSpookyPuttySheetCopiesMade)() < 5 && getTotalPuttyLikeCopiesMade() < 6;
|
|
12
|
+
export const RainDohBlackBox = new Copier(() => couldUseRainDohBlackBox(), null, () => couldUseRainDohBlackBox(), () => getRainDohBlackBoxMonster(), () => useRainDohBlackBox());
|
|
13
|
+
export function couldUseSpookyPuttySheet() {
|
|
14
|
+
return (haveSpookyPutty() &&
|
|
15
|
+
getSpookyPuttySheetCopiesMade() < 5 &&
|
|
16
|
+
getTotalPuttyLikeCopiesMade() < 6);
|
|
30
17
|
}
|
|
31
|
-
|
|
32
|
-
var SpookyPuttySheet = new _Copier.Copier(() => couldUseSpookyPuttySheet(), () => (0, _SpookyPutty.prepareSpookyPuttySheet)(), () => couldUseSpookyPuttySheet(), () => (0, _SpookyPutty.getSpookyPuttySheetMonster)(), () => (0, _SpookyPutty.useSpookyPuttySheet)());
|
|
33
|
-
exports.SpookyPuttySheet = SpookyPuttySheet;
|
|
18
|
+
export const SpookyPuttySheet = new Copier(() => couldUseSpookyPuttySheet(), () => prepareSpookyPuttySheet(), () => couldUseSpookyPuttySheet(), () => getSpookyPuttySheetMonster(), () => useSpookyPuttySheet());
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare class RingBuffer<T> {
|
|
2
|
+
#private;
|
|
3
|
+
constructor(maxLength: number);
|
|
4
|
+
/**
|
|
5
|
+
* Get length of structure.
|
|
6
|
+
*/
|
|
7
|
+
get length(): number;
|
|
8
|
+
/**
|
|
9
|
+
* Get maximium length of structure.
|
|
10
|
+
*/
|
|
11
|
+
get maxSize(): number;
|
|
12
|
+
entries(): T[];
|
|
13
|
+
/**
|
|
14
|
+
* Get element at index {index}.
|
|
15
|
+
* @param index Index to check.
|
|
16
|
+
*/
|
|
17
|
+
get(index: number): T | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Insert a value and evict last value if buffer is full.
|
|
20
|
+
* @param value Value to insert.
|
|
21
|
+
* @returns Evicted element and index of inserted value.
|
|
22
|
+
*/
|
|
23
|
+
insert(value: T): [T | undefined, number];
|
|
24
|
+
}
|