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.
- package/dist/Clan.js +268 -485
- package/dist/Copier.js +11 -48
- package/dist/Dungeon.js +77 -157
- package/dist/Kmail.d.ts +13 -7
- package/dist/Kmail.js +92 -233
- package/dist/Path.js +68 -120
- package/dist/ascend.js +153 -172
- package/dist/combat.d.ts +86 -1
- package/dist/combat.js +295 -387
- package/dist/console.js +13 -36
- package/dist/diet/index.d.ts +31 -0
- package/dist/diet/index.js +333 -0
- package/dist/diet/knapsack.d.ts +7 -0
- package/dist/diet/knapsack.js +106 -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 +23 -0
- package/dist/freerun.js +92 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +21 -263
- package/dist/lib.d.ts +43 -0
- package/dist/lib.js +296 -405
- package/dist/logger.js +23 -63
- package/dist/maximize.d.ts +29 -12
- package/dist/maximize.js +318 -421
- package/dist/modifier.d.ts +13 -0
- package/dist/modifier.js +35 -0
- package/dist/modifierTypes.d.ts +16 -0
- package/dist/modifierTypes.js +9 -0
- package/dist/mood.js +220 -531
- package/dist/property.d.ts +2 -0
- package/dist/property.js +96 -242
- package/dist/propertyTypes.d.ts +9 -0
- package/dist/propertyTypes.js +1 -0
- package/dist/propertyTyping.d.ts +2 -9
- package/dist/propertyTyping.js +42 -53
- 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 +61 -0
- package/dist/resources/2013/Florist.js +149 -0
- package/dist/resources/2013/PulledTaffy.d.ts +9 -0
- package/dist/resources/2013/PulledTaffy.js +33 -0
- package/dist/resources/2014/WinterGarden.js +15 -43
- package/dist/resources/2015/ChateauMantegna.js +52 -86
- package/dist/resources/2015/MayoClinic.d.ts +13 -0
- package/dist/resources/2015/MayoClinic.js +36 -0
- 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/TunnelOfLove.js +62 -111
- package/dist/resources/2018/SongBoom.js +32 -68
- package/dist/resources/2019/BeachComb.d.ts +2 -0
- package/dist/resources/2019/BeachComb.js +26 -0
- package/dist/resources/2019/Snapper.d.ts +28 -0
- package/dist/resources/2019/Snapper.js +70 -0
- package/dist/resources/2020/Guzzlr.js +79 -163
- package/dist/resources/LibramSummon.d.ts +12 -0
- package/dist/resources/LibramSummon.js +66 -0
- package/dist/resources/index.d.ts +18 -11
- package/dist/resources/index.js +19 -85
- 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 +14 -0
- package/dist/utils.js +50 -114
- package/package.json +5 -3
- package/dist/libram-example-briefcase.js +0 -16073
- package/dist/libram-example-clan.js +0 -8898
- package/dist/libram-example-consult.js +0 -6179
- package/dist/libram-example-item.js +0 -3248
- package/dist/libram-example-kmail.js +0 -2065
- package/dist/libram-example-lib.js +0 -7608
- package/dist/libram-example-props.js +0 -4770
- package/dist/libram-example-resources.js +0 -12226
|
@@ -1,250 +1,166 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
exports.isQuestActive = isQuestActive;
|
|
10
|
-
exports.getPlatinum = getPlatinum;
|
|
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 { runChoice, use, visitUrl } from "kolmafia";
|
|
2
|
+
import { have as haveItem } from "../../lib";
|
|
3
|
+
import { get, withChoice } from "../../property";
|
|
4
|
+
import { $item, $items } from "../../template-string";
|
|
5
|
+
export const item = $item `Guzzlr tablet`;
|
|
6
|
+
export function have() {
|
|
7
|
+
return haveItem(item);
|
|
8
|
+
}
|
|
51
9
|
function useTabletWithChoice(option) {
|
|
52
|
-
|
|
10
|
+
withChoice(1412, option, () => use(1, item));
|
|
53
11
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
return (0, _property.get)("questGuzzlr") !== "unstarted";
|
|
12
|
+
export function isQuestActive() {
|
|
13
|
+
return get("questGuzzlr") !== "unstarted";
|
|
57
14
|
}
|
|
58
15
|
/**
|
|
59
16
|
* Platinum deliveries completed overall
|
|
60
17
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
function getPlatinum() {
|
|
64
|
-
return (0, _property.get)("guzzlrPlatinumDeliveries");
|
|
18
|
+
export function getPlatinum() {
|
|
19
|
+
return get("guzzlrPlatinumDeliveries");
|
|
65
20
|
}
|
|
66
21
|
/**
|
|
67
22
|
* Platinum deliveries completed today
|
|
68
23
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
function getPlatinumToday() {
|
|
72
|
-
return (0, _property.get)("_guzzlrPlatinumDeliveries");
|
|
24
|
+
export function getPlatinumToday() {
|
|
25
|
+
return get("_guzzlrPlatinumDeliveries");
|
|
73
26
|
}
|
|
74
27
|
/**
|
|
75
28
|
* Can do a platinum delivery (haven't done one today)
|
|
76
29
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
function canPlatinum() {
|
|
80
|
-
return !isQuestActive() && getGold() >= 5 && getPlatinumToday() < 1;
|
|
30
|
+
export function canPlatinum() {
|
|
31
|
+
return !isQuestActive() && getGold() >= 5 && getPlatinumToday() < 1;
|
|
81
32
|
}
|
|
82
33
|
/**
|
|
83
34
|
* Have fully unlocked the platinum delivery bonuses (done >= 30)
|
|
84
35
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
function haveFullPlatinumBonus() {
|
|
88
|
-
return getPlatinum() >= 30;
|
|
36
|
+
export function haveFullPlatinumBonus() {
|
|
37
|
+
return getPlatinum() >= 30;
|
|
89
38
|
}
|
|
90
39
|
/**
|
|
91
40
|
* Accept platinum delivery
|
|
92
41
|
*/
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return true;
|
|
42
|
+
export function acceptPlatinum() {
|
|
43
|
+
if (!canPlatinum())
|
|
44
|
+
return false;
|
|
45
|
+
useTabletWithChoice(4);
|
|
46
|
+
return true;
|
|
99
47
|
}
|
|
100
48
|
/**
|
|
101
49
|
* Gold deliveries completed overall
|
|
102
50
|
*/
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
function getGold() {
|
|
106
|
-
return (0, _property.get)("guzzlrGoldDeliveries");
|
|
51
|
+
export function getGold() {
|
|
52
|
+
return get("guzzlrGoldDeliveries");
|
|
107
53
|
}
|
|
108
54
|
/**
|
|
109
55
|
* Gold deliveries completed today
|
|
110
56
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
function getGoldToday() {
|
|
114
|
-
return (0, _property.get)("_guzzlrGoldDeliveries");
|
|
57
|
+
export function getGoldToday() {
|
|
58
|
+
return get("_guzzlrGoldDeliveries");
|
|
115
59
|
}
|
|
116
60
|
/**
|
|
117
61
|
* Can do a gold delivery (have done fewer than 3 today)
|
|
118
62
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
function canGold() {
|
|
122
|
-
return !isQuestActive() && getBronze() >= 5 && getGoldToday() < 3;
|
|
63
|
+
export function canGold() {
|
|
64
|
+
return !isQuestActive() && getBronze() >= 5 && getGoldToday() < 3;
|
|
123
65
|
}
|
|
124
66
|
/**
|
|
125
67
|
* Have fully unlocked the platinum delivery bonuses (done >= 30)
|
|
126
68
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
function haveFullGoldBonus() {
|
|
130
|
-
return getGold() >= 150;
|
|
69
|
+
export function haveFullGoldBonus() {
|
|
70
|
+
return getGold() >= 150;
|
|
131
71
|
}
|
|
132
72
|
/**
|
|
133
73
|
* Accept gold delivery
|
|
134
74
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
return true;
|
|
75
|
+
export function acceptGold() {
|
|
76
|
+
if (!canGold())
|
|
77
|
+
return false;
|
|
78
|
+
useTabletWithChoice(3);
|
|
79
|
+
return true;
|
|
141
80
|
}
|
|
142
81
|
/**
|
|
143
82
|
* Bronze deliveries completed overall
|
|
144
83
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
function getBronze() {
|
|
148
|
-
return (0, _property.get)("guzzlrBronzeDeliveries");
|
|
84
|
+
export function getBronze() {
|
|
85
|
+
return get("guzzlrBronzeDeliveries");
|
|
149
86
|
}
|
|
150
87
|
/**
|
|
151
88
|
* Accept bronze delivery
|
|
152
89
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
return true;
|
|
90
|
+
export function acceptBronze() {
|
|
91
|
+
if (isQuestActive())
|
|
92
|
+
return false;
|
|
93
|
+
useTabletWithChoice(2);
|
|
94
|
+
return true;
|
|
159
95
|
}
|
|
160
96
|
/**
|
|
161
97
|
* Have fully unlocked the platinum delivery bonuses (done >= 30)
|
|
162
98
|
*/
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
function haveFullBronzeBonus() {
|
|
166
|
-
return getBronze() >= 196;
|
|
99
|
+
export function haveFullBronzeBonus() {
|
|
100
|
+
return getBronze() >= 196;
|
|
167
101
|
}
|
|
168
102
|
/**
|
|
169
103
|
* Can abandon the current Guzzlr quest
|
|
170
104
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
function canAbandon() {
|
|
174
|
-
return isQuestActive() && !(0, _property.get)("_guzzlrQuestAbandoned");
|
|
105
|
+
export function canAbandon() {
|
|
106
|
+
return isQuestActive() && !get("_guzzlrQuestAbandoned");
|
|
175
107
|
}
|
|
176
108
|
/**
|
|
177
109
|
* Abandon Guzzlr quest
|
|
178
110
|
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return true;
|
|
111
|
+
export function abandon() {
|
|
112
|
+
if (!canAbandon())
|
|
113
|
+
return false;
|
|
114
|
+
visitUrl("inventory.php?tap=guzzlr", false);
|
|
115
|
+
runChoice(1);
|
|
116
|
+
runChoice(5);
|
|
117
|
+
return true;
|
|
187
118
|
}
|
|
188
119
|
/**
|
|
189
120
|
* Get current Guzzlr quest location
|
|
190
121
|
*/
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
function getLocation() {
|
|
194
|
-
return (0, _property.get)("guzzlrQuestLocation");
|
|
122
|
+
export function getLocation() {
|
|
123
|
+
return get("guzzlrQuestLocation");
|
|
195
124
|
}
|
|
196
125
|
/**
|
|
197
126
|
* Get current Guzzlr quest tier
|
|
198
127
|
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
var tier = (0, _property.get)("guzzlrQuestTier");
|
|
203
|
-
return tier === "" ? null : tier;
|
|
128
|
+
export function getTier() {
|
|
129
|
+
const tier = get("guzzlrQuestTier");
|
|
130
|
+
return tier === "" ? null : tier;
|
|
204
131
|
}
|
|
205
132
|
/**
|
|
206
133
|
* Get current Guzzlr quest booze
|
|
207
134
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
return Item.get(booze);
|
|
135
|
+
export function getBooze() {
|
|
136
|
+
const booze = get("guzzlrQuestBooze");
|
|
137
|
+
if (booze === "")
|
|
138
|
+
return null;
|
|
139
|
+
return Item.get(booze);
|
|
214
140
|
}
|
|
215
141
|
/**
|
|
216
142
|
* List of the platinum cocktails
|
|
217
143
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
var Cocktails = (0, _templateString.$items)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Buttery Boy, Steamboat, Ghiaccio Colada, Nog-on-the-Cob, Sourfinger"])));
|
|
144
|
+
export const Cocktails = $items `Buttery Boy, Steamboat, Ghiaccio Colada, Nog-on-the-Cob, Sourfinger`;
|
|
221
145
|
/**
|
|
222
146
|
* Returns true if the user has a platinum cocktail in their inventory
|
|
223
147
|
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
function havePlatinumBooze() {
|
|
228
|
-
return Cocktails.some(cock => (0, _lib.have)(cock));
|
|
148
|
+
export function havePlatinumBooze() {
|
|
149
|
+
return Cocktails.some((cock) => haveItem(cock));
|
|
229
150
|
}
|
|
230
151
|
/**
|
|
231
152
|
* Returns true if the user has the cocktail that they need for their current quest
|
|
232
153
|
*
|
|
233
154
|
* If they have no quest, returns false
|
|
234
155
|
*/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
default:
|
|
248
|
-
return (0, _lib.have)(booze);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
156
|
+
export function haveBooze() {
|
|
157
|
+
const booze = getBooze();
|
|
158
|
+
switch (booze) {
|
|
159
|
+
case null:
|
|
160
|
+
return false;
|
|
161
|
+
case $item `Guzzlr cocktail set`:
|
|
162
|
+
return havePlatinumBooze();
|
|
163
|
+
default:
|
|
164
|
+
return haveItem(booze);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -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 { countedMapToArray } 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]) => getSaleValue(...countedMapToArray(itemMap))) ?? [null])[0];
|
|
66
|
+
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import * as Bandersnatch from "./2009/Bandersnatch";
|
|
2
|
+
import * as BeachComb from "./2019/BeachComb";
|
|
3
|
+
import * as ChateauMantegna from "./2015/ChateauMantegna";
|
|
4
|
+
import * as CrownOfThrones from "./2010/CrownOfThrones";
|
|
5
|
+
import * as FloristFriar from "./2013/Florist";
|
|
6
|
+
import * as Guzzlr from "./2020/Guzzlr";
|
|
7
|
+
import * as MayoClinic from "./2015/MayoClinic";
|
|
8
|
+
import * as ObtuseAngel from "./2011/ObtuseAngel";
|
|
9
|
+
import * as RainDoh from "./2012/RainDoh";
|
|
10
|
+
import * as Snapper from "./2019/Snapper";
|
|
11
|
+
import * as SongBoom from "./2018/SongBoom";
|
|
12
|
+
import * as SourceTerminal from "./2016/SourceTerminal";
|
|
13
|
+
import * as SpookyPutty from "./2009/SpookyPutty";
|
|
14
|
+
import * as TunnelOfLove from "./2017/TunnelOfLove";
|
|
15
|
+
import * as WinterGarden from "./2014/WinterGarden";
|
|
16
|
+
import * as Witchess from "./2016/Witchess";
|
|
17
|
+
export { Bandersnatch, BeachComb, ChateauMantegna, CrownOfThrones, FloristFriar, Guzzlr, MayoClinic, ObtuseAngel, RainDoh, SongBoom, SourceTerminal, Snapper, SpookyPutty, TunnelOfLove, WinterGarden, Witchess, };
|
|
12
18
|
export * from "./putty-likes";
|
|
19
|
+
export * from "./LibramSummon";
|
package/dist/resources/index.js
CHANGED
|
@@ -1,85 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Witchess: true,
|
|
21
|
-
Guzzlr: true
|
|
22
|
-
};
|
|
23
|
-
exports.Guzzlr = exports.Witchess = exports.WinterGarden = exports.TunnelOfLove = exports.SpookyPutty = exports.SourceTerminal = exports.SongBoom = exports.RainDoh = exports.ObtuseAngel = exports.ChateauMantegna = exports.Bandersnatch = void 0;
|
|
24
|
-
|
|
25
|
-
var _Bandersnatch = _interopRequireWildcard(require("./2009/Bandersnatch"));
|
|
26
|
-
|
|
27
|
-
exports.Bandersnatch = _Bandersnatch;
|
|
28
|
-
|
|
29
|
-
var _ChateauMantegna = _interopRequireWildcard(require("./2015/ChateauMantegna"));
|
|
30
|
-
|
|
31
|
-
exports.ChateauMantegna = _ChateauMantegna;
|
|
32
|
-
|
|
33
|
-
var _ObtuseAngel = _interopRequireWildcard(require("./2011/ObtuseAngel"));
|
|
34
|
-
|
|
35
|
-
exports.ObtuseAngel = _ObtuseAngel;
|
|
36
|
-
|
|
37
|
-
var _RainDoh = _interopRequireWildcard(require("./2012/RainDoh"));
|
|
38
|
-
|
|
39
|
-
exports.RainDoh = _RainDoh;
|
|
40
|
-
|
|
41
|
-
var _SongBoom = _interopRequireWildcard(require("./2018/SongBoom"));
|
|
42
|
-
|
|
43
|
-
exports.SongBoom = _SongBoom;
|
|
44
|
-
|
|
45
|
-
var _SourceTerminal = _interopRequireWildcard(require("./2016/SourceTerminal"));
|
|
46
|
-
|
|
47
|
-
exports.SourceTerminal = _SourceTerminal;
|
|
48
|
-
|
|
49
|
-
var _SpookyPutty = _interopRequireWildcard(require("./2009/SpookyPutty"));
|
|
50
|
-
|
|
51
|
-
exports.SpookyPutty = _SpookyPutty;
|
|
52
|
-
|
|
53
|
-
var _TunnelOfLove = _interopRequireWildcard(require("./2017/TunnelOfLove"));
|
|
54
|
-
|
|
55
|
-
exports.TunnelOfLove = _TunnelOfLove;
|
|
56
|
-
|
|
57
|
-
var _WinterGarden = _interopRequireWildcard(require("./2014/WinterGarden"));
|
|
58
|
-
|
|
59
|
-
exports.WinterGarden = _WinterGarden;
|
|
60
|
-
|
|
61
|
-
var _Witchess = _interopRequireWildcard(require("./2016/Witchess"));
|
|
62
|
-
|
|
63
|
-
exports.Witchess = _Witchess;
|
|
64
|
-
|
|
65
|
-
var _Guzzlr = _interopRequireWildcard(require("./2020/Guzzlr"));
|
|
66
|
-
|
|
67
|
-
exports.Guzzlr = _Guzzlr;
|
|
68
|
-
|
|
69
|
-
var _puttyLikes = require("./putty-likes");
|
|
70
|
-
|
|
71
|
-
Object.keys(_puttyLikes).forEach(function (key) {
|
|
72
|
-
if (key === "default" || key === "__esModule") return;
|
|
73
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
74
|
-
if (key in exports && exports[key] === _puttyLikes[key]) return;
|
|
75
|
-
Object.defineProperty(exports, key, {
|
|
76
|
-
enumerable: true,
|
|
77
|
-
get: function get() {
|
|
78
|
-
return _puttyLikes[key];
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
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); }
|
|
84
|
-
|
|
85
|
-
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 Bandersnatch from "./2009/Bandersnatch";
|
|
2
|
+
import * as BeachComb from "./2019/BeachComb";
|
|
3
|
+
import * as ChateauMantegna from "./2015/ChateauMantegna";
|
|
4
|
+
import * as CrownOfThrones from "./2010/CrownOfThrones";
|
|
5
|
+
import * as FloristFriar from "./2013/Florist";
|
|
6
|
+
import * as Guzzlr from "./2020/Guzzlr";
|
|
7
|
+
import * as MayoClinic from "./2015/MayoClinic";
|
|
8
|
+
import * as ObtuseAngel from "./2011/ObtuseAngel";
|
|
9
|
+
import * as RainDoh from "./2012/RainDoh";
|
|
10
|
+
import * as Snapper from "./2019/Snapper";
|
|
11
|
+
import * as SongBoom from "./2018/SongBoom";
|
|
12
|
+
import * as SourceTerminal from "./2016/SourceTerminal";
|
|
13
|
+
import * as SpookyPutty from "./2009/SpookyPutty";
|
|
14
|
+
import * as TunnelOfLove from "./2017/TunnelOfLove";
|
|
15
|
+
import * as WinterGarden from "./2014/WinterGarden";
|
|
16
|
+
import * as Witchess from "./2016/Witchess";
|
|
17
|
+
export { Bandersnatch, BeachComb, ChateauMantegna, CrownOfThrones, FloristFriar, Guzzlr, MayoClinic, ObtuseAngel, RainDoh, SongBoom, SourceTerminal, Snapper, SpookyPutty, TunnelOfLove, WinterGarden, Witchess, };
|
|
18
|
+
export * from "./putty-likes";
|
|
19
|
+
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
|
+
}
|