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: 6 additions & 0 deletions src/engine/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ export class Engine extends BaseEngine {
if (task.combat !== undefined && myHp() < myMaxhp() * 0.9) useSkill($skill`Cannelloni Cocoon`);
}

markAttempt(task: Task): void {
if (!(task.name in this.attempts)) this.attempts[task.name] = 0;
if (!task.attempted || task.attempted()) this.attempts[task.name]++;
else set("lastEncounter", "");
}

initPropertiesManager(manager: PropertiesManager): void {
super.initPropertiesManager(manager);
const bannedAutoRestorers = [
Expand Down
4 changes: 3 additions & 1 deletion src/engine/task.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Quest as BaseQuest, Task as BaseTask } from "grimoire-kolmafia";

export type Quest = BaseQuest<Task>;
export type Task = BaseTask;
export type Task = BaseTask & {
attempted?: () => boolean;
};
33 changes: 24 additions & 9 deletions src/tasks/runstart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ export const RunStartQuest: Quest = {
completed: () =>
mainStat === $stat`Moxie` || !have($item`Peridot of Peril`) || have($item`cherry`),
do: $location`The Skeleton Store`,
choices: { 1060: 5 },
combat: new CombatStrategy().macro(
Macro.if_($monster`time cop`, Macro.default())
.if_(
Expand All @@ -991,6 +992,10 @@ export const RunStartQuest: Quest = {
use($item`MayDay™ supply package`, 1);
if (have($item`space blanket`)) autosell($item`space blanket`, 1);
},
attempted: () =>
!["Skeletons In Store", "Temporarily Out of Skeletons", "time cop"].includes(
get("lastEncounter"),
),
limit: { tries: 2 },
},
{
Expand Down Expand Up @@ -1047,6 +1052,10 @@ export const RunStartQuest: Quest = {
use($item`MayDay™ supply package`, 1);
if (have($item`space blanket`)) autosell($item`space blanket`, 1);
},
attempted: () =>
!["Skeletons In Store", "Temporarily Out of Skeletons", "time cop"].includes(
get("lastEncounter"),
),
limit: { tries: 2 },
},
{
Expand All @@ -1068,16 +1077,18 @@ export const RunStartQuest: Quest = {
completedSkeletonBanishes() ||
!haveFreeSkeletonBanish())),
do: $location`The Skeleton Store`,
choices: { 1060: 5 },
combat: new CombatStrategy().macro(() =>
Macro.if_(
"!haseffect Everything Looks Yellow",
Macro.if_(
$monster`novelty tropical skeleton`,
Macro.externalIf(useParkaSpit, Macro.trySkill($skill`Spit jurassic acid`))
.trySkill($skill`Blow the Yellow Candle!`)
.tryItem($item`yellow rocket`),
),
)
Macro.if_($monster`time cop`, Macro.default())
.if_(
"!haseffect Everything Looks Yellow",
Macro.if_(
$monster`novelty tropical skeleton`,
Macro.externalIf(useParkaSpit, Macro.trySkill($skill`Spit jurassic acid`))
.trySkill($skill`Blow the Yellow Candle!`)
.tryItem($item`yellow rocket`),
),
)
.externalIf(
!Array.from(getBanishedMonsters().keys()).includes($skill`Bowl a Curveball`),
Macro.trySkill($skill`Bowl a Curveball`),
Expand Down Expand Up @@ -1114,6 +1125,10 @@ export const RunStartQuest: Quest = {
use($item`MayDay™ supply package`, 1);
if (have($item`space blanket`)) autosell($item`space blanket`, 1);
},
attempted: () =>
!["Skeletons In Store", "Temporarily Out of Skeletons", "time cop"].includes(
get("lastEncounter"),
),
limit: { tries: 4 },
},
{
Expand Down