isaacscript-common 7.4.3 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/dist/callbacks/postGridEntity.d.ts.map +1 -1
  2. package/dist/callbacks/postGridEntity.lua +53 -6
  3. package/dist/callbacks/postPlayerChangeStat.d.ts.map +1 -1
  4. package/dist/callbacks/postPlayerChangeStat.lua +9 -2
  5. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts +1 -0
  6. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.d.ts.map +1 -1
  7. package/dist/callbacks/subscriptions/postGridEntityCustomBroken.lua +5 -2
  8. package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts +9 -0
  9. package/dist/callbacks/subscriptions/postGridEntityCustomInit.d.ts.map +1 -0
  10. package/dist/callbacks/subscriptions/postGridEntityCustomInit.lua +23 -0
  11. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts +9 -0
  12. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.d.ts.map +1 -0
  13. package/dist/callbacks/subscriptions/postGridEntityCustomRemove.lua +23 -0
  14. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts +9 -0
  15. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.d.ts.map +1 -0
  16. package/dist/callbacks/subscriptions/postGridEntityCustomStateChanged.lua +29 -0
  17. package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts +3 -2
  18. package/dist/callbacks/subscriptions/postPlayerChangeStat.d.ts.map +1 -1
  19. package/dist/classes/DefaultMap.d.ts +3 -2
  20. package/dist/classes/DefaultMap.d.ts.map +1 -1
  21. package/dist/classes/DefaultMap.lua +2 -1
  22. package/dist/enums/ModCallbackCustom.d.ts +131 -81
  23. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  24. package/dist/enums/ModCallbackCustom.lua +67 -61
  25. package/dist/enums/StatType.d.ts +3 -1
  26. package/dist/enums/StatType.d.ts.map +1 -1
  27. package/dist/enums/StatType.lua +2 -0
  28. package/dist/features/customGridEntity.d.ts +30 -13
  29. package/dist/features/customGridEntity.d.ts.map +1 -1
  30. package/dist/features/customGridEntity.lua +67 -48
  31. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  32. package/dist/features/customStage/customStageGridEntities.lua +46 -36
  33. package/dist/features/customStage/customStageUtils.d.ts +2 -1
  34. package/dist/features/customStage/customStageUtils.d.ts.map +1 -1
  35. package/dist/features/customStage/customStageUtils.lua +40 -1
  36. package/dist/features/customStage/exports.d.ts +1 -25
  37. package/dist/features/customStage/exports.d.ts.map +1 -1
  38. package/dist/features/customStage/exports.lua +28 -29
  39. package/dist/features/customStage/v.d.ts +0 -2
  40. package/dist/features/customStage/v.d.ts.map +1 -1
  41. package/dist/features/customStage/v.lua +0 -2
  42. package/dist/features/customStage/versusScreen.d.ts.map +1 -1
  43. package/dist/features/customStage/versusScreen.lua +74 -60
  44. package/dist/features/customTrapdoor/exports.d.ts +28 -16
  45. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  46. package/dist/features/customTrapdoor/exports.lua +45 -61
  47. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  48. package/dist/features/customTrapdoor/init.lua +12 -10
  49. package/dist/features/customTrapdoor/spawn.d.ts +6 -0
  50. package/dist/features/customTrapdoor/spawn.d.ts.map +1 -0
  51. package/dist/features/customTrapdoor/spawn.lua +52 -0
  52. package/dist/features/customTrapdoor/v.d.ts +2 -2
  53. package/dist/features/customTrapdoor/v.d.ts.map +1 -1
  54. package/dist/functions/dev.d.ts +20 -0
  55. package/dist/functions/dev.d.ts.map +1 -0
  56. package/dist/functions/dev.lua +34 -0
  57. package/dist/functions/doors.d.ts +6 -5
  58. package/dist/functions/doors.d.ts.map +1 -1
  59. package/dist/functions/doors.lua +25 -12
  60. package/dist/functions/enums.d.ts +3 -3
  61. package/dist/functions/enums.lua +3 -3
  62. package/dist/functions/playerStats.d.ts.map +1 -1
  63. package/dist/functions/playerStats.lua +2 -1
  64. package/dist/functions/players.d.ts.map +1 -1
  65. package/dist/functions/players.lua +3 -2
  66. package/dist/functions/rooms.d.ts +5 -0
  67. package/dist/functions/rooms.d.ts.map +1 -1
  68. package/dist/functions/rooms.lua +12 -2
  69. package/dist/index.d.ts +172 -11037
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.lua +1134 -8
  72. package/dist/interfaces/{CustomStageLua.d.ts → CustomStageTSConfig.d.ts} +86 -60
  73. package/dist/interfaces/CustomStageTSConfig.d.ts.map +1 -0
  74. package/dist/interfaces/{CustomStageLua.lua → CustomStageTSConfig.lua} +0 -0
  75. package/dist/interfaces/JSONRoomsFile.d.ts +6 -5
  76. package/dist/interfaces/JSONRoomsFile.d.ts.map +1 -1
  77. package/dist/interfaces/StatTypeType.d.ts +1 -0
  78. package/dist/interfaces/StatTypeType.d.ts.map +1 -1
  79. package/dist/interfaces/private/AddCallbackParameterCustom.d.ts +6 -0
  80. package/dist/interfaces/private/AddCallbackParameterCustom.d.ts.map +1 -1
  81. package/dist/interfaces/private/CustomStage.d.ts +1 -1
  82. package/dist/interfaces/private/CustomStage.d.ts.map +1 -1
  83. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +2 -2
  84. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
  85. package/dist/interfaces/private/CustomTrapdoorDestination.d.ts +14 -0
  86. package/dist/interfaces/private/CustomTrapdoorDestination.d.ts.map +1 -0
  87. package/dist/interfaces/{index.lua → private/CustomTrapdoorDestination.lua} +0 -0
  88. package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
  89. package/dist/objects/callbackRegisterFunctions.lua +9 -0
  90. package/dist/types/PossibleStatType.d.ts +7 -0
  91. package/dist/types/PossibleStatType.d.ts.map +1 -0
  92. package/dist/types/{TrapdoorDestination.lua → PossibleStatType.lua} +0 -0
  93. package/package.json +1 -1
  94. package/src/callbacks/postGridEntity.ts +75 -10
  95. package/src/callbacks/postPlayerChangeStat.ts +8 -4
  96. package/src/callbacks/subscriptions/postGridEntityCustomBroken.ts +4 -0
  97. package/src/callbacks/subscriptions/postGridEntityCustomInit.ts +38 -0
  98. package/src/callbacks/subscriptions/postGridEntityCustomRemove.ts +35 -0
  99. package/src/callbacks/subscriptions/postGridEntityCustomStateChanged.ts +42 -0
  100. package/src/callbacks/subscriptions/postPlayerChangeStat.ts +4 -7
  101. package/src/classes/DefaultMap.ts +3 -2
  102. package/src/enums/ModCallbackCustom.ts +73 -20
  103. package/src/enums/StatType.ts +3 -3
  104. package/src/features/customGridEntity.ts +87 -61
  105. package/src/features/customStage/customStageGridEntities.ts +36 -23
  106. package/src/features/customStage/customStageUtils.ts +52 -1
  107. package/src/features/customStage/exports.ts +33 -45
  108. package/src/features/customStage/init.ts +1 -1
  109. package/src/features/customStage/v.ts +0 -6
  110. package/src/features/customStage/versusScreen.ts +70 -55
  111. package/src/features/customTrapdoor/exports.ts +60 -66
  112. package/src/features/customTrapdoor/init.ts +12 -11
  113. package/src/features/customTrapdoor/spawn.ts +54 -0
  114. package/src/features/customTrapdoor/v.ts +2 -2
  115. package/src/functions/dev.ts +31 -0
  116. package/src/functions/doors.ts +37 -21
  117. package/src/functions/enums.ts +3 -3
  118. package/src/functions/playerStats.ts +1 -0
  119. package/src/functions/players.ts +7 -3
  120. package/src/functions/rooms.ts +18 -0
  121. package/src/index.ts +207 -9
  122. package/src/interfaces/{CustomStageLua.ts → CustomStageTSConfig.ts} +107 -41
  123. package/src/interfaces/JSONRoomsFile.ts +6 -5
  124. package/src/interfaces/StatTypeType.ts +1 -0
  125. package/src/interfaces/private/AddCallbackParameterCustom.ts +6 -0
  126. package/src/interfaces/private/CustomStage.ts +4 -1
  127. package/src/interfaces/private/CustomTrapdoorDescription.ts +2 -2
  128. package/src/interfaces/private/CustomTrapdoorDestination.ts +14 -0
  129. package/src/objects/callbackRegisterFunctions.ts +9 -0
  130. package/src/types/PossibleStatType.ts +12 -0
  131. package/dist/classes/index.d.ts +0 -3
  132. package/dist/classes/index.d.ts.map +0 -1
  133. package/dist/classes/index.lua +0 -18
  134. package/dist/core/index.d.ts +0 -5
  135. package/dist/core/index.d.ts.map +0 -1
  136. package/dist/core/index.lua +0 -34
  137. package/dist/enums/DecorationVariant.d.ts +0 -10
  138. package/dist/enums/DecorationVariant.d.ts.map +0 -1
  139. package/dist/enums/DecorationVariant.lua +0 -7
  140. package/dist/enums/index.d.ts +0 -11
  141. package/dist/enums/index.d.ts.map +0 -1
  142. package/dist/enums/index.lua +0 -82
  143. package/dist/features/index.d.ts +0 -30
  144. package/dist/features/index.d.ts.map +0 -1
  145. package/dist/features/index.lua +0 -216
  146. package/dist/functions/index.d.ts +0 -100
  147. package/dist/functions/index.d.ts.map +0 -1
  148. package/dist/functions/index.lua +0 -794
  149. package/dist/interfaces/CustomStageLua.d.ts.map +0 -1
  150. package/dist/interfaces/index.d.ts +0 -12
  151. package/dist/interfaces/index.d.ts.map +0 -1
  152. package/dist/maps/index.d.ts +0 -5
  153. package/dist/maps/index.d.ts.map +0 -1
  154. package/dist/maps/index.lua +0 -34
  155. package/dist/objects/index.d.ts +0 -2
  156. package/dist/objects/index.d.ts.map +0 -1
  157. package/dist/objects/index.lua +0 -10
  158. package/dist/types/TrapdoorDestination.d.ts +0 -6
  159. package/dist/types/TrapdoorDestination.d.ts.map +0 -1
  160. package/dist/types/index.d.ts +0 -11
  161. package/dist/types/index.d.ts.map +0 -1
  162. package/dist/types/index.lua +0 -10
  163. package/src/classes/index.ts +0 -2
  164. package/src/classes/indexTypeDoc.ts +0 -2
  165. package/src/core/index.ts +0 -4
  166. package/src/core/indexTypeDoc.ts +0 -4
  167. package/src/enums/DecorationVariant.ts +0 -10
  168. package/src/enums/index.ts +0 -10
  169. package/src/enums/indexTypeDoc.ts +0 -10
  170. package/src/features/index.ts +0 -59
  171. package/src/features/indexTypeDoc.ts +0 -30
  172. package/src/functions/index.ts +0 -101
  173. package/src/functions/indexTypeDoc.ts +0 -101
  174. package/src/indexTypeDoc.ts +0 -13
  175. package/src/interfaces/index.ts +0 -11
  176. package/src/interfaces/indexTypeDoc.ts +0 -11
  177. package/src/maps/index.ts +0 -4
  178. package/src/maps/indexTypeDoc.ts +0 -4
  179. package/src/objects/index.ts +0 -1
  180. package/src/objects/indexTypeDoc.ts +0 -1
  181. package/src/types/TrapdoorDestination.ts +0 -8
  182. package/src/types/index.ts +0 -10
  183. package/src/types/indexTypeDoc.ts +0 -10
@@ -1,8 +1,8 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local Map = ____lualib.Map
3
2
  local __TS__ArraySome = ____lualib.__TS__ArraySome
3
+ local __TS__ArrayFind = ____lualib.__TS__ArrayFind
4
4
  local ____exports = {}
5
- local willVanillaVersusScreenPlay, getPlayerPNGPaths, getBossPNGPaths, DEFAULT_CHARACTER, PNG_PATH_PREFIX, PLAYER_PORTRAIT_PNG_PATH_PREFIX
5
+ local willVanillaVersusScreenPlay, getPlayerPNGPaths, getBossPNGPaths, getBossPNGPathsCustom, DEFAULT_CHARACTER, PNG_PATH_PREFIX, PLAYER_PORTRAIT_PNG_PATH_PREFIX
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local BossID = ____isaac_2Dtypescript_2Ddefinitions.BossID
8
8
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
@@ -17,8 +17,8 @@ local ____array = require("functions.array")
17
17
  local arrayRemove = ____array.arrayRemove
18
18
  local ____bosses = require("functions.bosses")
19
19
  local getBosses = ____bosses.getBosses
20
- local ____entities = require("functions.entities")
21
- local getEntityID = ____entities.getEntityID
20
+ local ____roomData = require("functions.roomData")
21
+ local getRoomSubType = ____roomData.getRoomSubType
22
22
  local ____utils = require("functions.utils")
23
23
  local erange = ____utils.erange
24
24
  local ____bossNamePNGFileNames = require("objects.bossNamePNGFileNames")
@@ -46,7 +46,6 @@ local DEFAULT_BASE_STAGE_TYPE = ____exports.DEFAULT_BASE_STAGE_TYPE
46
46
  local INVALID_STAGE_VALUE = ____exports.INVALID_STAGE_VALUE
47
47
  local ____v = require("features.customStage.v")
48
48
  local v = ____v.default
49
- local customBossPNGPaths = ____v.customBossPNGPaths
50
49
  function willVanillaVersusScreenPlay(self)
51
50
  local bosses = getBosses(nil)
52
51
  return __TS__ArraySome(
@@ -57,40 +56,51 @@ end
57
56
  function getPlayerPNGPaths(self)
58
57
  local player = Isaac.GetPlayer()
59
58
  local character = player:GetPlayerType()
60
- local playerNamePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[character]
61
- if playerNamePNGFileName == nil then
62
- playerNamePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[DEFAULT_CHARACTER]
59
+ local namePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[character]
60
+ if namePNGFileName == nil then
61
+ namePNGFileName = PLAYER_NAME_PNG_FILE_NAMES[DEFAULT_CHARACTER]
63
62
  end
64
- local playerNamePNGPath = (PNG_PATH_PREFIX .. "/") .. tostring(playerNamePNGFileName)
65
- local playerPortraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[character]
66
- if playerNamePNGFileName == nil then
67
- playerPortraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[DEFAULT_CHARACTER]
63
+ local namePNGPath = (PNG_PATH_PREFIX .. "/") .. tostring(namePNGFileName)
64
+ local portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[character]
65
+ if namePNGFileName == nil then
66
+ portraitFileName = PLAYER_PORTRAIT_PNG_FILE_NAMES[DEFAULT_CHARACTER]
68
67
  end
69
- local playerPortraitPNGPath = (PLAYER_PORTRAIT_PNG_PATH_PREFIX .. "/") .. tostring(playerPortraitFileName)
70
- return {playerNamePNGPath, playerPortraitPNGPath}
68
+ local portraitPNGPath = (PLAYER_PORTRAIT_PNG_PATH_PREFIX .. "/") .. tostring(portraitFileName)
69
+ return {namePNGPath = namePNGPath, portraitPNGPath = portraitPNGPath}
71
70
  end
72
- function getBossPNGPaths(self)
71
+ function getBossPNGPaths(self, customStage)
72
+ local paths = getBossPNGPathsCustom(nil, customStage)
73
+ if paths ~= nil then
74
+ return paths
75
+ end
73
76
  local bosses = getBosses(nil)
74
77
  local firstBoss = bosses[1]
75
- if firstBoss ~= nil then
76
- local entityID = getEntityID(nil, firstBoss)
77
- local pngPaths = customBossPNGPaths:get(entityID)
78
- if pngPaths ~= nil then
79
- return pngPaths
80
- end
81
- end
82
78
  local bossID = firstBoss == nil and 0 or firstBoss:GetBossID()
83
79
  if bossID == 0 then
84
80
  local questionMarkSprite = (PNG_PATH_PREFIX .. "/") .. BOSS_NAME_PNG_FILE_NAMES[BossID.BLUE_BABY]
85
- local bossNamePNGPath = questionMarkSprite
86
- local bossPortraitPNGPath = questionMarkSprite
87
- return {bossNamePNGPath, bossPortraitPNGPath}
88
- end
89
- local bossNamePNGFileName = BOSS_NAME_PNG_FILE_NAMES[bossID]
90
- local bossNamePNGPath = (PNG_PATH_PREFIX .. "/") .. bossNamePNGFileName
91
- local bossPortraitPNGFileName = BOSS_PORTRAIT_PNG_FILE_NAMES[bossID]
92
- local bossPortraitPNGPath = (PNG_PATH_PREFIX .. "/") .. bossPortraitPNGFileName
93
- return {bossNamePNGPath, bossPortraitPNGPath}
81
+ local namePNGPath = questionMarkSprite
82
+ local portraitPNGPath = questionMarkSprite
83
+ return {namePNGPath = namePNGPath, portraitPNGPath = portraitPNGPath}
84
+ end
85
+ local namePNGFileName = BOSS_NAME_PNG_FILE_NAMES[bossID]
86
+ local namePNGPath = (PNG_PATH_PREFIX .. "/") .. namePNGFileName
87
+ local portraitPNGFileName = BOSS_PORTRAIT_PNG_FILE_NAMES[bossID]
88
+ local portraitPNGPath = (PNG_PATH_PREFIX .. "/") .. portraitPNGFileName
89
+ return {namePNGPath = namePNGPath, portraitPNGPath = portraitPNGPath}
90
+ end
91
+ function getBossPNGPathsCustom(self, customStage)
92
+ if customStage.bossPool == nil then
93
+ return nil
94
+ end
95
+ local roomSubType = getRoomSubType(nil)
96
+ local matchingBossEntry = __TS__ArrayFind(
97
+ customStage.bossPool,
98
+ function(____, bossEntry) return bossEntry.subType == roomSubType end
99
+ )
100
+ if matchingBossEntry == nil then
101
+ return nil
102
+ end
103
+ return matchingBossEntry.versusScreen
94
104
  end
95
105
  DEFAULT_CHARACTER = PlayerType.ISAAC
96
106
  local DEFAULT_STAGE_ID = StageID.BASEMENT
@@ -164,37 +174,45 @@ function ____exports.playVersusScreenAnimation(self, customStage)
164
174
  v.run.showingBossVersusScreen = true
165
175
  pause(nil)
166
176
  hud:SetVisible(false)
167
- local playerNamePNGPath, playerPortraitPNGPath = table.unpack(getPlayerPNGPaths(nil))
168
- versusScreenSprite:ReplaceSpritesheet(PLAYER_NAME_ANM2_LAYER, playerNamePNGPath)
169
- versusScreenSprite:ReplaceSpritesheet(PLAYER_PORTRAIT_ANM2_LAYER, playerPortraitPNGPath)
170
- local bossNamePNGPath, bossPortraitPNGPath = table.unpack(getBossPNGPaths(nil))
171
- versusScreenSprite:ReplaceSpritesheet(BOSS_NAME_ANM2_LAYER, bossNamePNGPath)
172
- versusScreenSprite:ReplaceSpritesheet(BOSS_PORTRAIT_ANM2_LAYER, bossPortraitPNGPath)
177
+ do
178
+ local ____getPlayerPNGPaths_result_0 = getPlayerPNGPaths(nil)
179
+ local namePNGPath = ____getPlayerPNGPaths_result_0.namePNGPath
180
+ local portraitPNGPath = ____getPlayerPNGPaths_result_0.portraitPNGPath
181
+ versusScreenSprite:ReplaceSpritesheet(PLAYER_NAME_ANM2_LAYER, namePNGPath)
182
+ versusScreenSprite:ReplaceSpritesheet(PLAYER_PORTRAIT_ANM2_LAYER, portraitPNGPath)
183
+ end
184
+ do
185
+ local ____getBossPNGPaths_result_1 = getBossPNGPaths(nil, customStage)
186
+ local namePNGPath = ____getBossPNGPaths_result_1.namePNGPath
187
+ local portraitPNGPath = ____getBossPNGPaths_result_1.portraitPNGPath
188
+ versusScreenSprite:ReplaceSpritesheet(BOSS_NAME_ANM2_LAYER, namePNGPath)
189
+ versusScreenSprite:ReplaceSpritesheet(BOSS_PORTRAIT_ANM2_LAYER, portraitPNGPath)
190
+ end
173
191
  versusScreenSprite:LoadGraphics()
174
192
  local backgroundColor = VERSUS_SCREEN_BACKGROUND_COLORS[DEFAULT_STAGE_ID]
175
- local ____customStage_versusScreen_backgroundColor_0 = customStage.versusScreen
176
- if ____customStage_versusScreen_backgroundColor_0 ~= nil then
177
- ____customStage_versusScreen_backgroundColor_0 = ____customStage_versusScreen_backgroundColor_0.backgroundColor
178
- end
179
- if ____customStage_versusScreen_backgroundColor_0 ~= nil then
180
- local ____customStage_versusScreen_backgroundColor_2 = customStage.versusScreen.backgroundColor
181
- local r = ____customStage_versusScreen_backgroundColor_2.r
182
- local g = ____customStage_versusScreen_backgroundColor_2.g
183
- local b = ____customStage_versusScreen_backgroundColor_2.b
184
- local a = ____customStage_versusScreen_backgroundColor_2.a
193
+ local ____customStage_versusScreen_backgroundColor_2 = customStage.versusScreen
194
+ if ____customStage_versusScreen_backgroundColor_2 ~= nil then
195
+ ____customStage_versusScreen_backgroundColor_2 = ____customStage_versusScreen_backgroundColor_2.backgroundColor
196
+ end
197
+ if ____customStage_versusScreen_backgroundColor_2 ~= nil then
198
+ local ____customStage_versusScreen_backgroundColor_4 = customStage.versusScreen.backgroundColor
199
+ local r = ____customStage_versusScreen_backgroundColor_4.r
200
+ local g = ____customStage_versusScreen_backgroundColor_4.g
201
+ local b = ____customStage_versusScreen_backgroundColor_4.b
202
+ local a = ____customStage_versusScreen_backgroundColor_4.a
185
203
  backgroundColor = Color(r, g, b, a)
186
204
  end
187
205
  versusScreenBackgroundSprite.Color = backgroundColor
188
206
  local dirtSpotColor = VERSUS_SCREEN_DIRT_SPOT_COLORS[DEFAULT_STAGE_ID]
189
- local ____customStage_versusScreen_dirtSpotColor_3 = customStage.versusScreen
190
- if ____customStage_versusScreen_dirtSpotColor_3 ~= nil then
191
- ____customStage_versusScreen_dirtSpotColor_3 = ____customStage_versusScreen_dirtSpotColor_3.dirtSpotColor
192
- end
193
- if ____customStage_versusScreen_dirtSpotColor_3 ~= nil then
194
- local ____customStage_versusScreen_dirtSpotColor_5 = customStage.versusScreen.dirtSpotColor
195
- local r = ____customStage_versusScreen_dirtSpotColor_5.r
196
- local g = ____customStage_versusScreen_dirtSpotColor_5.g
197
- local b = ____customStage_versusScreen_dirtSpotColor_5.b
207
+ local ____customStage_versusScreen_dirtSpotColor_5 = customStage.versusScreen
208
+ if ____customStage_versusScreen_dirtSpotColor_5 ~= nil then
209
+ ____customStage_versusScreen_dirtSpotColor_5 = ____customStage_versusScreen_dirtSpotColor_5.dirtSpotColor
210
+ end
211
+ if ____customStage_versusScreen_dirtSpotColor_5 ~= nil then
212
+ local ____customStage_versusScreen_dirtSpotColor_7 = customStage.versusScreen.dirtSpotColor
213
+ local r = ____customStage_versusScreen_dirtSpotColor_7.r
214
+ local g = ____customStage_versusScreen_dirtSpotColor_7.g
215
+ local b = ____customStage_versusScreen_dirtSpotColor_7.b
198
216
  dirtSpotColor = Color(r, g, b)
199
217
  end
200
218
  versusScreenDirtSpotSprite.Color = dirtSpotColor
@@ -214,10 +232,6 @@ function ____exports.versusScreenPostRender(self)
214
232
  if not v.run.showingBossVersusScreen then
215
233
  return
216
234
  end
217
- local isPaused = game:IsPaused()
218
- if isPaused then
219
- return
220
- end
221
235
  if versusScreenSprite:IsFinished(VERSUS_SCREEN_ANIMATION_NAME) then
222
236
  finishVersusScreenAnimation(nil)
223
237
  return
@@ -1,33 +1,45 @@
1
- /// <reference types="isaac-typescript-definitions" />
2
- /// <reference types="isaac-typescript-definitions" />
3
- /// <reference types="isaac-typescript-definitions" />
4
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
1
+ import { LevelStage, StageType } from "isaac-typescript-definitions";
5
2
  /**
6
- * Helper function to spawn a trapdoor grid entity that will have one or more of the following
7
- * attributes:
3
+ * Helper function to spawn a trapdoor grid entity that will take a player to a custom stage. If you
4
+ * want to create a custom trapdoor that goes to a vanilla stage instead, use the
5
+ * `spawnCustomTrapdoorToVanilla` helper function.
6
+ *
7
+ * Custom trapdoors can have one or more of the following attributes:
8
8
  *
9
9
  * - custom destination (or custom logic for after the player enters)
10
10
  * - custom graphics
11
11
  * - custom logic for opening/closing
12
12
  *
13
- * You can use this function to take the player to your custom stage.
14
- *
15
13
  * Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
16
14
  * respawned every time the player re-enters the room.
17
15
  *
18
16
  * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
19
- * @param destination Optional. Used to specify where the player will go after jumping into the
20
- * trapdoor. Can either be a vanilla stage tuple, a custom stage tuple, or
21
- * undefined. For example, a destination of `[LevelStage.CAVES_1,
22
- * StageType.ORIGINAL]` corresponds to Caves 1, and a destination of
23
- * `["Slaughterhouse", 1]` corresponds to a custom stage of Slaughterhouse 1. If
24
- * the destination is undefined, then the "normal" destination corresponding to
25
- * the current stage and room will be used (e.g. the next floor, in most cases).
17
+ * @param customStageName The name of the custom stage.
18
+ * @param customStageFloorNum The floor of the custom stage. For most purposes, you should use 1 or
19
+ * 2.
20
+ * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
21
+ * of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
22
+ * have animations called "Opened", "Closed", and "Open Animation".
23
+ * @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
24
+ * behavior will be used that emulates a vanilla trapdoor.
25
+ */
26
+ export declare function spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, customStageName: string, customStageFloorNum: int, anm2Path?: string, spawnOpen?: boolean): GridEntity;
27
+ /**
28
+ * This is the same thing as the `spawnCustomTrapdoor` function, but instead of having a destination
29
+ * of a custom stage, it has a destination of a vanilla stage.
30
+ *
31
+ * For more information, see the `spawnCustomTrapdoor` function.
32
+ *
33
+ * @param gridIndexOrPosition The location in the room to spawn the trapdoor.
34
+ * @param stage Optional. The number of the vanilla stage to go to. If not provided, the "normal"
35
+ * next stage will be selected.
36
+ * @param stageType The stage type of the vanilla stage to go to. If not provided, the "normal" next
37
+ * stage type will be selected.
26
38
  * @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
27
39
  * of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
28
40
  * have animations called "Opened", "Closed", and "Open Animation".
29
41
  * @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
30
42
  * behavior will be used that emulates a vanilla trapdoor.
31
43
  */
32
- export declare function spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, destination?: TrapdoorDestination, anm2Path?: string, spawnOpen?: boolean): GridEntity;
44
+ export declare function spawnCustomTrapdoorToVanilla(gridIndexOrPosition: int | Vector, stage?: LevelStage, stageType?: StageType, anm2Path?: string, spawnOpen?: boolean): GridEntity;
33
45
  //# sourceMappingURL=exports.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":";;;AAYA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAStE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,WAAW,CAAC,EAAE,mBAAmB,EACjC,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAwCZ"}
1
+ {"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAOrE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,eAAe,EAAE,MAAM,EACvB,mBAAmB,EAAE,GAAG,EACxB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAcZ;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,4BAA4B,CAC1C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,EACrB,QAAQ,SAAmC,EAC3C,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAkBZ"}
@@ -1,94 +1,78 @@
1
- local ____lualib = require("lualib_bundle")
2
- local Map = ____lualib.Map
3
1
  local ____exports = {}
4
- local getDefaultDestination
5
- local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
- local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
7
- local ____cachedClasses = require("core.cachedClasses")
8
- local game = ____cachedClasses.game
9
- local ____TrapdoorAnimation = require("enums.private.TrapdoorAnimation")
10
- local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
11
2
  local ____featuresInitialized = require("featuresInitialized")
12
3
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
13
4
  local ____nextStage = require("functions.nextStage")
14
5
  local getNextStage = ____nextStage.getNextStage
15
6
  local getNextStageType = ____nextStage.getNextStageType
16
- local ____roomData = require("functions.roomData")
17
- local getRoomListIndex = ____roomData.getRoomListIndex
18
- local ____vector = require("functions.vector")
19
- local isVector = ____vector.isVector
20
- local ____customGridEntity = require("features.customGridEntity")
21
- local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
22
7
  local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
23
8
  local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
24
- local GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
25
- local ____openClose = require("features.customTrapdoor.openClose")
26
- local shouldTrapdoorSpawnOpen = ____openClose.shouldTrapdoorSpawnOpen
27
- local ____v = require("features.customTrapdoor.v")
28
- local v = ____v.default
29
- function getDefaultDestination(self)
30
- local nextStage = getNextStage(nil)
31
- local nextStageType = getNextStageType(nil)
32
- return {nextStage, nextStageType}
33
- end
34
- --- Helper function to spawn a trapdoor grid entity that will have one or more of the following
35
- -- attributes:
9
+ local ____spawn = require("features.customTrapdoor.spawn")
10
+ local spawnCustomTrapdoorToDestination = ____spawn.spawnCustomTrapdoorToDestination
11
+ --- Helper function to spawn a trapdoor grid entity that will take a player to a custom stage. If you
12
+ -- want to create a custom trapdoor that goes to a vanilla stage instead, use the
13
+ -- `spawnCustomTrapdoorToVanilla` helper function.
14
+ --
15
+ -- Custom trapdoors can have one or more of the following attributes:
36
16
  --
37
17
  -- - custom destination (or custom logic for after the player enters)
38
18
  -- - custom graphics
39
19
  -- - custom logic for opening/closing
40
20
  --
41
- -- You can use this function to take the player to your custom stage.
42
- --
43
21
  -- Under the hood, the custom trapdoor is represented by a decoration grid entity and is manually
44
22
  -- respawned every time the player re-enters the room.
45
23
  --
46
24
  -- @param gridIndexOrPosition The location in the room to spawn the trapdoor.
47
- -- @param destination Optional. Used to specify where the player will go after jumping into the
48
- -- trapdoor. Can either be a vanilla stage tuple, a custom stage tuple, or
49
- -- undefined. For example, a destination of `[LevelStage.CAVES_1,
50
- -- StageType.ORIGINAL]` corresponds to Caves 1, and a destination of
51
- -- `["Slaughterhouse", 1]` corresponds to a custom stage of Slaughterhouse 1. If
52
- -- the destination is undefined, then the "normal" destination corresponding to
53
- -- the current stage and room will be used (e.g. the next floor, in most cases).
25
+ -- @param customStageName The name of the custom stage.
26
+ -- @param customStageFloorNum The floor of the custom stage. For most purposes, you should use 1 or
27
+ -- 2.
54
28
  -- @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
55
29
  -- of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
56
30
  -- have animations called "Opened", "Closed", and "Open Animation".
57
31
  -- @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
58
32
  -- behavior will be used that emulates a vanilla trapdoor.
59
- function ____exports.spawnCustomTrapdoor(self, gridIndexOrPosition, destination, anm2Path, spawnOpen)
33
+ function ____exports.spawnCustomTrapdoor(self, gridIndexOrPosition, customStageName, customStageFloorNum, anm2Path, spawnOpen)
60
34
  if anm2Path == nil then
61
35
  anm2Path = "gfx/grid/door_11_trapdoor.anm2"
62
36
  end
63
37
  errorIfFeaturesNotInitialized(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
64
- local room = game:GetRoom()
65
- local roomFrameCount = room:GetFrameCount()
66
- local roomListIndex = getRoomListIndex(nil)
67
- local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
68
- local gridEntity = spawnCustomGridEntity(
38
+ local destination = {customStageName = customStageName, customStageFloorNum = customStageFloorNum}
39
+ return spawnCustomTrapdoorToDestination(
69
40
  nil,
70
- GridEntityTypeCustom.TRAPDOOR_CUSTOM,
71
41
  gridIndexOrPosition,
72
- GridCollisionClass.NONE,
42
+ destination,
73
43
  anm2Path,
74
- TrapdoorAnimation.OPENED
44
+ spawnOpen
75
45
  )
76
- local firstSpawn = roomFrameCount ~= 0
77
- local ____temp_0
78
- if spawnOpen == nil then
79
- ____temp_0 = shouldTrapdoorSpawnOpen(nil, gridEntity, firstSpawn)
80
- else
81
- ____temp_0 = spawnOpen
82
- end
83
- local open = ____temp_0
84
- local destinationToUse = destination == nil and getDefaultDestination(nil) or destination
85
- local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
86
- local customTrapdoorDescription = {open = open, destination = destinationToUse, firstSpawn = firstSpawn}
87
- roomTrapdoorMap:set(gridIndex, customTrapdoorDescription)
88
- if not open then
89
- local sprite = gridEntity:GetSprite()
90
- sprite:Play(TrapdoorAnimation.CLOSED, true)
46
+ end
47
+ --- This is the same thing as the `spawnCustomTrapdoor` function, but instead of having a destination
48
+ -- of a custom stage, it has a destination of a vanilla stage.
49
+ --
50
+ -- For more information, see the `spawnCustomTrapdoor` function.
51
+ --
52
+ -- @param gridIndexOrPosition The location in the room to spawn the trapdoor.
53
+ -- @param stage Optional. The number of the vanilla stage to go to. If not provided, the "normal"
54
+ -- next stage will be selected.
55
+ -- @param stageType The stage type of the vanilla stage to go to. If not provided, the "normal" next
56
+ -- stage type will be selected.
57
+ -- @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor anm2
58
+ -- of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file must
59
+ -- have animations called "Opened", "Closed", and "Open Animation".
60
+ -- @param spawnOpen Optional. Whether or not to spawn the trapdoor in an open state. By default,
61
+ -- behavior will be used that emulates a vanilla trapdoor.
62
+ function ____exports.spawnCustomTrapdoorToVanilla(self, gridIndexOrPosition, stage, stageType, anm2Path, spawnOpen)
63
+ if anm2Path == nil then
64
+ anm2Path = "gfx/grid/door_11_trapdoor.anm2"
91
65
  end
92
- return gridEntity
66
+ errorIfFeaturesNotInitialized(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
67
+ local vanillaStage = stage == nil and getNextStage(nil) or stage
68
+ local vanillaStageType = stageType == nil and getNextStageType(nil) or stageType
69
+ local destination = {vanillaStage = vanillaStage, vanillaStageType = vanillaStageType}
70
+ return spawnCustomTrapdoorToDestination(
71
+ nil,
72
+ gridIndexOrPosition,
73
+ destination,
74
+ anm2Path,
75
+ spawnOpen
76
+ )
93
77
  end
94
78
  return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AA0BxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAyBxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
@@ -2,7 +2,7 @@ local ____lualib = require("lualib_bundle")
2
2
  local __TS__ArraySome = ____lualib.__TS__ArraySome
3
3
  local Map = ____lualib.Map
4
4
  local ____exports = {}
5
- local postRender, checkAllPlayersJumpComplete, checkPixelationToBlackComplete, checkSecondPixelationHalfWay, checkAllPlayersLayingDownComplete, goToCustomDestination, anyPlayerPlayingExtraAnimation, postPEffectUpdate, checkJumpComplete, postGridEntityCustomUpdateTrapdoor
5
+ local postRender, checkAllPlayersJumpComplete, checkPixelationToBlackComplete, checkSecondPixelationHalfWay, checkAllPlayersLayingDownComplete, goToCustomTrapdoorDestination, anyPlayerPlayingExtraAnimation, postPEffectUpdate, checkJumpComplete, postGridEntityCustomUpdateTrapdoor
6
6
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
7
  local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
8
8
  local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
@@ -26,8 +26,6 @@ local ____roomTransition = require("functions.roomTransition")
26
26
  local teleport = ____roomTransition.teleport
27
27
  local ____stage = require("functions.stage")
28
28
  local setStage = ____stage.setStage
29
- local ____types = require("functions.types")
30
- local isString = ____types.isString
31
29
  local ____exports = require("features.customStage.exports")
32
30
  local disableCustomStage = ____exports.disableCustomStage
33
31
  local setCustomStage = ____exports.setCustomStage
@@ -93,7 +91,7 @@ function checkPixelationToBlackComplete(self)
93
91
  local futureRenderFrameCount = Isaac.GetFrameCount()
94
92
  v.run.state = StageTravelState.WAITING_FOR_SECOND_PIXELATION_TO_GET_HALF_WAY
95
93
  v.run.stateRenderFrame = futureRenderFrameCount
96
- goToCustomDestination(nil)
94
+ goToCustomTrapdoorDestination(nil)
97
95
  teleport(
98
96
  nil,
99
97
  startingRoomIndex,
@@ -145,17 +143,21 @@ function checkAllPlayersLayingDownComplete(self)
145
143
  v.run.state = StageTravelState.NONE
146
144
  enableAllInputs(nil, CUSTOM_TRAPDOOR_FEATURE_NAME)
147
145
  end
148
- function goToCustomDestination(self)
146
+ function goToCustomTrapdoorDestination(self)
149
147
  if v.run.destination == nil then
150
148
  return
151
149
  end
152
- local arg1, arg2 = table.unpack(v.run.destination)
153
- if isString(nil, arg1) then
154
- local firstFloor = arg2 == 1
150
+ local ____v_run_destination_0 = v.run.destination
151
+ local customStageName = ____v_run_destination_0.customStageName
152
+ local customStageFloorNum = ____v_run_destination_0.customStageFloorNum
153
+ local vanillaStage = ____v_run_destination_0.vanillaStage
154
+ local vanillaStageType = ____v_run_destination_0.vanillaStageType
155
+ if customStageName ~= nil and customStageFloorNum ~= nil then
156
+ local firstFloor = customStageFloorNum == 1
155
157
  setCustomStage(nil, "Slaughterhouse", firstFloor)
156
- else
158
+ elseif vanillaStage ~= nil and vanillaStageType ~= nil then
157
159
  disableCustomStage(nil)
158
- setStage(nil, arg1, arg2)
160
+ setStage(nil, vanillaStage, vanillaStageType)
159
161
  end
160
162
  end
161
163
  function anyPlayerPlayingExtraAnimation(self)
@@ -0,0 +1,6 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /// <reference types="isaac-typescript-definitions" />
3
+ /// <reference types="isaac-typescript-definitions" />
4
+ import { CustomTrapdoorDestination } from "../../interfaces/private/CustomTrapdoorDestination";
5
+ export declare function spawnCustomTrapdoorToDestination(gridIndexOrPosition: int | Vector, destination: CustomTrapdoorDestination, anm2Path: string, spawnOpen?: boolean): GridEntity;
6
+ //# sourceMappingURL=spawn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/spawn.ts"],"names":[],"mappings":";;;AAMA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAM/F,wBAAgB,gCAAgC,CAC9C,mBAAmB,EAAE,GAAG,GAAG,MAAM,EACjC,WAAW,EAAE,yBAAyB,EACtC,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,OAAO,GAClB,UAAU,CAoCZ"}
@@ -0,0 +1,52 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local ____exports = {}
4
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
5
+ local GridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.GridCollisionClass
6
+ local ____cachedClasses = require("core.cachedClasses")
7
+ local game = ____cachedClasses.game
8
+ local ____TrapdoorAnimation = require("enums.private.TrapdoorAnimation")
9
+ local TrapdoorAnimation = ____TrapdoorAnimation.TrapdoorAnimation
10
+ local ____roomData = require("functions.roomData")
11
+ local getRoomListIndex = ____roomData.getRoomListIndex
12
+ local ____vector = require("functions.vector")
13
+ local isVector = ____vector.isVector
14
+ local ____customGridEntity = require("features.customGridEntity")
15
+ local spawnCustomGridEntity = ____customGridEntity.spawnCustomGridEntity
16
+ local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
17
+ local GridEntityTypeCustom = ____customTrapdoorConstants.GridEntityTypeCustom
18
+ local ____openClose = require("features.customTrapdoor.openClose")
19
+ local shouldTrapdoorSpawnOpen = ____openClose.shouldTrapdoorSpawnOpen
20
+ local ____v = require("features.customTrapdoor.v")
21
+ local v = ____v.default
22
+ function ____exports.spawnCustomTrapdoorToDestination(self, gridIndexOrPosition, destination, anm2Path, spawnOpen)
23
+ local room = game:GetRoom()
24
+ local roomFrameCount = room:GetFrameCount()
25
+ local roomListIndex = getRoomListIndex(nil)
26
+ local gridIndex = isVector(nil, gridIndexOrPosition) and room:GetGridIndex(gridIndexOrPosition) or gridIndexOrPosition
27
+ local gridEntity = spawnCustomGridEntity(
28
+ nil,
29
+ GridEntityTypeCustom.TRAPDOOR_CUSTOM,
30
+ gridIndexOrPosition,
31
+ GridCollisionClass.NONE,
32
+ anm2Path,
33
+ TrapdoorAnimation.OPENED
34
+ )
35
+ local firstSpawn = roomFrameCount ~= 0
36
+ local ____temp_0
37
+ if spawnOpen == nil then
38
+ ____temp_0 = shouldTrapdoorSpawnOpen(nil, gridEntity, firstSpawn)
39
+ else
40
+ ____temp_0 = spawnOpen
41
+ end
42
+ local open = ____temp_0
43
+ local roomTrapdoorMap = v.level.trapdoors:getAndSetDefault(roomListIndex)
44
+ local customTrapdoorDescription = {open = open, destination = destination, firstSpawn = firstSpawn}
45
+ roomTrapdoorMap:set(gridIndex, customTrapdoorDescription)
46
+ if not open then
47
+ local sprite = gridEntity:GetSprite()
48
+ sprite:Play(TrapdoorAnimation.CLOSED, true)
49
+ end
50
+ return gridEntity
51
+ end
52
+ return ____exports
@@ -1,13 +1,13 @@
1
1
  import { DefaultMap } from "../../classes/DefaultMap";
2
2
  import { StageTravelState } from "../../enums/private/StageTravelState";
3
3
  import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
4
- import { TrapdoorDestination } from "../../types/TrapdoorDestination";
4
+ import { CustomTrapdoorDestination } from "../../interfaces/private/CustomTrapdoorDestination";
5
5
  declare const v: {
6
6
  run: {
7
7
  state: StageTravelState;
8
8
  /** The render frame that this state was reached. */
9
9
  stateRenderFrame: number | null;
10
- destination: TrapdoorDestination | null;
10
+ destination: CustomTrapdoorDestination | null;
11
11
  };
12
12
  level: {
13
13
  /** Indexed by room list index and grid index. */
@@ -1 +1 @@
1
- {"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,QAAA,MAAM,CAAC;;;QAIH,oDAAoD;;;;;QAOpD,iDAAiD;;;CAKpD,CAAC;AACF,eAAe,CAAC,CAAC"}
1
+ {"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAE/F,QAAA,MAAM,CAAC;;;QAIH,oDAAoD;;;;;QAOpD,iDAAiD;;;CAKpD,CAAC;AACF,eAAe,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ModUpgraded } from "../classes/ModUpgraded";
2
+ /**
3
+ * Helper function to enable some IsaacScript features that are useful when developing a mod. They
4
+ * shouldn't be enabled when your mod goes to production (i.e. it is uploaded to the Steam
5
+ * Workshop).
6
+ *
7
+ * The list of development features that are enabled are as follows:
8
+ *
9
+ * - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
10
+ * global variables so you can access them from the in-game console.
11
+ * - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
12
+ * from the in-game console.
13
+ * - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
14
+ * around easier (like e.g. `angel` to warp to the Angel Room).
15
+ * - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
16
+ * - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
17
+ * can immediately start playing or testing.
18
+ */
19
+ export declare function enableDevFeatures(mod: ModUpgraded): void;
20
+ //# sourceMappingURL=dev.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/functions/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAOrD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAMxD"}
@@ -0,0 +1,34 @@
1
+ local ____exports = {}
2
+ local ____exports = require("features.extraConsoleCommands.exports")
3
+ local enableExtraConsoleCommands = ____exports.enableExtraConsoleCommands
4
+ local ____fadeInRemover = require("features.fadeInRemover")
5
+ local removeFadeIn = ____fadeInRemover.removeFadeIn
6
+ local ____fastReset = require("features.fastReset")
7
+ local enableFastReset = ____fastReset.enableFastReset
8
+ local ____exports = require("features.saveDataManager.exports")
9
+ local saveDataManagerSetGlobal = ____exports.saveDataManagerSetGlobal
10
+ local ____log = require("functions.log")
11
+ local setLogFunctionsGlobal = ____log.setLogFunctionsGlobal
12
+ --- Helper function to enable some IsaacScript features that are useful when developing a mod. They
13
+ -- shouldn't be enabled when your mod goes to production (i.e. it is uploaded to the Steam
14
+ -- Workshop).
15
+ --
16
+ -- The list of development features that are enabled are as follows:
17
+ --
18
+ -- - `saveDataManagerSetGlobal` - Sets your local variables registered with the save data manager as
19
+ -- global variables so you can access them from the in-game console.
20
+ -- - `setLogFunctionsGlobal` - Sets the various log functions global so that you can access them
21
+ -- from the in-game console.
22
+ -- - `enableExtraConsoleCommands` - Enables many extra in-game console commands that make warping
23
+ -- around easier (like e.g. `angel` to warp to the Angel Room).
24
+ -- - `enableFastReset` - Makes it so that the r key resets the game instantaneously.
25
+ -- - `removeFadeIn` - Removes the slow fade in that occurs at the beginning of the run, so that you
26
+ -- can immediately start playing or testing.
27
+ function ____exports.enableDevFeatures(self, mod)
28
+ saveDataManagerSetGlobal(nil)
29
+ setLogFunctionsGlobal(nil)
30
+ enableExtraConsoleCommands(nil, mod)
31
+ enableFastReset(nil)
32
+ removeFadeIn(nil)
33
+ end
34
+ return ____exports