isaacscript-common 72.3.0 → 72.3.1

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,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 72.3.0
3
+ isaacscript-common 72.3.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -57651,14 +57651,15 @@ function ____exports.getDefaultCollectibleTypesInItemPool(self, itemPoolType)
57651
57651
  return ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
57652
57652
  end
57653
57653
  function ____exports.getDefaultItemPoolsForCollectibleType(self, collectibleType)
57654
- local itemPoolTypes = {}
57655
- for ____, itemPoolType in ipairs(ITEM_POOL_TYPE_VALUES) do
57654
+ local collectibleItemPoolTypes = {}
57655
+ local itemPoolTypes = game:IsGreedMode() and GREED_MODE_ITEM_POOL_TYPES or NORMAL_MODE_ITEM_POOL_TYPES
57656
+ for ____, itemPoolType in ipairs(itemPoolTypes) do
57656
57657
  local collectibleTypesSet = ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
57657
57658
  if collectibleTypesSet:has(collectibleType) then
57658
- itemPoolTypes[#itemPoolTypes + 1] = itemPoolType
57659
+ collectibleItemPoolTypes[#collectibleItemPoolTypes + 1] = itemPoolType
57659
57660
  end
57660
57661
  end
57661
- return itemPoolTypes
57662
+ return collectibleItemPoolTypes
57662
57663
  end
57663
57664
  function ____exports.getRandomItemPool(self, seedOrRNG)
57664
57665
  local itemPoolTypes = game:IsGreedMode() and GREED_MODE_ITEM_POOL_TYPES or NORMAL_MODE_ITEM_POOL_TYPES
@@ -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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,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"}
@@ -67,14 +67,15 @@ end
67
67
  -- This function will automatically account for Greed Mode. In other words, it will not return the
68
68
  -- "normal" item pools when playing in Greed Mode.
69
69
  function ____exports.getDefaultItemPoolsForCollectibleType(self, collectibleType)
70
- local itemPoolTypes = {}
71
- for ____, itemPoolType in ipairs(ITEM_POOL_TYPE_VALUES) do
70
+ local collectibleItemPoolTypes = {}
71
+ local itemPoolTypes = game:IsGreedMode() and GREED_MODE_ITEM_POOL_TYPES or NORMAL_MODE_ITEM_POOL_TYPES
72
+ for ____, itemPoolType in ipairs(itemPoolTypes) do
72
73
  local collectibleTypesSet = ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
73
74
  if collectibleTypesSet:has(collectibleType) then
74
- itemPoolTypes[#itemPoolTypes + 1] = itemPoolType
75
+ collectibleItemPoolTypes[#collectibleItemPoolTypes + 1] = itemPoolType
75
76
  end
76
77
  end
77
- return itemPoolTypes
78
+ return collectibleItemPoolTypes
78
79
  end
79
80
  --- Helper function to get a random item pool. This is not as simple as getting a random value from
80
81
  -- the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "72.3.0",
3
+ "version": "72.3.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -62,17 +62,21 @@ export function getDefaultCollectibleTypesInItemPool(
62
62
  export function getDefaultItemPoolsForCollectibleType(
63
63
  collectibleType: CollectibleType,
64
64
  ): ItemPoolType[] {
65
- const itemPoolTypes: ItemPoolType[] = [];
65
+ const collectibleItemPoolTypes: ItemPoolType[] = [];
66
66
 
67
- for (const itemPoolType of ITEM_POOL_TYPE_VALUES) {
67
+ const itemPoolTypes = game.IsGreedMode()
68
+ ? GREED_MODE_ITEM_POOL_TYPES
69
+ : NORMAL_MODE_ITEM_POOL_TYPES;
70
+
71
+ for (const itemPoolType of itemPoolTypes) {
68
72
  const collectibleTypesSet =
69
73
  ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType];
70
74
  if (collectibleTypesSet.has(collectibleType)) {
71
- itemPoolTypes.push(itemPoolType);
75
+ collectibleItemPoolTypes.push(itemPoolType);
72
76
  }
73
77
  }
74
78
 
75
- return itemPoolTypes;
79
+ return collectibleItemPoolTypes;
76
80
  }
77
81
 
78
82
  /**
@@ -93,6 +97,7 @@ export function getRandomItemPool(
93
97
  const itemPoolTypes = game.IsGreedMode()
94
98
  ? GREED_MODE_ITEM_POOL_TYPES
95
99
  : NORMAL_MODE_ITEM_POOL_TYPES;
100
+
96
101
  return getRandomArrayElement(itemPoolTypes, seedOrRNG);
97
102
  }
98
103