-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from loathers/mini-kiwi
implement & export mini-kiwi spading project
- Loading branch information
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { | ||
Familiar, | ||
Item, | ||
currentRound, | ||
familiarWeight, | ||
getProperty, | ||
haveEquipped, | ||
lastMonster, | ||
myFamiliar, | ||
myId, | ||
myLocation, | ||
myPath, | ||
myTotalTurnsSpent, | ||
weightAdjustment, | ||
} from "kolmafia"; | ||
|
||
import { ExcavatorProject } from "../type"; | ||
import { toNormalisedString } from "../utils"; | ||
|
||
type KiwiData = { | ||
player: number; | ||
gotDrop: boolean; | ||
dropsToday: number; | ||
location: string; | ||
monster: string; | ||
baseWeight: number; | ||
buffedWeight: number; | ||
turn: number; | ||
path: string; | ||
hasGoggles: boolean; | ||
}; | ||
|
||
function spadeKiwi(encounter: string, page: string): KiwiData | null { | ||
if (currentRound() !== 0) return null; | ||
if (myFamiliar() !== Familiar.get("Mini Kiwi")) return null; | ||
|
||
return { | ||
player: Number(myId()), | ||
gotDrop: page.includes("You acquire an item: <b>mini kiwi</b>"), | ||
dropsToday: Number(getProperty("_miniKiwiDrops")), | ||
location: toNormalisedString(myLocation()), | ||
path: toNormalisedString(myPath()), | ||
baseWeight: familiarWeight(Familiar.get("Mini Kiwi")), | ||
buffedWeight: | ||
familiarWeight(Familiar.get("Mini Kiwi")) + weightAdjustment(), | ||
turn: myTotalTurnsSpent(), | ||
hasGoggles: haveEquipped(Item.get("aviator goggles")), | ||
monster: toNormalisedString(lastMonster()), | ||
}; | ||
} | ||
|
||
export const MINI_KIWI: ExcavatorProject = { | ||
name: "Mini Kiwi", | ||
description: | ||
"Determine the formula and factors of the Mini Kiwi's mini-kiwi drop rate", | ||
author: "sweaty bill", | ||
hooks: { | ||
COMBAT_ROUND: spadeKiwi, | ||
}, | ||
since: 27973, // mini kiwi familiar equipment added | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters