isaacscript-common 6.2.1 → 6.5.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 (109) hide show
  1. package/cachedClasses.d.ts +15 -0
  2. package/cachedClasses.lua +20 -0
  3. package/callbacks/reorderedCallbacks.d.ts +9 -0
  4. package/callbacks/reorderedCallbacks.lua +9 -0
  5. package/constants.d.ts +26 -4
  6. package/constants.lua +20 -4
  7. package/enums/CornerType.d.ts +6 -0
  8. package/enums/CornerType.lua +11 -0
  9. package/enums/DecorationVariant.d.ts +9 -0
  10. package/enums/DecorationVariant.lua +7 -0
  11. package/enums/RockAltType.d.ts +7 -0
  12. package/enums/RockAltType.lua +13 -0
  13. package/features/customGridEntity.d.ts +2 -2
  14. package/features/customGridEntity.lua +7 -5
  15. package/features/customStage/backdrop.d.ts +2 -0
  16. package/features/customStage/backdrop.lua +211 -0
  17. package/features/customStage/customStageConstants.d.ts +1 -0
  18. package/features/customStage/customStageConstants.lua +3 -0
  19. package/features/customStage/exports.d.ts +28 -0
  20. package/features/customStage/exports.lua +58 -1
  21. package/features/customStage/gridEntities.d.ts +18 -0
  22. package/features/customStage/gridEntities.lua +215 -0
  23. package/features/customStage/init.d.ts +2 -1
  24. package/features/customStage/init.lua +71 -9
  25. package/features/customStage/streakText.d.ts +2 -0
  26. package/features/customStage/streakText.lua +22 -0
  27. package/features/customStage/v.d.ts +10 -0
  28. package/features/customStage/v.lua +4 -0
  29. package/features/customStage/versusScreen.d.ts +3 -0
  30. package/features/customStage/versusScreen.lua +201 -0
  31. package/features/debugDisplay/debugDisplay.lua +2 -0
  32. package/features/debugDisplay/exports.d.ts +108 -0
  33. package/features/debugDisplay/exports.lua +145 -0
  34. package/features/debugDisplay/v.d.ts +2 -0
  35. package/features/debugDisplay/v.lua +9 -0
  36. package/features/deployJSONRoom.lua +6 -2
  37. package/features/extraConsoleCommands/init.lua +10 -1
  38. package/features/extraConsoleCommands/listCommands.d.ts +21 -6
  39. package/features/extraConsoleCommands/listCommands.lua +50 -19
  40. package/features/extraConsoleCommands/v.d.ts +1 -0
  41. package/features/extraConsoleCommands/v.lua +2 -1
  42. package/features/pause.d.ts +11 -0
  43. package/features/pause.lua +71 -0
  44. package/features/runNextRoom.d.ts +8 -0
  45. package/features/runNextRoom.lua +40 -0
  46. package/features/saveDataManager/exports.lua +2 -2
  47. package/features/saveDataManager/load.lua +3 -3
  48. package/features/saveDataManager/main.lua +3 -3
  49. package/features/saveDataManager/merge.lua +2 -2
  50. package/features/saveDataManager/save.lua +3 -3
  51. package/features/saveDataManager/{constants.d.ts → saveDataManagerConstants.d.ts} +0 -0
  52. package/features/saveDataManager/{constants.lua → saveDataManagerConstants.lua} +0 -0
  53. package/functions/chargeBar.lua +4 -6
  54. package/functions/color.d.ts +0 -2
  55. package/functions/color.lua +0 -4
  56. package/functions/deepCopy.lua +2 -2
  57. package/functions/direction.d.ts +1 -1
  58. package/functions/doors.d.ts +12 -7
  59. package/functions/doors.lua +14 -11
  60. package/functions/entity.d.ts +5 -0
  61. package/functions/entity.lua +13 -0
  62. package/functions/gridEntity.d.ts +39 -0
  63. package/functions/gridEntity.lua +83 -2
  64. package/functions/kColor.d.ts +0 -2
  65. package/functions/kColor.lua +0 -4
  66. package/functions/log.lua +2 -1
  67. package/functions/pickups.d.ts +9 -9
  68. package/functions/playerCenter.lua +4 -5
  69. package/functions/playerIndex.d.ts +3 -0
  70. package/functions/playerIndex.lua +3 -0
  71. package/functions/roomShape.d.ts +10 -4
  72. package/functions/roomShape.lua +15 -2
  73. package/functions/run.d.ts +7 -0
  74. package/functions/run.lua +16 -4
  75. package/functions/sprite.d.ts +1 -1
  76. package/functions/sprite.lua +1 -1
  77. package/functions/ui.d.ts +2 -0
  78. package/functions/ui.lua +8 -0
  79. package/functions/utils.d.ts +6 -4
  80. package/functions/utils.lua +6 -4
  81. package/index.d.ts +1 -1
  82. package/index.lua +2 -0
  83. package/initFeatures.lua +7 -1
  84. package/interfaces/Corner.d.ts +6 -0
  85. package/interfaces/Corner.lua +2 -0
  86. package/interfaces/CustomStageLua.d.ts +236 -63
  87. package/objects/backdropTypeToRockAltType.d.ts +6 -0
  88. package/objects/backdropTypeToRockAltType.lua +69 -0
  89. package/objects/bossNamePNGFileNames.d.ts +5 -0
  90. package/objects/bossNamePNGFileNames.lua +108 -0
  91. package/objects/bossPortraitPNGFileNames.d.ts +5 -0
  92. package/objects/bossPortraitPNGFileNames.lua +108 -0
  93. package/objects/colors.d.ts +15 -8
  94. package/objects/colors.lua +9 -2
  95. package/objects/playerNamePNGFileNames.d.ts +5 -0
  96. package/objects/playerNamePNGFileNames.lua +49 -0
  97. package/objects/playerPortraitPNGFileNames.d.ts +5 -0
  98. package/objects/playerPortraitPNGFileNames.lua +49 -0
  99. package/objects/roomShapeCorners.d.ts +6 -0
  100. package/objects/roomShapeCorners.lua +259 -0
  101. package/objects/roomShapeToBottomRightPosition.d.ts +1 -1
  102. package/objects/roomShapeToTopLeftPosition.d.ts +1 -1
  103. package/objects/versusScreenBackgroundColors.d.ts +5 -0
  104. package/objects/versusScreenBackgroundColors.lua +38 -0
  105. package/objects/versusScreenDirtSpotColors.d.ts +5 -0
  106. package/objects/versusScreenDirtSpotColors.lua +38 -0
  107. package/package.json +2 -2
  108. package/sets/narrowRoomShapesSet.d.ts +2 -0
  109. package/sets/narrowRoomShapesSet.lua +8 -0
@@ -10,6 +10,15 @@ end
10
10
  function defaultGridEntityDisplayCallback(self, gridEntity)
11
11
  return getGridEntityID(nil, gridEntity)
12
12
  end
13
+ local debugDisplayEnabled = false
14
+ function ____exports.setDebugDisplayEnabled(self)
15
+ debugDisplayEnabled = true
16
+ end
17
+ function ____exports.errorIfDebugDisplayNotInitialized(self)
18
+ if not debugDisplayEnabled then
19
+ error("The \"debugDisplay\" feature is not initialized. You must run the \"enableExtraConsoleCommands\" function once at the beginning of your mod in order for this feature to work.")
20
+ end
21
+ end
13
22
  local v = {run = {
14
23
  player = false,
15
24
  tear = false,
@@ -28,6 +28,7 @@ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNot
28
28
  local ____array = require("functions.array")
29
29
  local emptyArray = ____array.emptyArray
30
30
  local ____entity = require("functions.entity")
31
+ local getEntityIDFromConstituents = ____entity.getEntityIDFromConstituents
31
32
  local removeAllMatchingEntities = ____entity.removeAllMatchingEntities
32
33
  local spawn = ____entity.spawn
33
34
  local spawnWithSeed = ____entity.spawnWithSeed
@@ -39,6 +40,7 @@ local ____gridEntity = require("functions.gridEntity")
39
40
  local convertXMLGridEntityType = ____gridEntity.convertXMLGridEntityType
40
41
  local getAllGridIndexes = ____gridEntity.getAllGridIndexes
41
42
  local getGridEntities = ____gridEntity.getGridEntities
43
+ local getGridEntityIDFromConstituents = ____gridEntity.getGridEntityIDFromConstituents
42
44
  local removeAllGridExcept = ____gridEntity.removeAllGridExcept
43
45
  local removeGrid = ____gridEntity.removeGrid
44
46
  local setGridEntityInvisible = ____gridEntity.setGridEntityInvisible
@@ -239,7 +241,8 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
239
241
  end
240
242
  if entityType >= 1000 then
241
243
  if verbose then
242
- log(((((((("Spawning grid entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
244
+ local gridEntityID = getGridEntityIDFromConstituents(nil, entityType, variant)
245
+ log(((((("Spawning grid entity " .. gridEntityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
243
246
  end
244
247
  spawnGridEntityForJSONRoom(
245
248
  nil,
@@ -250,7 +253,8 @@ function spawnAllEntities(self, jsonRoom, rng, verbose)
250
253
  )
251
254
  else
252
255
  if verbose then
253
- log(((((((((("Spawning normal entity " .. tostring(entityType)) .. ".") .. tostring(variant)) .. ".") .. tostring(subType)) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
256
+ local entityID = getEntityIDFromConstituents(nil, entityType, variant, subType)
257
+ log(((((("Spawning normal entity " .. entityID) .. " at: (") .. tostring(x)) .. ", ") .. tostring(y)) .. ")")
254
258
  end
255
259
  local entity = spawnNormalEntityForJSONRoom(
256
260
  nil,
@@ -1,7 +1,7 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local Map = ____lualib.Map
3
3
  local ____exports = {}
4
- local initMap, initCallbacks, postUpdate, evaluateCacheFireDelay, evaluateCacheSpeed, entityTakeDmgPlayer, postCurseEval, executeCmd, postFireTear
4
+ local initMap, initCallbacks, postUpdate, evaluateCacheFireDelay, evaluateCacheSpeed, evaluateCacheFlying, entityTakeDmgPlayer, postCurseEval, executeCmd, postFireTear
5
5
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
6
6
  local CacheFlag = ____isaac_2Dtypescript_2Ddefinitions.CacheFlag
7
7
  local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
@@ -72,6 +72,7 @@ function initMap(self)
72
72
  extraConsoleCommandsFunctionMap:set("eternalHearts", commands.eternalHearts)
73
73
  extraConsoleCommandsFunctionMap:set("familiarDisplay", commandsDisplay.familiarDisplay)
74
74
  extraConsoleCommandsFunctionMap:set("familiarsDisplay", commandsDisplay.familiarsDisplay)
75
+ extraConsoleCommandsFunctionMap:set("flight", commands.flight)
75
76
  extraConsoleCommandsFunctionMap:set("fool", commands.fool)
76
77
  extraConsoleCommandsFunctionMap:set("getPosition", commands.getPosition)
77
78
  extraConsoleCommandsFunctionMap:set("gigaBomb", commands.gigaBomb)
@@ -83,6 +84,7 @@ function initMap(self)
83
84
  extraConsoleCommandsFunctionMap:set("goldenKey", commands.goldenKey)
84
85
  extraConsoleCommandsFunctionMap:set("grid", commands.grid)
85
86
  extraConsoleCommandsFunctionMap:set("grid2", commands.grid2)
87
+ extraConsoleCommandsFunctionMap:set("gridCosts", commands.gridCosts)
86
88
  extraConsoleCommandsFunctionMap:set("gridEntities", commands.gridEntities)
87
89
  extraConsoleCommandsFunctionMap:set("h", commands.h)
88
90
  extraConsoleCommandsFunctionMap:set("hearts", commands.hearts)
@@ -167,6 +169,7 @@ function initMap(self)
167
169
  extraConsoleCommandsFunctionMap:set("trapdoor", commands.trapdoorCommand)
168
170
  extraConsoleCommandsFunctionMap:set("treasure", commands.treasure)
169
171
  extraConsoleCommandsFunctionMap:set("ultraSecret", commands.ultraSecret)
172
+ extraConsoleCommandsFunctionMap:set("unseed", commands.unseed)
170
173
  extraConsoleCommandsFunctionMap:set("up", commands.up)
171
174
  extraConsoleCommandsFunctionMap:set("warp", commands.warp)
172
175
  end
@@ -174,6 +177,7 @@ function initCallbacks(self, mod)
174
177
  mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
175
178
  mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheFireDelay, CacheFlag.FIRE_DELAY)
176
179
  mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheSpeed, CacheFlag.SPEED)
180
+ mod:AddCallback(ModCallback.EVALUATE_CACHE, evaluateCacheFlying, CacheFlag.FLYING)
177
181
  mod:AddCallback(ModCallback.ENTITY_TAKE_DMG, entityTakeDmgPlayer, EntityType.PLAYER)
178
182
  mod:AddCallback(ModCallback.POST_CURSE_EVAL, postCurseEval)
179
183
  mod:AddCallback(ModCallback.EXECUTE_CMD, executeCmd)
@@ -195,6 +199,11 @@ function evaluateCacheSpeed(self, player)
195
199
  player.MoveSpeed = MAX_SPEED_STAT
196
200
  end
197
201
  end
202
+ function evaluateCacheFlying(self, player)
203
+ if v.run.flight then
204
+ player.CanFly = true
205
+ end
206
+ end
198
207
  function entityTakeDmgPlayer(self)
199
208
  if v.run.spamBloodRights then
200
209
  return false
@@ -65,7 +65,10 @@ export declare function card(params: string): void;
65
65
  export declare function cards(): void;
66
66
  /** Alias for the "chaosCardTears" command. */
67
67
  export declare function cc(): void;
68
- /** Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10". */
68
+ /**
69
+ * Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
70
+ * "debug 10".
71
+ */
69
72
  export declare function chaosCardTears(): void;
70
73
  /**
71
74
  * Restart as the specified character. Accepts either the character sub-type or the partial name of
@@ -96,7 +99,7 @@ export declare function crawlSpace(): void;
96
99
  export declare function d20(): void;
97
100
  /** Uses the D6. */
98
101
  export declare function d6(): void;
99
- /** Toggles extremely high-damage tears. */
102
+ /** Toggles extremely high-damage tears for the player. */
100
103
  export declare function damage(): void;
101
104
  /** Alias for the "devil" command. */
102
105
  export declare function dd(): void;
@@ -124,6 +127,8 @@ export declare function error(): void;
124
127
  * numbers to remove hearts.)
125
128
  */
126
129
  export declare function eternalHearts(params: string): void;
130
+ /** Toggles flight for the player. */
131
+ export declare function flight(params: string): void;
127
132
  /** Alias for the "startingRoom" command. */
128
133
  export declare function fool(): void;
129
134
  /** Prints the current position of all players. */
@@ -148,10 +153,15 @@ export declare function goldenBomb(): void;
148
153
  export declare function goldenHearts(params: string): void;
149
154
  /** Gives the player a golden key. */
150
155
  export declare function goldenKey(): void;
151
- /** Alias for the "debug 2" command. */
156
+ /**
157
+ * Alias for the "debug 11" command. Useful for seeing the coordinates and grid index of each tile
158
+ * in the room.
159
+ */
152
160
  export declare function grid(): void;
153
- /** Alias for the "debug 11" command. */
161
+ /** Alias for the "gridCosts" command. */
154
162
  export declare function grid2(): void;
163
+ /** Alias for the "debug 2" command. Useful for seeing the grid costs of each tile in the room. */
164
+ export declare function gridCosts(): void;
155
165
  /** Spawns every grid entity, starting at the top-left-most tile. */
156
166
  export declare function gridEntities(): void;
157
167
  /** Alias for the "hearts" command. */
@@ -324,13 +334,16 @@ export declare function sounds(): void;
324
334
  export declare function spam(): void;
325
335
  /** Spawns a golden version of the specified trinket type. */
326
336
  export declare function spawnGoldenTrinket(params: string): void;
327
- /** Toggles maximum movement speed and flight. */
337
+ /** Toggles maximum movement speed and flight for the player. */
328
338
  export declare function speed(): void;
329
339
  /** Warps to the starting room of the floor. */
330
340
  export declare function startingRoom(): void;
331
341
  /** Warps to the first Super Secret Room on the floor. */
332
342
  export declare function superSecret(): void;
333
- /** Toggles extremely high tears stat (e.g. fire rate), equivalent of that to soy milk. */
343
+ /**
344
+ * Toggles an extremely high tears stat (e.g. fire rate) for the player, equivalent of that to soy
345
+ * milk.
346
+ */
334
347
  export declare function tears(): void;
335
348
  /** Creates a trapdoor next to the player. */
336
349
  export declare function trapdoorCommand(): void;
@@ -338,6 +351,8 @@ export declare function trapdoorCommand(): void;
338
351
  export declare function treasure(): void;
339
352
  /** Warps to the first Ultra Secret Room on the floor. */
340
353
  export declare function ultraSecret(): void;
354
+ /** If currently on a set seed, changes to an unseeded state and restarts the game. */
355
+ export declare function unseed(): void;
341
356
  /** Moves the player 0.5 units up. Provide a number to move a custom amount of units. */
342
357
  export declare function up(params: string): void;
343
358
  /**
@@ -64,7 +64,9 @@ local spawnTrinket = ____pickups.spawnTrinket
64
64
  local ____pills = require("functions.pills")
65
65
  local getPillEffectName = ____pills.getPillEffectName
66
66
  local ____player = require("functions.player")
67
+ local addCollectibleCostume = ____player.addCollectibleCostume
67
68
  local getPlayerName = ____player.getPlayerName
69
+ local removeCollectibleCostume = ____player.removeCollectibleCostume
68
70
  local useActiveItemTemp = ____player.useActiveItemTemp
69
71
  local ____playerIndex = require("functions.playerIndex")
70
72
  local getPlayers = ____playerIndex.getPlayers
@@ -74,7 +76,9 @@ local ____rooms = require("functions.rooms")
74
76
  local changeRoom = ____rooms.changeRoom
75
77
  local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
76
78
  local ____run = require("functions.run")
79
+ local onSetSeed = ____run.onSetSeed
77
80
  local restart = ____run.restart
81
+ local setUnseeded = ____run.setUnseeded
78
82
  local ____trinkets = require("functions.trinkets")
79
83
  local getGoldenTrinketType = ____trinkets.getGoldenTrinketType
80
84
  local ____utils = require("functions.utils")
@@ -104,7 +108,8 @@ local v = ____v.default
104
108
  function ____exports.blackHearts(self, params)
105
109
  addHeart(nil, params, HealthType.BLACK)
106
110
  end
107
- --- Toggles Chaos Card tears. Useful for killing enemies very fast without using "debug 10".
111
+ --- Toggles Chaos Card tears for the player. Useful for killing enemies very fast without using
112
+ -- "debug 10".
108
113
  function ____exports.chaosCardTears(self)
109
114
  v.run.chaosCardTears = not v.run.chaosCardTears
110
115
  printEnabled(nil, v.run.chaosCardTears, "Chaos Card tears")
@@ -134,6 +139,10 @@ function ____exports.goldenKey(self)
134
139
  local player = Isaac.GetPlayer()
135
140
  player:AddGoldenKey()
136
141
  end
142
+ --- Alias for the "debug 2" command. Useful for seeing the grid costs of each tile in the room.
143
+ function ____exports.gridCosts(self)
144
+ Isaac.ExecuteCommand("debug 2")
145
+ end
137
146
  --- Gives a half red heart. Provide a number to give a custom amount of hearts. (You can use negative
138
147
  -- numbers to remove hearts.)
139
148
  function ____exports.hearts(self, params)
@@ -480,7 +489,7 @@ function ____exports.d6(self)
480
489
  local player = Isaac.GetPlayer()
481
490
  useActiveItemTemp(nil, player, CollectibleType.D6)
482
491
  end
483
- --- Toggles extremely high-damage tears.
492
+ --- Toggles extremely high-damage tears for the player.
484
493
  function ____exports.damage(self)
485
494
  v.run.maxDamage = not v.run.maxDamage
486
495
  printEnabled(nil, v.run.maxDamage, "debug damage")
@@ -520,6 +529,25 @@ end
520
529
  function ____exports.error(self)
521
530
  ____exports.iAmError(nil)
522
531
  end
532
+ --- Toggles flight for the player.
533
+ function ____exports.flight(self, params)
534
+ local player = Isaac.GetPlayer()
535
+ v.run.flight = not v.run.flight
536
+ if params == "true" then
537
+ v.run.flight = true
538
+ elseif params == "false" then
539
+ v.run.flight = false
540
+ end
541
+ player:AddCacheFlags(CacheFlag.FLYING)
542
+ player:EvaluateItems()
543
+ local collectibleUsedToShowFlight = CollectibleType.FATE
544
+ if v.run.flight then
545
+ addCollectibleCostume(nil, player, collectibleUsedToShowFlight)
546
+ else
547
+ removeCollectibleCostume(nil, player, collectibleUsedToShowFlight)
548
+ end
549
+ printEnabled(nil, v.run.maxSpeed, "max speed")
550
+ end
523
551
  --- Alias for the "startingRoom" command.
524
552
  function ____exports.fool(self)
525
553
  ____exports.startingRoom(nil)
@@ -561,13 +589,14 @@ end
561
589
  function ____exports.goldKey(self)
562
590
  ____exports.goldenKey(nil)
563
591
  end
564
- --- Alias for the "debug 2" command.
592
+ --- Alias for the "debug 11" command. Useful for seeing the coordinates and grid index of each tile
593
+ -- in the room.
565
594
  function ____exports.grid(self)
566
- Isaac.ExecuteCommand("debug 2")
595
+ Isaac.ExecuteCommand("debug 11")
567
596
  end
568
- --- Alias for the "debug 11" command.
597
+ --- Alias for the "gridCosts" command.
569
598
  function ____exports.grid2(self)
570
- Isaac.ExecuteCommand("debug 11")
599
+ ____exports.gridCosts(nil)
571
600
  end
572
601
  --- Spawns every grid entity, starting at the top-left-most tile.
573
602
  function ____exports.gridEntities(self)
@@ -1018,29 +1047,22 @@ function ____exports.spawnGoldenTrinket(self, params)
1018
1047
  local centerPos = room:GetCenterPos()
1019
1048
  spawnTrinket(nil, goldenTrinketType, centerPos)
1020
1049
  end
1021
- --- Toggles maximum movement speed and flight.
1050
+ --- Toggles maximum movement speed and flight for the player.
1022
1051
  function ____exports.speed(self)
1023
1052
  local player = Isaac.GetPlayer()
1024
1053
  v.run.maxSpeed = not v.run.maxSpeed
1025
- if v.run.maxSpeed and not player.CanFly then
1026
- local numEternalHearts = player:GetEternalHearts()
1027
- if numEternalHearts == 0 then
1028
- player:AddCollectible(CollectibleType.FATE)
1029
- player:AddEternalHearts(-1)
1030
- else
1031
- player:AddEternalHearts(-1)
1032
- player:AddCollectible(CollectibleType.FATE)
1033
- end
1034
- end
1035
1054
  player:AddCacheFlags(CacheFlag.SPEED)
1036
1055
  player:EvaluateItems()
1037
- printEnabled(nil, v.run.maxSpeed, "max speed")
1056
+ local value = tostring(v.run.maxSpeed)
1057
+ ____exports.flight(nil, value)
1058
+ printEnabled(nil, v.run.maxSpeed, "max speed and flight")
1038
1059
  end
1039
1060
  --- Warps to the first Super Secret Room on the floor.
1040
1061
  function ____exports.superSecret(self)
1041
1062
  warpToRoomType(nil, RoomType.SUPER_SECRET)
1042
1063
  end
1043
- --- Toggles extremely high tears stat (e.g. fire rate), equivalent of that to soy milk.
1064
+ --- Toggles an extremely high tears stat (e.g. fire rate) for the player, equivalent of that to soy
1065
+ -- milk.
1044
1066
  function ____exports.tears(self)
1045
1067
  v.run.maxTears = not v.run.maxTears
1046
1068
  local player = Isaac.GetPlayer()
@@ -1060,6 +1082,15 @@ end
1060
1082
  function ____exports.ultraSecret(self)
1061
1083
  warpToRoomType(nil, RoomType.ULTRA_SECRET)
1062
1084
  end
1085
+ --- If currently on a set seed, changes to an unseeded state and restarts the game.
1086
+ function ____exports.unseed(self)
1087
+ if not onSetSeed(nil) then
1088
+ printConsole(nil, "You are not on a set seed, so you cannot unseed the run.")
1089
+ return
1090
+ end
1091
+ setUnseeded(nil)
1092
+ restart(nil)
1093
+ end
1063
1094
  --- Moves the player 0.5 units up. Provide a number to move a custom amount of units.
1064
1095
  function ____exports.up(self, params)
1065
1096
  movePlayer(nil, params, Direction.UP)
@@ -8,6 +8,7 @@ declare const v: {
8
8
  maxDamage: boolean;
9
9
  maxSpeed: boolean;
10
10
  maxTears: boolean;
11
+ flight: boolean;
11
12
  };
12
13
  };
13
14
  export default v;
@@ -7,7 +7,8 @@ local v = {persistent = {disableCurses = false}, run = {
7
7
  spamBloodRights = false,
8
8
  maxDamage = false,
9
9
  maxSpeed = false,
10
- maxTears = false
10
+ maxTears = false,
11
+ flight = false
11
12
  }}
12
13
  ____exports.default = v
13
14
  --- The contents of the map are initialized in the "init.ts" file.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Helper function to emulate what happens when the player pauses the game. Use the `unpause`
3
+ * function to return things back to normal.
4
+ *
5
+ * Under the hood, this function:
6
+ * - uses the Pause collectible on every game frame
7
+ * - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
8
+ */
9
+ export declare function pause(): void;
10
+ /** Helper function to put things back to normal after the `pause` function was used. */
11
+ export declare function unpause(): void;
@@ -0,0 +1,71 @@
1
+ local ____lualib = require("lualib_bundle")
2
+ local Set = ____lualib.Set
3
+ local __TS__New = ____lualib.__TS__New
4
+ local ____exports = {}
5
+ local postUpdate, inputActionGetActionValue, v
6
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
7
+ local ButtonAction = ____isaac_2Dtypescript_2Ddefinitions.ButtonAction
8
+ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
9
+ local InputHook = ____isaac_2Dtypescript_2Ddefinitions.InputHook
10
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
11
+ local ____log = require("functions.log")
12
+ local logError = ____log.logError
13
+ local ____player = require("functions.player")
14
+ local useActiveItemTemp = ____player.useActiveItemTemp
15
+ local ____disableInputs = require("features.disableInputs")
16
+ local disableAllInputsExceptFor = ____disableInputs.disableAllInputsExceptFor
17
+ local enableAllInputs = ____disableInputs.enableAllInputs
18
+ local ____exports = require("features.saveDataManager.exports")
19
+ local saveDataManager = ____exports.saveDataManager
20
+ function postUpdate(self)
21
+ if not v.run.isPseudoPaused then
22
+ return
23
+ end
24
+ local player = Isaac.GetPlayer()
25
+ useActiveItemTemp(nil, player, CollectibleType.PAUSE)
26
+ end
27
+ function inputActionGetActionValue(self, _entity, _inputHook, buttonAction)
28
+ if buttonAction ~= ButtonAction.SHOOT_RIGHT then
29
+ return
30
+ end
31
+ if not v.run.shouldUnpause then
32
+ return
33
+ end
34
+ v.run.shouldUnpause = false
35
+ return 1
36
+ end
37
+ local FEATURE_NAME = "pause"
38
+ v = {run = {isPseudoPaused = false, shouldUnpause = false}}
39
+ ---
40
+ -- @internal
41
+ function ____exports.pauseInit(self, mod)
42
+ saveDataManager(nil, FEATURE_NAME, v)
43
+ mod:AddCallback(ModCallback.POST_UPDATE, postUpdate)
44
+ mod:AddCallback(ModCallback.INPUT_ACTION, inputActionGetActionValue, InputHook.GET_ACTION_VALUE)
45
+ end
46
+ --- Helper function to emulate what happens when the player pauses the game. Use the `unpause`
47
+ -- function to return things back to normal.
48
+ --
49
+ -- Under the hood, this function:
50
+ -- - uses the Pause collectible on every game frame
51
+ -- - disables any player inputs (except for `ButtonAction.MENU_CONFIRM`)
52
+ function ____exports.pause(self)
53
+ if v.run.isPseudoPaused then
54
+ logError("Failed to pseudo-pause the game, since it was already pseudo-paused.")
55
+ return
56
+ end
57
+ v.run.isPseudoPaused = true
58
+ local whitelist = __TS__New(Set, {ButtonAction.MENU_CONFIRM})
59
+ disableAllInputsExceptFor(nil, FEATURE_NAME, whitelist)
60
+ end
61
+ --- Helper function to put things back to normal after the `pause` function was used.
62
+ function ____exports.unpause(self)
63
+ if not v.run.isPseudoPaused then
64
+ logError("Failed to pseudo-unpause the game, since it was not already pseudo-paused.")
65
+ return
66
+ end
67
+ v.run.isPseudoPaused = false
68
+ enableAllInputs(nil, FEATURE_NAME)
69
+ v.run.shouldUnpause = true
70
+ end
71
+ return ____exports
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Supply a function to run on the next `POST_NEW_ROOM` callback.
3
+ *
4
+ * Note that this function will not handle saving and quitting. If a player saving and quitting
5
+ * before the deferred function fires would cause a bug in your mod, then you should handle deferred
6
+ * functions manually using serializable data.
7
+ */
8
+ export declare function runNextRoom(func: () => void): void;
@@ -0,0 +1,40 @@
1
+ local ____exports = {}
2
+ local postNewRoomReordered, v
3
+ local ____ModCallbackCustom = require("enums.ModCallbackCustom")
4
+ local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
5
+ local ____featuresInitialized = require("featuresInitialized")
6
+ local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
7
+ local ____array = require("functions.array")
8
+ local emptyArray = ____array.emptyArray
9
+ local ____exports = require("features.saveDataManager.exports")
10
+ local saveDataManager = ____exports.saveDataManager
11
+ function postNewRoomReordered(self)
12
+ for ____, func in ipairs(v.run.queuedFunctions) do
13
+ func(nil)
14
+ end
15
+ emptyArray(nil, v.run.queuedFunctions)
16
+ end
17
+ local FEATURE_NAME = "runNextRoom"
18
+ v = {run = {queuedFunctions = {}}}
19
+ ---
20
+ -- @internal
21
+ function ____exports.runNextRoomInit(self, mod)
22
+ saveDataManager(
23
+ nil,
24
+ FEATURE_NAME,
25
+ v,
26
+ function() return false end
27
+ )
28
+ mod:AddCallbackCustom(ModCallbackCustom.POST_NEW_ROOM_REORDERED, postNewRoomReordered)
29
+ end
30
+ --- Supply a function to run on the next `POST_NEW_ROOM` callback.
31
+ --
32
+ -- Note that this function will not handle saving and quitting. If a player saving and quitting
33
+ -- before the deferred function fires would cause a bug in your mod, then you should handle deferred
34
+ -- functions manually using serializable data.
35
+ function ____exports.runNextRoom(self, func)
36
+ errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
37
+ local ____v_run_queuedFunctions_0 = v.run.queuedFunctions
38
+ ____v_run_queuedFunctions_0[#____v_run_queuedFunctions_0 + 1] = func
39
+ end
40
+ return ____exports
@@ -11,8 +11,6 @@ local ____deepCopy = require("functions.deepCopy")
11
11
  local deepCopy = ____deepCopy.deepCopy
12
12
  local ____types = require("functions.types")
13
13
  local isString = ____types.isString
14
- local ____constants = require("features.saveDataManager.constants")
15
- local SAVE_DATA_MANAGER_FEATURE_NAME = ____constants.SAVE_DATA_MANAGER_FEATURE_NAME
16
14
  local ____main = require("features.saveDataManager.main")
17
15
  local forceSaveDataManagerLoad = ____main.forceSaveDataManagerLoad
18
16
  local forceSaveDataManagerSave = ____main.forceSaveDataManagerSave
@@ -21,6 +19,8 @@ local ____maps = require("features.saveDataManager.maps")
21
19
  local saveDataConditionalFuncMap = ____maps.saveDataConditionalFuncMap
22
20
  local saveDataDefaultsMap = ____maps.saveDataDefaultsMap
23
21
  local saveDataMap = ____maps.saveDataMap
22
+ local ____saveDataManagerConstants = require("features.saveDataManager.saveDataManagerConstants")
23
+ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MANAGER_FEATURE_NAME
24
24
  --- This is the entry point to the save data manager, a system which provides two major features:
25
25
  --
26
26
  -- 1. automatic resetting of variables on a new run, on a new level, or on a new room (as desired)
@@ -12,11 +12,11 @@ local iterateTableInOrder = ____table.iterateTableInOrder
12
12
  local ____types = require("functions.types")
13
13
  local isString = ____types.isString
14
14
  local isTable = ____types.isTable
15
- local ____constants = require("features.saveDataManager.constants")
16
- local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
17
- local SAVE_DATA_MANAGER_FEATURE_NAME = ____constants.SAVE_DATA_MANAGER_FEATURE_NAME
18
15
  local ____merge = require("features.saveDataManager.merge")
19
16
  local merge = ____merge.merge
17
+ local ____saveDataManagerConstants = require("features.saveDataManager.saveDataManagerConstants")
18
+ local SAVE_DATA_MANAGER_DEBUG = ____saveDataManagerConstants.SAVE_DATA_MANAGER_DEBUG
19
+ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MANAGER_FEATURE_NAME
20
20
  function readSaveDatFile(self, mod)
21
21
  local renderFrameCount = Isaac.GetFrameCount()
22
22
  local ok, jsonStringOrErrMsg = pcall(tryLoadModData, mod)
@@ -21,9 +21,6 @@ local logError = ____log.logError
21
21
  local ____table = require("functions.table")
22
22
  local clearTable = ____table.clearTable
23
23
  local iterateTableInOrder = ____table.iterateTableInOrder
24
- local ____constants = require("features.saveDataManager.constants")
25
- local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
26
- local SAVE_DATA_MANAGER_FEATURE_NAME = ____constants.SAVE_DATA_MANAGER_FEATURE_NAME
27
24
  local ____load = require("features.saveDataManager.load")
28
25
  local loadFromDisk = ____load.loadFromDisk
29
26
  local ____maps = require("features.saveDataManager.maps")
@@ -32,6 +29,9 @@ local saveDataDefaultsMap = ____maps.saveDataDefaultsMap
32
29
  local saveDataMap = ____maps.saveDataMap
33
30
  local ____save = require("features.saveDataManager.save")
34
31
  local saveToDisk = ____save.saveToDisk
32
+ local ____saveDataManagerConstants = require("features.saveDataManager.saveDataManagerConstants")
33
+ local SAVE_DATA_MANAGER_DEBUG = ____saveDataManagerConstants.SAVE_DATA_MANAGER_DEBUG
34
+ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MANAGER_FEATURE_NAME
35
35
  function postPlayerInit(self)
36
36
  if mod == nil then
37
37
  error(("The mod for the " .. SAVE_DATA_MANAGER_FEATURE_NAME) .. " was not initialized.")
@@ -26,8 +26,8 @@ local ____types = require("functions.types")
26
26
  local isTable = ____types.isTable
27
27
  local ____utils = require("functions.utils")
28
28
  local getTraversalDescription = ____utils.getTraversalDescription
29
- local ____constants = require("features.saveDataManager.constants")
30
- local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
29
+ local ____saveDataManagerConstants = require("features.saveDataManager.saveDataManagerConstants")
30
+ local SAVE_DATA_MANAGER_DEBUG = ____saveDataManagerConstants.SAVE_DATA_MANAGER_DEBUG
31
31
  local ____serializationBrand = require("features.saveDataManager.serializationBrand")
32
32
  local isSerializationBrand = ____serializationBrand.isSerializationBrand
33
33
  --- `merge` takes the values from a new table and recursively merges them into an old object (while
@@ -13,9 +13,9 @@ local ____log = require("functions.log")
13
13
  local log = ____log.log
14
14
  local ____table = require("functions.table")
15
15
  local iterateTableInOrder = ____table.iterateTableInOrder
16
- local ____constants = require("features.saveDataManager.constants")
17
- local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
18
- local SAVE_DATA_MANAGER_FEATURE_NAME = ____constants.SAVE_DATA_MANAGER_FEATURE_NAME
16
+ local ____saveDataManagerConstants = require("features.saveDataManager.saveDataManagerConstants")
17
+ local SAVE_DATA_MANAGER_DEBUG = ____saveDataManagerConstants.SAVE_DATA_MANAGER_DEBUG
18
+ local SAVE_DATA_MANAGER_FEATURE_NAME = ____saveDataManagerConstants.SAVE_DATA_MANAGER_FEATURE_NAME
19
19
  function getAllSaveDataToWriteToDisk(self, saveDataMap, saveDataConditionalFuncMap)
20
20
  local allSaveData = {}
21
21
  iterateTableInOrder(
@@ -1,7 +1,5 @@
1
1
  local ____exports = {}
2
2
  local getChargeBarClamp
3
- local ____constants = require("constants")
4
- local VectorZero = ____constants.VectorZero
5
3
  function getChargeBarClamp(self, charges, maxCharges)
6
4
  local meterMultiplier = 24 / maxCharges
7
5
  local meterClip = 26 - charges * meterMultiplier
@@ -37,11 +35,11 @@ end
37
35
  --- Helper function to render a charge bar on the screen. First, call the `newChargeBarSprites`
38
36
  -- function to initialize the sprites, and then call this function on every render frame.
39
37
  function ____exports.renderChargeBar(self, sprites, position, normalCharges, batteryCharges)
40
- sprites.back:Render(position, VectorZero, VectorZero)
38
+ sprites.back:Render(position)
41
39
  local normalChargesClamp = getChargeBarClamp(nil, normalCharges, sprites.maxCharges)
42
- sprites.meter:Render(position, normalChargesClamp, VectorZero)
40
+ sprites.meter:Render(position, normalChargesClamp)
43
41
  local batteryChargesClamp = getChargeBarClamp(nil, batteryCharges, sprites.maxCharges)
44
- sprites.meterBattery:Render(position, batteryChargesClamp, VectorZero)
45
- sprites.lines:Render(position, VectorZero, VectorZero)
42
+ sprites.meterBattery:Render(position, batteryChargesClamp)
43
+ sprites.lines:Render(position)
46
44
  end
47
45
  return ____exports
@@ -19,8 +19,6 @@ export declare function colorEquals(color1: Color, color2: Color): boolean;
19
19
  */
20
20
  export declare function copyColor<C extends Color | SerializedColor, S extends SerializationType>(color: C, serializationType: S): CopyColorReturn[S];
21
21
  export declare function copyColor<C extends Color | SerializedColor>(color: C): CopyColorReturn[SerializationType.NONE];
22
- /** Returns `Color(1, 1, 1)`. */
23
- export declare function getDefaultColor(): Color;
24
22
  /** Helper function to check if something is an instantiated Color object. */
25
23
  export declare function isColor(object: unknown): object is Color;
26
24
  /**
@@ -104,10 +104,6 @@ function ____exports.copyColor(self, color, serializationType)
104
104
  end
105
105
  until true
106
106
  end
107
- --- Returns `Color(1, 1, 1)`.
108
- function ____exports.getDefaultColor(self)
109
- return Color(1, 1, 1)
110
- end
111
107
  --- Used to determine is the given table is a serialized `Color` object created by the save data
112
108
  -- manager and/or the `deepCopy` function.
113
109
  function ____exports.isSerializedColor(self, object)
@@ -15,8 +15,8 @@ local ____SerializationBrand = require("enums.private.SerializationBrand")
15
15
  local SerializationBrand = ____SerializationBrand.SerializationBrand
16
16
  local ____SerializationType = require("enums.SerializationType")
17
17
  local SerializationType = ____SerializationType.SerializationType
18
- local ____constants = require("features.saveDataManager.constants")
19
- local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
18
+ local ____saveDataManagerConstants = require("features.saveDataManager.saveDataManagerConstants")
19
+ local SAVE_DATA_MANAGER_DEBUG = ____saveDataManagerConstants.SAVE_DATA_MANAGER_DEBUG
20
20
  local ____serializationBrand = require("features.saveDataManager.serializationBrand")
21
21
  local isSerializationBrand = ____serializationBrand.isSerializationBrand
22
22
  local ____array = require("functions.array")
@@ -8,5 +8,5 @@ import { Direction } from "isaac-typescript-definitions";
8
8
  */
9
9
  export declare function angleToDirection(angleDegrees: int): Direction;
10
10
  export declare function directionToDegrees(direction: Direction): int;
11
- export declare function directionToVector(direction: Direction): Vector;
11
+ export declare function directionToVector(direction: Direction): Readonly<Vector>;
12
12
  export declare function getDirectionName(direction: Direction): string | undefined;