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,197 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Map = ____lualib.Map
3
+ local __TS__New = ____lualib.__TS__New
4
+ local __TS__Iterator = ____lualib.__TS__Iterator
5
+ local ____exports = {}
6
+ local postPickupInit, postEntityRemovePickup, checkDespawningFromPlayerLeavingRoom, trackDespawningPickupMetadata, postNewRoomReordered, getStoredPickupIndex, getPostAscentPickupIndex, v
7
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
8
+ local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
9
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
10
+ local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
11
+ local ____cachedClasses = require("cachedClasses")
12
+ local game = ____cachedClasses.game
13
+ local ____DefaultMap = require("classes.DefaultMap")
14
+ local DefaultMap = ____DefaultMap.DefaultMap
15
+ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
16
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
17
+ local ____featuresInitialized = require("featuresInitialized")
18
+ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
19
+ local ____entities = require("functions.entities")
20
+ local getEntityID = ____entities.getEntityID
21
+ local ____entitiesSpecific = require("functions.entitiesSpecific")
22
+ local getPickups = ____entitiesSpecific.getPickups
23
+ local ____roomData = require("functions.roomData")
24
+ local getRoomListIndex = ____roomData.getRoomListIndex
25
+ local ____stage = require("functions.stage")
26
+ local onAscent = ____stage.onAscent
27
+ local ____vector = require("functions.vector")
28
+ local vectorEquals = ____vector.vectorEquals
29
+ local ____roomHistory = require("features.roomHistory")
30
+ local getLatestRoomDescription = ____roomHistory.getLatestRoomDescription
31
+ local ____exports = require("features.saveDataManager.exports")
32
+ local saveDataManager = ____exports.saveDataManager
33
+ function postPickupInit(self, pickup)
34
+ local ptrHash = GetPtrHash(pickup)
35
+ if v.room.pickupIndexes:has(ptrHash) then
36
+ return
37
+ end
38
+ local room = game:GetRoom()
39
+ local isFirstVisit = room:IsFirstVisit()
40
+ local roomFrameCount = room:GetFrameCount()
41
+ if not isFirstVisit and roomFrameCount <= 0 then
42
+ return
43
+ end
44
+ local ____v_run_0, ____pickupCounter_1 = v.run, "pickupCounter"
45
+ ____v_run_0[____pickupCounter_1] = ____v_run_0[____pickupCounter_1] + 1
46
+ v.room.pickupIndexes:set(ptrHash, v.run.pickupCounter)
47
+ v.run.currentRoomListIndex = getRoomListIndex(nil)
48
+ end
49
+ function postEntityRemovePickup(self, entity)
50
+ checkDespawningFromPlayerLeavingRoom(nil, entity)
51
+ end
52
+ function checkDespawningFromPlayerLeavingRoom(self, entity)
53
+ local ptrHash = GetPtrHash(entity)
54
+ local pickupIndex = v.room.pickupIndexes:get(ptrHash)
55
+ if pickupIndex == nil then
56
+ return
57
+ end
58
+ local roomListIndex = getRoomListIndex(nil)
59
+ if roomListIndex == v.run.currentRoomListIndex then
60
+ return
61
+ end
62
+ trackDespawningPickupMetadata(nil, entity, pickupIndex)
63
+ end
64
+ function trackDespawningPickupMetadata(self, entity, pickupIndex)
65
+ local previousRoomDescription = getLatestRoomDescription(nil)
66
+ local previousRoomListIndex = previousRoomDescription.roomListIndex
67
+ local pickupDescriptions = v.level.pickupData:getAndSetDefault(previousRoomListIndex)
68
+ local pickupDescription = {position = entity.Position, initSeed = entity.InitSeed}
69
+ pickupDescriptions:set(pickupIndex, pickupDescription)
70
+ if onAscent(nil) then
71
+ return
72
+ end
73
+ local room = game:GetRoom()
74
+ local roomType = room:GetType()
75
+ repeat
76
+ local ____switch13 = roomType
77
+ local ____cond13 = ____switch13 == RoomType.TREASURE
78
+ if ____cond13 then
79
+ do
80
+ v.run.pickupDataTreasureRooms:set(pickupIndex, pickupDescription)
81
+ break
82
+ end
83
+ end
84
+ ____cond13 = ____cond13 or ____switch13 == RoomType.BOSS
85
+ if ____cond13 then
86
+ do
87
+ v.run.pickupDataBossRooms:set(pickupIndex, pickupDescription)
88
+ break
89
+ end
90
+ end
91
+ do
92
+ do
93
+ break
94
+ end
95
+ end
96
+ until true
97
+ end
98
+ function postNewRoomReordered(self)
99
+ local room = game:GetRoom()
100
+ local isFirstVisit = room:IsFirstVisit()
101
+ if isFirstVisit then
102
+ return
103
+ end
104
+ local roomListIndex = getRoomListIndex(nil)
105
+ local pickupDescriptions = v.level.pickupData:getAndSetDefault(roomListIndex)
106
+ for ____, pickup in ipairs(getPickups(nil)) do
107
+ local pickupIndex = getStoredPickupIndex(nil, pickup, pickupDescriptions)
108
+ if pickupIndex == nil then
109
+ pickupIndex = getPostAscentPickupIndex(nil, pickup)
110
+ end
111
+ if pickupIndex == nil then
112
+ local entityID = getEntityID(nil, pickup)
113
+ error("Failed to find a pickup index corresponding to existing pickup: " .. entityID)
114
+ end
115
+ local ptrHash = GetPtrHash(pickup)
116
+ v.room.pickupIndexes:set(ptrHash, pickupIndex)
117
+ end
118
+ end
119
+ function getStoredPickupIndex(self, pickup, pickupDescriptions)
120
+ for ____, ____value in __TS__Iterator(pickupDescriptions:entries()) do
121
+ local pickupIndex = ____value[1]
122
+ local pickupDescription = ____value[2]
123
+ if vectorEquals(nil, pickupDescription.position, pickup.Position) and pickupDescription.initSeed == pickup.InitSeed then
124
+ return pickupIndex
125
+ end
126
+ end
127
+ return nil
128
+ end
129
+ function getPostAscentPickupIndex(self, pickup)
130
+ if not onAscent(nil) then
131
+ return nil
132
+ end
133
+ local room = game:GetRoom()
134
+ local roomType = room:GetType()
135
+ repeat
136
+ local ____switch29 = roomType
137
+ local ____cond29 = ____switch29 == RoomType.TREASURE
138
+ if ____cond29 then
139
+ do
140
+ return getStoredPickupIndex(nil, pickup, v.run.pickupDataTreasureRooms)
141
+ end
142
+ end
143
+ ____cond29 = ____cond29 or ____switch29 == RoomType.BOSS
144
+ if ____cond29 then
145
+ do
146
+ return getStoredPickupIndex(nil, pickup, v.run.pickupDataBossRooms)
147
+ end
148
+ end
149
+ do
150
+ do
151
+ return nil
152
+ end
153
+ end
154
+ until true
155
+ end
156
+ local FEATURE_NAME = "pickupIndex"
157
+ v = {
158
+ run = {
159
+ pickupCounter = 0,
160
+ currentRoomListIndex = 0,
161
+ pickupDataTreasureRooms = __TS__New(Map),
162
+ pickupDataBossRooms = __TS__New(Map)
163
+ },
164
+ level = {pickupData = __TS__New(
165
+ DefaultMap,
166
+ function() return __TS__New(Map) end
167
+ )},
168
+ room = {pickupIndexes = __TS__New(Map)}
169
+ }
170
+ function ____exports.pickupIndexInit(self, mod)
171
+ saveDataManager(nil, FEATURE_NAME, v)
172
+ mod:AddCallback(ModCallback.POST_PICKUP_INIT, postPickupInit)
173
+ mod:AddCallback(ModCallback.POST_ENTITY_REMOVE, postEntityRemovePickup, EntityType.PICKUP)
174
+ mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
175
+ end
176
+ --- Mods often have to track variables relating to a pickups. Finding an index for these kinds of
177
+ -- data structures is difficult, since pickups are respawned every time a player re-enters a room,
178
+ -- so the `PtrHash` will change.
179
+ --
180
+ -- Use this function to get a unique index for a pickup to use in these data structures.
181
+ --
182
+ -- Specifically, `PickupIndex` is a number that represents the spawn order of the pickup on the
183
+ -- current run. For example, the first pickup spawned will have an index of 1, the second one will
184
+ -- have an index of 2, and so on.
185
+ --
186
+ -- Tracking pickups requires stateful tracking, so using pickup indexes requires an upgraded mod.
187
+ function ____exports.getPickupIndex(self, pickup)
188
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
189
+ local ptrHash = GetPtrHash(pickup)
190
+ local pickupIndex = v.room.pickupIndexes:get(ptrHash)
191
+ if pickupIndex == nil then
192
+ local entityID = getEntityID(nil, pickup)
193
+ error((("Failed to get a pickup index for entity " .. entityID) .. " with hash: ") .. tostring(ptrHash))
194
+ end
195
+ return pickupIndex
196
+ end
197
+ return ____exports
@@ -0,0 +1,24 @@
1
+ import { RoomDescription } from "../interfaces/RoomDescription";
2
+ /**
3
+ * Helper function to get information about all of the rooms that a player has visited thus far on
4
+ * this run.
5
+ */
6
+ export declare function getRoomHistory(): readonly RoomDescription[];
7
+ /**
8
+ * Helper function to get information about the room that was previously visited.
9
+ *
10
+ * In the special case of only one room having been visited thus far (i.e. the starting room of the
11
+ * run), the starting room will be returned.
12
+ */
13
+ export declare function getPreviousRoomDescription(): RoomDescription;
14
+ /**
15
+ * Helper function to get information about the most recent room that is stored in the room history
16
+ * array.
17
+ *
18
+ * This is useful in the `POST_ENTITY_REMOVE` callback, since if an entity is despawning due to a
19
+ * player having left the room, the current room will have changed already, but the `POST_NEW_ROOM`
20
+ * callback will not have fired yet, and there will not be an entry in the room history array for
21
+ * the current room.
22
+ */
23
+ export declare function getLatestRoomDescription(): RoomDescription;
24
+ //# sourceMappingURL=roomHistory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roomHistory.d.ts","sourceRoot":"","sources":["../../src/features/roomHistory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAiDhE;;;GAGG;AACH,wBAAgB,cAAc,IAAI,SAAS,eAAe,EAAE,CAG3D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,IAAI,eAAe,CAe5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,IAAI,eAAe,CAS1D"}
@@ -0,0 +1,89 @@
1
+ local ____exports = {}
2
+ local postNewRoomEarly, v
3
+ local ____cachedClasses = require("cachedClasses")
4
+ local game = ____cachedClasses.game
5
+ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
6
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
7
+ local ____featuresInitialized = require("featuresInitialized")
8
+ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
9
+ local ____array = require("functions.array")
10
+ local getLastElement = ____array.getLastElement
11
+ local ____roomData = require("functions.roomData")
12
+ local getRoomGridIndex = ____roomData.getRoomGridIndex
13
+ local getRoomListIndex = ____roomData.getRoomListIndex
14
+ local getRoomName = ____roomData.getRoomName
15
+ local getRoomStageID = ____roomData.getRoomStageID
16
+ local getRoomSubType = ____roomData.getRoomSubType
17
+ local getRoomVariant = ____roomData.getRoomVariant
18
+ local ____exports = require("features.saveDataManager.exports")
19
+ local saveDataManager = ____exports.saveDataManager
20
+ function postNewRoomEarly(self)
21
+ local level = game:GetLevel()
22
+ local stage = level:GetStage()
23
+ local stageType = level:GetStageType()
24
+ local room = game:GetRoom()
25
+ local roomType = room:GetType()
26
+ local stageID = getRoomStageID(nil)
27
+ local roomVariant = getRoomVariant(nil)
28
+ local roomSubType = getRoomSubType(nil)
29
+ local roomName = getRoomName(nil)
30
+ local roomGridIndex = getRoomGridIndex(nil)
31
+ local roomListIndex = getRoomListIndex(nil)
32
+ local roomDescription = {
33
+ stage = stage,
34
+ stageType = stageType,
35
+ stageID = stageID,
36
+ roomType = roomType,
37
+ roomVariant = roomVariant,
38
+ roomSubType = roomSubType,
39
+ roomName = roomName,
40
+ roomGridIndex = roomGridIndex,
41
+ roomListIndex = roomListIndex
42
+ }
43
+ local ____v_run_roomHistory_0 = v.run.roomHistory
44
+ ____v_run_roomHistory_0[#____v_run_roomHistory_0 + 1] = roomDescription
45
+ end
46
+ local FEATURE_NAME = "roomHistory"
47
+ v = {run = {roomHistory = {}}}
48
+ ---
49
+ -- @internal
50
+ function ____exports.roomHistoryInit(self, mod)
51
+ saveDataManager(nil, FEATURE_NAME, v)
52
+ mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_EARLY, postNewRoomEarly)
53
+ end
54
+ --- Helper function to get information about all of the rooms that a player has visited thus far on
55
+ -- this run.
56
+ function ____exports.getRoomHistory(self)
57
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
58
+ return v.run.roomHistory
59
+ end
60
+ --- Helper function to get information about the room that was previously visited.
61
+ --
62
+ -- In the special case of only one room having been visited thus far (i.e. the starting room of the
63
+ -- run), the starting room will be returned.
64
+ function ____exports.getPreviousRoomDescription(self)
65
+ local previousRoomDescription = v.run.roomHistory[#v.run.roomHistory - 2 + 1]
66
+ if previousRoomDescription ~= nil then
67
+ return previousRoomDescription
68
+ end
69
+ local startingRoomDescription = v.run.roomHistory[1]
70
+ if startingRoomDescription ~= nil then
71
+ return startingRoomDescription
72
+ end
73
+ error("Failed to find a room description for any rooms thus far on this run.")
74
+ end
75
+ --- Helper function to get information about the most recent room that is stored in the room history
76
+ -- array.
77
+ --
78
+ -- This is useful in the `POST_ENTITY_REMOVE` callback, since if an entity is despawning due to a
79
+ -- player having left the room, the current room will have changed already, but the `POST_NEW_ROOM`
80
+ -- callback will not have fired yet, and there will not be an entry in the room history array for
81
+ -- the current room.
82
+ function ____exports.getLatestRoomDescription(self)
83
+ local latestRoomDescription = getLastElement(nil, v.run.roomHistory)
84
+ if latestRoomDescription == nil then
85
+ error("Failed to get the latest room description since the room history array was empty.")
86
+ end
87
+ return latestRoomDescription
88
+ end
89
+ return ____exports
@@ -1 +1 @@
1
- {"version":3,"file":"taintedLazarusPlayers.d.ts","sourceRoot":"","sources":["../../src/features/taintedLazarusPlayers.ts"],"names":[],"mappings":";AAoFA;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,GACnB,YAAY,GAAG,SAAS,CAe1B"}
1
+ {"version":3,"file":"taintedLazarusPlayers.d.ts","sourceRoot":"","sources":["../../src/features/taintedLazarusPlayers.ts"],"names":[],"mappings":";AA+FA;;;;;;;;;;GAUG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,YAAY,GACnB,YAAY,GAAG,SAAS,CAK1B"}
@@ -8,17 +8,18 @@ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
8
8
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
9
9
  local ____featuresInitialized = require("featuresInitialized")
10
10
  local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
11
+ local ____log = require("functions.log")
12
+ local logError = ____log.logError
11
13
  local ____exports = require("features.saveDataManager.exports")
12
14
  local saveDataManager = ____exports.saveDataManager
13
15
  function postPlayerInit(self, player)
14
- local entityPtr = EntityPtr(player)
15
16
  local character = player:GetPlayerType()
16
17
  if character == PlayerType.LAZARUS_B then
17
18
  local ____v_run_queuedTaintedLazarus_0 = v.run.queuedTaintedLazarus
18
- ____v_run_queuedTaintedLazarus_0[#____v_run_queuedTaintedLazarus_0 + 1] = entityPtr
19
+ ____v_run_queuedTaintedLazarus_0[#____v_run_queuedTaintedLazarus_0 + 1] = player
19
20
  elseif character == PlayerType.LAZARUS_2_B then
20
21
  local ____v_run_queuedDeadTaintedLazarus_1 = v.run.queuedDeadTaintedLazarus
21
- ____v_run_queuedDeadTaintedLazarus_1[#____v_run_queuedDeadTaintedLazarus_1 + 1] = entityPtr
22
+ ____v_run_queuedDeadTaintedLazarus_1[#____v_run_queuedDeadTaintedLazarus_1 + 1] = player
22
23
  else
23
24
  return
24
25
  end
@@ -28,20 +29,19 @@ function checkDequeue(self)
28
29
  if #v.run.queuedTaintedLazarus == 0 or #v.run.queuedDeadTaintedLazarus == 0 then
29
30
  return
30
31
  end
31
- local taintedLazarusPtr = table.remove(v.run.queuedTaintedLazarus, 1)
32
- local deadTaintedLazarusPtr = table.remove(v.run.queuedDeadTaintedLazarus, 1)
33
- if taintedLazarusPtr == nil or deadTaintedLazarusPtr == nil then
34
- return
35
- end
36
- local taintedLazarus = taintedLazarusPtr.Ref
37
- local deadTaintedLazarus = deadTaintedLazarusPtr.Ref
32
+ local taintedLazarus = table.remove(v.run.queuedTaintedLazarus, 1)
33
+ local deadTaintedLazarus = table.remove(v.run.queuedDeadTaintedLazarus, 1)
38
34
  if taintedLazarus == nil or deadTaintedLazarus == nil then
39
35
  return
40
36
  end
41
37
  local taintedLazarusPtrHash = GetPtrHash(taintedLazarus)
42
38
  local deadTaintedLazarusPtrHash = GetPtrHash(deadTaintedLazarus)
43
- v.run.subPlayerMap:set(taintedLazarusPtrHash, deadTaintedLazarusPtr)
44
- v.run.subPlayerMap:set(deadTaintedLazarusPtrHash, taintedLazarusPtr)
39
+ if taintedLazarusPtrHash == deadTaintedLazarusPtrHash then
40
+ logError("Failed to cache the Tainted Lazarus player objects, since the hash for Tainted Lazarus and Dead Tainted Lazarus were the same.")
41
+ return
42
+ end
43
+ v.run.subPlayerMap:set(taintedLazarusPtrHash, deadTaintedLazarus)
44
+ v.run.subPlayerMap:set(deadTaintedLazarusPtrHash, taintedLazarus)
45
45
  end
46
46
  local FEATURE_NAME = "taintedLazarusPlayers"
47
47
  v = {run = {
@@ -72,14 +72,6 @@ end
72
72
  function ____exports.getTaintedLazarusSubPlayer(self, player)
73
73
  errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
74
74
  local ptrHash = GetPtrHash(player)
75
- local entityPtr = v.run.subPlayerMap:get(ptrHash)
76
- if entityPtr == nil then
77
- return nil
78
- end
79
- local entity = entityPtr.Ref
80
- if entity == nil then
81
- return nil
82
- end
83
- return entity:ToPlayer()
75
+ return v.run.subPlayerMap:get(ptrHash)
84
76
  end
85
77
  return ____exports
@@ -30,6 +30,8 @@ export declare function characterGetsBlackHeartFromEternalHeart(character: Playe
30
30
  * is considered to starts with the D6, but this is not the case on a brand new save file).
31
31
  */
32
32
  export declare function characterStartsWithActiveItem(character: PlayerType): boolean;
33
+ /** Helper function to get the numerical damage multiplier for a character. */
34
+ export declare function getCharacterDamageMultiplier(character: PlayerType, hasWhoreOfBabylon?: boolean): float;
33
35
  /**
34
36
  * - Most characters have a 56 frame death animation (i.e. the "Death" animation).
35
37
  * - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
@@ -46,4 +48,4 @@ export declare function getCharacterMaxHeartContainers(character: PlayerType): i
46
48
  export declare function getCharacterName(character: PlayerType): string;
47
49
  export declare function isModdedCharacter(character: PlayerType): boolean;
48
50
  export declare function isVanillaCharacter(character: PlayerType): boolean;
49
- //# sourceMappingURL=character.d.ts.map
51
+ //# sourceMappingURL=characters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAW1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEhE;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEjE"}
@@ -3,6 +3,8 @@ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitio
3
3
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
4
4
  local ____constantsFirstLast = require("constantsFirstLast")
5
5
  local LAST_VANILLA_CHARACTER = ____constantsFirstLast.LAST_VANILLA_CHARACTER
6
+ local ____characterDamageMultipliers = require("objects.characterDamageMultipliers")
7
+ local CHARACTER_DAMAGE_MULTIPLIERS = ____characterDamageMultipliers.CHARACTER_DAMAGE_MULTIPLIERS
6
8
  local ____characterNames = require("objects.characterNames")
7
9
  local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
8
10
  local ____charactersThatStartWithAnActiveItemSet = require("sets.charactersThatStartWithAnActiveItemSet")
@@ -54,6 +56,16 @@ end
54
56
  function ____exports.characterStartsWithActiveItem(self, character)
55
57
  return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET:has(character)
56
58
  end
59
+ --- Helper function to get the numerical damage multiplier for a character.
60
+ function ____exports.getCharacterDamageMultiplier(self, character, hasWhoreOfBabylon)
61
+ if hasWhoreOfBabylon == nil then
62
+ hasWhoreOfBabylon = false
63
+ end
64
+ if character == PlayerType.EVE and hasWhoreOfBabylon then
65
+ return 1
66
+ end
67
+ return CHARACTER_DAMAGE_MULTIPLIERS[character]
68
+ end
57
69
  --- - Most characters have a 56 frame death animation (i.e. the "Death" animation).
58
70
  -- - The Lost and Tainted Lost have a 38 frame death animation (i.e. the "LostDeath" animation).
59
71
  -- - Tainted Forgotten have a 20 frame death animation (i.e. the "ForgottenDeath" animation).
@@ -24,38 +24,51 @@ export declare function getCollectibleDevilHeartPrice(collectibleType: Collectib
24
24
  */
25
25
  export declare function getCollectibleGfxFilename(collectibleType: CollectibleType): string;
26
26
  /**
27
- * Mods often have to track variables relating to a collectible. Finding an index for these kinds of
28
- * data structures is difficult, since collectibles are respawned every time a player re-enters a
29
- * room, so the `PtrHash` will change. Instead, we use a 4-tuple of the room list index, the grid
30
- * index of the collectible in the room, the collectible's SubType, and the collectible's InitSeed.
27
+ * Mods may have to keep track of data relating to a collectible. Finding an index for these kinds
28
+ * of data structures is difficult, since collectibles are respawned every time a player re-enters a
29
+ * room (like all other pickups), so the `PtrHash` will change.
30
+ *
31
+ * Use this function to get a unique index for a collectible to use in these data structures.
32
+ *
33
+ * If your mod is upgraded, then you should use the `getPickupIndex` function instead, as it is more
34
+ * general purpose and less prone to error (but relies on stateful tracking of pickups as the run
35
+ * progresses).
36
+ *
37
+ * Collectibles are a special case of pickups: they cannot be pushed around. (They actually can be
38
+ * pushed, but usually will stay on the same grid index.) Thus, it is possible to generate a
39
+ * somewhat reliable non-stateful index for collectibles. We use a 4-tuple of the room list index,
40
+ * the grid index of the collectible in the room, the collectible's `SubType`, and the collectible's
41
+ * `InitSeed`.
31
42
  *
32
43
  * Collectibles that are shifted by Tainted Isaac's mechanic will have unique collectible indexes
33
- * because the SubType is different. (The collectible entities share the same InitSeed.)
44
+ * because the `SubType` is different. (The collectible entities share the same `InitSeed` and
45
+ * `PtrHash`.)
34
46
  *
35
47
  * Collectibles that are rolled (with e.g. a D6) will have unique collectible indexes because the
36
- * SubType and InitSeed are different. If you want to track collectibles independently of any
48
+ * `SubType` and `InitSeed` are different. If you want to track collectibles independently of any
37
49
  * rerolls, then you can use the `PtrHash` as an index instead. (The `PtrHash` will not persist
38
50
  * between rooms, however.)
39
51
  *
40
52
  * Note that:
41
53
  * - The grid index is a necessary part of the collectible index because Diplopia and Crooked Penny
42
- * can cause two or more collectibles with the same SubType and InitSeed to exist in the same
54
+ * can cause two or more collectibles with the same `SubType` and `InitSeed` to exist in the same
43
55
  * room.
44
56
  * - This index will fail in the case where the player uses Diplopia or a successful Crooked Penny
45
57
  * seven or more times in the same room, since that will cause two or more collectibles with the
46
- * same grid index, SubType, and InitSeed to exist.
47
- * - The SubType is a necessary part of the collectible index because Tainted Isaac will
48
- * continuously cause collectibles to morph into new sub-types with the same InitSeed.
58
+ * same grid index, `SubType`, and `InitSeed` to exist. (More than seven is required in non-1x1
59
+ * rooms.)
60
+ * - The `SubType` is a necessary part of the collectible index because Tainted Isaac will
61
+ * continuously cause collectibles to morph into new sub-types with the same `InitSeed`.
49
62
  * - Using a collectible's position as part of the index is problematic, since players can push a
50
63
  * pedestal. (Even using the grid index does not solve this problem, since it is possible in
51
64
  * certain cases for collectibles to be spawned at a position that is not aligned with the grid,
52
65
  * and the pedestal pushed to an adjacent tile, but this case should be extremely rare.)
53
66
  * - Mega Chests spawn two collectibles on the exact same position. However, both of them will have
54
- * different InitSeeds, so this is not a problem for this indexing scheme.
67
+ * a different `InitSeed`, so this is not a problem for this indexing scheme.
55
68
  * - The indexing scheme used is different for collectibles that are inside of a Treasure Room or
56
69
  * Boss Room, in order to handle the case of the player seeing the same collectible again in a
57
- * post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, SubType,
58
- * and InitSeed is used in this case. (Using the room list index or the room grid index is not
70
+ * post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, `SubType`,
71
+ * and `InitSeed` is used in this case. (Using the room list index or the room grid index is not
59
72
  * suitable for this purpose, since both of these values can change in the post-Ascent rooms.)
60
73
  * Even though Treasure Rooms and Boss Rooms are grouped together in this scheme, there probably
61
74
  * will not be collectibles with the same grid index, SubType, and InitSeed.
@@ -1 +1 @@
1
- {"version":3,"file":"collectibles.d.ts","sourceRoot":"","sources":["../../src/functions/collectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,eAAe,EAEf,aAAa,EAEb,QAAQ,EACR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AY,GAAG,IAAI,CAS5E;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CASnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAUnE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,YAAY,GAAG,IAAI,CAuBtE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,YAAY,EACzB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,IAAI,CAeN;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,YAAY,EACzB,kBAAkB,EAAE,eAAe,GAClC,IAAI,CA2BN;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,IAAI,CAK5D"}
@@ -182,38 +182,51 @@ function ____exports.getCollectibleGfxFilename(self, collectibleType)
182
182
  end
183
183
  return itemConfigItem.GfxFileName
184
184
  end
185
- --- Mods often have to track variables relating to a collectible. Finding an index for these kinds of
186
- -- data structures is difficult, since collectibles are respawned every time a player re-enters a
187
- -- room, so the `PtrHash` will change. Instead, we use a 4-tuple of the room list index, the grid
188
- -- index of the collectible in the room, the collectible's SubType, and the collectible's InitSeed.
185
+ --- Mods may have to keep track of data relating to a collectible. Finding an index for these kinds
186
+ -- of data structures is difficult, since collectibles are respawned every time a player re-enters a
187
+ -- room (like all other pickups), so the `PtrHash` will change.
188
+ --
189
+ -- Use this function to get a unique index for a collectible to use in these data structures.
190
+ --
191
+ -- If your mod is upgraded, then you should use the `getPickupIndex` function instead, as it is more
192
+ -- general purpose and less prone to error (but relies on stateful tracking of pickups as the run
193
+ -- progresses).
194
+ --
195
+ -- Collectibles are a special case of pickups: they cannot be pushed around. (They actually can be
196
+ -- pushed, but usually will stay on the same grid index.) Thus, it is possible to generate a
197
+ -- somewhat reliable non-stateful index for collectibles. We use a 4-tuple of the room list index,
198
+ -- the grid index of the collectible in the room, the collectible's `SubType`, and the collectible's
199
+ -- `InitSeed`.
189
200
  --
190
201
  -- Collectibles that are shifted by Tainted Isaac's mechanic will have unique collectible indexes
191
- -- because the SubType is different. (The collectible entities share the same InitSeed.)
202
+ -- because the `SubType` is different. (The collectible entities share the same `InitSeed` and
203
+ -- `PtrHash`.)
192
204
  --
193
205
  -- Collectibles that are rolled (with e.g. a D6) will have unique collectible indexes because the
194
- -- SubType and InitSeed are different. If you want to track collectibles independently of any
206
+ -- `SubType` and `InitSeed` are different. If you want to track collectibles independently of any
195
207
  -- rerolls, then you can use the `PtrHash` as an index instead. (The `PtrHash` will not persist
196
208
  -- between rooms, however.)
197
209
  --
198
210
  -- Note that:
199
211
  -- - The grid index is a necessary part of the collectible index because Diplopia and Crooked Penny
200
- -- can cause two or more collectibles with the same SubType and InitSeed to exist in the same
212
+ -- can cause two or more collectibles with the same `SubType` and `InitSeed` to exist in the same
201
213
  -- room.
202
214
  -- - This index will fail in the case where the player uses Diplopia or a successful Crooked Penny
203
215
  -- seven or more times in the same room, since that will cause two or more collectibles with the
204
- -- same grid index, SubType, and InitSeed to exist.
205
- -- - The SubType is a necessary part of the collectible index because Tainted Isaac will
206
- -- continuously cause collectibles to morph into new sub-types with the same InitSeed.
216
+ -- same grid index, `SubType`, and `InitSeed` to exist. (More than seven is required in non-1x1
217
+ -- rooms.)
218
+ -- - The `SubType` is a necessary part of the collectible index because Tainted Isaac will
219
+ -- continuously cause collectibles to morph into new sub-types with the same `InitSeed`.
207
220
  -- - Using a collectible's position as part of the index is problematic, since players can push a
208
221
  -- pedestal. (Even using the grid index does not solve this problem, since it is possible in
209
222
  -- certain cases for collectibles to be spawned at a position that is not aligned with the grid,
210
223
  -- and the pedestal pushed to an adjacent tile, but this case should be extremely rare.)
211
224
  -- - Mega Chests spawn two collectibles on the exact same position. However, both of them will have
212
- -- different InitSeeds, so this is not a problem for this indexing scheme.
225
+ -- a different `InitSeed`, so this is not a problem for this indexing scheme.
213
226
  -- - The indexing scheme used is different for collectibles that are inside of a Treasure Room or
214
227
  -- Boss Room, in order to handle the case of the player seeing the same collectible again in a
215
- -- post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, SubType,
216
- -- and InitSeed is used in this case. (Using the room list index or the room grid index is not
228
+ -- post-Ascent Treasure Room or Boss Room. A 5-tuple of stage, stage type, grid index, `SubType`,
229
+ -- and `InitSeed` is used in this case. (Using the room list index or the room grid index is not
217
230
  -- suitable for this purpose, since both of these values can change in the post-Ascent rooms.)
218
231
  -- Even though Treasure Rooms and Boss Rooms are grouped together in this scheme, there probably
219
232
  -- will not be collectibles with the same grid index, SubType, and InitSeed.
@@ -65,10 +65,10 @@ export declare function getClosestEntityTo<T extends AnyEntity>(referenceEntity:
65
65
  export declare function getEntities(entityType?: EntityType, variant?: number, subType?: number, ignoreFriendly?: boolean): Entity[];
66
66
  /**
67
67
  * Helper function to get all the fields on an entity. For example, this is useful for comparing it
68
- * to another entity later.
68
+ * to another entity later. (One option is to use the `logTableDifferences` function for this.)
69
69
  *
70
- * This function will only get fields that are equal to booleans, numbers, or strings, as comparing
71
- * other types is non-trivial.
70
+ * This function will only get fields that are equal to booleans, numbers, or strings, or Vectors,
71
+ * as comparing other types is non-trivial.
72
72
  */
73
73
  export declare function getEntityFields(entity: Entity): LuaMap<string, boolean | number | string>;
74
74
  /** Helper function to return a string containing the entity's type, variant, and sub-type. */
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/functions/entities.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAM/C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAC3B,UAAU,GAAE,UAAe,EAC3B,OAAO,SAAK,EACZ,OAAO,SAAK,EACZ,cAAc,UAAQ,GACrB,GAAG,CAcL;AAED;;;;;;;;GAQG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B,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
@@ -20,6 +20,9 @@ local isRNG = ____rng.isRNG
20
20
  local newRNG = ____rng.newRNG
21
21
  local ____types = require("functions.types")
22
22
  local isPrimitive = ____types.isPrimitive
23
+ local ____vector = require("functions.vector")
24
+ local isVector = ____vector.isVector
25
+ local vectorToString = ____vector.vectorToString
23
26
  function setPrimitiveEntityFields(self, entity, metatable, entityFields)
24
27
  local propGetTable = metatable.__propget
25
28
  if propGetTable == nil then
@@ -30,6 +33,8 @@ function setPrimitiveEntityFields(self, entity, metatable, entityFields)
30
33
  local value = entity[indexKey]
31
34
  if isPrimitive(nil, value) then
32
35
  entityFields[indexKey] = value
36
+ elseif isVector(nil, value) then
37
+ entityFields[indexKey] = vectorToString(nil, value)
33
38
  end
34
39
  end
35
40
  end
@@ -180,10 +185,10 @@ function ____exports.getEntities(self, entityType, variant, subType, ignoreFrien
180
185
  return Isaac.FindByType(entityType, variant, subType, ignoreFriendly)
181
186
  end
182
187
  --- Helper function to get all the fields on an entity. For example, this is useful for comparing it
183
- -- to another entity later.
188
+ -- to another entity later. (One option is to use the `logTableDifferences` function for this.)
184
189
  --
185
- -- This function will only get fields that are equal to booleans, numbers, or strings, as comparing
186
- -- other types is non-trivial.
190
+ -- This function will only get fields that are equal to booleans, numbers, or strings, or Vectors,
191
+ -- as comparing other types is non-trivial.
187
192
  function ____exports.getEntityFields(self, entity)
188
193
  local entityFields = {}
189
194
  local metatable = getmetatable(entity)