isaacscript-common 71.2.0 → 72.0.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.
- package/dist/index.rollup.d.ts +229 -96
- package/dist/isaacscript-common.lua +40 -154
- package/dist/src/classes/features/other/CustomItemPools.d.ts +7 -3
- package/dist/src/classes/features/other/CustomItemPools.d.ts.map +1 -1
- package/dist/src/classes/features/other/CustomItemPools.lua +1 -6
- package/dist/src/classes/features/other/DeployJSONRoom.d.ts +7 -3
- package/dist/src/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
- package/dist/src/classes/features/other/DeployJSONRoom.lua +1 -5
- package/dist/src/classes/features/other/ModdedElementSets.d.ts +35 -15
- package/dist/src/classes/features/other/ModdedElementSets.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +0 -17
- package/dist/src/classes/features/other/SpawnCollectible.d.ts +14 -6
- package/dist/src/classes/features/other/SpawnCollectible.d.ts.map +1 -1
- package/dist/src/classes/features/other/SpawnCollectible.lua +0 -8
- package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts +8 -4
- package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts.map +1 -1
- package/dist/src/classes/features/other/SpawnRockAltRewards.lua +0 -4
- package/dist/src/classes/features/other/customStages/utils.d.ts +2 -2
- package/dist/src/classes/features/other/customStages/utils.d.ts.map +1 -1
- package/dist/src/classes/features/other/customStages/utils.lua +0 -8
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +2 -2
- package/dist/src/functions/array.d.ts +35 -15
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/array.lua +30 -26
- package/dist/src/functions/color.d.ts +8 -4
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/color.lua +7 -7
- package/dist/src/functions/enums.d.ts +6 -3
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +5 -7
- package/dist/src/functions/itemPool.d.ts +8 -1
- package/dist/src/functions/itemPool.d.ts.map +1 -1
- package/dist/src/functions/itemPool.lua +9 -2
- package/dist/src/functions/jsonRoom.d.ts +13 -6
- package/dist/src/functions/jsonRoom.d.ts.map +1 -1
- package/dist/src/functions/jsonRoom.lua +11 -12
- package/dist/src/functions/kColor.d.ts +8 -4
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/kColor.lua +7 -7
- package/dist/src/functions/levelGrid.d.ts +12 -5
- package/dist/src/functions/levelGrid.d.ts.map +1 -1
- package/dist/src/functions/levelGrid.lua +10 -7
- package/dist/src/functions/nextStage.d.ts.map +1 -1
- package/dist/src/functions/nextStage.lua +4 -1
- package/dist/src/functions/random.d.ts +22 -13
- package/dist/src/functions/random.d.ts.map +1 -1
- package/dist/src/functions/random.lua +19 -20
- package/dist/src/functions/rng.d.ts +1 -1
- package/dist/src/functions/rng.lua +1 -1
- package/dist/src/functions/set.d.ts +7 -3
- package/dist/src/functions/set.d.ts.map +1 -1
- package/dist/src/functions/set.lua +6 -7
- package/dist/src/functions/spawnCollectible.d.ts +13 -5
- package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/src/functions/spawnCollectible.lua +14 -9
- package/dist/src/functions/vector.d.ts +7 -3
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +6 -6
- package/dist/src/functions/weighted.d.ts +18 -2
- package/dist/src/functions/weighted.d.ts.map +1 -1
- package/dist/src/functions/weighted.lua +16 -8
- package/package.json +1 -1
- package/src/classes/features/other/CustomItemPools.ts +7 -4
- package/src/classes/features/other/DeployJSONRoom.ts +9 -5
- package/src/classes/features/other/ModdedElementSets.ts +37 -16
- package/src/classes/features/other/SpawnCollectible.ts +14 -7
- package/src/classes/features/other/SpawnRockAltRewards.ts +9 -5
- package/src/classes/features/other/customStages/utils.ts +2 -3
- package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -2
- package/src/functions/array.ts +36 -16
- package/src/functions/color.ts +9 -5
- package/src/functions/enums.ts +6 -4
- package/src/functions/itemPool.ts +11 -2
- package/src/functions/jsonRoom.ts +13 -7
- package/src/functions/kColor.ts +9 -5
- package/src/functions/levelGrid.ts +13 -6
- package/src/functions/nextStage.ts +6 -1
- package/src/functions/random.ts +23 -14
- package/src/functions/rng.ts +1 -1
- package/src/functions/set.ts +7 -4
- package/src/functions/spawnCollectible.ts +17 -5
- package/src/functions/vector.ts +8 -4
- package/src/functions/weighted.ts +18 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 72.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -16890,20 +16890,13 @@ local ____exports = {}
|
|
|
16890
16890
|
local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
16891
16891
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
16892
16892
|
local ____rng = require("src.functions.rng")
|
|
16893
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
16894
16893
|
local isRNG = ____rng.isRNG
|
|
16895
16894
|
local newRNG = ____rng.newRNG
|
|
16896
16895
|
function ____exports.getRandom(self, seedOrRNG)
|
|
16897
|
-
if seedOrRNG == nil then
|
|
16898
|
-
seedOrRNG = getRandomSeed(nil)
|
|
16899
|
-
end
|
|
16900
16896
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
16901
16897
|
return rng:RandomFloat()
|
|
16902
16898
|
end
|
|
16903
16899
|
function ____exports.getRandomFloat(self, min, max, seedOrRNG)
|
|
16904
|
-
if seedOrRNG == nil then
|
|
16905
|
-
seedOrRNG = getRandomSeed(nil)
|
|
16906
|
-
end
|
|
16907
16900
|
if min > max then
|
|
16908
16901
|
local oldMin = min
|
|
16909
16902
|
local oldMax = max
|
|
@@ -16913,9 +16906,6 @@ function ____exports.getRandomFloat(self, min, max, seedOrRNG)
|
|
|
16913
16906
|
return min + ____exports.getRandom(nil, seedOrRNG) * (max - min)
|
|
16914
16907
|
end
|
|
16915
16908
|
function ____exports.getRandomInt(self, min, max, seedOrRNG, exceptions)
|
|
16916
|
-
if seedOrRNG == nil then
|
|
16917
|
-
seedOrRNG = getRandomSeed(nil)
|
|
16918
|
-
end
|
|
16919
16909
|
if exceptions == nil then
|
|
16920
16910
|
exceptions = {}
|
|
16921
16911
|
end
|
|
@@ -16966,7 +16956,6 @@ local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
|
16966
16956
|
local ____random = require("src.functions.random")
|
|
16967
16957
|
local getRandomInt = ____random.getRandomInt
|
|
16968
16958
|
local ____rng = require("src.functions.rng")
|
|
16969
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
16970
16959
|
local isRNG = ____rng.isRNG
|
|
16971
16960
|
local newRNG = ____rng.newRNG
|
|
16972
16961
|
local ____types = require("src.functions.types")
|
|
@@ -17043,9 +17032,6 @@ function addCombinations(self, n, src, got, all)
|
|
|
17043
17032
|
end
|
|
17044
17033
|
end
|
|
17045
17034
|
function ____exports.getRandomArrayIndex(self, array, seedOrRNG, exceptions)
|
|
17046
|
-
if seedOrRNG == nil then
|
|
17047
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17048
|
-
end
|
|
17049
17035
|
if exceptions == nil then
|
|
17050
17036
|
exceptions = {}
|
|
17051
17037
|
end
|
|
@@ -17061,9 +17047,6 @@ function ____exports.getRandomArrayIndex(self, array, seedOrRNG, exceptions)
|
|
|
17061
17047
|
)
|
|
17062
17048
|
end
|
|
17063
17049
|
function ____exports.shuffleArrayInPlace(self, array, seedOrRNG)
|
|
17064
|
-
if seedOrRNG == nil then
|
|
17065
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17066
|
-
end
|
|
17067
17050
|
local currentIndex = #array
|
|
17068
17051
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
17069
17052
|
while currentIndex > 0 do
|
|
@@ -17227,9 +17210,6 @@ function ____exports.getLowestArrayElement(self, array)
|
|
|
17227
17210
|
return lowestValue
|
|
17228
17211
|
end
|
|
17229
17212
|
function ____exports.getRandomArrayElement(self, array, seedOrRNG, exceptions)
|
|
17230
|
-
if seedOrRNG == nil then
|
|
17231
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17232
|
-
end
|
|
17233
17213
|
if exceptions == nil then
|
|
17234
17214
|
exceptions = {}
|
|
17235
17215
|
end
|
|
@@ -17251,9 +17231,6 @@ function ____exports.getRandomArrayElement(self, array, seedOrRNG, exceptions)
|
|
|
17251
17231
|
return randomElement
|
|
17252
17232
|
end
|
|
17253
17233
|
function ____exports.getRandomArrayElementAndRemove(self, array, seedOrRNG, exceptions)
|
|
17254
|
-
if seedOrRNG == nil then
|
|
17255
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17256
|
-
end
|
|
17257
17234
|
if exceptions == nil then
|
|
17258
17235
|
exceptions = {}
|
|
17259
17236
|
end
|
|
@@ -17329,9 +17306,6 @@ function ____exports.setAllArrayElements(self, array, value)
|
|
|
17329
17306
|
end
|
|
17330
17307
|
end
|
|
17331
17308
|
function ____exports.shuffleArray(self, originalArray, seedOrRNG)
|
|
17332
|
-
if seedOrRNG == nil then
|
|
17333
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17334
|
-
end
|
|
17335
17309
|
local array = ____exports.copyArray(nil, originalArray)
|
|
17336
17310
|
____exports.shuffleArrayInPlace(nil, array, seedOrRNG)
|
|
17337
17311
|
return array
|
|
@@ -17357,8 +17331,6 @@ local ____ReadonlySet = require("src.types.ReadonlySet")
|
|
|
17357
17331
|
local ReadonlySet = ____ReadonlySet.ReadonlySet
|
|
17358
17332
|
local ____array = require("src.functions.array")
|
|
17359
17333
|
local getRandomArrayElement = ____array.getRandomArrayElement
|
|
17360
|
-
local ____rng = require("src.functions.rng")
|
|
17361
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
17362
17334
|
local ____types = require("src.functions.types")
|
|
17363
17335
|
local isNumber = ____types.isNumber
|
|
17364
17336
|
local isString = ____types.isString
|
|
@@ -17437,9 +17409,6 @@ function ____exports.getLowestEnumValue(self, transpiledEnum)
|
|
|
17437
17409
|
return firstElement
|
|
17438
17410
|
end
|
|
17439
17411
|
function ____exports.getRandomEnumValue(self, transpiledEnum, seedOrRNG, exceptions)
|
|
17440
|
-
if seedOrRNG == nil then
|
|
17441
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17442
|
-
end
|
|
17443
17412
|
if exceptions == nil then
|
|
17444
17413
|
exceptions = {}
|
|
17445
17414
|
end
|
|
@@ -17692,7 +17661,6 @@ local isIsaacAPIClassOfType = ____isaacAPIClass.isIsaacAPIClassOfType
|
|
|
17692
17661
|
local ____random = require("src.functions.random")
|
|
17693
17662
|
local getRandom = ____random.getRandom
|
|
17694
17663
|
local ____rng = require("src.functions.rng")
|
|
17695
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
17696
17664
|
local isRNG = ____rng.isRNG
|
|
17697
17665
|
local newRNG = ____rng.newRNG
|
|
17698
17666
|
local ____table = require("src.functions.table")
|
|
@@ -17757,9 +17725,6 @@ function ____exports.deserializeColor(self, color)
|
|
|
17757
17725
|
)
|
|
17758
17726
|
end
|
|
17759
17727
|
function ____exports.getRandomColor(self, seedOrRNG, alpha)
|
|
17760
|
-
if seedOrRNG == nil then
|
|
17761
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17762
|
-
end
|
|
17763
17728
|
if alpha == nil then
|
|
17764
17729
|
alpha = 1
|
|
17765
17730
|
end
|
|
@@ -17801,7 +17766,6 @@ local isIsaacAPIClassOfType = ____isaacAPIClass.isIsaacAPIClassOfType
|
|
|
17801
17766
|
local ____random = require("src.functions.random")
|
|
17802
17767
|
local getRandom = ____random.getRandom
|
|
17803
17768
|
local ____rng = require("src.functions.rng")
|
|
17804
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
17805
17769
|
local isRNG = ____rng.isRNG
|
|
17806
17770
|
local newRNG = ____rng.newRNG
|
|
17807
17771
|
local ____table = require("src.functions.table")
|
|
@@ -17840,9 +17804,6 @@ function ____exports.deserializeKColor(self, kColor)
|
|
|
17840
17804
|
return KColor(r, g, b, a)
|
|
17841
17805
|
end
|
|
17842
17806
|
function ____exports.getRandomKColor(self, seedOrRNG, alpha)
|
|
17843
|
-
if seedOrRNG == nil then
|
|
17844
|
-
seedOrRNG = getRandomSeed(nil)
|
|
17845
|
-
end
|
|
17846
17807
|
if alpha == nil then
|
|
17847
17808
|
alpha = 1
|
|
17848
17809
|
end
|
|
@@ -18292,7 +18253,6 @@ local isaacAPIClassEquals = ____isaacAPIClass.isaacAPIClassEquals
|
|
|
18292
18253
|
local ____random = require("src.functions.random")
|
|
18293
18254
|
local getRandomFloat = ____random.getRandomFloat
|
|
18294
18255
|
local ____rng = require("src.functions.rng")
|
|
18295
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
18296
18256
|
local isRNG = ____rng.isRNG
|
|
18297
18257
|
local newRNG = ____rng.newRNG
|
|
18298
18258
|
local ____table = require("src.functions.table")
|
|
@@ -18347,9 +18307,6 @@ function ____exports.getClosestVectorTo(self, referenceVector, vectors)
|
|
|
18347
18307
|
return closestVector
|
|
18348
18308
|
end
|
|
18349
18309
|
function ____exports.getRandomVector(self, seedOrRNG)
|
|
18350
|
-
if seedOrRNG == nil then
|
|
18351
|
-
seedOrRNG = getRandomSeed(nil)
|
|
18352
|
-
end
|
|
18353
18310
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
18354
18311
|
local x = getRandomFloat(nil, -1, 1, rng)
|
|
18355
18312
|
local y = getRandomFloat(nil, -1, 1, rng)
|
|
@@ -38759,8 +38716,6 @@ local ____array = require("src.functions.array")
|
|
|
38759
38716
|
local getArrayCombinations = ____array.getArrayCombinations
|
|
38760
38717
|
local getRandomArrayElement = ____array.getRandomArrayElement
|
|
38761
38718
|
local sumArray = ____array.sumArray
|
|
38762
|
-
local ____rng = require("src.functions.rng")
|
|
38763
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
38764
38719
|
local ____types = require("src.functions.types")
|
|
38765
38720
|
local isPrimitive = ____types.isPrimitive
|
|
38766
38721
|
function ____exports.getSortedSetValues(self, set)
|
|
@@ -38810,9 +38765,6 @@ function ____exports.deleteSetsFromSet(self, mainSet, ...)
|
|
|
38810
38765
|
end
|
|
38811
38766
|
end
|
|
38812
38767
|
function ____exports.getRandomSetElement(self, set, seedOrRNG, exceptions)
|
|
38813
|
-
if seedOrRNG == nil then
|
|
38814
|
-
seedOrRNG = getRandomSeed(nil)
|
|
38815
|
-
end
|
|
38816
38768
|
if exceptions == nil then
|
|
38817
38769
|
exceptions = {}
|
|
38818
38770
|
end
|
|
@@ -39074,8 +39026,6 @@ local isHiddenCollectible = ____collectibles.isHiddenCollectible
|
|
|
39074
39026
|
local isPassiveOrFamiliarCollectible = ____collectibles.isPassiveOrFamiliarCollectible
|
|
39075
39027
|
local ____flag = require("src.functions.flag")
|
|
39076
39028
|
local getFlagName = ____flag.getFlagName
|
|
39077
|
-
local ____rng = require("src.functions.rng")
|
|
39078
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
39079
39029
|
local ____set = require("src.functions.set")
|
|
39080
39030
|
local copySet = ____set.copySet
|
|
39081
39031
|
local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
@@ -39622,9 +39572,6 @@ function ModdedElementSets.prototype.getEdenPassiveCollectibleTypes(self)
|
|
|
39622
39572
|
end
|
|
39623
39573
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibleTypes", true)
|
|
39624
39574
|
function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, seedOrRNG, exceptions)
|
|
39625
|
-
if seedOrRNG == nil then
|
|
39626
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39627
|
-
end
|
|
39628
39575
|
if exceptions == nil then
|
|
39629
39576
|
exceptions = {}
|
|
39630
39577
|
end
|
|
@@ -39633,9 +39580,6 @@ function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, se
|
|
|
39633
39580
|
end
|
|
39634
39581
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectibleType", true)
|
|
39635
39582
|
function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, seedOrRNG, exceptions)
|
|
39636
|
-
if seedOrRNG == nil then
|
|
39637
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39638
|
-
end
|
|
39639
39583
|
if exceptions == nil then
|
|
39640
39584
|
exceptions = {}
|
|
39641
39585
|
end
|
|
@@ -39689,9 +39633,6 @@ function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
|
|
|
39689
39633
|
end
|
|
39690
39634
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
|
|
39691
39635
|
function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
|
|
39692
|
-
if seedOrRNG == nil then
|
|
39693
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39694
|
-
end
|
|
39695
39636
|
if exceptions == nil then
|
|
39696
39637
|
exceptions = {}
|
|
39697
39638
|
end
|
|
@@ -39700,9 +39641,6 @@ function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCar
|
|
|
39700
39641
|
end
|
|
39701
39642
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
|
|
39702
39643
|
function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
39703
|
-
if seedOrRNG == nil then
|
|
39704
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39705
|
-
end
|
|
39706
39644
|
if exceptions == nil then
|
|
39707
39645
|
exceptions = {}
|
|
39708
39646
|
end
|
|
@@ -39711,9 +39649,6 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
|
39711
39649
|
end
|
|
39712
39650
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
|
|
39713
39651
|
function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
|
|
39714
|
-
if seedOrRNG == nil then
|
|
39715
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39716
|
-
end
|
|
39717
39652
|
if exceptions == nil then
|
|
39718
39653
|
exceptions = {}
|
|
39719
39654
|
end
|
|
@@ -41132,14 +41067,9 @@ local ____array = require("src.functions.array")
|
|
|
41132
41067
|
local sumArray = ____array.sumArray
|
|
41133
41068
|
local ____random = require("src.functions.random")
|
|
41134
41069
|
local getRandomFloat = ____random.getRandomFloat
|
|
41135
|
-
local ____rng = require("src.functions.rng")
|
|
41136
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
41137
41070
|
local ____utils = require("src.functions.utils")
|
|
41138
41071
|
local assertDefined = ____utils.assertDefined
|
|
41139
41072
|
function ____exports.getRandomIndexFromWeightedArray(self, weightedArray, seedOrRNG)
|
|
41140
|
-
if seedOrRNG == nil then
|
|
41141
|
-
seedOrRNG = getRandomSeed(nil)
|
|
41142
|
-
end
|
|
41143
41073
|
if #weightedArray == 0 then
|
|
41144
41074
|
error("Failed to get a random index from a weighted array since the provided array was empty.")
|
|
41145
41075
|
end
|
|
@@ -41162,9 +41092,6 @@ function ____exports.getRandomIndexFromWeightedArray(self, weightedArray, seedOr
|
|
|
41162
41092
|
error("Failed to get a random index from a weighted array.")
|
|
41163
41093
|
end
|
|
41164
41094
|
function ____exports.getRandomFromWeightedArray(self, weightedArray, seedOrRNG)
|
|
41165
|
-
if seedOrRNG == nil then
|
|
41166
|
-
seedOrRNG = getRandomSeed(nil)
|
|
41167
|
-
end
|
|
41168
41095
|
local randomIndex = ____exports.getRandomIndexFromWeightedArray(nil, weightedArray, seedOrRNG)
|
|
41169
41096
|
local randomElement = weightedArray[randomIndex + 1]
|
|
41170
41097
|
assertDefined(
|
|
@@ -41194,8 +41121,6 @@ local ____array = require("src.functions.array")
|
|
|
41194
41121
|
local arrayRemoveIndexInPlace = ____array.arrayRemoveIndexInPlace
|
|
41195
41122
|
local ____map = require("src.functions.map")
|
|
41196
41123
|
local copyMap = ____map.copyMap
|
|
41197
|
-
local ____rng = require("src.functions.rng")
|
|
41198
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
41199
41124
|
local ____utils = require("src.functions.utils")
|
|
41200
41125
|
local assertDefined = ____utils.assertDefined
|
|
41201
41126
|
local ____weighted = require("src.functions.weighted")
|
|
@@ -41223,13 +41148,10 @@ function CustomItemPools.prototype.registerCustomItemPool(self, itemPoolTypeCust
|
|
|
41223
41148
|
customItemPoolMap:set(itemPoolTypeCustom, collectibles)
|
|
41224
41149
|
end
|
|
41225
41150
|
__TS__DecorateLegacy({Exported}, CustomItemPools.prototype, "registerCustomItemPool", true)
|
|
41226
|
-
function CustomItemPools.prototype.getCustomItemPoolCollectible(self, itemPoolTypeCustom,
|
|
41151
|
+
function CustomItemPools.prototype.getCustomItemPoolCollectible(self, itemPoolTypeCustom, seedOrRNG, decrease, defaultItem)
|
|
41227
41152
|
if decrease == nil then
|
|
41228
41153
|
decrease = false
|
|
41229
41154
|
end
|
|
41230
|
-
if seedOrRNG == nil then
|
|
41231
|
-
seedOrRNG = getRandomSeed(nil)
|
|
41232
|
-
end
|
|
41233
41155
|
if defaultItem == nil then
|
|
41234
41156
|
defaultItem = CollectibleType.NULL
|
|
41235
41157
|
end
|
|
@@ -42173,6 +42095,32 @@ function RunNextRoom.prototype.runNextRoom(self, func)
|
|
|
42173
42095
|
____v_run_queuedFunctions_0[#____v_run_queuedFunctions_0 + 1] = func
|
|
42174
42096
|
end
|
|
42175
42097
|
__TS__DecorateLegacy({Exported}, RunNextRoom.prototype, "runNextRoom", true)
|
|
42098
|
+
return ____exports
|
|
42099
|
+
end,
|
|
42100
|
+
["src.functions.curses"] = function(...)
|
|
42101
|
+
local ____lualib = require("lualib_bundle")
|
|
42102
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
42103
|
+
local ____exports = {}
|
|
42104
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
42105
|
+
local game = ____cachedClasses.game
|
|
42106
|
+
local ____flag = require("src.functions.flag")
|
|
42107
|
+
local hasFlag = ____flag.hasFlag
|
|
42108
|
+
function ____exports.getCurseIDByName(self, name)
|
|
42109
|
+
local curseID = Isaac.GetCurseIdByName(name)
|
|
42110
|
+
if curseID == -1 then
|
|
42111
|
+
error(("Failed to get the curse ID corresponding to the curse name of \"" .. tostring(curseID)) .. "\". Does this name match what you put in the \"content/curses.xml\" file?")
|
|
42112
|
+
end
|
|
42113
|
+
return 1 << curseID - 1
|
|
42114
|
+
end
|
|
42115
|
+
function ____exports.hasCurse(self, ...)
|
|
42116
|
+
local curses = {...}
|
|
42117
|
+
local level = game:GetLevel()
|
|
42118
|
+
local levelCurses = level:GetCurses()
|
|
42119
|
+
return __TS__ArraySome(
|
|
42120
|
+
curses,
|
|
42121
|
+
function(____, curse) return hasFlag(nil, levelCurses, curse) end
|
|
42122
|
+
)
|
|
42123
|
+
end
|
|
42176
42124
|
return ____exports
|
|
42177
42125
|
end,
|
|
42178
42126
|
["src.functions.nextStage"] = function(...)
|
|
@@ -42180,10 +42128,13 @@ local ____exports = {}
|
|
|
42180
42128
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
42181
42129
|
local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
|
|
42182
42130
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
42131
|
+
local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
|
|
42183
42132
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
42184
42133
|
local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
|
|
42185
42134
|
local ____cachedClasses = require("src.core.cachedClasses")
|
|
42186
42135
|
local game = ____cachedClasses.game
|
|
42136
|
+
local ____curses = require("src.functions.curses")
|
|
42137
|
+
local hasCurse = ____curses.hasCurse
|
|
42187
42138
|
local ____roomData = require("src.functions.roomData")
|
|
42188
42139
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
42189
42140
|
local ____stage = require("src.functions.stage")
|
|
@@ -42223,7 +42174,7 @@ function ____exports.getNextStage(self)
|
|
|
42223
42174
|
if repentanceStage then
|
|
42224
42175
|
return asNumber(nil, stage) + 1
|
|
42225
42176
|
end
|
|
42226
|
-
if stage == LevelStage.DEPTHS_2 then
|
|
42177
|
+
if stage == LevelStage.DEPTHS_2 or stage == LevelStage.DEPTHS_1 and hasCurse(nil, LevelCurse.LABYRINTH) then
|
|
42227
42178
|
return LevelStage.DEPTHS_2
|
|
42228
42179
|
end
|
|
42229
42180
|
return stage
|
|
@@ -44061,8 +44012,6 @@ local ____log = require("src.functions.log")
|
|
|
44061
44012
|
local log = ____log.log
|
|
44062
44013
|
local ____random = require("src.functions.random")
|
|
44063
44014
|
local getRandomFloat = ____random.getRandomFloat
|
|
44064
|
-
local ____rng = require("src.functions.rng")
|
|
44065
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
44066
44015
|
function getTotalWeightOfCustomStageRooms(self, roomsMetadata)
|
|
44067
44016
|
local weights = __TS__ArrayMap(
|
|
44068
44017
|
roomsMetadata,
|
|
@@ -44096,9 +44045,6 @@ function getBossEntryWithChosenWeight(self, bossPool, chosenWeight)
|
|
|
44096
44045
|
error("Failed to get a custom stage boss entry with chosen weight: " .. tostring(chosenWeight))
|
|
44097
44046
|
end
|
|
44098
44047
|
function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, verbose)
|
|
44099
|
-
if seedOrRNG == nil then
|
|
44100
|
-
seedOrRNG = getRandomSeed(nil)
|
|
44101
|
-
end
|
|
44102
44048
|
if verbose == nil then
|
|
44103
44049
|
verbose = false
|
|
44104
44050
|
end
|
|
@@ -44113,9 +44059,6 @@ function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, ve
|
|
|
44113
44059
|
return getCustomStageRoomWithChosenWeight(nil, roomsMetadata, chosenWeight)
|
|
44114
44060
|
end
|
|
44115
44061
|
function ____exports.getRandomBossRoomFromPool(self, roomsMetadata, bossPool, seedOrRNG, verbose)
|
|
44116
|
-
if seedOrRNG == nil then
|
|
44117
|
-
seedOrRNG = getRandomSeed(nil)
|
|
44118
|
-
end
|
|
44119
44062
|
if verbose == nil then
|
|
44120
44063
|
verbose = false
|
|
44121
44064
|
end
|
|
@@ -47572,8 +47515,6 @@ local ____log = require("src.functions.log")
|
|
|
47572
47515
|
local log = ____log.log
|
|
47573
47516
|
local ____random = require("src.functions.random")
|
|
47574
47517
|
local getRandomFloat = ____random.getRandomFloat
|
|
47575
|
-
local ____rng = require("src.functions.rng")
|
|
47576
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
47577
47518
|
local ____utils = require("src.functions.utils")
|
|
47578
47519
|
local assertDefined = ____utils.assertDefined
|
|
47579
47520
|
function getTotalWeightOfJSONObject(self, jsonOjectArray)
|
|
@@ -47673,9 +47614,6 @@ function ____exports.getJSONRoomsOfSubType(self, jsonRooms, subType)
|
|
|
47673
47614
|
)
|
|
47674
47615
|
end
|
|
47675
47616
|
function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
|
|
47676
|
-
if seedOrRNG == nil then
|
|
47677
|
-
seedOrRNG = getRandomSeed(nil)
|
|
47678
|
-
end
|
|
47679
47617
|
if verbose == nil then
|
|
47680
47618
|
verbose = false
|
|
47681
47619
|
end
|
|
@@ -47696,9 +47634,6 @@ function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
|
|
|
47696
47634
|
return randomJSONEntity
|
|
47697
47635
|
end
|
|
47698
47636
|
function ____exports.getRandomJSONRoom(self, jsonRooms, seedOrRNG, verbose)
|
|
47699
|
-
if seedOrRNG == nil then
|
|
47700
|
-
seedOrRNG = getRandomSeed(nil)
|
|
47701
|
-
end
|
|
47702
47637
|
if verbose == nil then
|
|
47703
47638
|
verbose = false
|
|
47704
47639
|
end
|
|
@@ -47968,15 +47903,15 @@ local ____rng = require("src.functions.rng")
|
|
|
47968
47903
|
local getRandomSeed = ____rng.getRandomSeed
|
|
47969
47904
|
local isRNG = ____rng.isRNG
|
|
47970
47905
|
function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
|
|
47971
|
-
if seedOrRNG == nil then
|
|
47972
|
-
seedOrRNG = getRandomSeed(nil)
|
|
47973
|
-
end
|
|
47974
47906
|
if options == nil then
|
|
47975
47907
|
options = false
|
|
47976
47908
|
end
|
|
47977
47909
|
if forceFreeItem == nil then
|
|
47978
47910
|
forceFreeItem = false
|
|
47979
47911
|
end
|
|
47912
|
+
if seedOrRNG == nil then
|
|
47913
|
+
seedOrRNG = getRandomSeed(nil)
|
|
47914
|
+
end
|
|
47980
47915
|
local seed = isRNG(nil, seedOrRNG) and seedOrRNG:Next() or seedOrRNG
|
|
47981
47916
|
local collectible = spawnPickupWithSeed(
|
|
47982
47917
|
nil,
|
|
@@ -47997,9 +47932,6 @@ function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGri
|
|
|
47997
47932
|
return collectible
|
|
47998
47933
|
end
|
|
47999
47934
|
function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
|
|
48000
|
-
if seedOrRNG == nil then
|
|
48001
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48002
|
-
end
|
|
48003
47935
|
local collectible = ____exports.spawnCollectibleUnsafe(
|
|
48004
47936
|
nil,
|
|
48005
47937
|
CollectibleType.BROKEN_SHOVEL_1,
|
|
@@ -48141,8 +48073,6 @@ local ____ISCFeature = require("src.enums.ISCFeature")
|
|
|
48141
48073
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
48142
48074
|
local ____collectibleTag = require("src.functions.collectibleTag")
|
|
48143
48075
|
local isQuestCollectible = ____collectibleTag.isQuestCollectible
|
|
48144
|
-
local ____rng = require("src.functions.rng")
|
|
48145
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
48146
48076
|
local ____spawnCollectible = require("src.functions.spawnCollectible")
|
|
48147
48077
|
local spawnCollectibleUnsafe = ____spawnCollectible.spawnCollectibleUnsafe
|
|
48148
48078
|
local ____Feature = require("src.classes.private.Feature")
|
|
@@ -48157,9 +48087,6 @@ function SpawnCollectible.prototype.____constructor(self, preventCollectibleRota
|
|
|
48157
48087
|
self.preventCollectibleRotation = preventCollectibleRotation
|
|
48158
48088
|
end
|
|
48159
48089
|
function SpawnCollectible.prototype.spawnCollectible(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
|
|
48160
|
-
if seedOrRNG == nil then
|
|
48161
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48162
|
-
end
|
|
48163
48090
|
if options == nil then
|
|
48164
48091
|
options = false
|
|
48165
48092
|
end
|
|
@@ -48182,9 +48109,6 @@ function SpawnCollectible.prototype.spawnCollectible(self, collectibleType, posi
|
|
|
48182
48109
|
end
|
|
48183
48110
|
__TS__DecorateLegacy({Exported}, SpawnCollectible.prototype, "spawnCollectible", true)
|
|
48184
48111
|
function SpawnCollectible.prototype.spawnCollectibleFromPool(self, itemPoolType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
|
|
48185
|
-
if seedOrRNG == nil then
|
|
48186
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48187
|
-
end
|
|
48188
48112
|
if options == nil then
|
|
48189
48113
|
options = false
|
|
48190
48114
|
end
|
|
@@ -48245,7 +48169,6 @@ local getRandomJSONEntity = ____jsonRoom.getRandomJSONEntity
|
|
|
48245
48169
|
local ____log = require("src.functions.log")
|
|
48246
48170
|
local log = ____log.log
|
|
48247
48171
|
local ____rng = require("src.functions.rng")
|
|
48248
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
48249
48172
|
local isRNG = ____rng.isRNG
|
|
48250
48173
|
local newRNG = ____rng.newRNG
|
|
48251
48174
|
local ____roomGrid = require("src.functions.roomGrid")
|
|
@@ -48415,7 +48338,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
|
|
|
48415
48338
|
local yString = jsonSpawn["$"].y
|
|
48416
48339
|
local y = tonumber(yString)
|
|
48417
48340
|
assertDefined(nil, y, "Failed to convert the following y coordinate to a number (for a spawn): " .. yString)
|
|
48418
|
-
local jsonEntity = getRandomJSONEntity(nil, jsonSpawn.entity)
|
|
48341
|
+
local jsonEntity = getRandomJSONEntity(nil, jsonSpawn.entity, rng)
|
|
48419
48342
|
local entityTypeString = jsonEntity["$"].type
|
|
48420
48343
|
local entityTypeNumber = tonumber(entityTypeString)
|
|
48421
48344
|
assertDefined(nil, entityTypeNumber, "Failed to convert the entity type to a number: " .. entityTypeString)
|
|
@@ -48506,9 +48429,6 @@ function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType,
|
|
|
48506
48429
|
return entity
|
|
48507
48430
|
end
|
|
48508
48431
|
function DeployJSONRoom.prototype.deployJSONRoom(self, jsonRoom, seedOrRNG, verbose)
|
|
48509
|
-
if seedOrRNG == nil then
|
|
48510
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48511
|
-
end
|
|
48512
48432
|
if verbose == nil then
|
|
48513
48433
|
verbose = false
|
|
48514
48434
|
end
|
|
@@ -49008,7 +48928,6 @@ local removeFlag = ____flag.removeFlag
|
|
|
49008
48928
|
local ____map = require("src.functions.map")
|
|
49009
48929
|
local copyMap = ____map.copyMap
|
|
49010
48930
|
local ____rng = require("src.functions.rng")
|
|
49011
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
49012
48931
|
local isRNG = ____rng.isRNG
|
|
49013
48932
|
local newRNG = ____rng.newRNG
|
|
49014
48933
|
local ____roomData = require("src.functions.roomData")
|
|
@@ -49182,9 +49101,6 @@ function ____exports.getAllRoomGridIndexes(self)
|
|
|
49182
49101
|
)
|
|
49183
49102
|
end
|
|
49184
49103
|
function ____exports.getNewRoomCandidate(self, seedOrRNG, ensureDeadEnd)
|
|
49185
|
-
if seedOrRNG == nil then
|
|
49186
|
-
seedOrRNG = getRandomSeed(nil)
|
|
49187
|
-
end
|
|
49188
49104
|
if ensureDeadEnd == nil then
|
|
49189
49105
|
ensureDeadEnd = true
|
|
49190
49106
|
end
|
|
@@ -51164,7 +51080,7 @@ function ____exports.spawnCollectible(self, params)
|
|
|
51164
51080
|
end
|
|
51165
51081
|
local roomClass = game:GetRoom()
|
|
51166
51082
|
local centerPos = roomClass:GetCenterPos()
|
|
51167
|
-
spawnCollectibleUnsafe(nil, collectibleType, centerPos)
|
|
51083
|
+
spawnCollectibleUnsafe(nil, collectibleType, centerPos, nil)
|
|
51168
51084
|
end
|
|
51169
51085
|
function ____exports.spawnGoldenTrinket(self, params)
|
|
51170
51086
|
____exports.spawnTrinket(nil, params, true)
|
|
@@ -52011,7 +51927,7 @@ function ____exports.spawnCollectibleAt(self, params)
|
|
|
52011
51927
|
return
|
|
52012
51928
|
end
|
|
52013
51929
|
local collectibleType = asCollectibleType(nil, collectibleTypeNumber)
|
|
52014
|
-
spawnCollectibleUnsafe(nil, collectibleType, gridIndex)
|
|
51930
|
+
spawnCollectibleUnsafe(nil, collectibleType, gridIndex, nil)
|
|
52015
51931
|
end
|
|
52016
51932
|
function ____exports.spawnGoldTrinket(self, params)
|
|
52017
51933
|
____exports.spawnGoldenTrinket(nil, params)
|
|
@@ -53141,7 +53057,6 @@ local fireProjectilesInCircle = ____projectiles.fireProjectilesInCircle
|
|
|
53141
53057
|
local ____random = require("src.functions.random")
|
|
53142
53058
|
local getRandom = ____random.getRandom
|
|
53143
53059
|
local ____rng = require("src.functions.rng")
|
|
53144
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
53145
53060
|
local isRNG = ____rng.isRNG
|
|
53146
53061
|
local newRNG = ____rng.newRNG
|
|
53147
53062
|
local ____spawnCollectible = require("src.functions.spawnCollectible")
|
|
@@ -53169,9 +53084,6 @@ function SpawnRockAltRewards.prototype.____constructor(self, itemPoolDetection)
|
|
|
53169
53084
|
self.itemPoolDetection = itemPoolDetection
|
|
53170
53085
|
end
|
|
53171
53086
|
function SpawnRockAltRewards.prototype.spawnRockAltReward(self, positionOrGridIndex, rockAltType, seedOrRNG)
|
|
53172
|
-
if seedOrRNG == nil then
|
|
53173
|
-
seedOrRNG = getRandomSeed(nil)
|
|
53174
|
-
end
|
|
53175
53087
|
local room = game:GetRoom()
|
|
53176
53088
|
local position = isVector(nil, positionOrGridIndex) and positionOrGridIndex or room:GetGridPosition(positionOrGridIndex)
|
|
53177
53089
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
@@ -55083,32 +54995,6 @@ function ____exports.renderChargeBar(self, sprites, position, normalCharges, bat
|
|
|
55083
54995
|
sprites.meterBattery:Render(position, batteryChargesClamp)
|
|
55084
54996
|
sprites.lines:Render(position)
|
|
55085
54997
|
end
|
|
55086
|
-
return ____exports
|
|
55087
|
-
end,
|
|
55088
|
-
["src.functions.curses"] = function(...)
|
|
55089
|
-
local ____lualib = require("lualib_bundle")
|
|
55090
|
-
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
55091
|
-
local ____exports = {}
|
|
55092
|
-
local ____cachedClasses = require("src.core.cachedClasses")
|
|
55093
|
-
local game = ____cachedClasses.game
|
|
55094
|
-
local ____flag = require("src.functions.flag")
|
|
55095
|
-
local hasFlag = ____flag.hasFlag
|
|
55096
|
-
function ____exports.getCurseIDByName(self, name)
|
|
55097
|
-
local curseID = Isaac.GetCurseIdByName(name)
|
|
55098
|
-
if curseID == -1 then
|
|
55099
|
-
error(("Failed to get the curse ID corresponding to the curse name of \"" .. tostring(curseID)) .. "\". Does this name match what you put in the \"content/curses.xml\" file?")
|
|
55100
|
-
end
|
|
55101
|
-
return 1 << curseID - 1
|
|
55102
|
-
end
|
|
55103
|
-
function ____exports.hasCurse(self, ...)
|
|
55104
|
-
local curses = {...}
|
|
55105
|
-
local level = game:GetLevel()
|
|
55106
|
-
local levelCurses = level:GetCurses()
|
|
55107
|
-
return __TS__ArraySome(
|
|
55108
|
-
curses,
|
|
55109
|
-
function(____, curse) return hasFlag(nil, levelCurses, curse) end
|
|
55110
|
-
)
|
|
55111
|
-
end
|
|
55112
54998
|
return ____exports
|
|
55113
54999
|
end,
|
|
55114
55000
|
["src.functions.decorators"] = function(...)
|
|
@@ -55533,9 +55419,9 @@ __TS__SparseArrayPush(
|
|
|
55533
55419
|
table.unpack(FAKE_ITEM_POOL_TYPES)
|
|
55534
55420
|
)
|
|
55535
55421
|
local GREED_MODE_ITEM_POOL_TYPES = ____arrayRemove_3(__TS__SparseArraySpread(____array_2))
|
|
55536
|
-
function ____exports.getRandomItemPool(self)
|
|
55422
|
+
function ____exports.getRandomItemPool(self, seedOrRNG)
|
|
55537
55423
|
local itemPoolTypes = game:IsGreedMode() and GREED_MODE_ITEM_POOL_TYPES or NORMAL_MODE_ITEM_POOL_TYPES
|
|
55538
|
-
return getRandomArrayElement(nil, itemPoolTypes)
|
|
55424
|
+
return getRandomArrayElement(nil, itemPoolTypes, seedOrRNG)
|
|
55539
55425
|
end
|
|
55540
55426
|
function ____exports.removeCollectibleFromPools(self, ...)
|
|
55541
55427
|
local collectibleTypes = {...}
|
|
@@ -46,16 +46,20 @@ export declare class CustomItemPools extends Feature {
|
|
|
46
46
|
* By default, a collectible will not be removed from the pool once it is selected, unless the
|
|
47
47
|
* `decrease` argument is set to true (similar to how a vanilla item pool works).
|
|
48
48
|
*
|
|
49
|
+
* If you want to get an unseeded collectible type, you must explicitly pass `undefined` to the
|
|
50
|
+
* `seedOrRNG` parameter.
|
|
51
|
+
*
|
|
49
52
|
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_ITEM_POOLS`.
|
|
50
53
|
*
|
|
51
54
|
* @param itemPoolTypeCustom An integer representing the custom item pool to use.
|
|
55
|
+
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
56
|
+
* `RNG.Next` method will be called. If `undefined` is provided, it will default
|
|
57
|
+
* to a random seed.
|
|
52
58
|
* @param decrease Optional. Whether to remove the selected collectible from the item pool.
|
|
53
59
|
* Default is true.
|
|
54
|
-
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
|
|
55
|
-
* the `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
56
60
|
* @param defaultItem Optional. The collectible to return if the item pool is depleted. Default is
|
|
57
61
|
* `CollectibleType.NULL`.
|
|
58
62
|
*/
|
|
59
|
-
getCustomItemPoolCollectible(itemPoolTypeCustom: ItemPoolType,
|
|
63
|
+
getCustomItemPoolCollectible(itemPoolTypeCustom: ItemPoolType, seedOrRNG: Seed | RNG | undefined, decrease?: boolean, defaultItem?: CollectibleType): CollectibleType;
|
|
60
64
|
}
|
|
61
65
|
//# sourceMappingURL=CustomItemPools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomItemPools.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomItemPools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomItemPools.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomItemPools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAO/D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAahD,qBAAa,eAAgB,SAAQ,OAAO;IAmB1C,OAAO,CAAC,QAAQ,CAAC,6BAA6B,CAE5C;IAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IAEI,sBAAsB,CAC3B,kBAAkB,EAAE,YAAY,EAChC,YAAY,EAAE,aAAa,CAAC,eAAe,CAAC,GAC3C,IAAI;IAUP;;;;;;;;;;;;;;;;;;;;;OAqBG;IAEI,4BAA4B,CACjC,kBAAkB,EAAE,YAAY,EAChC,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,QAAQ,UAAQ,EAChB,WAAW,kBAAuB,GACjC,eAAe;CA2BnB"}
|
|
@@ -15,8 +15,6 @@ local ____array = require("src.functions.array")
|
|
|
15
15
|
local arrayRemoveIndexInPlace = ____array.arrayRemoveIndexInPlace
|
|
16
16
|
local ____map = require("src.functions.map")
|
|
17
17
|
local copyMap = ____map.copyMap
|
|
18
|
-
local ____rng = require("src.functions.rng")
|
|
19
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
20
18
|
local ____utils = require("src.functions.utils")
|
|
21
19
|
local assertDefined = ____utils.assertDefined
|
|
22
20
|
local ____weighted = require("src.functions.weighted")
|
|
@@ -44,13 +42,10 @@ function CustomItemPools.prototype.registerCustomItemPool(self, itemPoolTypeCust
|
|
|
44
42
|
customItemPoolMap:set(itemPoolTypeCustom, collectibles)
|
|
45
43
|
end
|
|
46
44
|
__TS__DecorateLegacy({Exported}, CustomItemPools.prototype, "registerCustomItemPool", true)
|
|
47
|
-
function CustomItemPools.prototype.getCustomItemPoolCollectible(self, itemPoolTypeCustom,
|
|
45
|
+
function CustomItemPools.prototype.getCustomItemPoolCollectible(self, itemPoolTypeCustom, seedOrRNG, decrease, defaultItem)
|
|
48
46
|
if decrease == nil then
|
|
49
47
|
decrease = false
|
|
50
48
|
end
|
|
51
|
-
if seedOrRNG == nil then
|
|
52
|
-
seedOrRNG = getRandomSeed(nil)
|
|
53
|
-
end
|
|
54
49
|
if defaultItem == nil then
|
|
55
50
|
defaultItem = CollectibleType.NULL
|
|
56
51
|
end
|
|
@@ -31,14 +31,18 @@ export declare class DeployJSONRoom extends Feature {
|
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*
|
|
34
|
+
* If you want to deploy an unseeded room, you must explicitly pass `undefined` to the `seedOrRNG`
|
|
35
|
+
* parameter.
|
|
36
|
+
*
|
|
34
37
|
* In order to use this function, you must upgrade your mod with `ISCFeature.DEPLOY_JSON_ROOM`.
|
|
35
38
|
*
|
|
36
39
|
* @param jsonRoom The JSON room to deploy.
|
|
37
|
-
* @param seedOrRNG
|
|
38
|
-
*
|
|
40
|
+
* @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
|
|
41
|
+
* `RNG.Next` method will be called. If `undefined` is provided, it will default
|
|
42
|
+
* to a random seed.
|
|
39
43
|
* @param verbose Optional. If specified, will write entries to the "log.txt" file that describe
|
|
40
44
|
* what the function is doing. Default is false.
|
|
41
45
|
*/
|
|
42
|
-
deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>, seedOrRNG
|
|
46
|
+
deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>, seedOrRNG: Seed | RNG | undefined, verbose?: boolean): void;
|
|
43
47
|
}
|
|
44
48
|
//# sourceMappingURL=DeployJSONRoom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeployJSONRoom.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/DeployJSONRoom.ts"],"names":[],"mappings":";;AA+BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,cAAe,SAAQ,OAAO;IACzC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA2B;IACpE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IAkBpD,OAAO,CAAC,gBAAgB;IA+FxB,OAAO,CAAC,4BAA4B;IAyCpC
|
|
1
|
+
{"version":3,"file":"DeployJSONRoom.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/DeployJSONRoom.ts"],"names":[],"mappings":";;AA+BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,qBAAa,cAAe,SAAQ,OAAO;IACzC,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAA2B;IACpE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAmB;IAkBpD,OAAO,CAAC,gBAAgB;IA+FxB,OAAO,CAAC,4BAA4B;IAyCpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IAEI,cAAc,CACnB,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,EACjC,OAAO,UAAQ,GACd,IAAI;CAwBR"}
|