isaacscript-common 47.2.0 → 47.3.0

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.
@@ -979,6 +979,9 @@ export declare function angleToDirection(angleDegrees: int): Direction;
979
979
  /** Helper type to represent any class. (This is the same type as any class constructor.) */
980
980
  export declare type AnyClass = new () => object;
981
981
 
982
+ /** Alias for the `anySeedEffectEnabled` function. */
983
+ export declare function anyEasterEggEnabled(): boolean;
984
+
982
985
  /**
983
986
  * A type union that matches `Entity`, `EntityBomb`, `EntityEffect`, and so on.
984
987
  *
@@ -1051,6 +1054,8 @@ export declare function anyPlayerHoldingItem(): boolean;
1051
1054
  */
1052
1055
  export declare function anyPlayerIs(...matchingCharacters: PlayerType[]): boolean;
1053
1056
 
1057
+ export declare function anySeedEffectEnabled(): boolean;
1058
+
1054
1059
  declare type Arr<N extends number, T extends unknown[] = []> = T["length"] extends N ? T : Arr<N, [...T, unknown]>;
1055
1060
 
1056
1061
  declare type Arr_2<N extends number, T extends unknown[] = []> = T["length"] extends N ? T : Arr_2<N, [...T, unknown]>;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 47.2.0
3
+ isaacscript-common 47.3.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -20100,6 +20100,7 @@ local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
20100
20100
  local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
20101
20101
  local PocketItemSlot = ____isaac_2Dtypescript_2Ddefinitions.PocketItemSlot
20102
20102
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
20103
+ local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
20103
20104
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
20104
20105
  local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
20105
20106
  local ____HealthType = require("src.enums.HealthType")
@@ -20126,6 +20127,7 @@ ____exports.PILL_COLOR_VALUES = getEnumValues(nil, PillColor)
20126
20127
  ____exports.PLAYER_FORM_VALUES = getEnumValues(nil, PlayerForm)
20127
20128
  ____exports.POCKET_ITEM_SLOT_VALUES = getEnumValues(nil, PocketItemSlot)
20128
20129
  ____exports.ROOM_SHAPE_VALUES = getEnumValues(nil, RoomShape)
20130
+ ____exports.SEED_EFFECTS = getEnumValues(nil, SeedEffect)
20129
20131
  ____exports.SERIALIZATION_BRAND_VALUES = getEnumValues(nil, SerializationBrand)
20130
20132
  ____exports.SOUND_EFFECT_VALUES = getEnumValues(nil, SoundEffect)
20131
20133
  ____exports.PLAYER_STAT_VALUES = getEnumValues(nil, PlayerStat)
@@ -22500,11 +22502,16 @@ end
22500
22502
  return ____exports
22501
22503
  end,
22502
22504
  ["src.functions.run"] = function(...)
22505
+ local ____lualib = require("lualib_bundle")
22506
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
22503
22507
  local ____exports = {}
22504
22508
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
22505
22509
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
22506
22510
  local Difficulty = ____isaac_2Dtypescript_2Ddefinitions.Difficulty
22511
+ local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
22507
22512
  local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
22513
+ local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
22514
+ local SEED_EFFECTS = ____cachedEnumValues.SEED_EFFECTS
22508
22515
  local ____cachedClasses = require("src.core.cachedClasses")
22509
22516
  local game = ____cachedClasses.game
22510
22517
  local ____constants = require("src.core.constants")
@@ -22517,6 +22524,16 @@ local ____entitiesSpecific = require("src.functions.entitiesSpecific")
22517
22524
  local spawnSlot = ____entitiesSpecific.spawnSlot
22518
22525
  local ____log = require("src.functions.log")
22519
22526
  local log = ____log.log
22527
+ function ____exports.anySeedEffectEnabled(self)
22528
+ local seeds = game:GetSeeds()
22529
+ return __TS__ArraySome(
22530
+ SEED_EFFECTS,
22531
+ function(____, seedEffect) return seedEffect ~= SeedEffect.NORMAL and seeds:HasSeedEffect(seedEffect) end
22532
+ )
22533
+ end
22534
+ function ____exports.anyEasterEggEnabled(self)
22535
+ return ____exports.anySeedEffectEnabled(nil)
22536
+ end
22520
22537
  function ____exports.canRunUnlockAchievements(self)
22521
22538
  local greedDonationMachine = spawnSlot(nil, SlotVariant.GREED_DONATION_MACHINE, 0, VectorZero)
22522
22539
  local canUnlockAchievements = greedDonationMachine:Exists()
@@ -1,4 +1,4 @@
1
- import { ActiveSlot, CacheFlag, ControllerIndex, DoorSlot, DoorSlotFlag, GridEntityType, GridEntityXMLType, ItemConfigCardType, ItemConfigTag, ItemPoolType, Keyboard, PillColor, PlayerForm, PocketItemSlot, RoomShape, SoundEffect, TrinketSlot } from "isaac-typescript-definitions";
1
+ import { ActiveSlot, CacheFlag, ControllerIndex, DoorSlot, DoorSlotFlag, GridEntityType, GridEntityXMLType, ItemConfigCardType, ItemConfigTag, ItemPoolType, Keyboard, PillColor, PlayerForm, PocketItemSlot, RoomShape, SeedEffect, SoundEffect, TrinketSlot } from "isaac-typescript-definitions";
2
2
  import { HealthType } from "../enums/HealthType";
3
3
  import { PlayerStat } from "../enums/PlayerStat";
4
4
  import { SerializationBrand } from "../enums/private/SerializationBrand";
@@ -18,6 +18,7 @@ export declare const PILL_COLOR_VALUES: readonly PillColor[];
18
18
  export declare const PLAYER_FORM_VALUES: readonly PlayerForm[];
19
19
  export declare const POCKET_ITEM_SLOT_VALUES: readonly PocketItemSlot[];
20
20
  export declare const ROOM_SHAPE_VALUES: readonly RoomShape[];
21
+ export declare const SEED_EFFECTS: readonly SeedEffect[];
21
22
  export declare const SERIALIZATION_BRAND_VALUES: readonly SerializationBrand[];
22
23
  export declare const SOUND_EFFECT_VALUES: readonly SoundEffect[];
23
24
  export declare const PLAYER_STA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EAA4B,CAAC;AAE7E,eAAO,MAAM,uBAAuB,EAAE,SAAS,cAAc,EAC9B,CAAC;AAEhC,eAAO,MAAM,2BAA2B,EAAE,SAAS,iBAAiB,EAClC,CAAC;AAEnC,eAAO,MAAM,sBAAsB,EAAE,SAAS,aAAa,EAC7B,CAAC;AAE/B,eAAO,MAAM,4BAA4B,EAAE,SAAS,kBAAkB,EACnC,CAAC;AAEpC,eAAO,MAAM,qBAAqB,EAAE,SAAS,YAAY,EAC5B,CAAC;AAE9B,eAAO,MAAM,eAAe,EAAE,SAAS,QAAQ,EAA4B,CAAC;AAE5E,eAAO,MAAM,kBAAkB,EAAE,SAAS,UAAU,EACzB,CAAC;AAE5B,eAAO,MAAM,iBAAiB,EAAE,SAAS,SAAS,EAA6B,CAAC;AAEhF,eAAO,MAAM,kBAAkB,EAAE,SAAS,UAAU,EACzB,CAAC;AAE5B,eAAO,MAAM,uBAAuB,EAAE,SAAS,cAAc,EAC9B,CAAC;AAEhC,eAAO,MAAM,iBAAiB,EAAE,SAAS,SAAS,EAA6B,CAAC;AAEhF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAA8B,CAAC;AAE7E,eAAO,MAAM,0BAA0B,EAAE,SAAS,kBAAkB,EACjC,CAAC;AAEpC,eAAO,MAAM,mBAAmB,EAAE,SAAS,WAAW,EAC1B,CAAC;AAE7B,eAAO,MAAM,kBAAkB,EAAE,SAAS,UAAU,EACzB,CAAC;AAE5B,eAAO,MAAM,mBAAmB,EAAE,SAAS,WAAW,EAC1B,CAAC"}
@@ -15,6 +15,7 @@ local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
15
15
  local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
16
16
  local PocketItemSlot = ____isaac_2Dtypescript_2Ddefinitions.PocketItemSlot
17
17
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
18
+ local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
18
19
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
19
20
  local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
20
21
  local ____HealthType = require("src.enums.HealthType")
@@ -41,6 +42,7 @@ ____exports.PILL_COLOR_VALUES = getEnumValues(nil, PillColor)
41
42
  ____exports.PLAYER_FORM_VALUES = getEnumValues(nil, PlayerForm)
42
43
  ____exports.POCKET_ITEM_SLOT_VALUES = getEnumValues(nil, PocketItemSlot)
43
44
  ____exports.ROOM_SHAPE_VALUES = getEnumValues(nil, RoomShape)
45
+ ____exports.SEED_EFFECTS = getEnumValues(nil, SeedEffect)
44
46
  ____exports.SERIALIZATION_BRAND_VALUES = getEnumValues(nil, SerializationBrand)
45
47
  ____exports.SOUND_EFFECT_VALUES = getEnumValues(nil, SoundEffect)
46
48
  ____exports.PLAYER_STAT_VALUES = getEnumValues(nil, PlayerStat)
@@ -1,4 +1,7 @@
1
1
  import type { PlayerType } from "isaac-typescript-definitions";
2
+ /** Alias for the `anySeedEffectEnabled` function. */
3
+ export declare function anyEasterEggEnabled(): boolean;
4
+ export declare function anySeedEffectEnabled(): boolean;
2
5
  /**
3
6
  * Helper function to see if the current run can unlock achievements. For example, if playing on a
4
7
  * set seed or in a victory lap, achievements are disabled.
@@ -1 +1 @@
1
- {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAa/D;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../../src/functions/run.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAe/D,qDAAqD;AACrD,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED,wBAAgB,oBAAoB,IAAI,OAAO,CAO9C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAUlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAKrC;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAMnC;AAED;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,IAAI,CAkBpD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAUlC"}
@@ -1,8 +1,13 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
1
3
  local ____exports = {}
2
4
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
5
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
4
6
  local Difficulty = ____isaac_2Dtypescript_2Ddefinitions.Difficulty
7
+ local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
5
8
  local SlotVariant = ____isaac_2Dtypescript_2Ddefinitions.SlotVariant
9
+ local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
10
+ local SEED_EFFECTS = ____cachedEnumValues.SEED_EFFECTS
6
11
  local ____cachedClasses = require("src.core.cachedClasses")
7
12
  local game = ____cachedClasses.game
8
13
  local ____constants = require("src.core.constants")
@@ -15,6 +20,17 @@ local ____entitiesSpecific = require("src.functions.entitiesSpecific")
15
20
  local spawnSlot = ____entitiesSpecific.spawnSlot
16
21
  local ____log = require("src.functions.log")
17
22
  local log = ____log.log
23
+ function ____exports.anySeedEffectEnabled(self)
24
+ local seeds = game:GetSeeds()
25
+ return __TS__ArraySome(
26
+ SEED_EFFECTS,
27
+ function(____, seedEffect) return seedEffect ~= SeedEffect.NORMAL and seeds:HasSeedEffect(seedEffect) end
28
+ )
29
+ end
30
+ --- Alias for the `anySeedEffectEnabled` function.
31
+ function ____exports.anyEasterEggEnabled(self)
32
+ return ____exports.anySeedEffectEnabled(nil)
33
+ end
18
34
  --- Helper function to see if the current run can unlock achievements. For example, if playing on a
19
35
  -- set seed or in a victory lap, achievements are disabled.
20
36
  function ____exports.canRunUnlockAchievements(self)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "47.2.0",
3
+ "version": "47.3.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -16,6 +16,7 @@ import {
16
16
  PlayerForm,
17
17
  PocketItemSlot,
18
18
  RoomShape,
19
+ SeedEffect,
19
20
  SoundEffect,
20
21
  TrinketSlot,
21
22
  } from "isaac-typescript-definitions";
@@ -67,6 +68,8 @@ export const POCKET_ITEM_SLOT_VALUES: readonly PocketItemSlot[] =
67
68
 
68
69
  export const ROOM_SHAPE_VALUES: readonly RoomShape[] = getEnumValues(RoomShape);
69
70
 
71
+ export const SEED_EFFECTS: readonly SeedEffect[] = getEnumValues(SeedEffect);
72
+
70
73
  export const SERIALIZATION_BRAND_VALUES: readonly SerializationBrand[] =
71
74
  getEnumValues(SerializationBrand);
72
75
 
@@ -2,8 +2,10 @@ import type { PlayerType } from "isaac-typescript-definitions";
2
2
  import {
3
3
  Challenge,
4
4
  Difficulty,
5
+ SeedEffect,
5
6
  SlotVariant,
6
7
  } from "isaac-typescript-definitions";
8
+ import { SEED_EFFECTS } from "../arrays/cachedEnumValues";
7
9
  import { game } from "../core/cachedClasses";
8
10
  import { VectorZero } from "../core/constants";
9
11
  import { FIRST_CHARACTER } from "../core/constantsFirstLast";
@@ -11,6 +13,20 @@ import { getCharacterName } from "./characters";
11
13
  import { spawnSlot } from "./entitiesSpecific";
12
14
  import { log } from "./log";
13
15
 
16
+ /** Alias for the `anySeedEffectEnabled` function. */
17
+ export function anyEasterEggEnabled(): boolean {
18
+ return anySeedEffectEnabled();
19
+ }
20
+
21
+ export function anySeedEffectEnabled(): boolean {
22
+ const seeds = game.GetSeeds();
23
+
24
+ return SEED_EFFECTS.some(
25
+ (seedEffect) =>
26
+ seedEffect !== SeedEffect.NORMAL && seeds.HasSeedEffect(seedEffect),
27
+ );
28
+ }
29
+
14
30
  /**
15
31
  * Helper function to see if the current run can unlock achievements. For example, if playing on a
16
32
  * set seed or in a victory lap, achievements are disabled.