isaacscript-common 72.1.1 → 72.2.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.
@@ -1,5 +1,18 @@
1
1
  import type { CollectibleType, TrinketType } from "isaac-typescript-definitions";
2
2
  import { ItemPoolType } from "isaac-typescript-definitions";
3
+ /**
4
+ * Helper function to get the collectibles that are in a particular item pool at the beginning of a
5
+ * vanilla run.
6
+ */
7
+ export declare function getDefaultCollectibleTypesInItemPool(itemPoolType: ItemPoolType): Set<CollectibleType>;
8
+ /**
9
+ * Helper function to get the item pools that a particular collectible starts in at the beginning of
10
+ * a vanilla run.
11
+ *
12
+ * This function will automatically account for Greed Mode. In other words, it will not return the
13
+ * "normal" item pools when playing in Greed Mode.
14
+ */
15
+ export declare function getDefaultItemPoolsForCollectibleType(collectibleType: CollectibleType): ItemPoolType[];
3
16
  /**
4
17
  * Helper function to get a random item pool. This is not as simple as getting a random value from
5
18
  * the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
@@ -1 +1 @@
1
- {"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAuC5D;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,GAChC,YAAY,CAKd;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAM3E"}
1
+ {"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAwC5D;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,YAAY,GACzB,GAAG,CAAC,eAAe,CAAC,CAEtB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,eAAe,EAAE,eAAe,GAC/B,YAAY,EAAE,CAYhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,GAChC,YAAY,CAKd;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAM3E"}
@@ -2,6 +2,7 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
3
3
  local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
4
4
  local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
5
+ local Set = ____lualib.Set
5
6
  local ____exports = {}
6
7
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
8
  local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
@@ -9,6 +10,8 @@ local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
9
10
  local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
10
11
  local ____cachedClasses = require("src.core.cachedClasses")
11
12
  local game = ____cachedClasses.game
13
+ local ____itemPoolTypeToCollectibleTypesSet = require("src.objects.itemPoolTypeToCollectibleTypesSet")
14
+ local ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET = ____itemPoolTypeToCollectibleTypesSet.ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET
12
15
  local ____array = require("src.functions.array")
13
16
  local arrayRemove = ____array.arrayRemove
14
17
  local getRandomArrayElement = ____array.getRandomArrayElement
@@ -53,6 +56,26 @@ __TS__SparseArrayPush(
53
56
  table.unpack(FAKE_ITEM_POOL_TYPES)
54
57
  )
55
58
  local GREED_MODE_ITEM_POOL_TYPES = ____arrayRemove_3(__TS__SparseArraySpread(____array_2))
59
+ --- Helper function to get the collectibles that are in a particular item pool at the beginning of a
60
+ -- vanilla run.
61
+ function ____exports.getDefaultCollectibleTypesInItemPool(self, itemPoolType)
62
+ return ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
63
+ end
64
+ --- Helper function to get the item pools that a particular collectible starts in at the beginning of
65
+ -- a vanilla run.
66
+ --
67
+ -- This function will automatically account for Greed Mode. In other words, it will not return the
68
+ -- "normal" item pools when playing in Greed Mode.
69
+ function ____exports.getDefaultItemPoolsForCollectibleType(self, collectibleType)
70
+ local itemPoolTypes = {}
71
+ for ____, itemPoolType in ipairs(ITEM_POOL_TYPE_VALUES) do
72
+ local collectibleTypesSet = ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
73
+ if collectibleTypesSet:has(collectibleType) then
74
+ itemPoolTypes[#itemPoolTypes + 1] = itemPoolType
75
+ end
76
+ end
77
+ return itemPoolTypes
78
+ end
56
79
  --- Helper function to get a random item pool. This is not as simple as getting a random value from
57
80
  -- the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
58
81
  -- Greed Mode item pools should be excluded if not playing in Greed Mode.
@@ -159,6 +159,13 @@ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int,
159
159
  * that function for more information.
160
160
  */
161
161
  export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
162
+ /**
163
+ * Helper function to determine if the current room grid index is inside of the normal 13x13 level
164
+ * grid.
165
+ *
166
+ * For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
167
+ */
168
+ export declare function inGrid(): boolean;
162
169
  /**
163
170
  * Helper function to detect if the current room was created by the Red Key item.
164
171
  *
@@ -1 +1 @@
1
- {"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAIL,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAoCtC;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAKhB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAKhB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACxC,aAAa,CAAC,EAAE,GAAG,GAClB,SAAS,GAAG,EAAE,CAchB;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,IAAI,SAAS,GAAG,EAAE,CAGtD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,aAAa,UAAO,GAElB;IACE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,EAAE,GAAG,CAAC;CAChC,GACD,SAAS,CAOZ;AAED;;;;;;;;;GASG;AACH,wBAAgB,8BAA8B,CAC5C,aAAa,CAAC,EAAE,GAAG,EACnB,aAAa,UAAO,GACnB,aAAa,CAAC;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ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AAO,CACrB,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,aAAa,UAAO,EACpB,cAAc,CAAC,EAAE,UAAU,GAC1B,GAAG,GAAG,SAAS,CAuDjB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAK1E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAE7D"}
@@ -362,6 +362,14 @@ function ____exports.getRoomGridIndexesForType(self, ...)
362
362
  function(____, roomDescriptor) return roomDescriptor.SafeGridIndex end
363
363
  )
364
364
  end
365
+ --- Helper function to determine if the current room grid index is inside of the normal 13x13 level
366
+ -- grid.
367
+ --
368
+ -- For example, Devil Rooms and the Mega Satan room are not considered to be inside the grid.
369
+ function ____exports.inGrid(self)
370
+ local roomGridIndex = getRoomGridIndex(nil)
371
+ return ____exports.isRoomInsideGrid(nil, roomGridIndex)
372
+ end
365
373
  --- Helper function to detect if the current room was created by the Red Key item.
366
374
  --
367
375
  -- Under the hood, this checks for the `RoomDescriptorFlag.FLAG_RED_ROOM` flag.
@@ -0,0 +1,35 @@
1
+ /** From "itempools.xml". */
2
+ export declare const ITEM_POOL_TYPE_TO_ITEM_POOL_NAME: {
3
+ readonly 0: "treasure";
4
+ readonly 1: "shop";
5
+ readonly 2: "boss";
6
+ readonly 3: "devil";
7
+ readonly 4: "angel";
8
+ readonly 5: "secret";
9
+ readonly 6: "library";
10
+ readonly 7: "shellGame";
11
+ readonly 8: "goldenChest";
12
+ readonly 9: "redChest";
13
+ readonly 10: "beggar";
14
+ readonly 11: "demonBeggar";
15
+ readonly 12: "curse";
16
+ readonly 13: "keyMaster";
17
+ readonly 14: "batteryBum";
18
+ readonly 15: "momsChest";
19
+ readonly 16: "greedTreasure";
20
+ readonly 17: "greedBoss";
21
+ readonly 18: "greedShop";
22
+ readonly 19: "greedDevil";
23
+ readonly 20: "greedAngel";
24
+ readonly 21: "greedCurse";
25
+ readonly 22: "greedSecret";
26
+ readonly 23: "craneGame";
27
+ readonly 24: "ultraSecret";
28
+ readonly 25: "bombBum";
29
+ readonly 26: "planetarium";
30
+ readonly 27: "oldChest";
31
+ readonly 28: "babyShop";
32
+ readonly 29: "woodenChest";
33
+ readonly 30: "rottenBeggar";
34
+ };
35
+ //# sourceMappingURL=itemPoolTypeToItemPoolName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemPoolTypeToItemPoolName.d.ts","sourceRoot":"","sources":["../../../src/maps/itemPoolTypeToItemPoolName.ts"],"names":[],"mappings":"AAEA,4BAA4B;AAC5B,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCI,CAAC"}
@@ -0,0 +1,38 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
4
+ --- From "itempools.xml".
5
+ ____exports.ITEM_POOL_TYPE_TO_ITEM_POOL_NAME = {
6
+ [ItemPoolType.TREASURE] = "treasure",
7
+ [ItemPoolType.SHOP] = "shop",
8
+ [ItemPoolType.BOSS] = "boss",
9
+ [ItemPoolType.DEVIL] = "devil",
10
+ [ItemPoolType.ANGEL] = "angel",
11
+ [ItemPoolType.SECRET] = "secret",
12
+ [ItemPoolType.LIBRARY] = "library",
13
+ [ItemPoolType.SHELL_GAME] = "shellGame",
14
+ [ItemPoolType.GOLDEN_CHEST] = "goldenChest",
15
+ [ItemPoolType.RED_CHEST] = "redChest",
16
+ [ItemPoolType.BEGGAR] = "beggar",
17
+ [ItemPoolType.DEMON_BEGGAR] = "demonBeggar",
18
+ [ItemPoolType.CURSE] = "curse",
19
+ [ItemPoolType.KEY_MASTER] = "keyMaster",
20
+ [ItemPoolType.BATTERY_BUM] = "batteryBum",
21
+ [ItemPoolType.MOMS_CHEST] = "momsChest",
22
+ [ItemPoolType.GREED_TREASURE] = "greedTreasure",
23
+ [ItemPoolType.GREED_BOSS] = "greedBoss",
24
+ [ItemPoolType.GREED_SHOP] = "greedShop",
25
+ [ItemPoolType.GREED_DEVIL] = "greedDevil",
26
+ [ItemPoolType.GREED_ANGEL] = "greedAngel",
27
+ [ItemPoolType.GREED_CURSE] = "greedCurse",
28
+ [ItemPoolType.GREED_SECRET] = "greedSecret",
29
+ [ItemPoolType.CRANE_GAME] = "craneGame",
30
+ [ItemPoolType.ULTRA_SECRET] = "ultraSecret",
31
+ [ItemPoolType.BOMB_BUM] = "bombBum",
32
+ [ItemPoolType.PLANETARIUM] = "planetarium",
33
+ [ItemPoolType.OLD_CHEST] = "oldChest",
34
+ [ItemPoolType.BABY_SHOP] = "babyShop",
35
+ [ItemPoolType.WOODEN_CHEST] = "woodenChest",
36
+ [ItemPoolType.ROTTEN_BEGGAR] = "rottenBeggar"
37
+ }
38
+ return ____exports
@@ -0,0 +1,3 @@
1
+ import type { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
2
+ export declare const ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET: Readonly<Record<ItemPoolType, Set<CollectibleType>>>;
3
+ //# sourceMappingURL=itemPoolTypeToCollectibleTypesSet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"itemPoolTypeToCollectibleTypesSet.d.ts","sourceRoot":"","sources":["../../../src/objects/itemPoolTypeToCollectibleTypesSet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACb,MAAM,8BAA8B,CAAC;AAMtC,eAAO,MAAM,uCAAuC,EAAE,QAAQ,CAC5D,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC,CAiCxC,CAAC"}
@@ -0,0 +1,44 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Set = ____lualib.Set
3
+ local __TS__New = ____lualib.__TS__New
4
+ local __TS__ArrayFind = ____lualib.__TS__ArrayFind
5
+ local ____exports = {}
6
+ local getItemPoolJSON
7
+ local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
8
+ local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
9
+ local ____itempools_2Ejson = require("src.data.itempools")
10
+ local itemPoolsJSON = ____itempools_2Ejson.default
11
+ local ____types = require("src.functions.types")
12
+ local asCollectibleType = ____types.asCollectibleType
13
+ local ____itemPoolTypeToItemPoolName = require("src.maps.itemPoolTypeToItemPoolName")
14
+ local ITEM_POOL_TYPE_TO_ITEM_POOL_NAME = ____itemPoolTypeToItemPoolName.ITEM_POOL_TYPE_TO_ITEM_POOL_NAME
15
+ function getItemPoolJSON(self, itemPoolType)
16
+ local itemPoolName = ITEM_POOL_TYPE_TO_ITEM_POOL_NAME[itemPoolType]
17
+ local itemPoolsJSONArray = itemPoolsJSON.ItemPools.Pool
18
+ return __TS__ArrayFind(
19
+ itemPoolsJSONArray,
20
+ function(____, itemPoolJSON) return itemPoolJSON["$"].Name == itemPoolName end
21
+ )
22
+ end
23
+ ____exports.ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET = (function()
24
+ local itemPoolTypeToCollectibleTypes = {}
25
+ for ____, itemPoolType in ipairs(ITEM_POOL_TYPE_VALUES) do
26
+ local itemPoolJSON = getItemPoolJSON(nil, itemPoolType)
27
+ if itemPoolJSON == nil then
28
+ itemPoolTypeToCollectibleTypes[itemPoolType] = __TS__New(Set)
29
+ else
30
+ local collectibleTypesSet = __TS__New(Set)
31
+ for ____, itemPoolJSONElement in ipairs(itemPoolJSON.Item) do
32
+ local collectibleTypeNumber = tonumber(itemPoolJSONElement["$"].Id)
33
+ if collectibleTypeNumber == nil then
34
+ error("Failed to parse a collectible type in the \"itempools.json\" file: " .. itemPoolJSONElement["$"].Id)
35
+ end
36
+ local collectibleType = asCollectibleType(nil, collectibleTypeNumber)
37
+ collectibleTypesSet:add(collectibleType)
38
+ end
39
+ itemPoolTypeToCollectibleTypes[itemPoolType] = collectibleTypesSet
40
+ end
41
+ end
42
+ return itemPoolTypeToCollectibleTypes
43
+ end)(nil)
44
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "72.1.1",
3
+ "version": "72.2.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",