isaacscript-common 75.2.1 → 76.1.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.
Files changed (43) hide show
  1. package/dist/classes/features/other/DeployJSONRoom.d.ts +0 -1
  2. package/dist/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
  3. package/dist/classes/features/other/DeployJSONRoom.lua +6 -4
  4. package/dist/classes/features/other/SpawnRockAltRewards.lua +14 -14
  5. package/dist/classes/features/other/extraConsoleCommands/commands.lua +3 -3
  6. package/dist/enums/ISCFeature.d.ts +12 -14
  7. package/dist/enums/ISCFeature.d.ts.map +1 -1
  8. package/dist/enums/ISCFeature.lua +12 -16
  9. package/dist/features.d.ts +12 -18
  10. package/dist/features.d.ts.map +1 -1
  11. package/dist/features.lua +1 -9
  12. package/dist/functions/cards.d.ts +8 -0
  13. package/dist/functions/cards.d.ts.map +1 -1
  14. package/dist/functions/cards.lua +22 -0
  15. package/dist/functions/collectibles.d.ts +8 -0
  16. package/dist/functions/collectibles.d.ts.map +1 -1
  17. package/dist/functions/collectibles.lua +19 -0
  18. package/dist/functions/spawnCollectible.d.ts +28 -6
  19. package/dist/functions/spawnCollectible.d.ts.map +1 -1
  20. package/dist/functions/spawnCollectible.lua +50 -7
  21. package/dist/functions/tears.d.ts +6 -2
  22. package/dist/functions/tears.d.ts.map +1 -1
  23. package/dist/functions/tears.lua +6 -2
  24. package/dist/index.rollup.d.ts +63 -106
  25. package/dist/isaacscript-common.lua +225 -331
  26. package/package.json +1 -1
  27. package/src/classes/features/other/DeployJSONRoom.ts +4 -12
  28. package/src/classes/features/other/SpawnRockAltRewards.ts +14 -14
  29. package/src/classes/features/other/extraConsoleCommands/commands.ts +3 -3
  30. package/src/enums/ISCFeature.ts +0 -2
  31. package/src/features.ts +1 -15
  32. package/src/functions/cards.ts +19 -0
  33. package/src/functions/collectibles.ts +25 -0
  34. package/src/functions/spawnCollectible.ts +58 -8
  35. package/src/functions/tears.ts +6 -2
  36. package/dist/classes/features/other/PreventCollectibleRotation.d.ts +0 -28
  37. package/dist/classes/features/other/PreventCollectibleRotation.d.ts.map +0 -1
  38. package/dist/classes/features/other/PreventCollectibleRotation.lua +0 -112
  39. package/dist/classes/features/other/SpawnCollectible.d.ts +0 -58
  40. package/dist/classes/features/other/SpawnCollectible.d.ts.map +0 -1
  41. package/dist/classes/features/other/SpawnCollectible.lua +0 -68
  42. package/src/classes/features/other/PreventCollectibleRotation.ts +0 -205
  43. package/src/classes/features/other/SpawnCollectible.ts +0 -124
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 75.2.0
3
+ isaacscript-common 76.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -18854,33 +18854,29 @@ ____exports.ISCFeature.PRESS_INPUT = 42
18854
18854
  ____exports.ISCFeature[____exports.ISCFeature.PRESS_INPUT] = "PRESS_INPUT"
18855
18855
  ____exports.ISCFeature.PREVENT_CHILD_ENTITIES = 43
18856
18856
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_CHILD_ENTITIES] = "PREVENT_CHILD_ENTITIES"
18857
- ____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION = 44
18858
- ____exports.ISCFeature[____exports.ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = "PREVENT_COLLECTIBLE_ROTATION"
18859
- ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 45
18857
+ ____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN = 44
18860
18858
  ____exports.ISCFeature[____exports.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = "PREVENT_GRID_ENTITY_RESPAWN"
18861
- ____exports.ISCFeature.ROOM_CLEAR_FRAME = 46
18859
+ ____exports.ISCFeature.ROOM_CLEAR_FRAME = 45
18862
18860
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_CLEAR_FRAME] = "ROOM_CLEAR_FRAME"
18863
- ____exports.ISCFeature.ROOM_HISTORY = 47
18861
+ ____exports.ISCFeature.ROOM_HISTORY = 46
18864
18862
  ____exports.ISCFeature[____exports.ISCFeature.ROOM_HISTORY] = "ROOM_HISTORY"
18865
- ____exports.ISCFeature.RUN_IN_N_FRAMES = 48
18863
+ ____exports.ISCFeature.RUN_IN_N_FRAMES = 47
18866
18864
  ____exports.ISCFeature[____exports.ISCFeature.RUN_IN_N_FRAMES] = "RUN_IN_N_FRAMES"
18867
- ____exports.ISCFeature.RUN_NEXT_ROOM = 49
18865
+ ____exports.ISCFeature.RUN_NEXT_ROOM = 48
18868
18866
  ____exports.ISCFeature[____exports.ISCFeature.RUN_NEXT_ROOM] = "RUN_NEXT_ROOM"
18869
- ____exports.ISCFeature.RUN_NEXT_RUN = 50
18867
+ ____exports.ISCFeature.RUN_NEXT_RUN = 49
18870
18868
  ____exports.ISCFeature[____exports.ISCFeature.RUN_NEXT_RUN] = "RUN_NEXT_RUN"
18871
- ____exports.ISCFeature.SAVE_DATA_MANAGER = 51
18869
+ ____exports.ISCFeature.SAVE_DATA_MANAGER = 50
18872
18870
  ____exports.ISCFeature[____exports.ISCFeature.SAVE_DATA_MANAGER] = "SAVE_DATA_MANAGER"
18873
- ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 52
18871
+ ____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS = 51
18874
18872
  ____exports.ISCFeature[____exports.ISCFeature.SPAWN_ALT_ROCK_REWARDS] = "SPAWN_ALT_ROCK_REWARDS"
18875
- ____exports.ISCFeature.SPAWN_COLLECTIBLE = 53
18876
- ____exports.ISCFeature[____exports.ISCFeature.SPAWN_COLLECTIBLE] = "SPAWN_COLLECTIBLE"
18877
- ____exports.ISCFeature.STAGE_HISTORY = 54
18873
+ ____exports.ISCFeature.STAGE_HISTORY = 52
18878
18874
  ____exports.ISCFeature[____exports.ISCFeature.STAGE_HISTORY] = "STAGE_HISTORY"
18879
- ____exports.ISCFeature.START_AMBUSH = 55
18875
+ ____exports.ISCFeature.START_AMBUSH = 53
18880
18876
  ____exports.ISCFeature[____exports.ISCFeature.START_AMBUSH] = "START_AMBUSH"
18881
- ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 56
18877
+ ____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS = 54
18882
18878
  ____exports.ISCFeature[____exports.ISCFeature.TAINTED_LAZARUS_PLAYERS] = "TAINTED_LAZARUS_PLAYERS"
18883
- ____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION = 57
18879
+ ____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION = 55
18884
18880
  ____exports.ISCFeature[____exports.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION] = "UNLOCK_ACHIEVEMENTS_DETECTION"
18885
18881
  return ____exports
18886
18882
  end,
@@ -26915,6 +26911,25 @@ function ____exports.newCollectibleSprite(self, collectibleType)
26915
26911
  sprite:Play(defaultAnimation, true)
26916
26912
  return sprite
26917
26913
  end
26914
+ --- Helper function to remove the rotation behavior from a collectible. This will happen by default
26915
+ -- when collectibles are spawned when playing as Tainted Isaac or when having Binge Eater.
26916
+ --
26917
+ -- Under the hood, this is accomplished by morphing the collectible with the `ignoreModifiers`
26918
+ -- argument set to true.
26919
+ function ____exports.preventCollectibleRotation(self, collectible)
26920
+ if not isCollectible(nil, collectible) then
26921
+ local entityID = getEntityID(nil, collectible)
26922
+ error("The \"preventCollectibleRotation\" function was given a non-collectible: " .. entityID)
26923
+ end
26924
+ collectible:Morph(
26925
+ collectible.Type,
26926
+ collectible.Variant,
26927
+ collectible.SubType,
26928
+ true,
26929
+ true,
26930
+ true
26931
+ )
26932
+ end
26918
26933
  --- Helper function to remove all pickup delay on a collectible. By default, collectibles have a 20
26919
26934
  -- frame delay before they can be picked up by a player.
26920
26935
  function ____exports.removeCollectiblePickupDelay(self, collectible)
@@ -34784,8 +34799,12 @@ end
34784
34799
  --- Helper function to check if a tear hit an enemy. A tear is considered to be missed if it hit the
34785
34800
  -- ground, a wall, or a grid entity.
34786
34801
  --
34787
- -- Under the hood, this function uses the `Entity.IsDead` method to determine this. (Tears will not
34788
- -- die if they hit an enemy, but they will die if they hit a wall or object.)
34802
+ -- Note that tears are still considered to be missed if they hit a poop or fire, so you may want to
34803
+ -- handle those separately using the `POST_GRID_ENTITY_COLLISION` and `POST_ENTITY_COLLISION`
34804
+ -- callbacks, respectively.
34805
+ --
34806
+ -- Under the hood, this function uses the `Entity.IsDead` method. (Tears will not die if they hit an
34807
+ -- enemy, but they will die if they hit a wall or object.)
34789
34808
  function ____exports.isMissedTear(self, tear)
34790
34809
  return tear:IsDead()
34791
34810
  end
@@ -43145,10 +43164,16 @@ ____exports.ITEM_CONFIG_CARD_TYPES_FOR_CARDS_SET = __TS__New(ReadonlySet, {ItemC
43145
43164
  return ____exports
43146
43165
  end,
43147
43166
  ["functions.cards"] = function(...)
43167
+ local ____lualib = require("lualib_bundle")
43168
+ local Set = ____lualib.Set
43169
+ local __TS__New = ____lualib.__TS__New
43170
+ local __TS__ArraySome = ____lualib.__TS__ArraySome
43148
43171
  local ____exports = {}
43149
43172
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
43150
43173
  local ItemConfigCardType = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigCardType
43151
43174
  local UseFlag = ____isaac_2Dtypescript_2Ddefinitions.UseFlag
43175
+ local ____cachedEnumValues = require("arrays.cachedEnumValues")
43176
+ local POCKET_ITEM_SLOT_VALUES = ____cachedEnumValues.POCKET_ITEM_SLOT_VALUES
43152
43177
  local ____cachedClasses = require("core.cachedClasses")
43153
43178
  local itemConfig = ____cachedClasses.itemConfig
43154
43179
  local ____constantsFirstLast = require("core.constantsFirstLast")
@@ -43211,6 +43236,22 @@ function ____exports.getItemConfigCardType(self, cardType)
43211
43236
  end
43212
43237
  return itemConfigCard.CardType
43213
43238
  end
43239
+ --- Helper function to check if a player is holding a specific card in one of their pocket item
43240
+ -- slots.
43241
+ --
43242
+ -- This function is variadic, meaning that you can pass as many cards as you want to check for. The
43243
+ -- function will return true if the player has any of the cards.
43244
+ function ____exports.hasCard(self, player, ...)
43245
+ local cardTypes = {...}
43246
+ local cardTypesSet = __TS__New(Set, cardTypes)
43247
+ return __TS__ArraySome(
43248
+ POCKET_ITEM_SLOT_VALUES,
43249
+ function(____, pocketItemSlot)
43250
+ local cardType = player:GetCard(pocketItemSlot)
43251
+ return cardTypesSet:has(cardType)
43252
+ end
43253
+ )
43254
+ end
43214
43255
  --- Returns true for card types that have the following item config card type:
43215
43256
  --
43216
43257
  -- - `ItemConfigCardType.TAROT` (0)
@@ -53249,133 +53290,6 @@ function ____exports.worldPositionToGridPositionFast(self, worldPos)
53249
53290
  local y = worldPos.Y / 40 - 4
53250
53291
  return Vector(x, y)
53251
53292
  end
53252
- return ____exports
53253
- end,
53254
- ["classes.features.other.PreventGridEntityRespawn"] = function(...)
53255
- local ____lualib = require("lualib_bundle")
53256
- local __TS__New = ____lualib.__TS__New
53257
- local __TS__Class = ____lualib.__TS__Class
53258
- local __TS__ClassExtends = ____lualib.__TS__ClassExtends
53259
- local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
53260
- local ____exports = {}
53261
- local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
53262
- local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
53263
- local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
53264
- local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
53265
- local ____cachedClasses = require("core.cachedClasses")
53266
- local game = ____cachedClasses.game
53267
- local ____decorators = require("decorators")
53268
- local Exported = ____decorators.Exported
53269
- local ____ISCFeature = require("enums.ISCFeature")
53270
- local ISCFeature = ____ISCFeature.ISCFeature
53271
- local ____ModCallbackCustom = require("enums.ModCallbackCustom")
53272
- local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
53273
- local ____array = require("functions.array")
53274
- local emptyArray = ____array.emptyArray
53275
- local ____gridEntities = require("functions.gridEntities")
53276
- local getAllGridIndexes = ____gridEntities.getAllGridIndexes
53277
- local getGridEntities = ____gridEntities.getGridEntities
53278
- local removeGridEntity = ____gridEntities.removeGridEntity
53279
- local setGridEntityInvisible = ____gridEntities.setGridEntityInvisible
53280
- local spawnGridEntity = ____gridEntities.spawnGridEntity
53281
- local ____players = require("functions.players")
53282
- local getPlayerFromPtr = ____players.getPlayerFromPtr
53283
- local ____roomData = require("functions.roomData")
53284
- local getRoomListIndex = ____roomData.getRoomListIndex
53285
- local ____DefaultMap = require("classes.DefaultMap")
53286
- local DefaultMap = ____DefaultMap.DefaultMap
53287
- local ____Feature = require("classes.private.Feature")
53288
- local Feature = ____Feature.Feature
53289
- local v = {
53290
- level = {roomListIndexToDecorationGridIndexes = __TS__New(
53291
- DefaultMap,
53292
- function() return {} end
53293
- )},
53294
- room = {manuallyUsingShovel = false}
53295
- }
53296
- ____exports.PreventGridEntityRespawn = __TS__Class()
53297
- local PreventGridEntityRespawn = ____exports.PreventGridEntityRespawn
53298
- PreventGridEntityRespawn.name = "PreventGridEntityRespawn"
53299
- __TS__ClassExtends(PreventGridEntityRespawn, Feature)
53300
- function PreventGridEntityRespawn.prototype.____constructor(self, runInNFrames)
53301
- Feature.prototype.____constructor(self)
53302
- self.v = v
53303
- self.preUseItemWeNeedToGoDeeper = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
53304
- if v.room.manuallyUsingShovel then
53305
- return nil
53306
- end
53307
- local roomListIndex = getRoomListIndex(nil)
53308
- if not v.level.roomListIndexToDecorationGridIndexes:has(roomListIndex) then
53309
- return
53310
- end
53311
- local decorations = getGridEntities(nil, GridEntityType.DECORATION)
53312
- for ____, decoration in ipairs(decorations) do
53313
- removeGridEntity(nil, decoration, false)
53314
- end
53315
- local entityPtr = EntityPtr(player)
53316
- self.runInNFrames:runNextGameFrame(function()
53317
- local futurePlayer = getPlayerFromPtr(nil, entityPtr)
53318
- if futurePlayer == nil then
53319
- return
53320
- end
53321
- local futureRoomListIndex = getRoomListIndex(nil)
53322
- if futureRoomListIndex ~= roomListIndex then
53323
- return
53324
- end
53325
- v.room.manuallyUsingShovel = true
53326
- futurePlayer:UseActiveItem(CollectibleType.WE_NEED_TO_GO_DEEPER)
53327
- v.room.manuallyUsingShovel = false
53328
- local decorationGridIndexes = v.level.roomListIndexToDecorationGridIndexes:getAndSetDefault(roomListIndex)
53329
- emptyArray(nil, decorationGridIndexes)
53330
- self:preventGridEntityRespawn()
53331
- end)
53332
- return true
53333
- end
53334
- self.postNewRoomReordered = function()
53335
- self:setDecorationsInvisible()
53336
- end
53337
- self.featuresUsed = {ISCFeature.RUN_IN_N_FRAMES}
53338
- self.callbacksUsed = {{ModCallback.PRE_USE_ITEM, self.preUseItemWeNeedToGoDeeper, {CollectibleType.WE_NEED_TO_GO_DEEPER}}}
53339
- self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, self.postNewRoomReordered}}
53340
- self.runInNFrames = runInNFrames
53341
- end
53342
- function PreventGridEntityRespawn.prototype.setDecorationsInvisible(self)
53343
- local room = game:GetRoom()
53344
- local roomListIndex = getRoomListIndex(nil)
53345
- local decorationGridIndexes = v.level.roomListIndexToDecorationGridIndexes:get(roomListIndex)
53346
- if decorationGridIndexes == nil then
53347
- return
53348
- end
53349
- for ____, gridIndex in ipairs(decorationGridIndexes) do
53350
- local gridEntity = room:GetGridEntity(gridIndex)
53351
- if gridEntity ~= nil then
53352
- local gridEntityType = gridEntity:GetType()
53353
- if gridEntityType == GridEntityType.DECORATION then
53354
- setGridEntityInvisible(nil, gridEntity)
53355
- end
53356
- end
53357
- end
53358
- end
53359
- function PreventGridEntityRespawn.prototype.preventGridEntityRespawn(self)
53360
- local room = game:GetRoom()
53361
- local roomListIndex = getRoomListIndex(nil)
53362
- local decorationGridIndexes = v.level.roomListIndexToDecorationGridIndexes:getAndSetDefault(roomListIndex)
53363
- for ____, gridIndex in ipairs(getAllGridIndexes(nil)) do
53364
- do
53365
- local existingGridEntity = room:GetGridEntity(gridIndex)
53366
- if existingGridEntity ~= nil then
53367
- goto __continue20
53368
- end
53369
- local decoration = spawnGridEntity(nil, GridEntityType.DECORATION, gridIndex)
53370
- if decoration ~= nil then
53371
- setGridEntityInvisible(nil, decoration)
53372
- end
53373
- decorationGridIndexes[#decorationGridIndexes + 1] = gridIndex
53374
- end
53375
- ::__continue20::
53376
- end
53377
- end
53378
- __TS__DecorateLegacy({Exported}, PreventGridEntityRespawn.prototype, "preventGridEntityRespawn", true)
53379
53293
  return ____exports
53380
53294
  end,
53381
53295
  ["functions.spawnCollectible"] = function(...)
@@ -53384,11 +53298,14 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescri
53384
53298
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
53385
53299
  local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
53386
53300
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
53301
+ local ____cachedClasses = require("core.cachedClasses")
53302
+ local game = ____cachedClasses.game
53387
53303
  local ____constants = require("core.constants")
53388
53304
  local VectorZero = ____constants.VectorZero
53389
53305
  local ____collectibleTag = require("functions.collectibleTag")
53390
53306
  local isQuestCollectible = ____collectibleTag.isQuestCollectible
53391
53307
  local ____collectibles = require("functions.collectibles")
53308
+ local preventCollectibleRotation = ____collectibles.preventCollectibleRotation
53392
53309
  local setCollectibleEmpty = ____collectibles.setCollectibleEmpty
53393
53310
  local ____entitiesSpecific = require("functions.entitiesSpecific")
53394
53311
  local spawnPickupWithSeed = ____entitiesSpecific.spawnPickupWithSeed
@@ -53400,11 +53317,8 @@ local isRNG = ____rng.isRNG
53400
53317
  --- Helper function to spawn a collectible.
53401
53318
  --
53402
53319
  -- Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
53403
- -- collectibles costing coins.
53404
- --
53405
- -- This function is unsafe because it will not correctly handle quest items being rotated by Tainted
53406
- -- Isaac's rotation mechanic. To handle that, use the `spawnCollectible` helper function instead
53407
- -- (which is provided by `ISCFeature.SPAWN_COLLECTIBLE`).
53320
+ -- collectibles costing coins and prevents quest items from being rotated by Tainted Isaac's
53321
+ -- rotation mechanic.
53408
53322
  --
53409
53323
  -- If you want to spawn an unseeded collectible, you must explicitly pass `undefined` to the
53410
53324
  -- `seedOrRNG` parameter.
@@ -53419,7 +53333,7 @@ local isRNG = ____rng.isRNG
53419
53333
  -- @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
53420
53334
  -- Tainted Keeper. Default is false.
53421
53335
  -- @param spawner Optional.
53422
- function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
53336
+ function ____exports.spawnCollectible(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
53423
53337
  if options == nil then
53424
53338
  options = false
53425
53339
  end
@@ -53439,6 +53353,9 @@ function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGri
53439
53353
  VectorZero,
53440
53354
  spawner
53441
53355
  )
53356
+ if isQuestCollectible(nil, collectible) then
53357
+ preventCollectibleRotation(nil, collectible)
53358
+ end
53442
53359
  if options then
53443
53360
  collectible.OptionsPickupIndex = 1
53444
53361
  end
@@ -53448,6 +53365,46 @@ function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGri
53448
53365
  end
53449
53366
  return collectible
53450
53367
  end
53368
+ --- Helper function to spawn a collectible from a specific item pool.
53369
+ --
53370
+ -- Use this instead of the `Game.Spawn` method because it handles the cases of Tainted Keeper
53371
+ -- collectibles costing coins and prevents quest items from being rotated by Tainted Isaac's
53372
+ -- rotation mechanic.
53373
+ --
53374
+ -- If you want to spawn an unseeded collectible, you must explicitly pass `undefined` to the
53375
+ -- `seedOrRNG` parameter.
53376
+ --
53377
+ -- In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
53378
+ --
53379
+ -- @param itemPoolType The item pool to draw the collectible type from.
53380
+ -- @param positionOrGridIndex The position or grid index to spawn the collectible at.
53381
+ -- @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
53382
+ -- `RNG.Next` method will be called. If `undefined` is provided, it will default to
53383
+ -- a random seed.
53384
+ -- @param options Optional. Set to true to make the collectible a "There's Options" style
53385
+ -- collectible. Default is false.
53386
+ -- @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
53387
+ -- Tainted Keeper. Default is false.
53388
+ -- @param spawner Optional.
53389
+ function ____exports.spawnCollectibleFromPool(self, itemPoolType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
53390
+ if options == nil then
53391
+ options = false
53392
+ end
53393
+ if forceFreeItem == nil then
53394
+ forceFreeItem = false
53395
+ end
53396
+ local itemPool = game:GetItemPool()
53397
+ local collectibleType = itemPool:GetCollectible(itemPoolType)
53398
+ return ____exports.spawnCollectible(
53399
+ nil,
53400
+ collectibleType,
53401
+ positionOrGridIndex,
53402
+ seedOrRNG,
53403
+ options,
53404
+ forceFreeItem,
53405
+ spawner
53406
+ )
53407
+ end
53451
53408
  --- Helper function to spawn an empty collectible. Doing this is tricky since spawning a collectible
53452
53409
  -- with `CollectibleType.NULL` will result in spawning a collectible with a random type from the
53453
53410
  -- current room's item pool.
@@ -53465,7 +53422,7 @@ end
53465
53422
  -- `RNG.Next` method will be called. If `undefined` is provided, it will default to
53466
53423
  -- a random seed.
53467
53424
  function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
53468
- local collectible = ____exports.spawnCollectibleUnsafe(
53425
+ local collectible = ____exports.spawnCollectible(
53469
53426
  nil,
53470
53427
  CollectibleType.BROKEN_SHOVEL_1,
53471
53428
  positionOrGridIndex,
@@ -53478,20 +53435,17 @@ function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
53478
53435
  end
53479
53436
  return ____exports
53480
53437
  end,
53481
- ["classes.features.other.PreventCollectibleRotation"] = function(...)
53438
+ ["classes.features.other.PreventGridEntityRespawn"] = function(...)
53482
53439
  local ____lualib = require("lualib_bundle")
53483
53440
  local __TS__New = ____lualib.__TS__New
53484
- local Map = ____lualib.Map
53485
53441
  local __TS__Class = ____lualib.__TS__Class
53486
53442
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
53487
53443
  local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
53488
53444
  local ____exports = {}
53489
53445
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
53490
- local CardType = ____isaac_2Dtypescript_2Ddefinitions.CardType
53491
53446
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
53492
- local DiceFloorSubType = ____isaac_2Dtypescript_2Ddefinitions.DiceFloorSubType
53447
+ local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
53493
53448
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
53494
- local PickupVariant = ____isaac_2Dtypescript_2Ddefinitions.PickupVariant
53495
53449
  local ____cachedClasses = require("core.cachedClasses")
53496
53450
  local game = ____cachedClasses.game
53497
53451
  local ____decorators = require("decorators")
@@ -53500,166 +53454,112 @@ local ____ISCFeature = require("enums.ISCFeature")
53500
53454
  local ISCFeature = ____ISCFeature.ISCFeature
53501
53455
  local ____ModCallbackCustom = require("enums.ModCallbackCustom")
53502
53456
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
53503
- local ____collectibles = require("functions.collectibles")
53504
- local setCollectibleSubType = ____collectibles.setCollectibleSubType
53505
- local ____entities = require("functions.entities")
53506
- local getEntityID = ____entities.getEntityID
53507
- local ____frames = require("functions.frames")
53508
- local onGameFrame = ____frames.onGameFrame
53509
- local ____pickupVariants = require("functions.pickupVariants")
53510
- local isCollectible = ____pickupVariants.isCollectible
53511
- local ____pickupsSpecific = require("functions.pickupsSpecific")
53512
- local getCollectibles = ____pickupsSpecific.getCollectibles
53513
- local ____types = require("functions.types")
53514
- local asCollectibleType = ____types.asCollectibleType
53515
- local ____ReadonlySet = require("types.ReadonlySet")
53516
- local ReadonlySet = ____ReadonlySet.ReadonlySet
53457
+ local ____array = require("functions.array")
53458
+ local emptyArray = ____array.emptyArray
53459
+ local ____gridEntities = require("functions.gridEntities")
53460
+ local getAllGridIndexes = ____gridEntities.getAllGridIndexes
53461
+ local getGridEntities = ____gridEntities.getGridEntities
53462
+ local removeGridEntity = ____gridEntities.removeGridEntity
53463
+ local setGridEntityInvisible = ____gridEntities.setGridEntityInvisible
53464
+ local spawnGridEntity = ____gridEntities.spawnGridEntity
53465
+ local ____players = require("functions.players")
53466
+ local getPlayerFromPtr = ____players.getPlayerFromPtr
53467
+ local ____roomData = require("functions.roomData")
53468
+ local getRoomListIndex = ____roomData.getRoomListIndex
53469
+ local ____DefaultMap = require("classes.DefaultMap")
53470
+ local DefaultMap = ____DefaultMap.DefaultMap
53517
53471
  local ____Feature = require("classes.private.Feature")
53518
53472
  local Feature = ____Feature.Feature
53519
- local ROLL_COLLECTIBLE_TYPES = __TS__New(ReadonlySet, {CollectibleType.D6, CollectibleType.ETERNAL_D6, CollectibleType.SPINDOWN_DICE})
53520
- local ROLL_FLOOR_DICE_FLOOR_SUB_TYPES = __TS__New(ReadonlySet, {DiceFloorSubType.FOUR_PIP, DiceFloorSubType.SIX_PIP})
53521
- local v = {run = {
53522
- trackedCollectibles = __TS__New(Map),
53523
- rollGameFrame = nil
53524
- }}
53525
- ____exports.PreventCollectibleRotation = __TS__Class()
53526
- local PreventCollectibleRotation = ____exports.PreventCollectibleRotation
53527
- PreventCollectibleRotation.name = "PreventCollectibleRotation"
53528
- __TS__ClassExtends(PreventCollectibleRotation, Feature)
53529
- function PreventCollectibleRotation.prototype.____constructor(self, pickupIndexCreation, runInNFrames)
53473
+ local v = {
53474
+ level = {roomListIndexToDecorationGridIndexes = __TS__New(
53475
+ DefaultMap,
53476
+ function() return {} end
53477
+ )},
53478
+ room = {manuallyUsingShovel = false}
53479
+ }
53480
+ ____exports.PreventGridEntityRespawn = __TS__Class()
53481
+ local PreventGridEntityRespawn = ____exports.PreventGridEntityRespawn
53482
+ PreventGridEntityRespawn.name = "PreventGridEntityRespawn"
53483
+ __TS__ClassExtends(PreventGridEntityRespawn, Feature)
53484
+ function PreventGridEntityRespawn.prototype.____constructor(self, runInNFrames)
53530
53485
  Feature.prototype.____constructor(self)
53531
53486
  self.v = v
53532
- self.preUseItem = function(____, collectibleType)
53533
- if ROLL_COLLECTIBLE_TYPES:has(collectibleType) then
53534
- v.run.rollGameFrame = game:GetFrameCount()
53535
- end
53536
- return nil
53537
- end
53538
- self.postUseCardSoulOfIsaac = function()
53539
- local collectibles = getCollectibles(nil)
53540
- for ____, collectible in ipairs(collectibles) do
53541
- local pickupIndex = self.pickupIndexCreation:getPickupIndex(collectible)
53542
- v.run.trackedCollectibles:delete(pickupIndex)
53543
- end
53544
- end
53545
- self.postDiceRoomActivated = function(____, _player, diceFloorSubType)
53546
- if ROLL_FLOOR_DICE_FLOOR_SUB_TYPES:has(diceFloorSubType) then
53547
- v.run.trackedCollectibles:clear()
53548
- end
53549
- end
53550
- self.postPickupChanged = function(____, pickup, oldVariant, _oldSubType, newVariant, newSubType)
53551
- if oldVariant ~= PickupVariant.COLLECTIBLE or newVariant ~= PickupVariant.COLLECTIBLE then
53552
- return
53553
- end
53554
- if asCollectibleType(nil, newSubType) == CollectibleType.NULL then
53555
- return
53556
- end
53557
- local pickupIndex = self.pickupIndexCreation:getPickupIndex(pickup)
53558
- local trackedCollectibleType = v.run.trackedCollectibles:get(pickupIndex)
53559
- if trackedCollectibleType == nil then
53560
- return
53487
+ self.preUseItemWeNeedToGoDeeper = function(____, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
53488
+ if v.room.manuallyUsingShovel then
53489
+ return nil
53561
53490
  end
53562
- if v.run.rollGameFrame ~= nil and (onGameFrame(nil, v.run.rollGameFrame) or onGameFrame(nil, v.run.rollGameFrame + 1)) then
53563
- v.run.trackedCollectibles:delete(pickupIndex)
53491
+ local roomListIndex = getRoomListIndex(nil)
53492
+ if not v.level.roomListIndexToDecorationGridIndexes:has(roomListIndex) then
53564
53493
  return
53565
53494
  end
53566
- if trackedCollectibleType ~= asCollectibleType(nil, newSubType) then
53567
- setCollectibleSubType(nil, pickup, trackedCollectibleType)
53495
+ local decorations = getGridEntities(nil, GridEntityType.DECORATION)
53496
+ for ____, decoration in ipairs(decorations) do
53497
+ removeGridEntity(nil, decoration, false)
53568
53498
  end
53499
+ local entityPtr = EntityPtr(player)
53500
+ self.runInNFrames:runNextGameFrame(function()
53501
+ local futurePlayer = getPlayerFromPtr(nil, entityPtr)
53502
+ if futurePlayer == nil then
53503
+ return
53504
+ end
53505
+ local futureRoomListIndex = getRoomListIndex(nil)
53506
+ if futureRoomListIndex ~= roomListIndex then
53507
+ return
53508
+ end
53509
+ v.room.manuallyUsingShovel = true
53510
+ futurePlayer:UseActiveItem(CollectibleType.WE_NEED_TO_GO_DEEPER)
53511
+ v.room.manuallyUsingShovel = false
53512
+ local decorationGridIndexes = v.level.roomListIndexToDecorationGridIndexes:getAndSetDefault(roomListIndex)
53513
+ emptyArray(nil, decorationGridIndexes)
53514
+ self:preventGridEntityRespawn()
53515
+ end)
53516
+ return true
53569
53517
  end
53570
- self.featuresUsed = {ISCFeature.PICKUP_INDEX_CREATION, ISCFeature.RUN_IN_N_FRAMES}
53571
- self.callbacksUsed = {{ModCallback.POST_USE_CARD, self.postUseCardSoulOfIsaac, {CardType.SOUL_OF_ISAAC}}, {ModCallback.PRE_USE_ITEM, self.preUseItem}}
53572
- self.customCallbacksUsed = {{ModCallbackCustom.POST_DICE_ROOM_ACTIVATED, self.postDiceRoomActivated}, {ModCallbackCustom.POST_PICKUP_CHANGED, self.postPickupChanged}}
53573
- self.pickupIndexCreation = pickupIndexCreation
53518
+ self.postNewRoomReordered = function()
53519
+ self:setDecorationsInvisible()
53520
+ end
53521
+ self.featuresUsed = {ISCFeature.RUN_IN_N_FRAMES}
53522
+ self.callbacksUsed = {{ModCallback.PRE_USE_ITEM, self.preUseItemWeNeedToGoDeeper, {CollectibleType.WE_NEED_TO_GO_DEEPER}}}
53523
+ self.customCallbacksUsed = {{ModCallbackCustom.POST_NEW_ROOM_REORDERED, self.postNewRoomReordered}}
53574
53524
  self.runInNFrames = runInNFrames
53575
53525
  end
53576
- function PreventCollectibleRotation.prototype.preventCollectibleRotation(self, collectible, collectibleType)
53577
- if not isCollectible(nil, collectible) then
53578
- local entityID = getEntityID(nil, collectible)
53579
- error("The \"preventCollectibleRotation\" function was given a non-collectible: " .. entityID)
53580
- end
53581
- local pickupIndex = self.pickupIndexCreation:getPickupIndex(collectible)
53582
- v.run.trackedCollectibles:set(pickupIndex, collectibleType)
53583
- if collectible.SubType ~= collectibleType then
53584
- setCollectibleSubType(nil, collectible, collectibleType)
53526
+ function PreventGridEntityRespawn.prototype.setDecorationsInvisible(self)
53527
+ local room = game:GetRoom()
53528
+ local roomListIndex = getRoomListIndex(nil)
53529
+ local decorationGridIndexes = v.level.roomListIndexToDecorationGridIndexes:get(roomListIndex)
53530
+ if decorationGridIndexes == nil then
53531
+ return
53585
53532
  end
53586
- self.runInNFrames:runNextGameFrame(function()
53587
- if collectible:Exists() and collectible.SubType ~= collectibleType then
53588
- setCollectibleSubType(nil, collectible, collectibleType)
53533
+ for ____, gridIndex in ipairs(decorationGridIndexes) do
53534
+ local gridEntity = room:GetGridEntity(gridIndex)
53535
+ if gridEntity ~= nil then
53536
+ local gridEntityType = gridEntity:GetType()
53537
+ if gridEntityType == GridEntityType.DECORATION then
53538
+ setGridEntityInvisible(nil, gridEntity)
53539
+ end
53589
53540
  end
53590
- end)
53591
- end
53592
- __TS__DecorateLegacy({Exported}, PreventCollectibleRotation.prototype, "preventCollectibleRotation", true)
53593
- return ____exports
53594
- end,
53595
- ["classes.features.other.SpawnCollectible"] = function(...)
53596
- local ____lualib = require("lualib_bundle")
53597
- local __TS__Class = ____lualib.__TS__Class
53598
- local __TS__ClassExtends = ____lualib.__TS__ClassExtends
53599
- local __TS__DecorateLegacy = ____lualib.__TS__DecorateLegacy
53600
- local ____exports = {}
53601
- local ____cachedClasses = require("core.cachedClasses")
53602
- local game = ____cachedClasses.game
53603
- local ____decorators = require("decorators")
53604
- local Exported = ____decorators.Exported
53605
- local ____ISCFeature = require("enums.ISCFeature")
53606
- local ISCFeature = ____ISCFeature.ISCFeature
53607
- local ____collectibleTag = require("functions.collectibleTag")
53608
- local isQuestCollectible = ____collectibleTag.isQuestCollectible
53609
- local ____spawnCollectible = require("functions.spawnCollectible")
53610
- local spawnCollectibleUnsafe = ____spawnCollectible.spawnCollectibleUnsafe
53611
- local ____Feature = require("classes.private.Feature")
53612
- local Feature = ____Feature.Feature
53613
- ____exports.SpawnCollectible = __TS__Class()
53614
- local SpawnCollectible = ____exports.SpawnCollectible
53615
- SpawnCollectible.name = "SpawnCollectible"
53616
- __TS__ClassExtends(SpawnCollectible, Feature)
53617
- function SpawnCollectible.prototype.____constructor(self, preventCollectibleRotation)
53618
- Feature.prototype.____constructor(self)
53619
- self.featuresUsed = {ISCFeature.PREVENT_COLLECTIBLE_ROTATION}
53620
- self.preventCollectibleRotation = preventCollectibleRotation
53621
- end
53622
- function SpawnCollectible.prototype.spawnCollectible(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
53623
- if options == nil then
53624
- options = false
53625
- end
53626
- if forceFreeItem == nil then
53627
- forceFreeItem = false
53628
- end
53629
- local collectible = spawnCollectibleUnsafe(
53630
- nil,
53631
- collectibleType,
53632
- positionOrGridIndex,
53633
- seedOrRNG,
53634
- options,
53635
- forceFreeItem,
53636
- spawner
53637
- )
53638
- if isQuestCollectible(nil, collectibleType) then
53639
- self.preventCollectibleRotation:preventCollectibleRotation(collectible, collectibleType)
53640
53541
  end
53641
- return collectible
53642
53542
  end
53643
- __TS__DecorateLegacy({Exported}, SpawnCollectible.prototype, "spawnCollectible", true)
53644
- function SpawnCollectible.prototype.spawnCollectibleFromPool(self, itemPoolType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
53645
- if options == nil then
53646
- options = false
53647
- end
53648
- if forceFreeItem == nil then
53649
- forceFreeItem = false
53543
+ function PreventGridEntityRespawn.prototype.preventGridEntityRespawn(self)
53544
+ local room = game:GetRoom()
53545
+ local roomListIndex = getRoomListIndex(nil)
53546
+ local decorationGridIndexes = v.level.roomListIndexToDecorationGridIndexes:getAndSetDefault(roomListIndex)
53547
+ for ____, gridIndex in ipairs(getAllGridIndexes(nil)) do
53548
+ do
53549
+ local existingGridEntity = room:GetGridEntity(gridIndex)
53550
+ if existingGridEntity ~= nil then
53551
+ goto __continue20
53552
+ end
53553
+ local decoration = spawnGridEntity(nil, GridEntityType.DECORATION, gridIndex)
53554
+ if decoration ~= nil then
53555
+ setGridEntityInvisible(nil, decoration)
53556
+ end
53557
+ decorationGridIndexes[#decorationGridIndexes + 1] = gridIndex
53558
+ end
53559
+ ::__continue20::
53650
53560
  end
53651
- local itemPool = game:GetItemPool()
53652
- local collectibleType = itemPool:GetCollectible(itemPoolType)
53653
- return self:spawnCollectible(
53654
- collectibleType,
53655
- positionOrGridIndex,
53656
- seedOrRNG,
53657
- options,
53658
- forceFreeItem,
53659
- spawner
53660
- )
53661
53561
  end
53662
- __TS__DecorateLegacy({Exported}, SpawnCollectible.prototype, "spawnCollectibleFromPool", true)
53562
+ __TS__DecorateLegacy({Exported}, PreventGridEntityRespawn.prototype, "preventGridEntityRespawn", true)
53663
53563
  return ____exports
53664
53564
  end,
53665
53565
  ["classes.features.other.DeployJSONRoom"] = function(...)
@@ -53709,6 +53609,8 @@ local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPositi
53709
53609
  local ____rooms = require("functions.rooms")
53710
53610
  local setRoomCleared = ____rooms.setRoomCleared
53711
53611
  local setRoomUncleared = ____rooms.setRoomUncleared
53612
+ local ____spawnCollectible = require("functions.spawnCollectible")
53613
+ local spawnCollectible = ____spawnCollectible.spawnCollectible
53712
53614
  local ____types = require("functions.types")
53713
53615
  local asCollectibleType = ____types.asCollectibleType
53714
53616
  local asNumber = ____types.asNumber
@@ -53853,11 +53755,10 @@ ____exports.DeployJSONRoom = __TS__Class()
53853
53755
  local DeployJSONRoom = ____exports.DeployJSONRoom
53854
53756
  DeployJSONRoom.name = "DeployJSONRoom"
53855
53757
  __TS__ClassExtends(DeployJSONRoom, Feature)
53856
- function DeployJSONRoom.prototype.____constructor(self, preventGridEntityRespawn, spawnCollectible)
53758
+ function DeployJSONRoom.prototype.____constructor(self, preventGridEntityRespawn)
53857
53759
  Feature.prototype.____constructor(self)
53858
- self.featuresUsed = {ISCFeature.PREVENT_GRID_ENTITY_RESPAWN, ISCFeature.SPAWN_COLLECTIBLE}
53760
+ self.featuresUsed = {ISCFeature.PREVENT_GRID_ENTITY_RESPAWN}
53859
53761
  self.preventGridEntityRespawn = preventGridEntityRespawn
53860
- self.spawnCollectible = spawnCollectible
53861
53762
  end
53862
53763
  function DeployJSONRoom.prototype.spawnAllEntities(self, jsonRoom, rng, verbose)
53863
53764
  if verbose == nil then
@@ -53939,7 +53840,8 @@ function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType,
53939
53840
  local entity
53940
53841
  if entityType == EntityType.PICKUP and variant == asNumber(nil, PickupVariant.COLLECTIBLE) then
53941
53842
  local options = roomType == RoomType.ANGEL
53942
- entity = self.spawnCollectible:spawnCollectible(
53843
+ entity = spawnCollectible(
53844
+ nil,
53943
53845
  asCollectibleType(nil, subType),
53944
53846
  position,
53945
53847
  seed,
@@ -59202,7 +59104,7 @@ local onSetSeed = ____run.onSetSeed
59202
59104
  local restart = ____run.restart
59203
59105
  local setUnseeded = ____run.setUnseeded
59204
59106
  local ____spawnCollectible = require("functions.spawnCollectible")
59205
- local spawnCollectibleUnsafe = ____spawnCollectible.spawnCollectibleUnsafe
59107
+ local spawnCollectibleFunc = ____spawnCollectible.spawnCollectible
59206
59108
  local ____stage = require("functions.stage")
59207
59109
  local onStage = ____stage.onStage
59208
59110
  local setStage = ____stage.setStage
@@ -59361,7 +59263,7 @@ function ____exports.spawnCollectible(self, params)
59361
59263
  end
59362
59264
  local roomClass = game:GetRoom()
59363
59265
  local centerPos = roomClass:GetCenterPos()
59364
- spawnCollectibleUnsafe(nil, collectibleType, centerPos, nil)
59266
+ spawnCollectibleFunc(nil, collectibleType, centerPos, nil)
59365
59267
  end
59366
59268
  --- The same thing as the `spawnTrinket` command but spawns a golden version of the specified
59367
59269
  -- trinket.
@@ -60412,7 +60314,7 @@ function ____exports.spawnCollectibleAt(self, params)
60412
60314
  return
60413
60315
  end
60414
60316
  local collectibleType = asCollectibleType(nil, collectibleTypeNumber)
60415
- spawnCollectibleUnsafe(nil, collectibleType, gridIndex, nil)
60317
+ spawnCollectibleFunc(nil, collectibleType, gridIndex, nil)
60416
60318
  end
60417
60319
  --- Alias for the `spawnGoldenTrinket` command.
60418
60320
  function ____exports.spawnGoldTrinket(self, params)
@@ -61605,7 +61507,7 @@ local ____rng = require("functions.rng")
61605
61507
  local isRNG = ____rng.isRNG
61606
61508
  local newRNG = ____rng.newRNG
61607
61509
  local ____spawnCollectible = require("functions.spawnCollectible")
61608
- local spawnCollectibleUnsafe = ____spawnCollectible.spawnCollectibleUnsafe
61510
+ local spawnCollectible = ____spawnCollectible.spawnCollectible
61609
61511
  local ____utils = require("functions.utils")
61610
61512
  local ____repeat = ____utils["repeat"]
61611
61513
  local ____vector = require("functions.vector")
@@ -61713,7 +61615,7 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardUrn(self, position, rng
61713
61615
  if chance < totalChance then
61714
61616
  local stillInPools = self.itemPoolDetection:isCollectibleInItemPool(CollectibleType.QUARTER, ItemPoolType.DEVIL)
61715
61617
  if stillInPools then
61716
- spawnCollectibleUnsafe(nil, CollectibleType.QUARTER, position, rng)
61618
+ spawnCollectible(nil, CollectibleType.QUARTER, position, rng)
61717
61619
  return true
61718
61620
  end
61719
61621
  return false
@@ -61763,7 +61665,7 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardMushroom(self, position
61763
61665
  if wavyCapChance < 0.0272 then
61764
61666
  local stillInPools = self.itemPoolDetection:isCollectibleInItemPool(CollectibleType.WAVY_CAP, ItemPoolType.SECRET)
61765
61667
  if stillInPools then
61766
- spawnCollectibleUnsafe(nil, CollectibleType.WAVY_CAP, position, rng)
61668
+ spawnCollectible(nil, CollectibleType.WAVY_CAP, position, rng)
61767
61669
  return true
61768
61670
  end
61769
61671
  end
@@ -61773,15 +61675,15 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardMushroom(self, position
61773
61675
  if magicMushroomStillInPools and miniMushStillInPools then
61774
61676
  local collectibleChance = getRandom(nil, rng)
61775
61677
  local collectibleType = collectibleChance < 0.5 and CollectibleType.MAGIC_MUSHROOM or CollectibleType.MINI_MUSH
61776
- spawnCollectibleUnsafe(nil, collectibleType, position, rng)
61678
+ spawnCollectible(nil, collectibleType, position, rng)
61777
61679
  return true
61778
61680
  end
61779
61681
  if magicMushroomStillInPools then
61780
- spawnCollectibleUnsafe(nil, CollectibleType.MINI_MUSH, position, rng)
61682
+ spawnCollectible(nil, CollectibleType.MINI_MUSH, position, rng)
61781
61683
  return true
61782
61684
  end
61783
61685
  if miniMushStillInPools then
61784
- spawnCollectibleUnsafe(nil, CollectibleType.MAGIC_MUSHROOM, position, rng)
61686
+ spawnCollectible(nil, CollectibleType.MAGIC_MUSHROOM, position, rng)
61785
61687
  return true
61786
61688
  end
61787
61689
  return false
@@ -61815,15 +61717,15 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardSkull(self, position, r
61815
61717
  if ghostBabyStillInPools and dryBabyStillInPools then
61816
61718
  local collectibleChance = getRandom(nil, rng)
61817
61719
  local collectibleType = collectibleChance < 0.5 and CollectibleType.GHOST_BABY or CollectibleType.DRY_BABY
61818
- spawnCollectibleUnsafe(nil, collectibleType, position, rng)
61720
+ spawnCollectible(nil, collectibleType, position, rng)
61819
61721
  return true
61820
61722
  end
61821
61723
  if ghostBabyStillInPools then
61822
- spawnCollectibleUnsafe(nil, CollectibleType.DRY_BABY, position, rng)
61724
+ spawnCollectible(nil, CollectibleType.DRY_BABY, position, rng)
61823
61725
  return true
61824
61726
  end
61825
61727
  if dryBabyStillInPools then
61826
- spawnCollectibleUnsafe(nil, CollectibleType.GHOST_BABY, position, rng)
61728
+ spawnCollectible(nil, CollectibleType.GHOST_BABY, position, rng)
61827
61729
  return true
61828
61730
  end
61829
61731
  return false
@@ -61863,15 +61765,15 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardPolyp(self, position, r
61863
61765
  if placentaStillInPools and bloodClotStillInPools then
61864
61766
  local collectibleChance = getRandom(nil, rng)
61865
61767
  local collectibleType = collectibleChance < 0.5 and CollectibleType.PLACENTA or CollectibleType.BLOOD_CLOT
61866
- spawnCollectibleUnsafe(nil, collectibleType, position, rng)
61768
+ spawnCollectible(nil, collectibleType, position, rng)
61867
61769
  return true
61868
61770
  end
61869
61771
  if placentaStillInPools then
61870
- spawnCollectibleUnsafe(nil, CollectibleType.PLACENTA, position, rng)
61772
+ spawnCollectible(nil, CollectibleType.PLACENTA, position, rng)
61871
61773
  return true
61872
61774
  end
61873
61775
  if bloodClotStillInPools then
61874
- spawnCollectibleUnsafe(nil, CollectibleType.BLOOD_CLOT, position, rng)
61776
+ spawnCollectible(nil, CollectibleType.BLOOD_CLOT, position, rng)
61875
61777
  return true
61876
61778
  end
61877
61779
  return false
@@ -61931,7 +61833,7 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardBucketDownpour(self, po
61931
61833
  if chance < totalChance then
61932
61834
  local stillInPools = self.itemPoolDetection:isCollectibleInItemPool(CollectibleType.LEECH, ItemPoolType.TREASURE)
61933
61835
  if stillInPools then
61934
- spawnCollectibleUnsafe(nil, CollectibleType.LEECH, position, rng)
61836
+ spawnCollectible(nil, CollectibleType.LEECH, position, rng)
61935
61837
  return true
61936
61838
  end
61937
61839
  return false
@@ -61998,7 +61900,7 @@ function SpawnRockAltRewards.prototype.spawnRockAltRewardBucketDross(self, posit
61998
61900
  if chance < totalChance then
61999
61901
  local stillInPools = self.itemPoolDetection:isCollectibleInItemPool(CollectibleType.POOP, ItemPoolType.TREASURE)
62000
61902
  if stillInPools then
62001
- spawnCollectibleUnsafe(nil, CollectibleType.POOP, position, rng)
61903
+ spawnCollectible(nil, CollectibleType.POOP, position, rng)
62002
61904
  return true
62003
61905
  end
62004
61906
  return false
@@ -62285,8 +62187,6 @@ local ____PressInput = require("classes.features.other.PressInput")
62285
62187
  local PressInput = ____PressInput.PressInput
62286
62188
  local ____PreventChildEntities = require("classes.features.other.PreventChildEntities")
62287
62189
  local PreventChildEntities = ____PreventChildEntities.PreventChildEntities
62288
- local ____PreventCollectibleRotation = require("classes.features.other.PreventCollectibleRotation")
62289
- local PreventCollectibleRotation = ____PreventCollectibleRotation.PreventCollectibleRotation
62290
62190
  local ____PreventGridEntityRespawn = require("classes.features.other.PreventGridEntityRespawn")
62291
62191
  local PreventGridEntityRespawn = ____PreventGridEntityRespawn.PreventGridEntityRespawn
62292
62192
  local ____RoomClearFrame = require("classes.features.other.RoomClearFrame")
@@ -62301,8 +62201,6 @@ local ____RunNextRun = require("classes.features.other.RunNextRun")
62301
62201
  local RunNextRun = ____RunNextRun.RunNextRun
62302
62202
  local ____SaveDataManager = require("classes.features.other.SaveDataManager")
62303
62203
  local SaveDataManager = ____SaveDataManager.SaveDataManager
62304
- local ____SpawnCollectible = require("classes.features.other.SpawnCollectible")
62305
- local SpawnCollectible = ____SpawnCollectible.SpawnCollectible
62306
62204
  local ____SpawnRockAltRewards = require("classes.features.other.SpawnRockAltRewards")
62307
62205
  local SpawnRockAltRewards = ____SpawnRockAltRewards.SpawnRockAltRewards
62308
62206
  local ____StageHistory = require("classes.features.other.StageHistory")
@@ -62340,13 +62238,11 @@ function ____exports.getFeatures(self, mod, callbacks)
62340
62238
  local stageHistory = __TS__New(StageHistory)
62341
62239
  local runInNFrames = __TS__New(RunInNFrames, roomHistory)
62342
62240
  local pickupIndexCreation = __TS__New(PickupIndexCreation, roomHistory, saveDataManager)
62343
- local preventCollectibleRotation = __TS__New(PreventCollectibleRotation, pickupIndexCreation, runInNFrames)
62344
62241
  local customGridEntities = __TS__New(CustomGridEntities, runInNFrames)
62345
62242
  local moddedElementSets = __TS__New(ModdedElementSets, moddedElementDetection)
62346
62243
  local itemPoolDetection = __TS__New(ItemPoolDetection, moddedElementSets)
62347
62244
  local pause = __TS__New(Pause, disableInputs)
62348
62245
  local preventGridEntityRespawn = __TS__New(PreventGridEntityRespawn, runInNFrames)
62349
- local spawnCollectible = __TS__New(SpawnCollectible, preventCollectibleRotation)
62350
62246
  local customTrapdoors = __TS__New(
62351
62247
  CustomTrapdoors,
62352
62248
  customGridEntities,
@@ -62409,7 +62305,7 @@ function ____exports.getFeatures(self, mod, callbacks)
62409
62305
  ),
62410
62306
  [ISCFeature.CUSTOM_TRAPDOORS] = customTrapdoors,
62411
62307
  [ISCFeature.DEBUG_DISPLAY] = __TS__New(DebugDisplay, mod),
62412
- [ISCFeature.DEPLOY_JSON_ROOM] = __TS__New(DeployJSONRoom, preventGridEntityRespawn, spawnCollectible),
62308
+ [ISCFeature.DEPLOY_JSON_ROOM] = __TS__New(DeployJSONRoom, preventGridEntityRespawn),
62413
62309
  [ISCFeature.DISABLE_ALL_SOUND] = disableAllSound,
62414
62310
  [ISCFeature.DISABLE_INPUTS] = disableInputs,
62415
62311
  [ISCFeature.EDEN_STARTING_STATS_HEALTH] = __TS__New(EdenStartingStatsHealth),
@@ -62429,7 +62325,6 @@ function ____exports.getFeatures(self, mod, callbacks)
62429
62325
  [ISCFeature.PONY_DETECTION] = ponyDetection,
62430
62326
  [ISCFeature.PRESS_INPUT] = pressInput,
62431
62327
  [ISCFeature.PREVENT_CHILD_ENTITIES] = __TS__New(PreventChildEntities),
62432
- [ISCFeature.PREVENT_COLLECTIBLE_ROTATION] = preventCollectibleRotation,
62433
62328
  [ISCFeature.PREVENT_GRID_ENTITY_RESPAWN] = preventGridEntityRespawn,
62434
62329
  [ISCFeature.ROOM_CLEAR_FRAME] = roomClearFrame,
62435
62330
  [ISCFeature.ROOM_HISTORY] = roomHistory,
@@ -62438,7 +62333,6 @@ function ____exports.getFeatures(self, mod, callbacks)
62438
62333
  [ISCFeature.RUN_NEXT_RUN] = __TS__New(RunNextRun),
62439
62334
  [ISCFeature.SAVE_DATA_MANAGER] = saveDataManager,
62440
62335
  [ISCFeature.SPAWN_ALT_ROCK_REWARDS] = __TS__New(SpawnRockAltRewards, itemPoolDetection),
62441
- [ISCFeature.SPAWN_COLLECTIBLE] = spawnCollectible,
62442
62336
  [ISCFeature.STAGE_HISTORY] = stageHistory,
62443
62337
  [ISCFeature.START_AMBUSH] = __TS__New(StartAmbush, runInNFrames),
62444
62338
  [ISCFeature.TAINTED_LAZARUS_PLAYERS] = __TS__New(TaintedLazarusPlayers),