isaacscript-common 7.2.0 → 7.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 (135) hide show
  1. package/dist/callbacks/itemPickup.d.ts.map +1 -1
  2. package/dist/callbacks/itemPickup.lua +3 -1
  3. package/dist/callbacks/postCustomDoorEnter.d.ts.map +1 -1
  4. package/dist/callbacks/postCustomDoorEnter.lua +14 -11
  5. package/dist/callbacks/postDiceRoomActivated.d.ts.map +1 -1
  6. package/dist/callbacks/postDiceRoomActivated.lua +5 -4
  7. package/dist/callbacks/postItemDischarged.lua +2 -1
  8. package/dist/callbacks/postSlotDestroyed.lua +3 -3
  9. package/dist/core/constants.d.ts +2 -2
  10. package/dist/core/constants.d.ts.map +1 -1
  11. package/dist/core/constants.lua +3 -1
  12. package/dist/core/constantsFirstLast.d.ts +2 -0
  13. package/dist/core/constantsFirstLast.d.ts.map +1 -1
  14. package/dist/core/constantsFirstLast.lua +36 -9
  15. package/dist/enums/SaveDataKey.d.ts +11 -0
  16. package/dist/enums/SaveDataKey.d.ts.map +1 -0
  17. package/dist/enums/{private/SaveDataKey.lua → SaveDataKey.lua} +2 -0
  18. package/dist/enums/index.d.ts +1 -0
  19. package/dist/enums/index.d.ts.map +1 -1
  20. package/dist/enums/index.lua +8 -0
  21. package/dist/features/customGridEntity.d.ts.map +1 -1
  22. package/dist/features/customGridEntity.lua +3 -1
  23. package/dist/features/customStage/backdrop.lua +4 -2
  24. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  25. package/dist/features/customStage/customStageGridEntities.lua +3 -1
  26. package/dist/features/customStage/exports.d.ts.map +1 -1
  27. package/dist/features/customStage/exports.lua +3 -1
  28. package/dist/features/customStage/shadows.d.ts.map +1 -1
  29. package/dist/features/customStage/shadows.lua +2 -1
  30. package/dist/features/deployJSONRoom.lua +13 -10
  31. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  32. package/dist/features/extraConsoleCommands/listCommands.lua +8 -2
  33. package/dist/features/saveDataManager/exports.d.ts +2 -1
  34. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  35. package/dist/features/saveDataManager/main.d.ts +1 -1
  36. package/dist/features/saveDataManager/main.d.ts.map +1 -1
  37. package/dist/features/saveDataManager/main.lua +1 -1
  38. package/dist/functions/bitSet128.d.ts.map +1 -1
  39. package/dist/functions/bosses.d.ts.map +1 -1
  40. package/dist/functions/bosses.lua +3 -1
  41. package/dist/functions/collectibles.d.ts.map +1 -1
  42. package/dist/functions/deepCopy.lua +2 -1
  43. package/dist/functions/doors.d.ts.map +1 -1
  44. package/dist/functions/doors.lua +3 -1
  45. package/dist/functions/entities.lua +2 -1
  46. package/dist/functions/gridEntities.lua +2 -1
  47. package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
  48. package/dist/functions/gridEntitiesSpecific.lua +5 -3
  49. package/dist/functions/input.d.ts +1 -1
  50. package/dist/functions/input.d.ts.map +1 -1
  51. package/dist/functions/input.lua +1 -1
  52. package/dist/functions/kColor.d.ts.map +1 -1
  53. package/dist/functions/levelGrid.d.ts.map +1 -1
  54. package/dist/functions/levelGrid.lua +3 -1
  55. package/dist/functions/nextStage.d.ts.map +1 -1
  56. package/dist/functions/nextStage.lua +7 -5
  57. package/dist/functions/npcs.d.ts.map +1 -1
  58. package/dist/functions/npcs.lua +4 -2
  59. package/dist/functions/pills.d.ts.map +1 -1
  60. package/dist/functions/pills.lua +9 -3
  61. package/dist/functions/playerIndex.d.ts.map +1 -1
  62. package/dist/functions/playerIndex.lua +2 -1
  63. package/dist/functions/players.d.ts +1 -1
  64. package/dist/functions/players.d.ts.map +1 -1
  65. package/dist/functions/players.lua +13 -15
  66. package/dist/functions/pocketItems.d.ts.map +1 -1
  67. package/dist/functions/pocketItems.lua +3 -1
  68. package/dist/functions/rng.d.ts.map +1 -1
  69. package/dist/functions/rng.lua +3 -0
  70. package/dist/functions/rooms.d.ts +4 -4
  71. package/dist/functions/rooms.d.ts.map +1 -1
  72. package/dist/functions/rooms.lua +17 -16
  73. package/dist/functions/spawnCollectible.d.ts.map +1 -1
  74. package/dist/functions/stage.d.ts.map +1 -1
  75. package/dist/functions/stage.lua +8 -2
  76. package/dist/functions/trinkets.d.ts.map +1 -1
  77. package/dist/functions/trinkets.lua +4 -2
  78. package/dist/functions/types.d.ts +64 -0
  79. package/dist/functions/types.d.ts.map +1 -1
  80. package/dist/functions/types.lua +63 -0
  81. package/dist/functions/vector.d.ts.map +1 -1
  82. package/package.json +2 -2
  83. package/src/callbacks/itemPickup.ts +5 -2
  84. package/src/callbacks/postCustomDoorEnter.ts +18 -11
  85. package/src/callbacks/postDiceRoomActivated.ts +7 -12
  86. package/src/callbacks/postItemDischarged.ts +3 -1
  87. package/src/callbacks/postSlotDestroyed.ts +3 -2
  88. package/src/callbacks/reorderedCallbacks.ts +2 -2
  89. package/src/classes/DefaultMap.ts +1 -1
  90. package/src/core/constants.ts +3 -3
  91. package/src/core/constantsFirstLast.ts +29 -14
  92. package/src/enums/SaveDataKey.ts +10 -0
  93. package/src/enums/index.ts +1 -0
  94. package/src/enums/indexTypeDoc.ts +1 -0
  95. package/src/features/customGridEntity.ts +2 -1
  96. package/src/features/customStage/backdrop.ts +4 -2
  97. package/src/features/customStage/customStageGridEntities.ts +2 -1
  98. package/src/features/customStage/exports.ts +5 -4
  99. package/src/features/customStage/shadows.ts +2 -1
  100. package/src/features/deployJSONRoom.ts +14 -19
  101. package/src/features/extraConsoleCommands/listCommands.ts +3 -2
  102. package/src/features/saveDataManager/exports.ts +4 -4
  103. package/src/features/saveDataManager/main.ts +1 -1
  104. package/src/features/saveDataManager/save.ts +1 -1
  105. package/src/functions/bitSet128.ts +1 -5
  106. package/src/functions/bosses.ts +2 -1
  107. package/src/functions/cards.ts +3 -3
  108. package/src/functions/collectibles.ts +2 -8
  109. package/src/functions/color.ts +1 -1
  110. package/src/functions/deepCopy.ts +2 -2
  111. package/src/functions/dimensions.ts +1 -1
  112. package/src/functions/doors.ts +2 -2
  113. package/src/functions/entities.ts +2 -2
  114. package/src/functions/gridEntities.ts +2 -2
  115. package/src/functions/gridEntitiesSpecific.ts +4 -3
  116. package/src/functions/input.ts +2 -2
  117. package/src/functions/jsonHelpers.ts +1 -1
  118. package/src/functions/kColor.ts +1 -5
  119. package/src/functions/levelGrid.ts +3 -2
  120. package/src/functions/nextStage.ts +6 -5
  121. package/src/functions/npcs.ts +3 -2
  122. package/src/functions/pills.ts +11 -9
  123. package/src/functions/playerIndex.ts +3 -1
  124. package/src/functions/players.ts +5 -6
  125. package/src/functions/pocketItems.ts +4 -4
  126. package/src/functions/rng.ts +8 -5
  127. package/src/functions/rooms.ts +26 -26
  128. package/src/functions/spawnCollectible.ts +1 -2
  129. package/src/functions/stage.ts +3 -2
  130. package/src/functions/trinkets.ts +6 -5
  131. package/src/functions/types.ts +100 -0
  132. package/src/functions/vector.ts +1 -5
  133. package/dist/enums/private/SaveDataKey.d.ts +0 -7
  134. package/dist/enums/private/SaveDataKey.d.ts.map +0 -1
  135. package/src/enums/private/SaveDataKey.ts +0 -6
@@ -1 +1 @@
1
- {"version":3,"file":"itemPickup.d.ts","sourceRoot":"","sources":["../../src/callbacks/itemPickup.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA2BrD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAO9D"}
1
+ {"version":3,"file":"itemPickup.d.ts","sourceRoot":"","sources":["../../src/callbacks/itemPickup.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA4BrD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAO9D"}
@@ -12,6 +12,8 @@ local ____exports = require("features.saveDataManager.exports")
12
12
  local saveDataManager = ____exports.saveDataManager
13
13
  local ____playerDataStructures = require("functions.playerDataStructures")
14
14
  local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
15
+ local ____types = require("functions.types")
16
+ local asNumber = ____types.asNumber
15
17
  local ____PickingUpItem = require("types.PickingUpItem")
16
18
  local newPickingUpItem = ____PickingUpItem.newPickingUpItem
17
19
  local resetPickingUpItem = ____PickingUpItem.resetPickingUpItem
@@ -36,7 +38,7 @@ function postPEffectUpdateReordered(self, player)
36
38
  end
37
39
  end
38
40
  function queueEmpty(self, player, pickingUpItem)
39
- if pickingUpItem.itemType == ItemType.NULL or pickingUpItem.subType == 0 then
41
+ if pickingUpItem.itemType == ItemType.NULL or asNumber(nil, pickingUpItem.subType) == 0 then
40
42
  return
41
43
  end
42
44
  postItemPickupFire(nil, player, pickingUpItem)
@@ -1 +1 @@
1
- {"version":3,"file":"postCustomDoorEnter.d.ts","sourceRoot":"","sources":["../../src/callbacks/postCustomDoorEnter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,aAAa,EAId,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AA6BrD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAMD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,aAAa,GAC3B,IAAI,CAqBN;AAgHD,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,GACjB,YAAY,CAmDd"}
1
+ {"version":3,"file":"postCustomDoorEnter.d.ts","sourceRoot":"","sources":["../../src/callbacks/postCustomDoorEnter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAER,aAAa,EAId,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAkCrD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C;AAMD,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,WAAW,EAChB,aAAa,EAAE,aAAa,GAC3B,IAAI,CAqBN;AAkHD,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,QAAQ,GACjB,YAAY,CAmDd"}
@@ -25,6 +25,8 @@ local getEffects = ____entitiesSpecific.getEffects
25
25
  local spawnEffect = ____entitiesSpecific.spawnEffect
26
26
  local ____players = require("functions.players")
27
27
  local getClosestPlayer = ____players.getClosestPlayer
28
+ local ____types = require("functions.types")
29
+ local asNumber = ____types.asNumber
28
30
  local ____postCustomDoorEnter = require("callbacks.subscriptions.postCustomDoorEnter")
29
31
  local postCustomDoorEnterFire = ____postCustomDoorEnter.postCustomDoorEnterFire
30
32
  local postCustomDoorEnterHasSubscriptions = ____postCustomDoorEnter.postCustomDoorEnterHasSubscriptions
@@ -32,32 +34,33 @@ function hasSubscriptions(self)
32
34
  return postCustomDoorEnterHasSubscriptions(nil)
33
35
  end
34
36
  function postEffectUpdaterCustomEntity(self, effect)
37
+ local customDoor = effect
35
38
  local ptrHash = GetPtrHash(effect)
36
39
  local doorData = v.room.customDoors:get(ptrHash)
37
40
  if doorData == nil then
38
41
  return
39
42
  end
40
- if doorData.state == effect.State then
43
+ if doorData.state == customDoor.State then
41
44
  return
42
45
  end
43
- doorData.state = effect.State
46
+ doorData.state = customDoor.State
44
47
  doorChangedState(nil, effect)
45
48
  end
46
- function doorChangedState(self, effect)
49
+ function doorChangedState(self, door)
47
50
  local room = game:GetRoom()
48
- local sprite = effect:GetSprite()
49
- local animation = getAnimationForCustomDoor(nil, effect)
51
+ local sprite = door:GetSprite()
52
+ local animation = getAnimationForCustomDoor(nil, door)
50
53
  sprite:Play(animation, true)
51
- local gridIndex = room:GetGridIndex(effect.Position)
54
+ local gridIndex = room:GetGridIndex(door.Position)
52
55
  local wall = room:GetGridEntity(gridIndex)
53
56
  if wall ~= nil then
54
- wall.CollisionClass = effect.State == DoorState.OPEN and GridCollisionClass.WALL_EXCEPT_PLAYER or GridCollisionClass.WALL
57
+ wall.CollisionClass = door.State == DoorState.OPEN and GridCollisionClass.WALL_EXCEPT_PLAYER or GridCollisionClass.WALL
55
58
  end
56
59
  end
57
- function getAnimationForCustomDoor(self, effect)
58
- local freshlySpawned = effect.FrameCount == 0
60
+ function getAnimationForCustomDoor(self, door)
61
+ local freshlySpawned = door.FrameCount == 0
59
62
  repeat
60
- local ____switch12 = effect.State
63
+ local ____switch12 = door.State
61
64
  local ____cond12 = ____switch12 == DoorState.OPEN
62
65
  if ____cond12 then
63
66
  do
@@ -185,7 +188,7 @@ function ____exports.spawnCustomDoorInternal(self, effectVariant, doorSlot)
185
188
  effect.RenderZOffset = -10000
186
189
  effect.PositionOffset = getPositionOffset(nil, doorSlot)
187
190
  local sprite = effect:GetSprite()
188
- sprite.Rotation = doorSlot * 90 - 90
191
+ sprite.Rotation = asNumber(nil, doorSlot) * 90 - 90
189
192
  local ptrHash = GetPtrHash(effect)
190
193
  local doorData = {slot = doorSlot, state = effect.State}
191
194
  v.room.customDoors:set(ptrHash, doorData)
@@ -1 +1 @@
1
- {"version":3,"file":"postDiceRoomActivated.d.ts","sourceRoot":"","sources":["../../src/callbacks/postDiceRoomActivated.ts"],"names":[],"mappings":";AAmBA,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAQxD"}
1
+ {"version":3,"file":"postDiceRoomActivated.d.ts","sourceRoot":"","sources":["../../src/callbacks/postDiceRoomActivated.ts"],"names":[],"mappings":";AAeA,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAQxD"}
@@ -16,19 +16,20 @@ function hasSubscriptions(self)
16
16
  return postDiceRoomActivatedHasSubscriptions(nil)
17
17
  end
18
18
  function postEffectUpdateDiceFloor(self, effect)
19
+ local diceFloor = effect
19
20
  if not hasSubscriptions(nil) then
20
21
  return
21
22
  end
22
23
  if v.room.diceRoomActivated then
23
24
  return
24
25
  end
25
- if effect.FrameCount == 0 then
26
+ if diceFloor.FrameCount == 0 then
26
27
  return
27
28
  end
28
- local closestPlayer = getClosestPlayer(nil, effect.Position)
29
- if isCloseEnoughToTriggerDiceFloor(nil, closestPlayer, effect) then
29
+ local closestPlayer = getClosestPlayer(nil, diceFloor.Position)
30
+ if isCloseEnoughToTriggerDiceFloor(nil, closestPlayer, diceFloor) then
30
31
  v.room.diceRoomActivated = true
31
- postDiceRoomActivatedFire(nil, closestPlayer, effect.SubType)
32
+ postDiceRoomActivatedFire(nil, closestPlayer, diceFloor.SubType)
32
33
  end
33
34
  end
34
35
  v = {room = {diceRoomActivated = false}}
@@ -70,10 +70,11 @@ function playerRecentlyCollidedWithBulb(self, player)
70
70
  return collidedOnThisFrame or collidedOnLastFrame
71
71
  end
72
72
  function preNPCCollisionSucker(self, npc, collider)
73
+ local sucker = npc
73
74
  if not hasSubscriptions(nil) then
74
75
  return nil
75
76
  end
76
- if npc.Variant ~= SuckerVariant.BULB then
77
+ if sucker.Variant ~= SuckerVariant.BULB then
77
78
  return nil
78
79
  end
79
80
  local player = collider:ToPlayer()
@@ -3,7 +3,7 @@ local Set = ____lualib.Set
3
3
  local __TS__New = ____lualib.__TS__New
4
4
  local Map = ____lualib.Map
5
5
  local ____exports = {}
6
- local hasSubscriptions, postEntityRemove, postSlotAnimationChanged, PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL, v
6
+ local hasSubscriptions, postEntityRemoveSlot, postSlotAnimationChanged, PRIZE_GAME_FRAME_DELAY_UNTIL_REMOVAL, v
7
7
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
8
  local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
9
9
  local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
@@ -22,7 +22,7 @@ local postSlotDestroyedHasSubscriptions = ____postSlotDestroyed.postSlotDestroye
22
22
  function hasSubscriptions(self)
23
23
  return postSlotDestroyedHasSubscriptions(nil)
24
24
  end
25
- function postEntityRemove(self, entity)
25
+ function postEntityRemoveSlot(self, entity)
26
26
  local slot = entity
27
27
  local ptrHash = GetPtrHash(slot)
28
28
  local gameFrameCount = game:GetFrameCount()
@@ -60,7 +60,7 @@ v = {room = {
60
60
  }}
61
61
  function ____exports.postSlotDestroyedInit(self, mod)
62
62
  saveDataManager(nil, "postSlotDestroyed", v, hasSubscriptions)
63
- mod:AddCallback(ModCallback.POST_ENTITY_REMOVE, postEntityRemove, EntityType.SLOT)
63
+ mod:AddCallback(ModCallback.POST_ENTITY_REMOVE, postEntityRemoveSlot, EntityType.SLOT)
64
64
  mod:AddCallbackCustom(ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED, postSlotAnimationChanged)
65
65
  end
66
66
  return ____exports
@@ -1,4 +1,4 @@
1
- import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
1
+ import { ItemPoolType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * The combination of the following flags:
4
4
  * - `DisplayFlag.VISIBLE` (1 << 0)
@@ -44,7 +44,7 @@ export declare const EMPTY_PNG_PATH = "gfx/none.png";
44
44
  * encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
45
45
  * second TMTRAINER item subtracts one from that, and so on.
46
46
  */
47
- export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: CollectibleType;
47
+ export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: import("isaac-typescript-definitions").CollectibleType;
48
48
  /** Game frames are what is returned by the `Game.GetFrameCount` method. */
49
49
  export declare const GAME_FRAMES_PER_SECOND = 30;
50
50
  /** Render frames are what is returned by the `Isaac.GetFrameCount` method. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/core/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGf,YAAY,EAEb,MAAM,8BAA8B,CAAC;AAKtC;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;;;;EAI7B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,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AO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAQ,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAsB,CAAC"}
@@ -8,6 +8,8 @@ local ____enums = require("functions.enums")
8
8
  local getEnumLength = ____enums.getEnumLength
9
9
  local ____flag = require("functions.flag")
10
10
  local addFlag = ____flag.addFlag
11
+ local ____types = require("functions.types")
12
+ local asCollectibleType = ____types.asCollectibleType
11
13
  local ____constantsFirstLast = require("core.constantsFirstLast")
12
14
  local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
13
15
  --- The combination of the following flags:
@@ -39,7 +41,7 @@ ____exports.EMPTY_PNG_PATH = "gfx/none.png"
39
41
  --- The random items that appear when the player has TMTRAINER are generated on the fly as they are
40
42
  -- encountered by the player. The first TMTRAINER item takes the final possible 32 bit number. The
41
43
  -- second TMTRAINER item subtracts one from that, and so on.
42
- ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = (1 << 32) - 1
44
+ ____exports.FIRST_GLITCHED_COLLECTIBLE_TYPE = asCollectibleType(nil, (1 << 32) - 1)
43
45
  --- Game frames are what is returned by the `Game.GetFrameCount` method.
44
46
  ____exports.GAME_FRAMES_PER_SECOND = 30
45
47
  --- Render frames are what is returned by the `Isaac.GetFrameCount` method.
@@ -126,6 +126,8 @@ export declare const FIRST_CHARACTER = PlayerType.ISAAC;
126
126
  export declare const LAST_VANILLA_CHARACTER: PlayerType;
127
127
  /**
128
128
  * If there are no modded characters, this constant will represent a character that does not exist.
129
+ * (There is no way to determine the amount of modded characters at run-time, since there is no
130
+ * exposed player config.)
129
131
  */
130
132
  export declare const FIRST_MODDED_CHARACTER: PlayerType;
131
133
  export declare const FIRST_ROOM_TYPE = RoomType.DEFAULT;
@@ -1 +1 @@
1
- {"version":3,"file":"constantsFirstLast.d.ts","sourceRoot":"","sources":["../../src/core/constantsFirstLast.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,eAAe,EACf,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAQtC,4CAA4C;AAC5C,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,iBACX,CAAC;AAExB;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,iBAAoC,CAAC;AAE/E;;;GAGG;AACH,eAAO,MAAM,6BAA6B,iBACuB,CAAC;AAElE,0FAA0F;AAC1F,eAAO,MAAM,6BAA6B,QAAqC,CAAC;AAEhF,wFAAwF;AACxF,eAAO,MAAM,4BAA4B,QACc,CAAC;AAExD,eAAO,MAAM,qBAAqB,QAC4B,CAAC;AAM/D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,QAAoC,CAAC;AAEnE,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,QAAiC,CAAC;AAExE,eAAO,MAAM,wBAAwB,QACU,CAAC;AAEhD,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,aAAmC,CAAC;AAElE,8CAA8C;AAC9C,eAAO,MAAM,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@@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
11
11
  local ____enums = require("functions.enums")
12
12
  local getEnumLength = ____enums.getEnumLength
13
13
  local getLastEnumValue = ____enums.getLastEnumValue
14
+ local ____types = require("functions.types")
15
+ local asCard = ____types.asCard
16
+ local asCollectibleType = ____types.asCollectibleType
17
+ local asNumber = ____types.asNumber
18
+ local asPillEffect = ____types.asPillEffect
19
+ local asPlayerType = ____types.asPlayerType
20
+ local asTrinketType = ____types.asTrinketType
14
21
  local ____cachedClasses = require("core.cachedClasses")
15
22
  local itemConfig = ____cachedClasses.itemConfig
16
23
  --- Equal to `CollectibleType.SAD_ONION`.
@@ -19,7 +26,10 @@ ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
19
26
  --
20
27
  -- Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
21
28
  -- 666. We subtract one to account for `CollectibleType.NULL`.)
22
- ____exports.LAST_COLLECTIBLE_TYPE = itemConfig:GetCollectibles().Size - 1
29
+ ____exports.LAST_COLLECTIBLE_TYPE = asCollectibleType(
30
+ nil,
31
+ itemConfig:GetCollectibles().Size - 1
32
+ )
23
33
  --- Calculated from the `CollectibleType` enum.
24
34
  --
25
35
  -- Note that this cannot be calculated from the length of the enum, because unlike all of the other
@@ -27,7 +37,10 @@ ____exports.LAST_COLLECTIBLE_TYPE = itemConfig:GetCollectibles().Size - 1
27
37
  ____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getLastEnumValue(nil, CollectibleType)
28
38
  --- If there are no modded collectibles, this constant will represent a collectible type that does
29
39
  -- not exist.
30
- ____exports.FIRST_MODDED_COLLECTIBLE_TYPE = ____exports.LAST_VANILLA_COLLECTIBLE_TYPE + 1
40
+ ____exports.FIRST_MODDED_COLLECTIBLE_TYPE = asCollectibleType(
41
+ nil,
42
+ asNumber(nil, ____exports.LAST_VANILLA_COLLECTIBLE_TYPE) + 1
43
+ )
31
44
  --- Calculated from the `CollectibleType` enum. `CollectibleType.NULL` is not included.
32
45
  ____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
33
46
  --- Unlike vanilla collectible types, modded collectible types are always contiguous.
@@ -47,11 +60,14 @@ ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
47
60
  --
48
61
  -- Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
49
62
  -- `TrinketType.NULL`.)
50
- ____exports.LAST_TRINKET_TYPE = ____exports.NUM_TRINKET_TYPES
63
+ ____exports.LAST_TRINKET_TYPE = asTrinketType(nil, ____exports.NUM_TRINKET_TYPES)
51
64
  --- Calculated from the `TrinketType` enum.
52
65
  ____exports.LAST_VANILLA_TRINKET_TYPE = getLastEnumValue(nil, TrinketType)
53
66
  --- If there are no modded trinkets, this constant will represent a trinket type that does not exist.
54
- ____exports.FIRST_MODDED_TRINKET_TYPE = ____exports.LAST_VANILLA_TRINKET_TYPE + 1
67
+ ____exports.FIRST_MODDED_TRINKET_TYPE = asTrinketType(
68
+ nil,
69
+ asNumber(nil, ____exports.LAST_VANILLA_TRINKET_TYPE) + 1
70
+ )
55
71
  --- Will change depending on how many modded cards there are.
56
72
  --
57
73
  -- Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
@@ -64,11 +80,14 @@ ____exports.FIRST_CARD = Card.FOOL
64
80
  --- Will change depending on how many modded cards there are.
65
81
  --
66
82
  -- Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
67
- ____exports.LAST_CARD = ____exports.NUM_CARDS
83
+ ____exports.LAST_CARD = asCard(nil, ____exports.NUM_CARDS)
68
84
  --- Calculated from the `Card` enum.
69
85
  ____exports.MAX_VANILLA_CARD = getLastEnumValue(nil, Card)
70
86
  --- If there are no modded cards, this constant will represent a card that does not exist.
71
- ____exports.FIRST_MODDED_CARD = ____exports.MAX_VANILLA_CARD + 1
87
+ ____exports.FIRST_MODDED_CARD = asCard(
88
+ nil,
89
+ asNumber(nil, ____exports.MAX_VANILLA_CARD) + 1
90
+ )
72
91
  --- Will change depending on how many modded pill effects there are.
73
92
  --
74
93
  -- Equal to `itemConfig.GetPillEffects().Size - 1`. (We subtract one to account for
@@ -85,12 +104,15 @@ ____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
85
104
  --
86
105
  -- Equal to `itemConfig.GetPillEffects().Size - 1`. (We subtract one to account for
87
106
  -- `PillEffect.NULL`.)
88
- ____exports.LAST_PILL_EFFECT = ____exports.NUM_PILL_EFFECTS
107
+ ____exports.LAST_PILL_EFFECT = asPillEffect(nil, ____exports.NUM_PILL_EFFECTS)
89
108
  --- Calculated from the `PillEffect` enum.
90
109
  ____exports.LAST_VANILLA_PILL_EFFECT = getLastEnumValue(nil, PillEffect)
91
110
  --- If there are no modded pill effects, this constant will represent a pill effect that does not
92
111
  -- exist.
93
- ____exports.FIRST_MODDED_PILL_EFFECT = ____exports.LAST_VANILLA_PILL_EFFECT + 1
112
+ ____exports.FIRST_MODDED_PILL_EFFECT = asPillEffect(
113
+ nil,
114
+ asNumber(nil, ____exports.LAST_VANILLA_PILL_EFFECT) + 1
115
+ )
94
116
  --- Equal to `PillColor.BLUE_BLUE`.
95
117
  ____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
96
118
  --- Equal to `PillColor.WHITE_YELLOW`.
@@ -111,7 +133,12 @@ ____exports.FIRST_CHARACTER = PlayerType.ISAAC
111
133
  --- Calculated from the `PlayerType` enum.
112
134
  ____exports.LAST_VANILLA_CHARACTER = getLastEnumValue(nil, PlayerType)
113
135
  --- If there are no modded characters, this constant will represent a character that does not exist.
114
- ____exports.FIRST_MODDED_CHARACTER = ____exports.LAST_VANILLA_CHARACTER + 1
136
+ -- (There is no way to determine the amount of modded characters at run-time, since there is no
137
+ -- exposed player config.)
138
+ ____exports.FIRST_MODDED_CHARACTER = asPlayerType(
139
+ nil,
140
+ asNumber(nil, ____exports.LAST_VANILLA_CHARACTER) + 1
141
+ )
115
142
  ____exports.FIRST_ROOM_TYPE = RoomType.DEFAULT
116
143
  ____exports.LAST_ROOM_TYPE = getLastEnumValue(nil, RoomType)
117
144
  ____exports.FIRST_STAGE = LevelStage.BASEMENT_1
@@ -0,0 +1,11 @@
1
+ /**
2
+ * These are the types of keys that you can put on the local variables that you feed to the save
3
+ * data manager.
4
+ */
5
+ export declare enum SaveDataKey {
6
+ PERSISTENT = "persistent",
7
+ RUN = "run",
8
+ LEVEL = "level",
9
+ ROOM = "room"
10
+ }
11
+ //# sourceMappingURL=SaveDataKey.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveDataKey.d.ts","sourceRoot":"","sources":["../../src/enums/SaveDataKey.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,WAAW;IACrB,UAAU,eAAe;IACzB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;CACd"}
@@ -1,4 +1,6 @@
1
1
  local ____exports = {}
2
+ --- These are the types of keys that you can put on the local variables that you feed to the save
3
+ -- data manager.
2
4
  ____exports.SaveDataKey = {}
3
5
  ____exports.SaveDataKey.PERSISTENT = "persistent"
4
6
  ____exports.SaveDataKey.RUN = "run"
@@ -4,6 +4,7 @@ export * from "./HealthType";
4
4
  export * from "./ModCallbackCustom";
5
5
  export * from "./PocketItemType";
6
6
  export * from "./RockAltType";
7
+ export * from "./SaveDataKey";
7
8
  export * from "./SerializationType";
8
9
  export * from "./SlotDestructionType";
9
10
  export * from "./StatType";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/enums/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC"}
@@ -47,6 +47,14 @@ do
47
47
  end
48
48
  end
49
49
  end
50
+ do
51
+ local ____export = require("enums.SaveDataKey")
52
+ for ____exportKey, ____exportValue in pairs(____export) do
53
+ if ____exportKey ~= "default" then
54
+ ____exports[____exportKey] = ____exportValue
55
+ end
56
+ end
57
+ end
50
58
  do
51
59
  local ____export = require("enums.SerializationType")
52
60
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -1 +1 @@
1
- {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAarD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAqB1E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAmB3D;AAkID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,EACzB,SAAS,UAAQ,GAChB,UAAU,CAyEZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAqCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAiBA"}
1
+ {"version":3,"file":"customGridEntity.d.ts","sourceRoot":"","sources":["../../src/features/customGridEntity.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,kBAAkB,EAClB,cAAc,EAGf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAcrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAqB1E,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAmB3D;AAkID;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,qBAAqB,CACnC,oBAAoB,EAAE,cAAc,EACpC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,kBAAkB,EAAE,kBAAkB,EACtC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,CAAC,EAAE,MAAM,EACzB,SAAS,UAAQ,GAChB,UAAU,CAyEZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,+BAA+B,EAAE,GAAG,GAAG,MAAM,GAAG,UAAU,EAC1D,UAAU,UAAO,GAChB,UAAU,GAAG,SAAS,CAqCxB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,KAAK,CAC5C;IAAC,UAAU,EAAE,UAAU;IAAE,IAAI,EAAE,oBAAoB;CAAC,CACrD,CAiBA"}
@@ -34,6 +34,8 @@ local removeGridEntity = ____gridEntities.removeGridEntity
34
34
  local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
35
35
  local ____roomData = require("functions.roomData")
36
36
  local getRoomListIndex = ____roomData.getRoomListIndex
37
+ local ____types = require("functions.types")
38
+ local asNumber = ____types.asNumber
37
39
  local ____vector = require("functions.vector")
38
40
  local isVector = ____vector.isVector
39
41
  local ____runInNFrames = require("features.runInNFrames")
@@ -183,7 +185,7 @@ function ____exports.spawnCustomGridEntity(self, gridEntityTypeCustom, gridIndex
183
185
  local roomListIndex = getRoomListIndex(nil)
184
186
  local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
185
187
  local existingGridEntity = room:GetGridEntity(gridIndex)
186
- local isExistingDecoration = existingGridEntity ~= nil and existingGridEntity:GetType() == GridEntityType.DECORATION and existingGridEntity:GetVariant() == DecorationVariant.CUSTOM_GRID_ENTITY
188
+ local isExistingDecoration = existingGridEntity ~= nil and existingGridEntity:GetType() == GridEntityType.DECORATION and existingGridEntity:GetVariant() == asNumber(nil, DecorationVariant.CUSTOM_GRID_ENTITY)
187
189
  local decoration = isExistingDecoration and existingGridEntity or spawnGridEntityWithVariant(nil, GridEntityType.DECORATION, DecorationVariant.CUSTOM_GRID_ENTITY, gridIndexOrPosition)
188
190
  if decoration == nil then
189
191
  error("Failed to spawn a decoration for a custom grid entity.")
@@ -36,12 +36,13 @@ end
36
36
  function spawnWallEntity(self, customStage, rng, isExtraWall)
37
37
  local room = game:GetRoom()
38
38
  local roomShape = room:GetRoomShape()
39
+ local seed = 1
39
40
  local wallEffect = spawnEffectWithSeed(
40
41
  nil,
41
42
  BACKDROP_EFFECT_VARIANT,
42
43
  BACKDROP_EFFECT_SUBTYPE,
43
44
  VectorZero,
44
- 1
45
+ seed
45
46
  )
46
47
  wallEffect:AddEntityFlags(EntityFlag.RENDER_WALL)
47
48
  local sprite = wallEffect:GetSprite()
@@ -81,12 +82,13 @@ end
81
82
  function spawnFloorEntity(self, customStage, rng)
82
83
  local room = game:GetRoom()
83
84
  local roomShape = room:GetRoomShape()
85
+ local seed = 1
84
86
  local floorEffect = spawnEffectWithSeed(
85
87
  nil,
86
88
  BACKDROP_EFFECT_VARIANT,
87
89
  0,
88
90
  VectorZero,
89
- 1
91
+ seed
90
92
  )
91
93
  floorEffect:AddEntityFlags(EntityFlag.RENDER_FLOOR)
92
94
  local sprite = floorEffect:GetSprite()
@@ -1 +1 @@
1
- {"version":3,"file":"customStageGridEntities.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageGridEntities.ts"],"names":[],"mappings":";AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAMnE,0CAA0C;AAC1C,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAyBN;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAqBN;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAkBN;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAmBN;AAuDD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN"}
1
+ {"version":3,"file":"customStageGridEntities.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/customStageGridEntities.ts"],"names":[],"mappings":";AAmBA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAMnE,0CAA0C;AAC1C,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAyBN;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAqBN;AAED,mCAAmC;AACnC,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAkBN;AAED,mCAAmC;AACnC,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAmBN;AAuDD,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,GACrB,IAAI,CAsBN"}
@@ -21,6 +21,8 @@ local getCollectibles = ____pickupsSpecific.getCollectibles
21
21
  local getTrinkets = ____pickupsSpecific.getTrinkets
22
22
  local ____stage = require("functions.stage")
23
23
  local calculateStageType = ____stage.calculateStageType
24
+ local ____types = require("functions.types")
25
+ local asNumber = ____types.asNumber
24
26
  local ____vector = require("functions.vector")
25
27
  local vectorEquals = ____vector.vectorEquals
26
28
  local ____exports = require("features.customTrapdoor.exports")
@@ -162,7 +164,7 @@ function ____exports.setCustomDecorationGraphics(self, customStage, gridEntity)
162
164
  return
163
165
  end
164
166
  local variant = gridEntity:GetVariant()
165
- if variant ~= DecorationVariant.VANILLA_DECORATION then
167
+ if variant ~= asNumber(nil, DecorationVariant.VANILLA_DECORATION) then
166
168
  return
167
169
  end
168
170
  local sprite = gridEntity:GetSprite()
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EAGV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAmBtC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,YAAmB,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI,CAwDN;AA4ED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,EACL,UAAU,EACV,UAAU,EAGV,SAAS,EACV,MAAM,8BAA8B,CAAC;AAoBtC,eAAO,MAAM,kBAAkB,wBAAwB,CAAC;AACxD,eAAO,MAAM,uBAAuB,qBAAqB,CAAC;AAE1D,eAAO,MAAM,mBAAmB,YAAmB,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI,CAwDN;AA4ED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -22,6 +22,8 @@ local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
22
22
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
23
23
  local ____stage = require("functions.stage")
24
24
  local setStage = ____stage.setStage
25
+ local ____types = require("functions.types")
26
+ local asNumber = ____types.asNumber
25
27
  local ____customStageUtils = require("features.customStage.customStageUtils")
26
28
  local getRandomCustomStageRoom = ____customStageUtils.getRandomCustomStageRoom
27
29
  local ____v = require("features.customStage.v")
@@ -115,7 +117,7 @@ function ____exports.setCustomStage(self, name, firstFloor, verbose)
115
117
  baseStage = baseStage + 1
116
118
  end
117
119
  local baseStageType = customStage.baseStageType == nil and ____exports.DEFAULT_BASE_STAGE_TYPE or customStage.baseStageType
118
- local reseed = stage >= baseStage
120
+ local reseed = asNumber(nil, stage) >= baseStage
119
121
  setStage(nil, baseStage, baseStageType, reseed)
120
122
  setStageRoomsData(nil, customStage, rng, verbose)
121
123
  local targetStage = ____exports.INVALID_STAGE_VALUE
@@ -1 +1 @@
1
- {"version":3,"file":"shadows.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/shadows.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAqCnE,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAqCzD"}
1
+ {"version":3,"file":"shadows.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/shadows.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAqCnE,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAsCzD"}
@@ -48,12 +48,13 @@ function ____exports.setShadows(self, customStage)
48
48
  if shadows == nil then
49
49
  return
50
50
  end
51
+ local seed = 1
51
52
  local shadowEffect = spawnEffectWithSeed(
52
53
  nil,
53
54
  SHADOW_EFFECT_VARIANT,
54
55
  SHADOW_EFFECT_SUBTYPE,
55
56
  centerPos,
56
- 1
57
+ seed
57
58
  )
58
59
  local sprite = shadowEffect:GetSprite()
59
60
  sprite:Load(ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/stage-shadow.anm2", false)
@@ -40,7 +40,6 @@ local ____gridEntities = require("functions.gridEntities")
40
40
  local convertXMLGridEntityType = ____gridEntities.convertXMLGridEntityType
41
41
  local getAllGridIndexes = ____gridEntities.getAllGridIndexes
42
42
  local getGridEntities = ____gridEntities.getGridEntities
43
- local getGridEntityIDFromConstituents = ____gridEntities.getGridEntityIDFromConstituents
44
43
  local removeAllGridExcept = ____gridEntities.removeAllGridExcept
45
44
  local removeGridEntity = ____gridEntities.removeGridEntity
46
45
  local setGridEntityInvisible = ____gridEntities.setGridEntityInvisible
@@ -62,6 +61,9 @@ local setRoomCleared = ____rooms.setRoomCleared
62
61
  local setRoomUncleared = ____rooms.setRoomUncleared
63
62
  local ____spawnCollectible = require("functions.spawnCollectible")
64
63
  local spawnCollectible = ____spawnCollectible.spawnCollectible
64
+ local ____types = require("functions.types")
65
+ local asCollectibleType = ____types.asCollectibleType
66
+ local asNumber = ____types.asNumber
65
67
  local ____runInNFrames = require("features.runInNFrames")
66
68
  local runNextGameFrame = ____runInNFrames.runNextGameFrame
67
69
  local ____exports = require("features.saveDataManager.exports")
@@ -225,8 +227,8 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
225
227
  error("Failed to get the first JSON entity from an \"entity\" array.")
226
228
  end
227
229
  local entityTypeString = firstXMLEntity["$"].type
228
- local entityType = tonumber(entityTypeString)
229
- if entityType == nil then
230
+ local entityTypeNumber = tonumber(entityTypeString)
231
+ if entityTypeNumber == nil then
230
232
  error("Failed to convert the entity type to a number: " .. entityTypeString)
231
233
  end
232
234
  local variantString = firstXMLEntity["$"].variant
@@ -239,19 +241,20 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
239
241
  if subType == nil then
240
242
  error("Failed to convert the entity sub-type to a number: " .. tostring(subType))
241
243
  end
242
- if entityType >= 1000 then
244
+ if entityTypeNumber >= 1000 then
245
+ local gridEntityXMLType = entityTypeNumber
243
246
  if verbose then
244
- local gridEntityID = getGridEntityIDFromConstituents(nil, entityType, variant)
245
- log(((((("Spawning grid entity " .. gridEntityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
247
+ log(((((((("Spawning grid entity " .. tostring(gridEntityXMLType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
246
248
  end
247
249
  spawnGridEntityForJSONRoom(
248
250
  nil,
249
- entityType,
251
+ gridEntityXMLType,
250
252
  variant,
251
253
  x,
252
254
  y
253
255
  )
254
256
  else
257
+ local entityType = entityTypeNumber
255
258
  if verbose then
256
259
  local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
257
260
  log(((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
@@ -306,11 +309,11 @@ function spawnNormalEntityForJSONRoom(self, entityType, variant, subType, x, y,
306
309
  local position = gridCoordinatesToWorldPosition(nil, x, y)
307
310
  local seed = rng:Next()
308
311
  local entity
309
- if entityType == EntityType.PICKUP and variant == PickupVariant.COLLECTIBLE then
312
+ if entityType == EntityType.PICKUP and variant == asNumber(nil, PickupVariant.COLLECTIBLE) then
310
313
  local options = roomType == RoomType.ANGEL
311
314
  entity = spawnCollectible(
312
315
  nil,
313
- subType,
316
+ asCollectibleType(nil, subType),
314
317
  position,
315
318
  seed,
316
319
  options
@@ -325,7 +328,7 @@ function spawnNormalEntityForJSONRoom(self, entityType, variant, subType, x, y,
325
328
  seed
326
329
  )
327
330
  end
328
- if entityType == EntityType.PITFALL and variant == PitfallVariant.PITFALL then
331
+ if entityType == EntityType.PITFALL and variant == asNumber(nil, PitfallVariant.PITFALL) then
329
332
  entity.EntityCollisionClass = EntityCollisionClass.ENEMIES
330
333
  entity.GridCollisionClass = EntityGridCollisionClass.WALLS
331
334
  end