isaacscript-common 6.20.2 → 6.21.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 (91) hide show
  1. package/dist/constantsFirstLast.d.ts +2 -2
  2. package/dist/constantsFirstLast.lua +2 -2
  3. package/dist/enums/RockAltType.d.ts +12 -1
  4. package/dist/enums/RockAltType.d.ts.map +1 -1
  5. package/dist/enums/RockAltType.lua +4 -2
  6. package/dist/features/customStage/backdrop.d.ts.map +1 -1
  7. package/dist/features/customStage/backdrop.lua +3 -2
  8. package/dist/features/customStage/customStageConstants.d.ts +11 -0
  9. package/dist/features/customStage/customStageConstants.d.ts.map +1 -1
  10. package/dist/features/customStage/customStageConstants.lua +10 -0
  11. package/dist/features/customStage/customStageGridEntities.d.ts +1 -0
  12. package/dist/features/customStage/customStageGridEntities.d.ts.map +1 -1
  13. package/dist/features/customStage/customStageGridEntities.lua +58 -23
  14. package/dist/features/customStage/exports.d.ts +4 -5
  15. package/dist/features/customStage/exports.d.ts.map +1 -1
  16. package/dist/features/customStage/exports.lua +49 -51
  17. package/dist/features/customStage/init.d.ts.map +1 -1
  18. package/dist/features/customStage/init.lua +7 -12
  19. package/dist/features/customStage/shadows.d.ts.map +1 -1
  20. package/dist/features/customStage/shadows.lua +2 -1
  21. package/dist/features/customStage/streakText.d.ts +0 -7
  22. package/dist/features/customStage/streakText.d.ts.map +1 -1
  23. package/dist/features/customStage/streakText.lua +51 -84
  24. package/dist/features/customStage/v.d.ts +13 -0
  25. package/dist/features/customStage/v.d.ts.map +1 -1
  26. package/dist/features/customStage/v.lua +6 -1
  27. package/dist/features/customTrapdoor/exports.d.ts +7 -6
  28. package/dist/features/customTrapdoor/exports.d.ts.map +1 -1
  29. package/dist/features/customTrapdoor/exports.lua +6 -5
  30. package/dist/features/customTrapdoor/init.d.ts.map +1 -1
  31. package/dist/features/customTrapdoor/init.lua +11 -6
  32. package/dist/features/customTrapdoor/touched.lua +0 -1
  33. package/dist/features/customTrapdoor/v.d.ts +1 -1
  34. package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
  35. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +3 -3
  36. package/dist/features/saveDataManager/exports.d.ts +3 -0
  37. package/dist/features/saveDataManager/exports.d.ts.map +1 -1
  38. package/dist/features/saveDataManager/exports.lua +3 -0
  39. package/dist/functions/collectibleSet.d.ts +1 -1
  40. package/dist/functions/collectibleSet.lua +1 -1
  41. package/dist/functions/doors.d.ts +10 -0
  42. package/dist/functions/doors.d.ts.map +1 -1
  43. package/dist/functions/doors.lua +6 -0
  44. package/dist/functions/log.d.ts +1 -15
  45. package/dist/functions/log.d.ts.map +1 -1
  46. package/dist/functions/log.lua +3 -218
  47. package/dist/functions/logEntities.d.ts +16 -0
  48. package/dist/functions/logEntities.d.ts.map +1 -0
  49. package/dist/functions/logEntities.lua +220 -0
  50. package/dist/functions/rockAlt.d.ts +6 -5
  51. package/dist/functions/rockAlt.d.ts.map +1 -1
  52. package/dist/functions/rockAlt.lua +147 -18
  53. package/dist/functions/roomTransition.d.ts +26 -0
  54. package/dist/functions/roomTransition.d.ts.map +1 -0
  55. package/dist/functions/roomTransition.lua +75 -0
  56. package/dist/functions/rooms.d.ts +1 -18
  57. package/dist/functions/rooms.d.ts.map +1 -1
  58. package/dist/functions/rooms.lua +3 -52
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.lua +8 -0
  62. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts +1 -1
  63. package/dist/interfaces/private/CustomTrapdoorDescription.d.ts.map +1 -1
  64. package/dist/objects/backdropTypeToRockAltType.lua +3 -3
  65. package/package.json +1 -1
  66. package/src/constantsFirstLast.ts +2 -2
  67. package/src/enums/RockAltType.ts +14 -1
  68. package/src/features/customStage/backdrop.ts +2 -1
  69. package/src/features/customStage/customStageConstants.ts +16 -0
  70. package/src/features/customStage/customStageGridEntities.ts +47 -0
  71. package/src/features/customStage/exports.ts +44 -40
  72. package/src/features/customStage/init.ts +7 -18
  73. package/src/features/customStage/shadows.ts +2 -1
  74. package/src/features/customStage/streakText.ts +58 -95
  75. package/src/features/customStage/v.ts +17 -0
  76. package/src/features/customTrapdoor/exports.ts +9 -6
  77. package/src/features/customTrapdoor/init.ts +16 -5
  78. package/src/features/customTrapdoor/touched.ts +0 -2
  79. package/src/features/customTrapdoor/v.ts +1 -1
  80. package/src/features/extraConsoleCommands/commandsSubroutines.ts +4 -1
  81. package/src/features/saveDataManager/exports.ts +3 -0
  82. package/src/functions/collectibleSet.ts +1 -1
  83. package/src/functions/doors.ts +10 -0
  84. package/src/functions/log.ts +1 -279
  85. package/src/functions/logEntities.ts +276 -0
  86. package/src/functions/rockAlt.ts +147 -19
  87. package/src/functions/roomTransition.ts +78 -0
  88. package/src/functions/rooms.ts +2 -60
  89. package/src/index.ts +1 -0
  90. package/src/interfaces/private/CustomTrapdoorDescription.ts +3 -1
  91. package/src/objects/backdropTypeToRockAltType.ts +3 -3
@@ -1,5 +1,5 @@
1
1
  local ____exports = {}
2
- local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucket, ROCK_ALT_CHANCES, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
2
+ local spawnRockAltRewardUrn, spawnRockAltRewardMushroom, spawnRockAltRewardSkull, spawnRockAltRewardPolyp, spawnRockAltRewardBucketDownpour, spawnRockAltRewardBucketDross, ROCK_ALT_CHANCES, COIN_VELOCITY_MULTIPLIER, POLYP_PROJECTILE_SPEED, POLYP_NUM_PROJECTILES
3
3
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
4
4
  local Card = ____isaac_2Dtypescript_2Ddefinitions.Card
5
5
  local CoinSubType = ____isaac_2Dtypescript_2Ddefinitions.CoinSubType
@@ -55,13 +55,12 @@ function spawnRockAltRewardUrn(self, position, rng)
55
55
  if chance < totalChance then
56
56
  local numCoinsChance = getRandom(nil, rng)
57
57
  local numCoins = numCoinsChance < 0.5 and 1 or 2
58
- local length = DISTANCE_OF_GRID_TILE
59
58
  ____repeat(
60
59
  nil,
61
60
  numCoins,
62
61
  function()
63
62
  local randomVector = getRandomVector(nil, rng)
64
- local velocity = randomVector * length
63
+ local velocity = randomVector * COIN_VELOCITY_MULTIPLIER
65
64
  spawnCoinWithSeed(
66
65
  nil,
67
66
  CoinSubType.NULL,
@@ -87,12 +86,12 @@ function spawnRockAltRewardUrn(self, position, rng)
87
86
  end
88
87
  return false
89
88
  end
90
- local numSpidersChance = getRandom(nil, rng)
91
- local numSpiders = numSpidersChance < 0.5 and 1 or 2
89
+ local numEnemiesChance = getRandom(nil, rng)
90
+ local numEnemies = numEnemiesChance < 0.5 and 1 or 2
92
91
  local length = DISTANCE_OF_GRID_TILE * 3
93
92
  ____repeat(
94
93
  nil,
95
- numSpiders,
94
+ numEnemies,
96
95
  function()
97
96
  local randomVector = getRandomVector(nil, rng)
98
97
  local offset = randomVector * length
@@ -266,16 +265,142 @@ function spawnRockAltRewardPolyp(self, position, rng)
266
265
  )
267
266
  return true
268
267
  end
269
- function spawnRockAltRewardBucket(self, _position, rng, _variant)
268
+ function spawnRockAltRewardBucketDownpour(self, position, rng)
270
269
  local chance = getRandom(nil, rng)
271
270
  local totalChance = 0
272
271
  totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
273
272
  if chance < totalChance then
274
273
  return false
275
274
  end
276
- return false
275
+ totalChance = totalChance + ROCK_ALT_CHANCES.BASIC_DROP
276
+ if chance < totalChance then
277
+ local numCoinsChance = getRandom(nil, rng)
278
+ local numCoins = numCoinsChance < 0.5 and 1 or 2
279
+ ____repeat(
280
+ nil,
281
+ numCoins,
282
+ function()
283
+ local randomVector = getRandomVector(nil, rng)
284
+ local velocity = randomVector * COIN_VELOCITY_MULTIPLIER
285
+ spawnCoinWithSeed(
286
+ nil,
287
+ CoinSubType.NULL,
288
+ position,
289
+ rng,
290
+ velocity
291
+ )
292
+ end
293
+ )
294
+ return true
295
+ end
296
+ totalChance = totalChance + ROCK_ALT_CHANCES.TRINKET
297
+ if chance < totalChance then
298
+ spawnTrinketWithSeed(nil, TrinketType.SWALLOWED_PENNY, position, rng)
299
+ return true
300
+ end
301
+ totalChance = totalChance + ROCK_ALT_CHANCES.COLLECTIBLE
302
+ if chance < totalChance then
303
+ local stillInPools = isCollectibleInItemPool(nil, CollectibleType.LEECH, ItemPoolType.TREASURE)
304
+ if stillInPools then
305
+ spawnCollectible(nil, CollectibleType.LEECH, position, rng)
306
+ return true
307
+ end
308
+ return false
309
+ end
310
+ local enemiesChance = getRandom(nil, rng)
311
+ local entityType = enemiesChance < 0.5 and EntityType.SPIDER or EntityType.SMALL_LEECH
312
+ local numEnemiesChance = getRandom(nil, rng)
313
+ local numEnemies = numEnemiesChance < 0.5 and 1 or 2
314
+ local jumpDistance = DISTANCE_OF_GRID_TILE * 3
315
+ ____repeat(
316
+ nil,
317
+ numEnemies,
318
+ function()
319
+ local randomVector = getRandomVector(nil, rng)
320
+ local offset = randomVector * jumpDistance
321
+ local targetPos = position + offset
322
+ local spider = EntityNPC.ThrowSpider(
323
+ position,
324
+ nil,
325
+ targetPos,
326
+ false,
327
+ 0
328
+ )
329
+ if entityType == EntityType.SMALL_LEECH and spider.Type ~= entityType then
330
+ spider:Morph(entityType, 0, 0, -1)
331
+ end
332
+ end
333
+ )
334
+ return true
335
+ end
336
+ function spawnRockAltRewardBucketDross(self, position, rng)
337
+ local chance = getRandom(nil, rng)
338
+ local totalChance = 0
339
+ totalChance = totalChance + ROCK_ALT_CHANCES.NOTHING
340
+ if chance < totalChance then
341
+ return false
342
+ end
343
+ totalChance = totalChance + ROCK_ALT_CHANCES.BASIC_DROP
344
+ if chance < totalChance then
345
+ local numCoinsChance = getRandom(nil, rng)
346
+ local numCoins = numCoinsChance < 0.5 and 1 or 2
347
+ ____repeat(
348
+ nil,
349
+ numCoins,
350
+ function()
351
+ local randomVector = getRandomVector(nil, rng)
352
+ local velocity = randomVector * COIN_VELOCITY_MULTIPLIER
353
+ spawnCoinWithSeed(
354
+ nil,
355
+ CoinSubType.NULL,
356
+ position,
357
+ rng,
358
+ velocity
359
+ )
360
+ end
361
+ )
362
+ return true
363
+ end
364
+ totalChance = totalChance + ROCK_ALT_CHANCES.TRINKET
365
+ if chance < totalChance then
366
+ spawnTrinketWithSeed(nil, TrinketType.BUTT_PENNY, position, rng)
367
+ return true
368
+ end
369
+ totalChance = totalChance + ROCK_ALT_CHANCES.COLLECTIBLE
370
+ if chance < totalChance then
371
+ local stillInPools = isCollectibleInItemPool(nil, CollectibleType.POOP, ItemPoolType.TREASURE)
372
+ if stillInPools then
373
+ spawnCollectible(nil, CollectibleType.POOP, position, rng)
374
+ return true
375
+ end
376
+ return false
377
+ end
378
+ local enemiesChance = getRandom(nil, rng)
379
+ local entityType = enemiesChance < 0.5 and EntityType.DRIP or EntityType.SMALL_LEECH
380
+ local numEnemiesChance = getRandom(nil, rng)
381
+ local numEnemies = numEnemiesChance < 0.5 and 1 or 2
382
+ local jumpDistance = DISTANCE_OF_GRID_TILE * 3
383
+ ____repeat(
384
+ nil,
385
+ numEnemies,
386
+ function()
387
+ local randomVector = getRandomVector(nil, rng)
388
+ local offset = randomVector * jumpDistance
389
+ local targetPos = position + offset
390
+ local spider = EntityNPC.ThrowSpider(
391
+ position,
392
+ nil,
393
+ targetPos,
394
+ false,
395
+ 0
396
+ )
397
+ spider:Morph(entityType, 0, 0, -1)
398
+ end
399
+ )
400
+ return true
277
401
  end
278
402
  ROCK_ALT_CHANCES = {NOTHING = 0.68, BASIC_DROP = 0.0967, TRINKET = 0.025, COLLECTIBLE = 0.005}
403
+ COIN_VELOCITY_MULTIPLIER = 2
279
404
  POLYP_PROJECTILE_SPEED = 10
280
405
  POLYP_NUM_PROJECTILES = 6
281
406
  --- Helper function to get the alternate rock type (i.e. urn, mushroom, etc.) that the current room
@@ -306,24 +431,22 @@ end
306
431
  -- trinket is still in the pool. Thus, it will always have a chance to spawn the respective trinket
307
432
  -- (e.g. Swallowed Penny from urns).
308
433
  --
434
+ -- When filled buckets are destroyed, 6 projectiles will always spawn in a random pattern (in
435
+ -- addition to any other rewards that are spawned). This function does not account for this, so if
436
+ -- you want to specifically emulate destroying a filled bucket, you have to account for the
437
+ -- projectiles yourself.
438
+ --
309
439
  -- The logic in this function is based on the rewards listed on the wiki:
310
440
  -- https://bindingofisaacrebirth.fandom.com/wiki/Rocks
311
441
  --
312
442
  -- @param position The place to spawn the reward.
313
443
  -- @param rockAltType The type of reward to spawn. For example, `RockAltType.URN` will have a chance
314
444
  -- at spawning coins and spiders.
315
- -- @param variant Optional. The variant of the grid entity to emulate. Default is 0, which
316
- -- corresponds to a "normal" grid entity or an empty bucket. This only matters when
317
- -- spawning the reward for buckets. (Empty buckets have different rewards than full
318
- -- buckets.)
319
445
  -- @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
320
446
  -- `RNG.Next` method will be called. Default is `getRandomSeed()`. Normally, you
321
447
  -- should pass the `InitSeed` of the grid entity that was broken.
322
448
  -- @returns Whether or not this function spawned something.
323
- function ____exports.spawnRockAltReward(self, position, rockAltType, variant, seedOrRNG)
324
- if variant == nil then
325
- variant = 0
326
- end
449
+ function ____exports.spawnRockAltReward(self, position, rockAltType, seedOrRNG)
327
450
  if seedOrRNG == nil then
328
451
  seedOrRNG = getRandomSeed(nil)
329
452
  end
@@ -354,10 +477,16 @@ function ____exports.spawnRockAltReward(self, position, rockAltType, variant, se
354
477
  return spawnRockAltRewardPolyp(nil, position, rng)
355
478
  end
356
479
  end
357
- ____cond4 = ____cond4 or ____switch4 == RockAltType.BUCKET
480
+ ____cond4 = ____cond4 or ____switch4 == RockAltType.BUCKET_DOWNPOUR
481
+ if ____cond4 then
482
+ do
483
+ return spawnRockAltRewardBucketDownpour(nil, position, rng)
484
+ end
485
+ end
486
+ ____cond4 = ____cond4 or ____switch4 == RockAltType.BUCKET_DROSS
358
487
  if ____cond4 then
359
488
  do
360
- return spawnRockAltRewardBucket(nil, position, rng, variant)
489
+ return spawnRockAltRewardBucketDross(nil, position, rng)
361
490
  end
362
491
  end
363
492
  until true
@@ -0,0 +1,26 @@
1
+ import { Direction, RoomTransitionAnim } from "isaac-typescript-definitions";
2
+ /**
3
+ * Helper function to reload the current room using `Game.StartRoomTransition`.
4
+ *
5
+ * This is useful for canceling the "goto" console command or to make the `Level.SetStage` method
6
+ * take effect.
7
+ */
8
+ export declare function reloadRoom(): void;
9
+ /**
10
+ * Helper function to change the current room. It can be used for both teleportation and "normal"
11
+ * room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
12
+ * arguments.
13
+ *
14
+ * Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
15
+ * - you do not forget to set `Level.LeaveDoor` property
16
+ * - to prevent crashing on invalid room grid indexes
17
+ * - to automatically handle Curse of the Maze
18
+ *
19
+ * @param roomGridIndex The room grid index of the destination room.
20
+ * @param direction Optional. Default is `Direction.NO_DIRECTION`.
21
+ * @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
22
+ * @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
23
+ * to false, then this function may not go to the provided room grid index.
24
+ */
25
+ export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim, force?: boolean): void;
26
+ //# sourceMappingURL=roomTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roomTransition.d.ts","sourceRoot":"","sources":["../../src/functions/roomTransition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAGT,kBAAkB,EACnB,MAAM,8BAA8B,CAAC;AAMtC;;;;;GAKG;AACH,wBAAgB,UAAU,IAAI,IAAI,CAQjC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,GAAG,EAClB,SAAS,YAAyB,EAClC,kBAAkB,qBAA8B,EAChD,KAAK,UAAQ,GACZ,IAAI,CA6BN"}
@@ -0,0 +1,75 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
4
+ local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
5
+ local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
6
+ local RoomTransitionAnim = ____isaac_2Dtypescript_2Ddefinitions.RoomTransitionAnim
7
+ local ____cachedClasses = require("cachedClasses")
8
+ local game = ____cachedClasses.game
9
+ local ____runNextRoom = require("features.runNextRoom")
10
+ local runNextRoom = ____runNextRoom.runNextRoom
11
+ local ____curses = require("functions.curses")
12
+ local hasCurse = ____curses.hasCurse
13
+ local ____roomData = require("functions.roomData")
14
+ local getRoomData = ____roomData.getRoomData
15
+ local getRoomGridIndex = ____roomData.getRoomGridIndex
16
+ --- Helper function to change the current room. It can be used for both teleportation and "normal"
17
+ -- room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
18
+ -- arguments.
19
+ --
20
+ -- Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
21
+ -- - you do not forget to set `Level.LeaveDoor` property
22
+ -- - to prevent crashing on invalid room grid indexes
23
+ -- - to automatically handle Curse of the Maze
24
+ --
25
+ -- @param roomGridIndex The room grid index of the destination room.
26
+ -- @param direction Optional. Default is `Direction.NO_DIRECTION`.
27
+ -- @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
28
+ -- @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
29
+ -- to false, then this function may not go to the provided room grid index.
30
+ function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim, force)
31
+ if direction == nil then
32
+ direction = Direction.NO_DIRECTION
33
+ end
34
+ if roomTransitionAnim == nil then
35
+ roomTransitionAnim = RoomTransitionAnim.TELEPORT
36
+ end
37
+ if force == nil then
38
+ force = false
39
+ end
40
+ local level = game:GetLevel()
41
+ local shouldTempDisableCurse = force and hasCurse(nil, LevelCurse.MAZE)
42
+ if shouldTempDisableCurse then
43
+ level:RemoveCurses(LevelCurse.MAZE)
44
+ end
45
+ local roomData = getRoomData(nil, roomGridIndex)
46
+ if roomData == nil then
47
+ error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
48
+ end
49
+ level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
50
+ game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
51
+ if shouldTempDisableCurse then
52
+ runNextRoom(
53
+ nil,
54
+ function()
55
+ local futureLevel = game:GetLevel()
56
+ futureLevel:AddCurse(LevelCurse.MAZE, false)
57
+ end
58
+ )
59
+ end
60
+ end
61
+ --- Helper function to reload the current room using `Game.StartRoomTransition`.
62
+ --
63
+ -- This is useful for canceling the "goto" console command or to make the `Level.SetStage` method
64
+ -- take effect.
65
+ function ____exports.reloadRoom(self)
66
+ local roomGridIndex = getRoomGridIndex(nil)
67
+ ____exports.teleport(
68
+ nil,
69
+ roomGridIndex,
70
+ Direction.NO_DIRECTION,
71
+ RoomTransitionAnim.FADE,
72
+ true
73
+ )
74
+ end
75
+ return ____exports
@@ -1,4 +1,4 @@
1
- import { BackdropType, BossID, Dimension, Direction, ItemPoolType, MinibossID, RoomTransitionAnim, RoomType } from "isaac-typescript-definitions";
1
+ import { BackdropType, BossID, Dimension, ItemPoolType, MinibossID, RoomType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function for quickly switching to a new room without playing a particular animation. Use
4
4
  * this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
@@ -182,21 +182,4 @@ export declare function setRoomCleared(): void;
182
182
  * spawns an NPC.
183
183
  */
184
184
  export declare function setRoomUncleared(): void;
185
- /**
186
- * Helper function to change the current room. It can be used for both teleportation and "normal"
187
- * room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
188
- * arguments.
189
- *
190
- * Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
191
- * - you do not forget to set `Level.LeaveDoor` property
192
- * - to prevent crashing on invalid room grid indexes
193
- * - to automatically handle Curse of the Maze
194
- *
195
- * @param roomGridIndex The room grid index of the destination room.
196
- * @param direction Optional. Default is `Direction.NO_DIRECTION`.
197
- * @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
198
- * @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
199
- * to false, then this function may not go to the provided room grid index.
200
- */
201
- export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim, force?: boolean): void;
202
185
  //# sourceMappingURL=rooms.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EACT,SAAS,EAKT,YAAY,EAEZ,UAAU,EAGV,kBAAkB,EAClB,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAiCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,GAC1B,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAgBlC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,U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CAKvC"}
@@ -14,15 +14,12 @@ local ____exports = {}
14
14
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
15
15
  local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
16
16
  local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
17
- local Direction = ____isaac_2Dtypescript_2Ddefinitions.Direction
18
17
  local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
19
18
  local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
20
19
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
21
20
  local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
22
- local LevelCurse = ____isaac_2Dtypescript_2Ddefinitions.LevelCurse
23
21
  local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
24
22
  local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
25
- local RoomTransitionAnim = ____isaac_2Dtypescript_2Ddefinitions.RoomTransitionAnim
26
23
  local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
27
24
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
28
25
  local StageID = ____isaac_2Dtypescript_2Ddefinitions.StageID
@@ -36,8 +33,6 @@ local ____roomTypeNames = require("objects.roomTypeNames")
36
33
  local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
37
34
  local ____mineShaftRoomSubTypesSet = require("sets.mineShaftRoomSubTypesSet")
38
35
  local MINE_SHAFT_ROOM_SUB_TYPE_SET = ____mineShaftRoomSubTypesSet.MINE_SHAFT_ROOM_SUB_TYPE_SET
39
- local ____curses = require("functions.curses")
40
- local hasCurse = ____curses.hasCurse
41
36
  local ____dimensions = require("functions.dimensions")
42
37
  local inDimension = ____dimensions.inDimension
43
38
  local ____doors = require("functions.doors")
@@ -62,6 +57,8 @@ local getRoomGridIndex = ____roomData.getRoomGridIndex
62
57
  local getRoomName = ____roomData.getRoomName
63
58
  local getRoomStageID = ____roomData.getRoomStageID
64
59
  local getRoomSubType = ____roomData.getRoomSubType
60
+ local ____roomTransition = require("functions.roomTransition")
61
+ local reloadRoom = ____roomTransition.reloadRoom
65
62
  local ____stage = require("functions.stage")
66
63
  local getGotoCommand = ____stage.getGotoCommand
67
64
  local ____utils = require("functions.utils")
@@ -134,45 +131,6 @@ function ____exports.getRoomsOutsideGrid(self)
134
131
  function(____, readOnlyRoomDescriptor) return getRoomDescriptor(nil, readOnlyRoomDescriptor.SafeGridIndex) end
135
132
  )
136
133
  end
137
- --- Helper function to change the current room. It can be used for both teleportation and "normal"
138
- -- room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
139
- -- arguments.
140
- --
141
- -- Use this function instead of invoking the `Game.StartRoomTransition` method directly so that:
142
- -- - you do not forget to set `Level.LeaveDoor` property
143
- -- - to prevent crashing on invalid room grid indexes
144
- -- - to automatically handle Curse of the Maze
145
- --
146
- -- @param roomGridIndex The room grid index of the destination room.
147
- -- @param direction Optional. Default is `Direction.NO_DIRECTION`.
148
- -- @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
149
- -- @param force Optional. Whether to temporarily disable Curse of the Maze. Default is false. If set
150
- -- to false, then this function may not go to the provided room grid index.
151
- function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim, force)
152
- if direction == nil then
153
- direction = Direction.NO_DIRECTION
154
- end
155
- if roomTransitionAnim == nil then
156
- roomTransitionAnim = RoomTransitionAnim.TELEPORT
157
- end
158
- if force == nil then
159
- force = false
160
- end
161
- local level = game:GetLevel()
162
- local shouldTempDisableCurse = force and hasCurse(nil, LevelCurse.MAZE)
163
- if shouldTempDisableCurse then
164
- level:RemoveCurses(LevelCurse.MAZE)
165
- end
166
- local roomData = getRoomData(nil, roomGridIndex)
167
- if roomData == nil then
168
- error(("Failed to change the room to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
169
- end
170
- level.LeaveDoor = DoorSlot.NO_DOOR_SLOT
171
- game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
172
- if shouldTempDisableCurse then
173
- level:AddCurse(LevelCurse.MAZE, false)
174
- end
175
- end
176
134
  --- Helper function for quickly switching to a new room without playing a particular animation. Use
177
135
  -- this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
178
136
  -- not forget to set the `LeaveDoor` property and to prevent crashing on invalid room grid indexes.
@@ -218,14 +176,7 @@ function ____exports.getRoomDataForTypeVariant(self, roomType, roomVariant, canc
218
176
  Isaac.ExecuteCommand(command)
219
177
  local newRoomData = getRoomData(nil, GridRoom.DEBUG)
220
178
  if cancelRoomTransition then
221
- local roomGridIndex = getRoomGridIndex(nil)
222
- ____exports.teleport(
223
- nil,
224
- roomGridIndex,
225
- Direction.NO_DIRECTION,
226
- RoomTransitionAnim.FADE,
227
- true
228
- )
179
+ reloadRoom(nil)
229
180
  end
230
181
  return newRoomData
231
182
  end
package/dist/index.d.ts CHANGED
@@ -84,6 +84,7 @@ export * from "./functions/language";
84
84
  export * from "./functions/level";
85
85
  export * from "./functions/levelGrid";
86
86
  export * from "./functions/log";
87
+ export * from "./functions/logEntities";
87
88
  export * from "./functions/map";
88
89
  export * from "./functions/math";
89
90
  export * from "./functions/mergeTests";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,eAAe,GAChB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,gCAAgC,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C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AAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,yCAAyC,CAAC;AACxD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC"}
package/dist/index.lua CHANGED
@@ -670,6 +670,14 @@ do
670
670
  end
671
671
  end
672
672
  end
673
+ do
674
+ local ____export = require("functions.logEntities")
675
+ for ____exportKey, ____exportValue in pairs(____export) do
676
+ if ____exportKey ~= "default" then
677
+ ____exports[____exportKey] = ____exportValue
678
+ end
679
+ end
680
+ end
673
681
  do
674
682
  local ____export = require("functions.map")
675
683
  for ____exportKey, ____exportValue in pairs(____export) do
@@ -1,7 +1,7 @@
1
1
  import { LevelStage, StageType } from "isaac-typescript-definitions";
2
2
  export interface CustomTrapdoorDescription {
3
3
  open: boolean;
4
- destination: [stage: LevelStage, stageType: StageType] | string;
4
+ destination: [stage: LevelStage, stageType: StageType] | [customStageName: string, floorNum: int];
5
5
  firstSpawn: boolean;
6
6
  }
7
7
  //# sourceMappingURL=CustomTrapdoorDescription.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomTrapdoorDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC;IAChE,UAAU,EAAE,OAAO,CAAC;CACrB"}
1
+ {"version":3,"file":"CustomTrapdoorDescription.d.ts","sourceRoot":"","sources":["../../../src/interfaces/private/CustomTrapdoorDescription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EACP,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,CAAC,GACzC,CAAC,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;IAC7C,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -35,12 +35,12 @@ ____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
35
35
  [BackdropType.GREED_SHOP] = RockAltType.URN,
36
36
  [BackdropType.DUNGEON] = RockAltType.URN,
37
37
  [BackdropType.SACRIFICE] = RockAltType.SKULL,
38
- [BackdropType.DOWNPOUR] = RockAltType.BUCKET,
38
+ [BackdropType.DOWNPOUR] = RockAltType.BUCKET_DOWNPOUR,
39
39
  [BackdropType.MINES] = RockAltType.MUSHROOM,
40
40
  [BackdropType.MAUSOLEUM] = RockAltType.SKULL,
41
41
  [BackdropType.CORPSE] = RockAltType.POLYP,
42
42
  [BackdropType.PLANETARIUM] = RockAltType.URN,
43
- [BackdropType.DOWNPOUR_ENTRANCE] = RockAltType.BUCKET,
43
+ [BackdropType.DOWNPOUR_ENTRANCE] = RockAltType.BUCKET_DOWNPOUR,
44
44
  [BackdropType.MINES_ENTRANCE] = RockAltType.MUSHROOM,
45
45
  [BackdropType.MAUSOLEUM_ENTRANCE] = RockAltType.SKULL,
46
46
  [BackdropType.CORPSE_ENTRANCE] = RockAltType.SKULL,
@@ -49,7 +49,7 @@ ____exports.BACKDROP_TYPE_TO_ROCK_ALT_TYPE = {
49
49
  [BackdropType.MAUSOLEUM_4] = RockAltType.SKULL,
50
50
  [BackdropType.CORPSE_2] = RockAltType.POLYP,
51
51
  [BackdropType.CORPSE_3] = RockAltType.POLYP,
52
- [BackdropType.DROSS] = RockAltType.BUCKET,
52
+ [BackdropType.DROSS] = RockAltType.BUCKET_DROSS,
53
53
  [BackdropType.ASHPIT] = RockAltType.MUSHROOM,
54
54
  [BackdropType.GEHENNA] = RockAltType.SKULL,
55
55
  [BackdropType.MORTIS] = RockAltType.POLYP,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "6.20.2",
3
+ "version": "6.21.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -21,8 +21,8 @@ export const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
21
21
  /**
22
22
  * Will change depending on how many modded collectibles there are.
23
23
  *
24
- * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles. We
25
- * subtract one to account for `CollectibleType.NULL`.)
24
+ * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles, like
25
+ * 666. We subtract one to account for `CollectibleType.NULL`.)
26
26
  */
27
27
  export const LAST_COLLECTIBLE_TYPE = (itemConfig.GetCollectibles().Size -
28
28
  1) as CollectibleType;
@@ -3,5 +3,18 @@ export enum RockAltType {
3
3
  MUSHROOM,
4
4
  SKULL,
5
5
  POLYP,
6
- BUCKET,
6
+
7
+ /**
8
+ * Destroying buckets in Downpour give different outcomes than in Dross.
9
+ *
10
+ * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets
11
+ */
12
+ BUCKET_DOWNPOUR,
13
+
14
+ /**
15
+ * Destroying buckets in Dross give different outcomes than in Downpour.
16
+ *
17
+ * See: https://bindingofisaacrebirth.fandom.com/wiki/Rocks#Buckets
18
+ */
19
+ BUCKET_DROSS,
7
20
  }
@@ -83,6 +83,7 @@ const N_FLOOR_ANM2_LAYERS: readonly int[] = [18, 19];
83
83
  * time passes, like most other effects.
84
84
  */
85
85
  const BACKDROP_EFFECT_VARIANT = EffectVariant.LADDER;
86
+ const BACKDROP_EFFECT_SUBTYPE = 101;
86
87
 
87
88
  const BACKDROP_ROOM_TYPE_SET: ReadonlySet<RoomType> = new Set([
88
89
  RoomType.DEFAULT,
@@ -132,7 +133,7 @@ function spawnWallEntity(
132
133
  // does this. (`EntityFlag.RENDER_WALL` is intended for this purpose.)
133
134
  const wallEffect = spawnEffectWithSeed(
134
135
  BACKDROP_EFFECT_VARIANT,
135
- 0,
136
+ BACKDROP_EFFECT_SUBTYPE,
136
137
  VectorZero,
137
138
  1 as Seed,
138
139
  );
@@ -1 +1,17 @@
1
1
  export const ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = "gfx/isaacscript-custom-stage";
2
+
3
+ /** Corresponds to "ui_streak.anm2". */
4
+ export enum UIStreakAnimation {
5
+ NONE,
6
+ TEXT,
7
+ TEXT_STAY,
8
+ }
9
+
10
+ /** Corresponds to "ui_streak.anm2". */
11
+ export const UI_STREAK_ANIMATION_END_FRAMES: {
12
+ readonly [key in UIStreakAnimation]: int;
13
+ } = {
14
+ [UIStreakAnimation.NONE]: 0,
15
+ [UIStreakAnimation.TEXT]: 69,
16
+ [UIStreakAnimation.TEXT_STAY]: 1,
17
+ } as const;