Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@
"esbuild-plugin-babel": "^0.2.3",
"eslint": "8.56.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-libram": "^0.4.27",
"eslint-plugin-libram": "^0.4.28",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.7.1",
"typescript": "^4.7.4"
},
"dependencies": {
"grimoire-kolmafia": "^0.3.29",
"grimoire-kolmafia": "^0.3.33",
"kolmafia": "^5.28481.0",
"libram": "^0.11.0"
"libram": "^0.11.6"
},
"author": "Phreddrickkv2",
"license": "ISC",
Expand Down
3 changes: 1 addition & 2 deletions src/boozedrop.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CSStrategy, Macro } from "./combat";
import { aprilTask, asdonTask, deckTask, potionTask, skillTask, songTask } from "./commons";
import { aprilTask, asdonTask, deckTask, potionTask, skillTask } from "./commons";
import { CSQuest } from "./engine";
import uniform from "./outfit";
import { OutfitSpec } from "grimoire-kolmafia";
Expand Down Expand Up @@ -64,7 +64,6 @@ const BoozeDrop: CSQuest = {
class: $classes`Sauceror, Turtle Tamer`,
core: "hard",
},
songTask($effect`Fat Leon's Phat Loot Lyric`, $effect`Ode to Booze`),
{
name: "Items.enh",
completed: () => have($effect`items.enh`),
Expand Down
4 changes: 2 additions & 2 deletions src/combat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import {

export class CSStrategy extends CombatStrategy {
constructor(
macro: Delayed<Macro> = () => Macro.defaultKill(),
macro: Delayed<Macro, [void]> = () => Macro.defaultKill(),
{
fallthrough,
fightHolidayWanderer,
}: { fallthrough?: Delayed<Macro>; fightHolidayWanderer?: boolean } = {}
}: { fallthrough?: Delayed<Macro, [void]>; fightHolidayWanderer?: boolean } = {}
) {
super();
this.macro(
Expand Down
42 changes: 36 additions & 6 deletions src/commons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,30 @@ import { CSStrategy, Macro } from "./combat";
import { CSTask, currentBirdHas, favouriteBirdHas } from "./lib";
import uniform from "./outfit";
import {
abort,
adv1,
availableAmount,
buy,
canEquip,
cliExecute,
create,
eat,
Effect,
effectModifier,
equippedItem,
getFuel,
getProperty,
handlingChoice,
Item,
mpCost,
myLevel,
myMp,
npcPrice,
runChoice,
Skill,
toEffect,
toSkill,
toSlot,
use,
useSkill,
} from "kolmafia";
Expand Down Expand Up @@ -147,13 +152,7 @@ export function commonFamiliarWeightBuffs(): CSTask[] {
return [
potionTask($item`green candy heart`),
...restoreBuffTasks(buffs),
{
name: "Witchess",
completed: () => get("_witchessBuff"),
do: () => cliExecute("witchess"),
},
skillTask({ skill: $skill`Empathy of the Newt`, effect: $effect`Thoughtful Empathy` }, true),
beachTask($effect`Do I Know You From Somewhere?`),
];
}

Expand Down Expand Up @@ -268,3 +267,34 @@ export function aprilTask(song: AprilingBandHelmet.MarchingSong): CSTask {
do: () => AprilingBandHelmet.changeSong(song),
};
}

export function buskTask(hat: Item, shirt: Item, pants: Item, index: number): CSTask {
return {
name: `Busk #${index + 1}: ${hat}. ${shirt}, and ${pants}`,
outfit: {
hat,
shirt,
pants,
...(hat === $item`prismatic beret`
? {}
: { familiar: $familiar`Mad Hatrack`, famequip: $item`prismatic beret` }),
},
acquire: () =>
[hat, pants, shirt]
.filter((i) => i !== $item.none && !have(i) && npcPrice(i) > 0)
.map((item) => ({ item })),
ready: () =>
[hat, shirt, pants].every(
(it) => it === $item.none || (canEquip(it) && (have(it) || npcPrice(it) > 0))
),
completed: () => get("_beretBuskingUses") !== index,
do: () => {
for (const [slotName, item] of Object.entries({ hat, shirt, pants })) {
if (equippedItem(toSlot(slotName)) !== item)
abort(`Failed to equip ${item} to ${slotName} for Busking!`);
}
useSkill($skill`Beret Busking`);
},
core: "soft",
};
}
38 changes: 0 additions & 38 deletions src/drinking.ts

This file was deleted.

4 changes: 3 additions & 1 deletion src/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ export class CSEngine extends Engine<never, CSTask> {
Outfit.from(
spec,
new Error(
`Failed to equip outfit for ${this.name}. Also, that outfit is ${toJson(spec)}`
`Failed to equip outfit for ${this.name}. Also, that outfit is ${toJson(
Object.fromEntries(Object.entries(spec).filter(([key]) => key !== "afterDress"))
)}`
)
).dress();
burnLibrams();
Expand Down
4 changes: 3 additions & 1 deletion src/familiarweight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { commonFamiliarWeightBuffs, meteorShower, potionTask } from "./commons";
import { CSQuest } from "./engine";
import { availableFights, unequip } from "./lib";
import uniform from "./outfit";
import { create, mySign, runCombat, toInt, use, visitUrl } from "kolmafia";
import { buy, create, mySign, runCombat, toInt, use, visitUrl } from "kolmafia";
import {
$effect,
$familiar,
Expand Down Expand Up @@ -137,6 +137,8 @@ const FamiliarWeight: CSQuest = {
ready: () => mySign() !== "Platypus",
completed: () => get("moonTuned"),
do: (): void => {
buy(1, $item`frilly skirt`);
buy(1, $item`maiden wig`);
unequip($item`hewn moon-rune spoon`);
visitUrl("inv_use.php?whichitem=10254&pwd&doit=96&whichsign=4");
},
Expand Down
9 changes: 1 addition & 8 deletions src/gash/cs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,7 @@ const SPECIAL_REQUIREMENTS: Record<
bootRequirement($item`mountain lion skin`),
],
Muscle: [bootRequirement($item`grizzled bearskin`)],
Mysticality: [
{
name: "Meteor Necklace",
meets: () => !args.softcore || have($item`meteorite necklace`),
reason: "we don't start in a canadian moonsign!",
},
bootRequirement($item`frontwinder skin`),
],
Mysticality: [bootRequirement($item`frontwinder skin`)],
};

export function main(input = ""): void {
Expand Down
33 changes: 17 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import BoozeDrop from "./boozedrop";
import CoilWire from "./coilwire";
import Drink from "./drinking";
import { CSEngine } from "./engine";
import FamiliarWeight from "./familiarweight";
import HotRes from "./hotres";
Expand All @@ -10,19 +9,21 @@ import Prologue from "./prologue";
import Spell from "./spell";
import StatTests from "./stattests";
import Weapon from "./weapon";
import { sinceKolmafiaRevision } from "libram";
import { logger, LogLevels, sinceKolmafiaRevision } from "libram";

sinceKolmafiaRevision(28500);
CSEngine.runTests(
Prologue,
CoilWire,
Level,
...StatTests,
Drink,
HotRes,
Noncombat,
FamiliarWeight,
Weapon,
Spell,
BoozeDrop
);
export function main() {
sinceKolmafiaRevision(28500);
logger.setLevel(LogLevels.DEBUG);
CSEngine.runTests(
Prologue,
CoilWire,
Level,
...StatTests,
HotRes,
Noncombat,
FamiliarWeight,
Weapon,
Spell,
BoozeDrop
);
}
Loading