isaacscript-common 6.11.0 → 6.12.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 (253) hide show
  1. package/dist/callbacks/postFlip.lua +2 -2
  2. package/dist/callbacks/postGridEntityCustomRender.d.ts +2 -0
  3. package/dist/callbacks/postGridEntityCustomRender.d.ts.map +1 -0
  4. package/dist/callbacks/postGridEntityCustomRender.lua +36 -0
  5. package/dist/callbacks/postGridEntityCustomUpdate.d.ts +2 -0
  6. package/dist/callbacks/postGridEntityCustomUpdate.d.ts.map +1 -0
  7. package/dist/callbacks/postGridEntityCustomUpdate.lua +36 -0
  8. package/dist/callbacks/postNewRoomEarly.lua +2 -2
  9. package/dist/callbacks/postPickupInitFirst.lua +1 -20
  10. package/dist/callbacks/postPlayerFatalDamage.lua +1 -1
  11. package/dist/callbacks/postPlayerInitFirst.d.ts +2 -0
  12. package/dist/callbacks/postPlayerInitFirst.d.ts.map +1 -0
  13. package/dist/callbacks/postPlayerInitFirst.lua +42 -0
  14. package/dist/callbacks/postPlayerInitLate.lua +5 -5
  15. package/dist/callbacks/postPlayerReorderedCallbacks.d.ts +2 -0
  16. package/dist/callbacks/postPlayerReorderedCallbacks.d.ts.map +1 -0
  17. package/dist/callbacks/{postPlayerReordered.lua → postPlayerReorderedCallbacks.lua} +11 -37
  18. package/dist/callbacks/reorderedCallbacks.d.ts +5 -5
  19. package/dist/callbacks/reorderedCallbacks.d.ts.map +1 -1
  20. package/dist/callbacks/reorderedCallbacks.lua +5 -5
  21. package/dist/callbacks/subscriptions/postFirstFlip.d.ts +1 -1
  22. package/dist/callbacks/subscriptions/postFirstFlip.d.ts.map +1 -1
  23. package/dist/callbacks/subscriptions/postFirstFlip.lua +2 -2
  24. package/dist/callbacks/subscriptions/postFlip.d.ts +1 -1
  25. package/dist/callbacks/subscriptions/postFlip.d.ts.map +1 -1
  26. package/dist/callbacks/subscriptions/postFlip.lua +2 -2
  27. package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts +6 -0
  28. package/dist/callbacks/subscriptions/postGridEntityCustomRender.d.ts.map +1 -0
  29. package/dist/callbacks/subscriptions/postGridEntityCustomRender.lua +29 -0
  30. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts +6 -0
  31. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.d.ts.map +1 -0
  32. package/dist/callbacks/subscriptions/postGridEntityCustomUpdate.lua +29 -0
  33. package/dist/callbacks/subscriptions/{postPlayerInitReordered.d.ts → postPlayerInitFirst.d.ts} +2 -2
  34. package/dist/callbacks/subscriptions/postPlayerInitFirst.d.ts.map +1 -0
  35. package/dist/callbacks/subscriptions/{postPlayerInitReordered.lua → postPlayerInitFirst.lua} +3 -3
  36. package/dist/constants.d.ts +1 -5
  37. package/dist/constants.d.ts.map +1 -1
  38. package/dist/constants.lua +0 -7
  39. package/dist/constantsFirstLast.d.ts +5 -1
  40. package/dist/constantsFirstLast.d.ts.map +1 -1
  41. package/dist/constantsFirstLast.lua +6 -0
  42. package/dist/enums/ModCallbackCustom.d.ts +106 -81
  43. package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
  44. package/dist/enums/ModCallbackCustom.lua +63 -59
  45. package/dist/enums/private/StageTravelState.d.ts +9 -0
  46. package/dist/enums/private/StageTravelState.d.ts.map +1 -0
  47. package/dist/enums/private/StageTravelState.lua +15 -0
  48. package/dist/enums/private/TrapdoorAnimation.d.ts +6 -0
  49. package/dist/enums/private/TrapdoorAnimation.d.ts.map +1 -0
  50. package/dist/enums/private/TrapdoorAnimation.lua +6 -0
  51. package/dist/features/customGridEntity.d.ts +17 -5
  52. package/dist/features/customGridEntity.d.ts.map +1 -1
  53. package/dist/features/customGridEntity.lua +86 -17
  54. package/dist/features/customStage/exports.d.ts.map +1 -1
  55. package/dist/features/customStage/exports.lua +0 -13
  56. package/dist/features/customStage/init.d.ts.map +1 -1
  57. package/dist/features/customStage/init.lua +24 -2
  58. package/dist/features/customStage/streakText.d.ts +6 -0
  59. package/dist/features/customStage/streakText.d.ts.map +1 -1
  60. package/dist/features/customStage/streakText.lua +16 -12
  61. package/dist/features/customStage/versusScreen.d.ts +6 -0
  62. package/dist/features/customStage/versusScreen.d.ts.map +1 -1
  63. package/dist/features/customStage/versusScreen.lua +10 -5
  64. package/dist/features/customTrapdoor/blackSprite.d.ts +2 -0
  65. package/dist/features/customTrapdoor/blackSprite.d.ts.map +1 -0
  66. package/dist/features/customTrapdoor/blackSprite.lua +19 -0
  67. package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts +15 -0
  68. package/dist/features/customTrapdoor/customTrapdoorConstants.d.ts.map +1 -0
  69. package/dist/features/customTrapdoor/customTrapdoorConstants.lua +16 -0
  70. package/dist/features/customTrapdoor/exports.d.ts +29 -0
  71. package/dist/features/customTrapdoor/exports.d.ts.map +1 -0
  72. package/dist/features/customTrapdoor/exports.lua +93 -0
  73. package/dist/features/customTrapdoor/init.d.ts +3 -0
  74. package/dist/features/customTrapdoor/init.d.ts.map +1 -0
  75. package/dist/features/customTrapdoor/init.lua +174 -0
  76. package/dist/features/customTrapdoor/openClose.d.ts +5 -0
  77. package/dist/features/customTrapdoor/openClose.d.ts.map +1 -0
  78. package/dist/features/customTrapdoor/openClose.lua +60 -0
  79. package/dist/features/customTrapdoor/touched.d.ts +4 -0
  80. package/dist/features/customTrapdoor/touched.d.ts.map +1 -0
  81. package/dist/features/customTrapdoor/touched.lua +159 -0
  82. package/dist/features/customTrapdoor/v.d.ts +18 -0
  83. package/dist/features/customTrapdoor/v.d.ts.map +1 -0
  84. package/dist/features/customTrapdoor/v.lua +17 -0
  85. package/dist/features/deployJSONRoom.d.ts +2 -2
  86. package/dist/features/deployJSONRoom.d.ts.map +1 -1
  87. package/dist/features/deployJSONRoom.lua +3 -3
  88. package/dist/features/extraConsoleCommands/init.d.ts.map +1 -1
  89. package/dist/features/extraConsoleCommands/init.lua +3 -1
  90. package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
  91. package/dist/features/extraConsoleCommands/listCommands.lua +6 -6
  92. package/dist/features/pause.d.ts +1 -1
  93. package/dist/features/pause.d.ts.map +1 -1
  94. package/dist/features/pause.lua +87 -8
  95. package/dist/features/persistentEntities.d.ts.map +1 -1
  96. package/dist/features/persistentEntities.lua +7 -7
  97. package/dist/features/pickupIndex.d.ts +19 -0
  98. package/dist/features/pickupIndex.d.ts.map +1 -0
  99. package/dist/features/pickupIndex.lua +197 -0
  100. package/dist/features/roomHistory.d.ts +24 -0
  101. package/dist/features/roomHistory.d.ts.map +1 -0
  102. package/dist/features/roomHistory.lua +89 -0
  103. package/dist/features/taintedLazarusPlayers.d.ts.map +1 -1
  104. package/dist/features/taintedLazarusPlayers.lua +13 -21
  105. package/dist/functions/{character.d.ts → characters.d.ts} +3 -1
  106. package/dist/functions/characters.d.ts.map +1 -0
  107. package/dist/functions/{character.lua → characters.lua} +12 -0
  108. package/dist/functions/collectibles.d.ts +26 -13
  109. package/dist/functions/collectibles.d.ts.map +1 -1
  110. package/dist/functions/collectibles.lua +26 -13
  111. package/dist/functions/entities.d.ts +3 -3
  112. package/dist/functions/entities.d.ts.map +1 -1
  113. package/dist/functions/entities.lua +8 -3
  114. package/dist/functions/gridEntities.d.ts +2 -2
  115. package/dist/functions/gridEntities.lua +2 -2
  116. package/dist/functions/isaacAPIClass.d.ts +64 -0
  117. package/dist/functions/isaacAPIClass.d.ts.map +1 -1
  118. package/dist/functions/isaacAPIClass.lua +84 -1
  119. package/dist/functions/log.lua +3 -3
  120. package/dist/functions/pickupVariants.d.ts +2 -2
  121. package/dist/functions/pickupVariants.d.ts.map +1 -1
  122. package/dist/functions/pickupVariants.lua +2 -2
  123. package/dist/functions/playerCenter.lua +2 -2
  124. package/dist/functions/playerIndex.d.ts +11 -5
  125. package/dist/functions/playerIndex.d.ts.map +1 -1
  126. package/dist/functions/playerIndex.lua +19 -26
  127. package/dist/functions/players.lua +4 -4
  128. package/dist/functions/revive.lua +2 -2
  129. package/dist/functions/roomData.d.ts +3 -2
  130. package/dist/functions/roomData.d.ts.map +1 -1
  131. package/dist/functions/roomData.lua +3 -2
  132. package/dist/functions/rooms.d.ts +6 -6
  133. package/dist/functions/rooms.lua +6 -6
  134. package/dist/functions/stage.d.ts +1 -0
  135. package/dist/functions/stage.d.ts.map +1 -1
  136. package/dist/functions/stage.lua +4 -0
  137. package/dist/functions/table.d.ts +1 -1
  138. package/dist/functions/table.d.ts.map +1 -1
  139. package/dist/index.d.ts +6 -2
  140. package/dist/index.d.ts.map +1 -1
  141. package/dist/index.lua +33 -2
  142. package/dist/initCustomCallbacks.d.ts.map +1 -1
  143. package/dist/initCustomCallbacks.lua +11 -2
  144. package/dist/initFeatures.d.ts +1 -2
  145. package/dist/initFeatures.d.ts.map +1 -1
  146. package/dist/initFeatures.lua +16 -2
  147. package/dist/interfaces/AddCallbackParameterCustom.d.ts +6 -2
  148. package/dist/interfaces/AddCallbackParameterCustom.d.ts.map +1 -1
  149. package/dist/interfaces/CustomGridEntityData.d.ts +6 -2
  150. package/dist/interfaces/CustomGridEntityData.d.ts.map +1 -1
  151. package/dist/interfaces/RoomDescription.d.ts +14 -0
  152. package/dist/interfaces/RoomDescription.d.ts.map +1 -0
  153. package/dist/interfaces/RoomDescription.lua +2 -0
  154. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +7 -0
  155. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -0
  156. package/dist/interfaces/private/CustomTrapdoorDescription.lua +2 -0
  157. package/dist/lib/jsonLua.lua +2 -0
  158. package/dist/objects/callbackRegisterFunctions.d.ts.map +1 -1
  159. package/dist/objects/callbackRegisterFunctions.lua +9 -3
  160. package/dist/objects/characterDamageMultipliers.d.ts +6 -0
  161. package/dist/objects/characterDamageMultipliers.d.ts.map +1 -0
  162. package/dist/objects/characterDamageMultipliers.lua +49 -0
  163. package/dist/types/CollectibleIndex.d.ts +1 -1
  164. package/dist/types/PickupIndex.d.ts +17 -0
  165. package/dist/types/PickupIndex.d.ts.map +1 -0
  166. package/dist/types/PickupIndex.lua +2 -0
  167. package/dist/types/PlayerIndex.d.ts +1 -1
  168. package/dist/upgradeMod.lua +2 -4
  169. package/package.json +2 -2
  170. package/src/callbacks/customRevive.ts +3 -3
  171. package/src/callbacks/itemPickup.ts +3 -3
  172. package/src/callbacks/postAmbush.ts +3 -3
  173. package/src/callbacks/postEsauJr.ts +3 -3
  174. package/src/callbacks/postFlip.ts +6 -5
  175. package/src/callbacks/postGridEntity.ts +5 -5
  176. package/src/callbacks/postGridEntityCustomRender.ts +44 -0
  177. package/src/callbacks/postGridEntityCustomUpdate.ts +44 -0
  178. package/src/callbacks/postNewRoomEarly.ts +2 -2
  179. package/src/callbacks/postPickupInitFirst.ts +1 -32
  180. package/src/callbacks/postPlayerCollectible.ts +2 -2
  181. package/src/callbacks/postPlayerFatalDamage.ts +5 -0
  182. package/src/callbacks/postPlayerInitFirst.ts +57 -0
  183. package/src/callbacks/postPlayerInitLate.ts +9 -5
  184. package/src/callbacks/{postPlayerReordered.ts → postPlayerReorderedCallbacks.ts} +12 -32
  185. package/src/callbacks/postSlotInitUpdate.ts +5 -2
  186. package/src/callbacks/postSlotRender.ts +2 -2
  187. package/src/callbacks/reorderedCallbacks.ts +10 -9
  188. package/src/callbacks/subscriptions/postFirstFlip.ts +6 -3
  189. package/src/callbacks/subscriptions/postFlip.ts +6 -3
  190. package/src/callbacks/subscriptions/postGridEntityCustomRender.ts +41 -0
  191. package/src/callbacks/subscriptions/postGridEntityCustomUpdate.ts +41 -0
  192. package/src/callbacks/subscriptions/{postPlayerInitReordered.ts → postPlayerInitFirst.ts} +6 -6
  193. package/src/constants.ts +1 -9
  194. package/src/constantsFirstLast.ts +16 -0
  195. package/src/enums/ModCallbackCustom.ts +52 -25
  196. package/src/enums/private/StageTravelState.ts +8 -0
  197. package/src/enums/private/TrapdoorAnimation.ts +5 -0
  198. package/src/features/customGridEntity.ts +118 -12
  199. package/src/features/customStage/exports.ts +3 -22
  200. package/src/features/customStage/init.ts +30 -1
  201. package/src/features/customStage/streakText.ts +13 -5
  202. package/src/features/customStage/versusScreen.ts +20 -12
  203. package/src/features/customTrapdoor/blackSprite.ts +16 -0
  204. package/src/features/customTrapdoor/customTrapdoorConstants.ts +23 -0
  205. package/src/features/customTrapdoor/exports.ts +99 -0
  206. package/src/features/customTrapdoor/init.ts +217 -0
  207. package/src/features/customTrapdoor/openClose.ts +103 -0
  208. package/src/features/customTrapdoor/touched.ts +195 -0
  209. package/src/features/customTrapdoor/v.ts +26 -0
  210. package/src/features/deployJSONRoom.ts +10 -5
  211. package/src/features/extraConsoleCommands/init.ts +5 -2
  212. package/src/features/extraConsoleCommands/listCommands.ts +6 -8
  213. package/src/features/pause.ts +97 -7
  214. package/src/features/persistentEntities.ts +9 -8
  215. package/src/features/pickupIndex.ts +257 -0
  216. package/src/features/playerInventory.ts +2 -2
  217. package/src/features/roomHistory.ts +113 -0
  218. package/src/features/saveDataManager/main.ts +3 -3
  219. package/src/features/taintedLazarusPlayers.ts +37 -36
  220. package/src/functions/{character.ts → characters.ts} +13 -0
  221. package/src/functions/collectibles.ts +26 -13
  222. package/src/functions/deepCopy.ts +2 -2
  223. package/src/functions/entities.ts +7 -4
  224. package/src/functions/gridEntities.ts +2 -2
  225. package/src/functions/isaacAPIClass.ts +106 -1
  226. package/src/functions/pickupVariants.ts +2 -2
  227. package/src/functions/playerCenter.ts +2 -2
  228. package/src/functions/playerIndex.ts +26 -23
  229. package/src/functions/players.ts +1 -1
  230. package/src/functions/revive.ts +1 -1
  231. package/src/functions/rng.ts +1 -1
  232. package/src/functions/roomData.ts +3 -2
  233. package/src/functions/rooms.ts +6 -6
  234. package/src/functions/stage.ts +10 -1
  235. package/src/functions/table.ts +2 -2
  236. package/src/index.ts +9 -2
  237. package/src/initCustomCallbacks.ts +7 -1
  238. package/src/initFeatures.ts +13 -2
  239. package/src/interfaces/AddCallbackParameterCustom.ts +6 -2
  240. package/src/interfaces/CustomGridEntityData.ts +7 -2
  241. package/src/interfaces/RoomDescription.ts +19 -0
  242. package/src/interfaces/private/CustomTrapdoorDescription.ts +7 -0
  243. package/src/lib/jsonLua.lua +2 -0
  244. package/src/objects/callbackRegisterFunctions.ts +8 -3
  245. package/src/objects/characterDamageMultipliers.ts +49 -0
  246. package/src/types/CollectibleIndex.ts +1 -1
  247. package/src/types/PickupIndex.ts +15 -0
  248. package/src/types/PlayerIndex.ts +1 -1
  249. package/src/upgradeMod.ts +4 -4
  250. package/dist/callbacks/postPlayerReordered.d.ts +0 -2
  251. package/dist/callbacks/postPlayerReordered.d.ts.map +0 -1
  252. package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts.map +0 -1
  253. package/dist/functions/character.d.ts.map +0 -1
@@ -0,0 +1,159 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Set = ____lualib.Set
3
+ local __TS__New = ____lualib.__TS__New
4
+ local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
5
+ local ____exports = {}
6
+ local canPlayerInteractWithTrapdoor, playerTouchedCustomTrapdoor, setPlayerAttributes, dropTaintedForgotten, startDelayedJump, adjustPlayerPositionToTrapdoor
7
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
+ local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
9
+ local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
10
+ local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
11
+ local EntityPartition = ____isaac_2Dtypescript_2Ddefinitions.EntityPartition
12
+ local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
13
+ local ____constants = require("constants")
14
+ local VectorZero = ____constants.VectorZero
15
+ local ____StageTravelState = require("enums.private.StageTravelState")
16
+ local StageTravelState = ____StageTravelState.StageTravelState
17
+ local ____easing = require("functions.easing")
18
+ local easeOutSine = ____easing.easeOutSine
19
+ local ____playerIndex = require("functions.playerIndex")
20
+ local getAllPlayers = ____playerIndex.getAllPlayers
21
+ local getOtherPlayers = ____playerIndex.getOtherPlayers
22
+ local isChildPlayer = ____playerIndex.isChildPlayer
23
+ local ____players = require("functions.players")
24
+ local isCharacter = ____players.isCharacter
25
+ local ____disableInputs = require("features.disableInputs")
26
+ local disableAllInputsExceptFor = ____disableInputs.disableAllInputsExceptFor
27
+ local ____ponyDetection = require("features.ponyDetection")
28
+ local isPlayerUsingPony = ____ponyDetection.isPlayerUsingPony
29
+ local ____runInNFrames = require("features.runInNFrames")
30
+ local runInNGameFrames = ____runInNFrames.runInNGameFrames
31
+ local runNextRenderFrame = ____runInNFrames.runNextRenderFrame
32
+ local ____customTrapdoorConstants = require("features.customTrapdoor.customTrapdoorConstants")
33
+ local ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL = ____customTrapdoorConstants.ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL
34
+ local CUSTOM_TRAPDOOR_FEATURE_NAME = ____customTrapdoorConstants.CUSTOM_TRAPDOOR_FEATURE_NAME
35
+ local OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES = ____customTrapdoorConstants.OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES
36
+ local OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES = ____customTrapdoorConstants.OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES
37
+ local TRAPDOOR_TOUCH_DISTANCE = ____customTrapdoorConstants.TRAPDOOR_TOUCH_DISTANCE
38
+ local ____v = require("features.customTrapdoor.v")
39
+ local v = ____v.default
40
+ function canPlayerInteractWithTrapdoor(self, player)
41
+ local sprite = player:GetSprite()
42
+ local animation = sprite:GetAnimation()
43
+ return not player:IsHoldingItem() and not ANIMATIONS_THAT_PREVENT_STAGE_TRAVEL:has(animation)
44
+ end
45
+ function playerTouchedCustomTrapdoor(self, gridEntity, trapdoorDescription, player)
46
+ v.run.state = StageTravelState.PLAYERS_JUMPING_DOWN
47
+ v.run.destination = trapdoorDescription.destination
48
+ local whitelist = __TS__New(Set, {ButtonAction.CONSOLE})
49
+ disableAllInputsExceptFor(nil, CUSTOM_TRAPDOOR_FEATURE_NAME, whitelist)
50
+ setPlayerAttributes(nil, player, gridEntity.Position)
51
+ dropTaintedForgotten(nil, player)
52
+ player:PlayExtraAnimation("Trapdoor")
53
+ local otherPlayers = getOtherPlayers(nil, player)
54
+ __TS__ArrayForEach(
55
+ otherPlayers,
56
+ function(____, otherPlayer, i)
57
+ local gameFramesToWaitBeforeJumping = OTHER_PLAYER_TRAPDOOR_JUMP_DELAY_GAME_FRAMES * (i + 1)
58
+ local otherPlayerPtr = EntityPtr(otherPlayer)
59
+ runInNGameFrames(
60
+ nil,
61
+ function()
62
+ startDelayedJump(nil, otherPlayerPtr, gridEntity.Position)
63
+ end,
64
+ gameFramesToWaitBeforeJumping
65
+ )
66
+ end
67
+ )
68
+ end
69
+ function setPlayerAttributes(self, trapdoorPlayer, position)
70
+ trapdoorPlayer.Position = position
71
+ for ____, player in ipairs(getAllPlayers(nil)) do
72
+ player.ControlsEnabled = false
73
+ player.Velocity = VectorZero
74
+ player.EntityCollisionClass = EntityCollisionClass.NONE
75
+ player.GridCollisionClass = EntityGridCollisionClass.NONE
76
+ player.SubType = -1
77
+ end
78
+ end
79
+ function dropTaintedForgotten(self, player)
80
+ if isCharacter(nil, player, PlayerType.THE_FORGOTTEN_B) then
81
+ local taintedSoul = player:GetOtherTwin()
82
+ if taintedSoul ~= nil then
83
+ taintedSoul:ThrowHeldEntity(VectorZero)
84
+ end
85
+ end
86
+ end
87
+ function startDelayedJump(self, entityPtr, trapdoorPosition)
88
+ local entity = entityPtr.Ref
89
+ if entity == nil then
90
+ return
91
+ end
92
+ local player = entity:ToPlayer()
93
+ if player == nil then
94
+ return
95
+ end
96
+ player:PlayExtraAnimation("Trapdoor")
97
+ adjustPlayerPositionToTrapdoor(nil, entityPtr, player.Position, trapdoorPosition)
98
+ end
99
+ function adjustPlayerPositionToTrapdoor(self, entityPtr, startPos, endPos)
100
+ if v.run.state ~= StageTravelState.PLAYERS_JUMPING_DOWN then
101
+ return
102
+ end
103
+ local entity = entityPtr.Ref
104
+ if entity == nil then
105
+ return
106
+ end
107
+ local player = entity:ToPlayer()
108
+ if player == nil then
109
+ return
110
+ end
111
+ runNextRenderFrame(
112
+ nil,
113
+ function()
114
+ adjustPlayerPositionToTrapdoor(nil, entityPtr, startPos, endPos)
115
+ end
116
+ )
117
+ local sprite = player:GetSprite()
118
+ if sprite:IsFinished("Trapdoor") then
119
+ player.Position = endPos
120
+ player.Velocity = VectorZero
121
+ return
122
+ end
123
+ local frame = sprite:GetFrame()
124
+ if frame >= OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES then
125
+ player.Position = endPos
126
+ player.Velocity = VectorZero
127
+ return
128
+ end
129
+ local totalDifference = endPos - startPos
130
+ local progress = frame / OTHER_PLAYER_TRAPDOOR_JUMP_DURATION_GAME_FRAMES
131
+ local easeProgress = easeOutSine(nil, progress)
132
+ local differenceForThisFrame = totalDifference * easeProgress
133
+ local targetPosition = startPos + differenceForThisFrame
134
+ player.Position = targetPosition
135
+ player.Velocity = VectorZero
136
+ end
137
+ function ____exports.checkCustomTrapdoorPlayerTouched(self, gridEntity, trapdoorDescription)
138
+ if v.run.state ~= StageTravelState.NONE then
139
+ return
140
+ end
141
+ if not trapdoorDescription.open then
142
+ return
143
+ end
144
+ local playersTouching = Isaac.FindInRadius(gridEntity.Position, TRAPDOOR_TOUCH_DISTANCE, EntityPartition.PLAYER)
145
+ for ____, playerEntity in ipairs(playersTouching) do
146
+ do
147
+ local player = playerEntity:ToPlayer()
148
+ if player == nil then
149
+ goto __continue5
150
+ end
151
+ if not isPlayerUsingPony(nil, player) and not isChildPlayer(nil, player) and canPlayerInteractWithTrapdoor(nil, player) then
152
+ playerTouchedCustomTrapdoor(nil, gridEntity, trapdoorDescription, player)
153
+ return
154
+ end
155
+ end
156
+ ::__continue5::
157
+ end
158
+ end
159
+ return ____exports
@@ -0,0 +1,18 @@
1
+ import { LevelStage, StageType } from "isaac-typescript-definitions";
2
+ import { DefaultMap } from "../../classes/DefaultMap";
3
+ import { StageTravelState } from "../../enums/private/StageTravelState";
4
+ import { CustomTrapdoorDescription } from "../../interfaces/private/CustomTrapdoorDescription";
5
+ declare const v: {
6
+ run: {
7
+ state: StageTravelState;
8
+ /** The render frame that this state was reached. */
9
+ stateRenderFrame: number | null;
10
+ destination: string | [stage: LevelStage, stageType: StageType] | null;
11
+ };
12
+ level: {
13
+ /** Indexed by room list index and grid index. */
14
+ trapdoors: DefaultMap<number, Map<number, CustomTrapdoorDescription>, []>;
15
+ };
16
+ };
17
+ export default v;
18
+ //# sourceMappingURL=v.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"v.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/v.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAE/F,QAAA,MAAM,CAAC;;;QAIH,oDAAoD;;;;;QAUpD,iDAAiD;;;CAKpD,CAAC;AACF,eAAe,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local ____exports = {}
5
+ local ____DefaultMap = require("classes.DefaultMap")
6
+ local DefaultMap = ____DefaultMap.DefaultMap
7
+ local ____StageTravelState = require("enums.private.StageTravelState")
8
+ local StageTravelState = ____StageTravelState.StageTravelState
9
+ local v = {
10
+ run = {state = StageTravelState.NONE, stateRenderFrame = nil, destination = nil},
11
+ level = {trapdoors = __TS__New(
12
+ DefaultMap,
13
+ function() return __TS__New(Map) end
14
+ )}
15
+ }
16
+ ____exports.default = v
17
+ return ____exports
@@ -6,7 +6,7 @@ import { JSONRoom } from "../interfaces/JSONRoomsFile";
6
6
  * Specifically, this will clear the current room of all entities and grid entities, and then spawn
7
7
  * all of the entries and grid entities in the provided JSON room.
8
8
  *
9
- * This function is meant to be used in the PostNewRoom callback.
9
+ * This function is meant to be used in the `POST_NEW_ROOM` callback.
10
10
  *
11
11
  * For example:
12
12
  *
@@ -30,7 +30,7 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
30
30
  * Specifically, this will clear the current room of all entities and grid entities, and then spawn
31
31
  * all of the entries and grid entities in one of the provided JSON rooms.
32
32
  *
33
- * This function is meant to be used in the PostNewRoom callback.
33
+ * This function is meant to be used in the `POST_NEW_ROOM` callback.
34
34
  *
35
35
  * Note that this function does not simply choose a random element in the provided array; it will
36
36
  * properly account for each room weight using the algorithm from:
@@ -1 +1 @@
1
- {"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAqDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAoKvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
1
+ {"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAuDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAuKvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,QAAQ,EAAE,EAC3C,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAwB5D"}
@@ -66,7 +66,7 @@ local ____runInNFrames = require("features.runInNFrames")
66
66
  local runNextGameFrame = ____runInNFrames.runNextGameFrame
67
67
  local ____exports = require("features.saveDataManager.exports")
68
68
  local saveDataManager = ____exports.saveDataManager
69
- function preUseItemWeNeedToGoDeeper(self, _collectibleType, _rng, player)
69
+ function preUseItemWeNeedToGoDeeper(self, _collectibleType, _rng, player, _useFlags, _activeSlot, _customVarData)
70
70
  if v.room.manuallyUsingShovel then
71
71
  return nil
72
72
  end
@@ -481,7 +481,7 @@ end
481
481
  -- Specifically, this will clear the current room of all entities and grid entities, and then spawn
482
482
  -- all of the entries and grid entities in the provided JSON room.
483
483
  --
484
- -- This function is meant to be used in the PostNewRoom callback.
484
+ -- This function is meant to be used in the `POST_NEW_ROOM` callback.
485
485
  --
486
486
  -- For example:
487
487
  --
@@ -528,7 +528,7 @@ end
528
528
  -- Specifically, this will clear the current room of all entities and grid entities, and then spawn
529
529
  -- all of the entries and grid entities in one of the provided JSON rooms.
530
530
  --
531
- -- This function is meant to be used in the PostNewRoom callback.
531
+ -- This function is meant to be used in the `POST_NEW_ROOM` callback.
532
532
  --
533
533
  -- Note that this function does not simply choose a random element in the provided array; it will
534
534
  -- properly account for each room weight using the algorithm from:
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAUxD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAK/D"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/init.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAWxD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAK/D"}
@@ -11,6 +11,8 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
11
11
  local TearVariant = ____isaac_2Dtypescript_2Ddefinitions.TearVariant
12
12
  local ____constants = require("constants")
13
13
  local MAX_SPEED_STAT = ____constants.MAX_SPEED_STAT
14
+ local ____flag = require("functions.flag")
15
+ local bitFlags = ____flag.bitFlags
14
16
  local ____map = require("functions.map")
15
17
  local getMapPartialMatch = ____map.getMapPartialMatch
16
18
  local ____utils = require("functions.utils")
@@ -212,7 +214,7 @@ function entityTakeDmgPlayer(self)
212
214
  return nil
213
215
  end
214
216
  function postCurseEval(self, curses)
215
- return v.persistent.disableCurses and LevelCurse.NONE or curses
217
+ return v.persistent.disableCurses and bitFlags(nil, LevelCurse.NONE) or curses
216
218
  end
217
219
  function executeCmd(self, command, params)
218
220
  local resultTuple = getMapPartialMatch(nil, command, extraConsoleCommandsFunctionMap)
@@ -1 +1 @@
1
- {"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AAqGA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KAAK,IAAI,IAAI,CAG5B;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAchD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQ1C;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED;;;GAGG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAG3B;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAkBvD;AAED,gEAAgE;AAChE,wBAAgB,KAAK,IAAI,IAAI,CAY5B;AAED,+CAA+C;AAC/C,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
1
+ {"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AAmGA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,KAAK,I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AGG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAQ1C;AAED,6EAA6E;AAC7E,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED;;;GAGG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAG3B;AAED,6DAA6D;AAC7D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAkBvD;AAED,gEAAgE;AAChE,wBAAgB,KAAK,IAAI,IAAI,CAY5B;AAED,+CAA+C;AAC/C,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,qDAAqD;AACrD,wBAAgB,QAAQ,IAAI,IAAI,CAE/B;AAED,yDAAyD;AACzD,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
@@ -20,24 +20,24 @@ local ____cachedClasses = require("cachedClasses")
20
20
  local game = ____cachedClasses.game
21
21
  local sfxManager = ____cachedClasses.sfxManager
22
22
  local ____constants = require("constants")
23
- local FIRST_ROOM_TYPE = ____constants.FIRST_ROOM_TYPE
24
- local FIRST_STAGE = ____constants.FIRST_STAGE
25
- local LAST_ROOM_TYPE = ____constants.LAST_ROOM_TYPE
26
- local LAST_STAGE = ____constants.LAST_STAGE
27
23
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
28
24
  local ____constantsFirstLast = require("constantsFirstLast")
29
25
  local FIRST_CARD = ____constantsFirstLast.FIRST_CARD
30
26
  local FIRST_CHARACTER = ____constantsFirstLast.FIRST_CHARACTER
31
27
  local FIRST_PILL_EFFECT = ____constantsFirstLast.FIRST_PILL_EFFECT
28
+ local FIRST_ROOM_TYPE = ____constantsFirstLast.FIRST_ROOM_TYPE
29
+ local FIRST_STAGE = ____constantsFirstLast.FIRST_STAGE
32
30
  local LAST_CARD = ____constantsFirstLast.LAST_CARD
33
31
  local LAST_PILL_EFFECT = ____constantsFirstLast.LAST_PILL_EFFECT
32
+ local LAST_ROOM_TYPE = ____constantsFirstLast.LAST_ROOM_TYPE
33
+ local LAST_STAGE = ____constantsFirstLast.LAST_STAGE
34
34
  local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
35
35
  local ____HealthType = require("enums.HealthType")
36
36
  local HealthType = ____HealthType.HealthType
37
37
  local ____cards = require("functions.cards")
38
38
  local getCardName = ____cards.getCardName
39
- local ____character = require("functions.character")
40
- local getCharacterName = ____character.getCharacterName
39
+ local ____characters = require("functions.characters")
40
+ local getCharacterName = ____characters.getCharacterName
41
41
  local ____charge = require("functions.charge")
42
42
  local addCharge = ____charge.addCharge
43
43
  local ____collectibles = require("functions.collectibles")
@@ -4,7 +4,7 @@
4
4
  *
5
5
  * Under the hood, this function:
6
6
  * - uses the Pause collectible on every game frame
7
- * - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
7
+ * - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and `ButtonAction.CONSOLE`)
8
8
  */
9
9
  export declare function pause(): void;
10
10
  /** Helper function to put things back to normal after the `pause` function was used. */
@@ -1 +1 @@
1
- {"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/features/pause.ts"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAW5B;AAED,wFAAwF;AACxF,wBAAgB,OAAO,IAAI,IAAI,CAW9B"}
1
+ {"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../src/features/pause.ts"],"names":[],"mappings":"AA6GA;;;;;;;GAOG;AACH,wBAAgB,KAAK,IAAI,IAAI,CA8C5B;AAED,wFAAwF;AACxF,wBAAgB,OAAO,IAAI,IAAI,CAqB9B"}
@@ -1,15 +1,30 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local Set = ____lualib.Set
2
+ local Map = ____lualib.Map
3
3
  local __TS__New = ____lualib.__TS__New
4
+ local __TS__SparseArrayNew = ____lualib.__TS__SparseArrayNew
5
+ local __TS__SparseArrayPush = ____lualib.__TS__SparseArrayPush
6
+ local __TS__SparseArraySpread = ____lualib.__TS__SparseArraySpread
7
+ local Set = ____lualib.Set
4
8
  local ____exports = {}
5
- local postUpdate, inputActionGetActionValue, v
9
+ local postUpdate, stopTearsAndProjectilesFromMoving, inputActionGetActionValue, v
6
10
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
11
  local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
8
12
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
9
13
  local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
10
14
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
15
+ local ____constants = require("constants")
16
+ local VectorZero = ____constants.VectorZero
17
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
18
+ local getProjectiles = ____entitiesSpecific.getProjectiles
19
+ local getTears = ____entitiesSpecific.getTears
20
+ local removeAllProjectiles = ____entitiesSpecific.removeAllProjectiles
21
+ local removeAllTears = ____entitiesSpecific.removeAllTears
22
+ local ____isaacAPIClass = require("functions.isaacAPIClass")
23
+ local isTear = ____isaacAPIClass.isTear
11
24
  local ____log = require("functions.log")
12
25
  local logError = ____log.logError
26
+ local ____playerIndex = require("functions.playerIndex")
27
+ local getAllPlayers = ____playerIndex.getAllPlayers
13
28
  local ____players = require("functions.players")
14
29
  local useActiveItemTemp = ____players.useActiveItemTemp
15
30
  local ____disableInputs = require("features.disableInputs")
@@ -21,8 +36,37 @@ function postUpdate(self)
21
36
  if not v.run.isPseudoPaused then
22
37
  return
23
38
  end
24
- local player = Isaac.GetPlayer()
25
- useActiveItemTemp(nil, player, CollectibleType.PAUSE)
39
+ local firstPlayer = Isaac.GetPlayer()
40
+ useActiveItemTemp(nil, firstPlayer, CollectibleType.PAUSE)
41
+ stopTearsAndProjectilesFromMoving(nil)
42
+ end
43
+ function stopTearsAndProjectilesFromMoving(self)
44
+ local ____array_0 = __TS__SparseArrayNew(table.unpack(getTears(nil)))
45
+ __TS__SparseArrayPush(
46
+ ____array_0,
47
+ table.unpack(getProjectiles(nil))
48
+ )
49
+ local tearsAndProjectiles = {__TS__SparseArraySpread(____array_0)}
50
+ for ____, tearOrProjectile in ipairs(tearsAndProjectiles) do
51
+ do
52
+ local ptrHash = GetPtrHash(tearOrProjectile)
53
+ local initialDescription = v.run.initialDescriptions:get(ptrHash)
54
+ if initialDescription == nil then
55
+ goto __continue6
56
+ end
57
+ tearOrProjectile.Position = initialDescription.position
58
+ tearOrProjectile.PositionOffset = initialDescription.positionOffset
59
+ tearOrProjectile.Velocity = VectorZero
60
+ tearOrProjectile.Height = initialDescription.height
61
+ tearOrProjectile.FallingSpeed = 0
62
+ if isTear(nil, tearOrProjectile) then
63
+ tearOrProjectile.FallingAcceleration = initialDescription.fallingAcceleration
64
+ else
65
+ tearOrProjectile.FallingAccel = initialDescription.fallingAcceleration
66
+ end
67
+ end
68
+ ::__continue6::
69
+ end
26
70
  end
27
71
  function inputActionGetActionValue(self, _entity, _inputHook, buttonAction)
28
72
  if buttonAction ~= ButtonAction.SHOOT_RIGHT then
@@ -35,7 +79,11 @@ function inputActionGetActionValue(self, _entity, _inputHook, buttonAction)
35
79
  return 1
36
80
  end
37
81
  local FEATURE_NAME = "pause"
38
- v = {run = {isPseudoPaused = false, shouldUnpause = false}}
82
+ v = {run = {
83
+ isPseudoPaused = false,
84
+ shouldUnpause = false,
85
+ initialDescriptions = __TS__New(Map)
86
+ }}
39
87
  ---
40
88
  -- @internal
41
89
  function ____exports.pauseInit(self, mod)
@@ -48,15 +96,41 @@ end
48
96
  --
49
97
  -- Under the hood, this function:
50
98
  -- - uses the Pause collectible on every game frame
51
- -- - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
99
+ -- - disables any player inputs (except for `ButtonAction.MENU_CONFIRM` and `ButtonAction.CONSOLE`)
52
100
  function ____exports.pause(self)
53
101
  if v.run.isPseudoPaused then
54
102
  logError("Failed to pseudo-pause the game, since it was already pseudo-paused.")
55
103
  return
56
104
  end
57
105
  v.run.isPseudoPaused = true
58
- local whitelist = __TS__New(Set, {ButtonAction.MENU_CONFIRM})
106
+ v.run.initialDescriptions:clear()
107
+ local ____array_1 = __TS__SparseArrayNew(table.unpack(getTears(nil)))
108
+ __TS__SparseArrayPush(
109
+ ____array_1,
110
+ table.unpack(getProjectiles(nil))
111
+ )
112
+ local tearsAndProjectiles = {__TS__SparseArraySpread(____array_1)}
113
+ for ____, tearOrProjectile in ipairs(tearsAndProjectiles) do
114
+ local ptrHash = GetPtrHash(tearOrProjectile)
115
+ local initialDescription = {
116
+ position = tearOrProjectile.Position,
117
+ positionOffset = tearOrProjectile.PositionOffset,
118
+ velocity = tearOrProjectile.Velocity,
119
+ height = tearOrProjectile.Height,
120
+ fallingSpeed = tearOrProjectile.FallingSpeed,
121
+ fallingAcceleration = isTear(nil, tearOrProjectile) and tearOrProjectile.FallingAcceleration or tearOrProjectile.FallingAccel
122
+ }
123
+ v.run.initialDescriptions:set(ptrHash, initialDescription)
124
+ end
125
+ local firstPlayer = Isaac.GetPlayer()
126
+ useActiveItemTemp(nil, firstPlayer, CollectibleType.PAUSE)
127
+ local whitelist = __TS__New(Set, {ButtonAction.MENU_CONFIRM, ButtonAction.CONSOLE})
59
128
  disableAllInputsExceptFor(nil, FEATURE_NAME, whitelist)
129
+ for ____, player in ipairs(getAllPlayers(nil)) do
130
+ player.ControlsEnabled = false
131
+ player.Velocity = VectorZero
132
+ end
133
+ stopTearsAndProjectilesFromMoving(nil)
60
134
  end
61
135
  --- Helper function to put things back to normal after the `pause` function was used.
62
136
  function ____exports.unpause(self)
@@ -65,7 +139,12 @@ function ____exports.unpause(self)
65
139
  return
66
140
  end
67
141
  v.run.isPseudoPaused = false
68
- enableAllInputs(nil, FEATURE_NAME)
69
142
  v.run.shouldUnpause = true
143
+ enableAllInputs(nil, FEATURE_NAME)
144
+ for ____, player in ipairs(getAllPlayers(nil)) do
145
+ player.ControlsEnabled = true
146
+ end
147
+ removeAllTears(nil)
148
+ removeAllProjectiles(nil)
70
149
  end
71
150
  return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"persistentEntities.d.ts","sourceRoot":"","sources":["../../src/features/persistentEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAiGtC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,GACf,CAAC,MAAM,EAAE,GAAG,CAAC,CAcf;AAwBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,qBAAqB,EAAE,GAAG,EAC1B,YAAY,UAAO,GAClB,IAAI,CAiBN"}
1
+ {"version":3,"file":"persistentEntities.d.ts","sourceRoot":"","sources":["../../src/features/persistentEntities.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAkGtC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,GACf,CAAC,MAAM,EAAE,GAAG,CAAC,CAcf;AAwBD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,qBAAqB,EAAE,GAAG,EAC1B,YAAY,UAAO,GAClB,IAAI,CAiBN"}
@@ -7,8 +7,6 @@ local postEntityRemove, postNewRoomReordered, spawnAndTrack, v
7
7
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
8
  local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
9
9
  local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
10
- local ____cachedClasses = require("cachedClasses")
11
- local game = ____cachedClasses.game
12
10
  local ____ModCallbackCustom = require("enums.ModCallbackCustom")
13
11
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
14
12
  local ____featuresInitialized = require("featuresInitialized")
@@ -17,6 +15,8 @@ local ____entities = require("functions.entities")
17
15
  local spawn = ____entities.spawn
18
16
  local ____roomData = require("functions.roomData")
19
17
  local getRoomListIndex = ____roomData.getRoomListIndex
18
+ local ____roomHistory = require("features.roomHistory")
19
+ local getLatestRoomDescription = ____roomHistory.getLatestRoomDescription
20
20
  local ____exports = require("features.saveDataManager.exports")
21
21
  local saveDataManager = ____exports.saveDataManager
22
22
  function postEntityRemove(self, entity)
@@ -26,16 +26,16 @@ function postEntityRemove(self, entity)
26
26
  return
27
27
  end
28
28
  local index = tuple[1]
29
- local level = game:GetLevel()
30
- local previousRoomGridIndex = level:GetPreviousRoomIndex()
31
- local previousRoomListIndex = getRoomListIndex(nil, previousRoomGridIndex)
32
- v.level.persistentEntities:set(index, {
29
+ local previousRoomDescription = getLatestRoomDescription(nil)
30
+ local previousRoomListIndex = previousRoomDescription.roomListIndex
31
+ local persistentEntityDescription = {
33
32
  entityType = entity.Type,
34
33
  variant = entity.Variant,
35
34
  subType = entity.SubType,
36
35
  roomListIndex = previousRoomListIndex,
37
36
  position = entity.Position
38
- })
37
+ }
38
+ v.level.persistentEntities:set(index, persistentEntityDescription)
39
39
  end
40
40
  function postNewRoomReordered(self)
41
41
  local roomListIndex = getRoomListIndex(nil)
@@ -0,0 +1,19 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ import { ModUpgraded } from "../classes/ModUpgraded";
3
+ import { PickupIndex } from "../types/PickupIndex";
4
+ export declare function pickupIndexInit(mod: ModUpgraded): void;
5
+ /**
6
+ * Mods often have to track variables relating to a pickups. Finding an index for these kinds of
7
+ * data structures is difficult, since pickups are respawned every time a player re-enters a room,
8
+ * so the `PtrHash` will change.
9
+ *
10
+ * Use this function to get a unique index for a pickup to use in these data structures.
11
+ *
12
+ * Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the
13
+ * current run. For example, the first pickup spawned will have an index of 1, the second one will
14
+ * have an index of 2, and so on.
15
+ *
16
+ * Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod.
17
+ */
18
+ export declare function getPickupIndex(pickup: EntityPickup): PickupIndex;
19
+ //# sourceMappingURL=pickupIndex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pickupIndex.d.ts","sourceRoot":"","sources":["../../src/features/pickupIndex.ts"],"names":[],"mappings":";AAOA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAQrD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAgCnD,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAatD;AA0KD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAahE"}