libram 0.8.30 → 0.8.31

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.
@@ -7,11 +7,10 @@ import * as Bandersnatch from "../resources/2009/Bandersnatch";
7
7
  import * as StompingBoots from "../resources/2011/StompingBoots";
8
8
  import { $effect, $familiar, $item, $items, $skill } from "../template-string";
9
9
  import { ActionSource, findActionSource, } from "./ActionSource";
10
- // eslint-disable-next-line libram/verify-constants
11
- const EVERYTHING_LOOKS_GREEN = $effect `Everything Looks Green`;
10
+ const everythingLooksGreen = () => have($effect `Everything Looks Green`) ? 0 : 1;
12
11
  const freeRunSources = [
13
12
  // Free unlimited source
14
- new ActionSource($item `spring shoes`, () => (have(EVERYTHING_LOOKS_GREEN) ? 1 : 0), Macro.skill($skill `Spring Away`), {
13
+ new ActionSource($item `spring shoes`, everythingLooksGreen, Macro.skill($skill `Spring Away`), {
15
14
  equipmentRequirements: () => new Requirement([], { forceEquip: $items `spring shoes` }),
16
15
  }),
17
16
  // Free limited sources
@@ -45,7 +44,7 @@ const freeRunSources = [
45
44
  cost: () => Math.min(ActionSource.defaultPriceFunction($item `peppermint sprout`) * 5, ActionSource.defaultPriceFunction($item `peppermint parasol`)) / 10, // Breaks after 10 successful runaways.
46
45
  }),
47
46
  // unlimited items that trigger everything looks green
48
- ...$items `green smoke bomb, tattered scrap of paper, GOTO, T.U.R.D.S. Key`.map((item) => new ActionSource(item, () => (have(EVERYTHING_LOOKS_GREEN) ? 0 : 1), Macro.item(item), {
47
+ ...$items `green smoke bomb, tattered scrap of paper, GOTO, T.U.R.D.S. Key`.map((item) => new ActionSource(item, everythingLooksGreen, Macro.item(item), {
49
48
  preparation: () => retrieveItem(item),
50
49
  cost: () => ActionSource.defaultPriceFunction(item),
51
50
  })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libram",
3
- "version": "0.8.30",
3
+ "version": "0.8.31",
4
4
  "description": "JavaScript helper library for KoLmafia",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",