isaacscript-common 30.4.4 → 30.4.6

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.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 30.4.4
3
+ isaacscript-common 30.4.6
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -31450,6 +31450,11 @@ local __TS__Class = ____lualib.__TS__Class
31450
31450
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
31451
31451
  local __TS__ArrayFind = ____lualib.__TS__ArrayFind
31452
31452
  local ____exports = {}
31453
+ local markUsedItemOnThisFrame, v
31454
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
31455
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
31456
+ local ____cachedClasses = require("src.core.cachedClasses")
31457
+ local game = ____cachedClasses.game
31453
31458
  local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
31454
31459
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
31455
31460
  local ____entitiesSpecific = require("src.functions.entitiesSpecific")
@@ -31461,7 +31466,14 @@ local ____DefaultMap = require("src.classes.DefaultMap")
31461
31466
  local DefaultMap = ____DefaultMap.DefaultMap
31462
31467
  local ____CustomCallback = require("src.classes.private.CustomCallback")
31463
31468
  local CustomCallback = ____CustomCallback.CustomCallback
31464
- local v = {room = {playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false)}}
31469
+ function markUsedItemOnThisFrame(self, player)
31470
+ local gameFrameCount = game:GetFrameCount()
31471
+ mapSetPlayer(nil, v.room.playersUsedItemOnFrame, player, gameFrameCount)
31472
+ end
31473
+ v = {room = {
31474
+ playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false),
31475
+ playersUsedItemOnFrame = __TS__New(DefaultMap, 0)
31476
+ }}
31465
31477
  ____exports.PostPurchase = __TS__Class()
31466
31478
  local PostPurchase = ____exports.PostPurchase
31467
31479
  PostPurchase.name = "PostPurchase"
@@ -31474,16 +31486,34 @@ function PostPurchase.prototype.____constructor(self)
31474
31486
  local callbackPickupVariant, callbackPickupSubType = table.unpack(optionalArgs)
31475
31487
  return (callbackPickupVariant == nil or callbackPickupVariant == pickup.Variant) and (callbackPickupSubType == nil or callbackPickupSubType == pickup.SubType)
31476
31488
  end
31489
+ self.postUseItem = function(____, _collectibleType, _rng, player)
31490
+ markUsedItemOnThisFrame(nil, player)
31491
+ return nil
31492
+ end
31493
+ self.postUseCard = function(____, _cardType, player)
31494
+ markUsedItemOnThisFrame(nil, player)
31495
+ return nil
31496
+ end
31497
+ self.postUsePill = function(____, _pillEffect, player)
31498
+ markUsedItemOnThisFrame(nil, player)
31499
+ return nil
31500
+ end
31477
31501
  self.postPEffectUpdateReordered = function(____, player)
31478
31502
  local isHoldingItem = player:IsHoldingItem()
31479
31503
  local wasHoldingItemOnLastFrame = defaultMapGetPlayer(nil, v.room.playersHoldingItemOnLastFrameMap, player)
31480
31504
  mapSetPlayer(nil, v.room.playersHoldingItemOnLastFrameMap, player, isHoldingItem)
31481
- if not wasHoldingItemOnLastFrame and isHoldingItem then
31505
+ if not wasHoldingItemOnLastFrame and isHoldingItem and not self:playerUsedItemRecently(player) then
31482
31506
  self:playerPickedUpNewItem(player)
31483
31507
  end
31484
31508
  end
31509
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItem}, {ModCallback.POST_USE_CARD, self.postUseCard}, {ModCallback.POST_USE_PILL, self.postUsePill}}
31485
31510
  self.customCallbacksUsed = {{ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}}
31486
31511
  end
31512
+ function PostPurchase.prototype.playerUsedItemRecently(self, player)
31513
+ local gameFrameCount = game:GetFrameCount()
31514
+ local usedCollectibleOnFrame = defaultMapGetPlayer(nil, v.room.playersUsedItemOnFrame, player)
31515
+ return gameFrameCount == usedCollectibleOnFrame or gameFrameCount == usedCollectibleOnFrame + 1
31516
+ end
31487
31517
  function PostPurchase.prototype.playerPickedUpNewItem(self, player)
31488
31518
  local pickups = getPickups(nil)
31489
31519
  local disappearingPickup = __TS__ArrayFind(
@@ -44295,6 +44325,7 @@ local removeUrnRewards = ____rockAlt.removeUrnRewards
44295
44325
  local ____rooms = require("src.functions.rooms")
44296
44326
  local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
44297
44327
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
44328
+ local inRoomType = ____rooms.inRoomType
44298
44329
  local ____sound = require("src.functions.sound")
44299
44330
  local getMusicForStage = ____sound.getMusicForStage
44300
44331
  local ____stage = require("src.functions.stage")
@@ -44379,6 +44410,14 @@ function CustomStages.prototype.____constructor(self, customGridEntities, custom
44379
44410
  end
44380
44411
  streakTextPostRender(nil)
44381
44412
  versusScreenPostRender(nil, self.pause, self.disableAllSound)
44413
+ if customStage.music ~= nil then
44414
+ local currentMusic = musicManager:GetCurrentMusicID()
44415
+ local music = Isaac.GetMusicIdByName(customStage.music)
44416
+ if currentMusic == music then
44417
+ musicManager:Resume()
44418
+ musicManager:UpdateVolume()
44419
+ end
44420
+ end
44382
44421
  end
44383
44422
  self.postCurseEval = function(____, curses)
44384
44423
  local customStage = v.run.currentCustomStage
@@ -44442,6 +44481,13 @@ function CustomStages.prototype.____constructor(self, customGridEntities, custom
44442
44481
  self.pause,
44443
44482
  self.runInNFrames
44444
44483
  )
44484
+ if customStage.music ~= nil and inRoomType(nil, RoomType.DEFAULT) then
44485
+ local music = Isaac.GetMusicIdByName(customStage.music)
44486
+ local currentMusic = musicManager:GetCurrentMusicID()
44487
+ if currentMusic ~= music then
44488
+ musicManager:Fadein(music)
44489
+ end
44490
+ end
44445
44491
  end
44446
44492
  self.featuresUsed = {
44447
44493
  ISCFeature.CUSTOM_GRID_ENTITIES,
@@ -44485,10 +44531,10 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
44485
44531
  for ____, room in ipairs(getRoomsInsideGrid(nil)) do
44486
44532
  do
44487
44533
  if room.SafeGridIndex == startingRoomGridIndex then
44488
- goto __continue27
44534
+ goto __continue31
44489
44535
  end
44490
44536
  if room.Data == nil then
44491
- goto __continue27
44537
+ goto __continue31
44492
44538
  end
44493
44539
  local roomType = room.Data.Type
44494
44540
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
@@ -44496,13 +44542,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
44496
44542
  if roomType == RoomType.DEFAULT then
44497
44543
  logError((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name)
44498
44544
  end
44499
- goto __continue27
44545
+ goto __continue31
44500
44546
  end
44501
44547
  local roomShape = room.Data.Shape
44502
44548
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
44503
44549
  if roomDoorSlotFlagMap == nil then
44504
44550
  logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name)
44505
- goto __continue27
44551
+ goto __continue31
44506
44552
  end
44507
44553
  local doorSlotFlags = room.Data.Doors
44508
44554
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
@@ -44512,13 +44558,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
44512
44558
  roomsMetadata = roomDoorSlotFlagMap:get(allDoorSlotFlags)
44513
44559
  if roomsMetadata == nil then
44514
44560
  logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name)
44515
- goto __continue27
44561
+ goto __continue31
44516
44562
  end
44517
44563
  end
44518
44564
  local randomRoom
44519
44565
  if roomType == RoomType.BOSS then
44520
44566
  if customStage.bossPool == nil then
44521
- goto __continue27
44567
+ goto __continue31
44522
44568
  end
44523
44569
  randomRoom = getRandomBossRoomFromPool(
44524
44570
  nil,
@@ -44541,13 +44587,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
44541
44587
  )
44542
44588
  if newRoomData == nil then
44543
44589
  logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
44544
- goto __continue27
44590
+ goto __continue31
44545
44591
  end
44546
44592
  self.customStageCachedRoomData:set(randomRoom.variant, newRoomData)
44547
44593
  end
44548
44594
  room.Data = newRoomData
44549
44595
  end
44550
- ::__continue27::
44596
+ ::__continue31::
44551
44597
  end
44552
44598
  end
44553
44599
  function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakText, verbose)
@@ -44603,7 +44649,8 @@ function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakTex
44603
44649
  self.runInNFrames:runInNRenderFrames(
44604
44650
  function()
44605
44651
  musicManager:Enable()
44606
- musicManager:Crossfade(music)
44652
+ musicManager:Play(music)
44653
+ musicManager:UpdateVolume()
44607
44654
  end,
44608
44655
  MUSIC_DELAY_RENDER_FRAMES
44609
44656
  )
@@ -7,11 +7,16 @@ export declare class PostPurchase extends CustomCallback<T> {
7
7
  v: {
8
8
  room: {
9
9
  playersHoldingItemOnLastFrameMap: DefaultMap<PlayerIndex, boolean, []>;
10
+ playersUsedItemOnFrame: DefaultMap<PlayerIndex, number, []>;
10
11
  };
11
12
  };
12
13
  constructor();
13
14
  protected shouldFire: (fireArgs: [player: EntityPlayer, pickup: EntityPickup], optionalArgs: [pickupVariant?: import("isaac-typescript-definitions").PickupVariant | undefined, subType?: number | undefined]) => boolean;
15
+ private postUseItem;
16
+ private postUseCard;
17
+ private postUsePill;
14
18
  private postPEffectUpdateReordered;
19
+ private playerUsedItemRecently;
15
20
  private playerPickedUpNewItem;
16
21
  }
17
22
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"PostPurchase.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPurchase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAMlE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,cAAc,EAGf,MAAM,2BAA2B,CAAC;AAEnC,KAAK,CAAC,GAAG,iBAAiB,CAAC,aAAa,CAAC;AAUzC,qBAAa,YAAa,SAAQ,cAAc,CAAC,CAAC,CAAC;IACjC,CAAC;;;;MAAK;;IAatB,UAAmB,UAAU,8LAG1B,OAAO,CAUR;IAGF,OAAO,CAAC,0BAA0B,CAehC;IAEF,OAAO,CAAC,qBAAqB;CAS9B"}
1
+ {"version":3,"file":"PostPurchase.d.ts","sourceRoot":"","sources":["../../../../src/classes/callbacks/PostPurchase.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAMlE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,cAAc,EAGf,MAAM,2BAA2B,CAAC;AAEnC,KAAK,CAAC,GAAG,iBAAiB,CAAC,aAAa,CAAC;AAWzC,qBAAa,YAAa,SAAQ,cAAc,CAAC,CAAC,CAAC;IACjC,CAAC;;;;;MAAK;;IAwBtB,UAAmB,UAAU,8LAG1B,OAAO,CAUR;IAGF,OAAO,CAAC,WAAW,CAOjB;IAGF,OAAO,CAAC,WAAW,CAGjB;IAGF,OAAO,CAAC,WAAW,CAGjB;IAGF,OAAO,CAAC,0BAA0B,CAqBhC;IAEF,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,qBAAqB;CAS9B"}
@@ -4,6 +4,11 @@ local __TS__Class = ____lualib.__TS__Class
4
4
  local __TS__ClassExtends = ____lualib.__TS__ClassExtends
5
5
  local __TS__ArrayFind = ____lualib.__TS__ArrayFind
6
6
  local ____exports = {}
7
+ local markUsedItemOnThisFrame, v
8
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
9
+ local ModCallback = ____isaac_2Dtypescript_2Ddefinitions.ModCallback
10
+ local ____cachedClasses = require("src.core.cachedClasses")
11
+ local game = ____cachedClasses.game
7
12
  local ____ModCallbackCustom = require("src.enums.ModCallbackCustom")
8
13
  local ModCallbackCustom = ____ModCallbackCustom.ModCallbackCustom
9
14
  local ____entitiesSpecific = require("src.functions.entitiesSpecific")
@@ -15,7 +20,14 @@ local ____DefaultMap = require("src.classes.DefaultMap")
15
20
  local DefaultMap = ____DefaultMap.DefaultMap
16
21
  local ____CustomCallback = require("src.classes.private.CustomCallback")
17
22
  local CustomCallback = ____CustomCallback.CustomCallback
18
- local v = {room = {playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false)}}
23
+ function markUsedItemOnThisFrame(self, player)
24
+ local gameFrameCount = game:GetFrameCount()
25
+ mapSetPlayer(nil, v.room.playersUsedItemOnFrame, player, gameFrameCount)
26
+ end
27
+ v = {room = {
28
+ playersHoldingItemOnLastFrameMap = __TS__New(DefaultMap, false),
29
+ playersUsedItemOnFrame = __TS__New(DefaultMap, 0)
30
+ }}
19
31
  ____exports.PostPurchase = __TS__Class()
20
32
  local PostPurchase = ____exports.PostPurchase
21
33
  PostPurchase.name = "PostPurchase"
@@ -28,16 +40,34 @@ function PostPurchase.prototype.____constructor(self)
28
40
  local callbackPickupVariant, callbackPickupSubType = table.unpack(optionalArgs)
29
41
  return (callbackPickupVariant == nil or callbackPickupVariant == pickup.Variant) and (callbackPickupSubType == nil or callbackPickupSubType == pickup.SubType)
30
42
  end
43
+ self.postUseItem = function(____, _collectibleType, _rng, player)
44
+ markUsedItemOnThisFrame(nil, player)
45
+ return nil
46
+ end
47
+ self.postUseCard = function(____, _cardType, player)
48
+ markUsedItemOnThisFrame(nil, player)
49
+ return nil
50
+ end
51
+ self.postUsePill = function(____, _pillEffect, player)
52
+ markUsedItemOnThisFrame(nil, player)
53
+ return nil
54
+ end
31
55
  self.postPEffectUpdateReordered = function(____, player)
32
56
  local isHoldingItem = player:IsHoldingItem()
33
57
  local wasHoldingItemOnLastFrame = defaultMapGetPlayer(nil, v.room.playersHoldingItemOnLastFrameMap, player)
34
58
  mapSetPlayer(nil, v.room.playersHoldingItemOnLastFrameMap, player, isHoldingItem)
35
- if not wasHoldingItemOnLastFrame and isHoldingItem then
59
+ if not wasHoldingItemOnLastFrame and isHoldingItem and not self:playerUsedItemRecently(player) then
36
60
  self:playerPickedUpNewItem(player)
37
61
  end
38
62
  end
63
+ self.callbacksUsed = {{ModCallback.POST_USE_ITEM, self.postUseItem}, {ModCallback.POST_USE_CARD, self.postUseCard}, {ModCallback.POST_USE_PILL, self.postUsePill}}
39
64
  self.customCallbacksUsed = {{ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED, self.postPEffectUpdateReordered}}
40
65
  end
66
+ function PostPurchase.prototype.playerUsedItemRecently(self, player)
67
+ local gameFrameCount = game:GetFrameCount()
68
+ local usedCollectibleOnFrame = defaultMapGetPlayer(nil, v.room.playersUsedItemOnFrame, player)
69
+ return gameFrameCount == usedCollectibleOnFrame or gameFrameCount == usedCollectibleOnFrame + 1
70
+ end
41
71
  function PostPurchase.prototype.playerPickedUpNewItem(self, player)
42
72
  local pickups = getPickups(nil)
43
73
  local disappearingPickup = __TS__ArrayFind(
@@ -1 +1 @@
1
- {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AA2ChD,qBAAa,YAAa,SAAQ,OAAO;IAIvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,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;IAc/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAmBhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAwB1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IAgGzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IAkGP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
@@ -42,6 +42,7 @@ local removeUrnRewards = ____rockAlt.removeUrnRewards
42
42
  local ____rooms = require("src.functions.rooms")
43
43
  local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
44
44
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
45
+ local inRoomType = ____rooms.inRoomType
45
46
  local ____sound = require("src.functions.sound")
46
47
  local getMusicForStage = ____sound.getMusicForStage
47
48
  local ____stage = require("src.functions.stage")
@@ -128,6 +129,14 @@ function CustomStages.prototype.____constructor(self, customGridEntities, custom
128
129
  end
129
130
  streakTextPostRender(nil)
130
131
  versusScreenPostRender(nil, self.pause, self.disableAllSound)
132
+ if customStage.music ~= nil then
133
+ local currentMusic = musicManager:GetCurrentMusicID()
134
+ local music = Isaac.GetMusicIdByName(customStage.music)
135
+ if currentMusic == music then
136
+ musicManager:Resume()
137
+ musicManager:UpdateVolume()
138
+ end
139
+ end
131
140
  end
132
141
  self.postCurseEval = function(____, curses)
133
142
  local customStage = v.run.currentCustomStage
@@ -191,6 +200,13 @@ function CustomStages.prototype.____constructor(self, customGridEntities, custom
191
200
  self.pause,
192
201
  self.runInNFrames
193
202
  )
203
+ if customStage.music ~= nil and inRoomType(nil, RoomType.DEFAULT) then
204
+ local music = Isaac.GetMusicIdByName(customStage.music)
205
+ local currentMusic = musicManager:GetCurrentMusicID()
206
+ if currentMusic ~= music then
207
+ musicManager:Fadein(music)
208
+ end
209
+ end
194
210
  end
195
211
  self.featuresUsed = {
196
212
  ISCFeature.CUSTOM_GRID_ENTITIES,
@@ -234,10 +250,10 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
234
250
  for ____, room in ipairs(getRoomsInsideGrid(nil)) do
235
251
  do
236
252
  if room.SafeGridIndex == startingRoomGridIndex then
237
- goto __continue27
253
+ goto __continue31
238
254
  end
239
255
  if room.Data == nil then
240
- goto __continue27
256
+ goto __continue31
241
257
  end
242
258
  local roomType = room.Data.Type
243
259
  local roomShapeMap = customStage.roomTypeMap:get(roomType)
@@ -245,13 +261,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
245
261
  if roomType == RoomType.DEFAULT then
246
262
  logError((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") for custom stage: ") .. customStage.name)
247
263
  end
248
- goto __continue27
264
+ goto __continue31
249
265
  end
250
266
  local roomShape = room.Data.Shape
251
267
  local roomDoorSlotFlagMap = roomShapeMap:get(roomShape)
252
268
  if roomDoorSlotFlagMap == nil then
253
269
  logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") for custom stage: ") .. customStage.name)
254
- goto __continue27
270
+ goto __continue31
255
271
  end
256
272
  local doorSlotFlags = room.Data.Doors
257
273
  local roomsMetadata = roomDoorSlotFlagMap:get(doorSlotFlags)
@@ -261,13 +277,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
261
277
  roomsMetadata = roomDoorSlotFlagMap:get(allDoorSlotFlags)
262
278
  if roomsMetadata == nil then
263
279
  logError((((((((("Failed to find any custom rooms for RoomType." .. RoomType[roomType]) .. " (") .. tostring(roomType)) .. ") + RoomShape.") .. RoomShape[roomShape]) .. " (") .. tostring(roomShape)) .. ") + all doors enabled for custom stage: ") .. customStage.name)
264
- goto __continue27
280
+ goto __continue31
265
281
  end
266
282
  end
267
283
  local randomRoom
268
284
  if roomType == RoomType.BOSS then
269
285
  if customStage.bossPool == nil then
270
- goto __continue27
286
+ goto __continue31
271
287
  end
272
288
  randomRoom = getRandomBossRoomFromPool(
273
289
  nil,
@@ -290,13 +306,13 @@ function CustomStages.prototype.setStageRoomsData(self, customStage, rng, verbos
290
306
  )
291
307
  if newRoomData == nil then
292
308
  logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. customStage.name)
293
- goto __continue27
309
+ goto __continue31
294
310
  end
295
311
  self.customStageCachedRoomData:set(randomRoom.variant, newRoomData)
296
312
  end
297
313
  room.Data = newRoomData
298
314
  end
299
- ::__continue27::
315
+ ::__continue31::
300
316
  end
301
317
  end
302
318
  function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakText, verbose)
@@ -352,7 +368,8 @@ function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakTex
352
368
  self.runInNFrames:runInNRenderFrames(
353
369
  function()
354
370
  musicManager:Enable()
355
- musicManager:Crossfade(music)
371
+ musicManager:Play(music)
372
+ musicManager:UpdateVolume()
356
373
  end,
357
374
  MUSIC_DELAY_RENDER_FRAMES
358
375
  )
@@ -0,0 +1,186 @@
1
+ export * from "./classes/DefaultMap";
2
+ export * from "./classes/ModFeature";
3
+ export * from "./classes/ModUpgraded";
4
+ export * from "./core/cachedClasses";
5
+ export * from "./core/constants";
6
+ export * from "./core/constantsFirstLast";
7
+ export * from "./core/upgradeMod";
8
+ export * from "./enums/AmbushType";
9
+ export * from "./enums/CornerType";
10
+ export * from "./enums/HealthType";
11
+ export * from "./enums/ISCFeature";
12
+ export * from "./enums/LadderSubTypeCustom";
13
+ export * from "./enums/ModCallbackCustom";
14
+ export * from "./enums/MysteriousPaperEffect";
15
+ export * from "./enums/PocketItemType";
16
+ export * from "./enums/RockAltType";
17
+ export * from "./enums/SaveDataKey";
18
+ export * from "./enums/SerializationType";
19
+ export * from "./enums/SlotDestructionType";
20
+ export * from "./enums/StatType";
21
+ export * from "./functions/ambush";
22
+ export * from "./functions/array";
23
+ export * from "./functions/arrayLua";
24
+ export * from "./functions/benchmark";
25
+ export * from "./functions/bitSet128";
26
+ export * from "./functions/bitwise";
27
+ export * from "./functions/bombs";
28
+ export * from "./functions/bosses";
29
+ export * from "./functions/cards";
30
+ export * from "./functions/challenges";
31
+ export * from "./functions/characters";
32
+ export * from "./functions/charge";
33
+ export * from "./functions/chargeBar";
34
+ export * from "./functions/collectibles";
35
+ export * from "./functions/collectibleTag";
36
+ export * from "./functions/color";
37
+ export * from "./functions/console";
38
+ export * from "./functions/curses";
39
+ export * from "./functions/debugFunctions";
40
+ export * from "./functions/decorators";
41
+ export * from "./functions/deepCopy";
42
+ export * from "./functions/deepCopyTests";
43
+ export * from "./functions/dimensions";
44
+ export * from "./functions/direction";
45
+ export * from "./functions/doors";
46
+ export * from "./functions/easing";
47
+ export * from "./functions/effects";
48
+ export * from "./functions/emptyRoom";
49
+ export * from "./functions/entities";
50
+ export * from "./functions/entitiesSpecific";
51
+ export * from "./functions/entityTypes";
52
+ export * from "./functions/enums";
53
+ export * from "./functions/familiars";
54
+ export * from "./functions/flag";
55
+ export * from "./functions/globals";
56
+ export * from "./functions/gridEntities";
57
+ export * from "./functions/gridEntitiesSpecific";
58
+ export * from "./functions/gridIndex";
59
+ export * from "./functions/hex";
60
+ export * from "./functions/initArray";
61
+ export * from "./functions/input";
62
+ export * from "./functions/isaacAPIClass";
63
+ export * from "./functions/itemPool";
64
+ export * from "./functions/jsonHelpers";
65
+ export * from "./functions/jsonRoom";
66
+ export * from "./functions/kColor";
67
+ export * from "./functions/language";
68
+ export * from "./functions/level";
69
+ export * from "./functions/levelGrid";
70
+ export * from "./functions/log";
71
+ export * from "./functions/logEntities";
72
+ export * from "./functions/logMisc";
73
+ export * from "./functions/map";
74
+ export * from "./functions/math";
75
+ export * from "./functions/merge";
76
+ export * from "./functions/mergeTests";
77
+ export * from "./functions/minimap";
78
+ export * from "./functions/modFeatures";
79
+ export * from "./functions/nextStage";
80
+ export * from "./functions/npcs";
81
+ export * from "./functions/pickups";
82
+ export * from "./functions/pickupsSpecific";
83
+ export * from "./functions/pickupVariants";
84
+ export * from "./functions/pills";
85
+ export * from "./functions/playerCenter";
86
+ export * from "./functions/playerDataStructures";
87
+ export * from "./functions/playerHealth";
88
+ export * from "./functions/playerIndex";
89
+ export * from "./functions/players";
90
+ export * from "./functions/playerStats";
91
+ export * from "./functions/pocketItems";
92
+ export * from "./functions/positionVelocity";
93
+ export * from "./functions/pressurePlate";
94
+ export * from "./functions/projectiles";
95
+ export * from "./functions/random";
96
+ export * from "./functions/readOnly";
97
+ export * from "./functions/revive";
98
+ export * from "./functions/rng";
99
+ export * from "./functions/rockAlt";
100
+ export * from "./functions/roomData";
101
+ export * from "./functions/roomGrid";
102
+ export * from "./functions/rooms";
103
+ export * from "./functions/roomShape";
104
+ export * from "./functions/roomShapeWalls";
105
+ export * from "./functions/roomTransition";
106
+ export * from "./functions/run";
107
+ export * from "./functions/seeds";
108
+ export * from "./functions/serialization";
109
+ export * from "./functions/set";
110
+ export * from "./functions/slots";
111
+ export * from "./functions/sort";
112
+ export * from "./functions/sound";
113
+ export * from "./functions/spawnCollectible";
114
+ export * from "./functions/sprites";
115
+ export * from "./functions/stage";
116
+ export * from "./functions/stats";
117
+ export * from "./functions/string";
118
+ export * from "./functions/table";
119
+ export * from "./functions/tears";
120
+ export * from "./functions/transformations";
121
+ export * from "./functions/trinketGive";
122
+ export * from "./functions/trinkets";
123
+ export * from "./functions/tstlClass";
124
+ export * from "./functions/types";
125
+ export * from "./functions/ui";
126
+ export * from "./functions/utils";
127
+ export * from "./functions/vector";
128
+ export * from "./functions/weighted";
129
+ export * from "./interfaces/ChargeBarSprites";
130
+ export * from "./interfaces/Corner";
131
+ export * from "./interfaces/CustomStageTSConfig";
132
+ export * from "./interfaces/GridEntityCustomData";
133
+ export * from "./interfaces/JSONRoomsFile";
134
+ export * from "./interfaces/PlayerHealth";
135
+ export * from "./interfaces/PocketItemDescription";
136
+ export * from "./interfaces/RoomDescription";
137
+ export * from "./interfaces/SaveData";
138
+ export * from "./interfaces/StageHistoryEntry";
139
+ export * from "./interfaces/StatTypeType";
140
+ export * from "./interfaces/TrinketSituation";
141
+ export * from "./interfaces/TSTLClassMetatable";
142
+ export * from "./maps/cardNameToTypeMap";
143
+ export * from "./maps/characterNameToTypeMap";
144
+ export * from "./maps/pillNameToEffectMap";
145
+ export * from "./maps/roomNameToTypeMap";
146
+ export * from "./maps/transformationNameToPlayerFormMap";
147
+ export * from "./objects/colors";
148
+ export * from "./objects/kColors";
149
+ export * from "./types/AllButFirst";
150
+ export * from "./types/AllButLast";
151
+ export * from "./types/AnyClass";
152
+ export * from "./types/AnyEntity";
153
+ export * from "./types/AnyFunction";
154
+ export * from "./types/AnyGridEntity";
155
+ export * from "./types/ConversionHeartSubType";
156
+ export * from "./types/Decrement";
157
+ export * from "./types/EntityID";
158
+ export * from "./types/FunctionTuple";
159
+ export * from "./types/GridEntityID";
160
+ export * from "./types/HasFunction";
161
+ export * from "./types/Immutable";
162
+ export * from "./types/Increment";
163
+ export * from "./types/LowercaseKeys";
164
+ export * from "./types/NaturalNumbersLessThan";
165
+ export * from "./types/NaturalNumbersLessThanOrEqualTo";
166
+ export * from "./types/PickingUpItem";
167
+ export * from "./types/PickupIndex";
168
+ export * from "./types/PlayerIndex";
169
+ export * from "./types/PossibleStatType";
170
+ export * from "./types/PublicInterface";
171
+ export * from "./types/Range";
172
+ export * from "./types/ReadonlyMap";
173
+ export * from "./types/ReadonlySet";
174
+ export * from "./types/StartsWithLowercase";
175
+ export * from "./types/StartsWithUppercase";
176
+ export * from "./types/TSTLClass";
177
+ export * from "./types/Tuple";
178
+ export * from "./types/TupleToIntersection";
179
+ export * from "./types/TupleToUnion";
180
+ export * from "./types/TupleWithMaxLength";
181
+ export * from "./types/UnionToIntersection";
182
+ export * from "./types/UppercaseKeys";
183
+ export * from "./types/WeightedArray";
184
+ export * from "./types/Writable";
185
+ export * from "isaac-typescript-definitions";
186
+ //# sourceMappingURL=indexLua.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"indexLua.d.ts","sourceRoot":"","sources":["../../../../../packages/isaacscript-common/src/indexLua.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC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