libram 0.8.28 → 0.8.30
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.d.ts +128 -0
- package/dist/Clan.js +300 -0
- package/dist/Copier.d.ts +9 -0
- package/dist/Copier.js +15 -0
- package/dist/Dungeon.d.ts +45 -0
- package/dist/Dungeon.js +115 -0
- package/dist/Kmail.d.ts +133 -0
- package/dist/Kmail.js +259 -0
- package/dist/actions/ActionSource.d.ts +131 -0
- package/dist/actions/ActionSource.js +178 -0
- package/dist/actions/Banish.d.ts +16 -0
- package/dist/actions/Banish.js +121 -0
- package/dist/actions/FreeKill.d.ts +16 -0
- package/dist/actions/FreeKill.js +94 -0
- package/dist/actions/FreeRun.d.ts +16 -0
- package/dist/actions/FreeRun.js +81 -0
- package/dist/actions/index.d.ts +4 -0
- package/dist/actions/index.js +4 -0
- package/dist/ascend.d.ts +83 -0
- package/dist/ascend.js +268 -0
- package/dist/challengePaths/2014/HeavyRains.d.ts +22 -0
- package/dist/challengePaths/2014/HeavyRains.js +75 -0
- package/dist/challengePaths/2015/CommunityService.d.ts +125 -0
- package/dist/challengePaths/2015/CommunityService.js +334 -0
- package/dist/challengePaths/2016/NuclearAutumn.d.ts +13 -0
- package/dist/challengePaths/2016/NuclearAutumn.js +21 -0
- package/dist/challengePaths/index.d.ts +4 -0
- package/dist/challengePaths/index.js +4 -0
- package/dist/combat.d.ts +414 -0
- package/dist/combat.js +711 -0
- package/dist/console.d.ts +12 -0
- package/dist/console.js +14 -0
- package/dist/counter.d.ts +22 -0
- package/dist/counter.js +37 -0
- package/dist/diet/index.d.ts +80 -0
- package/dist/diet/index.js +682 -0
- package/dist/diet/knapsack.d.ts +8 -0
- package/dist/diet/knapsack.js +128 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +26 -0
- package/dist/lib.d.ts +508 -0
- package/dist/lib.js +970 -0
- package/dist/logger.d.ts +35 -0
- package/dist/logger.js +62 -0
- package/dist/maximize.d.ts +122 -0
- package/dist/maximize.js +531 -0
- package/dist/modifier.d.ts +41 -0
- package/dist/modifier.js +160 -0
- package/dist/modifierTypes.d.ts +16 -0
- package/dist/modifierTypes.js +9 -0
- package/dist/mood.d.ts +105 -0
- package/dist/mood.js +349 -0
- package/dist/moonSign.d.ts +13 -0
- package/dist/moonSign.js +25 -0
- package/dist/overlappingNames.d.ts +3 -0
- package/dist/overlappingNames.js +42 -0
- package/dist/property.d.ts +222 -0
- package/dist/property.js +385 -0
- package/dist/propertyTypes.d.ts +19 -0
- package/dist/propertyTypes.js +10 -0
- package/dist/propertyTyping.d.ts +65 -0
- package/dist/propertyTyping.js +91 -0
- 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/2008/Stickers.d.ts +49 -0
- package/dist/resources/2008/Stickers.js +84 -0
- package/dist/resources/2009/Bandersnatch.d.ts +56 -0
- package/dist/resources/2009/Bandersnatch.js +93 -0
- package/dist/resources/2009/LoveSongs.d.ts +9 -0
- package/dist/resources/2009/LoveSongs.js +24 -0
- package/dist/resources/2009/SpookyPutty.d.ts +31 -0
- package/dist/resources/2009/SpookyPutty.js +49 -0
- package/dist/resources/2010/Brickos.d.ts +9 -0
- package/dist/resources/2010/Brickos.js +21 -0
- package/dist/resources/2010/CrownOfThrones.d.ts +68 -0
- package/dist/resources/2010/CrownOfThrones.js +418 -0
- package/dist/resources/2010/LookingGlass.d.ts +29 -0
- package/dist/resources/2010/LookingGlass.js +89 -0
- package/dist/resources/2011/Gygaxian.d.ts +9 -0
- package/dist/resources/2011/Gygaxian.js +24 -0
- package/dist/resources/2011/ObtuseAngel.d.ts +33 -0
- package/dist/resources/2011/ObtuseAngel.js +51 -0
- package/dist/resources/2011/StompingBoots.d.ts +37 -0
- package/dist/resources/2011/StompingBoots.js +57 -0
- package/dist/resources/2012/RainDoh.d.ts +25 -0
- package/dist/resources/2012/RainDoh.js +37 -0
- package/dist/resources/2012/ReagnimatedGnome.d.ts +31 -0
- package/dist/resources/2012/ReagnimatedGnome.js +46 -0
- package/dist/resources/2012/Resolutions.d.ts +9 -0
- package/dist/resources/2012/Resolutions.js +28 -0
- package/dist/resources/2013/Florist.d.ts +81 -0
- package/dist/resources/2013/Florist.js +245 -0
- package/dist/resources/2013/JungMan.d.ts +33 -0
- package/dist/resources/2013/JungMan.js +69 -0
- package/dist/resources/2013/PulledTaffy.d.ts +9 -0
- package/dist/resources/2013/PulledTaffy.js +33 -0
- package/dist/resources/2014/CrimboShrub.d.ts +42 -0
- package/dist/resources/2014/CrimboShrub.js +89 -0
- package/dist/resources/2014/DNALab.d.ts +56 -0
- package/dist/resources/2014/DNALab.js +162 -0
- package/dist/resources/2014/WinterGarden.d.ts +23 -0
- package/dist/resources/2014/WinterGarden.js +35 -0
- package/dist/resources/2015/BarrelShrine.d.ts +8 -0
- package/dist/resources/2015/BarrelShrine.js +25 -0
- package/dist/resources/2015/ChateauMantegna.d.ts +54 -0
- package/dist/resources/2015/ChateauMantegna.js +100 -0
- package/dist/resources/2015/DeckOfEveryCard.d.ts +29 -0
- package/dist/resources/2015/DeckOfEveryCard.js +122 -0
- package/dist/resources/2015/Dinseylandfill.d.ts +89 -0
- package/dist/resources/2015/Dinseylandfill.js +205 -0
- package/dist/resources/2015/MayoClinic.d.ts +23 -0
- package/dist/resources/2015/MayoClinic.js +49 -0
- package/dist/resources/2016/GingerBread.d.ts +32 -0
- package/dist/resources/2016/GingerBread.js +73 -0
- package/dist/resources/2016/SourceTerminal.d.ts +181 -0
- package/dist/resources/2016/SourceTerminal.js +275 -0
- package/dist/resources/2016/Witchess.d.ts +19 -0
- package/dist/resources/2016/Witchess.js +48 -0
- package/dist/resources/2017/AsdonMartin.d.ts +59 -0
- package/dist/resources/2017/AsdonMartin.js +238 -0
- package/dist/resources/2017/Horsery.d.ts +19 -0
- package/dist/resources/2017/Horsery.js +42 -0
- package/dist/resources/2017/MummingTrunk.d.ts +8 -0
- package/dist/resources/2017/MummingTrunk.js +33 -0
- package/dist/resources/2017/Pantogram.d.ts +92 -0
- package/dist/resources/2017/Pantogram.js +174 -0
- package/dist/resources/2017/Robortender.d.ts +30 -0
- package/dist/resources/2017/Robortender.js +90 -0
- package/dist/resources/2017/Spacegate.d.ts +86 -0
- package/dist/resources/2017/Spacegate.js +178 -0
- package/dist/resources/2017/TunnelOfLove.d.ts +39 -0
- package/dist/resources/2017/TunnelOfLove.js +120 -0
- package/dist/resources/2018/LatteLoversMembersMug.d.ts +392 -0
- package/dist/resources/2018/LatteLoversMembersMug.js +303 -0
- package/dist/resources/2018/SongBoom.d.ts +33 -0
- package/dist/resources/2018/SongBoom.js +55 -0
- package/dist/resources/2019/BeachComb.d.ts +72 -0
- package/dist/resources/2019/BeachComb.js +118 -0
- package/dist/resources/2019/CampAway.d.ts +39 -0
- package/dist/resources/2019/CampAway.js +72 -0
- package/dist/resources/2019/Snapper.d.ts +33 -0
- package/dist/resources/2019/Snapper.js +73 -0
- package/dist/resources/2020/Cartography.d.ts +16 -0
- package/dist/resources/2020/Cartography.js +48 -0
- package/dist/resources/2020/Guzzlr.d.ts +160 -0
- package/dist/resources/2020/Guzzlr.js +275 -0
- package/dist/resources/2020/RetroCape.d.ts +51 -0
- package/dist/resources/2020/RetroCape.js +115 -0
- package/dist/resources/2021/CrystalBall.d.ts +14 -0
- package/dist/resources/2021/CrystalBall.js +41 -0
- package/dist/resources/2021/DaylightShavings.d.ts +40 -0
- package/dist/resources/2021/DaylightShavings.js +74 -0
- package/dist/resources/2022/AutumnAton.d.ts +78 -0
- package/dist/resources/2022/AutumnAton.js +182 -0
- package/dist/resources/2022/CombatLoversLocket.d.ts +46 -0
- package/dist/resources/2022/CombatLoversLocket.js +83 -0
- package/dist/resources/2022/GreyGoose.d.ts +59 -0
- package/dist/resources/2022/GreyGoose.js +90 -0
- package/dist/resources/2022/JuneCleaver.d.ts +47 -0
- package/dist/resources/2022/JuneCleaver.js +69 -0
- package/dist/resources/2022/TrainSet.d.ts +146 -0
- package/dist/resources/2022/TrainSet.js +228 -0
- package/dist/resources/2023/AugustScepter.d.ts +25 -0
- package/dist/resources/2023/AugustScepter.js +40 -0
- package/dist/resources/2023/BurningLeaves.d.ts +25 -0
- package/dist/resources/2023/BurningLeaves.js +74 -0
- package/dist/resources/2023/CinchoDeMayo.d.ts +25 -0
- package/dist/resources/2023/CinchoDeMayo.js +45 -0
- package/dist/resources/2023/ClosedCircuitPayphone.d.ts +80 -0
- package/dist/resources/2023/ClosedCircuitPayphone.js +129 -0
- package/dist/resources/2023/CursedMonkeyPaw.d.ts +46 -0
- package/dist/resources/2023/CursedMonkeyPaw.js +113 -0
- package/dist/resources/2024/AprilingBandHelmet.d.ts +57 -0
- package/dist/resources/2024/AprilingBandHelmet.js +118 -0
- package/dist/resources/2024/ChestMimic.d.ts +43 -0
- package/dist/resources/2024/ChestMimic.js +125 -0
- package/dist/resources/LibramSummon.d.ts +18 -0
- package/dist/resources/LibramSummon.js +74 -0
- package/dist/resources/index.d.ts +54 -0
- package/dist/resources/index.js +54 -0
- package/dist/resources/putty-likes.d.ts +21 -0
- package/dist/resources/putty-likes.js +33 -0
- package/dist/session.d.ts +169 -0
- package/dist/session.js +284 -0
- package/dist/since.d.ts +51 -0
- package/dist/since.js +108 -0
- package/dist/template-string.d.ts +324 -0
- package/dist/template-string.js +265 -0
- package/dist/url.d.ts +35 -0
- package/dist/url.js +67 -0
- package/dist/utils.d.ts +185 -0
- package/dist/utils.js +264 -0
- package/package.json +2 -2
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { haveFamiliar, Item, itemAmount, Monster, myFamiliar, toItem, useFamiliar, visitUrl, } from "kolmafia";
|
|
2
|
+
import { get } from "../../property";
|
|
3
|
+
import { $familiar, $item, $items, $phylum } from "../../template-string";
|
|
4
|
+
/**
|
|
5
|
+
* The Robortender itself
|
|
6
|
+
*/
|
|
7
|
+
const familiar = $familiar `Robortender`;
|
|
8
|
+
/**
|
|
9
|
+
* @returns Whether you have the Robortender in your terrarium/available
|
|
10
|
+
*/
|
|
11
|
+
export function have() {
|
|
12
|
+
return haveFamiliar(familiar);
|
|
13
|
+
}
|
|
14
|
+
const phylumDrops = new Map([
|
|
15
|
+
[$phylum `Bug`, $item `pickled grasshopper`],
|
|
16
|
+
// bottle of anís
|
|
17
|
+
[$phylum `Constellation`, Item.get(9348)],
|
|
18
|
+
[$phylum `Demon`, $item `bottle of novelty hot sauce`],
|
|
19
|
+
[$phylum `Elemental`, $item `elemental sugarcube`],
|
|
20
|
+
[$phylum `Elf`, $item `peppermint sprig`],
|
|
21
|
+
[$phylum `Fish`, $item `bottle of clam juice`],
|
|
22
|
+
[$phylum `Goblin`, $item `cocktail mushroom`],
|
|
23
|
+
[$phylum `Hippy`, $item `shot of granola liqueur`],
|
|
24
|
+
[$phylum `Hobo`, $item `can of cherry-flavored sterno`],
|
|
25
|
+
[$phylum `Horror`, $item `lump of black ichor`],
|
|
26
|
+
[$phylum `Humanoid`, $item `bottle of gregnadigne`],
|
|
27
|
+
// bottle of Crème de Fugu
|
|
28
|
+
[$phylum `Mer-kin`, Item.get(9358)],
|
|
29
|
+
[$phylum `Orc`, $item `baby oil shooter`],
|
|
30
|
+
[$phylum `Penguin`, $item `fish head`],
|
|
31
|
+
[$phylum `Pirate`, $item `limepatch`],
|
|
32
|
+
[$phylum `Plant`, $item `pile of dirt`],
|
|
33
|
+
[$phylum `Slime`, $item `slime shooter`],
|
|
34
|
+
[$phylum `Weird`, $item `imaginary lemon`],
|
|
35
|
+
]);
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param target The phylum or monster you want to know the robortender drop of
|
|
39
|
+
* @returns The robortender drop associated with that phylum or monster
|
|
40
|
+
*/
|
|
41
|
+
export function dropFrom(target) {
|
|
42
|
+
const phylum = target instanceof Monster ? target.phylum : target;
|
|
43
|
+
return phylumDrops.get(phylum) ?? $item.none;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Determines the probability of getting a robortender drop based on number of drops received
|
|
47
|
+
*
|
|
48
|
+
* @param dropNumber The number of drops to assume you've already received; defaults to mafia's tracked amount
|
|
49
|
+
* @returns The probability of getting a robort drop
|
|
50
|
+
*/
|
|
51
|
+
export function dropChance(dropNumber = get("_roboDrops")) {
|
|
52
|
+
return [1, 0.5, 0.4, 0.4, 0.4, 0.3, 0.3, 0.3][dropNumber] ?? 0.2;
|
|
53
|
+
}
|
|
54
|
+
export const minorDrinks = $items `literal grasshopper, double entendre, Phlegethon, Siberian sunrise, mentholated wine, low tide martini, shroomtini, morning dew, whiskey squeeze, great old fashioned, Gnomish sagngria, vodka stinger, extremely slippery nipple, piscatini, Churchill, soilzerac, London frog, nothingtini`;
|
|
55
|
+
export const majorDrinks = $items `eighth plague, single entendre, reverse Tantalus, elemental caipiroska, Feliz Navidad, Bloody Nora, moreltini, hell in a bucket, Newark, R'lyeh, Gnollish sangria, vodka barracuda, Mysterious Island iced tea, drive-by shooting, gunner's daughter, dirt julep, Simepore slime, Phil Collins`;
|
|
56
|
+
export const drinks = [...minorDrinks, ...majorDrinks];
|
|
57
|
+
/**
|
|
58
|
+
* @returns An array consisting of the drinks you've fed your robortender today.
|
|
59
|
+
*/
|
|
60
|
+
export function currentDrinks() {
|
|
61
|
+
const pref = get("_roboDrinks");
|
|
62
|
+
if (!pref)
|
|
63
|
+
return [];
|
|
64
|
+
return pref
|
|
65
|
+
.split(",")
|
|
66
|
+
.filter((x) => x.trim())
|
|
67
|
+
.map((name) => toItem(name))
|
|
68
|
+
.filter((drink) => drinks.includes(drink));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @param beverage A robortender-consumable drink of choice (i.e. Drive-By Shooting, Single Entendre, etc)
|
|
72
|
+
* @returns A boolean; if true, the user's robortender has drunk that drink after execution. If false, it has not. This ALSO returns false if the user has not passed the function a robortender-consumable drink. If the user does not already have the beverage in their inventory, this function will not purchase the requested for you.
|
|
73
|
+
*/
|
|
74
|
+
export function feed(beverage) {
|
|
75
|
+
if (currentDrinks().includes(beverage))
|
|
76
|
+
return true;
|
|
77
|
+
if (currentDrinks().length >= 5)
|
|
78
|
+
return false;
|
|
79
|
+
if (!drinks.includes(beverage))
|
|
80
|
+
return false;
|
|
81
|
+
if (!itemAmount(beverage))
|
|
82
|
+
return false;
|
|
83
|
+
if (!have())
|
|
84
|
+
return false;
|
|
85
|
+
const priorFamiliar = myFamiliar();
|
|
86
|
+
useFamiliar(familiar); // must equip Robortender to feed it
|
|
87
|
+
visitUrl(`inventory.php?action=robooze&which=1&whichitem=${beverage.id}`);
|
|
88
|
+
useFamiliar(priorFamiliar);
|
|
89
|
+
return currentDrinks().includes(beverage);
|
|
90
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Item } from "kolmafia";
|
|
2
|
+
/**
|
|
3
|
+
* @returns Whether you have permanent Spacegate Access
|
|
4
|
+
*/
|
|
5
|
+
export declare function have(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Refreshes the data from the Spacegate Terminal to determine current Spacegate Status
|
|
8
|
+
*/
|
|
9
|
+
export declare function updateStatus(): void;
|
|
10
|
+
/**
|
|
11
|
+
* @returns Whether you have dialled the spacegate today.
|
|
12
|
+
*/
|
|
13
|
+
export declare function dialled(): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @returns A string containing a pipe-separated (|) list of all known hazards at the dialled planet
|
|
16
|
+
*/
|
|
17
|
+
export declare function hazards(): string;
|
|
18
|
+
/**
|
|
19
|
+
* @returns The name of the dialled planet
|
|
20
|
+
*/
|
|
21
|
+
export declare function planetName(): string;
|
|
22
|
+
/**
|
|
23
|
+
* @returns The 7-letter coordinates of the dialled planet
|
|
24
|
+
*/
|
|
25
|
+
export declare function planetCoords(): string;
|
|
26
|
+
/**
|
|
27
|
+
* @returns The level of plantlife expected on the dialled planet (none, primitive, advanced, anomalous)
|
|
28
|
+
*/
|
|
29
|
+
export declare function plantLife(): string;
|
|
30
|
+
/**
|
|
31
|
+
* @returns The level of animal life expected on the dialled planet (none, primitive, advanced, anomalous)
|
|
32
|
+
*/
|
|
33
|
+
export declare function animalLife(): string;
|
|
34
|
+
/**
|
|
35
|
+
* @returns Whether intelligent life is detected on the dialled planet
|
|
36
|
+
*/
|
|
37
|
+
export declare function intelligentLife(): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* @returns Whether hostile life is detected on the dialled planet
|
|
40
|
+
*/
|
|
41
|
+
export declare function hostileLife(): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* @returns Whether alien ruins are detected on the dialled planet
|
|
44
|
+
*/
|
|
45
|
+
export declare function ruins(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @returns Whether Spants are detected on the dialled planet
|
|
48
|
+
*/
|
|
49
|
+
export declare function spants(): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* @returns Whether muderbots are detected on the dialled planet
|
|
52
|
+
*/
|
|
53
|
+
export declare function murderBots(): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* @param hazards A string of the various hazard names
|
|
56
|
+
* @returns An array of the various required equipment to deal with those hazards
|
|
57
|
+
*/
|
|
58
|
+
export declare function hazardEquipment(hazards: string): Item[];
|
|
59
|
+
/**
|
|
60
|
+
* Tries to acquire all necessary equipment for the stated hazards at the dialed planet
|
|
61
|
+
*
|
|
62
|
+
* @returns Whether you successfully acquired all necessary equipment
|
|
63
|
+
*/
|
|
64
|
+
export declare function getHazardEquipment(): boolean;
|
|
65
|
+
declare type Vaccine = "Rainbow" | "Broad-Spectrum" | "Emotional" | "Elemental Resistance" | "Stats" | "Monster Level";
|
|
66
|
+
/**
|
|
67
|
+
* Gets the requested Spacegate Vaccine Buff
|
|
68
|
+
*
|
|
69
|
+
* @param choice Name of Vaccine or Buff type requested
|
|
70
|
+
* @returns Whether you successfully acquired a vaccine
|
|
71
|
+
*/
|
|
72
|
+
export declare function getVaccine(choice: Vaccine): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Dials the requested gate address
|
|
75
|
+
*
|
|
76
|
+
* @param address 7-letter string indicating the coordinates of the planet you wish to dial.
|
|
77
|
+
* @returns Whether you successfully dialled the requested planet.
|
|
78
|
+
*/
|
|
79
|
+
export declare function dial(address: string): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Dials a random gate address
|
|
82
|
+
*
|
|
83
|
+
* @returns Whether you successfully dialled a planet.
|
|
84
|
+
*/
|
|
85
|
+
export declare function dialRandom(): boolean;
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { availableAmount, cliExecute, visitUrl } from "kolmafia";
|
|
2
|
+
import { get } from "../../property";
|
|
3
|
+
import { $item } from "../../template-string";
|
|
4
|
+
/**
|
|
5
|
+
* @returns Whether you have permanent Spacegate Access
|
|
6
|
+
*/
|
|
7
|
+
export function have() {
|
|
8
|
+
return get("spacegateAlways");
|
|
9
|
+
("");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Refreshes the data from the Spacegate Terminal to determine current Spacegate Status
|
|
13
|
+
*/
|
|
14
|
+
export function updateStatus() {
|
|
15
|
+
visitUrl("place.php?whichplace=spacegate&action=sg_Terminal");
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @returns Whether you have dialled the spacegate today.
|
|
19
|
+
*/
|
|
20
|
+
export function dialled() {
|
|
21
|
+
updateStatus();
|
|
22
|
+
return get("_spacegateCoordinates") !== "" || get("_spacegateToday");
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @returns A string containing a pipe-separated (|) list of all known hazards at the dialled planet
|
|
26
|
+
*/
|
|
27
|
+
export function hazards() {
|
|
28
|
+
return get("_spacegateHazards");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @returns The name of the dialled planet
|
|
32
|
+
*/
|
|
33
|
+
export function planetName() {
|
|
34
|
+
return get("_spacegatePlanetName");
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @returns The 7-letter coordinates of the dialled planet
|
|
38
|
+
*/
|
|
39
|
+
export function planetCoords() {
|
|
40
|
+
return get("_spacegateCoordinates");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* @returns The level of plantlife expected on the dialled planet (none, primitive, advanced, anomalous)
|
|
44
|
+
*/
|
|
45
|
+
export function plantLife() {
|
|
46
|
+
return get("_spacegatePlantLife");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @returns The level of animal life expected on the dialled planet (none, primitive, advanced, anomalous)
|
|
50
|
+
*/
|
|
51
|
+
export function animalLife() {
|
|
52
|
+
return get("_spacegateAnimalLife");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* @returns Whether intelligent life is detected on the dialled planet
|
|
56
|
+
*/
|
|
57
|
+
export function intelligentLife() {
|
|
58
|
+
return get("_spacegateIntelligentLife").includes("detected");
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @returns Whether hostile life is detected on the dialled planet
|
|
62
|
+
*/
|
|
63
|
+
export function hostileLife() {
|
|
64
|
+
return get("_spacegateIntelligentLife").includes("hostile");
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @returns Whether alien ruins are detected on the dialled planet
|
|
68
|
+
*/
|
|
69
|
+
export function ruins() {
|
|
70
|
+
return get("_spacegateRuins");
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @returns Whether Spants are detected on the dialled planet
|
|
74
|
+
*/
|
|
75
|
+
export function spants() {
|
|
76
|
+
return get("_spacegateSpant");
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* @returns Whether muderbots are detected on the dialled planet
|
|
80
|
+
*/
|
|
81
|
+
export function murderBots() {
|
|
82
|
+
return get("_spacegateMurderbot");
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* @param hazards A string of the various hazard names
|
|
86
|
+
* @returns An array of the various required equipment to deal with those hazards
|
|
87
|
+
*/
|
|
88
|
+
export function hazardEquipment(hazards) {
|
|
89
|
+
const hazardEquipment = {
|
|
90
|
+
"toxic atmosphere": $item `filter helmet`,
|
|
91
|
+
"high gravity": $item `exo-servo leg braces`,
|
|
92
|
+
irradiated: $item `rad cloak`,
|
|
93
|
+
"magnetic storms": $item `gate transceiver`,
|
|
94
|
+
"high winds": $item `high-friction boots`,
|
|
95
|
+
};
|
|
96
|
+
return Object.entries(hazardEquipment)
|
|
97
|
+
.filter(([clue]) => hazards.includes(clue))
|
|
98
|
+
.map(([, item]) => item);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Tries to acquire all necessary equipment for the stated hazards at the dialed planet
|
|
102
|
+
*
|
|
103
|
+
* @returns Whether you successfully acquired all necessary equipment
|
|
104
|
+
*/
|
|
105
|
+
export function getHazardEquipment() {
|
|
106
|
+
if (!have()) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
const equipment = hazardEquipment(hazards());
|
|
110
|
+
equipment.forEach((equip) => {
|
|
111
|
+
const num = equip.id - 9404; //Equipment items are 9405 - 9409,
|
|
112
|
+
visitUrl("place.php?whichplace=spacegate&action=sg_requisition");
|
|
113
|
+
visitUrl(`choice.php?whichchoice=1233&option=${num}`);
|
|
114
|
+
});
|
|
115
|
+
equipment.forEach((equip) => {
|
|
116
|
+
if (availableAmount(equip) !== 1) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Gets the requested Spacegate Vaccine Buff
|
|
124
|
+
*
|
|
125
|
+
* @param choice Name of Vaccine or Buff type requested
|
|
126
|
+
* @returns Whether you successfully acquired a vaccine
|
|
127
|
+
*/
|
|
128
|
+
export function getVaccine(choice) {
|
|
129
|
+
if (get("_spacegateVaccine")) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const nums = {
|
|
133
|
+
Rainbow: 1,
|
|
134
|
+
"Elemental Resistance": 1,
|
|
135
|
+
"Broad-Spectrum": 2,
|
|
136
|
+
Stats: 2,
|
|
137
|
+
Emotional: 3,
|
|
138
|
+
"Monster Level": 3,
|
|
139
|
+
};
|
|
140
|
+
const num = nums[choice];
|
|
141
|
+
if (!get(`spacegateVaccine${num}`)) {
|
|
142
|
+
throw "You don't appear to have that Vaccine Unlocked!";
|
|
143
|
+
}
|
|
144
|
+
cliExecute(`spacegate vaccine ${num}`);
|
|
145
|
+
return get("_spacegateVaccine");
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Dials the requested gate address
|
|
149
|
+
*
|
|
150
|
+
* @param address 7-letter string indicating the coordinates of the planet you wish to dial.
|
|
151
|
+
* @returns Whether you successfully dialled the requested planet.
|
|
152
|
+
*/
|
|
153
|
+
export function dial(address) {
|
|
154
|
+
if (!have() || dialled()) {
|
|
155
|
+
//cannot dial if we already have or don't own it.
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
if (!address.match(`^[[alpha]]+$`) || address.length !== 7) {
|
|
159
|
+
throw "Invalid Spacegate Address - must be exactly 7 alphabetic characters";
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
cliExecute(`spacegate destination ${address}`);
|
|
163
|
+
}
|
|
164
|
+
return dialled() && planetCoords() === address;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Dials a random gate address
|
|
168
|
+
*
|
|
169
|
+
* @returns Whether you successfully dialled a planet.
|
|
170
|
+
*/
|
|
171
|
+
export function dialRandom() {
|
|
172
|
+
if (!have() || dialled()) {
|
|
173
|
+
//cannot dial if we already have or don't own it.
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
cliExecute("spacegate destination random");
|
|
177
|
+
return dialled();
|
|
178
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Monster } from "kolmafia";
|
|
2
|
+
import { Copier } from "../../Copier";
|
|
3
|
+
/**
|
|
4
|
+
* @returns Is the love tunnel available?
|
|
5
|
+
*/
|
|
6
|
+
export declare function have(): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* @returns Have we visited the love tunnel yet today?
|
|
9
|
+
*/
|
|
10
|
+
export declare function isUsed(): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* @returns Do we `have` an Enamorang?
|
|
13
|
+
*/
|
|
14
|
+
export declare function haveLovEnamorang(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @returns How many enamorangs have we used today?
|
|
17
|
+
*/
|
|
18
|
+
export declare function getLovEnamorangUses(): number;
|
|
19
|
+
/**
|
|
20
|
+
* @returns Can we currently use an enamorang?
|
|
21
|
+
*/
|
|
22
|
+
export declare function couldUseLoveEnamorang(): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* @returns The Monster currently in our enamorang; `null` for none
|
|
25
|
+
*/
|
|
26
|
+
export declare function getLovEnamorangMonster(): Monster | null;
|
|
27
|
+
export declare const LovEnamorang: Copier;
|
|
28
|
+
declare type LOVEquipment = "LOV Eardigan" | "LOV Epaulettes" | "LOV Earring";
|
|
29
|
+
declare type LOVEffect = "Lovebotamy" | "Open Heart Surgery" | "Wandering Eye Surgery";
|
|
30
|
+
declare type LOVExtra = "LOV Enamorang" | "LOV Emotionizer" | "LOV Extraterrestrial Chocolate" | "LOV Echinacea Bouquet" | "LOV Elephant" | "toast" | null;
|
|
31
|
+
/**
|
|
32
|
+
* Fight all LOV monsters and get buffs/equipment.
|
|
33
|
+
*
|
|
34
|
+
* @param equipment Equipment to take from LOV.
|
|
35
|
+
* @param effect Effect to take from LOV.
|
|
36
|
+
* @param extra Extra item to take from LOV.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fightAll(equipment: LOVEquipment, effect: LOVEffect, extra: LOVExtra): void;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { adv1 } from "kolmafia";
|
|
2
|
+
import { Copier } from "../../Copier";
|
|
3
|
+
import { have as haveItem, haveWandererCounter, Wanderer } from "../../lib";
|
|
4
|
+
import { get, withChoices } from "../../property";
|
|
5
|
+
import { $item, $location } from "../../template-string";
|
|
6
|
+
/**
|
|
7
|
+
* @returns Is the love tunnel available?
|
|
8
|
+
*/
|
|
9
|
+
export function have() {
|
|
10
|
+
return get("loveTunnelAvailable");
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* @returns Have we visited the love tunnel yet today?
|
|
14
|
+
*/
|
|
15
|
+
export function isUsed() {
|
|
16
|
+
return get("_loveTunnelUsed");
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* @returns Do we `have` an Enamorang?
|
|
20
|
+
*/
|
|
21
|
+
export function haveLovEnamorang() {
|
|
22
|
+
return haveItem($item `LOV Enamorang`);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* @returns How many enamorangs have we used today?
|
|
26
|
+
*/
|
|
27
|
+
export function getLovEnamorangUses() {
|
|
28
|
+
return get("_enamorangs");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @returns Can we currently use an enamorang?
|
|
32
|
+
*/
|
|
33
|
+
export function couldUseLoveEnamorang() {
|
|
34
|
+
return (!haveWandererCounter(Wanderer.Enamorang) &&
|
|
35
|
+
getLovEnamorangUses() < 3 &&
|
|
36
|
+
haveLovEnamorang());
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @returns The Monster currently in our enamorang; `null` for none
|
|
40
|
+
*/
|
|
41
|
+
export function getLovEnamorangMonster() {
|
|
42
|
+
return get("enamorangMonster");
|
|
43
|
+
}
|
|
44
|
+
export const LovEnamorang = new Copier(() => couldUseLoveEnamorang(), null, () => couldUseLoveEnamorang(), () => getLovEnamorangMonster());
|
|
45
|
+
/**
|
|
46
|
+
* Internal function used for `fightAll`
|
|
47
|
+
*
|
|
48
|
+
* @param equipment The equipment to select from the tunnel
|
|
49
|
+
* @returns The relevant choice option
|
|
50
|
+
*/
|
|
51
|
+
function equipmentChoice(equipment) {
|
|
52
|
+
switch (equipment) {
|
|
53
|
+
case "LOV Eardigan":
|
|
54
|
+
return 1;
|
|
55
|
+
case "LOV Epaulettes":
|
|
56
|
+
return 2;
|
|
57
|
+
case "LOV Earring":
|
|
58
|
+
return 3;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
*Internal function used for `fightAll`
|
|
63
|
+
*
|
|
64
|
+
* @param effect The effect to select from the tunnel
|
|
65
|
+
* @returns The relevant choice option
|
|
66
|
+
*/
|
|
67
|
+
function effectChoice(effect) {
|
|
68
|
+
switch (effect) {
|
|
69
|
+
case "Lovebotamy":
|
|
70
|
+
return 1;
|
|
71
|
+
case "Open Heart Surgery":
|
|
72
|
+
return 2;
|
|
73
|
+
case "Wandering Eye Surgery":
|
|
74
|
+
return 3;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Internal function used for `fightAll`
|
|
79
|
+
*
|
|
80
|
+
* @param extra The extra item to select from the tunnel
|
|
81
|
+
* @returns The relevant choice option
|
|
82
|
+
*/
|
|
83
|
+
function extraChoice(extra) {
|
|
84
|
+
switch (extra) {
|
|
85
|
+
case "LOV Enamorang":
|
|
86
|
+
return 1;
|
|
87
|
+
case "LOV Emotionizer":
|
|
88
|
+
return 2;
|
|
89
|
+
case "LOV Extraterrestrial Chocolate":
|
|
90
|
+
return 3;
|
|
91
|
+
case "LOV Echinacea Bouquet":
|
|
92
|
+
return 4;
|
|
93
|
+
case "LOV Elephant":
|
|
94
|
+
return 5;
|
|
95
|
+
case "toast":
|
|
96
|
+
return 6;
|
|
97
|
+
case null:
|
|
98
|
+
return 7;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Fight all LOV monsters and get buffs/equipment.
|
|
103
|
+
*
|
|
104
|
+
* @param equipment Equipment to take from LOV.
|
|
105
|
+
* @param effect Effect to take from LOV.
|
|
106
|
+
* @param extra Extra item to take from LOV.
|
|
107
|
+
*/
|
|
108
|
+
export function fightAll(equipment, effect, extra) {
|
|
109
|
+
withChoices({
|
|
110
|
+
1222: 1,
|
|
111
|
+
1223: 1,
|
|
112
|
+
1224: equipmentChoice(equipment),
|
|
113
|
+
1225: 1,
|
|
114
|
+
1226: effectChoice(effect),
|
|
115
|
+
1227: 1,
|
|
116
|
+
1228: extraChoice(extra),
|
|
117
|
+
}, () => {
|
|
118
|
+
adv1($location `The Tunnel of L.O.V.E.`, 0, "");
|
|
119
|
+
});
|
|
120
|
+
}
|