isaacscript-common 31.7.3 → 31.8.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.
- package/dist/index.rollup.d.ts +211 -149
- package/dist/isaacscript-common.lua +144 -14
- package/dist/lualib_bundle.lua +99 -3
- package/dist/src/classes/ModFeature.d.ts +2 -2
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts +1 -1
- package/dist/src/classes/callbacks/PostPlayerFatalDamage.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostUsePillFilter.d.ts +2 -2
- package/dist/src/classes/callbacks/PostUsePillFilter.lua +2 -2
- package/dist/src/classes/features/callbackLogic/CustomGridEntities.d.ts +1 -1
- package/dist/src/classes/features/other/CustomItemPools.d.ts +1 -1
- package/dist/src/classes/features/other/CustomTrapdoors.d.ts +2 -2
- package/dist/src/classes/features/other/DebugDisplay.d.ts +18 -18
- package/dist/src/classes/features/other/ModdedElementSets.d.ts +2 -2
- package/dist/src/classes/features/other/RunInNFrames.d.ts +14 -14
- package/dist/src/classes/features/other/SaveDataManager.d.ts +2 -2
- package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts +1 -1
- package/dist/src/classes/features/other/StageHistory.d.ts +2 -2
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +1 -1
- package/dist/src/functions/array.d.ts +4 -4
- package/dist/src/functions/array.lua +4 -4
- package/dist/src/functions/cards.d.ts +1 -1
- package/dist/src/functions/cards.d.ts.map +1 -1
- package/dist/src/functions/cards.lua +1 -1
- package/dist/src/functions/charge.d.ts +1 -1
- package/dist/src/functions/charge.lua +1 -1
- package/dist/src/functions/collectibles.d.ts +3 -3
- package/dist/src/functions/collectibles.lua +3 -3
- package/dist/src/functions/debugFunctions.d.ts +2 -2
- package/dist/src/functions/debugFunctions.lua +2 -2
- package/dist/src/functions/deepCopy.d.ts +2 -2
- package/dist/src/functions/deepCopy.lua +2 -2
- package/dist/src/functions/globals.d.ts +1 -1
- package/dist/src/functions/globals.lua +1 -1
- package/dist/src/functions/gridEntities.d.ts +6 -6
- package/dist/src/functions/gridEntities.lua +6 -6
- package/dist/src/functions/gridEntitiesSpecific.d.ts +22 -22
- package/dist/src/functions/gridEntitiesSpecific.lua +22 -22
- package/dist/src/functions/logEntities.d.ts +1 -1
- package/dist/src/functions/logEntities.lua +1 -1
- package/dist/src/functions/minimap.d.ts +17 -20
- package/dist/src/functions/minimap.d.ts.map +1 -1
- package/dist/src/functions/minimap.lua +17 -20
- package/dist/src/functions/nextStage.d.ts +2 -2
- package/dist/src/functions/nextStage.lua +2 -2
- package/dist/src/functions/pills.d.ts +2 -2
- package/dist/src/functions/pills.lua +2 -2
- package/dist/src/functions/playerHealth.d.ts +4 -4
- package/dist/src/functions/playerHealth.lua +4 -4
- package/dist/src/functions/playerIndex.d.ts +2 -3
- package/dist/src/functions/playerIndex.d.ts.map +1 -1
- package/dist/src/functions/playerIndex.lua +2 -3
- package/dist/src/functions/players.d.ts +5 -5
- package/dist/src/functions/players.lua +5 -5
- package/dist/src/functions/pocketItems.d.ts +5 -5
- package/dist/src/functions/pocketItems.lua +5 -5
- package/dist/src/functions/revive.d.ts +3 -3
- package/dist/src/functions/revive.lua +3 -3
- package/dist/src/functions/rooms.d.ts +7 -7
- package/dist/src/functions/rooms.lua +7 -7
- package/dist/src/functions/run.d.ts +1 -1
- package/dist/src/functions/run.lua +1 -1
- package/dist/src/functions/set.d.ts +1 -1
- package/dist/src/functions/set.lua +1 -1
- package/dist/src/functions/stage.d.ts +64 -7
- package/dist/src/functions/stage.d.ts.map +1 -1
- package/dist/src/functions/stage.lua +80 -16
- package/dist/src/functions/trinkets.d.ts +1 -1
- package/dist/src/functions/trinkets.lua +1 -1
- package/package.json +2 -2
- package/src/classes/ModFeature.ts +2 -2
- package/src/classes/callbacks/PostPlayerFatalDamage.ts +1 -1
- package/src/classes/callbacks/PostUsePillFilter.ts +2 -2
- package/src/classes/features/callbackLogic/CustomGridEntities.ts +1 -1
- package/src/classes/features/other/CustomItemPools.ts +1 -1
- package/src/classes/features/other/CustomTrapdoors.ts +2 -2
- package/src/classes/features/other/DebugDisplay.ts +18 -18
- package/src/classes/features/other/DisableInputs.ts +2 -2
- package/src/classes/features/other/ModdedElementSets.ts +2 -2
- package/src/classes/features/other/RunInNFrames.ts +15 -15
- package/src/classes/features/other/SaveDataManager.ts +2 -2
- package/src/classes/features/other/SpawnRockAltRewards.ts +1 -1
- package/src/classes/features/other/StageHistory.ts +2 -2
- package/src/classes/features/other/extraConsoleCommands/commands.ts +1 -1
- package/src/functions/array.ts +4 -4
- package/src/functions/cards.ts +1 -1
- package/src/functions/charge.ts +1 -1
- package/src/functions/collectibles.ts +3 -3
- package/src/functions/debugFunctions.ts +2 -2
- package/src/functions/deepCopy.ts +3 -3
- package/src/functions/globals.ts +1 -1
- package/src/functions/gridEntities.ts +6 -6
- package/src/functions/gridEntitiesSpecific.ts +22 -22
- package/src/functions/logEntities.ts +1 -1
- package/src/functions/minimap.ts +17 -20
- package/src/functions/nextStage.ts +2 -2
- package/src/functions/pills.ts +2 -2
- package/src/functions/playerHealth.ts +4 -4
- package/src/functions/playerIndex.ts +2 -3
- package/src/functions/players.ts +5 -5
- package/src/functions/pocketItems.ts +5 -5
- package/src/functions/revive.ts +3 -3
- package/src/functions/rooms.ts +7 -7
- package/src/functions/run.ts +1 -1
- package/src/functions/set.ts +1 -1
- package/src/functions/stage.ts +139 -33
- package/src/functions/trinkets.ts +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 31.
|
|
3
|
+
isaacscript-common 31.8.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -85,6 +85,8 @@ do
|
|
|
85
85
|
return setmetatable({description = description}, symbolMetatable)
|
|
86
86
|
end
|
|
87
87
|
Symbol = {
|
|
88
|
+
asyncDispose = __TS__Symbol("Symbol.asyncDispose"),
|
|
89
|
+
dispose = __TS__Symbol("Symbol.dispose"),
|
|
88
90
|
iterator = __TS__Symbol("Symbol.iterator"),
|
|
89
91
|
hasInstance = __TS__Symbol("Symbol.hasInstance"),
|
|
90
92
|
species = __TS__Symbol("Symbol.species"),
|
|
@@ -584,6 +586,32 @@ local function __TS__ArraySetLength(self, length)
|
|
|
584
586
|
return length
|
|
585
587
|
end
|
|
586
588
|
|
|
589
|
+
local __TS__Unpack = table.unpack or unpack
|
|
590
|
+
|
|
591
|
+
local function __TS__ArrayToReversed(self)
|
|
592
|
+
local copy = {__TS__Unpack(self)}
|
|
593
|
+
__TS__ArrayReverse(copy)
|
|
594
|
+
return copy
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
local function __TS__ArrayToSorted(self, compareFn)
|
|
598
|
+
local copy = {__TS__Unpack(self)}
|
|
599
|
+
__TS__ArraySort(copy, compareFn)
|
|
600
|
+
return copy
|
|
601
|
+
end
|
|
602
|
+
|
|
603
|
+
local function __TS__ArrayToSpliced(self, start, deleteCount, ...)
|
|
604
|
+
local copy = {__TS__Unpack(self)}
|
|
605
|
+
__TS__ArraySplice(copy, start, deleteCount, ...)
|
|
606
|
+
return copy
|
|
607
|
+
end
|
|
608
|
+
|
|
609
|
+
local function __TS__ArrayWith(self, index, value)
|
|
610
|
+
local copy = {__TS__Unpack(self)}
|
|
611
|
+
copy[index + 1] = value
|
|
612
|
+
return copy
|
|
613
|
+
end
|
|
614
|
+
|
|
587
615
|
local function __TS__InstanceOf(obj, classTbl)
|
|
588
616
|
if type(classTbl) ~= "table" then
|
|
589
617
|
error("Right-hand side of 'instanceof' is not an object", 0)
|
|
@@ -616,8 +644,6 @@ local function __TS__Class(self)
|
|
|
616
644
|
return c
|
|
617
645
|
end
|
|
618
646
|
|
|
619
|
-
local __TS__Unpack = table.unpack or unpack
|
|
620
|
-
|
|
621
647
|
local function __TS__FunctionBind(fn, ...)
|
|
622
648
|
local boundArgs = {...}
|
|
623
649
|
return function(____, ...)
|
|
@@ -2433,6 +2459,70 @@ local function __TS__TypeOf(value)
|
|
|
2433
2459
|
end
|
|
2434
2460
|
end
|
|
2435
2461
|
|
|
2462
|
+
local function __TS__Using(self, cb, ...)
|
|
2463
|
+
local args = {...}
|
|
2464
|
+
local thrownError
|
|
2465
|
+
local ok, result = xpcall(
|
|
2466
|
+
function() return cb(
|
|
2467
|
+
nil,
|
|
2468
|
+
__TS__Unpack(args)
|
|
2469
|
+
) end,
|
|
2470
|
+
function(err)
|
|
2471
|
+
thrownError = err
|
|
2472
|
+
return thrownError
|
|
2473
|
+
end
|
|
2474
|
+
)
|
|
2475
|
+
local argArray = {__TS__Unpack(args)}
|
|
2476
|
+
do
|
|
2477
|
+
local i = #argArray - 1
|
|
2478
|
+
while i >= 0 do
|
|
2479
|
+
local ____self_0 = argArray[i + 1]
|
|
2480
|
+
____self_0[Symbol.dispose](____self_0)
|
|
2481
|
+
i = i - 1
|
|
2482
|
+
end
|
|
2483
|
+
end
|
|
2484
|
+
if not ok then
|
|
2485
|
+
error(thrownError, 0)
|
|
2486
|
+
end
|
|
2487
|
+
return result
|
|
2488
|
+
end
|
|
2489
|
+
|
|
2490
|
+
local function __TS__UsingAsync(self, cb, ...)
|
|
2491
|
+
local args = {...}
|
|
2492
|
+
return __TS__AsyncAwaiter(function(____awaiter_resolve)
|
|
2493
|
+
local thrownError
|
|
2494
|
+
local ok, result = xpcall(
|
|
2495
|
+
function() return cb(
|
|
2496
|
+
nil,
|
|
2497
|
+
__TS__Unpack(args)
|
|
2498
|
+
) end,
|
|
2499
|
+
function(err)
|
|
2500
|
+
thrownError = err
|
|
2501
|
+
return thrownError
|
|
2502
|
+
end
|
|
2503
|
+
)
|
|
2504
|
+
local argArray = {__TS__Unpack(args)}
|
|
2505
|
+
do
|
|
2506
|
+
local i = #argArray - 1
|
|
2507
|
+
while i >= 0 do
|
|
2508
|
+
if argArray[i + 1][Symbol.dispose] ~= nil then
|
|
2509
|
+
local ____self_0 = argArray[i + 1]
|
|
2510
|
+
____self_0[Symbol.dispose](____self_0)
|
|
2511
|
+
end
|
|
2512
|
+
if argArray[i + 1][Symbol.asyncDispose] ~= nil then
|
|
2513
|
+
local ____self_1 = argArray[i + 1]
|
|
2514
|
+
__TS__Await(____self_1[Symbol.asyncDispose](____self_1))
|
|
2515
|
+
end
|
|
2516
|
+
i = i - 1
|
|
2517
|
+
end
|
|
2518
|
+
end
|
|
2519
|
+
if not ok then
|
|
2520
|
+
error(thrownError, 0)
|
|
2521
|
+
end
|
|
2522
|
+
return ____awaiter_resolve(nil, result)
|
|
2523
|
+
end)
|
|
2524
|
+
end
|
|
2525
|
+
|
|
2436
2526
|
return {
|
|
2437
2527
|
__TS__ArrayConcat = __TS__ArrayConcat,
|
|
2438
2528
|
__TS__ArrayEntries = __TS__ArrayEntries,
|
|
@@ -2461,6 +2551,10 @@ return {
|
|
|
2461
2551
|
__TS__ArrayFlat = __TS__ArrayFlat,
|
|
2462
2552
|
__TS__ArrayFlatMap = __TS__ArrayFlatMap,
|
|
2463
2553
|
__TS__ArraySetLength = __TS__ArraySetLength,
|
|
2554
|
+
__TS__ArrayToReversed = __TS__ArrayToReversed,
|
|
2555
|
+
__TS__ArrayToSorted = __TS__ArrayToSorted,
|
|
2556
|
+
__TS__ArrayToSpliced = __TS__ArrayToSpliced,
|
|
2557
|
+
__TS__ArrayWith = __TS__ArrayWith,
|
|
2464
2558
|
__TS__AsyncAwaiter = __TS__AsyncAwaiter,
|
|
2465
2559
|
__TS__Await = __TS__Await,
|
|
2466
2560
|
__TS__Class = __TS__Class,
|
|
@@ -2542,7 +2636,9 @@ return {
|
|
|
2542
2636
|
__TS__SymbolRegistryFor = __TS__SymbolRegistryFor,
|
|
2543
2637
|
__TS__SymbolRegistryKeyFor = __TS__SymbolRegistryKeyFor,
|
|
2544
2638
|
__TS__TypeOf = __TS__TypeOf,
|
|
2545
|
-
__TS__Unpack = __TS__Unpack
|
|
2639
|
+
__TS__Unpack = __TS__Unpack,
|
|
2640
|
+
__TS__Using = __TS__Using,
|
|
2641
|
+
__TS__UsingAsync = __TS__UsingAsync
|
|
2546
2642
|
}
|
|
2547
2643
|
end,
|
|
2548
2644
|
["src.enums.ModCallbackCustom"] = function(...)
|
|
@@ -27204,6 +27300,33 @@ function ____exports.goToStage(self, stage, stageType)
|
|
|
27204
27300
|
local command = ("stage " .. tostring(stage)) .. stageTypeLetterSuffix
|
|
27205
27301
|
Isaac.ExecuteCommand(command)
|
|
27206
27302
|
end
|
|
27303
|
+
function ____exports.isFinalFloor(self, stage, stageType)
|
|
27304
|
+
return stage == LevelStage.DARK_ROOM_CHEST or stage == LevelStage.THE_VOID or stage == LevelStage.HOME or stage == LevelStage.WOMB_2 and ____exports.isRepentanceStage(nil, stageType)
|
|
27305
|
+
end
|
|
27306
|
+
function ____exports.isStageWithNaturalDevilRoom(self, effectiveStage)
|
|
27307
|
+
return inRange(nil, effectiveStage, LevelStage.BASEMENT_2, LevelStage.WOMB_2) and effectiveStage ~= LevelStage.BLUE_WOMB
|
|
27308
|
+
end
|
|
27309
|
+
function ____exports.isStageWithRandomBossCollectible(self, stage)
|
|
27310
|
+
return stage ~= LevelStage.DEPTHS_2 and stage < LevelStage.WOMB_2
|
|
27311
|
+
end
|
|
27312
|
+
function ____exports.isStageWithSecretExitToDownpour(self, stage)
|
|
27313
|
+
return stage == LevelStage.BASEMENT_1 or stage == LevelStage.BASEMENT_2
|
|
27314
|
+
end
|
|
27315
|
+
function ____exports.isStageWithSecretExitToMausoleum(self, stage, stageType)
|
|
27316
|
+
local repentanceStage = ____exports.isRepentanceStage(nil, stageType)
|
|
27317
|
+
return stage == LevelStage.DEPTHS_1 and not repentanceStage or stage == LevelStage.CAVES_2 and repentanceStage
|
|
27318
|
+
end
|
|
27319
|
+
function ____exports.isStageWithSecretExitToMines(self, stage, stageType)
|
|
27320
|
+
local repentanceStage = ____exports.isRepentanceStage(nil, stageType)
|
|
27321
|
+
return stage == LevelStage.CAVES_1 and not repentanceStage or stage == LevelStage.BASEMENT_2 and repentanceStage
|
|
27322
|
+
end
|
|
27323
|
+
function ____exports.isStageWithShovelTrapdoors(self, stage, stageType)
|
|
27324
|
+
local repentanceStage = ____exports.isRepentanceStage(nil, stageType)
|
|
27325
|
+
return stage < LevelStage.WOMB_2 or stage == LevelStage.WOMB_2 and not repentanceStage
|
|
27326
|
+
end
|
|
27327
|
+
function ____exports.isStageWithStoryBoss(self, stage)
|
|
27328
|
+
return stage == LevelStage.DEPTHS_2 or stage >= LevelStage.WOMB_2
|
|
27329
|
+
end
|
|
27207
27330
|
function ____exports.onAscent(self)
|
|
27208
27331
|
return game:GetStateFlag(GameStateFlag.BACKWARDS_PATH)
|
|
27209
27332
|
end
|
|
@@ -27233,7 +27356,8 @@ end
|
|
|
27233
27356
|
function ____exports.onFinalFloor(self)
|
|
27234
27357
|
local level = game:GetLevel()
|
|
27235
27358
|
local stage = level:GetStage()
|
|
27236
|
-
|
|
27359
|
+
local stageType = level:GetStageType()
|
|
27360
|
+
return ____exports.isFinalFloor(nil, stage, stageType)
|
|
27237
27361
|
end
|
|
27238
27362
|
function ____exports.onFirstFloor(self)
|
|
27239
27363
|
local effectiveStage = ____exports.getEffectiveStage(nil)
|
|
@@ -27270,34 +27394,40 @@ function ____exports.onStageType(self, ...)
|
|
|
27270
27394
|
end
|
|
27271
27395
|
function ____exports.onStageWithNaturalDevilRoom(self)
|
|
27272
27396
|
local effectiveStage = ____exports.getEffectiveStage(nil)
|
|
27273
|
-
return
|
|
27397
|
+
return ____exports.isStageWithNaturalDevilRoom(nil, effectiveStage)
|
|
27274
27398
|
end
|
|
27275
27399
|
function ____exports.onStageWithRandomBossCollectible(self)
|
|
27276
27400
|
local level = game:GetLevel()
|
|
27277
27401
|
local stage = level:GetStage()
|
|
27278
|
-
return
|
|
27402
|
+
return ____exports.isStageWithRandomBossCollectible(nil, stage)
|
|
27279
27403
|
end
|
|
27280
27404
|
function ____exports.onStageWithSecretExitToDownpour(self)
|
|
27281
27405
|
local level = game:GetLevel()
|
|
27282
27406
|
local stage = level:GetStage()
|
|
27283
|
-
return
|
|
27407
|
+
return ____exports.isStageWithSecretExitToDownpour(nil, stage)
|
|
27284
27408
|
end
|
|
27285
27409
|
function ____exports.onStageWithSecretExitToMausoleum(self)
|
|
27286
27410
|
local level = game:GetLevel()
|
|
27287
27411
|
local stage = level:GetStage()
|
|
27288
|
-
local
|
|
27289
|
-
return
|
|
27412
|
+
local stageType = level:GetStageType()
|
|
27413
|
+
return ____exports.isStageWithSecretExitToMausoleum(nil, stage, stageType)
|
|
27290
27414
|
end
|
|
27291
27415
|
function ____exports.onStageWithSecretExitToMines(self)
|
|
27292
27416
|
local level = game:GetLevel()
|
|
27293
27417
|
local stage = level:GetStage()
|
|
27294
|
-
local
|
|
27295
|
-
return
|
|
27418
|
+
local stageType = level:GetStageType()
|
|
27419
|
+
return ____exports.isStageWithSecretExitToMines(nil, stage, stageType)
|
|
27420
|
+
end
|
|
27421
|
+
function ____exports.onStageWithShovelTrapdoors(self)
|
|
27422
|
+
local level = game:GetLevel()
|
|
27423
|
+
local stage = level:GetStage()
|
|
27424
|
+
local stageType = level:GetStageType()
|
|
27425
|
+
return ____exports.isStageWithShovelTrapdoors(nil, stage, stageType)
|
|
27296
27426
|
end
|
|
27297
|
-
function ____exports.
|
|
27427
|
+
function ____exports.onStageWithStoryBoss(self)
|
|
27298
27428
|
local level = game:GetLevel()
|
|
27299
27429
|
local stage = level:GetStage()
|
|
27300
|
-
return
|
|
27430
|
+
return ____exports.isStageWithStoryBoss(nil, stage)
|
|
27301
27431
|
end
|
|
27302
27432
|
function ____exports.setStage(self, stage, stageType, reseed)
|
|
27303
27433
|
if reseed == nil then
|
package/dist/lualib_bundle.lua
CHANGED
|
@@ -34,6 +34,8 @@ do
|
|
|
34
34
|
return setmetatable({description = description}, symbolMetatable)
|
|
35
35
|
end
|
|
36
36
|
Symbol = {
|
|
37
|
+
asyncDispose = __TS__Symbol("Symbol.asyncDispose"),
|
|
38
|
+
dispose = __TS__Symbol("Symbol.dispose"),
|
|
37
39
|
iterator = __TS__Symbol("Symbol.iterator"),
|
|
38
40
|
hasInstance = __TS__Symbol("Symbol.hasInstance"),
|
|
39
41
|
species = __TS__Symbol("Symbol.species"),
|
|
@@ -533,6 +535,32 @@ local function __TS__ArraySetLength(self, length)
|
|
|
533
535
|
return length
|
|
534
536
|
end
|
|
535
537
|
|
|
538
|
+
local __TS__Unpack = table.unpack or unpack
|
|
539
|
+
|
|
540
|
+
local function __TS__ArrayToReversed(self)
|
|
541
|
+
local copy = {__TS__Unpack(self)}
|
|
542
|
+
__TS__ArrayReverse(copy)
|
|
543
|
+
return copy
|
|
544
|
+
end
|
|
545
|
+
|
|
546
|
+
local function __TS__ArrayToSorted(self, compareFn)
|
|
547
|
+
local copy = {__TS__Unpack(self)}
|
|
548
|
+
__TS__ArraySort(copy, compareFn)
|
|
549
|
+
return copy
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
local function __TS__ArrayToSpliced(self, start, deleteCount, ...)
|
|
553
|
+
local copy = {__TS__Unpack(self)}
|
|
554
|
+
__TS__ArraySplice(copy, start, deleteCount, ...)
|
|
555
|
+
return copy
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
local function __TS__ArrayWith(self, index, value)
|
|
559
|
+
local copy = {__TS__Unpack(self)}
|
|
560
|
+
copy[index + 1] = value
|
|
561
|
+
return copy
|
|
562
|
+
end
|
|
563
|
+
|
|
536
564
|
local function __TS__InstanceOf(obj, classTbl)
|
|
537
565
|
if type(classTbl) ~= "table" then
|
|
538
566
|
error("Right-hand side of 'instanceof' is not an object", 0)
|
|
@@ -565,8 +593,6 @@ local function __TS__Class(self)
|
|
|
565
593
|
return c
|
|
566
594
|
end
|
|
567
595
|
|
|
568
|
-
local __TS__Unpack = table.unpack or unpack
|
|
569
|
-
|
|
570
596
|
local function __TS__FunctionBind(fn, ...)
|
|
571
597
|
local boundArgs = {...}
|
|
572
598
|
return function(____, ...)
|
|
@@ -2382,6 +2408,70 @@ local function __TS__TypeOf(value)
|
|
|
2382
2408
|
end
|
|
2383
2409
|
end
|
|
2384
2410
|
|
|
2411
|
+
local function __TS__Using(self, cb, ...)
|
|
2412
|
+
local args = {...}
|
|
2413
|
+
local thrownError
|
|
2414
|
+
local ok, result = xpcall(
|
|
2415
|
+
function() return cb(
|
|
2416
|
+
nil,
|
|
2417
|
+
__TS__Unpack(args)
|
|
2418
|
+
) end,
|
|
2419
|
+
function(err)
|
|
2420
|
+
thrownError = err
|
|
2421
|
+
return thrownError
|
|
2422
|
+
end
|
|
2423
|
+
)
|
|
2424
|
+
local argArray = {__TS__Unpack(args)}
|
|
2425
|
+
do
|
|
2426
|
+
local i = #argArray - 1
|
|
2427
|
+
while i >= 0 do
|
|
2428
|
+
local ____self_0 = argArray[i + 1]
|
|
2429
|
+
____self_0[Symbol.dispose](____self_0)
|
|
2430
|
+
i = i - 1
|
|
2431
|
+
end
|
|
2432
|
+
end
|
|
2433
|
+
if not ok then
|
|
2434
|
+
error(thrownError, 0)
|
|
2435
|
+
end
|
|
2436
|
+
return result
|
|
2437
|
+
end
|
|
2438
|
+
|
|
2439
|
+
local function __TS__UsingAsync(self, cb, ...)
|
|
2440
|
+
local args = {...}
|
|
2441
|
+
return __TS__AsyncAwaiter(function(____awaiter_resolve)
|
|
2442
|
+
local thrownError
|
|
2443
|
+
local ok, result = xpcall(
|
|
2444
|
+
function() return cb(
|
|
2445
|
+
nil,
|
|
2446
|
+
__TS__Unpack(args)
|
|
2447
|
+
) end,
|
|
2448
|
+
function(err)
|
|
2449
|
+
thrownError = err
|
|
2450
|
+
return thrownError
|
|
2451
|
+
end
|
|
2452
|
+
)
|
|
2453
|
+
local argArray = {__TS__Unpack(args)}
|
|
2454
|
+
do
|
|
2455
|
+
local i = #argArray - 1
|
|
2456
|
+
while i >= 0 do
|
|
2457
|
+
if argArray[i + 1][Symbol.dispose] ~= nil then
|
|
2458
|
+
local ____self_0 = argArray[i + 1]
|
|
2459
|
+
____self_0[Symbol.dispose](____self_0)
|
|
2460
|
+
end
|
|
2461
|
+
if argArray[i + 1][Symbol.asyncDispose] ~= nil then
|
|
2462
|
+
local ____self_1 = argArray[i + 1]
|
|
2463
|
+
__TS__Await(____self_1[Symbol.asyncDispose](____self_1))
|
|
2464
|
+
end
|
|
2465
|
+
i = i - 1
|
|
2466
|
+
end
|
|
2467
|
+
end
|
|
2468
|
+
if not ok then
|
|
2469
|
+
error(thrownError, 0)
|
|
2470
|
+
end
|
|
2471
|
+
return ____awaiter_resolve(nil, result)
|
|
2472
|
+
end)
|
|
2473
|
+
end
|
|
2474
|
+
|
|
2385
2475
|
return {
|
|
2386
2476
|
__TS__ArrayConcat = __TS__ArrayConcat,
|
|
2387
2477
|
__TS__ArrayEntries = __TS__ArrayEntries,
|
|
@@ -2410,6 +2500,10 @@ return {
|
|
|
2410
2500
|
__TS__ArrayFlat = __TS__ArrayFlat,
|
|
2411
2501
|
__TS__ArrayFlatMap = __TS__ArrayFlatMap,
|
|
2412
2502
|
__TS__ArraySetLength = __TS__ArraySetLength,
|
|
2503
|
+
__TS__ArrayToReversed = __TS__ArrayToReversed,
|
|
2504
|
+
__TS__ArrayToSorted = __TS__ArrayToSorted,
|
|
2505
|
+
__TS__ArrayToSpliced = __TS__ArrayToSpliced,
|
|
2506
|
+
__TS__ArrayWith = __TS__ArrayWith,
|
|
2413
2507
|
__TS__AsyncAwaiter = __TS__AsyncAwaiter,
|
|
2414
2508
|
__TS__Await = __TS__Await,
|
|
2415
2509
|
__TS__Class = __TS__Class,
|
|
@@ -2491,5 +2585,7 @@ return {
|
|
|
2491
2585
|
__TS__SymbolRegistryFor = __TS__SymbolRegistryFor,
|
|
2492
2586
|
__TS__SymbolRegistryKeyFor = __TS__SymbolRegistryKeyFor,
|
|
2493
2587
|
__TS__TypeOf = __TS__TypeOf,
|
|
2494
|
-
__TS__Unpack = __TS__Unpack
|
|
2588
|
+
__TS__Unpack = __TS__Unpack,
|
|
2589
|
+
__TS__Using = __TS__Using,
|
|
2590
|
+
__TS__UsingAsync = __TS__UsingAsync
|
|
2495
2591
|
}
|
|
@@ -46,7 +46,7 @@ export declare class ModFeature {
|
|
|
46
46
|
*
|
|
47
47
|
* ```ts
|
|
48
48
|
* <T extends boolean>(
|
|
49
|
-
* vanilla: T, // Whether
|
|
49
|
+
* vanilla: T, // Whether this is a vanilla or custom callback.
|
|
50
50
|
* modCallback: T extends true ? ModCallback : ModCallbackCustom,
|
|
51
51
|
* ...callbackArgs: unknown[] // This would be e.g. `pickup: EntityPickup` for the `POST_PICKUP_INIT` callback.
|
|
52
52
|
* ) => boolean;
|
|
@@ -54,7 +54,7 @@ export declare class ModFeature {
|
|
|
54
54
|
*/
|
|
55
55
|
protected shouldCallbackMethodsFire: (<T extends boolean>(vanilla: T, modCallback: T extends true ? ModCallback : ModCallbackCustom, ...callbackArgs: unknown[]) => boolean) | null;
|
|
56
56
|
/**
|
|
57
|
-
* Whether
|
|
57
|
+
* Whether the feature has registered its callbacks yet.
|
|
58
58
|
*
|
|
59
59
|
* This will almost always be equal to true unless you explicitly passed `false` to the second
|
|
60
60
|
* argument of the constructor.
|
|
@@ -5,7 +5,7 @@ import { CustomCallback } from "../private/CustomCallback";
|
|
|
5
5
|
export declare class PostPlayerFatalDamage extends CustomCallback<ModCallbackCustom.POST_PLAYER_FATAL_DAMAGE> {
|
|
6
6
|
v: {
|
|
7
7
|
run: {
|
|
8
|
-
/** Needed to detect if Glass Cannon will kill the player
|
|
8
|
+
/** Needed to detect if Glass Cannon will kill the player. */
|
|
9
9
|
playersLastDamageGameFrame: Map<PlayerIndex, int>;
|
|
10
10
|
};
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostPlayerFatalDamage.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPlayerFatalDamage.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;YANf,
|
|
1
|
+
{"version":3,"file":"PostPlayerFatalDamage.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPlayerFatalDamage.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAWlE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAS3D,qBAAa,qBAAsB,SAAQ,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC;IACnF,CAAC;;YANf,6DAA6D;;;MAMzC;;IAetB,UAAmB,UAAU,0BAAoB;IAEjD;;;OAGG;IAGH,OAAO,CAAC,QAAQ,CAAC,eAAe,CA8B9B;IAGF,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAyClC;CACH"}
|
|
@@ -6,8 +6,8 @@ import { CustomCallback } from "../private/CustomCallback";
|
|
|
6
6
|
/**
|
|
7
7
|
* The vanilla `POST_USE_PILL` callback does not pass the `PillColor` of the used pill. We can
|
|
8
8
|
* resolve pill effect to pill color by using the `ItemPool.GetPillEffect` method. However, this
|
|
9
|
-
* does not tell us whether
|
|
10
|
-
*
|
|
9
|
+
* does not tell us whether the pill used was a horse pill. Thus, we must keep track of the pills
|
|
10
|
+
* that the player is holding on every frame to account for this.
|
|
11
11
|
*
|
|
12
12
|
* In some cases, pills can be used without a corresponding pocket item slot, like in the case of
|
|
13
13
|
* the reverse Temperance card. In this case, we fall back to looking up the color using the
|
|
@@ -28,8 +28,8 @@ local v = {run = {
|
|
|
28
28
|
}}
|
|
29
29
|
--- The vanilla `POST_USE_PILL` callback does not pass the `PillColor` of the used pill. We can
|
|
30
30
|
-- resolve pill effect to pill color by using the `ItemPool.GetPillEffect` method. However, this
|
|
31
|
-
-- does not tell us whether
|
|
32
|
-
--
|
|
31
|
+
-- does not tell us whether the pill used was a horse pill. Thus, we must keep track of the pills
|
|
32
|
+
-- that the player is holding on every frame to account for this.
|
|
33
33
|
--
|
|
34
34
|
-- In some cases, pills can be used without a corresponding pocket item slot, like in the case of
|
|
35
35
|
-- the reverse Temperance card. In this case, we fall back to looking up the color using the
|
|
@@ -95,7 +95,7 @@ export declare class CustomGridEntities extends Feature {
|
|
|
95
95
|
* @param gridIndexOrPositionOrGridEntity You can specify the custom grid entity to remove by
|
|
96
96
|
* providing the grid index, the room position, or the grid entity
|
|
97
97
|
* itself.
|
|
98
|
-
* @param updateRoom Optional. Whether
|
|
98
|
+
* @param updateRoom Optional. Whether to update the room after the grid entity is removed.
|
|
99
99
|
* Default is true. This is generally a good idea because if the room is not
|
|
100
100
|
* updated, you will be unable to spawn another grid entity on the same tile
|
|
101
101
|
* until a frame has passed. However, doing this is expensive, since it involves
|
|
@@ -49,7 +49,7 @@ export declare class CustomItemPools extends Feature {
|
|
|
49
49
|
* In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_ITEM_POOLS`.
|
|
50
50
|
*
|
|
51
51
|
* @param itemPoolTypeCustom An integer representing the custom item pool to use.
|
|
52
|
-
* @param decrease Optional. Whether
|
|
52
|
+
* @param decrease Optional. Whether to remove the selected collectible from the item pool.
|
|
53
53
|
* Default is true.
|
|
54
54
|
* @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
|
|
55
55
|
* the `RNG.Next` method will be called. Default is `getRandomSeed()`.
|
|
@@ -92,8 +92,8 @@ export declare class CustomTrapdoors extends Feature {
|
|
|
92
92
|
* @param anm2Path Optional. The path to the anm2 file to use. By default, the vanilla trapdoor
|
|
93
93
|
* anm2 of "gfx/grid/door_11_trapdoor.anm2" will be used. The specified anm2 file
|
|
94
94
|
* must have animations called "Opened", "Closed", and "Open Animation".
|
|
95
|
-
* @param spawnOpen Optional. Whether
|
|
96
|
-
*
|
|
95
|
+
* @param spawnOpen Optional. Whether to spawn the trapdoor in an open state. By default, behavior
|
|
96
|
+
* will be used that emulates a vanilla trapdoor.
|
|
97
97
|
*/
|
|
98
98
|
spawnCustomTrapdoor(gridIndexOrPosition: int | Vector, destinationName?: string, destinationStage?: LevelStage, destinationStageType?: StageType, anm2Path?: string, spawnOpen?: boolean): GridEntity;
|
|
99
99
|
}
|
|
@@ -251,7 +251,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
251
251
|
*
|
|
252
252
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
253
253
|
* example, you can specify true to always make the display turn on, regardless of
|
|
254
|
-
* whether
|
|
254
|
+
* whether it is already on.
|
|
255
255
|
*/
|
|
256
256
|
togglePlayerDisplay(force?: boolean): void;
|
|
257
257
|
/**
|
|
@@ -261,7 +261,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
261
261
|
*
|
|
262
262
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
263
263
|
* example, you can specify true to always make the display turn on, regardless of
|
|
264
|
-
* whether
|
|
264
|
+
* whether it is already on.
|
|
265
265
|
*/
|
|
266
266
|
toggleTearDisplay(force?: boolean): void;
|
|
267
267
|
/**
|
|
@@ -272,7 +272,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
272
272
|
*
|
|
273
273
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
274
274
|
* example, you can specify true to always make the display turn on, regardless of
|
|
275
|
-
* whether
|
|
275
|
+
* whether it is already on.
|
|
276
276
|
*/
|
|
277
277
|
toggleFamiliarDisplay(force?: boolean): void;
|
|
278
278
|
/**
|
|
@@ -282,7 +282,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
282
282
|
*
|
|
283
283
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
284
284
|
* example, you can specify true to always make the display turn on, regardless of
|
|
285
|
-
* whether
|
|
285
|
+
* whether it is already on.
|
|
286
286
|
*/
|
|
287
287
|
toggleBombDisplay(force?: boolean): void;
|
|
288
288
|
/**
|
|
@@ -292,7 +292,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
292
292
|
*
|
|
293
293
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
294
294
|
* example, you can specify true to always make the display turn on, regardless of
|
|
295
|
-
* whether
|
|
295
|
+
* whether it is already on.
|
|
296
296
|
*/
|
|
297
297
|
togglePickupDisplay(force?: boolean): void;
|
|
298
298
|
/**
|
|
@@ -302,7 +302,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
302
302
|
*
|
|
303
303
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
304
304
|
* example, you can specify true to always make the display turn on, regardless of
|
|
305
|
-
* whether
|
|
305
|
+
* whether it is already on.
|
|
306
306
|
*/
|
|
307
307
|
toggleSlotDisplay(force?: boolean): void;
|
|
308
308
|
/**
|
|
@@ -312,7 +312,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
312
312
|
*
|
|
313
313
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
314
314
|
* example, you can specify true to always make the display turn on, regardless of
|
|
315
|
-
* whether
|
|
315
|
+
* whether it is already on.
|
|
316
316
|
*/
|
|
317
317
|
toggleLaserDisplay(force?: boolean): void;
|
|
318
318
|
/**
|
|
@@ -322,7 +322,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
322
322
|
*
|
|
323
323
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
324
324
|
* example, you can specify true to always make the display turn on, regardless of
|
|
325
|
-
* whether
|
|
325
|
+
* whether it is already on.
|
|
326
326
|
*/
|
|
327
327
|
toggleKnifeDisplay(force?: boolean): void;
|
|
328
328
|
/**
|
|
@@ -333,7 +333,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
333
333
|
*
|
|
334
334
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
335
335
|
* example, you can specify true to always make the display turn on, regardless of
|
|
336
|
-
* whether
|
|
336
|
+
* whether it is already on.
|
|
337
337
|
*/
|
|
338
338
|
toggleProjectileDisplay(force?: boolean): void;
|
|
339
339
|
/**
|
|
@@ -343,7 +343,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
343
343
|
*
|
|
344
344
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
345
345
|
* example, you can specify true to always make the display turn on, regardless of
|
|
346
|
-
* whether
|
|
346
|
+
* whether it is already on.
|
|
347
347
|
*/
|
|
348
348
|
toggleEffectDisplay(force?: boolean): void;
|
|
349
349
|
/**
|
|
@@ -353,7 +353,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
353
353
|
*
|
|
354
354
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
355
355
|
* example, you can specify true to always make the display turn on, regardless of
|
|
356
|
-
* whether
|
|
356
|
+
* whether it is already on.
|
|
357
357
|
*/
|
|
358
358
|
toggleNPCDisplay(force?: boolean): void;
|
|
359
359
|
/**
|
|
@@ -363,7 +363,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
363
363
|
*
|
|
364
364
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
365
365
|
* example, you can specify true to always make the display turn on, regardless of
|
|
366
|
-
* whether
|
|
366
|
+
* whether it is already on.
|
|
367
367
|
*/
|
|
368
368
|
toggleRockDisplay(force?: boolean): void;
|
|
369
369
|
/**
|
|
@@ -373,7 +373,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
373
373
|
*
|
|
374
374
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
375
375
|
* example, you can specify true to always make the display turn on, regardless of
|
|
376
|
-
* whether
|
|
376
|
+
* whether it is already on.
|
|
377
377
|
*/
|
|
378
378
|
togglePitDisplay(force?: boolean): void;
|
|
379
379
|
/**
|
|
@@ -383,7 +383,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
383
383
|
*
|
|
384
384
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
385
385
|
* example, you can specify true to always make the display turn on, regardless of
|
|
386
|
-
* whether
|
|
386
|
+
* whether it is already on.
|
|
387
387
|
*/
|
|
388
388
|
toggleSpikesDisplay(force?: boolean): void;
|
|
389
389
|
/**
|
|
@@ -393,7 +393,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
393
393
|
*
|
|
394
394
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
395
395
|
* example, you can specify true to always make the display turn on, regardless of
|
|
396
|
-
* whether
|
|
396
|
+
* whether it is already on.
|
|
397
397
|
*/
|
|
398
398
|
toggleTNTDisplay(force?: boolean): void;
|
|
399
399
|
/**
|
|
@@ -403,7 +403,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
403
403
|
*
|
|
404
404
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
405
405
|
* example, you can specify true to always make the display turn on, regardless of
|
|
406
|
-
* whether
|
|
406
|
+
* whether it is already on.
|
|
407
407
|
*/
|
|
408
408
|
togglePoopDisplay(force?: boolean): void;
|
|
409
409
|
/**
|
|
@@ -413,7 +413,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
413
413
|
*
|
|
414
414
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
415
415
|
* example, you can specify true to always make the display turn on, regardless of
|
|
416
|
-
* whether
|
|
416
|
+
* whether it is already on.
|
|
417
417
|
*/
|
|
418
418
|
toggleDoorDisplay(force?: boolean): void;
|
|
419
419
|
/**
|
|
@@ -424,7 +424,7 @@ export declare class DebugDisplay extends Feature {
|
|
|
424
424
|
*
|
|
425
425
|
* @param force Optional. A boolean that represents the value to force the display to. For
|
|
426
426
|
* example, you can specify true to always make the display turn on, regardless of
|
|
427
|
-
* whether
|
|
427
|
+
* whether it is already on.
|
|
428
428
|
*/
|
|
429
429
|
togglePressurePlateDisplay(force?: boolean): void;
|
|
430
430
|
}
|
|
@@ -197,8 +197,8 @@ export declare class ModdedElementSets extends Feature {
|
|
|
197
197
|
*
|
|
198
198
|
* In order to use this function, you must upgrade your mod with `ISCFeature.MODDED_ELEMENT_SETS`.
|
|
199
199
|
*
|
|
200
|
-
* @param includeConditionalItems Whether
|
|
201
|
-
*
|
|
200
|
+
* @param includeConditionalItems Whether collectibles that only grant flight conditionally should
|
|
201
|
+
* be included in the set (like Empty Vessel).
|
|
202
202
|
*/
|
|
203
203
|
getFlyingCollectibles(includeConditionalItems: boolean): ReadonlySet<CollectibleType>;
|
|
204
204
|
/**
|