isaacscript-common 1.0.524 → 1.0.528

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 (52) hide show
  1. package/dist/callbacks/subscriptions/PreNewLevel.d.ts +1 -1
  2. package/dist/callbacks/subscriptions/postBombInitLate.d.ts +2 -1
  3. package/dist/callbacks/subscriptions/postCursedTeleport.d.ts +2 -1
  4. package/dist/callbacks/subscriptions/postCustomRevive.d.ts +2 -1
  5. package/dist/callbacks/subscriptions/postEffectInitLate.d.ts +2 -1
  6. package/dist/callbacks/subscriptions/postEsauJr.d.ts +2 -1
  7. package/dist/callbacks/subscriptions/postFamiliarInitLate.d.ts +2 -1
  8. package/dist/callbacks/subscriptions/postFirstEsauJr.d.ts +2 -1
  9. package/dist/callbacks/subscriptions/postFirstFlip.d.ts +2 -1
  10. package/dist/callbacks/subscriptions/postFlip.d.ts +2 -1
  11. package/dist/callbacks/subscriptions/postGameStartedReordered.d.ts +1 -1
  12. package/dist/callbacks/subscriptions/postGridEntityInit.d.ts +2 -1
  13. package/dist/callbacks/subscriptions/postGridEntityRemove.d.ts +2 -1
  14. package/dist/callbacks/subscriptions/postGridEntityUpdate.d.ts +2 -1
  15. package/dist/callbacks/subscriptions/postItemPickup.d.ts +1 -0
  16. package/dist/callbacks/subscriptions/postKnifeInitLate.d.ts +2 -1
  17. package/dist/callbacks/subscriptions/postLaserInitLate.d.ts +2 -1
  18. package/dist/callbacks/subscriptions/postNPCInitLate.d.ts +2 -1
  19. package/dist/callbacks/subscriptions/postNewLevelReordered.d.ts +1 -1
  20. package/dist/callbacks/subscriptions/postNewRoomEarly.d.ts +1 -1
  21. package/dist/callbacks/subscriptions/postNewRoomReordered.d.ts +1 -1
  22. package/dist/callbacks/subscriptions/postPickupCollect.d.ts +2 -1
  23. package/dist/callbacks/subscriptions/postPickupInitLate.d.ts +2 -1
  24. package/dist/callbacks/subscriptions/postPlayerChangeHealth.d.ts +3 -1
  25. package/dist/callbacks/subscriptions/postPlayerChangeType.d.ts +2 -1
  26. package/dist/callbacks/subscriptions/postPlayerFatalDamage.d.ts +2 -1
  27. package/dist/callbacks/subscriptions/postPlayerInitLate.d.ts +2 -1
  28. package/dist/callbacks/subscriptions/postPlayerInitReordered.d.ts +2 -1
  29. package/dist/callbacks/subscriptions/postPlayerRenderReordered.d.ts +2 -1
  30. package/dist/callbacks/subscriptions/postPlayerUpdateReordered.d.ts +2 -1
  31. package/dist/callbacks/subscriptions/postProjectileInitLate.d.ts +2 -1
  32. package/dist/callbacks/subscriptions/postPurchase.d.ts +2 -1
  33. package/dist/callbacks/subscriptions/postSacrifice.d.ts +2 -1
  34. package/dist/callbacks/subscriptions/postSlotDestroyed.d.ts +2 -1
  35. package/dist/callbacks/subscriptions/postSlotInit.d.ts +2 -1
  36. package/dist/callbacks/subscriptions/postSlotRender.d.ts +2 -1
  37. package/dist/callbacks/subscriptions/postSlotUpdate.d.ts +2 -1
  38. package/dist/callbacks/subscriptions/postTearInitLate.d.ts +2 -1
  39. package/dist/callbacks/subscriptions/postTransformation.d.ts +2 -1
  40. package/dist/callbacks/subscriptions/preCustomRevive.d.ts +2 -1
  41. package/dist/callbacks/subscriptions/preItemPickup.d.ts +3 -1
  42. package/dist/functions/rooms.d.ts +11 -0
  43. package/dist/functions/rooms.lua +59 -48
  44. package/dist/functions/seeds.d.ts +2 -0
  45. package/dist/functions/seeds.lua +8 -0
  46. package/dist/functions/stage.d.ts +9 -0
  47. package/dist/functions/stage.lua +23 -13
  48. package/dist/functions/util.d.ts +7 -2
  49. package/dist/functions/util.lua +13 -0
  50. package/dist/index.d.ts +1 -0
  51. package/dist/index.lua +8 -0
  52. package/package.json +1 -1
@@ -1 +1 @@
1
- export {};
1
+ export declare type PreNewLevelCallbackType = () => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostBombInitLateCallbackType = (bomb: EntityBomb) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostCursedTeleportCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostCustomReviveCallbackType = (player: EntityPlayer, revivalType: int) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostEffectInitLateCallbackType = (effect: EntityEffect) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostEsauJrCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostFamiliarInitLateCallbackType = (familiar: EntityFamiliar) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostFirstEsauJrCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostFirstFlipCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostFlipCallbackType = (player: EntityPlayer) => void;
@@ -1 +1 @@
1
- export {};
1
+ export declare type PostGameStartedReorderedCallbackType = (isContinued: boolean) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostGridEntityInitCallbackType = (gridEntity: GridEntity) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostGridEntityRemoveCallbackType = (gridIndex: int, gridEntityType: GridEntityType) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostGridEntityUpdateCallbackType = (gridEntity: GridEntity) => void;
@@ -1,2 +1,3 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ import { PickingUpItem } from "../../types/PickingUpItem";
2
3
  export declare type PostItemPickupCallbackType = (player: EntityPlayer, pickingUpItem: PickingUpItem) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostKnifeInitLateCallbackType = (knife: EntityKnife) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostLaserInitLateCallbackType = (laser: EntityLaser) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostNPCInitLateCallbackType = (npc: EntityNPC) => void;
@@ -1 +1 @@
1
- export {};
1
+ export declare type PostNewLevelReorderedCallbackType = () => void;
@@ -1 +1 @@
1
- export {};
1
+ export declare type PostNewRoomEarlyCallbackType = () => void;
@@ -1 +1 @@
1
- export {};
1
+ export declare type PostNewRoomReorderedCallbackType = () => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPickupCollectCallbackType = (pickup: EntityPickup, player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPickupInitLateCallbackType = (pickup: EntityPickup) => void;
@@ -1 +1,3 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ import { HealthType } from "../../types/HealthType";
3
+ export declare type PostPlayerChangeHealthCallbackType = (player: EntityPlayer, healthType: HealthType, amount: int) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPlayerChangeTypeCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPlayerFatalDamageCallbackType = (player: EntityPlayer) => boolean | void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPlayerInitLateCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPlayerInitReorderedCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPlayerRenderReorderedCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPlayerUpdateReorderedCallbackType = (player: EntityPlayer) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostProjectileInitLateCallbackType = (projectile: EntityProjectile) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPurchaseCallbackType = (player: EntityPlayer, pickupVariant: PickupVariant | int, pickupSubType: int, pickupPrice: int) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostSacrificeCallbackType = (player: EntityPlayer, numSacrifices: int) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostSlotDestroyedCallbackType = (slot: Entity) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostSlotInitCallbackType = (slot: Entity) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostSlotRenderCallbackType = (slot: Entity) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostSlotUpdateCallbackType = (slot: Entity) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostTearInitLateCallbackType = (tear: EntityTear) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostTransformationCallbackType = (player: EntityPlayer, playerForm: PlayerForm, hasForm: boolean) => void;
@@ -1 +1,2 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PreCustomReviveCallbackType = (player: EntityPlayer) => int | void;
@@ -1 +1,3 @@
1
- export {};
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ import { PickingUpItem } from "../../types/PickingUpItem";
3
+ export declare type PreItemPickupCallbackType = (player: EntityPlayer, pickingUpItem: PickingUpItem) => void;
@@ -89,6 +89,15 @@ export declare function getRoomVariant(): int;
89
89
  * the variable is only incremented immediately before the PostNewRoom callback fires.
90
90
  */
91
91
  export declare function getRoomVisitedCount(): int;
92
+ /**
93
+ * Helper function to get the room descriptor for every room on the level. Uses the
94
+ * `Level.GetRooms()` method to accomplish this.
95
+ *
96
+ * @param includeExtraDimensionalRooms Optional. On some floors (e.g. Downpour 2, Mines 2),
97
+ * extra-dimensional rooms are automatically be generated and can be seen when you iterate over the
98
+ * `RoomList`. False by default.
99
+ */
100
+ export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
92
101
  /**
93
102
  * Converts a room X and Y coordinate to a position. For example, the coordinates of 0, 0 are
94
103
  * equal to `Vector(80, 160)`.
@@ -136,6 +145,8 @@ export declare function inStartingRoom(): boolean;
136
145
  /**
137
146
  * Helper function to loop through every room on the floor and see if it has been cleared.
138
147
  *
148
+ * This function will only check rooms in the current dimension.
149
+ *
139
150
  * @param onlyCheckRoomTypes Optional. A whitelist of room types. If specified, room types not in
140
151
  * the array will be ignored. If not specified, then all rooms will be checked. Undefined by
141
152
  * default.
@@ -44,6 +44,39 @@ function ____exports.getRoomSubType(self)
44
44
  end
45
45
  return roomData.Subtype
46
46
  end
47
+ function ____exports.getRooms(self, includeExtraDimensionalRooms)
48
+ if includeExtraDimensionalRooms == nil then
49
+ includeExtraDimensionalRooms = false
50
+ end
51
+ local game = Game()
52
+ local level = game:GetLevel()
53
+ local roomList = level:GetRooms()
54
+ local rooms = {}
55
+ if includeExtraDimensionalRooms then
56
+ do
57
+ local i = 0
58
+ while i < roomList.Size do
59
+ local roomDesc = roomList:Get(i)
60
+ if roomDesc ~= nil then
61
+ __TS__ArrayPush(rooms, roomDesc)
62
+ end
63
+ i = i + 1
64
+ end
65
+ end
66
+ else
67
+ do
68
+ local i = 0
69
+ while i <= MAX_ROOM_INDEX do
70
+ local roomDesc = level:GetRoomByIdx(i)
71
+ if roomDesc ~= nil then
72
+ __TS__ArrayPush(rooms, roomDesc)
73
+ end
74
+ i = i + 1
75
+ end
76
+ end
77
+ end
78
+ return rooms
79
+ end
47
80
  function ____exports.inDeathCertificateArea(self)
48
81
  local roomStageID = ____exports.getRoomStageID(nil)
49
82
  local roomSubType = ____exports.getRoomSubType(nil)
@@ -56,19 +89,11 @@ function ____exports.changeRoom(self, roomGridIndex)
56
89
  game:ChangeRoom(roomGridIndex)
57
90
  end
58
91
  function ____exports.getAllRoomGridIndexes(self)
59
- local game = Game()
60
- local level = game:GetLevel()
61
- local rooms = level:GetRooms()
62
92
  local allRoomGridIndexes = {}
63
- do
64
- local i = 0
65
- while i < rooms.Size do
66
- local roomDesc = rooms:Get(i)
67
- if roomDesc ~= nil then
68
- __TS__ArrayPush(allRoomGridIndexes, roomDesc.SafeGridIndex)
69
- end
70
- i = i + 1
71
- end
93
+ for ____, roomDesc in ipairs(
94
+ ____exports.getRooms(nil)
95
+ ) do
96
+ __TS__ArrayPush(allRoomGridIndexes, roomDesc.SafeGridIndex)
72
97
  end
73
98
  return allRoomGridIndexes
74
99
  end
@@ -111,17 +136,12 @@ function ____exports.getRoomListIndex(self)
111
136
  return roomDesc.ListIndex
112
137
  end
113
138
  function ____exports.getRoomGridIndexesForType(self, roomType)
114
- local game = Game()
115
- local level = game:GetLevel()
116
139
  local roomGridIndexes = {}
117
- do
118
- local i = 0
119
- while i <= MAX_ROOM_INDEX do
120
- local room = level:GetRoomByIdx(i)
121
- if ((room ~= nil) and (room.Data ~= nil)) and (room.Data.Type == roomType) then
122
- __TS__ArrayPush(roomGridIndexes, room.SafeGridIndex)
123
- end
124
- i = i + 1
140
+ for ____, roomDesc in ipairs(
141
+ ____exports.getRooms(nil)
142
+ ) do
143
+ if (roomDesc.Data ~= nil) and (roomDesc.Data.Type == roomType) then
144
+ __TS__ArrayPush(roomGridIndexes, roomDesc.SafeGridIndex)
125
145
  end
126
146
  end
127
147
  return roomGridIndexes
@@ -232,33 +252,24 @@ function ____exports.inStartingRoom(self)
232
252
  return (roomSafeGridIndex == startingRoomGridIndex) and ____exports.inDimension(nil, 0)
233
253
  end
234
254
  function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
235
- local game = Game()
236
- local level = game:GetLevel()
237
- local rooms = level:GetRooms()
238
255
  local roomTypeWhitelist = (((onlyCheckRoomTypes == nil) and (function() return nil end)) or (function() return __TS__New(Set, onlyCheckRoomTypes) end))()
239
- do
240
- local i = 0
241
- while i < rooms.Size do
242
- do
243
- local roomDesc = rooms:Get(i)
244
- if roomDesc == nil then
245
- goto __continue42
246
- end
247
- local roomData = roomDesc.Data
248
- if roomData == nil then
249
- goto __continue42
250
- end
251
- local roomType = roomData.Type
252
- if (roomTypeWhitelist ~= nil) and (not roomTypeWhitelist:has(roomType)) then
253
- goto __continue42
254
- end
255
- if not roomDesc.Clear then
256
- return false
257
- end
256
+ for ____, roomDesc in ipairs(
257
+ ____exports.getRooms(nil)
258
+ ) do
259
+ do
260
+ local roomData = roomDesc.Data
261
+ if roomData == nil then
262
+ goto __continue48
263
+ end
264
+ local roomType = roomData.Type
265
+ if (roomTypeWhitelist ~= nil) and (not roomTypeWhitelist:has(roomType)) then
266
+ goto __continue48
267
+ end
268
+ if not roomDesc.Clear then
269
+ return false
258
270
  end
259
- ::__continue42::
260
- i = i + 1
261
271
  end
272
+ ::__continue48::
262
273
  end
263
274
  return true
264
275
  end
@@ -290,14 +301,14 @@ function ____exports.setRoomCleared(self)
290
301
  ) do
291
302
  do
292
303
  if isHiddenSecretRoomDoor(nil, door) then
293
- goto __continue51
304
+ goto __continue56
294
305
  end
295
306
  door.State = DoorState.STATE_OPEN
296
307
  local sprite = door:GetSprite()
297
308
  sprite:Play("Opened", true)
298
309
  door.ExtraVisible = false
299
310
  end
300
- ::__continue51::
311
+ ::__continue56::
301
312
  end
302
313
  sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
303
314
  game:ShakeScreen(0)
@@ -0,0 +1,2 @@
1
+ /** Helper function to get the seed of the current run. */
2
+ export declare function getStartSeedString(): string;
@@ -0,0 +1,8 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ function ____exports.getStartSeedString(self)
4
+ local game = Game()
5
+ local seeds = game:GetSeeds()
6
+ return seeds:GetStartSeedString()
7
+ end
8
+ return ____exports
@@ -1,5 +1,14 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Helper function to account for Repentance floors being offset by 1. For example, Downpour 2 is
4
+ * the third level of the run, but the game considers it to have a stage of 2. This function will
5
+ * consider Downpour 2 to have a stage of 3.
6
+ */
2
7
  export declare function getEffectiveStage(): int;
8
+ /** Helper function to get the current stage. */
9
+ export declare function getStage(): LevelStage;
10
+ /** Helper function to get the current stage. */
11
+ export declare function getStageType(): StageType;
3
12
  /** Helper function to directly warp to a specific stage using the "stage" console command. */
4
13
  export declare function goToStage(stage: LevelStage, stageType: StageType): void;
5
14
  export declare function onCathedral(): boolean;
@@ -10,39 +10,39 @@ function ____exports.onRepentanceStage(self)
10
10
  end
11
11
  function ____exports.stageTypeToLetter(self, stageType)
12
12
  repeat
13
- local ____switch12 = stageType
14
- local ____cond12 = ____switch12 == StageType.STAGETYPE_ORIGINAL
15
- if ____cond12 then
13
+ local ____switch14 = stageType
14
+ local ____cond14 = ____switch14 == StageType.STAGETYPE_ORIGINAL
15
+ if ____cond14 then
16
16
  do
17
17
  return ""
18
18
  end
19
19
  end
20
- ____cond12 = ____cond12 or (____switch12 == StageType.STAGETYPE_WOTL)
21
- if ____cond12 then
20
+ ____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_WOTL)
21
+ if ____cond14 then
22
22
  do
23
23
  return "a"
24
24
  end
25
25
  end
26
- ____cond12 = ____cond12 or (____switch12 == StageType.STAGETYPE_AFTERBIRTH)
27
- if ____cond12 then
26
+ ____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_AFTERBIRTH)
27
+ if ____cond14 then
28
28
  do
29
29
  return "b"
30
30
  end
31
31
  end
32
- ____cond12 = ____cond12 or (____switch12 == StageType.STAGETYPE_GREEDMODE)
33
- if ____cond12 then
32
+ ____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_GREEDMODE)
33
+ if ____cond14 then
34
34
  do
35
35
  return ""
36
36
  end
37
37
  end
38
- ____cond12 = ____cond12 or (____switch12 == StageType.STAGETYPE_REPENTANCE)
39
- if ____cond12 then
38
+ ____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_REPENTANCE)
39
+ if ____cond14 then
40
40
  do
41
41
  return "c"
42
42
  end
43
43
  end
44
- ____cond12 = ____cond12 or (____switch12 == StageType.STAGETYPE_REPENTANCE_B)
45
- if ____cond12 then
44
+ ____cond14 = ____cond14 or (____switch14 == StageType.STAGETYPE_REPENTANCE_B)
45
+ if ____cond14 then
46
46
  do
47
47
  return "d"
48
48
  end
@@ -64,6 +64,16 @@ function ____exports.getEffectiveStage(self)
64
64
  end
65
65
  return stage
66
66
  end
67
+ function ____exports.getStage(self)
68
+ local game = Game()
69
+ local level = game:GetLevel()
70
+ return level:GetStage()
71
+ end
72
+ function ____exports.getStageType(self)
73
+ local game = Game()
74
+ local level = game:GetLevel()
75
+ return level:GetStageType()
76
+ end
67
77
  function ____exports.goToStage(self, stage, stageType)
68
78
  local stageTypeLetterSuffix = ____exports.stageTypeToLetter(nil, stageType)
69
79
  local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
@@ -1,8 +1,13 @@
1
1
  /// <reference types="isaac-typescript-definitions" />
2
2
  /// <reference types="typescript-to-lua/language-extensions" />
3
3
  /**
4
- * Using a Set constructor to copy a Set does not seem to work properly, so this helper function is
5
- * used instead.
4
+ * Using a Map constructor to copy a Map does not seem to work properly, so use this helper function
5
+ * instead.
6
+ */
7
+ export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
8
+ /**
9
+ * Using a Set constructor to copy a Set does not seem to work properly, so use this helper function
10
+ * instead.
6
11
  */
7
12
  export declare function copySet<T>(oldSet: Set<T>): Set<T>;
8
13
  /**
@@ -2,6 +2,19 @@
2
2
  require("lualib_bundle");
3
3
  local ____exports = {}
4
4
  local HEX_STRING_LENGTH = 6
5
+ function ____exports.copyMap(self, oldMap)
6
+ local newMap = __TS__New(Map)
7
+ for ____, ____value in __TS__Iterator(
8
+ oldMap:entries()
9
+ ) do
10
+ local key
11
+ key = ____value[1]
12
+ local value
13
+ value = ____value[2]
14
+ newMap:set(key, value)
15
+ end
16
+ return newMap
17
+ end
5
18
  function ____exports.copySet(self, oldSet)
6
19
  local newSet = __TS__New(Set)
7
20
  for ____, value in __TS__Iterator(
package/dist/index.d.ts CHANGED
@@ -38,6 +38,7 @@ export * from "./functions/position";
38
38
  export * from "./functions/random";
39
39
  export * from "./functions/revive";
40
40
  export * from "./functions/rooms";
41
+ export * from "./functions/seeds";
41
42
  export * from "./functions/spawnCollectible";
42
43
  export * from "./functions/sprite";
43
44
  export * from "./functions/stage";
package/dist/index.lua CHANGED
@@ -310,6 +310,14 @@ do
310
310
  end
311
311
  end
312
312
  end
313
+ do
314
+ local ____export = require("functions.seeds")
315
+ for ____exportKey, ____exportValue in pairs(____export) do
316
+ if ____exportKey ~= "default" then
317
+ ____exports[____exportKey] = ____exportValue
318
+ end
319
+ end
320
+ end
313
321
  do
314
322
  local ____export = require("functions.spawnCollectible")
315
323
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.524",
3
+ "version": "1.0.528",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",