libram 0.4.1 → 0.4.5
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 +271 -485
- package/dist/Copier.js +15 -48
- package/dist/Dungeon.js +77 -157
- package/dist/Kmail.d.ts +3 -1
- package/dist/Kmail.js +99 -244
- package/dist/Path.js +77 -120
- package/dist/ascend.js +153 -172
- package/dist/combat.d.ts +98 -3
- package/dist/combat.js +349 -387
- package/dist/console.js +13 -36
- package/dist/diet/index.d.ts +32 -8
- package/dist/diet/index.js +420 -426
- package/dist/diet/knapsack.d.ts +1 -1
- package/dist/diet/knapsack.js +104 -100
- 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 +92 -99
- package/dist/index.d.ts +5 -1
- package/dist/index.js +22 -300
- package/dist/lib.d.ts +4 -0
- package/dist/lib.js +284 -515
- package/dist/logger.js +21 -63
- package/dist/maximize.js +289 -562
- package/dist/modifier.js +35 -46
- package/dist/modifierTypes.js +8 -22
- package/dist/mood.d.ts +5 -0
- package/dist/mood.js +268 -551
- package/dist/property.d.ts +2 -0
- package/dist/property.js +100 -242
- package/dist/propertyTypes.d.ts +5 -4
- 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 +9 -0
- package/dist/resources/2010/CrownOfThrones.js +550 -374
- 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 +142 -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 +5 -1
- package/dist/resources/index.js +21 -105
- package/dist/resources/putty-likes.js +15 -30
- 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 +5 -0
- package/dist/utils.js +47 -134
- package/package.json +15 -9
|
@@ -0,0 +1,33 @@
|
|
|
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 Taffy`;
|
|
5
|
+
/**
|
|
6
|
+
* @returns true if the player can Summon Taffy
|
|
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 rareSummons = get("_taffyRareSummons");
|
|
16
|
+
const yellowSummons = get("_taffyYellowSummons");
|
|
17
|
+
const onlyYellow = yellowSummons === 0 && rareSummons === 3;
|
|
18
|
+
const totalRareChance = rareSummons < 4 ? 1.0 / 2 ** (rareSummons + 1) : 0.0;
|
|
19
|
+
const commonChance = (1.0 - totalRareChance) / 4;
|
|
20
|
+
const rareChance = onlyYellow
|
|
21
|
+
? 0.0
|
|
22
|
+
: totalRareChance / (3 - get("_taffyYellowSummons"));
|
|
23
|
+
const yellowChance = yellowSummons === 1 ? 0.0 : onlyYellow ? totalRareChance : rareChance;
|
|
24
|
+
return new Map([
|
|
25
|
+
[$item `pulled blue taffy`, commonChance],
|
|
26
|
+
[$item `pulled orange taffy`, commonChance],
|
|
27
|
+
[$item `pulled violet taffy`, commonChance],
|
|
28
|
+
[$item `pulled red taffy`, commonChance],
|
|
29
|
+
[$item `pulled indigo taffy`, rareChance],
|
|
30
|
+
[$item `pulled green taffy`, rareChance],
|
|
31
|
+
[$item `pulled yellow taffy`, yellowChance],
|
|
32
|
+
]);
|
|
33
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checks if you have DNA lab in inventory or installed
|
|
3
|
+
*/
|
|
4
|
+
export declare function have(): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Checks if you have DNA lab installed
|
|
7
|
+
*/
|
|
8
|
+
export declare function installed(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Tells you whether you are currently hybridized. When passed with an input of any sort, tells you whether you are currently hybridized with that effect.
|
|
11
|
+
* @param tonic Optional input. When passed, the function returns whether that specific effect is hybridized.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isHybridized(tonic?: Effect | Phylum | Item): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Returns the tonic item associated with a particular phylum.
|
|
16
|
+
* @param phylum The phylum in question.
|
|
17
|
+
* @returns The tonic item associated with that phylum; returns $item`none` for $phylum`none`.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getTonic(phylum: Phylum): Item;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the tonic effect associated with a particular phylum.
|
|
22
|
+
* @param phylum The phylum in question.
|
|
23
|
+
* @returns The tonic effect associated with that phylum; returns $effect`none` for $phylum`none`.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getEffect(phylum: Phylum): Effect;
|
|
26
|
+
/**
|
|
27
|
+
* Tells you which phylum to hunt down for a given effect or item.
|
|
28
|
+
* @param dnatype The tonic effect or item in question
|
|
29
|
+
* @returns The Phylum associated with that effect or item; null if an invalid choice
|
|
30
|
+
*/
|
|
31
|
+
export declare function phylumFor(dnatype: Effect | Item): Phylum | null;
|
|
32
|
+
/**
|
|
33
|
+
* Hybridize yourself with the current contents of your syringe, if possible.
|
|
34
|
+
* @returns Whether or not we succeeded
|
|
35
|
+
*/
|
|
36
|
+
export declare function hybridize(): boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Makes tonics with whatever phylum is currently in your syringe
|
|
39
|
+
* @param {number} [amount=1] the number of tonics to make
|
|
40
|
+
* @returns Whether we successfully made tonics; returns true if we made as many as we could, regardless of whether that was the number requested
|
|
41
|
+
*/
|
|
42
|
+
export declare function makeTonic(amount?: 1 | 2 | 3): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Tells you how many tonics you can make the rest of the day.
|
|
45
|
+
* @returns The remaining tonics you can make
|
|
46
|
+
*/
|
|
47
|
+
export declare function tonicsLeft(): number;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { cliExecute, getWorkshed, haveEffect, itemAmount } from "kolmafia";
|
|
2
|
+
import { $effect, $item, $phylum } from "../../template-string";
|
|
3
|
+
import { have as haveItem } from "../../lib";
|
|
4
|
+
import { get } from "../../property";
|
|
5
|
+
import { get as getModifier } from "../../modifier";
|
|
6
|
+
import { clamp } from "../../utils";
|
|
7
|
+
const lab = $item `Little Geneticist DNA-Splicing Lab`;
|
|
8
|
+
/**
|
|
9
|
+
* Checks if you have DNA lab in inventory or installed
|
|
10
|
+
*/
|
|
11
|
+
export function have() {
|
|
12
|
+
return haveItem(lab) || getWorkshed() === lab;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks if you have DNA lab installed
|
|
16
|
+
*/
|
|
17
|
+
export function installed() {
|
|
18
|
+
return getWorkshed() === lab;
|
|
19
|
+
}
|
|
20
|
+
const phylaEffects = new Map([
|
|
21
|
+
[$phylum `beast`, $effect `Human-Beast Hybrid`],
|
|
22
|
+
[$phylum `bug`, $effect `Human-Insect Hybrid`],
|
|
23
|
+
[$phylum `constellation`, $effect `Human-Constellation Hybrid`],
|
|
24
|
+
[$phylum `construct`, $effect `Human-Machine Hybrid`],
|
|
25
|
+
[$phylum `demon`, $effect `Human-Demon Hybrid`],
|
|
26
|
+
[$phylum `dude`, $effect `Human-Human Hybrid`],
|
|
27
|
+
[$phylum `elemental`, $effect `Human-Elemental Hybrid`],
|
|
28
|
+
[$phylum `elf`, $effect `Human-Elf Hybrid`],
|
|
29
|
+
[$phylum `fish`, $effect `Human-Fish Hybrid`],
|
|
30
|
+
[$phylum `goblin`, $effect `Human-Goblin Hybrid`],
|
|
31
|
+
[$phylum `hippy`, $effect `Human-Hobo Hybrid`],
|
|
32
|
+
[$phylum `horror`, $effect `Human-Horror Hybrid`],
|
|
33
|
+
[$phylum `humanoid`, $effect `Human-Humanoid Hybrid`],
|
|
34
|
+
[$phylum `mer-kin`, $effect `Human-Mer-kin Hybrid`],
|
|
35
|
+
[$phylum `orc`, $effect `Human-Orc Hybrid`],
|
|
36
|
+
[$phylum `penguin`, $effect `Human-Penguin Hybrid`],
|
|
37
|
+
[$phylum `pirate`, $effect `Human-Pirate Hybrid`],
|
|
38
|
+
[$phylum `plant`, $effect `Human-Plant Hybrid`],
|
|
39
|
+
[$phylum `slime`, $effect `Human-Slime Hybrid`],
|
|
40
|
+
[$phylum `undead`, $effect `Human-Undead Hybrid`],
|
|
41
|
+
[$phylum `weird`, $effect `Human-Weird Thing Hybrid`],
|
|
42
|
+
]);
|
|
43
|
+
const phylaTonics = new Map([
|
|
44
|
+
[$phylum `beast`, $item `Gene Tonic: Beast`],
|
|
45
|
+
[$phylum `bug`, $item `Gene Tonic: Insect`],
|
|
46
|
+
[$phylum `constellation`, $item `Gene Tonic: Constellation`],
|
|
47
|
+
[$phylum `construct`, $item `Gene Tonic: Construct`],
|
|
48
|
+
[$phylum `demon`, $item `Gene Tonic: Demon`],
|
|
49
|
+
[$phylum `dude`, $item `Gene Tonic: Humanoid`],
|
|
50
|
+
[$phylum `elemental`, $item `Gene Tonic: Elemental`],
|
|
51
|
+
[$phylum `elf`, $item `Gene Tonic: Elf`],
|
|
52
|
+
[$phylum `fish`, $item `Gene Tonic: Fish`],
|
|
53
|
+
[$phylum `goblin`, $item `Gene Tonic: Goblin`],
|
|
54
|
+
[$phylum `hippy`, $item `Gene Tonic: Hobo`],
|
|
55
|
+
[$phylum `horror`, $item `Gene Tonic: Horror`],
|
|
56
|
+
[$phylum `humanoid`, $item `Gene Tonic: Humanoid`],
|
|
57
|
+
[$phylum `mer-kin`, $item `Gene Tonic: Mer-kin`],
|
|
58
|
+
[$phylum `orc`, $item `Gene Tonic: Orc`],
|
|
59
|
+
[$phylum `penguin`, $item `Gene Tonic: Penguin`],
|
|
60
|
+
[$phylum `pirate`, $item `Gene Tonic: Pirate`],
|
|
61
|
+
[$phylum `plant`, $item `Gene Tonic: Plant`],
|
|
62
|
+
[$phylum `slime`, $item `Gene Tonic: Slime`],
|
|
63
|
+
[$phylum `undead`, $item `Gene Tonic: Undead`],
|
|
64
|
+
[$phylum `weird`, $item `Gene Tonic: Weird`],
|
|
65
|
+
]);
|
|
66
|
+
const tonicEffects = Array.from(phylaEffects.values());
|
|
67
|
+
/**
|
|
68
|
+
* Tells you whether you are currently hybridized. When passed with an input of any sort, tells you whether you are currently hybridized with that effect.
|
|
69
|
+
* @param tonic Optional input. When passed, the function returns whether that specific effect is hybridized.
|
|
70
|
+
*/
|
|
71
|
+
export function isHybridized(tonic) {
|
|
72
|
+
if (!tonic)
|
|
73
|
+
return installed() && get("_dnaHybrid");
|
|
74
|
+
const tonicEffect = tonic instanceof Effect
|
|
75
|
+
? tonic
|
|
76
|
+
: tonic instanceof Phylum
|
|
77
|
+
? getEffect(tonic)
|
|
78
|
+
: getModifier("Effect", tonic);
|
|
79
|
+
return (tonicEffects.includes(tonicEffect) && haveEffect(tonicEffect) === 2147483647);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Returns the tonic item associated with a particular phylum.
|
|
83
|
+
* @param phylum The phylum in question.
|
|
84
|
+
* @returns The tonic item associated with that phylum; returns $item`none` for $phylum`none`.
|
|
85
|
+
*/
|
|
86
|
+
export function getTonic(phylum) {
|
|
87
|
+
return phylaTonics.get(phylum) ?? $item `none`;
|
|
88
|
+
//return $item`none` rather than null because it should never happen.
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns the tonic effect associated with a particular phylum.
|
|
92
|
+
* @param phylum The phylum in question.
|
|
93
|
+
* @returns The tonic effect associated with that phylum; returns $effect`none` for $phylum`none`.
|
|
94
|
+
*/
|
|
95
|
+
export function getEffect(phylum) {
|
|
96
|
+
return phylaEffects.get(phylum) ?? $effect `none`;
|
|
97
|
+
//return $effect`none` rather than null because it should never happen
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Tells you which phylum to hunt down for a given effect or item.
|
|
101
|
+
* @param dnatype The tonic effect or item in question
|
|
102
|
+
* @returns The Phylum associated with that effect or item; null if an invalid choice
|
|
103
|
+
*/
|
|
104
|
+
export function phylumFor(dnatype) {
|
|
105
|
+
if (dnatype instanceof Effect) {
|
|
106
|
+
const phylumPair = Array.from(phylaEffects.entries()).find(([, effect]) => effect === dnatype);
|
|
107
|
+
return phylumPair ? phylumPair[0] : null;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
const phylumPair = Array.from(phylaTonics.entries()).find(([, tonic]) => tonic === dnatype);
|
|
111
|
+
return phylumPair ? phylumPair[0] : null;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Hybridize yourself with the current contents of your syringe, if possible.
|
|
116
|
+
* @returns Whether or not we succeeded
|
|
117
|
+
*/
|
|
118
|
+
export function hybridize() {
|
|
119
|
+
if (get("_dnaHybrid"))
|
|
120
|
+
return false;
|
|
121
|
+
if (!installed())
|
|
122
|
+
return false;
|
|
123
|
+
const currentSyringe = get("dnaSyringe");
|
|
124
|
+
if (!currentSyringe)
|
|
125
|
+
return false;
|
|
126
|
+
const tonicPotion = getTonic(currentSyringe);
|
|
127
|
+
const expectedEffect = getModifier("Effect", tonicPotion);
|
|
128
|
+
cliExecute("camp dnainject");
|
|
129
|
+
return isHybridized(expectedEffect);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Makes tonics with whatever phylum is currently in your syringe
|
|
133
|
+
* @param {number} [amount=1] the number of tonics to make
|
|
134
|
+
* @returns Whether we successfully made tonics; returns true if we made as many as we could, regardless of whether that was the number requested
|
|
135
|
+
*/
|
|
136
|
+
export function makeTonic(amount = 1) {
|
|
137
|
+
if (!installed())
|
|
138
|
+
return false;
|
|
139
|
+
const currentSyringe = get("dnaSyringe");
|
|
140
|
+
if (!currentSyringe)
|
|
141
|
+
return false;
|
|
142
|
+
const tonicPotion = getTonic(currentSyringe);
|
|
143
|
+
const amountToMake = clamp(amount, 0, tonicsLeft());
|
|
144
|
+
const startingAmount = itemAmount(tonicPotion);
|
|
145
|
+
cliExecute(`camp dnapotion ${amountToMake}`);
|
|
146
|
+
return itemAmount(tonicPotion) - startingAmount === amountToMake;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Tells you how many tonics you can make the rest of the day.
|
|
150
|
+
* @returns The remaining tonics you can make
|
|
151
|
+
*/
|
|
152
|
+
export function tonicsLeft() {
|
|
153
|
+
return clamp(3 - get("_dnaPotionsMade"), 0, 3);
|
|
154
|
+
}
|
|
@@ -1,48 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.have = have;
|
|
9
|
-
exports.haveUnfinishedIceSculpture = haveUnfinishedIceSculpture;
|
|
10
|
-
exports.isUnfinishedIceSculptureUsed = isUnfinishedIceSculptureUsed;
|
|
11
|
-
exports.couldUseUnfinishedIceSculpture = couldUseUnfinishedIceSculpture;
|
|
12
|
-
exports.getUnfinishedIceSculptureMonster = getUnfinishedIceSculptureMonster;
|
|
13
|
-
exports.UnfinishedIceSculpture = void 0;
|
|
14
|
-
|
|
15
|
-
var _Copier = require("../../Copier");
|
|
16
|
-
|
|
17
|
-
var _property = require("../../property");
|
|
18
|
-
|
|
19
|
-
var _lib = require("../../lib");
|
|
20
|
-
|
|
21
|
-
var _templateString = require("../../template-string");
|
|
22
|
-
|
|
23
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
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
|
-
function have() {
|
|
28
|
-
return (0, _lib.haveInCampground)((0, _templateString.$item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["packet of winter seeds"]))));
|
|
1
|
+
import { Copier } from "../../Copier";
|
|
2
|
+
import { get } from "../../property";
|
|
3
|
+
import { haveInCampground, have as haveItem } from "../../lib";
|
|
4
|
+
import { $item } from "../../template-string";
|
|
5
|
+
export function have() {
|
|
6
|
+
return haveInCampground($item `packet of winter seeds`);
|
|
29
7
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return (0, _lib.have)((0, _templateString.$item)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["unfinished ice sculpture"]))));
|
|
8
|
+
export function haveUnfinishedIceSculpture() {
|
|
9
|
+
return haveItem($item `unfinished ice sculpture`);
|
|
33
10
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
return (0, _property.get)("_iceSculptureUsed");
|
|
11
|
+
export function isUnfinishedIceSculptureUsed() {
|
|
12
|
+
return get("_iceSculptureUsed");
|
|
37
13
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
return (0, _lib.have)((0, _templateString.$item)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["unfinished ice sculpture"])))) && !(0, _lib.have)((0, _templateString.$item)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["ice sculpture"]))));
|
|
14
|
+
export function couldUseUnfinishedIceSculpture() {
|
|
15
|
+
return (haveItem($item `unfinished ice sculpture`) && !haveItem($item `ice sculpture`));
|
|
41
16
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return (0, _property.get)("iceSculptureMonster");
|
|
17
|
+
export function getUnfinishedIceSculptureMonster() {
|
|
18
|
+
return get("iceSculptureMonster");
|
|
45
19
|
}
|
|
46
|
-
|
|
47
|
-
var UnfinishedIceSculpture = new _Copier.Copier(() => couldUseUnfinishedIceSculpture(), null, () => couldUseUnfinishedIceSculpture(), () => getUnfinishedIceSculptureMonster());
|
|
48
|
-
exports.UnfinishedIceSculpture = UnfinishedIceSculpture;
|
|
20
|
+
export const UnfinishedIceSculpture = new Copier(() => couldUseUnfinishedIceSculpture(), null, () => couldUseUnfinishedIceSculpture(), () => getUnfinishedIceSculptureMonster());
|
|
@@ -1,87 +1,53 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
import { buy, getChateau, runCombat, visitUrl } from "kolmafia";
|
|
2
|
+
import { $item, $items } from "../../template-string";
|
|
3
|
+
import { get } from "../../property";
|
|
4
|
+
export function have() {
|
|
5
|
+
return get("chateauAvailable");
|
|
6
|
+
}
|
|
7
|
+
export function paintingMonster() {
|
|
8
|
+
return get("chateauMonster");
|
|
9
|
+
}
|
|
10
|
+
export function paintingFought() {
|
|
11
|
+
return get("_chateauMonsterFought");
|
|
12
|
+
}
|
|
13
|
+
export function fightPainting() {
|
|
14
|
+
visitUrl("place.php?whichplace=chateau&action=chateau_painting", false);
|
|
15
|
+
return runCombat();
|
|
16
|
+
}
|
|
17
|
+
const desks = $items `fancy stationery set, Swiss piggy bank, continental juice bar`;
|
|
18
|
+
const ceilings = $items `antler chandelier, ceiling fan, artificial skylight`;
|
|
19
|
+
const nightstands = $items `foreign language tapes, bowl of potpourri, electric muscle stimulator`;
|
|
20
|
+
export function getDesk() {
|
|
21
|
+
return (desks.find((desk) => Object.keys(getChateau()).includes(desk.name)) ||
|
|
22
|
+
$item `none`);
|
|
23
|
+
}
|
|
24
|
+
export function getCeiling() {
|
|
25
|
+
return (ceilings.find((ceiling) => Object.keys(getChateau()).includes(ceiling.name)) || $item `none`);
|
|
26
|
+
}
|
|
27
|
+
export function getNightstand() {
|
|
28
|
+
return (nightstands.find((nightstand) => Object.keys(getChateau()).includes(nightstand.name)) || $item `none`);
|
|
29
|
+
}
|
|
30
|
+
export function changeDesk(desk) {
|
|
31
|
+
if (getDesk() === desk)
|
|
32
|
+
return true;
|
|
33
|
+
if (!desks.includes(desk))
|
|
34
|
+
return false;
|
|
35
|
+
buy(desk);
|
|
36
|
+
return getDesk() === desk;
|
|
37
|
+
}
|
|
38
|
+
export function changeCeiling(ceiling) {
|
|
39
|
+
if (getCeiling() === ceiling)
|
|
40
|
+
return true;
|
|
41
|
+
if (!ceilings.includes(ceiling))
|
|
42
|
+
return false;
|
|
43
|
+
buy(ceiling);
|
|
44
|
+
return getCeiling() === ceiling;
|
|
45
|
+
}
|
|
46
|
+
export function changeNightstand(nightstand) {
|
|
47
|
+
if (getNightstand() === nightstand)
|
|
48
|
+
return true;
|
|
49
|
+
if (!nightstands.includes(nightstand))
|
|
50
|
+
return false;
|
|
51
|
+
buy(nightstand);
|
|
52
|
+
return getNightstand() === nightstand;
|
|
37
53
|
}
|
|
38
|
-
|
|
39
|
-
function paintingMonster() {
|
|
40
|
-
return (0, _property.get)("chateauMonster");
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function paintingFought() {
|
|
44
|
-
return (0, _property.get)("_chateauMonsterFought");
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function fightPainting() {
|
|
48
|
-
(0, _kolmafia.visitUrl)("place.php?whichplace=chateau&action=chateau_painting", false);
|
|
49
|
-
return (0, _kolmafia.runCombat)();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
var desks = (0, _templateString.$items)(_templateObject || (_templateObject = _taggedTemplateLiteral(["fancy stationery set, Swiss piggy bank, continental juice bar"])));
|
|
53
|
-
var ceilings = (0, _templateString.$items)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["antler chandelier, ceiling fan, artificial skylight"])));
|
|
54
|
-
var nightstands = (0, _templateString.$items)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["foreign language tapes, bowl of potpourri, electric muscle stimulator"])));
|
|
55
|
-
|
|
56
|
-
function getDesk() {
|
|
57
|
-
return desks.find(desk => Object.keys((0, _kolmafia.getChateau)()).includes(desk.name)) || (0, _templateString.$item)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["none"])));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function getCeiling() {
|
|
61
|
-
return ceilings.find(ceiling => Object.keys((0, _kolmafia.getChateau)()).includes(ceiling.name)) || (0, _templateString.$item)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["none"])));
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function getNightstand() {
|
|
65
|
-
return nightstands.find(nightstand => Object.keys((0, _kolmafia.getChateau)()).includes(nightstand.name)) || (0, _templateString.$item)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["none"])));
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function changeDesk(desk) {
|
|
69
|
-
if (getDesk() === desk) return true;
|
|
70
|
-
if (!desks.includes(desk)) return false;
|
|
71
|
-
(0, _kolmafia.buy)(desk);
|
|
72
|
-
return getDesk() === desk;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function changeCeiling(ceiling) {
|
|
76
|
-
if (getCeiling() === ceiling) return true;
|
|
77
|
-
if (!ceilings.includes(ceiling)) return false;
|
|
78
|
-
(0, _kolmafia.buy)(ceiling);
|
|
79
|
-
return getCeiling() === ceiling;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function changeNightstand(nightstand) {
|
|
83
|
-
if (getNightstand() === nightstand) return true;
|
|
84
|
-
if (!nightstands.includes(nightstand)) return false;
|
|
85
|
-
(0, _kolmafia.buy)(nightstand);
|
|
86
|
-
return getNightstand() === nightstand;
|
|
87
|
-
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import "core-js/modules/es.object.values";
|
|
1
2
|
export declare const Mayo: {
|
|
2
3
|
nex: Item;
|
|
3
4
|
diol: Item;
|
|
4
5
|
zapine: Item;
|
|
5
6
|
flex: Item;
|
|
6
7
|
};
|
|
8
|
+
export declare function installed(): boolean;
|
|
9
|
+
export declare function have(): boolean;
|
|
7
10
|
/**
|
|
8
11
|
* Sets mayo minder to a particular mayo, and ensures you have enough of it.
|
|
9
12
|
* @param mayo Mayo to use
|
|
@@ -1,71 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/es.string.includes.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.object.values.js");
|
|
16
|
-
|
|
17
|
-
var _kolmafia = require("kolmafia");
|
|
18
|
-
|
|
19
|
-
var _lib = require("../../lib");
|
|
20
|
-
|
|
21
|
-
var _logger = _interopRequireDefault(require("../../logger"));
|
|
22
|
-
|
|
23
|
-
var _property = require("../../property");
|
|
24
|
-
|
|
25
|
-
var _templateString = require("../../template-string");
|
|
26
|
-
|
|
27
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8;
|
|
28
|
-
|
|
29
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
30
|
-
|
|
31
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
32
|
-
|
|
33
|
-
var Mayo = {
|
|
34
|
-
nex: (0, _templateString.$item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["Mayonex"]))),
|
|
35
|
-
diol: (0, _templateString.$item)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Mayodiol"]))),
|
|
36
|
-
zapine: (0, _templateString.$item)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Mayozapine"]))),
|
|
37
|
-
flex: (0, _templateString.$item)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Mayoflex"])))
|
|
1
|
+
import "core-js/modules/es.object.values";
|
|
2
|
+
import { buy, getWorkshed, retrieveItem, toInt, use } from "kolmafia";
|
|
3
|
+
import { have as haveItem } from "../../lib";
|
|
4
|
+
import logger from "../../logger";
|
|
5
|
+
import { get, withChoice } from "../../property";
|
|
6
|
+
import { $item } from "../../template-string";
|
|
7
|
+
export const Mayo = {
|
|
8
|
+
nex: $item `Mayonex`,
|
|
9
|
+
diol: $item `Mayodiol`,
|
|
10
|
+
zapine: $item `Mayozapine`,
|
|
11
|
+
flex: $item `Mayoflex`,
|
|
38
12
|
};
|
|
13
|
+
export function installed() {
|
|
14
|
+
return getWorkshed() === $item `portable Mayo Clinic`;
|
|
15
|
+
}
|
|
16
|
+
export function have() {
|
|
17
|
+
return haveItem($item `portable Mayo Clinic`) || installed();
|
|
18
|
+
}
|
|
39
19
|
/**
|
|
40
20
|
* Sets mayo minder to a particular mayo, and ensures you have enough of it.
|
|
41
21
|
* @param mayo Mayo to use
|
|
42
22
|
* @param quantity Quantity to ensure
|
|
43
23
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
(0, _kolmafia.retrieveItem)(quantity, mayo);
|
|
64
|
-
if (!(0, _lib.have)((0, _templateString.$item)(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["Mayo Minder\u2122"]))))) (0, _kolmafia.buy)((0, _templateString.$item)(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["Mayo Minder\u2122"]))));
|
|
65
|
-
|
|
66
|
-
if ((0, _property.get)("mayoMinderSetting") !== mayo.name) {
|
|
67
|
-
(0, _property.withChoice)(1076, (0, _kolmafia.toInt)(mayo) - 8260, () => (0, _kolmafia.use)((0, _templateString.$item)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["Mayo Minder\u2122"])))));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return (0, _property.get)("mayoMinderSetting") === mayo.name;
|
|
71
|
-
}
|
|
24
|
+
export function setMayoMinder(mayo, quantity = 1) {
|
|
25
|
+
if (getWorkshed() !== $item `portable Mayo Clinic`)
|
|
26
|
+
return false;
|
|
27
|
+
if (!Object.values(Mayo).includes(mayo)) {
|
|
28
|
+
logger.error("Invalid mayo selected");
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
if (get("mayoInMouth") && get("mayoInMouth") !== mayo.name) {
|
|
32
|
+
logger.error("Currently have incorrect mayo in mouth");
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
retrieveItem(quantity, mayo);
|
|
36
|
+
if (!haveItem($item `Mayo Minder™`))
|
|
37
|
+
buy($item `Mayo Minder™`);
|
|
38
|
+
if (get("mayoMinderSetting") !== mayo.name) {
|
|
39
|
+
withChoice(1076, toInt(mayo) - 8260, () => use($item `Mayo Minder™`));
|
|
40
|
+
}
|
|
41
|
+
return get("mayoMinderSetting") === mayo.name;
|
|
42
|
+
}
|