isaacscript-common 20.13.0 → 20.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/index.d.ts +32 -4
  2. package/dist/isaacscript-common.lua +183 -116
  3. package/dist/lualib_bundle.lua +6 -30
  4. package/dist/src/classes/features/other/CustomStages.d.ts.map +1 -1
  5. package/dist/src/classes/features/other/CustomStages.lua +5 -0
  6. package/dist/src/classes/features/other/customStages/gridEntities.lua +22 -55
  7. package/dist/src/classes/features/other/customStages/versusScreen.d.ts.map +1 -1
  8. package/dist/src/classes/features/other/customStages/versusScreen.lua +7 -13
  9. package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts +2 -0
  10. package/dist/src/classes/features/other/extraConsoleCommands/commands.d.ts.map +1 -1
  11. package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +6 -0
  12. package/dist/src/functions/logMisc.d.ts +1 -0
  13. package/dist/src/functions/logMisc.d.ts.map +1 -1
  14. package/dist/src/functions/logMisc.lua +6 -0
  15. package/dist/src/functions/sound.d.ts +18 -1
  16. package/dist/src/functions/sound.d.ts.map +1 -1
  17. package/dist/src/functions/sound.lua +31 -1
  18. package/dist/src/functions/ui.d.ts +4 -3
  19. package/dist/src/functions/ui.d.ts.map +1 -1
  20. package/dist/src/functions/ui.lua +4 -3
  21. package/dist/src/interfaces/CustomStageTSConfig.d.ts +7 -0
  22. package/dist/src/interfaces/CustomStageTSConfig.d.ts.map +1 -1
  23. package/dist/src/objects/stageToMusic.d.ts +108 -0
  24. package/dist/src/objects/stageToMusic.d.ts.map +1 -0
  25. package/dist/src/objects/stageToMusic.lua +93 -0
  26. package/package.json +1 -1
  27. package/src/classes/features/other/CustomStages.ts +17 -7
  28. package/src/classes/features/other/customStages/versusScreen.ts +2 -3
  29. package/src/classes/features/other/extraConsoleCommands/commands.ts +7 -0
  30. package/src/functions/logMisc.ts +9 -1
  31. package/src/functions/sound.ts +48 -3
  32. package/src/functions/ui.ts +4 -3
  33. package/src/interfaces/CustomStageTSConfig.ts +8 -0
  34. package/src/objects/stageToMusic.ts +99 -0
package/dist/index.d.ts CHANGED
@@ -52,6 +52,7 @@ import { LevelCurse } from 'isaac-typescript-definitions';
52
52
  import { LevelStage } from 'isaac-typescript-definitions';
53
53
  import { MinibossID } from 'isaac-typescript-definitions';
54
54
  import { ModCallback } from 'isaac-typescript-definitions';
55
+ import { Music } from 'isaac-typescript-definitions';
55
56
  import { NpcState } from 'isaac-typescript-definitions';
56
57
  import { PickupPrice } from 'isaac-typescript-definitions';
57
58
  import { PickupVariant } from 'isaac-typescript-definitions';
@@ -2108,6 +2109,13 @@ export declare interface CustomStageTSConfig {
2108
2109
  * @maximum 5
2109
2110
  */
2110
2111
  baseStageType?: number;
2112
+ /**
2113
+ * Optional. A string that represents the name of the music track from the "content/music.xml"
2114
+ * file that corresponds to this custom stage. It will be manually played upon entering the stage.
2115
+ *
2116
+ * If not specified, the same music track as the base stage will be used.
2117
+ */
2118
+ music?: string;
2111
2119
  /**
2112
2120
  * Optional. An object containing the paths to the backdrop graphics for the stage. (A backdrop is
2113
2121
  * the graphics for the walls and floor.) If not specified, the graphics for Basement will be
@@ -4979,9 +4987,10 @@ export declare function getHorsePillColor(pillColor: PillColor): PillColor;
4979
4987
  export declare function getHorsePillColors(): PillColor[];
4980
4988
 
4981
4989
  /**
4982
- * In the options menu, players have the ability to set a HUD offset. This uses the current HUD
4983
- * offset to generate a vector that should be added to the corresponding position that you want to
4984
- * draw a UI element.
4990
+ * In the options menu, players have the ability to set a HUD offset (which gets written to the
4991
+ * `HudOffset` attribute in the "options.ini" file). This function uses the current HUD offset to
4992
+ * generate a vector that should be added to the corresponding position that you want to draw a UI
4993
+ * element at.
4985
4994
  *
4986
4995
  * For example:
4987
4996
  * - If the user does not have a HUD offset configured, this function will return `Vector(0, 0)`.
@@ -5158,6 +5167,16 @@ export declare function getMatchingGridEntities(gridEntityType: GridEntityType,
5158
5167
 
5159
5168
  export declare function getMoveActions(): ReadonlySet<ButtonAction>;
5160
5169
 
5170
+ /**
5171
+ * Helper function to get the corresponding music value for a stage and stage type combination.
5172
+ *
5173
+ * @param stage Optional. The stage to get the music for. If not specified, the current stage will
5174
+ * be used.
5175
+ * @param stageType Optional. The stage type to get the music for. If not specified, the current
5176
+ * stage type will be used.
5177
+ */
5178
+ export declare function getMusicForStage(stage?: LevelStage, stageType?: StageType): Music;
5179
+
5161
5180
  /**
5162
5181
  * Helper function to get the current effect that the Mysterious Paper trinket is providing to the
5163
5182
  * player. Returns undefined if the player does not have the Mysterious Paper trinket.
@@ -8518,6 +8537,8 @@ export declare function logLevelStateFlags(this: void): void;
8518
8537
 
8519
8538
  export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
8520
8539
 
8540
+ export declare function logMusic(this: void): void;
8541
+
8521
8542
  export declare function logNewGlobals(): void;
8522
8543
 
8523
8544
  export declare function logPlayerEffects(this: void, player: EntityPlayer): void;
@@ -14997,7 +15018,14 @@ export declare interface StatTypeType {
14997
15018
  [StatType.SIZE]: Vector;
14998
15019
  }
14999
15020
 
15000
- export declare function stopAllSoundEffects(): void;
15021
+ /**
15022
+ * Helper function to manually stop every vanilla sound effect. If you also want to stop custom
15023
+ * sound effects in addition to vanilla ones, then pass the `SoundEffectCustom` enum for your mod.
15024
+ *
15025
+ * @param soundEffectCustom Optional. The enum that represents all of the custom sound effects for
15026
+ * your mod.
15027
+ */
15028
+ export declare function stopAllSoundEffects(soundEffectCustom?: unknown): void;
15001
15029
 
15002
15030
  /** Helper function to sum every value in an array together. */
15003
15031
  export declare function sumArray(array: number[] | readonly number[]): number;
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 20.13.0
3
+ isaacscript-common 20.14.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -408,11 +408,7 @@ end
408
408
 
409
409
  local function __TS__ArraySlice(self, first, last)
410
410
  local len = #self
411
- local ____first_0 = first
412
- if ____first_0 == nil then
413
- ____first_0 = 0
414
- end
415
- first = ____first_0
411
+ first = first or 0
416
412
  if first < 0 then
417
413
  first = len + first
418
414
  if first < 0 then
@@ -423,11 +419,7 @@ local function __TS__ArraySlice(self, first, last)
423
419
  first = len
424
420
  end
425
421
  end
426
- local ____last_1 = last
427
- if ____last_1 == nil then
428
- ____last_1 = len
429
- end
430
- last = ____last_1
422
+ last = last or len
431
423
  if last < 0 then
432
424
  last = len + last
433
425
  if last < 0 then
@@ -483,11 +475,7 @@ local function __TS__ArraySplice(self, ...)
483
475
  elseif actualArgumentCount == 1 then
484
476
  actualDeleteCount = len - start
485
477
  else
486
- local ____deleteCount_0 = deleteCount
487
- if ____deleteCount_0 == nil then
488
- ____deleteCount_0 = 0
489
- end
490
- actualDeleteCount = ____deleteCount_0
478
+ actualDeleteCount = deleteCount or 0
491
479
  if actualDeleteCount < 0 then
492
480
  actualDeleteCount = 0
493
481
  end
@@ -1656,11 +1644,7 @@ local function __TS__ParseFloat(numberString)
1656
1644
  return ____temp_0
1657
1645
  end
1658
1646
  local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
1659
- local ____number_1 = number
1660
- if ____number_1 == nil then
1661
- ____number_1 = 0 / 0
1662
- end
1663
- return ____number_1
1647
+ return number or 0 / 0
1664
1648
  end
1665
1649
 
1666
1650
  local function __TS__StringSubstring(self, start, ____end)
@@ -2038,11 +2022,7 @@ local function __TS__SparseArrayPush(sparseArray, ...)
2038
2022
  end
2039
2023
 
2040
2024
  local function __TS__SparseArraySpread(sparseArray)
2041
- local ____unpack_0 = unpack
2042
- if ____unpack_0 == nil then
2043
- ____unpack_0 = table.unpack
2044
- end
2045
- local _unpack = ____unpack_0
2025
+ local _unpack = unpack or table.unpack
2046
2026
  return _unpack(sparseArray, 1, sparseArray.sparseLength)
2047
2027
  end
2048
2028
 
@@ -2224,11 +2204,7 @@ local function __TS__StringCharCodeAt(self, index)
2224
2204
  if index < 0 then
2225
2205
  return 0 / 0
2226
2206
  end
2227
- local ____string_byte_result_0 = string.byte(self, index + 1)
2228
- if ____string_byte_result_0 == nil then
2229
- ____string_byte_result_0 = 0 / 0
2230
- end
2231
- return ____string_byte_result_0
2207
+ return string.byte(self, index + 1) or 0 / 0
2232
2208
  end
2233
2209
 
2234
2210
  local function __TS__StringEndsWith(self, searchString, endPosition)
@@ -6189,8 +6165,8 @@ ____exports.Music.CATACOMBS = 5
6189
6165
  ____exports.Music[____exports.Music.CATACOMBS] = "CATACOMBS"
6190
6166
  ____exports.Music.NECROPOLIS = 6
6191
6167
  ____exports.Music[____exports.Music.NECROPOLIS] = "NECROPOLIS"
6192
- ____exports.Music.WOMB_UTERO = 7
6193
- ____exports.Music[____exports.Music.WOMB_UTERO] = "WOMB_UTERO"
6168
+ ____exports.Music.WOMB = 7
6169
+ ____exports.Music[____exports.Music.WOMB] = "WOMB"
6194
6170
  ____exports.Music.GAME_OVER = 8
6195
6171
  ____exports.Music[____exports.Music.GAME_OVER] = "GAME_OVER"
6196
6172
  ____exports.Music.BOSS = 9
@@ -27787,6 +27763,7 @@ local GameStateFlag = ____isaac_2Dtypescript_2Ddefinitions.GameStateFlag
27787
27763
  local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
27788
27764
  local HeartSubType = ____isaac_2Dtypescript_2Ddefinitions.HeartSubType
27789
27765
  local LevelStateFlag = ____isaac_2Dtypescript_2Ddefinitions.LevelStateFlag
27766
+ local Music = ____isaac_2Dtypescript_2Ddefinitions.Music
27790
27767
  local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
27791
27768
  local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
27792
27769
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
@@ -27794,6 +27771,7 @@ local TearFlag = ____isaac_2Dtypescript_2Ddefinitions.TearFlag
27794
27771
  local UseFlag = ____isaac_2Dtypescript_2Ddefinitions.UseFlag
27795
27772
  local ____cachedClasses = require("src.core.cachedClasses")
27796
27773
  local game = ____cachedClasses.game
27774
+ local musicManager = ____cachedClasses.musicManager
27797
27775
  local sfxManager = ____cachedClasses.sfxManager
27798
27776
  local ____array = require("src.functions.array")
27799
27777
  local arrayToString = ____array.arrayToString
@@ -27943,6 +27921,10 @@ function ____exports.logMap(map)
27943
27921
  end
27944
27922
  log(" The size of the map was: " .. tostring(map.size))
27945
27923
  end
27924
+ function ____exports.logMusic()
27925
+ local currentMusic = musicManager:GetCurrentMusicID()
27926
+ log(((("Currently playing music track: " .. Music[currentMusic]) .. " (") .. tostring(currentMusic)) .. ")")
27927
+ end
27946
27928
  function ____exports.logPlayerEffects(player)
27947
27929
  local effects = getEffectsList(nil, player)
27948
27930
  log("Logging player effects:")
@@ -38005,6 +37987,135 @@ function ____exports.removeUrnRewards(self, gridEntity)
38005
37987
  local spiders = getNPCs(nil, EntityType.SPIDER)
38006
37988
  removeEntitiesSpawnedFromGridEntity(nil, spiders, gridEntity)
38007
37989
  end
37990
+ return ____exports
37991
+ end,
37992
+ ["src.objects.stageToMusic"] = function(...)
37993
+ local ____exports = {}
37994
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
37995
+ local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
37996
+ local Music = ____isaac_2Dtypescript_2Ddefinitions.Music
37997
+ local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
37998
+ local BASEMENT_TO_MUSIC = {
37999
+ [StageType.ORIGINAL] = Music.BASEMENT,
38000
+ [StageType.WRATH_OF_THE_LAMB] = Music.CELLAR,
38001
+ [StageType.AFTERBIRTH] = Music.BURNING_BASEMENT,
38002
+ [StageType.GREED_MODE] = Music.BASEMENT,
38003
+ [StageType.REPENTANCE] = Music.DOWNPOUR,
38004
+ [StageType.REPENTANCE_B] = Music.DROSS
38005
+ }
38006
+ local CAVES_TO_MUSIC = {
38007
+ [StageType.ORIGINAL] = Music.CAVES,
38008
+ [StageType.WRATH_OF_THE_LAMB] = Music.CATACOMBS,
38009
+ [StageType.AFTERBIRTH] = Music.FLOODED_CAVES,
38010
+ [StageType.GREED_MODE] = Music.CAVES,
38011
+ [StageType.REPENTANCE] = Music.MINES,
38012
+ [StageType.REPENTANCE_B] = Music.ASHPIT
38013
+ }
38014
+ local DEPTHS_TO_MUSIC = {
38015
+ [StageType.ORIGINAL] = Music.DEPTHS,
38016
+ [StageType.WRATH_OF_THE_LAMB] = Music.NECROPOLIS,
38017
+ [StageType.AFTERBIRTH] = Music.DANK_DEPTHS,
38018
+ [StageType.GREED_MODE] = Music.DEPTHS,
38019
+ [StageType.REPENTANCE] = Music.MAUSOLEUM,
38020
+ [StageType.REPENTANCE_B] = Music.GEHENNA
38021
+ }
38022
+ local WOMB_TO_MUSIC = {
38023
+ [StageType.ORIGINAL] = Music.WOMB,
38024
+ [StageType.WRATH_OF_THE_LAMB] = Music.UTERO,
38025
+ [StageType.AFTERBIRTH] = Music.SCARRED_WOMB,
38026
+ [StageType.GREED_MODE] = Music.WOMB,
38027
+ [StageType.REPENTANCE] = Music.CORPSE,
38028
+ [StageType.REPENTANCE_B] = Music.MORTIS
38029
+ }
38030
+ local BLUE_WOMB_TO_MUSIC = {
38031
+ [StageType.ORIGINAL] = Music.BLUE_WOMB,
38032
+ [StageType.WRATH_OF_THE_LAMB] = Music.BLUE_WOMB,
38033
+ [StageType.AFTERBIRTH] = Music.BLUE_WOMB,
38034
+ [StageType.GREED_MODE] = Music.BLUE_WOMB,
38035
+ [StageType.REPENTANCE] = Music.BLUE_WOMB,
38036
+ [StageType.REPENTANCE_B] = Music.BLUE_WOMB
38037
+ }
38038
+ local SHEOL_CATHEDRAL_TO_MUSIC = {
38039
+ [StageType.ORIGINAL] = Music.SHEOL,
38040
+ [StageType.WRATH_OF_THE_LAMB] = Music.CATHEDRAL,
38041
+ [StageType.AFTERBIRTH] = Music.SHEOL,
38042
+ [StageType.GREED_MODE] = Music.SHEOL,
38043
+ [StageType.REPENTANCE] = Music.SHEOL,
38044
+ [StageType.REPENTANCE_B] = Music.SHEOL
38045
+ }
38046
+ local DARK_ROOM_CHEST_TO_MUSIC = {
38047
+ [StageType.ORIGINAL] = Music.DARK_ROOM,
38048
+ [StageType.WRATH_OF_THE_LAMB] = Music.CHEST,
38049
+ [StageType.AFTERBIRTH] = Music.DARK_ROOM,
38050
+ [StageType.GREED_MODE] = Music.DARK_ROOM,
38051
+ [StageType.REPENTANCE] = Music.DARK_ROOM,
38052
+ [StageType.REPENTANCE_B] = Music.DARK_ROOM
38053
+ }
38054
+ local THE_VOID_TO_MUSIC = {
38055
+ [StageType.ORIGINAL] = Music.VOID,
38056
+ [StageType.WRATH_OF_THE_LAMB] = Music.VOID,
38057
+ [StageType.AFTERBIRTH] = Music.VOID,
38058
+ [StageType.GREED_MODE] = Music.VOID,
38059
+ [StageType.REPENTANCE] = Music.VOID,
38060
+ [StageType.REPENTANCE_B] = Music.VOID
38061
+ }
38062
+ local HOME_TO_MUSIC = {
38063
+ [StageType.ORIGINAL] = Music.ISAACS_HOUSE,
38064
+ [StageType.WRATH_OF_THE_LAMB] = Music.ISAACS_HOUSE,
38065
+ [StageType.AFTERBIRTH] = Music.ISAACS_HOUSE,
38066
+ [StageType.GREED_MODE] = Music.ISAACS_HOUSE,
38067
+ [StageType.REPENTANCE] = Music.ISAACS_HOUSE,
38068
+ [StageType.REPENTANCE_B] = Music.ISAACS_HOUSE
38069
+ }
38070
+ ____exports.STAGE_TO_MUSIC = {
38071
+ [LevelStage.BASEMENT_1] = BASEMENT_TO_MUSIC,
38072
+ [LevelStage.BASEMENT_2] = BASEMENT_TO_MUSIC,
38073
+ [LevelStage.CAVES_1] = CAVES_TO_MUSIC,
38074
+ [LevelStage.CAVES_2] = CAVES_TO_MUSIC,
38075
+ [LevelStage.DEPTHS_1] = DEPTHS_TO_MUSIC,
38076
+ [LevelStage.DEPTHS_2] = DEPTHS_TO_MUSIC,
38077
+ [LevelStage.WOMB_1] = WOMB_TO_MUSIC,
38078
+ [LevelStage.WOMB_2] = WOMB_TO_MUSIC,
38079
+ [LevelStage.BLUE_WOMB] = BLUE_WOMB_TO_MUSIC,
38080
+ [LevelStage.SHEOL_CATHEDRAL] = SHEOL_CATHEDRAL_TO_MUSIC,
38081
+ [LevelStage.DARK_ROOM_CHEST] = DARK_ROOM_CHEST_TO_MUSIC,
38082
+ [LevelStage.THE_VOID] = THE_VOID_TO_MUSIC,
38083
+ [LevelStage.HOME] = HOME_TO_MUSIC
38084
+ }
38085
+ return ____exports
38086
+ end,
38087
+ ["src.functions.sound"] = function(...)
38088
+ local ____exports = {}
38089
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
38090
+ local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
38091
+ local ____cachedClasses = require("src.core.cachedClasses")
38092
+ local game = ____cachedClasses.game
38093
+ local sfxManager = ____cachedClasses.sfxManager
38094
+ local ____stageToMusic = require("src.objects.stageToMusic")
38095
+ local STAGE_TO_MUSIC = ____stageToMusic.STAGE_TO_MUSIC
38096
+ local ____enums = require("src.functions.enums")
38097
+ local getEnumValues = ____enums.getEnumValues
38098
+ function ____exports.getMusicForStage(self, stage, stageType)
38099
+ local level = game:GetLevel()
38100
+ if stage == nil then
38101
+ stage = level:GetStage()
38102
+ end
38103
+ if stageType == nil then
38104
+ stageType = level:GetStageType()
38105
+ end
38106
+ local stageTypeToMusic = STAGE_TO_MUSIC[stage]
38107
+ return stageTypeToMusic[stageType]
38108
+ end
38109
+ function ____exports.stopAllSoundEffects(self, soundEffectCustom)
38110
+ for ____, soundEffect in ipairs(getEnumValues(nil, SoundEffect)) do
38111
+ sfxManager:Stop(soundEffect)
38112
+ end
38113
+ if soundEffectCustom ~= nil then
38114
+ for ____, soundEffect in ipairs(getEnumValues(nil, soundEffectCustom)) do
38115
+ sfxManager:Stop(soundEffect)
38116
+ end
38117
+ end
38118
+ end
38008
38119
  return ____exports
38009
38120
  end,
38010
38121
  ["src.types.Immutable"] = function(...)
@@ -39627,111 +39738,78 @@ function getNewDoorPNGPath(self, customStage, fileName)
39627
39738
  local ____cond26 = ____switch26 == "gfx/grid/door_01_normaldoor.anm2"
39628
39739
  if ____cond26 then
39629
39740
  do
39630
- local ____customStage_doorPNGPaths_normal_0 = customStage.doorPNGPaths
39631
- if ____customStage_doorPNGPaths_normal_0 ~= nil then
39632
- ____customStage_doorPNGPaths_normal_0 = ____customStage_doorPNGPaths_normal_0.normal
39633
- end
39634
- return ____customStage_doorPNGPaths_normal_0
39741
+ local ____opt_0 = customStage.doorPNGPaths
39742
+ return ____opt_0 and ____opt_0.normal
39635
39743
  end
39636
39744
  end
39637
39745
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_02_treasureroomdoor.anm2"
39638
39746
  if ____cond26 then
39639
39747
  do
39640
- local ____customStage_doorPNGPaths_treasureRoom_2 = customStage.doorPNGPaths
39641
- if ____customStage_doorPNGPaths_treasureRoom_2 ~= nil then
39642
- ____customStage_doorPNGPaths_treasureRoom_2 = ____customStage_doorPNGPaths_treasureRoom_2.treasureRoom
39643
- end
39644
- return ____customStage_doorPNGPaths_treasureRoom_2
39748
+ local ____opt_2 = customStage.doorPNGPaths
39749
+ return ____opt_2 and ____opt_2.treasureRoom
39645
39750
  end
39646
39751
  end
39647
39752
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_03_ambushroomdoor.anm2"
39648
39753
  if ____cond26 then
39649
39754
  do
39650
- local ____customStage_doorPNGPaths_normalChallengeRoom_4 = customStage.doorPNGPaths
39651
- if ____customStage_doorPNGPaths_normalChallengeRoom_4 ~= nil then
39652
- ____customStage_doorPNGPaths_normalChallengeRoom_4 = ____customStage_doorPNGPaths_normalChallengeRoom_4.normalChallengeRoom
39653
- end
39654
- return ____customStage_doorPNGPaths_normalChallengeRoom_4
39755
+ local ____opt_4 = customStage.doorPNGPaths
39756
+ return ____opt_4 and ____opt_4.normalChallengeRoom
39655
39757
  end
39656
39758
  end
39657
39759
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_04_selfsacrificeroomdoor.anm2"
39658
39760
  if ____cond26 then
39659
39761
  do
39660
- local ____customStage_doorPNGPaths_curseRoom_6 = customStage.doorPNGPaths
39661
- if ____customStage_doorPNGPaths_curseRoom_6 ~= nil then
39662
- ____customStage_doorPNGPaths_curseRoom_6 = ____customStage_doorPNGPaths_curseRoom_6.curseRoom
39663
- end
39664
- return ____customStage_doorPNGPaths_curseRoom_6
39762
+ local ____opt_6 = customStage.doorPNGPaths
39763
+ return ____opt_6 and ____opt_6.curseRoom
39665
39764
  end
39666
39765
  end
39667
39766
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_05_arcaderoomdoor.anm2"
39668
39767
  if ____cond26 then
39669
39768
  do
39670
- local ____customStage_doorPNGPaths_arcade_8 = customStage.doorPNGPaths
39671
- if ____customStage_doorPNGPaths_arcade_8 ~= nil then
39672
- ____customStage_doorPNGPaths_arcade_8 = ____customStage_doorPNGPaths_arcade_8.arcade
39673
- end
39674
- return ____customStage_doorPNGPaths_arcade_8
39769
+ local ____opt_8 = customStage.doorPNGPaths
39770
+ return ____opt_8 and ____opt_8.arcade
39675
39771
  end
39676
39772
  end
39677
39773
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_07_devilroomdoor.anm2"
39678
39774
  if ____cond26 then
39679
39775
  do
39680
- local ____customStage_doorPNGPaths_devilRoom_10 = customStage.doorPNGPaths
39681
- if ____customStage_doorPNGPaths_devilRoom_10 ~= nil then
39682
- ____customStage_doorPNGPaths_devilRoom_10 = ____customStage_doorPNGPaths_devilRoom_10.devilRoom
39683
- end
39684
- return ____customStage_doorPNGPaths_devilRoom_10
39776
+ local ____opt_10 = customStage.doorPNGPaths
39777
+ return ____opt_10 and ____opt_10.devilRoom
39685
39778
  end
39686
39779
  end
39687
39780
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_07_holyroomdoor.anm2"
39688
39781
  if ____cond26 then
39689
39782
  do
39690
- local ____customStage_doorPNGPaths_angelRoom_12 = customStage.doorPNGPaths
39691
- if ____customStage_doorPNGPaths_angelRoom_12 ~= nil then
39692
- ____customStage_doorPNGPaths_angelRoom_12 = ____customStage_doorPNGPaths_angelRoom_12.angelRoom
39693
- end
39694
- return ____customStage_doorPNGPaths_angelRoom_12
39783
+ local ____opt_12 = customStage.doorPNGPaths
39784
+ return ____opt_12 and ____opt_12.angelRoom
39695
39785
  end
39696
39786
  end
39697
39787
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_08_holeinwall.anm2"
39698
39788
  if ____cond26 then
39699
39789
  do
39700
- local ____customStage_doorPNGPaths_secretRoom_14 = customStage.doorPNGPaths
39701
- if ____customStage_doorPNGPaths_secretRoom_14 ~= nil then
39702
- ____customStage_doorPNGPaths_secretRoom_14 = ____customStage_doorPNGPaths_secretRoom_14.secretRoom
39703
- end
39704
- return ____customStage_doorPNGPaths_secretRoom_14
39790
+ local ____opt_14 = customStage.doorPNGPaths
39791
+ return ____opt_14 and ____opt_14.secretRoom
39705
39792
  end
39706
39793
  end
39707
39794
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_09_bossambushroomdoor.anm2"
39708
39795
  if ____cond26 then
39709
39796
  do
39710
- local ____customStage_doorPNGPaths_bossChallengeRoom_16 = customStage.doorPNGPaths
39711
- if ____customStage_doorPNGPaths_bossChallengeRoom_16 ~= nil then
39712
- ____customStage_doorPNGPaths_bossChallengeRoom_16 = ____customStage_doorPNGPaths_bossChallengeRoom_16.bossChallengeRoom
39713
- end
39714
- return ____customStage_doorPNGPaths_bossChallengeRoom_16
39797
+ local ____opt_16 = customStage.doorPNGPaths
39798
+ return ____opt_16 and ____opt_16.bossChallengeRoom
39715
39799
  end
39716
39800
  end
39717
39801
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_10_bossroomdoor.anm2"
39718
39802
  if ____cond26 then
39719
39803
  do
39720
- local ____customStage_doorPNGPaths_bossRoom_18 = customStage.doorPNGPaths
39721
- if ____customStage_doorPNGPaths_bossRoom_18 ~= nil then
39722
- ____customStage_doorPNGPaths_bossRoom_18 = ____customStage_doorPNGPaths_bossRoom_18.bossRoom
39723
- end
39724
- return ____customStage_doorPNGPaths_bossRoom_18
39804
+ local ____opt_18 = customStage.doorPNGPaths
39805
+ return ____opt_18 and ____opt_18.bossRoom
39725
39806
  end
39726
39807
  end
39727
39808
  ____cond26 = ____cond26 or ____switch26 == "gfx/grid/door_15_bossrushdoor.anm2"
39728
39809
  if ____cond26 then
39729
39810
  do
39730
- local ____customStage_doorPNGPaths_bossRush_20 = customStage.doorPNGPaths
39731
- if ____customStage_doorPNGPaths_bossRush_20 ~= nil then
39732
- ____customStage_doorPNGPaths_bossRush_20 = ____customStage_doorPNGPaths_bossRush_20.bossRush
39733
- end
39734
- return ____customStage_doorPNGPaths_bossRush_20
39811
+ local ____opt_20 = customStage.doorPNGPaths
39812
+ return ____opt_20 and ____opt_20.bossRush
39735
39813
  end
39736
39814
  end
39737
39815
  until true
@@ -41607,21 +41685,6 @@ ____exports.VERSUS_SCREEN_DIRT_SPOT_COLORS = {
41607
41685
  [StageID.HOME] = DEFAULT_COLOR,
41608
41686
  [StageID.BACKWARDS] = DEFAULT_COLOR
41609
41687
  }
41610
- return ____exports
41611
- end,
41612
- ["src.functions.sound"] = function(...)
41613
- local ____exports = {}
41614
- local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
41615
- local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
41616
- local ____cachedClasses = require("src.core.cachedClasses")
41617
- local sfxManager = ____cachedClasses.sfxManager
41618
- local ____enums = require("src.functions.enums")
41619
- local getEnumValues = ____enums.getEnumValues
41620
- function ____exports.stopAllSoundEffects(self)
41621
- for ____, soundEffect in ipairs(getEnumValues(nil, SoundEffect)) do
41622
- sfxManager:Stop(soundEffect)
41623
- end
41624
- end
41625
41688
  return ____exports
41626
41689
  end,
41627
41690
  ["src.classes.features.other.DisableAllSound"] = function(...)
@@ -41865,6 +41928,8 @@ local ____roomData = require("src.functions.roomData")
41865
41928
  local getRoomSubType = ____roomData.getRoomSubType
41866
41929
  local ____string = require("src.functions.string")
41867
41930
  local removeCharactersBefore = ____string.removeCharactersBefore
41931
+ local ____ui = require("src.functions.ui")
41932
+ local getScreenCenterPos = ____ui.getScreenCenterPos
41868
41933
  local ____utils = require("src.functions.utils")
41869
41934
  local eRange = ____utils.eRange
41870
41935
  local ____bossNamePNGFileNames = require("src.objects.bossNamePNGFileNames")
@@ -42037,11 +42102,8 @@ function ____exports.playVersusScreenAnimation(self, v, customStage, disableAllS
42037
42102
  versusScreenBackgroundSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
42038
42103
  end
42039
42104
  local backgroundColor = VERSUS_SCREEN_BACKGROUND_COLORS[DEFAULT_STAGE_ID]
42040
- local ____customStage_versusScreen_backgroundColor_2 = customStage.versusScreen
42041
- if ____customStage_versusScreen_backgroundColor_2 ~= nil then
42042
- ____customStage_versusScreen_backgroundColor_2 = ____customStage_versusScreen_backgroundColor_2.backgroundColor
42043
- end
42044
- if ____customStage_versusScreen_backgroundColor_2 ~= nil then
42105
+ local ____opt_2 = customStage.versusScreen
42106
+ if (____opt_2 and ____opt_2.backgroundColor) ~= nil then
42045
42107
  local ____customStage_versusScreen_backgroundColor_4 = customStage.versusScreen.backgroundColor
42046
42108
  local r = ____customStage_versusScreen_backgroundColor_4.r
42047
42109
  local g = ____customStage_versusScreen_backgroundColor_4.g
@@ -42054,11 +42116,8 @@ function ____exports.playVersusScreenAnimation(self, v, customStage, disableAllS
42054
42116
  versusScreenDirtSpotSprite:Load("gfx/ui/boss/versusscreen.anm2", true)
42055
42117
  end
42056
42118
  local dirtSpotColor = VERSUS_SCREEN_DIRT_SPOT_COLORS[DEFAULT_STAGE_ID]
42057
- local ____customStage_versusScreen_dirtSpotColor_5 = customStage.versusScreen
42058
- if ____customStage_versusScreen_dirtSpotColor_5 ~= nil then
42059
- ____customStage_versusScreen_dirtSpotColor_5 = ____customStage_versusScreen_dirtSpotColor_5.dirtSpotColor
42060
- end
42061
- if ____customStage_versusScreen_dirtSpotColor_5 ~= nil then
42119
+ local ____opt_5 = customStage.versusScreen
42120
+ if (____opt_5 and ____opt_5.dirtSpotColor) ~= nil then
42062
42121
  local ____customStage_versusScreen_dirtSpotColor_7 = customStage.versusScreen.dirtSpotColor
42063
42122
  local r = ____customStage_versusScreen_dirtSpotColor_7.r
42064
42123
  local g = ____customStage_versusScreen_dirtSpotColor_7.g
@@ -42087,9 +42146,7 @@ function ____exports.versusScreenPostRender(self, v, pause, disableAllSound)
42087
42146
  finishVersusScreenAnimation(nil, v, pause, disableAllSound)
42088
42147
  return
42089
42148
  end
42090
- local room = game:GetRoom()
42091
- local centerPos = room:GetCenterPos()
42092
- local position = Isaac.WorldToRenderPosition(centerPos)
42149
+ local position = getScreenCenterPos(nil)
42093
42150
  versusScreenBackgroundSprite:RenderLayer(VersusScreenLayer.BACKGROUND, position)
42094
42151
  versusScreenBackgroundSprite:Update()
42095
42152
  versusScreenSprite:RenderLayer(VersusScreenLayer.OVERLAY, position)
@@ -42123,6 +42180,7 @@ local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
42123
42180
  local StageType = ____isaac_2Dtypescript_2Ddefinitions.StageType
42124
42181
  local ____cachedClasses = require("src.core.cachedClasses")
42125
42182
  local game = ____cachedClasses.game
42183
+ local musicManager = ____cachedClasses.musicManager
42126
42184
  local metadataJSON = require("src.customStageMetadata")
42127
42185
  local ____decorators = require("src.decorators")
42128
42186
  local Exported = ____decorators.Exported
@@ -42149,6 +42207,8 @@ local removeUrnRewards = ____rockAlt.removeUrnRewards
42149
42207
  local ____rooms = require("src.functions.rooms")
42150
42208
  local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
42151
42209
  local getRoomsInsideGrid = ____rooms.getRoomsInsideGrid
42210
+ local ____sound = require("src.functions.sound")
42211
+ local getMusicForStage = ____sound.getMusicForStage
42152
42212
  local ____stage = require("src.functions.stage")
42153
42213
  local setStage = ____stage.setStage
42154
42214
  local ____types = require("src.functions.types")
@@ -42443,6 +42503,8 @@ function CustomStages.prototype.setCustomStage(self, name, firstFloor, streakTex
42443
42503
  topStreakTextStart(nil, self.v)
42444
42504
  end)
42445
42505
  end
42506
+ local music = customStage.music == nil and getMusicForStage(nil, baseStage, baseStageType) or Isaac.GetMusicIdByName(customStage.music)
42507
+ musicManager:Play(music)
42446
42508
  end
42447
42509
  function CustomStages.prototype.disableCustomStage(self)
42448
42510
  self.v.run.currentCustomStage = nil
@@ -46724,6 +46786,7 @@ local spawnGridEntity = ____gridEntities.spawnGridEntity
46724
46786
  local ____levelGrid = require("src.functions.levelGrid")
46725
46787
  local getRoomGridIndexesForType = ____levelGrid.getRoomGridIndexesForType
46726
46788
  local ____logMisc = require("src.functions.logMisc")
46789
+ local logMusic = ____logMisc.logMusic
46727
46790
  local logPlayerEffects = ____logMisc.logPlayerEffects
46728
46791
  local logRoom = ____logMisc.logRoom
46729
46792
  local logSeedEffects = ____logMisc.logSeedEffects
@@ -47342,6 +47405,10 @@ end
47342
47405
  function ____exports.miniboss(self)
47343
47406
  warpToRoomType(nil, RoomType.MINI_BOSS)
47344
47407
  end
47408
+ function ____exports.music(self)
47409
+ logMusic()
47410
+ print("Logged the currently playing music track to the \"log.txt\" file.")
47411
+ end
47345
47412
  function ____exports.noCurses(self)
47346
47413
  ____exports.disableCurses(nil)
47347
47414
  end
@@ -349,11 +349,7 @@ end
349
349
 
350
350
  local function __TS__ArraySlice(self, first, last)
351
351
  local len = #self
352
- local ____first_0 = first
353
- if ____first_0 == nil then
354
- ____first_0 = 0
355
- end
356
- first = ____first_0
352
+ first = first or 0
357
353
  if first < 0 then
358
354
  first = len + first
359
355
  if first < 0 then
@@ -364,11 +360,7 @@ local function __TS__ArraySlice(self, first, last)
364
360
  first = len
365
361
  end
366
362
  end
367
- local ____last_1 = last
368
- if ____last_1 == nil then
369
- ____last_1 = len
370
- end
371
- last = ____last_1
363
+ last = last or len
372
364
  if last < 0 then
373
365
  last = len + last
374
366
  if last < 0 then
@@ -424,11 +416,7 @@ local function __TS__ArraySplice(self, ...)
424
416
  elseif actualArgumentCount == 1 then
425
417
  actualDeleteCount = len - start
426
418
  else
427
- local ____deleteCount_0 = deleteCount
428
- if ____deleteCount_0 == nil then
429
- ____deleteCount_0 = 0
430
- end
431
- actualDeleteCount = ____deleteCount_0
419
+ actualDeleteCount = deleteCount or 0
432
420
  if actualDeleteCount < 0 then
433
421
  actualDeleteCount = 0
434
422
  end
@@ -1597,11 +1585,7 @@ local function __TS__ParseFloat(numberString)
1597
1585
  return ____temp_0
1598
1586
  end
1599
1587
  local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
1600
- local ____number_1 = number
1601
- if ____number_1 == nil then
1602
- ____number_1 = 0 / 0
1603
- end
1604
- return ____number_1
1588
+ return number or 0 / 0
1605
1589
  end
1606
1590
 
1607
1591
  local function __TS__StringSubstring(self, start, ____end)
@@ -1979,11 +1963,7 @@ local function __TS__SparseArrayPush(sparseArray, ...)
1979
1963
  end
1980
1964
 
1981
1965
  local function __TS__SparseArraySpread(sparseArray)
1982
- local ____unpack_0 = unpack
1983
- if ____unpack_0 == nil then
1984
- ____unpack_0 = table.unpack
1985
- end
1986
- local _unpack = ____unpack_0
1966
+ local _unpack = unpack or table.unpack
1987
1967
  return _unpack(sparseArray, 1, sparseArray.sparseLength)
1988
1968
  end
1989
1969
 
@@ -2165,11 +2145,7 @@ local function __TS__StringCharCodeAt(self, index)
2165
2145
  if index < 0 then
2166
2146
  return 0 / 0
2167
2147
  end
2168
- local ____string_byte_result_0 = string.byte(self, index + 1)
2169
- if ____string_byte_result_0 == nil then
2170
- ____string_byte_result_0 = 0 / 0
2171
- end
2172
- return ____string_byte_result_0
2148
+ return string.byte(self, index + 1) or 0 / 0
2173
2149
  end
2174
2150
 
2175
2151
  local function __TS__StringEndsWith(self, searchString, endPosition)
@@ -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;AAoChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAAwC;IAEzE,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAe;IAqDnC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAQhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAe1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IA+FzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IAoEP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}
1
+ {"version":3,"file":"CustomStages.d.ts","sourceRoot":"","sources":["../../../../../src/classes/features/other/CustomStages.ts"],"names":[],"mappings":"AAyCA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAoChD,qBAAa,YAAa,SAAQ,OAAO;IA8BvC,oCAAoC;IACpC,OAAO,CAAC,eAAe,CAAkC;IAEzD,+BAA+B;IAC/B,OAAO,CAAC,yBAAyB,CAAwC;IAEzE,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,eAAe,CAAkB;IACzC,OAAO,CAAC,sBAAsB,CAAyB;IACvD,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,YAAY,CAAe;IAqDnC,OAAO,CAAC,uBAAuB;IAc/B,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,6BAA6B;IAOrC,OAAO,CAAC,eAAe,CAarB;IAGF,OAAO,CAAC,UAAU,CAQhB;IAGF,OAAO,CAAC,aAAa,CAcnB;IAGF,OAAO,CAAC,eAAe,CAUrB;IAIF,OAAO,CAAC,2BAA2B,CAejC;IAGF,OAAO,CAAC,kBAAkB,CAqBxB;IAGF,OAAO,CAAC,oBAAoB,CAe1B;IAEF,gDAAgD;IAChD,OAAO,CAAC,iBAAiB;IA+FzB;;;;;;;;;;;;;;;;OAgBG;IAEI,cAAc,CACnB,IAAI,EAAE,MAAM,EACZ,UAAU,UAAO,EACjB,UAAU,UAAO,EACjB,OAAO,UAAQ,GACd,IAAI;IA6EP;;;;;OAKG;IAEI,kBAAkB,IAAI,IAAI;CAGlC"}