isaacscript-common 72.3.0 → 72.3.2
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.
- package/dist/isaacscript-common.lua +7 -7
- package/dist/src/functions/itemPool.d.ts.map +1 -1
- package/dist/src/functions/itemPool.lua +5 -4
- package/dist/src/objects/itemPoolTypeToCollectibleTypesSet.lua +1 -2
- package/package.json +1 -1
- package/src/functions/itemPool.ts +9 -4
- package/src/objects/itemPoolTypeToCollectibleTypesSet.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 72.3.
|
|
3
|
+
isaacscript-common 72.3.2
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -57551,8 +57551,7 @@ local ____exports = {}
|
|
|
57551
57551
|
local getItemPoolJSON
|
|
57552
57552
|
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
57553
57553
|
local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
|
|
57554
|
-
local
|
|
57555
|
-
local itemPoolsJSON = ____itempools_2Ejson.default
|
|
57554
|
+
local itemPoolsJSON = require("src.data.itempools")
|
|
57556
57555
|
local ____types = require("src.functions.types")
|
|
57557
57556
|
local asCollectibleType = ____types.asCollectibleType
|
|
57558
57557
|
local ____itemPoolTypeToItemPoolName = require("src.maps.itemPoolTypeToItemPoolName")
|
|
@@ -57651,14 +57650,15 @@ function ____exports.getDefaultCollectibleTypesInItemPool(self, itemPoolType)
|
|
|
57651
57650
|
return ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
|
|
57652
57651
|
end
|
|
57653
57652
|
function ____exports.getDefaultItemPoolsForCollectibleType(self, collectibleType)
|
|
57654
|
-
local
|
|
57655
|
-
|
|
57653
|
+
local collectibleItemPoolTypes = {}
|
|
57654
|
+
local itemPoolTypes = game:IsGreedMode() and GREED_MODE_ITEM_POOL_TYPES or NORMAL_MODE_ITEM_POOL_TYPES
|
|
57655
|
+
for ____, itemPoolType in ipairs(itemPoolTypes) do
|
|
57656
57656
|
local collectibleTypesSet = ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET[itemPoolType]
|
|
57657
57657
|
if collectibleTypesSet:has(collectibleType) then
|
|
57658
|
-
|
|
57658
|
+
collectibleItemPoolTypes[#collectibleItemPoolTypes + 1] = itemPoolType
|
|
57659
57659
|
end
|
|
57660
57660
|
end
|
|
57661
|
-
return
|
|
57661
|
+
return collectibleItemPoolTypes
|
|
57662
57662
|
end
|
|
57663
57663
|
function ____exports.getRandomItemPool(self, seedOrRNG)
|
|
57664
57664
|
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,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,
|
|
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,CAgBhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,GAChC,YAAY,CAMd;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO,CAIT;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"}
|
|
@@ -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
|
|
71
|
-
|
|
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
|
-
|
|
75
|
+
collectibleItemPoolTypes[#collectibleItemPoolTypes + 1] = itemPoolType
|
|
75
76
|
end
|
|
76
77
|
end
|
|
77
|
-
return
|
|
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
|
|
@@ -6,8 +6,7 @@ local ____exports = {}
|
|
|
6
6
|
local getItemPoolJSON
|
|
7
7
|
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
8
8
|
local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
|
|
9
|
-
local
|
|
10
|
-
local itemPoolsJSON = ____itempools_2Ejson.default
|
|
9
|
+
local itemPoolsJSON = require("src.data.itempools")
|
|
11
10
|
local ____types = require("src.functions.types")
|
|
12
11
|
local asCollectibleType = ____types.asCollectibleType
|
|
13
12
|
local ____itemPoolTypeToItemPoolName = require("src.maps.itemPoolTypeToItemPoolName")
|
package/package.json
CHANGED
|
@@ -62,17 +62,21 @@ export function getDefaultCollectibleTypesInItemPool(
|
|
|
62
62
|
export function getDefaultItemPoolsForCollectibleType(
|
|
63
63
|
collectibleType: CollectibleType,
|
|
64
64
|
): ItemPoolType[] {
|
|
65
|
-
const
|
|
65
|
+
const collectibleItemPoolTypes: ItemPoolType[] = [];
|
|
66
66
|
|
|
67
|
-
|
|
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
|
-
|
|
75
|
+
collectibleItemPoolTypes.push(itemPoolType);
|
|
72
76
|
}
|
|
73
77
|
}
|
|
74
78
|
|
|
75
|
-
return
|
|
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
|
|
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
ItemPoolType,
|
|
4
4
|
} from "isaac-typescript-definitions";
|
|
5
5
|
import { ITEM_POOL_TYPE_VALUES } from "../arrays/cachedEnumValues";
|
|
6
|
-
import itemPoolsJSON from "../data/itempools.json";
|
|
6
|
+
import * as itemPoolsJSON from "../data/itempools.json";
|
|
7
7
|
import { asCollectibleType } from "../functions/types";
|
|
8
8
|
import { ITEM_POOL_TYPE_TO_ITEM_POOL_NAME } from "../maps/itemPoolTypeToItemPoolName";
|
|
9
9
|
|