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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { $item, $skill } from "../../template-string";
|
|
2
|
+
import { have as _have } from "../../lib";
|
|
3
|
+
export const summonSkill = $skill `Summon Dice`;
|
|
4
|
+
const libramChance = 1.0 / 6;
|
|
5
|
+
const libramExpected = new Map([
|
|
6
|
+
[$item `d4`, libramChance],
|
|
7
|
+
[$item `d6`, libramChance],
|
|
8
|
+
[$item `d8`, libramChance],
|
|
9
|
+
[$item `d10`, libramChance],
|
|
10
|
+
[$item `d12`, libramChance],
|
|
11
|
+
[$item `d20`, libramChance],
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* @returns true if the player can Summon Dice
|
|
15
|
+
*/
|
|
16
|
+
export function have() {
|
|
17
|
+
return _have(summonSkill);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @returns map containing the chance of an item to be summoned
|
|
21
|
+
*/
|
|
22
|
+
export function expected() {
|
|
23
|
+
return libramExpected;
|
|
24
|
+
}
|
|
@@ -1,91 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
exports.have = have;
|
|
9
|
-
exports.getBadlyRomanticArrowUses = getBadlyRomanticArrowUses;
|
|
10
|
-
exports.haveBadlyRomanticArrowUsesRemaining = haveBadlyRomanticArrowUsesRemaining;
|
|
11
|
-
exports.couldUseBadlyRomanticArrow = couldUseBadlyRomanticArrow;
|
|
12
|
-
exports.prepareBadlyRomanticArrow = prepareBadlyRomanticArrow;
|
|
13
|
-
exports.canUseBadlyRomanticArrow = canUseBadlyRomanticArrow;
|
|
14
|
-
exports.getBadlyRomanticArrowMonster = getBadlyRomanticArrowMonster;
|
|
15
|
-
exports.BadlyRomanticArrow = exports.familiar = void 0;
|
|
16
|
-
|
|
17
|
-
var _kolmafia = require("kolmafia");
|
|
18
|
-
|
|
19
|
-
var _Copier = require("../../Copier");
|
|
20
|
-
|
|
21
|
-
var _lib = require("../../lib");
|
|
22
|
-
|
|
23
|
-
var _property = require("../../property");
|
|
24
|
-
|
|
25
|
-
var _templateString = require("../../template-string");
|
|
26
|
-
|
|
27
|
-
var _templateObject;
|
|
28
|
-
|
|
29
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
30
|
-
|
|
31
|
-
var familiar = (0, _templateString.$familiar)(_templateObject || (_templateObject = _taggedTemplateLiteral(["Obtuse Angel"])));
|
|
1
|
+
import { useFamiliar } from "kolmafia";
|
|
2
|
+
import { Copier } from "../../Copier";
|
|
3
|
+
import { have as _have, isCurrentFamiliar } from "../../lib";
|
|
4
|
+
import { get } from "../../property";
|
|
5
|
+
import { $familiar } from "../../template-string";
|
|
6
|
+
export const familiar = $familiar `Obtuse Angel`;
|
|
32
7
|
/**
|
|
33
8
|
* Returns true if the player has an Obtuse Angel
|
|
34
9
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
function have() {
|
|
39
|
-
return (0, _lib.have)(familiar);
|
|
10
|
+
export function have() {
|
|
11
|
+
return _have(familiar);
|
|
40
12
|
}
|
|
41
13
|
/**
|
|
42
14
|
* Returns number of badly romantic arrows used
|
|
43
15
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
function getBadlyRomanticArrowUses() {
|
|
47
|
-
return Math.max(0, (0, _property.get)("_badlyRomanticArrows"));
|
|
16
|
+
export function getBadlyRomanticArrowUses() {
|
|
17
|
+
return Math.max(0, get("_badlyRomanticArrows"));
|
|
48
18
|
}
|
|
49
19
|
/**
|
|
50
20
|
* Returns true if badly romantic arrow can still be used
|
|
51
21
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function haveBadlyRomanticArrowUsesRemaining() {
|
|
55
|
-
return getBadlyRomanticArrowUses() === 0;
|
|
22
|
+
export function haveBadlyRomanticArrowUsesRemaining() {
|
|
23
|
+
return getBadlyRomanticArrowUses() === 0;
|
|
56
24
|
}
|
|
57
25
|
/**
|
|
58
26
|
* Returns true if the player could use badly romantic arrow in theory
|
|
59
27
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
function couldUseBadlyRomanticArrow() {
|
|
63
|
-
return have() && haveBadlyRomanticArrowUsesRemaining();
|
|
28
|
+
export function couldUseBadlyRomanticArrow() {
|
|
29
|
+
return have() && haveBadlyRomanticArrowUsesRemaining();
|
|
64
30
|
}
|
|
65
31
|
/**
|
|
66
32
|
* Prepares badly romantic arrow for use
|
|
67
33
|
*/
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
function prepareBadlyRomanticArrow() {
|
|
71
|
-
return (0, _kolmafia.useFamiliar)(familiar);
|
|
34
|
+
export function prepareBadlyRomanticArrow() {
|
|
35
|
+
return useFamiliar(familiar);
|
|
72
36
|
}
|
|
73
37
|
/**
|
|
74
38
|
* Returns true if the player can use badly romantic arrow right now
|
|
75
39
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
function canUseBadlyRomanticArrow() {
|
|
79
|
-
return (0, _lib.isCurrentFamiliar)(familiar) && haveBadlyRomanticArrowUsesRemaining();
|
|
40
|
+
export function canUseBadlyRomanticArrow() {
|
|
41
|
+
return isCurrentFamiliar(familiar) && haveBadlyRomanticArrowUsesRemaining();
|
|
80
42
|
}
|
|
81
43
|
/**
|
|
82
44
|
* Returns the current badly romantic arrow monster target
|
|
83
45
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
function getBadlyRomanticArrowMonster() {
|
|
87
|
-
return (0, _property.get)("romanticTarget");
|
|
46
|
+
export function getBadlyRomanticArrowMonster() {
|
|
47
|
+
return get("romanticTarget");
|
|
88
48
|
}
|
|
89
|
-
|
|
90
|
-
var BadlyRomanticArrow = new _Copier.Copier(() => couldUseBadlyRomanticArrow(), () => prepareBadlyRomanticArrow(), () => canUseBadlyRomanticArrow(), () => getBadlyRomanticArrowMonster());
|
|
91
|
-
exports.BadlyRomanticArrow = BadlyRomanticArrow;
|
|
49
|
+
export const BadlyRomanticArrow = new Copier(() => couldUseBadlyRomanticArrow(), () => prepareBadlyRomanticArrow(), () => canUseBadlyRomanticArrow(), () => getBadlyRomanticArrowMonster());
|
|
@@ -1,43 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.have = have;
|
|
9
|
-
exports.getRainDohBlackBoxCopiesMade = getRainDohBlackBoxCopiesMade;
|
|
10
|
-
exports.getRainDohBlackBoxMonster = getRainDohBlackBoxMonster;
|
|
11
|
-
exports.useRainDohBlackBox = useRainDohBlackBox;
|
|
12
|
-
exports.box = void 0;
|
|
13
|
-
|
|
14
|
-
var _kolmafia = require("kolmafia");
|
|
15
|
-
|
|
16
|
-
var _lib = require("../../lib");
|
|
17
|
-
|
|
18
|
-
var _property = require("../../property");
|
|
19
|
-
|
|
20
|
-
var _templateString = require("../../template-string");
|
|
21
|
-
|
|
22
|
-
var _templateObject;
|
|
23
|
-
|
|
24
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
-
|
|
26
|
-
var box = (0, _templateString.$item)(_templateObject || (_templateObject = _taggedTemplateLiteral(["Rain-Doh black box"])));
|
|
27
|
-
exports.box = box;
|
|
28
|
-
|
|
29
|
-
function have() {
|
|
30
|
-
return (0, _lib.getFoldGroup)(box).some(item => (0, _lib.have)(item));
|
|
1
|
+
import { 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 box = $item `Rain-Doh black box`;
|
|
6
|
+
export function have() {
|
|
7
|
+
return getFoldGroup(box).some((item) => haveItem(item));
|
|
31
8
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return Math.max(0, (0, _property.get)("_raindohCopiesMade"));
|
|
9
|
+
export function getRainDohBlackBoxCopiesMade() {
|
|
10
|
+
return Math.max(0, get("_raindohCopiesMade"));
|
|
35
11
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
12
|
+
export function getRainDohBlackBoxMonster() {
|
|
13
|
+
return get("rainDohMonster");
|
|
14
|
+
}
|
|
15
|
+
export function useRainDohBlackBox() {
|
|
16
|
+
return use(box);
|
|
39
17
|
}
|
|
40
|
-
|
|
41
|
-
function useRainDohBlackBox() {
|
|
42
|
-
return (0, _kolmafia.use)(box);
|
|
43
|
-
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const summonSkill: Skill;
|
|
2
|
+
/**
|
|
3
|
+
* @returns true if the player can Summon Resolutions
|
|
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,28 @@
|
|
|
1
|
+
import { $item, $skill } from "../../template-string";
|
|
2
|
+
import { have as _have } from "../../lib";
|
|
3
|
+
export const summonSkill = $skill `Summon Resolutions`;
|
|
4
|
+
const commonChance = 0.98 / 6;
|
|
5
|
+
const rareChance = 0.02 / 3;
|
|
6
|
+
const libramExpected = new Map([
|
|
7
|
+
[$item `resolution: be feistier`, commonChance],
|
|
8
|
+
[$item `resolution: be happier`, commonChance],
|
|
9
|
+
[$item `resolution: be sexier`, commonChance],
|
|
10
|
+
[$item `resolution: be smarter`, commonChance],
|
|
11
|
+
[$item `resolution: be stronger`, commonChance],
|
|
12
|
+
[$item `resolution: be wealthier`, commonChance],
|
|
13
|
+
[$item `resolution: be kinder`, rareChance],
|
|
14
|
+
[$item `resolution: be luckier`, rareChance],
|
|
15
|
+
[$item `resolution: be more adventurous`, rareChance],
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* @returns true if the player can Summon Resolutions
|
|
19
|
+
*/
|
|
20
|
+
export function have() {
|
|
21
|
+
return _have(summonSkill);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @returns map containing the chance of an item to be summoned
|
|
25
|
+
*/
|
|
26
|
+
export function expected() {
|
|
27
|
+
return libramExpected;
|
|
28
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EnvironmentType } from "../../lib";
|
|
2
|
+
declare class Flower {
|
|
3
|
+
name: string;
|
|
4
|
+
id: number;
|
|
5
|
+
environment: EnvironmentType;
|
|
6
|
+
modifier: string;
|
|
7
|
+
territorial: boolean;
|
|
8
|
+
constructor(name: string, id: number, environment: EnvironmentType, modifier: string, territorial?: boolean);
|
|
9
|
+
plantNamesInZone(location?: Location): string[] | undefined;
|
|
10
|
+
plantsInZone(location?: Location): Flower[] | undefined;
|
|
11
|
+
isPlantedHere(location?: Location): boolean;
|
|
12
|
+
available(location?: Location): boolean;
|
|
13
|
+
dig(): boolean;
|
|
14
|
+
plant(): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function have(): boolean;
|
|
17
|
+
export declare function flowersIn(location: Location): Flower[];
|
|
18
|
+
export declare function flowersAvailableFor(location?: Location): Flower[];
|
|
19
|
+
export declare function isFull(location?: Location): boolean;
|
|
20
|
+
export declare const RabidDogwood: Flower;
|
|
21
|
+
export declare const Rutabeggar: Flower;
|
|
22
|
+
export declare const RadishRadish: Flower;
|
|
23
|
+
export declare const Artichoker: Flower;
|
|
24
|
+
export declare const SmokeRa: Flower;
|
|
25
|
+
export declare const SkunkCabbage: Flower;
|
|
26
|
+
export declare const DeadlyCinnamon: Flower;
|
|
27
|
+
export declare const CeleryStalker: Flower;
|
|
28
|
+
export declare const LettuceSpray: Flower;
|
|
29
|
+
export declare const SeltzerWatercress: Flower;
|
|
30
|
+
export declare const WarLily: Flower;
|
|
31
|
+
export declare const StealingMagnolia: Flower;
|
|
32
|
+
export declare const CannedSpinach: Flower;
|
|
33
|
+
export declare const Impatiens: Flower;
|
|
34
|
+
export declare const SpiderPlant: Flower;
|
|
35
|
+
export declare const RedFern: Flower;
|
|
36
|
+
export declare const BamBoo: Flower;
|
|
37
|
+
export declare const ArcticMoss: Flower;
|
|
38
|
+
export declare const AloeGuvnor: Flower;
|
|
39
|
+
export declare const PitcherPlant: Flower;
|
|
40
|
+
export declare const BlusteryPuffball: Flower;
|
|
41
|
+
export declare const HornOfPlenty: Flower;
|
|
42
|
+
export declare const WizardsWig: Flower;
|
|
43
|
+
export declare const ShuffleTruffle: Flower;
|
|
44
|
+
export declare const DisLichen: Flower;
|
|
45
|
+
export declare const LooseMorels: Flower;
|
|
46
|
+
export declare const FoulToadstool: Flower;
|
|
47
|
+
export declare const Chillterelle: Flower;
|
|
48
|
+
export declare const Portlybella: Flower;
|
|
49
|
+
export declare const MaxHeadshroom: Flower;
|
|
50
|
+
export declare const Spankton: Flower;
|
|
51
|
+
export declare const Kelptomaniac: Flower;
|
|
52
|
+
export declare const Crookweed: Flower;
|
|
53
|
+
export declare const ElectricEelgrass: Flower;
|
|
54
|
+
export declare const Duckweed: Flower;
|
|
55
|
+
export declare const OrcaOrchid: Flower;
|
|
56
|
+
export declare const Sargassum: Flower;
|
|
57
|
+
export declare const SubSeaRose: Flower;
|
|
58
|
+
export declare const Snori: Flower;
|
|
59
|
+
export declare const UpSeaDaisy: Flower;
|
|
60
|
+
export declare const all: readonly Flower[];
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { floristAvailable, getFloristPlants, myLocation, visitUrl, } from "kolmafia";
|
|
2
|
+
import { get } from "../../property";
|
|
3
|
+
class Flower {
|
|
4
|
+
constructor(name, id, environment, modifier, territorial = false) {
|
|
5
|
+
this.name = name;
|
|
6
|
+
this.id = id;
|
|
7
|
+
this.environment = environment;
|
|
8
|
+
this.modifier = modifier;
|
|
9
|
+
this.territorial = territorial;
|
|
10
|
+
}
|
|
11
|
+
plantNamesInZone(location = myLocation()) {
|
|
12
|
+
return getFloristPlants()[location.toString()];
|
|
13
|
+
}
|
|
14
|
+
plantsInZone(location = myLocation()) {
|
|
15
|
+
return this.plantNamesInZone(location)
|
|
16
|
+
?.map((flowerName) => toFlower(flowerName))
|
|
17
|
+
.filter((flower) => flower !== undefined);
|
|
18
|
+
}
|
|
19
|
+
isPlantedHere(location = myLocation()) {
|
|
20
|
+
const plantedHere = this.plantNamesInZone(location)?.includes(this.name);
|
|
21
|
+
return plantedHere !== undefined && plantedHere;
|
|
22
|
+
}
|
|
23
|
+
available(location = myLocation()) {
|
|
24
|
+
return (this.environment === location.environment &&
|
|
25
|
+
!get("_floristPlantsUsed").includes(this.name) &&
|
|
26
|
+
!this.isPlantedHere(location));
|
|
27
|
+
}
|
|
28
|
+
dig() {
|
|
29
|
+
if (!this.isPlantedHere())
|
|
30
|
+
return false;
|
|
31
|
+
const flowers = this.plantNamesInZone();
|
|
32
|
+
if (!flowers || !flowers[2])
|
|
33
|
+
return false;
|
|
34
|
+
const plantNumber = getFloristPlants()[myLocation().toString()].indexOf(this.name);
|
|
35
|
+
visitUrl(`choice.php?option=2&whichchoice=720&pwd&plnti=${plantNumber}`);
|
|
36
|
+
return !this.isPlantedHere();
|
|
37
|
+
}
|
|
38
|
+
plant() {
|
|
39
|
+
if (this.isPlantedHere())
|
|
40
|
+
return true;
|
|
41
|
+
if (isFull())
|
|
42
|
+
return false;
|
|
43
|
+
visitUrl(`choice.php?whichchoice=720&whichoption=1&pwd&plant=${this.id}`);
|
|
44
|
+
return this.isPlantedHere();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export function have() {
|
|
48
|
+
return floristAvailable();
|
|
49
|
+
}
|
|
50
|
+
function toFlower(name) {
|
|
51
|
+
return all.find((flower) => name === flower.name);
|
|
52
|
+
}
|
|
53
|
+
export function flowersIn(location) {
|
|
54
|
+
const returnValue = [];
|
|
55
|
+
getFloristPlants()[location.toString()].map(toFlower)
|
|
56
|
+
.forEach((flower) => {
|
|
57
|
+
if (flower)
|
|
58
|
+
returnValue.push(flower);
|
|
59
|
+
});
|
|
60
|
+
return returnValue;
|
|
61
|
+
}
|
|
62
|
+
export function flowersAvailableFor(location = myLocation()) {
|
|
63
|
+
return all.filter((flower) => flower.available(location));
|
|
64
|
+
}
|
|
65
|
+
export function isFull(location = myLocation()) {
|
|
66
|
+
return flowersIn(location).length === 3;
|
|
67
|
+
}
|
|
68
|
+
export const RabidDogwood = new Flower("Rabid Dogwood", 1, "outdoor", "+30 Monster Level", true);
|
|
69
|
+
export const Rutabeggar = new Flower("Rutabeggar", 2, "outdoor", "+25 Item Drop", true);
|
|
70
|
+
export const RadishRadish = new Flower("Rad-ish Radish", 3, "outdoor", "+5 Moxie Experience", true);
|
|
71
|
+
export const Artichoker = new Flower("Artichoker", 4, "outdoor", "Delevels enemies");
|
|
72
|
+
export const SmokeRa = new Flower("Smoke-ra", 5, "outdoor", "Blocks attacks");
|
|
73
|
+
export const SkunkCabbage = new Flower("Skunk Cabbage", 6, "outdoor", "Stench damage");
|
|
74
|
+
export const DeadlyCinnamon = new Flower("Deadly Cinnamon", 7, "outdoor", "Hot damage");
|
|
75
|
+
export const CeleryStalker = new Flower("Celery Stalker", 8, "outdoor", "Spooky damage");
|
|
76
|
+
export const LettuceSpray = new Flower("Lettus Spray", 9, "outdoor", "Restores HP");
|
|
77
|
+
export const SeltzerWatercress = new Flower("Seltzer Watercress", 10, "outdoor", "Restores MP");
|
|
78
|
+
export const WarLily = new Flower("War Lily", 11, "indoor", "+30 Monster Level", true);
|
|
79
|
+
export const StealingMagnolia = new Flower("Stealing Magnolia", 12, "indoor", "+25 Item Drop", true);
|
|
80
|
+
export const CannedSpinach = new Flower("Canned Spinach", 13, "indoor", "+5 Muscle Experience", true);
|
|
81
|
+
export const Impatiens = new Flower("Impatiens", 14, "indoor", "+25 Initiative");
|
|
82
|
+
export const SpiderPlant = new Flower("Spider Plant", 15, "indoor", "Poison");
|
|
83
|
+
export const RedFern = new Flower("Red Fern", 16, "indoor", "Delevels enemies");
|
|
84
|
+
export const BamBoo = new Flower("Bam BOO!", 17, "indoor", "Spooky damage");
|
|
85
|
+
export const ArcticMoss = new Flower("Arctic Moss", 18, "indoor", "Cold damage");
|
|
86
|
+
export const AloeGuvnor = new Flower("Aloe Guv'nor", 19, "indoor", "Restores HP");
|
|
87
|
+
export const PitcherPlant = new Flower("Pitcher Plant", 20, "indoor", "Restores MP");
|
|
88
|
+
export const BlusteryPuffball = new Flower("Blustery Puffball", 21, "underground", "+30 Monster Level", true);
|
|
89
|
+
export const HornOfPlenty = new Flower("Horn of Plenty", 22, "underground", "+25 Item Drop", true);
|
|
90
|
+
export const WizardsWig = new Flower("Wizard's Wig", 23, "underground", "+5 Mysticality Experience", true);
|
|
91
|
+
export const ShuffleTruffle = new Flower("Shuffle Truffle", 24, "underground", "+25 Initiative");
|
|
92
|
+
export const DisLichen = new Flower("Dis Lichen", 25, "underground", "Delevels enemies");
|
|
93
|
+
export const LooseMorels = new Flower("Loose Morels", 26, "underground", "Sleaze damage");
|
|
94
|
+
export const FoulToadstool = new Flower("Foul Toadstool", 27, "underground", "Stench damage");
|
|
95
|
+
export const Chillterelle = new Flower("Chillterelle", 28, "underground", "Cold damage");
|
|
96
|
+
export const Portlybella = new Flower("Portlybella", 29, "underground", "Retores HP");
|
|
97
|
+
export const MaxHeadshroom = new Flower("Max Headshroom", 30, "underground", "Restores MP");
|
|
98
|
+
export const Spankton = new Flower("Spankton", 31, "underwater", "Delevels enemies", true);
|
|
99
|
+
export const Kelptomaniac = new Flower("Kelptomaniac", 32, "underwater", "+40 Item Drop", true);
|
|
100
|
+
export const Crookweed = new Flower("Crookweed", 33, "underwater", "+60 Meat Drop", true);
|
|
101
|
+
export const ElectricEelgrass = new Flower("Electric Eelgrass", 34, "underwater", "Blocks attacks");
|
|
102
|
+
export const Duckweed = new Flower("Duckweed", 35, "underwater", "Protects once");
|
|
103
|
+
export const OrcaOrchid = new Flower("Orca Orchid", 36, "underwater", "Physical damage");
|
|
104
|
+
export const Sargassum = new Flower("Sargassum", 37, "underwater", "Stench damage");
|
|
105
|
+
export const SubSeaRose = new Flower("Sub-Sea Rose", 38, "underwater", "Cold damage");
|
|
106
|
+
export const Snori = new Flower("Snori", 39, "underwater", "Restores HP, Restores MP");
|
|
107
|
+
export const UpSeaDaisy = new Flower("Up Sea Daisy", 40, "underwater", "+30 Experience");
|
|
108
|
+
export const all = Object.freeze([
|
|
109
|
+
RabidDogwood,
|
|
110
|
+
Rutabeggar,
|
|
111
|
+
RadishRadish,
|
|
112
|
+
Artichoker,
|
|
113
|
+
SmokeRa,
|
|
114
|
+
SkunkCabbage,
|
|
115
|
+
DeadlyCinnamon,
|
|
116
|
+
CeleryStalker,
|
|
117
|
+
LettuceSpray,
|
|
118
|
+
SeltzerWatercress,
|
|
119
|
+
WarLily,
|
|
120
|
+
StealingMagnolia,
|
|
121
|
+
CannedSpinach,
|
|
122
|
+
Impatiens,
|
|
123
|
+
SpiderPlant,
|
|
124
|
+
RedFern,
|
|
125
|
+
BamBoo,
|
|
126
|
+
ArcticMoss,
|
|
127
|
+
AloeGuvnor,
|
|
128
|
+
PitcherPlant,
|
|
129
|
+
BlusteryPuffball,
|
|
130
|
+
HornOfPlenty,
|
|
131
|
+
WizardsWig,
|
|
132
|
+
ShuffleTruffle,
|
|
133
|
+
DisLichen,
|
|
134
|
+
LooseMorels,
|
|
135
|
+
FoulToadstool,
|
|
136
|
+
Chillterelle,
|
|
137
|
+
Portlybella,
|
|
138
|
+
MaxHeadshroom,
|
|
139
|
+
Spankton,
|
|
140
|
+
Kelptomaniac,
|
|
141
|
+
Crookweed,
|
|
142
|
+
ElectricEelgrass,
|
|
143
|
+
Duckweed,
|
|
144
|
+
OrcaOrchid,
|
|
145
|
+
Sargassum,
|
|
146
|
+
SubSeaRose,
|
|
147
|
+
Snori,
|
|
148
|
+
UpSeaDaisy,
|
|
149
|
+
]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const summonSkill: Skill;
|
|
2
|
+
/**
|
|
3
|
+
* @returns true if the player can Summon Taffy
|
|
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,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
|
+
}
|
|
@@ -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());
|