Skip to content

Commit

Permalink
use the hot new type
Browse files Browse the repository at this point in the history
  • Loading branch information
horrible-little-slime committed Nov 13, 2024
1 parent 85e7ebd commit 18753b9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/resources/2017/Horsery.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { cliExecute, visitUrl } from "kolmafia";
import { Modifiers } from "../../modifier.js";
import { get } from "../../property.js";
import { NumericModifier } from "../../modifierTypes.js";

/**
* @returns Whether or not the horsery is available
Expand Down Expand Up @@ -33,7 +34,7 @@ export function changeHorse(horse: Horse): boolean {
/**
* @returns a `Modifiers` object consisting of the crazy horse's stats today
*/
export function crazyHorseStats(): Modifiers {
export function crazyHorseStats(): Modifiers<NumericModifier> {
if (!have()) return {};

if (!get("_horseryCrazyName")) {
Expand Down
3 changes: 2 additions & 1 deletion src/resources/2018/LatteLoversMembersMug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Modifiers } from "../../modifier.js";
import { get } from "../../property.js";
import { $item, $location } from "../../template-string.js";
import { clamp } from "../../utils.js";
import { NumericModifier } from "../../modifierTypes.js";

/**
* @returns Whether we `have` the latte lovers member's mug
Expand Down Expand Up @@ -294,7 +295,7 @@ export function fill(
* @param ingredient A latte ingredient
* @returns An object containing the modifiers associated with that latte ingredient
*/
export function modifierOf(ingredient: Ingredient): Modifiers {
export function modifierOf(ingredient: Ingredient): Modifiers<NumericModifier> {
return INGREDIENTS[ingredient].modifier;
}

Expand Down
9 changes: 5 additions & 4 deletions src/resources/2022/Stillsuit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,22 @@ export function drinkDistillate(): boolean {
return cliExecute("drink stillsuit distillate");
}

const distillateModifiers = (pref: StringProperty): Modifiers =>
parseModifiers(pref);
const distillateModifiers = (
pref: StringProperty,
): Modifiers<NumericModifier> => parseModifiers(pref);

/**
* @returns A `Modifiers` object that contains your next Distillate modifiers
*/
export function nextDistillateModifiers(): Modifiers {
export function nextDistillateModifiers(): Modifiers<NumericModifier> {
visitUrl("inventory.php?action=distill&pwd");
return distillateModifiers("nextDistillateMods");
}

/**
* @returns A `Modifiers` object that contains your current Distillate modifiers
*/
export function currentDistillateModifiers(): Modifiers {
export function currentDistillateModifiers(): Modifiers<NumericModifier> {
return distillateModifiers("currentDistillateMods");
}

Expand Down

0 comments on commit 18753b9

Please sign in to comment.