isaacscript-common 71.2.1 → 72.0.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.
- package/dist/index.rollup.d.ts +229 -96
- package/dist/isaacscript-common.lua +13 -128
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostHolyMantleRemoved.lua +3 -1
- 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/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/callbacks/PostHolyMantleRemoved.ts +6 -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/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.1
|
|
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)
|
|
@@ -21933,6 +21890,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescri
|
|
|
21933
21890
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
21934
21891
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
21935
21892
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
21893
|
+
local ____frames = require("src.functions.frames")
|
|
21894
|
+
local isAfterRoomFrame = ____frames.isAfterRoomFrame
|
|
21936
21895
|
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
21937
21896
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
21938
21897
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
@@ -21956,7 +21915,7 @@ function PostHolyMantleRemoved.prototype.____constructor(self)
|
|
|
21956
21915
|
local newNumHolyMantles = effects:GetCollectibleEffectNum(CollectibleType.HOLY_MANTLE)
|
|
21957
21916
|
local oldNumHolyMantles = defaultMapGetPlayer(nil, v.run.playersHolyMantleMap, player)
|
|
21958
21917
|
mapSetPlayer(nil, v.run.playersHolyMantleMap, player, newNumHolyMantles)
|
|
21959
|
-
if newNumHolyMantles < oldNumHolyMantles then
|
|
21918
|
+
if newNumHolyMantles < oldNumHolyMantles and isAfterRoomFrame(nil, 0) then
|
|
21960
21919
|
self:fire(player, oldNumHolyMantles, newNumHolyMantles)
|
|
21961
21920
|
end
|
|
21962
21921
|
end
|
|
@@ -38759,8 +38718,6 @@ local ____array = require("src.functions.array")
|
|
|
38759
38718
|
local getArrayCombinations = ____array.getArrayCombinations
|
|
38760
38719
|
local getRandomArrayElement = ____array.getRandomArrayElement
|
|
38761
38720
|
local sumArray = ____array.sumArray
|
|
38762
|
-
local ____rng = require("src.functions.rng")
|
|
38763
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
38764
38721
|
local ____types = require("src.functions.types")
|
|
38765
38722
|
local isPrimitive = ____types.isPrimitive
|
|
38766
38723
|
function ____exports.getSortedSetValues(self, set)
|
|
@@ -38810,9 +38767,6 @@ function ____exports.deleteSetsFromSet(self, mainSet, ...)
|
|
|
38810
38767
|
end
|
|
38811
38768
|
end
|
|
38812
38769
|
function ____exports.getRandomSetElement(self, set, seedOrRNG, exceptions)
|
|
38813
|
-
if seedOrRNG == nil then
|
|
38814
|
-
seedOrRNG = getRandomSeed(nil)
|
|
38815
|
-
end
|
|
38816
38770
|
if exceptions == nil then
|
|
38817
38771
|
exceptions = {}
|
|
38818
38772
|
end
|
|
@@ -39074,8 +39028,6 @@ local isHiddenCollectible = ____collectibles.isHiddenCollectible
|
|
|
39074
39028
|
local isPassiveOrFamiliarCollectible = ____collectibles.isPassiveOrFamiliarCollectible
|
|
39075
39029
|
local ____flag = require("src.functions.flag")
|
|
39076
39030
|
local getFlagName = ____flag.getFlagName
|
|
39077
|
-
local ____rng = require("src.functions.rng")
|
|
39078
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
39079
39031
|
local ____set = require("src.functions.set")
|
|
39080
39032
|
local copySet = ____set.copySet
|
|
39081
39033
|
local deleteSetsFromSet = ____set.deleteSetsFromSet
|
|
@@ -39622,9 +39574,6 @@ function ModdedElementSets.prototype.getEdenPassiveCollectibleTypes(self)
|
|
|
39622
39574
|
end
|
|
39623
39575
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getEdenPassiveCollectibleTypes", true)
|
|
39624
39576
|
function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, seedOrRNG, exceptions)
|
|
39625
|
-
if seedOrRNG == nil then
|
|
39626
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39627
|
-
end
|
|
39628
39577
|
if exceptions == nil then
|
|
39629
39578
|
exceptions = {}
|
|
39630
39579
|
end
|
|
@@ -39633,9 +39582,6 @@ function ModdedElementSets.prototype.getRandomEdenActiveCollectibleType(self, se
|
|
|
39633
39582
|
end
|
|
39634
39583
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomEdenActiveCollectibleType", true)
|
|
39635
39584
|
function ModdedElementSets.prototype.getRandomEdenPassiveCollectibleType(self, seedOrRNG, exceptions)
|
|
39636
|
-
if seedOrRNG == nil then
|
|
39637
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39638
|
-
end
|
|
39639
39585
|
if exceptions == nil then
|
|
39640
39586
|
exceptions = {}
|
|
39641
39587
|
end
|
|
@@ -39689,9 +39635,6 @@ function ModdedElementSets.prototype.getCardTypesOfType(self, ...)
|
|
|
39689
39635
|
end
|
|
39690
39636
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getCardTypesOfType", true)
|
|
39691
39637
|
function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCardType, seedOrRNG, exceptions)
|
|
39692
|
-
if seedOrRNG == nil then
|
|
39693
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39694
|
-
end
|
|
39695
39638
|
if exceptions == nil then
|
|
39696
39639
|
exceptions = {}
|
|
39697
39640
|
end
|
|
@@ -39700,9 +39643,6 @@ function ModdedElementSets.prototype.getRandomCardTypeOfType(self, itemConfigCar
|
|
|
39700
39643
|
end
|
|
39701
39644
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCardTypeOfType", true)
|
|
39702
39645
|
function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
39703
|
-
if seedOrRNG == nil then
|
|
39704
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39705
|
-
end
|
|
39706
39646
|
if exceptions == nil then
|
|
39707
39647
|
exceptions = {}
|
|
39708
39648
|
end
|
|
@@ -39711,9 +39651,6 @@ function ModdedElementSets.prototype.getRandomCard(self, seedOrRNG, exceptions)
|
|
|
39711
39651
|
end
|
|
39712
39652
|
__TS__DecorateLegacy({Exported}, ModdedElementSets.prototype, "getRandomCard", true)
|
|
39713
39653
|
function ModdedElementSets.prototype.getRandomRune(self, seedOrRNG, exceptions)
|
|
39714
|
-
if seedOrRNG == nil then
|
|
39715
|
-
seedOrRNG = getRandomSeed(nil)
|
|
39716
|
-
end
|
|
39717
39654
|
if exceptions == nil then
|
|
39718
39655
|
exceptions = {}
|
|
39719
39656
|
end
|
|
@@ -41132,14 +41069,9 @@ local ____array = require("src.functions.array")
|
|
|
41132
41069
|
local sumArray = ____array.sumArray
|
|
41133
41070
|
local ____random = require("src.functions.random")
|
|
41134
41071
|
local getRandomFloat = ____random.getRandomFloat
|
|
41135
|
-
local ____rng = require("src.functions.rng")
|
|
41136
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
41137
41072
|
local ____utils = require("src.functions.utils")
|
|
41138
41073
|
local assertDefined = ____utils.assertDefined
|
|
41139
41074
|
function ____exports.getRandomIndexFromWeightedArray(self, weightedArray, seedOrRNG)
|
|
41140
|
-
if seedOrRNG == nil then
|
|
41141
|
-
seedOrRNG = getRandomSeed(nil)
|
|
41142
|
-
end
|
|
41143
41075
|
if #weightedArray == 0 then
|
|
41144
41076
|
error("Failed to get a random index from a weighted array since the provided array was empty.")
|
|
41145
41077
|
end
|
|
@@ -41162,9 +41094,6 @@ function ____exports.getRandomIndexFromWeightedArray(self, weightedArray, seedOr
|
|
|
41162
41094
|
error("Failed to get a random index from a weighted array.")
|
|
41163
41095
|
end
|
|
41164
41096
|
function ____exports.getRandomFromWeightedArray(self, weightedArray, seedOrRNG)
|
|
41165
|
-
if seedOrRNG == nil then
|
|
41166
|
-
seedOrRNG = getRandomSeed(nil)
|
|
41167
|
-
end
|
|
41168
41097
|
local randomIndex = ____exports.getRandomIndexFromWeightedArray(nil, weightedArray, seedOrRNG)
|
|
41169
41098
|
local randomElement = weightedArray[randomIndex + 1]
|
|
41170
41099
|
assertDefined(
|
|
@@ -41194,8 +41123,6 @@ local ____array = require("src.functions.array")
|
|
|
41194
41123
|
local arrayRemoveIndexInPlace = ____array.arrayRemoveIndexInPlace
|
|
41195
41124
|
local ____map = require("src.functions.map")
|
|
41196
41125
|
local copyMap = ____map.copyMap
|
|
41197
|
-
local ____rng = require("src.functions.rng")
|
|
41198
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
41199
41126
|
local ____utils = require("src.functions.utils")
|
|
41200
41127
|
local assertDefined = ____utils.assertDefined
|
|
41201
41128
|
local ____weighted = require("src.functions.weighted")
|
|
@@ -41223,13 +41150,10 @@ function CustomItemPools.prototype.registerCustomItemPool(self, itemPoolTypeCust
|
|
|
41223
41150
|
customItemPoolMap:set(itemPoolTypeCustom, collectibles)
|
|
41224
41151
|
end
|
|
41225
41152
|
__TS__DecorateLegacy({Exported}, CustomItemPools.prototype, "registerCustomItemPool", true)
|
|
41226
|
-
function CustomItemPools.prototype.getCustomItemPoolCollectible(self, itemPoolTypeCustom,
|
|
41153
|
+
function CustomItemPools.prototype.getCustomItemPoolCollectible(self, itemPoolTypeCustom, seedOrRNG, decrease, defaultItem)
|
|
41227
41154
|
if decrease == nil then
|
|
41228
41155
|
decrease = false
|
|
41229
41156
|
end
|
|
41230
|
-
if seedOrRNG == nil then
|
|
41231
|
-
seedOrRNG = getRandomSeed(nil)
|
|
41232
|
-
end
|
|
41233
41157
|
if defaultItem == nil then
|
|
41234
41158
|
defaultItem = CollectibleType.NULL
|
|
41235
41159
|
end
|
|
@@ -44090,8 +44014,6 @@ local ____log = require("src.functions.log")
|
|
|
44090
44014
|
local log = ____log.log
|
|
44091
44015
|
local ____random = require("src.functions.random")
|
|
44092
44016
|
local getRandomFloat = ____random.getRandomFloat
|
|
44093
|
-
local ____rng = require("src.functions.rng")
|
|
44094
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
44095
44017
|
function getTotalWeightOfCustomStageRooms(self, roomsMetadata)
|
|
44096
44018
|
local weights = __TS__ArrayMap(
|
|
44097
44019
|
roomsMetadata,
|
|
@@ -44125,9 +44047,6 @@ function getBossEntryWithChosenWeight(self, bossPool, chosenWeight)
|
|
|
44125
44047
|
error("Failed to get a custom stage boss entry with chosen weight: " .. tostring(chosenWeight))
|
|
44126
44048
|
end
|
|
44127
44049
|
function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, verbose)
|
|
44128
|
-
if seedOrRNG == nil then
|
|
44129
|
-
seedOrRNG = getRandomSeed(nil)
|
|
44130
|
-
end
|
|
44131
44050
|
if verbose == nil then
|
|
44132
44051
|
verbose = false
|
|
44133
44052
|
end
|
|
@@ -44142,9 +44061,6 @@ function ____exports.getRandomCustomStageRoom(self, roomsMetadata, seedOrRNG, ve
|
|
|
44142
44061
|
return getCustomStageRoomWithChosenWeight(nil, roomsMetadata, chosenWeight)
|
|
44143
44062
|
end
|
|
44144
44063
|
function ____exports.getRandomBossRoomFromPool(self, roomsMetadata, bossPool, seedOrRNG, verbose)
|
|
44145
|
-
if seedOrRNG == nil then
|
|
44146
|
-
seedOrRNG = getRandomSeed(nil)
|
|
44147
|
-
end
|
|
44148
44064
|
if verbose == nil then
|
|
44149
44065
|
verbose = false
|
|
44150
44066
|
end
|
|
@@ -47601,8 +47517,6 @@ local ____log = require("src.functions.log")
|
|
|
47601
47517
|
local log = ____log.log
|
|
47602
47518
|
local ____random = require("src.functions.random")
|
|
47603
47519
|
local getRandomFloat = ____random.getRandomFloat
|
|
47604
|
-
local ____rng = require("src.functions.rng")
|
|
47605
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
47606
47520
|
local ____utils = require("src.functions.utils")
|
|
47607
47521
|
local assertDefined = ____utils.assertDefined
|
|
47608
47522
|
function getTotalWeightOfJSONObject(self, jsonOjectArray)
|
|
@@ -47702,9 +47616,6 @@ function ____exports.getJSONRoomsOfSubType(self, jsonRooms, subType)
|
|
|
47702
47616
|
)
|
|
47703
47617
|
end
|
|
47704
47618
|
function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
|
|
47705
|
-
if seedOrRNG == nil then
|
|
47706
|
-
seedOrRNG = getRandomSeed(nil)
|
|
47707
|
-
end
|
|
47708
47619
|
if verbose == nil then
|
|
47709
47620
|
verbose = false
|
|
47710
47621
|
end
|
|
@@ -47725,9 +47636,6 @@ function ____exports.getRandomJSONEntity(self, jsonEntities, seedOrRNG, verbose)
|
|
|
47725
47636
|
return randomJSONEntity
|
|
47726
47637
|
end
|
|
47727
47638
|
function ____exports.getRandomJSONRoom(self, jsonRooms, seedOrRNG, verbose)
|
|
47728
|
-
if seedOrRNG == nil then
|
|
47729
|
-
seedOrRNG = getRandomSeed(nil)
|
|
47730
|
-
end
|
|
47731
47639
|
if verbose == nil then
|
|
47732
47640
|
verbose = false
|
|
47733
47641
|
end
|
|
@@ -47997,15 +47905,15 @@ local ____rng = require("src.functions.rng")
|
|
|
47997
47905
|
local getRandomSeed = ____rng.getRandomSeed
|
|
47998
47906
|
local isRNG = ____rng.isRNG
|
|
47999
47907
|
function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
|
|
48000
|
-
if seedOrRNG == nil then
|
|
48001
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48002
|
-
end
|
|
48003
47908
|
if options == nil then
|
|
48004
47909
|
options = false
|
|
48005
47910
|
end
|
|
48006
47911
|
if forceFreeItem == nil then
|
|
48007
47912
|
forceFreeItem = false
|
|
48008
47913
|
end
|
|
47914
|
+
if seedOrRNG == nil then
|
|
47915
|
+
seedOrRNG = getRandomSeed(nil)
|
|
47916
|
+
end
|
|
48009
47917
|
local seed = isRNG(nil, seedOrRNG) and seedOrRNG:Next() or seedOrRNG
|
|
48010
47918
|
local collectible = spawnPickupWithSeed(
|
|
48011
47919
|
nil,
|
|
@@ -48026,9 +47934,6 @@ function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGri
|
|
|
48026
47934
|
return collectible
|
|
48027
47935
|
end
|
|
48028
47936
|
function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
|
|
48029
|
-
if seedOrRNG == nil then
|
|
48030
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48031
|
-
end
|
|
48032
47937
|
local collectible = ____exports.spawnCollectibleUnsafe(
|
|
48033
47938
|
nil,
|
|
48034
47939
|
CollectibleType.BROKEN_SHOVEL_1,
|
|
@@ -48170,8 +48075,6 @@ local ____ISCFeature = require("src.enums.ISCFeature")
|
|
|
48170
48075
|
local ISCFeature = ____ISCFeature.ISCFeature
|
|
48171
48076
|
local ____collectibleTag = require("src.functions.collectibleTag")
|
|
48172
48077
|
local isQuestCollectible = ____collectibleTag.isQuestCollectible
|
|
48173
|
-
local ____rng = require("src.functions.rng")
|
|
48174
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
48175
48078
|
local ____spawnCollectible = require("src.functions.spawnCollectible")
|
|
48176
48079
|
local spawnCollectibleUnsafe = ____spawnCollectible.spawnCollectibleUnsafe
|
|
48177
48080
|
local ____Feature = require("src.classes.private.Feature")
|
|
@@ -48186,9 +48089,6 @@ function SpawnCollectible.prototype.____constructor(self, preventCollectibleRota
|
|
|
48186
48089
|
self.preventCollectibleRotation = preventCollectibleRotation
|
|
48187
48090
|
end
|
|
48188
48091
|
function SpawnCollectible.prototype.spawnCollectible(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
|
|
48189
|
-
if seedOrRNG == nil then
|
|
48190
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48191
|
-
end
|
|
48192
48092
|
if options == nil then
|
|
48193
48093
|
options = false
|
|
48194
48094
|
end
|
|
@@ -48211,9 +48111,6 @@ function SpawnCollectible.prototype.spawnCollectible(self, collectibleType, posi
|
|
|
48211
48111
|
end
|
|
48212
48112
|
__TS__DecorateLegacy({Exported}, SpawnCollectible.prototype, "spawnCollectible", true)
|
|
48213
48113
|
function SpawnCollectible.prototype.spawnCollectibleFromPool(self, itemPoolType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
|
|
48214
|
-
if seedOrRNG == nil then
|
|
48215
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48216
|
-
end
|
|
48217
48114
|
if options == nil then
|
|
48218
48115
|
options = false
|
|
48219
48116
|
end
|
|
@@ -48274,7 +48171,6 @@ local getRandomJSONEntity = ____jsonRoom.getRandomJSONEntity
|
|
|
48274
48171
|
local ____log = require("src.functions.log")
|
|
48275
48172
|
local log = ____log.log
|
|
48276
48173
|
local ____rng = require("src.functions.rng")
|
|
48277
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
48278
48174
|
local isRNG = ____rng.isRNG
|
|
48279
48175
|
local newRNG = ____rng.newRNG
|
|
48280
48176
|
local ____roomGrid = require("src.functions.roomGrid")
|
|
@@ -48444,7 +48340,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
|
|
|
48444
48340
|
local yString = jsonSpawn["$"].y
|
|
48445
48341
|
local y = tonumber(yString)
|
|
48446
48342
|
assertDefined(nil, y, "Failed to convert the following y coordinate to a number (for a spawn): " .. yString)
|
|
48447
|
-
local jsonEntity = getRandomJSONEntity(nil, jsonSpawn.entity)
|
|
48343
|
+
local jsonEntity = getRandomJSONEntity(nil, jsonSpawn.entity, rng)
|
|
48448
48344
|
local entityTypeString = jsonEntity["$"].type
|
|
48449
48345
|
local entityTypeNumber = tonumber(entityTypeString)
|
|
48450
48346
|
assertDefined(nil, entityTypeNumber, "Failed to convert the entity type to a number: " .. entityTypeString)
|
|
@@ -48535,9 +48431,6 @@ function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType,
|
|
|
48535
48431
|
return entity
|
|
48536
48432
|
end
|
|
48537
48433
|
function DeployJSONRoom.prototype.deployJSONRoom(self, jsonRoom, seedOrRNG, verbose)
|
|
48538
|
-
if seedOrRNG == nil then
|
|
48539
|
-
seedOrRNG = getRandomSeed(nil)
|
|
48540
|
-
end
|
|
48541
48434
|
if verbose == nil then
|
|
48542
48435
|
verbose = false
|
|
48543
48436
|
end
|
|
@@ -49037,7 +48930,6 @@ local removeFlag = ____flag.removeFlag
|
|
|
49037
48930
|
local ____map = require("src.functions.map")
|
|
49038
48931
|
local copyMap = ____map.copyMap
|
|
49039
48932
|
local ____rng = require("src.functions.rng")
|
|
49040
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
49041
48933
|
local isRNG = ____rng.isRNG
|
|
49042
48934
|
local newRNG = ____rng.newRNG
|
|
49043
48935
|
local ____roomData = require("src.functions.roomData")
|
|
@@ -49211,9 +49103,6 @@ function ____exports.getAllRoomGridIndexes(self)
|
|
|
49211
49103
|
)
|
|
49212
49104
|
end
|
|
49213
49105
|
function ____exports.getNewRoomCandidate(self, seedOrRNG, ensureDeadEnd)
|
|
49214
|
-
if seedOrRNG == nil then
|
|
49215
|
-
seedOrRNG = getRandomSeed(nil)
|
|
49216
|
-
end
|
|
49217
49106
|
if ensureDeadEnd == nil then
|
|
49218
49107
|
ensureDeadEnd = true
|
|
49219
49108
|
end
|
|
@@ -51193,7 +51082,7 @@ function ____exports.spawnCollectible(self, params)
|
|
|
51193
51082
|
end
|
|
51194
51083
|
local roomClass = game:GetRoom()
|
|
51195
51084
|
local centerPos = roomClass:GetCenterPos()
|
|
51196
|
-
spawnCollectibleUnsafe(nil, collectibleType, centerPos)
|
|
51085
|
+
spawnCollectibleUnsafe(nil, collectibleType, centerPos, nil)
|
|
51197
51086
|
end
|
|
51198
51087
|
function ____exports.spawnGoldenTrinket(self, params)
|
|
51199
51088
|
____exports.spawnTrinket(nil, params, true)
|
|
@@ -52040,7 +51929,7 @@ function ____exports.spawnCollectibleAt(self, params)
|
|
|
52040
51929
|
return
|
|
52041
51930
|
end
|
|
52042
51931
|
local collectibleType = asCollectibleType(nil, collectibleTypeNumber)
|
|
52043
|
-
spawnCollectibleUnsafe(nil, collectibleType, gridIndex)
|
|
51932
|
+
spawnCollectibleUnsafe(nil, collectibleType, gridIndex, nil)
|
|
52044
51933
|
end
|
|
52045
51934
|
function ____exports.spawnGoldTrinket(self, params)
|
|
52046
51935
|
____exports.spawnGoldenTrinket(nil, params)
|
|
@@ -53170,7 +53059,6 @@ local fireProjectilesInCircle = ____projectiles.fireProjectilesInCircle
|
|
|
53170
53059
|
local ____random = require("src.functions.random")
|
|
53171
53060
|
local getRandom = ____random.getRandom
|
|
53172
53061
|
local ____rng = require("src.functions.rng")
|
|
53173
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
53174
53062
|
local isRNG = ____rng.isRNG
|
|
53175
53063
|
local newRNG = ____rng.newRNG
|
|
53176
53064
|
local ____spawnCollectible = require("src.functions.spawnCollectible")
|
|
@@ -53198,9 +53086,6 @@ function SpawnRockAltRewards.prototype.____constructor(self, itemPoolDetection)
|
|
|
53198
53086
|
self.itemPoolDetection = itemPoolDetection
|
|
53199
53087
|
end
|
|
53200
53088
|
function SpawnRockAltRewards.prototype.spawnRockAltReward(self, positionOrGridIndex, rockAltType, seedOrRNG)
|
|
53201
|
-
if seedOrRNG == nil then
|
|
53202
|
-
seedOrRNG = getRandomSeed(nil)
|
|
53203
|
-
end
|
|
53204
53089
|
local room = game:GetRoom()
|
|
53205
53090
|
local position = isVector(nil, positionOrGridIndex) and positionOrGridIndex or room:GetGridPosition(positionOrGridIndex)
|
|
53206
53091
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
@@ -55536,9 +55421,9 @@ __TS__SparseArrayPush(
|
|
|
55536
55421
|
table.unpack(FAKE_ITEM_POOL_TYPES)
|
|
55537
55422
|
)
|
|
55538
55423
|
local GREED_MODE_ITEM_POOL_TYPES = ____arrayRemove_3(__TS__SparseArraySpread(____array_2))
|
|
55539
|
-
function ____exports.getRandomItemPool(self)
|
|
55424
|
+
function ____exports.getRandomItemPool(self, seedOrRNG)
|
|
55540
55425
|
local itemPoolTypes = game:IsGreedMode() and GREED_MODE_ITEM_POOL_TYPES or NORMAL_MODE_ITEM_POOL_TYPES
|
|
55541
|
-
return getRandomArrayElement(nil, itemPoolTypes)
|
|
55426
|
+
return getRandomArrayElement(nil, itemPoolTypes, seedOrRNG)
|
|
55542
55427
|
end
|
|
55543
55428
|
function ____exports.removeCollectibleFromPools(self, ...)
|
|
55544
55429
|
local collectibleTypes = {...}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostHolyMantleRemoved.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostHolyMantleRemoved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"PostHolyMantleRemoved.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostHolyMantleRemoved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAMlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAQ3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;;;MAAK;;IAatB,UAAmB,UAAU,0BAAoB;IAGjD,OAAO,CAAC,QAAQ,CAAC,0BAA0B,CAoBzC;CACH"}
|
|
@@ -7,6 +7,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
|
|
|
7
7
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
8
8
|
local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
|
|
9
9
|
local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
|
|
10
|
+
local ____frames = require("src.functions.frames")
|
|
11
|
+
local isAfterRoomFrame = ____frames.isAfterRoomFrame
|
|
10
12
|
local ____playerDataStructures = require("src.functions.playerDataStructures")
|
|
11
13
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
12
14
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
@@ -30,7 +32,7 @@ function PostHolyMantleRemoved.prototype.____constructor(self)
|
|
|
30
32
|
local newNumHolyMantles = effects:GetCollectibleEffectNum(CollectibleType.HOLY_MANTLE)
|
|
31
33
|
local oldNumHolyMantles = defaultMapGetPlayer(nil, v.run.playersHolyMantleMap, player)
|
|
32
34
|
mapSetPlayer(nil, v.run.playersHolyMantleMap, player, newNumHolyMantles)
|
|
33
|
-
if newNumHolyMantles < oldNumHolyMantles then
|
|
35
|
+
if newNumHolyMantles < oldNumHolyMantles and isAfterRoomFrame(nil, 0) then
|
|
34
36
|
self:fire(player, oldNumHolyMantles, newNumHolyMantles)
|
|
35
37
|
end
|
|
36
38
|
end
|
|
@@ -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"}
|
|
@@ -37,7 +37,6 @@ local getRandomJSONEntity = ____jsonRoom.getRandomJSONEntity
|
|
|
37
37
|
local ____log = require("src.functions.log")
|
|
38
38
|
local log = ____log.log
|
|
39
39
|
local ____rng = require("src.functions.rng")
|
|
40
|
-
local getRandomSeed = ____rng.getRandomSeed
|
|
41
40
|
local isRNG = ____rng.isRNG
|
|
42
41
|
local newRNG = ____rng.newRNG
|
|
43
42
|
local ____roomGrid = require("src.functions.roomGrid")
|
|
@@ -207,7 +206,7 @@ function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
|
|
|
207
206
|
local yString = jsonSpawn["$"].y
|
|
208
207
|
local y = tonumber(yString)
|
|
209
208
|
assertDefined(nil, y, "Failed to convert the following y coordinate to a number (for a spawn): " .. yString)
|
|
210
|
-
local jsonEntity = getRandomJSONEntity(nil, jsonSpawn.entity)
|
|
209
|
+
local jsonEntity = getRandomJSONEntity(nil, jsonSpawn.entity, rng)
|
|
211
210
|
local entityTypeString = jsonEntity["$"].type
|
|
212
211
|
local entityTypeNumber = tonumber(entityTypeString)
|
|
213
212
|
assertDefined(nil, entityTypeNumber, "Failed to convert the entity type to a number: " .. entityTypeString)
|
|
@@ -298,9 +297,6 @@ function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType,
|
|
|
298
297
|
return entity
|
|
299
298
|
end
|
|
300
299
|
function DeployJSONRoom.prototype.deployJSONRoom(self, jsonRoom, seedOrRNG, verbose)
|
|
301
|
-
if seedOrRNG == nil then
|
|
302
|
-
seedOrRNG = getRandomSeed(nil)
|
|
303
|
-
end
|
|
304
300
|
if verbose == nil then
|
|
305
301
|
verbose = false
|
|
306
302
|
end
|