isaacscript-common 1.2.135 → 1.2.138

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 (43) hide show
  1. package/dist/callbacks/customRevive.lua +1 -0
  2. package/dist/callbacks/postCustomDoorEnter.d.ts +8 -0
  3. package/dist/callbacks/postCustomDoorEnter.lua +35 -0
  4. package/dist/callbacks/postPlayerChangeHealth.lua +4 -64
  5. package/dist/callbacks/subscriptions/postCustomDoorEnter.d.ts +2 -0
  6. package/dist/callbacks/subscriptions/postCustomDoorEnter.lua +25 -0
  7. package/dist/constants.d.ts +5 -0
  8. package/dist/constants.lua +1 -0
  9. package/dist/features/extraConsoleCommands/commands.d.ts +250 -0
  10. package/dist/features/extraConsoleCommands/commands.lua +658 -0
  11. package/dist/features/extraConsoleCommands/init.d.ts +25 -0
  12. package/dist/features/extraConsoleCommands/init.lua +153 -0
  13. package/dist/features/extraConsoleCommands/v.d.ts +9 -0
  14. package/dist/features/extraConsoleCommands/v.lua +5 -0
  15. package/dist/functions/log.d.ts +5 -1
  16. package/dist/functions/log.lua +172 -2
  17. package/dist/functions/map.d.ts +16 -0
  18. package/dist/functions/map.lua +24 -0
  19. package/dist/functions/player.d.ts +2 -2
  20. package/dist/functions/playerHealth.d.ts +3 -0
  21. package/dist/functions/playerHealth.lua +142 -0
  22. package/dist/functions/run.d.ts +12 -0
  23. package/dist/functions/run.lua +25 -0
  24. package/dist/functions/utils.d.ts +0 -6
  25. package/dist/functions/utils.lua +0 -8
  26. package/dist/functions/vector.lua +8 -8
  27. package/dist/index.d.ts +6 -0
  28. package/dist/index.lua +46 -0
  29. package/dist/maps/cardMap.d.ts +3 -0
  30. package/dist/maps/cardMap.lua +202 -0
  31. package/dist/maps/characterMap.d.ts +3 -0
  32. package/dist/maps/characterMap.lua +90 -0
  33. package/dist/maps/pillEffectMap.d.ts +3 -0
  34. package/dist/maps/pillEffectMap.lua +88 -0
  35. package/dist/types/CallbackParametersCustom.d.ts +4 -0
  36. package/dist/types/HealthType.d.ts +4 -2
  37. package/dist/types/HealthType.lua +3 -1
  38. package/dist/types/ModCallbacksCustom.d.ts +2 -1
  39. package/dist/types/ModCallbacksCustom.lua +2 -0
  40. package/dist/types/ModUpgraded.lua +8 -0
  41. package/dist/types/PlayerIndex.d.ts +2 -2
  42. package/dist/upgradeMod.lua +3 -0
  43. package/package.json +1 -1
@@ -0,0 +1,658 @@
1
+ --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
+ local ____lualib = require("lualib_bundle")
3
+ local Map = ____lualib.Map
4
+ local __TS__StringSlice = ____lualib.__TS__StringSlice
5
+ local ____exports = {}
6
+ local addHeart, devilAngel, listEntities, listGridEntities, movePlayer, printEnabled, spawnTrapdoorOrCrawlspace, warpToRoomType, DEFAULT_MOVE_UNITS
7
+ local ____cachedClasses = require("cachedClasses")
8
+ local game = ____cachedClasses.game
9
+ local sfxManager = ____cachedClasses.sfxManager
10
+ local ____constants = require("constants")
11
+ local PILL_GIANT_FLAG = ____constants.PILL_GIANT_FLAG
12
+ local ____gridEntity = require("functions.gridEntity")
13
+ local spawnGridEntityWithVariant = ____gridEntity.spawnGridEntityWithVariant
14
+ local ____log = require("functions.log")
15
+ local logAllSeedEffects = ____log.logAllSeedEffects
16
+ local logEntities = ____log.logEntities
17
+ local logGridEntities = ____log.logGridEntities
18
+ local logRoom = ____log.logRoom
19
+ local logSounds = ____log.logSounds
20
+ local logTemporaryEffects = ____log.logTemporaryEffects
21
+ local ____map = require("functions.map")
22
+ local getMapPartialMatch = ____map.getMapPartialMatch
23
+ local ____npc = require("functions.npc")
24
+ local getNPCs = ____npc.getNPCs
25
+ local ____player = require("functions.player")
26
+ local getPlayers = ____player.getPlayers
27
+ local useActiveItemTemp = ____player.useActiveItemTemp
28
+ local ____playerHealth = require("functions.playerHealth")
29
+ local addPlayerHealthType = ____playerHealth.addPlayerHealthType
30
+ local ____rooms = require("functions.rooms")
31
+ local changeRoom = ____rooms.changeRoom
32
+ local getRoomData = ____rooms.getRoomData
33
+ local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
34
+ local gridToPos = ____rooms.gridToPos
35
+ local ____run = require("functions.run")
36
+ local restart = ____run.restart
37
+ local ____utils = require("functions.utils")
38
+ local printConsole = ____utils.printConsole
39
+ local ____vector = require("functions.vector")
40
+ local directionToVector = ____vector.directionToVector
41
+ local ____cardMap = require("maps.cardMap")
42
+ local CARD_MAP = ____cardMap.CARD_MAP
43
+ local ____characterMap = require("maps.characterMap")
44
+ local CHARACTER_MAP = ____characterMap.CHARACTER_MAP
45
+ local ____pillEffectMap = require("maps.pillEffectMap")
46
+ local PILL_EFFECT_MAP = ____pillEffectMap.PILL_EFFECT_MAP
47
+ local ____HealthType = require("types.HealthType")
48
+ local HealthType = ____HealthType.HealthType
49
+ local ____v = require("features.extraConsoleCommands.v")
50
+ local v = ____v.default
51
+ function ____exports.blackHearts(self, params)
52
+ addHeart(nil, params, HealthType.BLACK)
53
+ end
54
+ function ____exports.chaosCardTears(self)
55
+ v.run.chaosCardTears = not v.run.chaosCardTears
56
+ printEnabled(nil, v.run.chaosCardTears, "Chaos Card tears")
57
+ end
58
+ function ____exports.devil(self)
59
+ devilAngel(nil, true)
60
+ end
61
+ function ____exports.eternalHearts(self, params)
62
+ addHeart(nil, params, HealthType.ETERNAL)
63
+ end
64
+ function ____exports.goldenBomb(self)
65
+ local player = Isaac.GetPlayer()
66
+ player:AddGoldenBomb()
67
+ end
68
+ function ____exports.goldenKey(self)
69
+ local player = Isaac.GetPlayer()
70
+ player:AddGoldenKey()
71
+ end
72
+ function ____exports.hearts(self, params)
73
+ addHeart(nil, params, HealthType.RED)
74
+ end
75
+ function ____exports.IAMERROR(self)
76
+ changeRoom(nil, GridRooms.ROOM_ERROR_IDX)
77
+ end
78
+ function ____exports.soulHearts(self, params)
79
+ addHeart(nil, params, HealthType.SOUL)
80
+ end
81
+ function ____exports.startingRoom(self)
82
+ local level = game:GetLevel()
83
+ local startingRoomIndex = level:GetStartingRoomIndex()
84
+ changeRoom(nil, startingRoomIndex)
85
+ end
86
+ function addHeart(self, params, healthType)
87
+ local numHearts = healthType == HealthType.MAX_HEARTS and 2 or 1
88
+ if params ~= "" then
89
+ local num = tonumber(params)
90
+ if num == nil then
91
+ printConsole(nil, "That is an invalid amount of hearts to add.")
92
+ return
93
+ end
94
+ numHearts = num
95
+ end
96
+ local player = Isaac.GetPlayer()
97
+ addPlayerHealthType(nil, player, healthType, numHearts)
98
+ end
99
+ function devilAngel(self, useDevil)
100
+ local level = game:GetLevel()
101
+ local devilAngelRoomData = getRoomData(nil, GridRooms.ROOM_DEVIL_IDX)
102
+ if devilAngelRoomData ~= nil then
103
+ local roomType = devilAngelRoomData.Type
104
+ local conflictingType = useDevil and RoomType.ROOM_ANGEL or RoomType.ROOM_DEVIL
105
+ if roomType == conflictingType then
106
+ local roomDesc = level:GetRoomByIdx(GridRooms.ROOM_DEVIL_IDX)
107
+ roomDesc.Data = nil
108
+ end
109
+ end
110
+ if useDevil then
111
+ level:InitializeDevilAngelRoom(false, true)
112
+ else
113
+ level:InitializeDevilAngelRoom(true, false)
114
+ end
115
+ changeRoom(nil, GridRooms.ROOM_DEVIL_IDX)
116
+ end
117
+ function listEntities(self, params, includeBackgroundEffects)
118
+ local entityTypeFilter
119
+ if params ~= "" then
120
+ entityTypeFilter = tonumber(params)
121
+ if entityTypeFilter == nil then
122
+ printConsole(nil, "That is an invalid entity type to filter by.")
123
+ return
124
+ end
125
+ end
126
+ logEntities(includeBackgroundEffects, entityTypeFilter)
127
+ printConsole(nil, "Logged the entities in the room to the \"log.txt\" file.")
128
+ end
129
+ function listGridEntities(self, params, includeWalls)
130
+ local gridEntityTypeFilter
131
+ if params ~= "" then
132
+ gridEntityTypeFilter = tonumber(params)
133
+ if gridEntityTypeFilter == nil then
134
+ printConsole(nil, "That is an invalid grid entity type to filter by.")
135
+ return
136
+ end
137
+ end
138
+ logGridEntities(includeWalls, gridEntityTypeFilter)
139
+ printConsole(nil, "Logged the grid entities in the room to the \"log.txt\" file.")
140
+ end
141
+ function movePlayer(self, params, direction)
142
+ local amount = DEFAULT_MOVE_UNITS
143
+ if params ~= "" then
144
+ local num = tonumber(params)
145
+ if num == nil then
146
+ printConsole(nil, "That is an invalid amount of units to move.")
147
+ return
148
+ end
149
+ amount = num
150
+ end
151
+ local player = Isaac.GetPlayer()
152
+ local vector = directionToVector(nil, direction)
153
+ local modifiedVector = vector * amount
154
+ player.Position = player.Position + modifiedVector
155
+ end
156
+ function printEnabled(self, enabled, description)
157
+ local enabledText = enabled and "Enabled" or "Disabled"
158
+ printConsole(nil, ((enabledText .. " ") .. description) .. ".")
159
+ end
160
+ function spawnTrapdoorOrCrawlspace(self, trapdoor)
161
+ local room = game:GetRoom()
162
+ local player = Isaac.GetPlayer()
163
+ local position = room:FindFreeTilePosition(player.Position, 0)
164
+ local gridIndex = room:GetGridIndex(position)
165
+ local gridEntityType = trapdoor and GridEntityType.GRID_TRAPDOOR or GridEntityType.GRID_STAIRS
166
+ spawnGridEntityWithVariant(nil, gridEntityType, 0, gridIndex)
167
+ end
168
+ function warpToRoomType(self, roomType, roomTypeName)
169
+ local gridIndexes = getRoomGridIndexesForType(nil, roomType)
170
+ if #gridIndexes == 0 then
171
+ printConsole(nil, ("There are no " .. roomTypeName) .. "s on this floor.")
172
+ return
173
+ end
174
+ local firstGridIndex = gridIndexes[1]
175
+ changeRoom(nil, firstGridIndex)
176
+ end
177
+ DEFAULT_MOVE_UNITS = 0.5
178
+ function ____exports.angel(self)
179
+ devilAngel(nil, false)
180
+ end
181
+ function ____exports.ascent(self)
182
+ game:SetStateFlag(GameStateFlag.STATE_BACKWARDS_PATH_INIT, true)
183
+ game:SetStateFlag(GameStateFlag.STATE_BACKWARDS_PATH, true)
184
+ printConsole(nil, "Set Ascent flags.")
185
+ end
186
+ function ____exports.bh(self, params)
187
+ ____exports.blackHearts(nil, params)
188
+ end
189
+ function ____exports.blackMarket(self)
190
+ changeRoom(nil, GridRooms.ROOM_BLACK_MARKET_IDX)
191
+ end
192
+ function ____exports.bloodCharges(self, params)
193
+ local charges = 1
194
+ if params ~= "" then
195
+ local num = tonumber(params)
196
+ if num == nil then
197
+ printConsole(nil, "That is an invalid amount of charges to add.")
198
+ return
199
+ end
200
+ charges = num
201
+ end
202
+ local player = Isaac.GetPlayer()
203
+ player:AddBloodCharge(charges)
204
+ end
205
+ function ____exports.bomb(self, params)
206
+ local numBombs = 1
207
+ if params ~= "" then
208
+ local num = tonumber(params)
209
+ if num == nil then
210
+ printConsole(nil, "That is an invalid amount of bombs to add.")
211
+ return
212
+ end
213
+ numBombs = num
214
+ end
215
+ local player = Isaac.GetPlayer()
216
+ player:AddBombs(numBombs)
217
+ end
218
+ function ____exports.bombs(self, params)
219
+ local numBombs = 99
220
+ if params ~= "" then
221
+ local num = tonumber(params)
222
+ if num == nil then
223
+ printConsole(nil, "That is an invalid amount of bombs to add.")
224
+ return
225
+ end
226
+ numBombs = num
227
+ end
228
+ local player = Isaac.GetPlayer()
229
+ player:AddBombs(numBombs)
230
+ end
231
+ function ____exports.boneHearts(self, params)
232
+ addHeart(nil, params, HealthType.BONE)
233
+ end
234
+ function ____exports.boss(self)
235
+ warpToRoomType(nil, RoomType.ROOM_BOSS, "Boss Room")
236
+ end
237
+ function ____exports.bm(self)
238
+ ____exports.blackMarket(nil)
239
+ end
240
+ function ____exports.brokenHearts(self, params)
241
+ addHeart(nil, params, HealthType.BROKEN)
242
+ end
243
+ function ____exports.card(self, params)
244
+ if params == "" then
245
+ printConsole(nil, "You must specify a card name or number.")
246
+ return
247
+ end
248
+ local num = tonumber(params)
249
+ if num ~= nil then
250
+ if num < 1 or num >= Card.NUM_CARDS then
251
+ printConsole(nil, "That is an invalid card sub-type.")
252
+ return
253
+ end
254
+ Isaac.ExecuteCommand("g k" .. tostring(num))
255
+ printConsole(
256
+ nil,
257
+ "Gave card: " .. tostring(num)
258
+ )
259
+ return
260
+ end
261
+ local match = getMapPartialMatch(nil, params, CARD_MAP)
262
+ if match == nil then
263
+ printConsole(nil, "Unknown card: " .. params)
264
+ return
265
+ end
266
+ Isaac.ExecuteCommand("g k" .. tostring(match))
267
+ printConsole(
268
+ nil,
269
+ "Gave card: " .. tostring(match)
270
+ )
271
+ end
272
+ function ____exports.cards(self)
273
+ local cardType = 1
274
+ do
275
+ local y = 0
276
+ while y <= 6 do
277
+ do
278
+ local x = 0
279
+ while x <= 12 do
280
+ if cardType == Card.NUM_CARDS then
281
+ return
282
+ end
283
+ local position = gridToPos(nil, x, y)
284
+ Isaac.Spawn(
285
+ EntityType.ENTITY_PICKUP,
286
+ PickupVariant.PICKUP_TAROTCARD,
287
+ cardType,
288
+ position,
289
+ Vector.Zero,
290
+ nil
291
+ )
292
+ cardType = cardType + 1
293
+ x = x + 1
294
+ end
295
+ end
296
+ y = y + 1
297
+ end
298
+ end
299
+ end
300
+ function ____exports.cc(self)
301
+ ____exports.chaosCardTears(nil)
302
+ end
303
+ function ____exports.characterCommand(self, params)
304
+ if params == "" then
305
+ printConsole(nil, "You must specify a character name or number.")
306
+ return
307
+ end
308
+ local num = tonumber(params)
309
+ if num ~= nil then
310
+ if num < 0 or num >= PlayerType.NUM_PLAYER_TYPES then
311
+ printConsole(nil, "That is an invalid player sub-type.")
312
+ return
313
+ end
314
+ printConsole(
315
+ nil,
316
+ "Restarting as character: " .. tostring(num)
317
+ )
318
+ restart(nil, num)
319
+ return
320
+ end
321
+ local match = getMapPartialMatch(nil, params, CHARACTER_MAP)
322
+ if match == nil then
323
+ printConsole(nil, "Unknown character: " .. params)
324
+ return
325
+ end
326
+ restart(nil, match)
327
+ printConsole(
328
+ nil,
329
+ "Restarting as character: " .. tostring(match)
330
+ )
331
+ end
332
+ function ____exports.coin(self, params)
333
+ local numCoins = 1
334
+ if params ~= "" then
335
+ local num = tonumber(params)
336
+ if num == nil then
337
+ printConsole(nil, "That is an invalid amount of coins to add.")
338
+ return
339
+ end
340
+ numCoins = num
341
+ end
342
+ local player = Isaac.GetPlayer()
343
+ player:AddCoins(numCoins)
344
+ end
345
+ function ____exports.coins(self, params)
346
+ local numCoins = 999
347
+ if params ~= "" then
348
+ local num = tonumber(params)
349
+ if num == nil then
350
+ printConsole(nil, "That is an invalid amount of coins to add.")
351
+ return
352
+ end
353
+ numCoins = num
354
+ end
355
+ local player = Isaac.GetPlayer()
356
+ player:AddCoins(numCoins)
357
+ end
358
+ function ____exports.crawlspace(self)
359
+ spawnTrapdoorOrCrawlspace(nil, false)
360
+ end
361
+ function ____exports.d6(self)
362
+ local player = Isaac.GetPlayer()
363
+ useActiveItemTemp(nil, player, CollectibleType.COLLECTIBLE_D6)
364
+ end
365
+ function ____exports.d20(self)
366
+ local player = Isaac.GetPlayer()
367
+ useActiveItemTemp(nil, player, CollectibleType.COLLECTIBLE_D20)
368
+ end
369
+ function ____exports.damage(self)
370
+ v.run.maxDamage = not v.run.maxDamage
371
+ printEnabled(nil, v.run.maxDamage, "debug damage")
372
+ end
373
+ function ____exports.dd(self)
374
+ ____exports.devil(nil)
375
+ end
376
+ function ____exports.down(self, params)
377
+ movePlayer(nil, params, Direction.DOWN)
378
+ end
379
+ function ____exports.effects(self)
380
+ local player = Isaac.GetPlayer()
381
+ logTemporaryEffects(player)
382
+ printConsole(nil, "Logged the player's effects to the \"log.txt\" file.")
383
+ end
384
+ function ____exports.eh(self, params)
385
+ ____exports.eternalHearts(nil, params)
386
+ end
387
+ function ____exports.error(self)
388
+ ____exports.IAMERROR(nil)
389
+ end
390
+ function ____exports.fool(self)
391
+ ____exports.startingRoom(nil)
392
+ end
393
+ function ____exports.goldBomb(self)
394
+ ____exports.goldenBomb(nil)
395
+ end
396
+ function ____exports.goldKey(self)
397
+ ____exports.goldenKey(nil)
398
+ end
399
+ function ____exports.h(self, params)
400
+ ____exports.hearts(nil, params)
401
+ end
402
+ function ____exports.key(self, params)
403
+ local numKeys = 1
404
+ if params ~= "" then
405
+ local num = tonumber(params)
406
+ if num == nil then
407
+ printConsole(nil, "That is an invalid amount of keys to add.")
408
+ return
409
+ end
410
+ numKeys = num
411
+ end
412
+ local player = Isaac.GetPlayer()
413
+ player:AddKeys(numKeys)
414
+ end
415
+ function ____exports.keys(self, params)
416
+ local numKeys = 99
417
+ if params ~= "" then
418
+ local num = tonumber(params)
419
+ if num == nil then
420
+ printConsole(nil, "That is an invalid amount of keys to add.")
421
+ return
422
+ end
423
+ numKeys = num
424
+ end
425
+ local player = Isaac.GetPlayer()
426
+ player:AddKeys(numKeys)
427
+ end
428
+ function ____exports.list(self, params)
429
+ listEntities(nil, params, false)
430
+ end
431
+ function ____exports.listAll(self, params)
432
+ listEntities(nil, params, true)
433
+ end
434
+ function ____exports.listGrid(self, params)
435
+ listGridEntities(nil, params, false)
436
+ end
437
+ function ____exports.listGridAll(self, params)
438
+ listGridEntities(nil, params, true)
439
+ end
440
+ function ____exports.lowHP(self)
441
+ for ____, npc in ipairs(getNPCs(nil)) do
442
+ npc.HitPoints = 1
443
+ end
444
+ printConsole(nil, "Set every NPC to 1 HP.")
445
+ end
446
+ function ____exports.luck(self)
447
+ Isaac.ExecuteCommand("debug 9")
448
+ end
449
+ function ____exports.maxHearts(self, params)
450
+ addHeart(nil, params, HealthType.MAX_HEARTS)
451
+ end
452
+ function ____exports.mh(self, params)
453
+ ____exports.maxHearts(nil, params)
454
+ end
455
+ function ____exports.pill(self, params)
456
+ if params == "" then
457
+ printConsole(nil, "You must specify a pill name or number.")
458
+ return
459
+ end
460
+ local num = tonumber(params)
461
+ if num ~= nil then
462
+ if num < 1 or num >= PillEffect.NUM_PILL_EFFECTS then
463
+ printConsole(nil, "That is an invalid pill effect ID.")
464
+ return
465
+ end
466
+ Isaac.ExecuteCommand("g p" .. tostring(num))
467
+ printConsole(
468
+ nil,
469
+ "Gave pill: " .. tostring(num)
470
+ )
471
+ return
472
+ end
473
+ local match = getMapPartialMatch(nil, params, PILL_EFFECT_MAP)
474
+ if match == nil then
475
+ printConsole(nil, "Unknown pill effect: " .. params)
476
+ return
477
+ end
478
+ Isaac.ExecuteCommand("g p" .. tostring(match))
479
+ printConsole(
480
+ nil,
481
+ "Gave pill: " .. tostring(match)
482
+ )
483
+ end
484
+ function ____exports.pills(self)
485
+ local pillColor = 1
486
+ local horse = false
487
+ do
488
+ local y = 0
489
+ while y <= 6 do
490
+ do
491
+ local x = 0
492
+ while x <= 12 do
493
+ if pillColor == PillColor.NUM_PILLS then
494
+ if horse then
495
+ return
496
+ end
497
+ horse = true
498
+ pillColor = 1
499
+ end
500
+ local horsePillColor = pillColor + PILL_GIANT_FLAG
501
+ local subType = horse and horsePillColor or pillColor
502
+ local position = gridToPos(nil, x, y)
503
+ Isaac.Spawn(
504
+ EntityType.ENTITY_PICKUP,
505
+ PickupVariant.PICKUP_PILL,
506
+ subType,
507
+ position,
508
+ Vector.Zero,
509
+ nil
510
+ )
511
+ pillColor = pillColor + 1
512
+ x = x + 1
513
+ end
514
+ end
515
+ y = y + 1
516
+ end
517
+ end
518
+ end
519
+ function ____exports.planetarium(self)
520
+ warpToRoomType(nil, RoomType.ROOM_PLANETARIUM, "Planetarium")
521
+ end
522
+ function ____exports.pocket(self, params)
523
+ if params == "" then
524
+ printConsole(nil, "You must supply a collectible type to put as the pocket item.")
525
+ return
526
+ end
527
+ local num = tonumber(params)
528
+ if num == nil then
529
+ printConsole(nil, "That is an invalid collectible type.")
530
+ return
531
+ end
532
+ local player = Isaac.GetPlayer()
533
+ player:SetPocketActiveItem(num, ActiveSlot.SLOT_POCKET)
534
+ end
535
+ function ____exports.positionCommand(self)
536
+ for ____, player in ipairs(getPlayers(nil)) do
537
+ local character = player:GetPlayerType()
538
+ printConsole(
539
+ nil,
540
+ ((((("Player position for character " .. tostring(character)) .. ": (") .. tostring(player.Position.X)) .. ", ") .. tostring(player.Position.Y)) .. ")"
541
+ )
542
+ end
543
+ end
544
+ function ____exports.redHearts(self, params)
545
+ ____exports.hearts(nil, params)
546
+ end
547
+ function ____exports.rh(self, params)
548
+ ____exports.redHearts(nil, params)
549
+ end
550
+ function ____exports.roomCommand(self)
551
+ logRoom()
552
+ end
553
+ function ____exports.rottenHearts(self, params)
554
+ addHeart(nil, params, HealthType.ROTTEN)
555
+ end
556
+ function ____exports.s(self, params)
557
+ if params == "" then
558
+ printConsole(nil, "You must specify a stage number.")
559
+ return
560
+ end
561
+ local finalCharacter = string.sub(params, -1)
562
+ local stageString
563
+ local stageTypeLetter
564
+ if finalCharacter == "a" or finalCharacter == "b" or finalCharacter == "c" or finalCharacter == "d" then
565
+ stageString = __TS__StringSlice(params, 0, #params - 1)
566
+ stageTypeLetter = finalCharacter
567
+ else
568
+ stageString = params
569
+ stageTypeLetter = ""
570
+ end
571
+ local stage = tonumber(stageString)
572
+ if stage == nil then
573
+ printConsole(
574
+ nil,
575
+ "That is an invalid stage number: " .. tostring(stage)
576
+ )
577
+ return
578
+ end
579
+ local minStage = 1
580
+ local maxStage = 13
581
+ if stage < minStage or stage > maxStage then
582
+ printConsole(
583
+ nil,
584
+ ((("Invalid stage number; must be between " .. tostring(minStage)) .. " and ") .. tostring(maxStage)) .. "."
585
+ )
586
+ return
587
+ end
588
+ Isaac.ExecuteCommand(("stage " .. tostring(stage)) .. stageTypeLetter)
589
+ end
590
+ function ____exports.seeds(self)
591
+ logAllSeedEffects()
592
+ printConsole(nil, "Logged the seed effects to the \"log.txt\" file.")
593
+ end
594
+ function ____exports.sh(self, params)
595
+ ____exports.soulHearts(nil, params)
596
+ end
597
+ function ____exports.shop(self)
598
+ warpToRoomType(nil, RoomType.ROOM_SHOP, "shop")
599
+ end
600
+ function ____exports.smelt(self)
601
+ local player = Isaac.GetPlayer()
602
+ useActiveItemTemp(nil, player, CollectibleType.COLLECTIBLE_SMELTER)
603
+ end
604
+ function ____exports.soulCharges(self, params)
605
+ local charges = 1
606
+ if params ~= "" then
607
+ local num = tonumber(params)
608
+ if num == nil then
609
+ printConsole(nil, "That is an invalid amount of charges to add.")
610
+ return
611
+ end
612
+ charges = num
613
+ end
614
+ local player = Isaac.GetPlayer()
615
+ player:AddSoulCharge(charges)
616
+ end
617
+ function ____exports.sound(self, params)
618
+ local soundEffect = tonumber(params)
619
+ if soundEffect == nil then
620
+ printConsole(nil, "That is an invalid sound effect ID.")
621
+ return
622
+ end
623
+ sfxManager:Play(soundEffect)
624
+ end
625
+ function ____exports.sounds(self)
626
+ logSounds()
627
+ printConsole(nil, "Logged the currently playing sound effects to the \"log.txt\" file.")
628
+ end
629
+ function ____exports.spam(self)
630
+ v.run.spamBloodRights = not v.run.spamBloodRights
631
+ end
632
+ function ____exports.speed(self)
633
+ local player = Isaac.GetPlayer()
634
+ v.run.maxSpeed = not v.run.maxSpeed
635
+ if v.run.maxSpeed and not player:HasCollectible(CollectibleType.COLLECTIBLE_FATE) then
636
+ local numEternalHearts = player:GetEternalHearts()
637
+ if numEternalHearts == 0 then
638
+ player:AddCollectible(CollectibleType.COLLECTIBLE_FATE)
639
+ player:AddEternalHearts(-1)
640
+ else
641
+ player:AddEternalHearts(-1)
642
+ player:AddCollectible(CollectibleType.COLLECTIBLE_FATE)
643
+ end
644
+ end
645
+ player:AddCacheFlags(CacheFlag.CACHE_SPEED)
646
+ player:EvaluateItems()
647
+ printEnabled(nil, v.run.maxSpeed, "max speed")
648
+ end
649
+ function ____exports.trapdoorCommand(self)
650
+ spawnTrapdoorOrCrawlspace(nil, true)
651
+ end
652
+ function ____exports.treasure(self)
653
+ warpToRoomType(nil, RoomType.ROOM_TREASURE, "Treasure Room")
654
+ end
655
+ function ____exports.ultra(self)
656
+ warpToRoomType(nil, RoomType.ROOM_ULTRASECRET, "Ultra Secret Room")
657
+ end
658
+ return ____exports
@@ -0,0 +1,25 @@
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ /**
3
+ * Enables extra console commands which are useful for debugging. See the `isaacscript-common`
4
+ * documentation for details on the commands that are added.
5
+ */
6
+ export declare function enableExtraConsoleCommands(mod: Mod): void;
7
+ /**
8
+ * Helper function to add a custom console command.
9
+ *
10
+ * The standard library comes with many existing console commands that are useful for debugging, but
11
+ * you can also add your own commands that are useful for your particular mod. It's easier to add
12
+ * commands to the existing command system than to add logic manually to the ExecuteCmd callback.
13
+ *
14
+ * Before using this function, you must first invoke `enableExtraConsoleCommands`.
15
+ */
16
+ export declare function addConsoleCommand(commandName: string, commandFunction: (params: string) => void): void;
17
+ /**
18
+ * Helper function to remove a custom console command.
19
+ *
20
+ * The standard library comes with many existing console commands that are useful for debugging. If
21
+ * you want to disable one of them, use this function.
22
+ *
23
+ * Before using this function, you must first invoke `enableExtraConsoleCommands`.
24
+ */
25
+ export declare function removeConsoleCommand(commandName: string): void;