isaacscript-common 1.2.286 → 1.2.289

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 (35) hide show
  1. package/dist/callbacks/postEffectStateChanged.d.ts +1 -0
  2. package/dist/callbacks/postEffectStateChanged.lua +35 -0
  3. package/dist/callbacks/postFamiliarStateChanged.d.ts +1 -0
  4. package/dist/callbacks/postFamiliarStateChanged.lua +35 -0
  5. package/dist/callbacks/postNPCStateChanged.d.ts +1 -0
  6. package/dist/callbacks/postNPCStateChanged.lua +35 -0
  7. package/dist/callbacks/postPickupStateChanged.d.ts +1 -0
  8. package/dist/callbacks/postPickupStateChanged.lua +35 -0
  9. package/dist/callbacks/subscriptions/postEffectStateChanged.d.ts +2 -0
  10. package/dist/callbacks/subscriptions/postEffectStateChanged.lua +23 -0
  11. package/dist/callbacks/subscriptions/postFamiliarStateChanged.d.ts +2 -0
  12. package/dist/callbacks/subscriptions/postFamiliarStateChanged.lua +23 -0
  13. package/dist/callbacks/subscriptions/postNPCStateChanged.d.ts +2 -0
  14. package/dist/callbacks/subscriptions/postNPCStateChanged.lua +23 -0
  15. package/dist/callbacks/subscriptions/postPickupStateChanged.d.ts +2 -0
  16. package/dist/callbacks/subscriptions/postPickupStateChanged.lua +23 -0
  17. package/dist/enums/ModCallbacksCustom.d.ts +12 -8
  18. package/dist/enums/ModCallbacksCustom.lua +16 -8
  19. package/dist/features/debugDisplay.d.ts +80 -0
  20. package/dist/features/debugDisplay.lua +230 -0
  21. package/dist/features/extraConsoleCommands/commands.d.ts +6 -0
  22. package/dist/features/extraConsoleCommands/commands.lua +18 -118
  23. package/dist/features/extraConsoleCommands/commandsDisplay.d.ts +99 -0
  24. package/dist/features/extraConsoleCommands/commandsDisplay.lua +81 -0
  25. package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts +9 -0
  26. package/dist/features/extraConsoleCommands/commandsSubroutines.lua +126 -0
  27. package/dist/features/extraConsoleCommands/init.lua +26 -0
  28. package/dist/functions/utils.d.ts +12 -1
  29. package/dist/functions/utils.lua +4 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.lua +25 -0
  32. package/dist/objects/callbackRegisterFunctions.lua +12 -0
  33. package/dist/types/AddCallbackParametersCustom.d.ts +20 -0
  34. package/dist/upgradeMod.lua +28 -10
  35. package/package.json +1 -1
@@ -173,6 +173,8 @@ export declare function key(params: string): void;
173
173
  * to remove keys.)
174
174
  */
175
175
  export declare function keys(params: string): void;
176
+ /** Moves the player 0.5 units left. Provide a number to move a custom amount of units. */
177
+ export declare function left(params: string): void;
176
178
  /** Warps to the first Library on the floor. */
177
179
  export declare function library(): void;
178
180
  /**
@@ -244,6 +246,8 @@ export declare function positionCommand(): void;
244
246
  export declare function redHearts(params: string): void;
245
247
  /** Alias for the "redhearts" command. */
246
248
  export declare function rh(params: string): void;
249
+ /** Moves the player 0.5 units right. Provide a number to move a custom amount of units. */
250
+ export declare function right(params: string): void;
247
251
  /** Logs information about the room to the "log.txt" file. */
248
252
  export declare function roomCommand(): void;
249
253
  /**
@@ -325,6 +329,8 @@ export declare function trapdoorCommand(): void;
325
329
  export declare function treasure(): void;
326
330
  /** Warps to the first Ultra Secret Room on the floor. */
327
331
  export declare function ultraSecret(): void;
332
+ /** Moves the player 0.5 units up. Provide a number to move a custom amount of units. */
333
+ export declare function up(params: string): void;
328
334
  /**
329
335
  * Warps to the specified room type. Accepts either the room type number or the partial name of the
330
336
  * room type.
@@ -3,7 +3,6 @@ local Map = ____lualib.Map
3
3
  local __TS__StringSplit = ____lualib.__TS__StringSplit
4
4
  local __TS__StringSlice = ____lualib.__TS__StringSlice
5
5
  local ____exports = {}
6
- local addHeart, devilAngel, listEntities, listGridEntities, movePlayer, printEnabled, spawnTrapdoorOrCrawlspace, warpToRoomType, DEFAULT_MOVE_UNITS
7
6
  local ____cachedClasses = require("cachedClasses")
8
7
  local game = ____cachedClasses.game
9
8
  local sfxManager = ____cachedClasses.sfxManager
@@ -18,12 +17,8 @@ local ____character = require("functions.character")
18
17
  local getCharacterName = ____character.getCharacterName
19
18
  local ____entitySpecific = require("functions.entitySpecific")
20
19
  local getNPCs = ____entitySpecific.getNPCs
21
- local ____gridEntity = require("functions.gridEntity")
22
- local spawnGridWithVariant = ____gridEntity.spawnGridWithVariant
23
20
  local ____log = require("functions.log")
24
21
  local logEffects = ____log.logEffects
25
- local logEntities = ____log.logEntities
26
- local logGridEntities = ____log.logGridEntities
27
22
  local logRoom = ____log.logRoom
28
23
  local logSeedEffects = ____log.logSeedEffects
29
24
  local logSounds = ____log.logSounds
@@ -38,13 +33,8 @@ local getPillEffectName = ____pills.getPillEffectName
38
33
  local ____player = require("functions.player")
39
34
  local getPlayerName = ____player.getPlayerName
40
35
  local useActiveItemTemp = ____player.useActiveItemTemp
41
- local ____playerHealth = require("functions.playerHealth")
42
- local addPlayerHealthType = ____playerHealth.addPlayerHealthType
43
36
  local ____playerIndex = require("functions.playerIndex")
44
37
  local getPlayers = ____playerIndex.getPlayers
45
- local ____roomData = require("functions.roomData")
46
- local getRoomData = ____roomData.getRoomData
47
- local getRoomDescriptor = ____roomData.getRoomDescriptor
48
38
  local ____roomGrid = require("functions.roomGrid")
49
39
  local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
50
40
  local ____rooms = require("functions.rooms")
@@ -54,8 +44,7 @@ local ____run = require("functions.run")
54
44
  local restart = ____run.restart
55
45
  local ____utils = require("functions.utils")
56
46
  local printConsole = ____utils.printConsole
57
- local ____vector = require("functions.vector")
58
- local directionToVector = ____vector.directionToVector
47
+ local printEnabled = ____utils.printEnabled
59
48
  local ____cardMap = require("maps.cardMap")
60
49
  local CARD_MAP = ____cardMap.CARD_MAP
61
50
  local ____characterMap = require("maps.characterMap")
@@ -64,9 +53,14 @@ local ____pillEffectMap = require("maps.pillEffectMap")
64
53
  local PILL_EFFECT_MAP = ____pillEffectMap.PILL_EFFECT_MAP
65
54
  local ____roomTypeMap = require("maps.roomTypeMap")
66
55
  local ROOM_TYPE_MAP = ____roomTypeMap.ROOM_TYPE_MAP
67
- local ____roomTypeNames = require("objects.roomTypeNames")
68
- local DEFAULT_ROOM_TYPE_NAME = ____roomTypeNames.DEFAULT_ROOM_TYPE_NAME
69
- local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
56
+ local ____commandsSubroutines = require("features.extraConsoleCommands.commandsSubroutines")
57
+ local addHeart = ____commandsSubroutines.addHeart
58
+ local devilAngel = ____commandsSubroutines.devilAngel
59
+ local listEntities = ____commandsSubroutines.listEntities
60
+ local listGridEntities = ____commandsSubroutines.listGridEntities
61
+ local movePlayer = ____commandsSubroutines.movePlayer
62
+ local spawnTrapdoorOrCrawlspace = ____commandsSubroutines.spawnTrapdoorOrCrawlspace
63
+ local warpToRoomType = ____commandsSubroutines.warpToRoomType
70
64
  local ____v = require("features.extraConsoleCommands.v")
71
65
  local v = ____v.default
72
66
  function ____exports.blackHearts(self, params)
@@ -115,109 +109,6 @@ function ____exports.startingRoom(self)
115
109
  local startingRoomIndex = level:GetStartingRoomIndex()
116
110
  changeRoom(nil, startingRoomIndex)
117
111
  end
118
- function addHeart(self, params, healthType)
119
- local numHearts = healthType == HealthType.MAX_HEARTS and 2 or 1
120
- if params ~= "" then
121
- local num = tonumber(params)
122
- if num == nil then
123
- printConsole(nil, "That is an invalid amount of hearts to add.")
124
- return
125
- end
126
- numHearts = num
127
- end
128
- local player = Isaac.GetPlayer()
129
- addPlayerHealthType(nil, player, healthType, numHearts)
130
- end
131
- function devilAngel(self, useDevil)
132
- local level = game:GetLevel()
133
- local devilAngelRoomData = getRoomData(nil, GridRooms.ROOM_DEVIL_IDX)
134
- if devilAngelRoomData ~= nil then
135
- local roomType = devilAngelRoomData.Type
136
- local conflictingType = useDevil and RoomType.ROOM_ANGEL or RoomType.ROOM_DEVIL
137
- if roomType == conflictingType then
138
- local roomDescriptor = getRoomDescriptor(nil, GridRooms.ROOM_DEVIL_IDX)
139
- roomDescriptor.Data = nil
140
- end
141
- end
142
- if useDevil then
143
- level:InitializeDevilAngelRoom(false, true)
144
- else
145
- level:InitializeDevilAngelRoom(true, false)
146
- end
147
- changeRoom(nil, GridRooms.ROOM_DEVIL_IDX)
148
- end
149
- function listEntities(self, params, includeBackgroundEffects)
150
- local entityTypeFilter
151
- if params ~= "" then
152
- entityTypeFilter = tonumber(params)
153
- if entityTypeFilter == nil then
154
- printConsole(nil, "That is an invalid entity type to filter by.")
155
- return
156
- end
157
- end
158
- logEntities(includeBackgroundEffects, entityTypeFilter)
159
- printConsole(nil, "Logged the entities in the room to the \"log.txt\" file.")
160
- end
161
- function listGridEntities(self, params, includeWalls)
162
- local gridEntityTypeFilter
163
- if params ~= "" then
164
- gridEntityTypeFilter = tonumber(params)
165
- if gridEntityTypeFilter == nil then
166
- printConsole(nil, "That is an invalid grid entity type to filter by.")
167
- return
168
- end
169
- end
170
- logGridEntities(includeWalls, gridEntityTypeFilter)
171
- printConsole(nil, "Logged the grid entities in the room to the \"log.txt\" file.")
172
- end
173
- function movePlayer(self, params, direction)
174
- local amount = DEFAULT_MOVE_UNITS
175
- if params ~= "" then
176
- local num = tonumber(params)
177
- if num == nil then
178
- printConsole(nil, "That is an invalid amount of units to move.")
179
- return
180
- end
181
- amount = num
182
- end
183
- local player = Isaac.GetPlayer()
184
- local vector = directionToVector(nil, direction)
185
- local modifiedVector = vector * amount
186
- player.Position = player.Position + modifiedVector
187
- end
188
- function printEnabled(self, enabled, description)
189
- local enabledText = enabled and "Enabled" or "Disabled"
190
- printConsole(nil, ((enabledText .. " ") .. description) .. ".")
191
- end
192
- function spawnTrapdoorOrCrawlspace(self, trapdoor)
193
- local room = game:GetRoom()
194
- local player = Isaac.GetPlayer()
195
- local position = room:FindFreeTilePosition(player.Position, 0)
196
- local gridIndex = room:GetGridIndex(position)
197
- local gridEntityType = trapdoor and GridEntityType.GRID_TRAPDOOR or GridEntityType.GRID_STAIRS
198
- spawnGridWithVariant(nil, gridEntityType, 0, gridIndex)
199
- end
200
- function warpToRoomType(self, roomType)
201
- local roomTypeName = ROOM_TYPE_NAMES[roomType]
202
- if roomTypeName == nil or roomTypeName == DEFAULT_ROOM_TYPE_NAME then
203
- printConsole(
204
- nil,
205
- "Invalid room type: " .. tostring(roomType)
206
- )
207
- end
208
- local gridIndexes = getRoomGridIndexesForType(nil, roomType)
209
- if #gridIndexes == 0 then
210
- printConsole(nil, ("There are no " .. roomTypeName) .. "s on this floor.")
211
- return
212
- end
213
- local firstGridIndex = gridIndexes[1]
214
- changeRoom(nil, firstGridIndex)
215
- printConsole(
216
- nil,
217
- ((("Warped to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")"
218
- )
219
- end
220
- DEFAULT_MOVE_UNITS = 0.5
221
112
  function ____exports.addCharges(self, params)
222
113
  if params == "" then
223
114
  printConsole(nil, "You must specify a slot number. (Use 0 for the primary slot, 1 for the Schoolbag slot, 2 for the pocket item slot, and 3 for the Dice Bag slot.)")
@@ -568,6 +459,9 @@ function ____exports.keys(self, params)
568
459
  local player = Isaac.GetPlayer()
569
460
  player:AddKeys(numKeys)
570
461
  end
462
+ function ____exports.left(self, params)
463
+ movePlayer(nil, params, Direction.LEFT)
464
+ end
571
465
  function ____exports.library(self)
572
466
  warpToRoomType(nil, RoomType.ROOM_LIBRARY)
573
467
  end
@@ -704,6 +598,9 @@ end
704
598
  function ____exports.rh(self, params)
705
599
  ____exports.redHearts(nil, params)
706
600
  end
601
+ function ____exports.right(self, params)
602
+ movePlayer(nil, params, Direction.RIGHT)
603
+ end
707
604
  function ____exports.roomCommand(self)
708
605
  logRoom()
709
606
  end
@@ -908,6 +805,9 @@ end
908
805
  function ____exports.ultraSecret(self)
909
806
  warpToRoomType(nil, RoomType.ROOM_ULTRASECRET)
910
807
  end
808
+ function ____exports.up(self, params)
809
+ movePlayer(nil, params, Direction.UP)
810
+ end
911
811
  function ____exports.warp(self, params)
912
812
  if params == "" then
913
813
  printConsole(nil, "You must specify a room type name or number.")
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Toggles custom text to appear next to every bomb. Useful for debugging.
3
+ *
4
+ * By default, the entity ID will be displayed. Use the `setBombDisplay` helper function to assign
5
+ * the text that you want to appear.
6
+ */
7
+ export declare function bombDisplay(): void;
8
+ /** Alias for the "bombdisplay" command. */
9
+ export declare function bombsDisplay(): void;
10
+ /**
11
+ * Toggles custom text to appear next to every effect. Useful for debugging.
12
+ *
13
+ * By default, the entity ID will be displayed. Use the `setEffectDisplay` helper function to assign
14
+ * the text that you want to appear.
15
+ */
16
+ export declare function effectDisplay(): void;
17
+ /** Alias for the "effectdisplay" function. */
18
+ export declare function effectsDisplay(): void;
19
+ /**
20
+ * Toggles custom text to appear next to every familiar. Useful for debugging.
21
+ *
22
+ * By default, the entity ID will be displayed. Use the `setFamiliarDisplay` helper function to
23
+ * assign the text that you want to appear.
24
+ */
25
+ export declare function familiarDisplay(): void;
26
+ /** Alias for the "familiardisplay" command. */
27
+ export declare function familiarsDisplay(): void;
28
+ /**
29
+ * Toggles custom text to appear next to every knife. Useful for debugging.
30
+ *
31
+ * By default, the entity ID will be displayed. Use the `setKnifeDisplay` helper function to assign
32
+ * the text that you want to appear.
33
+ */
34
+ export declare function knifeDisplay(): void;
35
+ /** Alias for the "knifedisplay" command. */
36
+ export declare function knivesDisplay(): void;
37
+ /**
38
+ * Toggles custom text to appear next to every laser. Useful for debugging.
39
+ *
40
+ * By default, the entity ID will be displayed. Use the `setLaserDisplay` helper function to assign
41
+ * the text that you want to appear.
42
+ */
43
+ export declare function laserDisplay(): void;
44
+ /** Alias for the "laserdisplay" command. */
45
+ export declare function lasersDisplay(): void;
46
+ /**
47
+ * Toggles custom text to appear next to every NPC. Useful for debugging.
48
+ *
49
+ * By default, the entity ID will be displayed. Use the `setNPCDisplay` helper function to assign
50
+ * the text that you want to appear.
51
+ */
52
+ export declare function npcDisplay(): void;
53
+ /** Alias for the "npcdisplay" command. */
54
+ export declare function npcsDisplay(): void;
55
+ /**
56
+ * Toggles custom text to appear next to every pickup. Useful for debugging.
57
+ *
58
+ * By default, the entity ID will be displayed. Use the `setPickupDisplay` helper function to assign
59
+ * the text that you want to appear.
60
+ */
61
+ export declare function pickupDisplay(): void;
62
+ /** Alias for the "pickupdisplay" command. */
63
+ export declare function pickupsDisplay(): void;
64
+ /**
65
+ * Toggles custom text to appear next to every player. Useful for debugging.
66
+ *
67
+ * By default, the entity ID will be displayed. Use the `setPlayerDisplay` helper function to assign
68
+ * the text that you want to appear.
69
+ */
70
+ export declare function playerDisplay(): void;
71
+ /** Alias for the "playerdisplay" command. */
72
+ export declare function playersDisplay(): void;
73
+ /**
74
+ * Toggles custom text to appear next to every projectile. Useful for debugging.
75
+ *
76
+ * By default, the entity ID will be displayed. Use the `setProjectileDisplay` helper function to
77
+ * assign the text that you want to appear.
78
+ */
79
+ export declare function projectileDisplay(): void;
80
+ /** Alias for the "projectiledisplay" command. */
81
+ export declare function projectilesDisplay(): void;
82
+ /**
83
+ * Toggles custom text to appear next to every slot. Useful for debugging.
84
+ *
85
+ * By default, the entity ID will be displayed. Use the `setSlotDisplay` helper function to assign
86
+ * the text that you want to appear.
87
+ */
88
+ export declare function slotDisplay(): void;
89
+ /** Alias for the "slotdisplay" command. */
90
+ export declare function slotsDisplay(): void;
91
+ /**
92
+ * Toggles custom text to appear next to every tear. Useful for debugging.
93
+ *
94
+ * By default, the entity ID will be displayed. Use the `setTearDisplay` helper function to assign
95
+ * the text that you want to appear.
96
+ */
97
+ export declare function tearDisplay(): void;
98
+ /** Alias for the "teardisplay" command. */
99
+ export declare function tearsDisplay(): void;
@@ -0,0 +1,81 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local ____debugDisplay = require("features.debugDisplay")
4
+ local toggleBombDisplay = ____debugDisplay.toggleBombDisplay
5
+ local toggleEffectDisplay = ____debugDisplay.toggleEffectDisplay
6
+ local toggleFamiliarDisplay = ____debugDisplay.toggleFamiliarDisplay
7
+ local toggleKnifeDisplay = ____debugDisplay.toggleKnifeDisplay
8
+ local toggleLaserDisplay = ____debugDisplay.toggleLaserDisplay
9
+ local toggleNPCDisplay = ____debugDisplay.toggleNPCDisplay
10
+ local togglePickupDisplay = ____debugDisplay.togglePickupDisplay
11
+ local togglePlayerDisplay = ____debugDisplay.togglePlayerDisplay
12
+ local toggleProjectileDisplay = ____debugDisplay.toggleProjectileDisplay
13
+ local toggleSlotDisplay = ____debugDisplay.toggleSlotDisplay
14
+ local toggleTearDisplay = ____debugDisplay.toggleTearDisplay
15
+ function ____exports.bombDisplay(self)
16
+ toggleBombDisplay(nil)
17
+ end
18
+ function ____exports.bombsDisplay(self)
19
+ ____exports.bombDisplay(nil)
20
+ end
21
+ function ____exports.effectDisplay(self)
22
+ toggleEffectDisplay(nil)
23
+ end
24
+ function ____exports.effectsDisplay(self)
25
+ ____exports.effectDisplay(nil)
26
+ end
27
+ function ____exports.familiarDisplay(self)
28
+ toggleFamiliarDisplay(nil)
29
+ end
30
+ function ____exports.familiarsDisplay(self)
31
+ ____exports.familiarDisplay(nil)
32
+ end
33
+ function ____exports.knifeDisplay(self)
34
+ toggleKnifeDisplay(nil)
35
+ end
36
+ function ____exports.knivesDisplay(self)
37
+ ____exports.knifeDisplay(nil)
38
+ end
39
+ function ____exports.laserDisplay(self)
40
+ toggleLaserDisplay(nil)
41
+ end
42
+ function ____exports.lasersDisplay(self)
43
+ ____exports.laserDisplay(nil)
44
+ end
45
+ function ____exports.npcDisplay(self)
46
+ toggleNPCDisplay(nil)
47
+ end
48
+ function ____exports.npcsDisplay(self)
49
+ ____exports.npcDisplay(nil)
50
+ end
51
+ function ____exports.pickupDisplay(self)
52
+ togglePickupDisplay(nil)
53
+ end
54
+ function ____exports.pickupsDisplay(self)
55
+ ____exports.pickupDisplay(nil)
56
+ end
57
+ function ____exports.playerDisplay(self)
58
+ togglePlayerDisplay(nil)
59
+ end
60
+ function ____exports.playersDisplay(self)
61
+ ____exports.playerDisplay(nil)
62
+ end
63
+ function ____exports.projectileDisplay(self)
64
+ toggleProjectileDisplay(nil)
65
+ end
66
+ function ____exports.projectilesDisplay(self)
67
+ ____exports.projectileDisplay(nil)
68
+ end
69
+ function ____exports.slotDisplay(self)
70
+ toggleSlotDisplay(nil)
71
+ end
72
+ function ____exports.slotsDisplay(self)
73
+ ____exports.slotDisplay(nil)
74
+ end
75
+ function ____exports.tearDisplay(self)
76
+ toggleTearDisplay(nil)
77
+ end
78
+ function ____exports.tearsDisplay(self)
79
+ ____exports.tearDisplay(nil)
80
+ end
81
+ return ____exports
@@ -0,0 +1,9 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ import { HealthType } from "../../enums/HealthType";
3
+ export declare function addHeart(params: string, healthType: HealthType): void;
4
+ export declare function devilAngel(useDevil: boolean): void;
5
+ export declare function listEntities(params: string, includeBackgroundEffects: boolean): void;
6
+ export declare function listGridEntities(params: string, includeWalls: boolean): void;
7
+ export declare function movePlayer(params: string, direction: Direction): void;
8
+ export declare function spawnTrapdoorOrCrawlspace(trapdoor: boolean): void;
9
+ export declare function warpToRoomType(roomType: RoomType): void;
@@ -0,0 +1,126 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____exports = {}
3
+ local ____cachedClasses = require("cachedClasses")
4
+ local game = ____cachedClasses.game
5
+ local ____HealthType = require("enums.HealthType")
6
+ local HealthType = ____HealthType.HealthType
7
+ local ____gridEntity = require("functions.gridEntity")
8
+ local spawnGridWithVariant = ____gridEntity.spawnGridWithVariant
9
+ local ____log = require("functions.log")
10
+ local logEntities = ____log.logEntities
11
+ local logGridEntities = ____log.logGridEntities
12
+ local ____playerHealth = require("functions.playerHealth")
13
+ local addPlayerHealthType = ____playerHealth.addPlayerHealthType
14
+ local ____roomData = require("functions.roomData")
15
+ local getRoomData = ____roomData.getRoomData
16
+ local getRoomDescriptor = ____roomData.getRoomDescriptor
17
+ local ____rooms = require("functions.rooms")
18
+ local changeRoom = ____rooms.changeRoom
19
+ local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
20
+ local ____utils = require("functions.utils")
21
+ local printConsole = ____utils.printConsole
22
+ local ____vector = require("functions.vector")
23
+ local directionToVector = ____vector.directionToVector
24
+ local ____roomTypeNames = require("objects.roomTypeNames")
25
+ local DEFAULT_ROOM_TYPE_NAME = ____roomTypeNames.DEFAULT_ROOM_TYPE_NAME
26
+ local ROOM_TYPE_NAMES = ____roomTypeNames.ROOM_TYPE_NAMES
27
+ local DEFAULT_MOVE_UNITS = 0.5
28
+ function ____exports.addHeart(self, params, healthType)
29
+ local numHearts = healthType == HealthType.MAX_HEARTS and 2 or 1
30
+ if params ~= "" then
31
+ local num = tonumber(params)
32
+ if num == nil then
33
+ printConsole(nil, "That is an invalid amount of hearts to add.")
34
+ return
35
+ end
36
+ numHearts = num
37
+ end
38
+ local player = Isaac.GetPlayer()
39
+ addPlayerHealthType(nil, player, healthType, numHearts)
40
+ end
41
+ function ____exports.devilAngel(self, useDevil)
42
+ local level = game:GetLevel()
43
+ local devilAngelRoomData = getRoomData(nil, GridRooms.ROOM_DEVIL_IDX)
44
+ if devilAngelRoomData ~= nil then
45
+ local roomType = devilAngelRoomData.Type
46
+ local conflictingType = useDevil and RoomType.ROOM_ANGEL or RoomType.ROOM_DEVIL
47
+ if roomType == conflictingType then
48
+ local roomDescriptor = getRoomDescriptor(nil, GridRooms.ROOM_DEVIL_IDX)
49
+ roomDescriptor.Data = nil
50
+ end
51
+ end
52
+ if useDevil then
53
+ level:InitializeDevilAngelRoom(false, true)
54
+ else
55
+ level:InitializeDevilAngelRoom(true, false)
56
+ end
57
+ changeRoom(nil, GridRooms.ROOM_DEVIL_IDX)
58
+ end
59
+ function ____exports.listEntities(self, params, includeBackgroundEffects)
60
+ local entityTypeFilter
61
+ if params ~= "" then
62
+ entityTypeFilter = tonumber(params)
63
+ if entityTypeFilter == nil then
64
+ printConsole(nil, "That is an invalid entity type to filter by.")
65
+ return
66
+ end
67
+ end
68
+ logEntities(includeBackgroundEffects, entityTypeFilter)
69
+ printConsole(nil, "Logged the entities in the room to the \"log.txt\" file.")
70
+ end
71
+ function ____exports.listGridEntities(self, params, includeWalls)
72
+ local gridEntityTypeFilter
73
+ if params ~= "" then
74
+ gridEntityTypeFilter = tonumber(params)
75
+ if gridEntityTypeFilter == nil then
76
+ printConsole(nil, "That is an invalid grid entity type to filter by.")
77
+ return
78
+ end
79
+ end
80
+ logGridEntities(includeWalls, gridEntityTypeFilter)
81
+ printConsole(nil, "Logged the grid entities in the room to the \"log.txt\" file.")
82
+ end
83
+ function ____exports.movePlayer(self, params, direction)
84
+ local amount = DEFAULT_MOVE_UNITS
85
+ if params ~= "" then
86
+ local num = tonumber(params)
87
+ if num == nil then
88
+ printConsole(nil, "That is an invalid amount of units to move.")
89
+ return
90
+ end
91
+ amount = num
92
+ end
93
+ local player = Isaac.GetPlayer()
94
+ local vector = directionToVector(nil, direction)
95
+ local modifiedVector = vector * amount
96
+ player.Position = player.Position + modifiedVector
97
+ end
98
+ function ____exports.spawnTrapdoorOrCrawlspace(self, trapdoor)
99
+ local room = game:GetRoom()
100
+ local player = Isaac.GetPlayer()
101
+ local position = room:FindFreeTilePosition(player.Position, 0)
102
+ local gridIndex = room:GetGridIndex(position)
103
+ local gridEntityType = trapdoor and GridEntityType.GRID_TRAPDOOR or GridEntityType.GRID_STAIRS
104
+ spawnGridWithVariant(nil, gridEntityType, 0, gridIndex)
105
+ end
106
+ function ____exports.warpToRoomType(self, roomType)
107
+ local roomTypeName = ROOM_TYPE_NAMES[roomType]
108
+ if roomTypeName == nil or roomTypeName == DEFAULT_ROOM_TYPE_NAME then
109
+ printConsole(
110
+ nil,
111
+ "Invalid room type: " .. tostring(roomType)
112
+ )
113
+ end
114
+ local gridIndexes = getRoomGridIndexesForType(nil, roomType)
115
+ if #gridIndexes == 0 then
116
+ printConsole(nil, ("There are no " .. roomTypeName) .. "s on this floor.")
117
+ return
118
+ end
119
+ local firstGridIndex = gridIndexes[1]
120
+ changeRoom(nil, firstGridIndex)
121
+ printConsole(
122
+ nil,
123
+ ((("Warped to room type: " .. roomTypeName) .. " (") .. tostring(roomType)) .. ")"
124
+ )
125
+ end
126
+ return ____exports
@@ -12,6 +12,7 @@ local printConsole = ____utils.printConsole
12
12
  local ____exports = require("features.saveDataManager.exports")
13
13
  local saveDataManager = ____exports.saveDataManager
14
14
  local commands = require("features.extraConsoleCommands.commands")
15
+ local commandsDisplay = require("features.extraConsoleCommands.commandsDisplay")
15
16
  local ____v = require("features.extraConsoleCommands.v")
16
17
  local v = ____v.default
17
18
  function featureEnabled(self)
@@ -102,6 +103,8 @@ commandFunctionsMap:set("blackmarket", commands.blackMarket)
102
103
  commandFunctionsMap:set("bloodcharges", commands.bloodCharges)
103
104
  commandFunctionsMap:set("bm", commands.bm)
104
105
  commandFunctionsMap:set("bomb", commands.bomb)
106
+ commandFunctionsMap:set("bombdisplay", commandsDisplay.bombDisplay)
107
+ commandFunctionsMap:set("bombsdisplay", commandsDisplay.bombsDisplay)
105
108
  commandFunctionsMap:set("bombs", commands.bombs)
106
109
  commandFunctionsMap:set("bonehearts", commands.boneHearts)
107
110
  commandFunctionsMap:set("boss", commands.boss)
@@ -126,10 +129,14 @@ commandFunctionsMap:set("dirtybedroom", commands.dirtyBedroom)
126
129
  commandFunctionsMap:set("disablecurses", commands.disableCurses)
127
130
  commandFunctionsMap:set("down", commands.down)
128
131
  commandFunctionsMap:set("dungeon", commands.dungeon)
132
+ commandFunctionsMap:set("effectdisplay", commandsDisplay.effectDisplay)
129
133
  commandFunctionsMap:set("effects", commands.effects)
134
+ commandFunctionsMap:set("effectsdisplay", commandsDisplay.effectsDisplay)
130
135
  commandFunctionsMap:set("eh", commands.eh)
131
136
  commandFunctionsMap:set("error", commands.error)
132
137
  commandFunctionsMap:set("eternalhearts", commands.eternalHearts)
138
+ commandFunctionsMap:set("familiardisplay", commandsDisplay.familiarDisplay)
139
+ commandFunctionsMap:set("familiarsdisplay", commandsDisplay.familiarsDisplay)
133
140
  commandFunctionsMap:set("fool", commands.fool)
134
141
  commandFunctionsMap:set("getposition", commands.getPosition)
135
142
  commandFunctionsMap:set("gigabomb", commands.gigaBomb)
@@ -147,6 +154,11 @@ commandFunctionsMap:set("hitboxes", commands.hitboxes)
147
154
  commandFunctionsMap:set("iamerror", commands.iAmError)
148
155
  commandFunctionsMap:set("key", commands.key)
149
156
  commandFunctionsMap:set("keys", commands.keys)
157
+ commandFunctionsMap:set("knifedisplay", commandsDisplay.knifeDisplay)
158
+ commandFunctionsMap:set("knivesdisplay", commandsDisplay.knivesDisplay)
159
+ commandFunctionsMap:set("laserdisplay", commandsDisplay.laserDisplay)
160
+ commandFunctionsMap:set("lasersdisplay", commandsDisplay.lasersDisplay)
161
+ commandFunctionsMap:set("left", commands.left)
150
162
  commandFunctionsMap:set("library", commands.library)
151
163
  commandFunctionsMap:set("list", commands.list)
152
164
  commandFunctionsMap:set("listall", commands.listAll)
@@ -158,15 +170,24 @@ commandFunctionsMap:set("maxhearts", commands.maxHearts)
158
170
  commandFunctionsMap:set("mh", commands.mh)
159
171
  commandFunctionsMap:set("miniboss", commands.miniboss)
160
172
  commandFunctionsMap:set("nocurses", commands.noCurses)
173
+ commandFunctionsMap:set("npcdisplay", commandsDisplay.npcDisplay)
174
+ commandFunctionsMap:set("npcsdisplay", commandsDisplay.npcsDisplay)
175
+ commandFunctionsMap:set("pickupdisplay", commandsDisplay.pickupDisplay)
176
+ commandFunctionsMap:set("pickupsdisplay", commandsDisplay.pickupsDisplay)
161
177
  commandFunctionsMap:set("pill", commands.pill)
162
178
  commandFunctionsMap:set("pills", commands.pills)
163
179
  commandFunctionsMap:set("planetarium", commands.planetarium)
180
+ commandFunctionsMap:set("playerdisplay", commandsDisplay.playerDisplay)
181
+ commandFunctionsMap:set("playersdisplay", commandsDisplay.playersDisplay)
164
182
  commandFunctionsMap:set("playsound", commands.playSound)
165
183
  commandFunctionsMap:set("pocket", commands.pocket)
166
184
  commandFunctionsMap:set("poopMana", commands.poopMana)
167
185
  commandFunctionsMap:set("position", commands.positionCommand)
186
+ commandFunctionsMap:set("projectiledisplay", commandsDisplay.projectileDisplay)
187
+ commandFunctionsMap:set("projectilesdisplay", commandsDisplay.projectilesDisplay)
168
188
  commandFunctionsMap:set("redhearts", commands.redHearts)
169
189
  commandFunctionsMap:set("rh", commands.rh)
190
+ commandFunctionsMap:set("right", commands.right)
170
191
  commandFunctionsMap:set("room", commands.roomCommand)
171
192
  commandFunctionsMap:set("rottenhearts", commands.rottenHearts)
172
193
  commandFunctionsMap:set("s", commands.s)
@@ -178,6 +199,8 @@ commandFunctionsMap:set("setcharges", commands.setCharges)
178
199
  commandFunctionsMap:set("setposition", commands.setPosition)
179
200
  commandFunctionsMap:set("sh", commands.sh)
180
201
  commandFunctionsMap:set("shop", commands.shop)
202
+ commandFunctionsMap:set("slotdisplay", commandsDisplay.slotDisplay)
203
+ commandFunctionsMap:set("slotsdisplay", commandsDisplay.slotsDisplay)
181
204
  commandFunctionsMap:set("smelt", commands.smelt)
182
205
  commandFunctionsMap:set("soulcharges", commands.soulCharges)
183
206
  commandFunctionsMap:set("soulhearts", commands.soulHearts)
@@ -188,9 +211,12 @@ commandFunctionsMap:set("spawngoldentrinket", commands.spawnGoldenTrinket)
188
211
  commandFunctionsMap:set("speed", commands.speed)
189
212
  commandFunctionsMap:set("supersecret", commands.superSecret)
190
213
  commandFunctionsMap:set("startingroom", commands.startingRoom)
214
+ commandFunctionsMap:set("teardisplay", commandsDisplay.tearDisplay)
191
215
  commandFunctionsMap:set("tears", commands.tears)
216
+ commandFunctionsMap:set("tearsdisplay", commandsDisplay.tearsDisplay)
192
217
  commandFunctionsMap:set("trapdoor", commands.trapdoorCommand)
193
218
  commandFunctionsMap:set("treasure", commands.treasure)
194
219
  commandFunctionsMap:set("ultrasecret", commands.ultraSecret)
220
+ commandFunctionsMap:set("up", commands.up)
195
221
  commandFunctionsMap:set("warp", commands.warp)
196
222
  return ____exports
@@ -103,6 +103,8 @@ export declare function isReflectionRender(): boolean;
103
103
  * of the message (which `Isaac.ConsoleOutput` does not do by default).
104
104
  */
105
105
  export declare function printConsole(msg: string): void;
106
+ /** Helper function to print whether something was enabled or disabled to the in-game console. */
107
+ export declare function printEnabled(enabled: boolean, description: string): void;
106
108
  /**
107
109
  * Helper function to repeat code N times. This is faster to type and cleaner than using a for loop.
108
110
  *
@@ -123,7 +125,16 @@ export declare function printConsole(msg: string): void;
123
125
  * ```
124
126
  */
125
127
  export declare function repeat(n: int, func: (i: int) => void): void;
126
- /** Helper function to prevent early returns from being deleted by ESLint. */
128
+ /**
129
+ * Helper function to signify that the enclosing code block is not yet complete. Using this function
130
+ * is similar to writing a "TODO" comment, but it has the benefit of preventing early returns from
131
+ * being automatically deleted by ESLint.
132
+ *
133
+ * When you see this function, it simply means that the programmer intends to add in more code to
134
+ * this spot later.
135
+ *
136
+ * This function does not actually do anything. (It is an "empty" function.)
137
+ */
127
138
  export declare function todo(): void;
128
139
  /**
129
140
  * Helper function to check every value of a custom enum for -1. This is helpful as a run-time check
@@ -75,6 +75,10 @@ end
75
75
  function ____exports.printConsole(self, msg)
76
76
  Isaac.ConsoleOutput(msg .. "\n")
77
77
  end
78
+ function ____exports.printEnabled(self, enabled, description)
79
+ local enabledText = enabled and "Enabled" or "Disabled"
80
+ ____exports.printConsole(nil, ((enabledText .. " ") .. description) .. ".")
81
+ end
78
82
  ____exports["repeat"] = function(self, n, func)
79
83
  do
80
84
  local i = 0