isaacscript-common 80.2.0 → 80.2.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.
Files changed (62) hide show
  1. package/dist/classes/callbacks/PostItemDischarge.d.ts.map +1 -1
  2. package/dist/classes/callbacks/PostItemDischarge.lua +1 -3
  3. package/dist/classes/features/other/CustomPickups.d.ts.map +1 -1
  4. package/dist/classes/features/other/CustomPickups.lua +1 -3
  5. package/dist/classes/features/other/CustomStages.d.ts.map +1 -1
  6. package/dist/classes/features/other/CustomStages.lua +1 -3
  7. package/dist/classes/features/other/DeployJSONRoom.d.ts.map +1 -1
  8. package/dist/classes/features/other/DeployJSONRoom.lua +4 -4
  9. package/dist/classes/features/other/ModdedElementDetection.d.ts +31 -20
  10. package/dist/classes/features/other/ModdedElementDetection.d.ts.map +1 -1
  11. package/dist/classes/features/other/ModdedElementDetection.lua +23 -49
  12. package/dist/classes/features/other/StageHistory.d.ts.map +1 -1
  13. package/dist/classes/features/other/StageHistory.lua +1 -3
  14. package/dist/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
  15. package/dist/classes/features/other/extraConsoleCommands/commands.lua +1 -6
  16. package/dist/core/constantsFirstLast.d.ts +29 -6
  17. package/dist/core/constantsFirstLast.d.ts.map +1 -1
  18. package/dist/core/constantsFirstLast.lua +18 -3
  19. package/dist/functions/bosses.d.ts.map +1 -1
  20. package/dist/functions/bosses.lua +1 -3
  21. package/dist/functions/doors.d.ts.map +1 -1
  22. package/dist/functions/doors.lua +5 -7
  23. package/dist/functions/gridEntities.lua +1 -2
  24. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
  25. package/dist/functions/gridEntitiesSpecific.lua +5 -7
  26. package/dist/functions/nextStage.d.ts.map +1 -1
  27. package/dist/functions/nextStage.lua +4 -6
  28. package/dist/functions/npcs.d.ts.map +1 -1
  29. package/dist/functions/npcs.lua +3 -5
  30. package/dist/functions/pills.d.ts.map +1 -1
  31. package/dist/functions/pills.lua +8 -16
  32. package/dist/functions/pocketItems.d.ts.map +1 -1
  33. package/dist/functions/pocketItems.lua +1 -3
  34. package/dist/functions/rooms.d.ts.map +1 -1
  35. package/dist/functions/rooms.lua +13 -15
  36. package/dist/functions/stage.lua +2 -6
  37. package/dist/functions/trinkets.lua +2 -2
  38. package/dist/functions/types.d.ts +29 -0
  39. package/dist/functions/types.d.ts.map +1 -1
  40. package/dist/index.rollup.d.ts +56 -26
  41. package/dist/isaacscript-common.lua +96 -147
  42. package/package.json +2 -2
  43. package/src/classes/callbacks/PostItemDischarge.ts +1 -2
  44. package/src/classes/features/other/CustomPickups.ts +1 -2
  45. package/src/classes/features/other/CustomStages.ts +1 -4
  46. package/src/classes/features/other/DeployJSONRoom.ts +5 -9
  47. package/src/classes/features/other/ModdedElementDetection.ts +61 -77
  48. package/src/classes/features/other/StageHistory.ts +1 -2
  49. package/src/classes/features/other/extraConsoleCommands/commands.ts +2 -6
  50. package/src/core/constantsFirstLast.ts +29 -6
  51. package/src/functions/bosses.ts +1 -2
  52. package/src/functions/doors.ts +5 -6
  53. package/src/functions/gridEntities.ts +2 -2
  54. package/src/functions/gridEntitiesSpecific.ts +5 -6
  55. package/src/functions/nextStage.ts +4 -5
  56. package/src/functions/npcs.ts +3 -4
  57. package/src/functions/pills.ts +4 -6
  58. package/src/functions/pocketItems.ts +1 -2
  59. package/src/functions/rooms.ts +15 -17
  60. package/src/functions/stage.ts +3 -3
  61. package/src/functions/trinkets.ts +2 -2
  62. package/src/functions/types.ts +30 -0
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 80.1.0
3
+ isaacscript-common 80.2.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -20120,26 +20120,37 @@ local iRange = ____utils.iRange
20120
20120
  ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
20121
20121
  --- Calculated from the `CollectibleType` enum.
20122
20122
  --
20123
- -- Note that this cannot be calculated from the length of the enum, because unlike all of the other
20124
- -- enums, collectible types are not contiguous.
20123
+ -- Note that this cannot be calculated from the length of the enum, because collectible types are
20124
+ -- not contiguous.
20125
20125
  ____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getHighestEnumValue(nil, CollectibleType)
20126
20126
  --- Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.)
20127
20127
  ____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
20128
20128
  --- Equal to `TrinketType.SWALLOWED_PENNY`.
20129
20129
  ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
20130
20130
  --- Calculated from the `TrinketType` enum.
20131
+ --
20132
+ -- Note that this cannot be calculated from the length of the enum, because trinket types are not
20133
+ -- contiguous.
20131
20134
  ____exports.LAST_VANILLA_TRINKET_TYPE = getHighestEnumValue(nil, TrinketType)
20132
20135
  --- Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.)
20133
20136
  ____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
20134
20137
  --- Equal to `Card.FOOL`.
20135
20138
  ____exports.FIRST_CARD_TYPE = CardType.FOOL
20136
- --- Calculated from the `Card` enum.
20139
+ --- Calculated from the `CardType` enum.
20140
+ --
20141
+ -- Note that this could be calculated from the length of the enum, because card types are
20142
+ -- contiguous. However, we instead get the highest enum value to be safer and to make the code more
20143
+ -- consistent with collectibles and trinkets.
20137
20144
  ____exports.LAST_VANILLA_CARD_TYPE = getHighestEnumValue(nil, CardType)
20138
20145
  --- Calculated from the `Card` enum. `Card.NULL` is not included.
20139
20146
  ____exports.NUM_VANILLA_CARD_TYPES = getEnumLength(nil, CardType) - 1
20140
20147
  --- Equal to `PillEffect.BAD_GAS`.
20141
20148
  ____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
20142
20149
  --- Calculated from the `PillEffect` enum.
20150
+ --
20151
+ -- Note that this could be calculated from the length of the enum, because pill effects are
20152
+ -- contiguous. However, we instead get the highest enum value to be safer and to make the code more
20153
+ -- consistent with collectibles and trinkets.
20143
20154
  ____exports.LAST_VANILLA_PILL_EFFECT = getHighestEnumValue(nil, PillEffect)
20144
20155
  --- Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
20145
20156
  -- do not have to subtract one here.)
@@ -20162,6 +20173,10 @@ ____exports.NUM_NORMAL_PILL_COLORS = #iRange(nil, ____exports.FIRST_PILL_COLOR,
20162
20173
  --- Equal to `PlayerType.ISAAC`.
20163
20174
  ____exports.FIRST_CHARACTER = PlayerType.ISAAC
20164
20175
  --- Calculated from the `PlayerType` enum.
20176
+ --
20177
+ -- Note that this could be calculated from the length of the enum, because characters are
20178
+ -- contiguous. However, we instead get the highest enum value to be safer and to make the code more
20179
+ -- consistent with collectibles and trinkets.
20165
20180
  ____exports.LAST_VANILLA_CHARACTER = getHighestEnumValue(nil, PlayerType)
20166
20181
  ____exports.FIRST_ROOM_TYPE = RoomType.DEFAULT
20167
20182
  ____exports.LAST_ROOM_TYPE = getHighestEnumValue(nil, RoomType)
@@ -23561,8 +23576,6 @@ local ____flag = require("functions.flag")
23561
23576
  local hasFlag = ____flag.hasFlag
23562
23577
  local ____tstlClass = require("functions.tstlClass")
23563
23578
  local isTSTLSet = ____tstlClass.isTSTLSet
23564
- local ____types = require("functions.types")
23565
- local asNumber = ____types.asNumber
23566
23579
  function ____exports.doorSlotToDirection(self, doorSlot)
23567
23580
  return DOOR_SLOT_TO_DIRECTION[doorSlot]
23568
23581
  end
@@ -23616,22 +23629,22 @@ end
23616
23629
  -- contains the hole to the Blue Womb. (In vanilla, the door will only appear in the It Lives Boss
23617
23630
  -- Room.)
23618
23631
  function ____exports.isBlueWombDoor(self, door)
23619
- return door.TargetRoomIndex == asNumber(nil, GridRoom.BLUE_WOMB)
23632
+ return door.TargetRoomIndex == GridRoom.BLUE_WOMB
23620
23633
  end
23621
23634
  --- Helper function to check if the provided door is the one that leads to the Boss Rush room. (In
23622
23635
  -- vanilla, the door will only appear in the Boss Room of the sixth floor.)
23623
23636
  function ____exports.isBossRushDoor(self, door)
23624
- return door.TargetRoomIndex == asNumber(nil, GridRoom.BOSS_RUSH)
23637
+ return door.TargetRoomIndex == GridRoom.BOSS_RUSH
23625
23638
  end
23626
23639
  --- Helper function to check if the provided door is the one that leads to the Mega Satan Boss Room.
23627
23640
  -- (In vanilla, the door will only appear in the starting room of The Chest / Dark Room.)
23628
23641
  function ____exports.isMegaSatanDoor(self, door)
23629
- return door.TargetRoomIndex == asNumber(nil, GridRoom.MEGA_SATAN)
23642
+ return door.TargetRoomIndex == GridRoom.MEGA_SATAN
23630
23643
  end
23631
23644
  --- Helper function to check if the provided door leads to the "secret exit" off-grid room that takes
23632
23645
  -- you to the Repentance floor.
23633
23646
  function ____exports.isRepentanceDoor(self, door)
23634
- return door.TargetRoomIndex == asNumber(nil, GridRoom.SECRET_EXIT)
23647
+ return door.TargetRoomIndex == GridRoom.SECRET_EXIT
23635
23648
  end
23636
23649
  --- This refers to the hole in the wall that appears after bombing the entrance to a secret room.
23637
23650
  -- Note that the door still exists before it has been bombed open. It has a sprite filename of
@@ -23647,7 +23660,7 @@ end
23647
23660
  --- Helper function to check if the provided door is the one that leads to the off-grid room that
23648
23661
  -- contains the portal to The Void. (In vanilla, the door will only appear in the Hush Boss Room.)
23649
23662
  function ____exports.isVoidDoor(self, door)
23650
- return door.TargetRoomIndex == asNumber(nil, GridRoom.VOID)
23663
+ return door.TargetRoomIndex == GridRoom.VOID
23651
23664
  end
23652
23665
  --- Helper function to remove a single door.
23653
23666
  function ____exports.removeDoor(self, door)
@@ -29301,8 +29314,6 @@ local ____playerDataStructures = require("functions.playerDataStructures")
29301
29314
  local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
29302
29315
  local mapGetPlayer = ____playerDataStructures.mapGetPlayer
29303
29316
  local mapSetPlayer = ____playerDataStructures.mapSetPlayer
29304
- local ____types = require("functions.types")
29305
- local asNumber = ____types.asNumber
29306
29317
  local ____DefaultMap = require("classes.DefaultMap")
29307
29318
  local DefaultMap = ____DefaultMap.DefaultMap
29308
29319
  local ____CustomCallback = require("classes.private.CustomCallback")
@@ -29333,7 +29344,7 @@ function PostItemDischarge.prototype.____constructor(self)
29333
29344
  return callbackCollectibleType == nil or callbackCollectibleType == collectibleType
29334
29345
  end
29335
29346
  self.preNPCCollisionSucker = function(____, npc, collider)
29336
- if npc.Variant == asNumber(nil, SuckerVariant.BULB) then
29347
+ if npc.Variant == SuckerVariant.BULB then
29337
29348
  return self:preNPCCollisionBulb(npc, collider)
29338
29349
  end
29339
29350
  return nil
@@ -32066,7 +32077,6 @@ local ____log = require("functions.log")
32066
32077
  local log = ____log.log
32067
32078
  local ____types = require("functions.types")
32068
32079
  local asLevelStage = ____types.asLevelStage
32069
- local asNumber = ____types.asNumber
32070
32080
  local ____utils = require("functions.utils")
32071
32081
  local inRange = ____utils.inRange
32072
32082
  --- Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
@@ -32108,10 +32118,7 @@ function ____exports.calculateStageTypeRepentance(self, stage)
32108
32118
  return StageType.REPENTANCE
32109
32119
  end
32110
32120
  local seeds = game:GetSeeds()
32111
- local adjustedStage = asLevelStage(
32112
- nil,
32113
- asNumber(nil, stage) + 1
32114
- )
32121
+ local adjustedStage = asLevelStage(nil, stage + 1)
32115
32122
  local stageSeed = seeds:GetStageSeed(adjustedStage)
32116
32123
  local halfStageSeed = math.floor(stageSeed / 2)
32117
32124
  if halfStageSeed % 2 == 0 then
@@ -32126,7 +32133,7 @@ function ____exports.getEffectiveStage(self)
32126
32133
  local level = game:GetLevel()
32127
32134
  local stage = level:GetStage()
32128
32135
  if ____exports.onRepentanceStage(nil) then
32129
- return asNumber(nil, stage) + 1
32136
+ return stage + 1
32130
32137
  end
32131
32138
  return stage
32132
32139
  end
@@ -32503,8 +32510,6 @@ local ____roomTransition = require("functions.roomTransition")
32503
32510
  local reloadRoom = ____roomTransition.reloadRoom
32504
32511
  local ____stage = require("functions.stage")
32505
32512
  local getGotoCommand = ____stage.getGotoCommand
32506
- local ____types = require("functions.types")
32507
- local asNumber = ____types.asNumber
32508
32513
  local ____utils = require("functions.utils")
32509
32514
  local assertDefined = ____utils.assertDefined
32510
32515
  local iRange = ____utils.iRange
@@ -32584,7 +32589,7 @@ end
32584
32589
  -- Under the hood, this checks the room type being equal to `RoomType.ANGEL` (15) and the sub-type
32585
32590
  -- being equal to `AngelRoomSubType.SHOP` (1).
32586
32591
  function ____exports.isAngelShop(self, roomData)
32587
- return roomData.Type == RoomType.ANGEL and roomData.Subtype == asNumber(nil, AngelRoomSubType.SHOP)
32592
+ return roomData.Type == RoomType.ANGEL and roomData.Subtype == AngelRoomSubType.SHOP
32588
32593
  end
32589
32594
  --- Helper function to check to see if the provided room is the Boss Room for The Beast.
32590
32595
  --
@@ -32593,7 +32598,7 @@ end
32593
32598
  -- Under the hood, this checks the room type being equal to `RoomType.DUNGEON` (16) and the sub-type
32594
32599
  -- being equal to `DungeonSubType.BEAST_ROOM` (4).
32595
32600
  function ____exports.isBeastRoom(self, roomData)
32596
- return roomData.Type == RoomType.DUNGEON and roomData.Subtype == asNumber(nil, DungeonSubType.BEAST_ROOM)
32601
+ return roomData.Type == RoomType.DUNGEON and roomData.Subtype == DungeonSubType.BEAST_ROOM
32597
32602
  end
32598
32603
  --- Helper function to detect if the provided room is big. Specifically, this is all 1x2 rooms, 2x2
32599
32604
  -- rooms, and L rooms.
@@ -32603,13 +32608,13 @@ end
32603
32608
  --- Helper function to check if the provided room is the Boss Room for a particular boss. This will
32604
32609
  -- only work for bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
32605
32610
  function ____exports.isBossRoomOf(self, roomData, bossID)
32606
- return roomData.Type == RoomType.BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == asNumber(nil, bossID)
32611
+ return roomData.Type == RoomType.BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == bossID
32607
32612
  end
32608
32613
  --- Helper function for determining whether the provided room is a crawl space. Use this function
32609
32614
  -- over comparing to `RoomType.DUNGEON` or `GridRoom.DUNGEON_IDX` since there is a special case of
32610
32615
  -- the player being in a boss fight that takes place in a dungeon.
32611
32616
  function ____exports.isCrawlSpace(self, roomData)
32612
- return roomData.Type == RoomType.DUNGEON and roomData.Subtype == asNumber(nil, DungeonSubType.NORMAL)
32617
+ return roomData.Type == RoomType.DUNGEON and roomData.Subtype == DungeonSubType.NORMAL
32613
32618
  end
32614
32619
  --- Helper function for checking whether the provided room is a crawl space with a door corresponding
32615
32620
  -- to `DoorSlotFlag.RIGHT_0` (1 << 2).
@@ -32618,7 +32623,7 @@ function ____exports.isCrawlSpaceWithBlackMarketEntrance(self, roomData)
32618
32623
  end
32619
32624
  --- Helper function to detect if the provided room is one of the rooms in the Death Certificate area.
32620
32625
  function ____exports.isDeathCertificateArea(self, roomData)
32621
- return roomData.StageID == StageID.HOME and (roomData.Subtype == asNumber(nil, HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE) or roomData.Subtype == asNumber(nil, HomeRoomSubType.DEATH_CERTIFICATE_ITEMS))
32626
+ return roomData.StageID == StageID.HOME and (roomData.Subtype == HomeRoomSubType.DEATH_CERTIFICATE_ENTRANCE or roomData.Subtype == HomeRoomSubType.DEATH_CERTIFICATE_ITEMS)
32622
32627
  end
32623
32628
  --- Helper function to detect if the provided room is a Treasure Room created when entering with a
32624
32629
  -- Devil's Crown trinket.
@@ -32639,7 +32644,7 @@ end
32639
32644
  -- Dogma Boss Room that exists in vanilla) and the sub-type being equal to
32640
32645
  -- `HomeRoomSubType.LIVING_ROOM` (3).
32641
32646
  function ____exports.isDogmaRoom(self, roomData)
32642
- return roomData.StageID == StageID.HOME and roomData.Type == RoomType.DEFAULT and roomData.Variant == 1000 and roomData.Subtype == asNumber(nil, HomeRoomSubType.LIVING_ROOM)
32647
+ return roomData.StageID == StageID.HOME and roomData.Type == RoomType.DEFAULT and roomData.Variant == 1000 and roomData.Subtype == HomeRoomSubType.LIVING_ROOM
32643
32648
  end
32644
32649
  --- Helper function to detect if the provided room is a Double Trouble Boss Room.
32645
32650
  --
@@ -32655,14 +32660,14 @@ function ____exports.isDoubleTrouble(self, roomData)
32655
32660
  end
32656
32661
  --- Helper function to determine if the index of the provided room is equal to `GridRoom.GENESIS`.
32657
32662
  function ____exports.isGenesisRoom(self, roomGridIndex)
32658
- return roomGridIndex == asNumber(nil, GridRoom.GENESIS)
32663
+ return roomGridIndex == GridRoom.GENESIS
32659
32664
  end
32660
32665
  --- Helper function to check if the provided room is either the left Home closet (behind the red
32661
32666
  -- door) or the right Home closet (with one random pickup).
32662
32667
  --
32663
32668
  -- Home closets have a unique shape that is different from any other room in the game.
32664
32669
  function ____exports.isHomeCloset(self, roomData)
32665
- return roomData.StageID == StageID.HOME and (roomData.Subtype == asNumber(nil, HomeRoomSubType.CLOSET_LEFT) or roomData.Subtype == asNumber(nil, HomeRoomSubType.CLOSET_RIGHT))
32670
+ return roomData.StageID == StageID.HOME and (roomData.Subtype == HomeRoomSubType.CLOSET_LEFT or roomData.Subtype == HomeRoomSubType.CLOSET_RIGHT)
32666
32671
  end
32667
32672
  --- Helper function to determine if the provided room is one of the four L room shapes.
32668
32673
  function ____exports.isLRoom(self, roomData)
@@ -32670,7 +32675,7 @@ function ____exports.isLRoom(self, roomData)
32670
32675
  end
32671
32676
  --- Helper function to determine if the index of the provided room is equal to `GridRoom.MEGA_SATAN`.
32672
32677
  function ____exports.isMegaSatanRoom(self, roomGridIndex)
32673
- return roomGridIndex == asNumber(nil, GridRoom.MEGA_SATAN)
32678
+ return roomGridIndex == GridRoom.MEGA_SATAN
32674
32679
  end
32675
32680
  --- Helper function to determine if the provided room is part of the Repentance "escape sequence" in
32676
32681
  -- the Mines/Ashpit.
@@ -32680,12 +32685,12 @@ end
32680
32685
  --- Helper function to check if the provided room is a miniboss room for a particular miniboss. This
32681
32686
  -- will only work for mini-bosses that have dedicated boss rooms in the "00.special rooms.stb" file.
32682
32687
  function ____exports.isMinibossRoomOf(self, roomData, minibossID)
32683
- return roomData.Type == RoomType.MINI_BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == asNumber(nil, minibossID)
32688
+ return roomData.Type == RoomType.MINI_BOSS and roomData.StageID == StageID.SPECIAL_ROOMS and roomData.Subtype == minibossID
32684
32689
  end
32685
32690
  --- Helper function to check if the provided room is a "mirror room" in Downpour or Dross. (These
32686
32691
  -- rooms are marked with a specific sub-type.)
32687
32692
  function ____exports.isMirrorRoom(self, roomData)
32688
- return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == asNumber(nil, DownpourRoomSubType.MIRROR)
32693
+ return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == DownpourRoomSubType.MIRROR
32689
32694
  end
32690
32695
  --- Helper function to check if the provided room matches one of the given room shapes.
32691
32696
  --
@@ -32704,7 +32709,7 @@ end
32704
32709
  --- Helper function for checking if the provided room is a secret exit that leads to a Repentance
32705
32710
  -- floor.
32706
32711
  function ____exports.isSecretExit(self, roomGridIndex)
32707
- return roomGridIndex == asNumber(nil, GridRoom.SECRET_EXIT)
32712
+ return roomGridIndex == GridRoom.SECRET_EXIT
32708
32713
  end
32709
32714
  --- Helper function for checking if the provided room is a secret shop (from the Member Card
32710
32715
  -- collectible).
@@ -32713,7 +32718,7 @@ end
32713
32718
  -- words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
32714
32719
  -- the only way to detect them is by using the grid index.
32715
32720
  function ____exports.isSecretShop(self, roomGridIndex)
32716
- return roomGridIndex == asNumber(nil, GridRoom.SECRET_SHOP)
32721
+ return roomGridIndex == GridRoom.SECRET_SHOP
32717
32722
  end
32718
32723
  local SECRET_ROOM_TYPES = __TS__New(ReadonlySet, {RoomType.SECRET, RoomType.SUPER_SECRET, RoomType.ULTRA_SECRET})
32719
32724
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
@@ -33158,7 +33163,6 @@ local isCircleIntersectingRectangle = ____math.isCircleIntersectingRectangle
33158
33163
  local ____rooms = require("functions.rooms")
33159
33164
  local roomUpdateSafe = ____rooms.roomUpdateSafe
33160
33165
  local ____types = require("functions.types")
33161
- local asNumber = ____types.asNumber
33162
33166
  local isInteger = ____types.isInteger
33163
33167
  local ____utils = require("functions.utils")
33164
33168
  local assertDefined = ____utils.assertDefined
@@ -33516,7 +33520,7 @@ function ____exports.removeGridEntity(self, gridEntityOrGridIndex, updateRoom)
33516
33520
  roomUpdateSafe(nil)
33517
33521
  end
33518
33522
  if gridEntityType == GridEntityType.STATUE then
33519
- local effectVariant = variant == asNumber(nil, StatueVariant.DEVIL) and EffectVariant.DEVIL or EffectVariant.ANGEL
33523
+ local effectVariant = variant == StatueVariant.DEVIL and EffectVariant.DEVIL or EffectVariant.ANGEL
33520
33524
  local effects = getEffects(nil, effectVariant)
33521
33525
  local effectsOnTile = __TS__ArrayFilter(
33522
33526
  effects,
@@ -34508,8 +34512,6 @@ local getGridEntities = ____gridEntities.getGridEntities
34508
34512
  local getMatchingGridEntities = ____gridEntities.getMatchingGridEntities
34509
34513
  local removeGridEntities = ____gridEntities.removeGridEntities
34510
34514
  local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
34511
- local ____types = require("functions.types")
34512
- local asNumber = ____types.asNumber
34513
34515
  local ____utils = require("functions.utils")
34514
34516
  local assertDefined = ____utils.assertDefined
34515
34517
  --- Helper function to spawn a `GridEntityType.CRAWL_SPACE` (18) with a specific variant.
@@ -34599,7 +34601,7 @@ function ____exports.getCrawlSpaces(self, crawlSpaceVariant)
34599
34601
  if crawlSpaceVariant == nil then
34600
34602
  crawlSpaceVariant = -1
34601
34603
  end
34602
- if asNumber(nil, crawlSpaceVariant) == -1 then
34604
+ if crawlSpaceVariant == -1 then
34603
34605
  return getGridEntities(nil, GridEntityType.CRAWL_SPACE)
34604
34606
  end
34605
34607
  return getMatchingGridEntities(nil, GridEntityType.CRAWL_SPACE, crawlSpaceVariant)
@@ -34617,7 +34619,7 @@ function ____exports.getPits(self, pitVariant)
34617
34619
  local pit = gridEntity:ToPit()
34618
34620
  if pit ~= nil then
34619
34621
  local thisPitVariant = pit:GetVariant()
34620
- if asNumber(nil, pitVariant) == -1 or pitVariant == thisPitVariant then
34622
+ if pitVariant == -1 or pitVariant == thisPitVariant then
34621
34623
  pits[#pits + 1] = pit
34622
34624
  end
34623
34625
  end
@@ -34637,7 +34639,7 @@ function ____exports.getPoops(self, poopVariant)
34637
34639
  local poop = gridEntity:ToPoop()
34638
34640
  if poop ~= nil then
34639
34641
  local thisPoopVariant = poop:GetVariant()
34640
- if asNumber(nil, poopVariant) == -1 or poopVariant == thisPoopVariant then
34642
+ if poopVariant == -1 or poopVariant == thisPoopVariant then
34641
34643
  poops[#poops + 1] = poop
34642
34644
  end
34643
34645
  end
@@ -34657,7 +34659,7 @@ function ____exports.getPressurePlates(self, pressurePlateVariant)
34657
34659
  local pressurePlate = gridEntity:ToPressurePlate()
34658
34660
  if pressurePlate ~= nil then
34659
34661
  local thisPressurePlateVariant = pressurePlate:GetVariant()
34660
- if asNumber(nil, pressurePlateVariant) == -1 or pressurePlateVariant == thisPressurePlateVariant then
34662
+ if pressurePlateVariant == -1 or pressurePlateVariant == thisPressurePlateVariant then
34661
34663
  pressurePlates[#pressurePlates + 1] = pressurePlate
34662
34664
  end
34663
34665
  end
@@ -34743,7 +34745,7 @@ function ____exports.getTrapdoors(self, trapdoorVariant)
34743
34745
  if trapdoorVariant == nil then
34744
34746
  trapdoorVariant = -1
34745
34747
  end
34746
- if asNumber(nil, trapdoorVariant) == -1 then
34748
+ if trapdoorVariant == -1 then
34747
34749
  return getGridEntities(nil, GridEntityType.TRAPDOOR)
34748
34750
  end
34749
34751
  return getMatchingGridEntities(nil, GridEntityType.TRAPDOOR, trapdoorVariant)
@@ -36575,7 +36577,7 @@ local TRINKET_SPRITE_LAYER = 0
36575
36577
  -- For example, passing `TrinketType.SWALLOWED_PENNY` would result in 32769, which is the value that
36576
36578
  -- corresponds to the golden trinket sub-type for Swallowed Penny.
36577
36579
  function ____exports.getGoldenTrinketType(self, trinketType)
36578
- return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType or asNumber(nil, trinketType) + GOLDEN_TRINKET_ADJUSTMENT
36580
+ return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType or trinketType + GOLDEN_TRINKET_ADJUSTMENT
36579
36581
  end
36580
36582
  --- Helper function to get the current effect that the Mysterious Paper trinket is providing to the
36581
36583
  -- player. Returns undefined if the player does not have the Mysterious Paper trinket.
@@ -36609,7 +36611,7 @@ end
36609
36611
  -- If the provided trinket type is already a normal trinket type, then the trinket type will be
36610
36612
  -- returned unmodified.
36611
36613
  function ____exports.getNormalTrinketType(self, trinketType)
36612
- return ____exports.isGoldenTrinketType(nil, trinketType) and asNumber(nil, trinketType) - GOLDEN_TRINKET_ADJUSTMENT or trinketType
36614
+ return ____exports.isGoldenTrinketType(nil, trinketType) and trinketType - GOLDEN_TRINKET_ADJUSTMENT or trinketType
36613
36615
  end
36614
36616
  --- Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
36615
36617
  -- trinket type was not valid.
@@ -38555,6 +38557,7 @@ return ____exports
38555
38557
  local ____lualib = require("lualib_bundle")
38556
38558
  local __TS__ArraySlice = ____lualib.__TS__ArraySlice
38557
38559
  local ____exports = {}
38560
+ local HORSE_PILL_ADJUSTMENT
38558
38561
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
38559
38562
  local PillColor = ____isaac_2Dtypescript_2Ddefinitions.PillColor
38560
38563
  local ____cachedEnumValues = require("arrays.cachedEnumValues")
@@ -38588,15 +38591,14 @@ local asNumber = ____types.asNumber
38588
38591
  local asPillColor = ____types.asPillColor
38589
38592
  local ____utils = require("functions.utils")
38590
38593
  local iRange = ____utils.iRange
38594
+ --- Helper function to see if the given pill color is a horse pill.
38595
+ function ____exports.isHorsePill(self, pillColor)
38596
+ return asNumber(nil, pillColor) > HORSE_PILL_ADJUSTMENT
38597
+ end
38591
38598
  function ____exports.isVanillaPillEffect(self, pillEffect)
38592
38599
  return pillEffect <= LAST_VANILLA_PILL_EFFECT
38593
38600
  end
38594
- --- Add this to a `PillColor` to get the corresponding giant pill color.
38595
- --
38596
- -- Corresponds to the vanilla `PillColor.GIANT_FLAG` value.
38597
- --
38598
- -- 1 << 11
38599
- local HORSE_PILL_ADJUSTMENT = 2048
38601
+ HORSE_PILL_ADJUSTMENT = 2048
38600
38602
  --- Helper function to get an array with every non-null pill color. This includes all gold colors and
38601
38603
  -- all horse colors.
38602
38604
  function ____exports.getAllPillColors(self)
@@ -38613,7 +38615,7 @@ end
38613
38615
  -- For example, passing `PillColor.BLUE_BLUE` would result in 2049, which is the value that
38614
38616
  -- corresponds to the horse pill color for blue/blue.
38615
38617
  function ____exports.getHorsePillColor(self, pillColor)
38616
- return asNumber(nil, pillColor) + HORSE_PILL_ADJUSTMENT
38618
+ return pillColor + HORSE_PILL_ADJUSTMENT
38617
38619
  end
38618
38620
  --- Helper function to get an array with every non-gold horse pill color.
38619
38621
  function ____exports.getHorsePillColors(self)
@@ -38625,11 +38627,7 @@ end
38625
38627
  --
38626
38628
  -- If called with a non-horse pill color, this function will return back the same color.
38627
38629
  function ____exports.getNormalPillColorFromHorse(self, pillColor)
38628
- local normalPillColor = asPillColor(
38629
- nil,
38630
- asNumber(nil, pillColor) - HORSE_PILL_ADJUSTMENT
38631
- )
38632
- return normalPillColor > PillColor.NULL and normalPillColor or pillColor
38630
+ return ____exports.isHorsePill(nil, pillColor) and asPillColor(nil, pillColor - HORSE_PILL_ADJUSTMENT) or pillColor
38633
38631
  end
38634
38632
  --- Helper function to get an array with every non-gold and non-horse pill color.
38635
38633
  function ____exports.getNormalPillColors(self)
@@ -38710,10 +38708,6 @@ end
38710
38708
  function ____exports.isGoldPill(self, pillColor)
38711
38709
  return pillColor == PillColor.GOLD or pillColor == PillColor.HORSE_GOLD
38712
38710
  end
38713
- --- Helper function to see if the given pill color is a horse pill.
38714
- function ____exports.isHorsePill(self, pillColor)
38715
- return asNumber(nil, pillColor) > HORSE_PILL_ADJUSTMENT
38716
- end
38717
38711
  function ____exports.isModdedPillEffect(self, pillEffect)
38718
38712
  return not ____exports.isVanillaPillEffect(nil, pillEffect)
38719
38713
  end
@@ -38741,8 +38735,6 @@ local ____PocketItemType = require("enums.PocketItemType")
38741
38735
  local PocketItemType = ____PocketItemType.PocketItemType
38742
38736
  local ____players = require("functions.players")
38743
38737
  local isCharacter = ____players.isCharacter
38744
- local ____types = require("functions.types")
38745
- local asNumber = ____types.asNumber
38746
38738
  --- Use this helper function as a workaround for the `EntityPlayer.GetPocketItem` method not working
38747
38739
  -- correctly.
38748
38740
  --
@@ -38778,7 +38770,7 @@ function ____exports.getPocketItems(self, player)
38778
38770
  else
38779
38771
  pocketItems[#pocketItems + 1] = {slot = slot, type = PocketItemType.EMPTY, subType = 0}
38780
38772
  end
38781
- if asNumber(nil, slot) + 1 == maxPocketItems then
38773
+ if slot + 1 == maxPocketItems then
38782
38774
  break
38783
38775
  end
38784
38776
  end
@@ -44457,14 +44449,12 @@ local NUM_VANILLA_PILL_EFFECTS = ____constantsFirstLast.NUM_VANILLA_PILL_EFFECTS
44457
44449
  local NUM_VANILLA_TRINKET_TYPES = ____constantsFirstLast.NUM_VANILLA_TRINKET_TYPES
44458
44450
  local ____decorators = require("decorators")
44459
44451
  local Exported = ____decorators.Exported
44460
- local ____types = require("functions.types")
44461
- local asCardType = ____types.asCardType
44462
- local asCollectibleType = ____types.asCollectibleType
44463
- local asNumber = ____types.asNumber
44464
- local asPillEffect = ____types.asPillEffect
44465
- local asTrinketType = ____types.asTrinketType
44466
44452
  local ____Feature = require("classes.private.Feature")
44467
44453
  local Feature = ____Feature.Feature
44454
+ ____exports.FIRST_MODDED_COLLECTIBLE_TYPE = LAST_VANILLA_COLLECTIBLE_TYPE + 1
44455
+ ____exports.FIRST_MODDED_TRINKET_TYPE = LAST_VANILLA_TRINKET_TYPE + 1
44456
+ ____exports.FIRST_MODDED_CARD_TYPE = LAST_VANILLA_CARD_TYPE + 1
44457
+ ____exports.FIRST_MODDED_PILL_EFFECT = LAST_VANILLA_PILL_EFFECT + 1
44468
44458
  --- Mods can add extra things to the game (e.g. collectibles, trinkets, and so on). Since mods load
44469
44459
  -- in alphabetical order, the total number of things can't be properly be known until at least one
44470
44460
  -- callback fires (which indicates that all mods have been loaded).
@@ -44492,16 +44482,12 @@ function ModdedElementDetection.prototype.errorIfNoCallbacksFired(self, constant
44492
44482
  end
44493
44483
  function ModdedElementDetection.prototype.getFirstModdedCollectibleType(self)
44494
44484
  self:errorIfNoCallbacksFired("collectible")
44495
- local firstModdedCollectibleType = asCollectibleType(
44496
- nil,
44497
- asNumber(nil, LAST_VANILLA_COLLECTIBLE_TYPE) + 1
44498
- )
44499
- local itemConfigItem = itemConfig:GetCollectible(firstModdedCollectibleType)
44485
+ local itemConfigItem = itemConfig:GetCollectible(____exports.FIRST_MODDED_COLLECTIBLE_TYPE)
44500
44486
  local ____temp_0
44501
44487
  if itemConfigItem == nil then
44502
44488
  ____temp_0 = nil
44503
44489
  else
44504
- ____temp_0 = firstModdedCollectibleType
44490
+ ____temp_0 = ____exports.FIRST_MODDED_COLLECTIBLE_TYPE
44505
44491
  end
44506
44492
  return ____temp_0
44507
44493
  end
@@ -44513,28 +44499,22 @@ end
44513
44499
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastCollectibleType", true)
44514
44500
  function ModdedElementDetection.prototype.getNumCollectibleTypes(self)
44515
44501
  self:errorIfNoCallbacksFired("collectible")
44516
- local numModdedCollectibleTypes = self:getNumModdedCollectibleTypes()
44517
- return NUM_VANILLA_COLLECTIBLE_TYPES + numModdedCollectibleTypes
44502
+ return NUM_VANILLA_COLLECTIBLE_TYPES + self:getNumModdedCollectibleTypes()
44518
44503
  end
44519
44504
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumCollectibleTypes", true)
44520
44505
  function ModdedElementDetection.prototype.getNumModdedCollectibleTypes(self)
44521
44506
  self:errorIfNoCallbacksFired("collectible")
44522
- local lastCollectibleType = self:getLastCollectibleType()
44523
- return lastCollectibleType - LAST_VANILLA_COLLECTIBLE_TYPE
44507
+ return self:getLastCollectibleType() - LAST_VANILLA_COLLECTIBLE_TYPE
44524
44508
  end
44525
44509
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedCollectibleTypes", true)
44526
44510
  function ModdedElementDetection.prototype.getFirstModdedTrinketType(self)
44527
44511
  self:errorIfNoCallbacksFired("trinket")
44528
- local firstModdedTrinketType = asTrinketType(
44529
- nil,
44530
- asNumber(nil, LAST_VANILLA_TRINKET_TYPE) + 1
44531
- )
44532
- local itemConfigItem = itemConfig:GetTrinket(firstModdedTrinketType)
44512
+ local itemConfigItem = itemConfig:GetTrinket(____exports.FIRST_MODDED_TRINKET_TYPE)
44533
44513
  local ____temp_1
44534
44514
  if itemConfigItem == nil then
44535
44515
  ____temp_1 = nil
44536
44516
  else
44537
- ____temp_1 = firstModdedTrinketType
44517
+ ____temp_1 = ____exports.FIRST_MODDED_TRINKET_TYPE
44538
44518
  end
44539
44519
  return ____temp_1
44540
44520
  end
@@ -44546,80 +44526,66 @@ end
44546
44526
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastTrinketType", true)
44547
44527
  function ModdedElementDetection.prototype.getNumTrinketTypes(self)
44548
44528
  self:errorIfNoCallbacksFired("trinket")
44549
- local numModdedTrinketTypes = self:getNumModdedTrinketTypes()
44550
- return NUM_VANILLA_TRINKET_TYPES + numModdedTrinketTypes
44529
+ return NUM_VANILLA_TRINKET_TYPES + self:getNumModdedTrinketTypes()
44551
44530
  end
44552
44531
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumTrinketTypes", true)
44553
44532
  function ModdedElementDetection.prototype.getNumModdedTrinketTypes(self)
44554
44533
  self:errorIfNoCallbacksFired("trinket")
44555
- local lastTrinketType = self:getLastTrinketType()
44556
- return lastTrinketType - LAST_VANILLA_TRINKET_TYPE
44534
+ return self:getLastTrinketType() - LAST_VANILLA_TRINKET_TYPE
44557
44535
  end
44558
44536
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedTrinketTypes", true)
44559
44537
  function ModdedElementDetection.prototype.getFirstModdedCardType(self)
44560
44538
  self:errorIfNoCallbacksFired("card")
44561
- local firstModdedCardType = asCardType(
44562
- nil,
44563
- asNumber(nil, LAST_VANILLA_CARD_TYPE) + 1
44564
- )
44565
- local itemConfigCard = itemConfig:GetCard(firstModdedCardType)
44539
+ local itemConfigCard = itemConfig:GetCard(____exports.FIRST_MODDED_CARD_TYPE)
44566
44540
  local ____temp_2
44567
44541
  if itemConfigCard == nil then
44568
44542
  ____temp_2 = nil
44569
44543
  else
44570
- ____temp_2 = firstModdedCardType
44544
+ ____temp_2 = ____exports.FIRST_MODDED_CARD_TYPE
44571
44545
  end
44572
44546
  return ____temp_2
44573
44547
  end
44574
44548
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getFirstModdedCardType", true)
44575
44549
  function ModdedElementDetection.prototype.getLastCardType(self)
44576
44550
  self:errorIfNoCallbacksFired("card")
44577
- local numCards = self:getNumCardTypes()
44578
- return asCardType(nil, numCards)
44551
+ return itemConfig:GetCards().Size - 1
44579
44552
  end
44580
44553
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastCardType", true)
44581
44554
  function ModdedElementDetection.prototype.getNumCardTypes(self)
44582
44555
  self:errorIfNoCallbacksFired("card")
44583
- return itemConfig:GetCards().Size - 1
44556
+ return NUM_VANILLA_CARD_TYPES + self:getNumModdedCardTypes()
44584
44557
  end
44585
44558
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumCardTypes", true)
44586
44559
  function ModdedElementDetection.prototype.getNumModdedCardTypes(self)
44587
44560
  self:errorIfNoCallbacksFired("card")
44588
- local numCardTypes = self:getNumCardTypes()
44589
- return numCardTypes - NUM_VANILLA_CARD_TYPES
44561
+ return self:getLastCardType() - LAST_VANILLA_CARD_TYPE
44590
44562
  end
44591
44563
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedCardTypes", true)
44592
44564
  function ModdedElementDetection.prototype.getFirstModdedPillEffect(self)
44593
44565
  self:errorIfNoCallbacksFired("pill")
44594
- local firstModdedPillEffect = asPillEffect(
44595
- nil,
44596
- asNumber(nil, LAST_VANILLA_PILL_EFFECT) + 1
44597
- )
44598
- local itemConfigPillEffect = itemConfig:GetPillEffect(firstModdedPillEffect)
44566
+ local itemConfigPillEffect = itemConfig:GetPillEffect(____exports.FIRST_MODDED_PILL_EFFECT)
44599
44567
  local ____temp_3
44600
44568
  if itemConfigPillEffect == nil then
44601
44569
  ____temp_3 = nil
44602
44570
  else
44603
- ____temp_3 = firstModdedPillEffect
44571
+ ____temp_3 = ____exports.FIRST_MODDED_PILL_EFFECT
44604
44572
  end
44605
44573
  return ____temp_3
44606
44574
  end
44607
44575
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getFirstModdedPillEffect", true)
44608
44576
  function ModdedElementDetection.prototype.getLastPillEffect(self)
44609
44577
  self:errorIfNoCallbacksFired("pill")
44610
- local numPillEffects = self:getNumPillEffects() - 1
44611
- return asPillEffect(nil, numPillEffects)
44578
+ return itemConfig:GetPillEffects().Size - 1
44612
44579
  end
44613
44580
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getLastPillEffect", true)
44614
44581
  function ModdedElementDetection.prototype.getNumPillEffects(self)
44615
44582
  self:errorIfNoCallbacksFired("pill")
44616
- return itemConfig:GetPillEffects().Size
44583
+ return NUM_VANILLA_PILL_EFFECTS + self:getNumModdedPillEffects()
44617
44584
  end
44618
44585
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumPillEffects", true)
44619
44586
  function ModdedElementDetection.prototype.getNumModdedPillEffects(self)
44620
- self:errorIfNoCallbacksFired("pill")
44621
- local numPillEffects = self:getNumPillEffects()
44622
- return numPillEffects - NUM_VANILLA_PILL_EFFECTS
44587
+ self:errorIfNoCallbacksFired("card")
44588
+ return self:getLastPillEffect() - LAST_VANILLA_PILL_EFFECT
44623
44589
  end
44624
44590
  __TS__DecorateLegacy({Exported}, ModdedElementDetection.prototype, "getNumModdedPillEffects", true)
44625
44591
  return ____exports
@@ -47182,8 +47148,6 @@ local getEntityID = ____entities.getEntityID
47182
47148
  local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
47183
47149
  local ____entitiesSpecific = require("functions.entitiesSpecific")
47184
47150
  local spawnEffect = ____entitiesSpecific.spawnEffect
47185
- local ____types = require("functions.types")
47186
- local asNumber = ____types.asNumber
47187
47151
  local ____Feature = require("classes.private.Feature")
47188
47152
  local Feature = ____Feature.Feature
47189
47153
  --- Normally, we would make a custom entity to represent a fading-away pickup, but we don't want to
@@ -47226,7 +47190,7 @@ function CustomPickups.prototype.____constructor(self)
47226
47190
  return nil
47227
47191
  end
47228
47192
  self.postEffectRenderPickupEffect = function(____, effect)
47229
- if effect.SubType ~= asNumber(nil, PICKUP_EFFECT_SUB_TYPE) then
47193
+ if effect.SubType ~= PICKUP_EFFECT_SUB_TYPE then
47230
47194
  return
47231
47195
  end
47232
47196
  local sprite = effect:GetSprite()
@@ -48333,8 +48297,6 @@ local ____stage = require("functions.stage")
48333
48297
  local calculateStageType = ____stage.calculateStageType
48334
48298
  local calculateStageTypeRepentance = ____stage.calculateStageTypeRepentance
48335
48299
  local onRepentanceStage = ____stage.onRepentanceStage
48336
- local ____types = require("functions.types")
48337
- local asNumber = ____types.asNumber
48338
48300
  --- Helper function to get the stage that a trapdoor or heaven door would take the player to, based
48339
48301
  -- on the current stage, room, and game state flags.
48340
48302
  --
@@ -48349,7 +48311,7 @@ function ____exports.getNextStage(self)
48349
48311
  local repentanceStage = onRepentanceStage(nil)
48350
48312
  local roomGridIndex = getRoomGridIndex(nil)
48351
48313
  if backwardsPath then
48352
- local nextStage = asNumber(nil, stage) - 1
48314
+ local nextStage = stage - 1
48353
48315
  return nextStage == 0 and LevelStage.HOME or nextStage
48354
48316
  end
48355
48317
  repeat
@@ -48370,7 +48332,7 @@ function ____exports.getNextStage(self)
48370
48332
  if ____cond4 then
48371
48333
  do
48372
48334
  if repentanceStage then
48373
- return asNumber(nil, stage) + 1
48335
+ return stage + 1
48374
48336
  end
48375
48337
  if stage == LevelStage.DEPTHS_2 or stage == LevelStage.DEPTHS_1 and hasCurse(nil, LevelCurse.LABYRINTH) then
48376
48338
  return LevelStage.DEPTHS_2
@@ -48400,7 +48362,7 @@ function ____exports.getNextStage(self)
48400
48362
  if stage == LevelStage.VOID then
48401
48363
  return LevelStage.VOID
48402
48364
  end
48403
- return asNumber(nil, stage) + 1
48365
+ return stage + 1
48404
48366
  end
48405
48367
  --- Helper function to get the stage type that a trapdoor or heaven door would take the player to,
48406
48368
  -- based on the current stage, room, and game state flags.
@@ -48426,7 +48388,7 @@ function ____exports.getNextStageType(self, upwards)
48426
48388
  if backwardsPath then
48427
48389
  return calculateStageType(nil, nextStage)
48428
48390
  end
48429
- if roomGridIndex == asNumber(nil, GridRoom.SECRET_EXIT) then
48391
+ if roomGridIndex == GridRoom.SECRET_EXIT then
48430
48392
  return calculateStageTypeRepentance(nil, nextStage)
48431
48393
  end
48432
48394
  if repentanceStage and (stage == LevelStage.BASEMENT_1 or stage == LevelStage.CAVES_1 or stage == LevelStage.DEPTHS_1 or stage == LevelStage.WOMB_1) then
@@ -48487,8 +48449,6 @@ local getNextStageType = ____nextStage.getNextStageType
48487
48449
  local ____stage = require("functions.stage")
48488
48450
  local calculateStageType = ____stage.calculateStageType
48489
48451
  local onRepentanceStage = ____stage.onRepentanceStage
48490
- local ____types = require("functions.types")
48491
- local asNumber = ____types.asNumber
48492
48452
  local ____Feature = require("classes.private.Feature")
48493
48453
  local Feature = ____Feature.Feature
48494
48454
  local v = {run = {stageHistory = {}}}
@@ -48635,7 +48595,7 @@ function StageHistory.prototype.getNextStageWithHistory(self)
48635
48595
  end
48636
48596
  return LevelStage.DEPTHS_1
48637
48597
  end
48638
- return asNumber(nil, stage) - 1
48598
+ return stage - 1
48639
48599
  end
48640
48600
  __TS__DecorateLegacy({Exported}, StageHistory.prototype, "getNextStageWithHistory", true)
48641
48601
  function StageHistory.prototype.getStageHistory(self)
@@ -51137,8 +51097,6 @@ local ____ReadonlySet = require("types.ReadonlySet")
51137
51097
  local ReadonlySet = ____ReadonlySet.ReadonlySet
51138
51098
  local ____entitiesSpecific = require("functions.entitiesSpecific")
51139
51099
  local getNPCs = ____entitiesSpecific.getNPCs
51140
- local ____types = require("functions.types")
51141
- local asNumber = ____types.asNumber
51142
51100
  --- Checks for specific NPCs that have "CanShutDoors" set to true naturally by the game, but should
51143
51101
  -- not actually keep the doors closed (like Death's scythes).
51144
51102
  function ____exports.isAliveExceptionNPC(self, npc)
@@ -51177,20 +51135,20 @@ end
51177
51135
  -- `NPCState.SPECIAL`, spit out their head, and then slowly fade away while shooting a burst of
51178
51136
  -- tears.
51179
51137
  function ____exports.isDyingDump(self, npc)
51180
- return npc.Type == EntityType.DUMP and npc.Variant == asNumber(nil, DumpVariant.DUMP) and npc.State == NPCState.SPECIAL
51138
+ return npc.Type == EntityType.DUMP and npc.Variant == DumpVariant.DUMP and npc.State == NPCState.SPECIAL
51181
51139
  end
51182
51140
  --- Helper function to detect the custom death state of an Eggy. Eggies are never actually marked
51183
51141
  -- dead by the game. Instead, when Eggies take fatal damage, they go into NPCState.STATE_SUICIDE and
51184
51142
  -- spawn 14 Swarm Spiders while their StateFrame ticks upwards.
51185
51143
  function ____exports.isDyingEggyWithNoSpidersLeft(self, npc)
51186
- return npc.Type == EntityType.HOPPER and npc.Variant == asNumber(nil, HopperVariant.EGGY) and npc.State == NPCState.SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
51144
+ return npc.Type == EntityType.HOPPER and npc.Variant == HopperVariant.EGGY and npc.State == NPCState.SUICIDE and npc.StateFrame >= EGGY_STATE_FRAME_OF_FINAL_SPIDER
51187
51145
  end
51188
51146
  --- Helper function to detect the custom death state of a Rag Man Ragling. When Rag Man Raglings die,
51189
51147
  -- they turn into a patch on the ground and can be revived by Rag Man at a later time. This causes
51190
51148
  -- them to show up as an "alive" enemy, so they should usually be filtered out of lists of alive
51191
51149
  -- enemies.
51192
51150
  function ____exports.isRaglingDeathPatch(self, npc)
51193
- return npc.Type == EntityType.RAGLING and npc.Variant == asNumber(nil, RaglingVariant.RAG_MANS_RAGLING) and npc.State == NPCState.SPECIAL
51151
+ return npc.Type == EntityType.RAGLING and npc.Variant == RaglingVariant.RAG_MANS_RAGLING and npc.State == NPCState.SPECIAL
51194
51152
  end
51195
51153
  NON_ALIVE_NPCS_TYPE_VARIANT = __TS__New(
51196
51154
  ReadonlySet,
@@ -51298,8 +51256,6 @@ local isRNG = ____rng.isRNG
51298
51256
  local ____rooms = require("functions.rooms")
51299
51257
  local inBeastRoom = ____rooms.inBeastRoom
51300
51258
  local inDogmaRoom = ____rooms.inDogmaRoom
51301
- local ____types = require("functions.types")
51302
- local asNumber = ____types.asNumber
51303
51259
  local ____utils = require("functions.utils")
51304
51260
  local ____repeat = ____utils["repeat"]
51305
51261
  local BOSSES_THAT_REQUIRE_MULTIPLE_SPAWNS = __TS__New(ReadonlySet, {
@@ -51476,7 +51432,7 @@ local function getNumBossSegments(self, entityType, variant, numSegments)
51476
51432
  ____cond22 = ____cond22 or ____switch22 == EntityType.LOKI
51477
51433
  if ____cond22 then
51478
51434
  do
51479
- return variant == asNumber(nil, LokiVariant.LOKII) and 2 or 1
51435
+ return variant == LokiVariant.LOKII and 2 or 1
51480
51436
  end
51481
51437
  end
51482
51438
  ____cond22 = ____cond22 or ____switch22 == EntityType.GURGLING
@@ -52329,8 +52285,6 @@ local ____sound = require("functions.sound")
52329
52285
  local getMusicForStage = ____sound.getMusicForStage
52330
52286
  local ____stage = require("functions.stage")
52331
52287
  local setStage = ____stage.setStage
52332
- local ____types = require("functions.types")
52333
- local asNumber = ____types.asNumber
52334
52288
  local ____utils = require("functions.utils")
52335
52289
  local assertDefined = ____utils.assertDefined
52336
52290
  local ____Feature = require("classes.private.Feature")
@@ -52656,7 +52610,7 @@ function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakTex
52656
52610
  baseStage = baseStage + 1
52657
52611
  end
52658
52612
  local baseStageType = customStage.baseStageType == nil and DEFAULT_BASE_STAGE_TYPE or customStage.baseStageType
52659
- local reseed = asNumber(nil, stage) >= baseStage
52613
+ local reseed = stage >= baseStage
52660
52614
  setStage(nil, baseStage, baseStageType, reseed)
52661
52615
  musicManager:Disable()
52662
52616
  self:setStageRoomsData(customStage, rng, verbose)
@@ -54647,7 +54601,6 @@ local ____spawnCollectible = require("functions.spawnCollectible")
54647
54601
  local spawnCollectible = ____spawnCollectible.spawnCollectible
54648
54602
  local ____types = require("functions.types")
54649
54603
  local asCollectibleType = ____types.asCollectibleType
54650
- local asNumber = ____types.asNumber
54651
54604
  local ____utils = require("functions.utils")
54652
54605
  local assertDefined = ____utils.assertDefined
54653
54606
  local ____ReadonlySet = require("types.ReadonlySet")
@@ -54872,11 +54825,12 @@ function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType,
54872
54825
  local position = gridCoordinatesToWorldPosition(nil, x, y)
54873
54826
  local seed = rng:Next()
54874
54827
  local entity
54875
- if entityType == EntityType.PICKUP and variant == asNumber(nil, PickupVariant.COLLECTIBLE) then
54828
+ if entityType == EntityType.PICKUP and variant == PickupVariant.COLLECTIBLE then
54829
+ local collectibleType = asCollectibleType(nil, subType)
54876
54830
  local options = roomType == RoomType.ANGEL
54877
54831
  entity = spawnCollectible(
54878
54832
  nil,
54879
- asCollectibleType(nil, subType),
54833
+ collectibleType,
54880
54834
  position,
54881
54835
  seed,
54882
54836
  options
@@ -54891,7 +54845,7 @@ function DeployJSONRoom.prototype.spawnNormalEntityForJSONRoom(self, entityType,
54891
54845
  seed
54892
54846
  )
54893
54847
  end
54894
- if entityType == EntityType.PITFALL and variant == asNumber(nil, PitfallVariant.PITFALL) then
54848
+ if entityType == EntityType.PITFALL and variant == PitfallVariant.PITFALL then
54895
54849
  entity.EntityCollisionClass = EntityCollisionClass.ENEMIES
54896
54850
  entity.GridCollisionClass = EntityGridCollisionClass.WALLS
54897
54851
  end
@@ -60150,7 +60104,6 @@ local getMapPartialMatch = ____string.getMapPartialMatch
60150
60104
  local ____trinkets = require("functions.trinkets")
60151
60105
  local getGoldenTrinketType = ____trinkets.getGoldenTrinketType
60152
60106
  local ____types = require("functions.types")
60153
- local asCardType = ____types.asCardType
60154
60107
  local asCollectibleType = ____types.asCollectibleType
60155
60108
  local asTrinketType = ____types.asTrinketType
60156
60109
  local ____utils = require("functions.utils")
@@ -60579,11 +60532,7 @@ function ____exports.cards(self)
60579
60532
  return
60580
60533
  end
60581
60534
  local worldPosition = gridCoordinatesToWorldPosition(nil, x, y)
60582
- spawnCard(
60583
- nil,
60584
- asCardType(nil, cardType),
60585
- worldPosition
60586
- )
60535
+ spawnCard(nil, cardType, worldPosition)
60587
60536
  cardType = cardType + 1
60588
60537
  x = x + 1
60589
60538
  end