isaacscript-common 1.2.39 → 1.2.42

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.
Files changed (53) hide show
  1. package/dist/callbacks/postPlayerChangeHealth.lua +4 -5
  2. package/dist/constants.d.ts +13 -13
  3. package/dist/features/disableInputs.d.ts +1 -1
  4. package/dist/features/saveDataManager/main.lua +2 -2
  5. package/dist/features/saveDataManager/merge.lua +2 -2
  6. package/dist/functions/array.d.ts +11 -11
  7. package/dist/functions/cards.lua +0 -2
  8. package/dist/functions/challenges.lua +0 -2
  9. package/dist/functions/collectibleCacheFlag.lua +2 -2
  10. package/dist/functions/collectibles.lua +0 -3
  11. package/dist/functions/entity.lua +1 -1
  12. package/dist/functions/familiars.d.ts +35 -4
  13. package/dist/functions/familiars.lua +19 -10
  14. package/dist/functions/flying.d.ts +1 -1
  15. package/dist/functions/globals.lua +2 -2
  16. package/dist/functions/gridEntity.lua +0 -1
  17. package/dist/functions/map.d.ts +2 -0
  18. package/dist/functions/map.lua +16 -0
  19. package/dist/functions/math.lua +3 -4
  20. package/dist/functions/pickups.lua +2 -2
  21. package/dist/functions/pills.lua +0 -2
  22. package/dist/functions/player.lua +5 -4
  23. package/dist/functions/set.d.ts +4 -4
  24. package/dist/functions/sound.lua +2 -2
  25. package/dist/functions/stage.lua +3 -4
  26. package/dist/functions/string.d.ts +5 -0
  27. package/dist/functions/string.lua +23 -0
  28. package/dist/functions/table.d.ts +6 -0
  29. package/dist/functions/table.lua +8 -0
  30. package/dist/functions/trinketCacheFlag.lua +2 -2
  31. package/dist/functions/trinkets.lua +0 -2
  32. package/dist/functions/utils.d.ts +76 -0
  33. package/dist/functions/utils.lua +56 -0
  34. package/dist/functions/vector.lua +3 -4
  35. package/dist/index.d.ts +4 -1
  36. package/dist/index.lua +25 -1
  37. package/dist/maps/cardDescriptionMap.d.ts +1 -1
  38. package/dist/maps/cardNameMap.d.ts +1 -1
  39. package/dist/maps/challengeNameMap.d.ts +1 -1
  40. package/dist/maps/collectibleDescriptionMap.d.ts +1 -1
  41. package/dist/maps/collectibleNameMap.d.ts +1 -1
  42. package/dist/maps/gridEntityXMLMap.d.ts +4 -1
  43. package/dist/maps/pillEffectClassMap.d.ts +1 -1
  44. package/dist/maps/pillEffectNameMap.d.ts +1 -1
  45. package/dist/maps/pillEffectTypeMap.d.ts +1 -1
  46. package/dist/maps/roomShapeToTopLeftWallGridIndexMap.d.ts +1 -1
  47. package/dist/maps/transformationNameMap.d.ts +1 -1
  48. package/dist/maps/trinketDescriptionMap.d.ts +1 -1
  49. package/dist/maps/trinketNameMap.d.ts +1 -1
  50. package/dist/patchErrorFunctions.lua +2 -2
  51. package/dist/sets/cards.d.ts +6 -6
  52. package/dist/types/ModUpgraded.lua +3 -4
  53. package/package.json +1 -1
@@ -8,9 +8,9 @@ local ____exports = require("features.saveDataManager.exports")
8
8
  local saveDataManager = ____exports.saveDataManager
9
9
  local ____player = require("functions.player")
10
10
  local getPlayerIndex = ____player.getPlayerIndex
11
- local ____util = require("functions.util")
12
- local ensureAllCases = ____util.ensureAllCases
13
- local getEnumValues = ____util.getEnumValues
11
+ local ____utils = require("functions.utils")
12
+ local ensureAllCases = ____utils.ensureAllCases
13
+ local getEnumValues = ____utils.getEnumValues
14
14
  local ____HealthType = require("types.HealthType")
15
15
  local HealthType = ____HealthType.HealthType
16
16
  local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
@@ -93,8 +93,7 @@ function getCurrentHealthValue(self, player, healthType)
93
93
  end
94
94
  do
95
95
  do
96
- ensureAllCases(nil, healthType)
97
- return 0
96
+ return ensureAllCases(nil, healthType)
98
97
  end
99
98
  end
100
99
  until true
@@ -11,19 +11,19 @@ export declare const AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125;
11
11
  export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.png";
12
12
  /** Bombs explode when their frame count is equal to this value. */
13
13
  export declare const BOMB_EXPLODE_FRAME = 45;
14
- export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
15
- export declare const CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART: Set<PlayerType>;
16
- export declare const CHARACTERS_WITH_FREE_DEVIL_DEALS: Set<PlayerType>;
14
+ export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: ReadonlySet<PlayerType>;
15
+ export declare const CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART: ReadonlySet<PlayerType>;
16
+ export declare const CHARACTERS_WITH_FREE_DEVIL_DEALS: ReadonlySet<PlayerType>;
17
17
  /**
18
18
  * The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
19
19
  * Baby). This includes The Lost and Tainted Lost. This does not include Keeper or Tainted Keeper.
20
20
  */
21
- export declare const CHARACTERS_WITH_NO_RED_HEARTS: Set<PlayerType>;
21
+ export declare const CHARACTERS_WITH_NO_RED_HEARTS: ReadonlySet<PlayerType>;
22
22
  /**
23
23
  * The set of characters where soul hearts will be automatically stripped away (e.g. Bethany). This
24
24
  * includes The Lost and Tainted Lost.
25
25
  */
26
- export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: Set<PlayerType>;
26
+ export declare const CHARACTERS_WITH_NO_SOUL_HEARTS: ReadonlySet<PlayerType>;
27
27
  /**
28
28
  * A collection of common colors that can be reused. Note that if you want to further modify these
29
29
  * colors, you should copy them first with the `copyColor` function.
@@ -53,7 +53,7 @@ export declare const EGGY_STATE_FRAME_OF_FINAL_SPIDER = 45;
53
53
  * information, see the documentation for the `clearSprite()` helper function.
54
54
  */
55
55
  export declare const EMPTY_PNG_PATH = "gfx/none.png";
56
- export declare const FAMILIARS_THAT_SHOOT_PLAYER_TEARS: Set<FamiliarVariant>;
56
+ export declare const FAMILIARS_THAT_SHOOT_PLAYER_TEARS: ReadonlySet<FamiliarVariant>;
57
57
  /** As of Repentance, the final stage is floor 13 (which is the Home floor). */
58
58
  export declare const FINAL_STAGE: number;
59
59
  /**
@@ -72,7 +72,7 @@ export declare const ISAAC_FRAMES_PER_SECOND = 60;
72
72
  * This is the set of characters that look like The Lost and play the "LostDeath" animation when
73
73
  * they die.
74
74
  */
75
- export declare const LOST_STYLE_PLAYER_TYPES: Set<PlayerType>;
75
+ export declare const LOST_STYLE_PLAYER_TYPES: ReadonlySet<PlayerType>;
76
76
  /** In a 2x2 room, there can be 8 doors. */
77
77
  export declare const MAX_NUM_DOORS = 8;
78
78
  /**
@@ -104,13 +104,13 @@ export declare const MAX_VANILLA_CHARACTER = PlayerType.PLAYER_THESOUL_B;
104
104
  export declare const MAX_VANILLA_COLLECTIBLE_TYPE = CollectibleType.COLLECTIBLE_MOMS_RING;
105
105
  export declare const SECOND_IN_MILLISECONDS = 1000;
106
106
  export declare const MINUTE_IN_MILLISECONDS: number;
107
- export declare const MOVEMENT_ACTIONS: ButtonAction[];
108
- export declare const MOVEMENT_ACTIONS_SET: Set<ButtonAction>;
107
+ export declare const MOVEMENT_ACTIONS: readonly ButtonAction[];
108
+ export declare const MOVEMENT_ACTIONS_SET: ReadonlySet<ButtonAction>;
109
109
  export declare const ONE_BY_ONE_ROOM_GRID_SIZE = 135;
110
- export declare const SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES: Set<CollectibleType>;
111
- export declare const SHOOTING_ACTIONS: ButtonAction[];
112
- export declare const SHOOTING_ACTIONS_SET: Set<ButtonAction>;
113
- export declare const STORY_BOSSES: Set<EntityType>;
110
+ export declare const SINGLE_USE_ACTIVE_COLLECTIBLE_TYPES: ReadonlySet<CollectibleType>;
111
+ export declare const SHOOTING_ACTIONS: readonly ButtonAction[];
112
+ export declare const SHOOTING_ACTIONS_SET: ReadonlySet<ButtonAction>;
113
+ export declare const STORY_BOSSES: ReadonlySet<EntityType>;
114
114
  /**
115
115
  * This is the number of draw coordinates that each heart spans on the UI in the upper left hand
116
116
  * corner.
@@ -22,7 +22,7 @@ export declare function disableAllInputs(): void;
22
22
  * Note that calling any of the various `enable` or `disable` functions will override the effects of
23
23
  * this function.
24
24
  */
25
- export declare function enableAllInputsExceptFor(blacklist: Set<ButtonAction>): void;
25
+ export declare function enableAllInputsExceptFor(blacklist: Set<ButtonAction> | ReadonlySet<ButtonAction>): void;
26
26
  /**
27
27
  * Helper function to disable all inputs besides the ones provided.
28
28
  * This is useful because `EntityPlayer.ControlsEnabled` can be changed by the game under certain
@@ -8,8 +8,8 @@ local getUpgradeErrorMsg = ____errors.getUpgradeErrorMsg
8
8
  local ____deepCopy = require("functions.deepCopy")
9
9
  local deepCopy = ____deepCopy.deepCopy
10
10
  local SerializationType = ____deepCopy.SerializationType
11
- local ____util = require("functions.util")
12
- local tableClear = ____util.tableClear
11
+ local ____table = require("functions.table")
12
+ local tableClear = ____table.tableClear
13
13
  local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
14
14
  local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
15
15
  local ____SaveData = require("types.SaveData")
@@ -20,8 +20,8 @@ local isSerializedVector = ____deepCopy.isSerializedVector
20
20
  local SerializationType = ____deepCopy.SerializationType
21
21
  local ____log = require("functions.log")
22
22
  local log = ____log.log
23
- local ____util = require("functions.util")
24
- local tableClear = ____util.tableClear
23
+ local ____table = require("functions.table")
24
+ local tableClear = ____table.tableClear
25
25
  function ____exports.merge(self, oldObject, newTable, traversalDescription)
26
26
  local oldObjectType = type(oldObject)
27
27
  if oldObjectType ~= "table" then
@@ -5,16 +5,16 @@
5
5
  * specified arrays. This function is variadic, meaning that you can specify N arguments to combine
6
6
  * N arrays. Note that this will only perform a shallow copy of the array elements.
7
7
  */
8
- export declare function arrayCombine<T>(...arrays: T[][]): T[];
8
+ export declare function arrayCombine<T>(...arrays: Array<T[] | readonly T[]>): T[];
9
9
  /** Helper function to perform a shallow copy. */
10
- export declare function arrayCopy<T>(array: T[]): T[];
10
+ export declare function arrayCopy<T>(array: T[] | readonly T[]): T[];
11
11
  export declare function arrayEmpty<T>(array: T[]): void;
12
12
  /**
13
13
  * Helper function for determining if two arrays contain the exact same elements. Note that this
14
14
  * only performs a shallow comparison.
15
15
  */
16
- export declare function arrayEquals<T>(array1: T[], array2: T[]): boolean;
17
- export declare function arrayInArray<T>(arrayToMatch: T[], parentArray: T[][]): boolean;
16
+ export declare function arrayEquals<T>(array1: T[] | readonly T[], array2: T[] | readonly T[]): boolean;
17
+ export declare function arrayInArray<T>(arrayToMatch: T[] | readonly T[], parentArray: Array<T[] | readonly T[]>): boolean;
18
18
  /**
19
19
  * Initializes an array with all elements containing the specified default value.
20
20
  *
@@ -29,14 +29,14 @@ export declare function arrayInit<T>(defaultValue: T, size: int): T[];
29
29
  *
30
30
  * From: https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array
31
31
  */
32
- export declare function arrayShuffle<T>(originalArray: T[], seed?: number): T[];
32
+ export declare function arrayShuffle<T>(originalArray: T[] | readonly T[], seed?: number): T[];
33
33
  /**
34
34
  * Shuffles the provided array in-place using the Fisher-Yates algorithm.
35
35
  *
36
36
  * From: https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array
37
37
  */
38
38
  export declare function arrayShuffleInPlace<T>(array: T[], seed?: number): void;
39
- export declare function arraySum(array: int[]): int;
39
+ export declare function arraySum(array: number[] | readonly number[]): number;
40
40
  export declare function arrayToString<T>(array: T[]): string;
41
41
  /**
42
42
  * Shallow copies and removes the specified element(s) from the array. Returns the copied array. If
@@ -45,14 +45,14 @@ export declare function arrayToString<T>(array: T[]): string;
45
45
  *
46
46
  * This function is variadic, meaning that you can specify N arguments to remove N elements.
47
47
  */
48
- export declare function arrayRemove<T>(originalArray: T[], ...elements: T[]): T[];
48
+ export declare function arrayRemove<T>(originalArray: T[] | readonly T[], ...elements: T[]): T[];
49
49
  /**
50
50
  * Removes the specified element(s) from the array. If the specified element(s) are not found in the
51
51
  * array, this function will do nothing. Returns whether or not one or more elements were removed.
52
52
  *
53
53
  * This function is variadic, meaning that you can specify N arguments to remove N elements.
54
54
  */
55
- export declare function arrayRemoveInPlace<T>(array: T[], ...elements: T[]): boolean;
55
+ export declare function arrayRemoveInPlace<T>(array: T[], ...elements: T[] | readonly T[]): boolean;
56
56
  /**
57
57
  * Helper function to get a random element from the provided array.
58
58
  *
@@ -60,7 +60,7 @@ export declare function arrayRemoveInPlace<T>(array: T[], ...elements: T[]): boo
60
60
  * @param seed Optional. The seed used to select the random element. `Random()` by default.
61
61
  * @param exceptions Optional. An array of elements to skip over if selected.
62
62
  */
63
- export declare function getRandomArrayElement<T>(array: T[], seed?: number, exceptions?: T[]): T;
63
+ export declare function getRandomArrayElement<T>(array: T[] | readonly T[], seed?: number, exceptions?: T[] | readonly T[]): T;
64
64
  /**
65
65
  * Helper function to get a random element from the provided array. Once the random element is
66
66
  * decided, it is then removed from the array (in-place).
@@ -69,8 +69,8 @@ export declare function getRandomArrayElement<T>(array: T[], seed?: number, exce
69
69
  * @param seed Optional. The seed used to select the random element. `Random()` by default.
70
70
  * @param exceptions Optional. An array of elements to skip over if selected.
71
71
  */
72
- export declare function getRandomArrayElementAndRemove<T>(array: T[], seed?: number, exceptions?: T[]): T;
73
- export declare function getRandomArrayIndex<T>(array: T[], seed?: number): int;
72
+ export declare function getRandomArrayElementAndRemove<T>(array: T[], seed?: number, exceptions?: T[] | readonly T[]): T;
73
+ export declare function getRandomArrayIndex<T>(array: T[] | readonly T[], seed?: number): int;
74
74
  /**
75
75
  * Since Lua uses tables for every non-primitive data structure, it is non-trivial to determine if a
76
76
  * particular table is being used as an array. isArray returns true if:
@@ -1,7 +1,5 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____lualib = require("lualib_bundle")
3
- local Map = ____lualib.Map
4
- local Set = ____lualib.Set
5
3
  local __TS__ArrayPush = ____lualib.__TS__ArrayPush
6
4
  local ____exports = {}
7
5
  local ____cardDescriptionMap = require("maps.cardDescriptionMap")
@@ -1,6 +1,4 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
- local ____lualib = require("lualib_bundle")
3
- local Map = ____lualib.Map
4
2
  local ____exports = {}
5
3
  local ____challengeNameMap = require("maps.challengeNameMap")
6
4
  local CHALLENGE_NAME_MAP = ____challengeNameMap.CHALLENGE_NAME_MAP
@@ -11,8 +11,8 @@ local collectibleHasCacheFlag = ____collectibles.collectibleHasCacheFlag
11
11
  local getMaxCollectibleID = ____collectibles.getMaxCollectibleID
12
12
  local ____set = require("functions.set")
13
13
  local copySet = ____set.copySet
14
- local ____util = require("functions.util")
15
- local getEnumValues = ____util.getEnumValues
14
+ local ____utils = require("functions.utils")
15
+ local getEnumValues = ____utils.getEnumValues
16
16
  local CACHE_FLAG_TO_COLLECTIBLES_MAP = __TS__New(Map)
17
17
  local function initCacheFlagMap(self)
18
18
  local maxCollectibleID = getMaxCollectibleID(nil)
@@ -1,7 +1,4 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
- local ____lualib = require("lualib_bundle")
3
- local Set = ____lualib.Set
4
- local Map = ____lualib.Map
5
2
  local ____exports = {}
6
3
  local COLLECTIBLE_SPRITE_LAYER, COLLECTIBLE_SHADOW_LAYER
7
4
  local ____constants = require("constants")
@@ -1,8 +1,8 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____lualib = require("lualib_bundle")
3
- local Set = ____lualib.Set
4
3
  local __TS__ArraySome = ____lualib.__TS__ArraySome
5
4
  local __TS__ArrayPush = ____lualib.__TS__ArrayPush
5
+ local Set = ____lualib.Set
6
6
  local __TS__New = ____lualib.__TS__New
7
7
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
8
8
  local Map = ____lualib.Map
@@ -1,21 +1,52 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Helper function to add and remove familiars based on a target amount that you specify. Use this
4
+ * instead of the `EntityPlayer.CheckFamiliar` method so that the InitSeed of the spawned familiar
5
+ * will be set properly. Note that when using this function, you need to manually account for Box of
6
+ * Friends (by looking at the number of collectible effects on the player for Box of Friends).
7
+ *
8
+ * This function is meant to be called in the EvaluateCache callback (when the cache flag is equal
9
+ * to `CacheFlag.CACHE_FAMILIARS`).
10
+ *
11
+ * Note that this function is only meant to be used in special circumstances. For general purpose
12
+ * usage, please use the `checkFamiliarFromCollectibles` helper function instead.
13
+ *
14
+ * @param player The player that owns the familiars.
15
+ * @param collectibleType The collectible type of the collectible associated with this familiar.
16
+ * @param numTargetFamiliars The number of familiars that should exist. This function will add or
17
+ * remove familiars until it matches the target count.
18
+ * @param familiarVariant The variant of the familiar to spawn or remove.
19
+ * @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. If not
20
+ * specified, it will search for existing familiars of all sub-types, and spawn new familiars with a
21
+ * sub-type of 0.
22
+ * @returns The amount of familiars that were added or removed. For example, the player has 0
23
+ * collectibles and there were 2 familiars, this function would remove the 2 familiars and return
24
+ * -2.
25
+ */
26
+ export declare function checkFamiliar(player: EntityPlayer, collectibleType: int, numTargetFamiliars: int, familiarVariant: int, familiarSubType?: int): int;
2
27
  /**
3
28
  * Helper function to add and remove familiars based on the amount of associated collectibles that a
4
29
  * player has. Use this instead of the `EntityPlayer.CheckFamiliar` method so that the InitSeed of
5
- * the spawned familiar will be set properly and Box of Friends functions correctly.
30
+ * the spawned familiar will be set properly and Box of Friends is handled automatically.
6
31
  *
7
32
  * This function is meant to be called in the EvaluateCache callback (when the cache flag is equal
8
33
  * to `CacheFlag.CACHE_FAMILIARS`).
9
34
  *
10
- * @param player The player that has the collectibles for this familiar.
35
+ * Use this function when the amount of familiars should be equal to the amount of associated
36
+ * collectibles that the player has (plus any extras from having used Box of Friends). If you
37
+ * instead need to have a custom amount of familiars, use the `checkFamiliars` function instead.
38
+ *
39
+ * @param player The player that owns the familiars and collectibles.
11
40
  * @param collectibleType The collectible type of the collectible associated with this familiar.
12
41
  * @param familiarVariant The variant of the familiar to spawn or remove.
13
- * @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. 0 by default.
42
+ * @param familiarSubType Optional. The sub-type of the familiar to spawn or remove. If not
43
+ * specified, it will search for existing familiars of all sub-types, and spawn new familiars with a
44
+ * sub-type of 0.
14
45
  * @returns The amount of familiars that were added or removed. For example, the player has 0
15
46
  * collectibles and there were 2 familiars, this function would remove the 2 familiars and return
16
47
  * -2.
17
48
  */
18
- export declare function checkFamiliar(player: EntityPlayer, collectibleType: int, familiarVariant: int, familiarSubType?: int): int;
49
+ export declare function checkFamiliarFromCollectibles(player: EntityPlayer, collectibleType: int, familiarVariant: int, familiarSubType?: int): int;
19
50
  /**
20
51
  * Helper function to get all of the familiars in the room.
21
52
  *
@@ -1,6 +1,5 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____lualib = require("lualib_bundle")
3
- local Set = ____lualib.Set
4
3
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
5
4
  local __TS__ArrayPush = ____lualib.__TS__ArrayPush
6
5
  local ____exports = {}
@@ -26,7 +25,7 @@ function ____exports.getFamiliars(self, matchingVariant, matchingSubType)
26
25
  end
27
26
  return familiars
28
27
  end
29
- function ____exports.checkFamiliar(self, player, collectibleType, familiarVariant, familiarSubType)
28
+ function ____exports.checkFamiliar(self, player, collectibleType, numTargetFamiliars, familiarVariant, familiarSubType)
30
29
  local game = Game()
31
30
  local familiarSubTypeToSearchFor = familiarSubType == nil and -1 or familiarSubType
32
31
  local playerPtrHash = GetPtrHash(player)
@@ -35,15 +34,11 @@ function ____exports.checkFamiliar(self, player, collectibleType, familiarVarian
35
34
  familiars,
36
35
  function(____, familiar) return GetPtrHash(familiar.Player) == playerPtrHash end
37
36
  )
38
- local numCollectibles = player:GetCollectibleNum(collectibleType)
39
- local effects = player:GetEffects()
40
- local numBoxOfFriendsUses = effects:GetCollectibleEffectNum(CollectibleType.COLLECTIBLE_BOX_OF_FRIENDS)
41
- local numFamiliarsThatShouldExist = numCollectibles * (numBoxOfFriendsUses + 1)
42
- if #familiarsForThisPlayer == numFamiliarsThatShouldExist then
37
+ if #familiarsForThisPlayer == numTargetFamiliars then
43
38
  return 0
44
39
  end
45
- if #familiarsForThisPlayer > numFamiliarsThatShouldExist then
46
- local numFamiliarsToRemove = #familiarsForThisPlayer - numFamiliarsThatShouldExist
40
+ if #familiarsForThisPlayer > numTargetFamiliars then
41
+ local numFamiliarsToRemove = #familiarsForThisPlayer - numTargetFamiliars
47
42
  do
48
43
  local i = 0
49
44
  while i < numFamiliarsToRemove do
@@ -54,7 +49,7 @@ function ____exports.checkFamiliar(self, player, collectibleType, familiarVarian
54
49
  end
55
50
  return numFamiliarsToRemove * -1
56
51
  end
57
- local numFamiliarsToSpawn = numFamiliarsThatShouldExist - #familiarsForThisPlayer
52
+ local numFamiliarsToSpawn = numTargetFamiliars - #familiarsForThisPlayer
58
53
  local collectibleRNG = player:GetCollectibleRNG(collectibleType)
59
54
  local familiarSubTypeToUse = familiarSubType == nil and 0 or familiarSubType
60
55
  do
@@ -78,6 +73,20 @@ function ____exports.checkFamiliar(self, player, collectibleType, familiarVarian
78
73
  end
79
74
  return numFamiliarsToSpawn
80
75
  end
76
+ function ____exports.checkFamiliarFromCollectibles(self, player, collectibleType, familiarVariant, familiarSubType)
77
+ local numCollectibles = player:GetCollectibleNum(collectibleType)
78
+ local effects = player:GetEffects()
79
+ local numBoxOfFriendsUses = effects:GetCollectibleEffectNum(CollectibleType.COLLECTIBLE_BOX_OF_FRIENDS)
80
+ local numTargetFamiliars = numCollectibles * (numBoxOfFriendsUses + 1)
81
+ return ____exports.checkFamiliar(
82
+ nil,
83
+ player,
84
+ collectibleType,
85
+ numTargetFamiliars,
86
+ familiarVariant,
87
+ familiarSubType
88
+ )
89
+ end
81
90
  function ____exports.isFamiliarThatShootsPlayerTears(self, familiar)
82
91
  return FAMILIARS_THAT_SHOOT_PLAYER_TEARS:has(familiar.Type)
83
92
  end
@@ -14,6 +14,6 @@ export declare function getFlyingCollectibles(pruneConditionalItems: boolean): S
14
14
  * Returns a set of all of the trinkets that grant flight. (All trinkets that grant flight do so
15
15
  * conditionally, like Bat Wing.)
16
16
  */
17
- export declare function getFlyingTrinkets(): Set<CollectibleType | int>;
17
+ export declare function getFlyingTrinkets(): ReadonlySet<CollectibleType | int>;
18
18
  export declare function hasFlyingTemporaryEffect(player: EntityPlayer): boolean;
19
19
  export declare function isFlyingCharacter(player: EntityPlayer): boolean;
@@ -11,8 +11,8 @@ local log = ____log.log
11
11
  local ____set = require("functions.set")
12
12
  local addSetsToSet = ____set.addSetsToSet
13
13
  local copySet = ____set.copySet
14
- local ____util = require("functions.util")
15
- local isLuaDebugEnabled = ____util.isLuaDebugEnabled
14
+ local ____utils = require("functions.utils")
15
+ local isLuaDebugEnabled = ____utils.isLuaDebugEnabled
16
16
  function twoDimensionalSort(self, a, b)
17
17
  if a[1] == b[1] then
18
18
  return 0
@@ -1,6 +1,5 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____lualib = require("lualib_bundle")
3
- local Map = ____lualib.Map
4
3
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
5
4
  local Set = ____lualib.Set
6
5
  local __TS__New = ____lualib.__TS__New
@@ -0,0 +1,2 @@
1
+ /** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
2
+ export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
@@ -0,0 +1,16 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local Map = ____lualib.Map
4
+ local __TS__New = ____lualib.__TS__New
5
+ local __TS__Iterator = ____lualib.__TS__Iterator
6
+ local ____exports = {}
7
+ function ____exports.copyMap(self, oldMap)
8
+ local newMap = __TS__New(Map)
9
+ for ____, ____value in __TS__Iterator(oldMap:entries()) do
10
+ local key = ____value[1]
11
+ local value = ____value[2]
12
+ newMap:set(key, value)
13
+ end
14
+ return newMap
15
+ end
16
+ return ____exports
@@ -3,8 +3,8 @@ local ____lualib = require("lualib_bundle")
3
3
  local __TS__ArrayPush = ____lualib.__TS__ArrayPush
4
4
  local ____exports = {}
5
5
  local getCircleInitialPosition
6
- local ____util = require("functions.util")
7
- local ensureAllCases = ____util.ensureAllCases
6
+ local ____utils = require("functions.utils")
7
+ local ensureAllCases = ____utils.ensureAllCases
8
8
  function getCircleInitialPosition(self, direction, radius)
9
9
  repeat
10
10
  local ____switch6 = direction
@@ -40,8 +40,7 @@ function getCircleInitialPosition(self, direction, radius)
40
40
  end
41
41
  do
42
42
  do
43
- ensureAllCases(nil, direction)
44
- return Vector.Zero
43
+ return ensureAllCases(nil, direction)
45
44
  end
46
45
  end
47
46
  until true
@@ -5,8 +5,8 @@ local __TS__New = ____lualib.__TS__New
5
5
  local ____exports = {}
6
6
  local ____array = require("functions.array")
7
7
  local getRandomArrayElement = ____array.getRandomArrayElement
8
- local ____util = require("functions.util")
9
- local getEnumValues = ____util.getEnumValues
8
+ local ____utils = require("functions.utils")
9
+ local getEnumValues = ____utils.getEnumValues
10
10
  function ____exports.getRandomHeartSubType(self, seed, exceptions)
11
11
  if seed == nil then
12
12
  seed = Random()
@@ -1,6 +1,4 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
- local ____lualib = require("lualib_bundle")
3
- local Map = ____lualib.Map
4
2
  local ____exports = {}
5
3
  local ____pillEffectClassMap = require("maps.pillEffectClassMap")
6
4
  local PILL_EFFECT_CLASS_MAP = ____pillEffectClassMap.PILL_EFFECT_CLASS_MAP
@@ -29,10 +29,11 @@ local ____collectibles = require("functions.collectibles")
29
29
  local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
30
30
  local ____collectibleSet = require("functions.collectibleSet")
31
31
  local getCollectibleSet = ____collectibleSet.getCollectibleSet
32
- local ____util = require("functions.util")
33
- local ensureAllCases = ____util.ensureAllCases
34
- local stringContains = ____util.stringContains
35
- local trimPrefix = ____util.trimPrefix
32
+ local ____string = require("functions.string")
33
+ local stringContains = ____string.stringContains
34
+ local trimPrefix = ____string.trimPrefix
35
+ local ____utils = require("functions.utils")
36
+ local ensureAllCases = ____utils.ensureAllCases
36
37
  function ____exports.getCharacterMaxHeartContainers(self, character)
37
38
  if character == PlayerType.PLAYER_KEEPER then
38
39
  return 3
@@ -4,19 +4,19 @@
4
4
  *
5
5
  * This function is variadic, meaning that you can specify N sets to add to the first set.
6
6
  */
7
- export declare function addSetsToSet<T>(mainSet: Set<T>, ...setsToAdd: Array<Set<T>>): void;
7
+ export declare function addSetsToSet<T>(mainSet: Set<T>, ...setsToAdd: Array<Set<T> | ReadonlySet<T>>): void;
8
8
  /** Helper function to copy a set. (You can also use a Set constructor to accomplish this task.) */
9
- export declare function copySet<T>(oldSet: Set<T>): Set<T>;
9
+ export declare function copySet<T>(oldSet: Set<T> | ReadonlySet<T>): Set<T>;
10
10
  /**
11
11
  * Helper function to create a new set that is the composition of two or more sets.
12
12
  *
13
13
  * This function is variadic, meaning that you can specify N sets.
14
14
  */
15
- export declare function combineSets<T>(...sets: Array<Set<T>>): Set<T>;
15
+ export declare function combineSets<T>(...sets: Array<Set<T> | ReadonlySet<T>>): Set<T>;
16
16
  /**
17
17
  * Helper function to delete all of the values in one set from another set. The first set passed
18
18
  * will be modified in place.
19
19
  *
20
20
  * This function is variadic, meaning that you can specify N sets to remove from the first set.
21
21
  */
22
- export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: Array<Set<T>>): void;
22
+ export declare function deleteSetsFromSet<T>(mainSet: Set<T>, ...setsToRemove: Array<Set<T> | ReadonlySet<T>>): void;
@@ -1,7 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local ____util = require("functions.util")
4
- local getEnumValues = ____util.getEnumValues
3
+ local ____utils = require("functions.utils")
4
+ local getEnumValues = ____utils.getEnumValues
5
5
  function ____exports.stopAllSoundEffects(self)
6
6
  local sfxManager = SFXManager()
7
7
  for ____, soundEffect in ipairs(getEnumValues(nil, SoundEffect)) do
@@ -1,7 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local ____util = require("functions.util")
4
- local ensureAllCases = ____util.ensureAllCases
3
+ local ____utils = require("functions.utils")
4
+ local ensureAllCases = ____utils.ensureAllCases
5
5
  function ____exports.isRepentanceStage(self, stageType)
6
6
  return stageType == StageType.STAGETYPE_REPENTANCE or stageType == StageType.STAGETYPE_REPENTANCE_B
7
7
  end
@@ -52,8 +52,7 @@ function ____exports.stageTypeToLetter(self, stageType)
52
52
  end
53
53
  do
54
54
  do
55
- ensureAllCases(nil, stageType)
56
- return ""
55
+ return ensureAllCases(nil, stageType)
57
56
  end
58
57
  end
59
58
  until true
@@ -0,0 +1,5 @@
1
+ export declare function stringContains(string: string, searchString: string): boolean;
2
+ /** Helper function to trim a prefix from a string, if it exists. Returns the trimmed string. */
3
+ export declare function trimPrefix(string: string, prefix: string): string;
4
+ /** Helper function to trim a suffix from a string, if it exists. Returns the trimmed string. */
5
+ export declare function trimSuffix(string: string, prefix: string): string;
@@ -0,0 +1,23 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local __TS__StringStartsWith = ____lualib.__TS__StringStartsWith
4
+ local __TS__StringSlice = ____lualib.__TS__StringSlice
5
+ local __TS__StringEndsWith = ____lualib.__TS__StringEndsWith
6
+ local ____exports = {}
7
+ function ____exports.stringContains(self, ____string, searchString)
8
+ return (string.find(____string, searchString, nil, true) or 0) - 1 ~= -1
9
+ end
10
+ function ____exports.trimPrefix(self, ____string, prefix)
11
+ if not __TS__StringStartsWith(____string, prefix) then
12
+ return ____string
13
+ end
14
+ return __TS__StringSlice(____string, #prefix)
15
+ end
16
+ function ____exports.trimSuffix(self, ____string, prefix)
17
+ if not __TS__StringEndsWith(____string, prefix) then
18
+ return ____string
19
+ end
20
+ local endCharacter = #____string - #prefix
21
+ return __TS__StringSlice(____string, 0, endCharacter)
22
+ end
23
+ return ____exports
@@ -0,0 +1,6 @@
1
+ /// <reference types="typescript-to-lua/language-extensions" />
2
+ /**
3
+ * In a Map, you can use the `clear` method to delete every element. However, in a LuaTable, the
4
+ * `clear` method does not exist. Use this helper function as a drop-in replacement for this.
5
+ */
6
+ export declare function tableClear(table: LuaTable): void;
@@ -0,0 +1,8 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ function ____exports.tableClear(self, ____table)
4
+ for key in pairs(____table) do
5
+ ____table[key] = nil
6
+ end
7
+ end
8
+ return ____exports
@@ -10,8 +10,8 @@ local copySet = ____set.copySet
10
10
  local ____trinkets = require("functions.trinkets")
11
11
  local getMaxTrinketID = ____trinkets.getMaxTrinketID
12
12
  local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
13
- local ____util = require("functions.util")
14
- local getEnumValues = ____util.getEnumValues
13
+ local ____utils = require("functions.utils")
14
+ local getEnumValues = ____utils.getEnumValues
15
15
  local CACHE_FLAG_TO_TRINKETS_MAP = __TS__New(Map)
16
16
  local function initCacheFlagMap(self)
17
17
  local maxTrinketID = getMaxTrinketID(nil)
@@ -1,6 +1,4 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
- local ____lualib = require("lualib_bundle")
3
- local Map = ____lualib.Map
4
2
  local ____exports = {}
5
3
  local ____constants = require("constants")
6
4
  local GOLDEN_TRINKET_SHIFT = ____constants.GOLDEN_TRINKET_SHIFT
@@ -0,0 +1,76 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Helper function to get type safety on a switch statement.
4
+ * Very useful to be future-safe against people adding values to a type or an enum.
5
+ *
6
+ * Example:
7
+ * ```
8
+ * enum Situations {
9
+ * Situation1,
10
+ * Situation2,
11
+ * Situation3,
12
+ * // Situation4, // If we uncomment this line, the program will no longer compile
13
+ * }
14
+ *
15
+ * function doThingBasedOnSituation(situation: Situation) {
16
+ * switch (situation) {
17
+ * case Situation1: {
18
+ * return 41;
19
+ * }
20
+ *
21
+ * case Situation2: {
22
+ * return 68;
23
+ * }
24
+ *
25
+ * case Situation3: {
26
+ * return 12;
27
+ * }
28
+ *
29
+ * default: {
30
+ * ensureAllCases(situation);
31
+ * return 0;
32
+ * }
33
+ * }
34
+ * }
35
+ * ```
36
+ */
37
+ export declare const ensureAllCases: (obj: never) => never;
38
+ /**
39
+ * TypeScriptToLua will transpile TypeScript enums to Lua tables that have a double mapping. Thus,
40
+ * when you iterate over them, you will get both the names of the enums and the values of the enums,
41
+ * in a random order. If all you need are the values of an enum, use this helper function.
42
+ *
43
+ * For a more in depth explanation, see:
44
+ * https://isaacscript.github.io/docs/gotchas#iterating-over-enums
45
+ */
46
+ export declare function getEnumValues(transpiledEnum: unknown): int[];
47
+ /**
48
+ * Converts a hex string like "#33aa33" to a KColor object.
49
+ *
50
+ * @param hexString A hex string like "#ffffff" or "ffffff". (The "#" character is optional.)
51
+ */
52
+ export declare function hexToKColor(hexString: string, alpha: float): KColor;
53
+ /**
54
+ * Players can boot the game with an launch option called "--luadebug", which will enable additional
55
+ * functionality that is considered to be unsafe. For more information about this flag, see the
56
+ * wiki: https://bindingofisaacrebirth.fandom.com/wiki/Launch_Options
57
+ *
58
+ * When this flag is enabled, the global environment will be slightly different. The differences are
59
+ * documented here: https://wofsauge.github.io/IsaacDocs/rep/Globals.html
60
+ *
61
+ * This function uses the `package` global variable as a proxy to determine if the "--luadebug" flag
62
+ * is enabled or not.
63
+ */
64
+ export declare function isLuaDebugEnabled(): boolean;
65
+ /**
66
+ * Whether or not the player is playing on a set seed (i.e. that they entered in a specific seed by
67
+ * pressing tab on the character selection screen). When the player resets the game on a set seed,
68
+ * the game will not switch to a different seed.
69
+ */
70
+ export declare function onSetSeed(): boolean;
71
+ /**
72
+ * Helper function to print something to the in-game console. Use this instead of invoking
73
+ * `Isaac.ConsoleOutput()` directly because it will automatically insert a newline at the end of the
74
+ * message (which `Isaac.ConsoleOutput()` does not do by default).
75
+ */
76
+ export declare function printConsole(msg: string): void;
@@ -0,0 +1,56 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local __TS__ArrayPush = ____lualib.__TS__ArrayPush
4
+ local __TS__ArraySort = ____lualib.__TS__ArraySort
5
+ local __TS__StringReplace = ____lualib.__TS__StringReplace
6
+ local __TS__StringSubstr = ____lualib.__TS__StringSubstr
7
+ local ____exports = {}
8
+ local HEX_STRING_LENGTH = 6
9
+ ____exports.ensureAllCases = function(____, obj) return obj end
10
+ function ____exports.getEnumValues(self, transpiledEnum)
11
+ local enumValues = {}
12
+ for key, value in pairs(transpiledEnum) do
13
+ if type(key) == "string" then
14
+ __TS__ArrayPush(enumValues, value)
15
+ end
16
+ end
17
+ __TS__ArraySort(enumValues)
18
+ return enumValues
19
+ end
20
+ function ____exports.hexToKColor(self, hexString, alpha)
21
+ hexString = __TS__StringReplace(hexString, "#", "")
22
+ if #hexString ~= HEX_STRING_LENGTH then
23
+ error(("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. ".")
24
+ end
25
+ local rString = __TS__StringSubstr(hexString, 0, 2)
26
+ local R = tonumber("0x" .. rString)
27
+ if R == nil then
28
+ error(("Failed to convert `0x" .. rString) .. "` to a number.")
29
+ end
30
+ local gString = __TS__StringSubstr(hexString, 2, 2)
31
+ local G = tonumber("0x" .. gString)
32
+ if G == nil then
33
+ error(("Failed to convert `0x" .. gString) .. "` to a number.")
34
+ end
35
+ local bString = __TS__StringSubstr(hexString, 4, 2)
36
+ local B = tonumber("0x" .. bString)
37
+ if B == nil then
38
+ error(("Failed to convert `0x" .. bString) .. "` to a number.")
39
+ end
40
+ local base = 255
41
+ return KColor(R / base, G / base, B / base, alpha)
42
+ end
43
+ function ____exports.isLuaDebugEnabled(self)
44
+ return package ~= nil
45
+ end
46
+ function ____exports.onSetSeed(self)
47
+ local game = Game()
48
+ local seeds = game:GetSeeds()
49
+ local customRun = seeds:IsCustomRun()
50
+ local challenge = Isaac.GetChallenge()
51
+ return challenge == Challenge.CHALLENGE_NULL and customRun
52
+ end
53
+ function ____exports.printConsole(self, msg)
54
+ Isaac.ConsoleOutput(msg .. "\n")
55
+ end
56
+ return ____exports
@@ -1,7 +1,7 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____exports = {}
3
- local ____util = require("functions.util")
4
- local ensureAllCases = ____util.ensureAllCases
3
+ local ____utils = require("functions.utils")
4
+ local ensureAllCases = ____utils.ensureAllCases
5
5
  function ____exports.copyVector(self, vector)
6
6
  return Vector(vector.X, vector.Y)
7
7
  end
@@ -40,8 +40,7 @@ function ____exports.directionToVector(self, direction)
40
40
  end
41
41
  do
42
42
  do
43
- ensureAllCases(nil, direction)
44
- return Vector.Zero
43
+ return ensureAllCases(nil, direction)
45
44
  end
46
45
  end
47
46
  until true
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export * from "./functions/json";
32
32
  export * from "./functions/jsonRoom";
33
33
  export * from "./functions/language";
34
34
  export * from "./functions/log";
35
+ export * from "./functions/map";
35
36
  export * from "./functions/math";
36
37
  export * from "./functions/npc";
37
38
  export * from "./functions/pickups";
@@ -49,6 +50,8 @@ export * from "./functions/sound";
49
50
  export * from "./functions/spawnCollectible";
50
51
  export * from "./functions/sprite";
51
52
  export * from "./functions/stage";
53
+ export * from "./functions/string";
54
+ export * from "./functions/table";
52
55
  export * from "./functions/tears";
53
56
  export * from "./functions/transformations";
54
57
  export * from "./functions/trinketCacheFlag";
@@ -56,7 +59,7 @@ export * from "./functions/trinketGive";
56
59
  export * from "./functions/trinkets";
57
60
  export * from "./functions/trinketSet";
58
61
  export * from "./functions/ui";
59
- export * from "./functions/util";
62
+ export * from "./functions/utils";
60
63
  export * from "./functions/vector";
61
64
  export * from "./maps/cardNameMap";
62
65
  export * from "./maps/collectibleNameMap";
package/dist/index.lua CHANGED
@@ -266,6 +266,14 @@ do
266
266
  end
267
267
  end
268
268
  end
269
+ do
270
+ local ____export = require("functions.map")
271
+ for ____exportKey, ____exportValue in pairs(____export) do
272
+ if ____exportKey ~= "default" then
273
+ ____exports[____exportKey] = ____exportValue
274
+ end
275
+ end
276
+ end
269
277
  do
270
278
  local ____export = require("functions.math")
271
279
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -402,6 +410,22 @@ do
402
410
  end
403
411
  end
404
412
  end
413
+ do
414
+ local ____export = require("functions.string")
415
+ for ____exportKey, ____exportValue in pairs(____export) do
416
+ if ____exportKey ~= "default" then
417
+ ____exports[____exportKey] = ____exportValue
418
+ end
419
+ end
420
+ end
421
+ do
422
+ local ____export = require("functions.table")
423
+ for ____exportKey, ____exportValue in pairs(____export) do
424
+ if ____exportKey ~= "default" then
425
+ ____exports[____exportKey] = ____exportValue
426
+ end
427
+ end
428
+ end
405
429
  do
406
430
  local ____export = require("functions.tears")
407
431
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -459,7 +483,7 @@ do
459
483
  end
460
484
  end
461
485
  do
462
- local ____export = require("functions.util")
486
+ local ____export = require("functions.utils")
463
487
  for ____exportKey, ____exportValue in pairs(____export) do
464
488
  if ____exportKey ~= "default" then
465
489
  ____exports[____exportKey] = ____exportValue
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const CARD_DESCRIPTION_MAP: Map<Card, string>;
2
+ export declare const CARD_DESCRIPTION_MAP: ReadonlyMap<Card, string>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const CARD_NAME_MAP: Map<Card, string>;
2
+ export declare const CARD_NAME_MAP: ReadonlyMap<Card, string>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const CHALLENGE_NAME_MAP: Map<Challenge, string>;
2
+ export declare const CHALLENGE_NAME_MAP: ReadonlyMap<Challenge, string>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const COLLECTIBLE_DESCRIPTION_MAP: Map<CollectibleType, string>;
2
+ export declare const COLLECTIBLE_DESCRIPTION_MAP: ReadonlyMap<CollectibleType, string>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const COLLECTIBLE_NAME_MAP: Map<CollectibleType, string>;
2
+ export declare const COLLECTIBLE_NAME_MAP: ReadonlyMap<CollectibleType, string>;
@@ -3,4 +3,7 @@
3
3
  * This maps the GridEntityXMLType (i.e. the type contained in the room XML/STB file) to the
4
4
  * GridEntityType and the variant used by the game.
5
5
  */
6
- export declare const GRID_ENTITY_XML_MAP: Map<GridEntityXMLType, [GridEntityType, number]>;
6
+ export declare const GRID_ENTITY_XML_MAP: ReadonlyMap<GridEntityXMLType, [
7
+ GridEntityType,
8
+ int
9
+ ]>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  import { PillEffectClass } from "../types/PillEffectClass";
3
- export declare const PILL_EFFECT_CLASS_MAP: Map<PillEffect, PillEffectClass>;
3
+ export declare const PILL_EFFECT_CLASS_MAP: ReadonlyMap<PillEffect, PillEffectClass>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const PILL_EFFECT_NAME_MAP: Map<PillEffect, string>;
2
+ export declare const PILL_EFFECT_NAME_MAP: ReadonlyMap<PillEffect, string>;
@@ -1,3 +1,3 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  import { PillEffectType } from "../types/PillEffectType";
3
- export declare const PILL_EFFECT_TYPE_MAP: Map<PillEffect, PillEffectType>;
3
+ export declare const PILL_EFFECT_TYPE_MAP: ReadonlyMap<PillEffect, PillEffectType>;
@@ -3,5 +3,5 @@
3
3
  * Only used for special room shapes where the top left wall grid index is not equal to
4
4
  * `DEFAULT_TOP_LEFT_WALL_GRID_INDEX`.
5
5
  */
6
- export declare const ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP: Map<RoomShape, number>;
6
+ export declare const ROOM_SHAPE_TO_TOP_LEFT_WALL_GRID_INDEX_MAP: ReadonlyMap<RoomShape, int>;
7
7
  export declare const DEFAULT_TOP_LEFT_WALL_GRID_INDEX = 0;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const TRANSFORMATION_NAME_MAP: Map<PlayerForm, string>;
2
+ export declare const TRANSFORMATION_NAME_MAP: ReadonlyMap<PlayerForm, string>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const TRINKET_DESCRIPTION_MAP: Map<TrinketType, string>;
2
+ export declare const TRINKET_DESCRIPTION_MAP: ReadonlyMap<TrinketType, string>;
@@ -1,2 +1,2 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
- export declare const TRINKET_NAME_MAP: Map<TrinketType, string>;
2
+ export declare const TRINKET_NAME_MAP: ReadonlyMap<TrinketType, string>;
@@ -7,8 +7,8 @@ local ____exports = {}
7
7
  local errorWithTraceback, slimTracebackOutput, removeAnyLineThatContains, LINE_SEPARATOR, USELESS_TRACEBACK_MESSAGES, vanillaError
8
8
  local ____debug = require("functions.debug")
9
9
  local getTraceback = ____debug.getTraceback
10
- local ____util = require("functions.util")
11
- local isLuaDebugEnabled = ____util.isLuaDebugEnabled
10
+ local ____utils = require("functions.utils")
11
+ local isLuaDebugEnabled = ____utils.isLuaDebugEnabled
12
12
  function errorWithTraceback(message, level)
13
13
  if vanillaError == nil then
14
14
  error(message, level)
@@ -3,23 +3,23 @@
3
3
  * Contains all of the entries in the `Card` enum that are not a rune and not an object (e.g. Fool,
4
4
  * Reverse Fool, Wild Card, etc.).
5
5
  */
6
- export declare const CARDS: Card[];
6
+ export declare const CARDS: readonly Card[];
7
7
  /**
8
8
  * Contains all of the entries in the `Card` enum that are not a rune and not an object (e.g. Fool,
9
9
  * Reverse Fool, Wild Card, etc.).
10
10
  */
11
- export declare const CARD_SET: Set<Card>;
11
+ export declare const CARD_SET: ReadonlySet<Card>;
12
12
  /**
13
13
  * Contains all of the entries in the `Card` enum that are a rune (e.g. Rune of Hagalaz, Blank Rune,
14
14
  * Black Rune, Rune Shard, Soul of Isaac, etc.).
15
15
  */
16
- export declare const RUNES: Card[];
16
+ export declare const RUNES: readonly Card[];
17
17
  /**
18
18
  * Contains all of the entries in the `Card` enum that are a rune (e.g. Rune of Hagalaz, Blank Rune,
19
19
  * Black Rune, Rune Shard, Soul of Isaac, etc.).
20
20
  */
21
- export declare const RUNE_SET: Set<Card>;
21
+ export declare const RUNE_SET: ReadonlySet<Card>;
22
22
  /** Contains all of the entries in the `Card` enum that are objects (like Dice Shard). */
23
- export declare const POCKET_ITEM_OBJECTS: Card[];
23
+ export declare const POCKET_ITEM_OBJECTS: readonly Card[];
24
24
  /** Contains all of the entries in the `Card` enum that are objects (like Dice Shard). */
25
- export declare const POCKET_ITEM_OBJECT_SET: Set<Card>;
25
+ export declare const POCKET_ITEM_OBJECT_SET: ReadonlySet<Card>;
@@ -99,8 +99,8 @@ local ____preNewLevel = require("callbacks.subscriptions.preNewLevel")
99
99
  local preNewLevelRegister = ____preNewLevel.preNewLevelRegister
100
100
  local ____log = require("functions.log")
101
101
  local getDebugPrependString = ____log.getDebugPrependString
102
- local ____util = require("functions.util")
103
- local ensureAllCases = ____util.ensureAllCases
102
+ local ____utils = require("functions.utils")
103
+ local ensureAllCases = ____utils.ensureAllCases
104
104
  local ____ModCallbacksCustom = require("types.ModCallbacksCustom")
105
105
  local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
106
106
  function getCallbackName(self, callbackID)
@@ -394,8 +394,7 @@ function getCallbackRegisterFunction(self, callbackID)
394
394
  end
395
395
  do
396
396
  do
397
- ensureAllCases(nil, callbackID)
398
- return error(("The custom callback ID of \"" .. tostring(callbackID)) .. "\" is not valid.")
397
+ return ensureAllCases(nil, callbackID)
399
398
  end
400
399
  end
401
400
  until true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.39",
3
+ "version": "1.2.42",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",