isaacscript-common 6.18.0 → 6.20.1
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/constants.d.ts +5 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.lua +4 -0
- package/dist/features/customStage/exports.d.ts.map +1 -1
- package/dist/features/customStage/exports.lua +2 -7
- package/dist/features/customTrapdoor/init.d.ts.map +1 -1
- package/dist/features/customTrapdoor/init.lua +10 -2
- package/dist/features/extraConsoleCommands/commandsSubroutines.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/commandsSubroutines.lua +2 -1
- package/dist/features/extraConsoleCommands/listCommands.d.ts.map +1 -1
- package/dist/features/extraConsoleCommands/listCommands.lua +2 -1
- package/dist/features/playerInventory.d.ts.map +1 -1
- package/dist/features/playerInventory.lua +2 -4
- package/dist/functions/curses.d.ts +3 -0
- package/dist/functions/curses.d.ts.map +1 -0
- package/dist/functions/curses.lua +11 -0
- package/dist/functions/dimensions.d.ts +12 -0
- package/dist/functions/dimensions.d.ts.map +1 -0
- package/dist/functions/dimensions.lua +35 -0
- package/dist/functions/eden.d.ts.map +1 -1
- package/dist/functions/eden.lua +2 -4
- package/dist/functions/itemPool.d.ts +18 -0
- package/dist/functions/itemPool.d.ts.map +1 -0
- package/dist/functions/itemPool.lua +133 -0
- package/dist/functions/level.d.ts.map +1 -1
- package/dist/functions/level.lua +8 -7
- package/dist/functions/levelGrid.d.ts +155 -0
- package/dist/functions/levelGrid.d.ts.map +1 -0
- package/dist/functions/levelGrid.lua +349 -0
- package/dist/functions/rockAlt.d.ts +4 -4
- package/dist/functions/rockAlt.d.ts.map +1 -1
- package/dist/functions/rockAlt.lua +69 -20
- package/dist/functions/roomData.d.ts +5 -0
- package/dist/functions/roomData.d.ts.map +1 -1
- package/dist/functions/roomData.lua +6 -0
- package/dist/functions/roomGrid.d.ts +8 -0
- package/dist/functions/roomGrid.d.ts.map +1 -1
- package/dist/functions/rooms.d.ts +42 -61
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +129 -200
- package/dist/functions/saveFile.d.ts +1 -6
- package/dist/functions/saveFile.d.ts.map +1 -1
- package/dist/functions/saveFile.lua +4 -113
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.lua +32 -0
- package/package.json +2 -2
- package/src/constants.ts +8 -0
- package/src/features/customStage/exports.ts +10 -11
- package/src/features/customTrapdoor/init.ts +7 -3
- package/src/features/extraConsoleCommands/commandsSubroutines.ts +2 -1
- package/src/features/extraConsoleCommands/listCommands.ts +2 -1
- package/src/features/playerInventory.ts +2 -3
- package/src/functions/curses.ts +9 -0
- package/src/functions/dimensions.ts +41 -0
- package/src/functions/eden.ts +2 -4
- package/src/functions/itemPool.ts +178 -0
- package/src/functions/level.ts +7 -10
- package/src/functions/levelGrid.ts +468 -0
- package/src/functions/rockAlt.ts +111 -29
- package/src/functions/roomData.ts +12 -0
- package/src/functions/roomGrid.ts +9 -0
- package/src/functions/rooms.ts +93 -206
- package/src/functions/saveFile.ts +5 -147
- package/src/index.ts +4 -0
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
|
|
2
|
+
export declare const ALL_DISPLAY_FLAGS: BitFlags<number & {
|
|
3
|
+
readonly __bitFlagBrand: symbol;
|
|
4
|
+
} & {
|
|
5
|
+
readonly __displayFlagBrand: symbol;
|
|
6
|
+
}>;
|
|
2
7
|
/**
|
|
3
8
|
* The distance of the laser when Azazel does not have any range up items yet. For more info, see
|
|
4
9
|
* the documentation for the `getAzazelBrimstoneDistance` function.
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","s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AyF;AACzF,eAAO,MAAM,0BAA0B,MAAM,CAAC;AAE9C,qFAAqF;AACrF,eAAO,MAAM,qBAAqB,MAAM,CAAC;AAEzC;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAM,CAAC;AAElC,yCAAyC;AACzC,eAAO,MAAM,uCAAuC,QAAmB,CAAC;AAExE,iCAAiC;AACjC,eAAO,MAAM,sCAAsC,QAAmB,CAAC;AAEvE;;;GAGG;AACH,eAAO,MAAM,gCAAgC,QAAmB,CAAC;AAEjE,+EAA+E;AAC/E,eAAO,MAAM,iCAAiC,SAAS,CAAC;AAExD,eAAO,MAAM,cAAc,QAA+B,CAAC;AAE3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAyB,CAAC;AAExD,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAC3C,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAE7C,6FAA6F;AAC7F,eAAO,MAAM,gDAAgD,QAAQ,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAExD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAgB,CAAC;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAkB,CAAC;AAE5D;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAsB,CAAC"}
|
package/dist/constants.lua
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
local ____exports = {}
|
|
2
2
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
3
|
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
4
|
+
local DisplayFlag = ____isaac_2Dtypescript_2Ddefinitions.DisplayFlag
|
|
4
5
|
local ItemPoolType = ____isaac_2Dtypescript_2Ddefinitions.ItemPoolType
|
|
5
6
|
local TrinketSlot = ____isaac_2Dtypescript_2Ddefinitions.TrinketSlot
|
|
6
7
|
local ____constantsFirstLast = require("constantsFirstLast")
|
|
7
8
|
local NUM_NORMAL_PILL_COLORS = ____constantsFirstLast.NUM_NORMAL_PILL_COLORS
|
|
8
9
|
local ____enums = require("functions.enums")
|
|
9
10
|
local getEnumLength = ____enums.getEnumLength
|
|
11
|
+
local ____flag = require("functions.flag")
|
|
12
|
+
local addFlag = ____flag.addFlag
|
|
13
|
+
____exports.ALL_DISPLAY_FLAGS = addFlag(nil, DisplayFlag.VISIBLE, DisplayFlag.SHADOW, DisplayFlag.SHOW_ICON)
|
|
10
14
|
--- The distance of the laser when Azazel does not have any range up items yet. For more info, see
|
|
11
15
|
-- the documentation for the `getAzazelBrimstoneDistance` function.
|
|
12
16
|
____exports.AZAZEL_DEFAULT_BRIMSTONE_DISTANCE = 75.125
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,
|
|
1
|
+
{"version":3,"file":"exports.d.ts","sourceRoot":"","sources":["../../../src/features/customStage/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKX,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,IAAI,CAyGlE;AAED,wBAAgB,mBAAmB,IAAI,IAAI,CAQ1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,GACtB,IAAI,CAGN"}
|
|
@@ -2,7 +2,6 @@ local ____lualib = require("lualib_bundle")
|
|
|
2
2
|
local Map = ____lualib.Map
|
|
3
3
|
local ____exports = {}
|
|
4
4
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
5
|
-
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
6
5
|
local LevelStage = ____isaac_2Dtypescript_2Ddefinitions.LevelStage
|
|
7
6
|
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
8
7
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
@@ -18,12 +17,10 @@ local log = ____log.log
|
|
|
18
17
|
local logError = ____log.logError
|
|
19
18
|
local ____rng = require("functions.rng")
|
|
20
19
|
local newRNG = ____rng.newRNG
|
|
21
|
-
local ____roomData = require("functions.roomData")
|
|
22
|
-
local getRoomData = ____roomData.getRoomData
|
|
23
20
|
local ____rooms = require("functions.rooms")
|
|
21
|
+
local getRoomDataForTypeVariant = ____rooms.getRoomDataForTypeVariant
|
|
24
22
|
local getRooms = ____rooms.getRooms
|
|
25
23
|
local ____stage = require("functions.stage")
|
|
26
|
-
local getGotoCommand = ____stage.getGotoCommand
|
|
27
24
|
local setStage = ____stage.setStage
|
|
28
25
|
local ____customStageUtils = require("features.customStage.customStageUtils")
|
|
29
26
|
local getRandomCustomStageRoom = ____customStageUtils.getRandomCustomStageRoom
|
|
@@ -88,9 +85,7 @@ function ____exports.setCustomStage(self, name, verbose)
|
|
|
88
85
|
local randomRoom = getRandomCustomStageRoom(nil, roomsMetadata, rng, verbose)
|
|
89
86
|
local newRoomData = customStageCachedRoomData:get(randomRoom.variant)
|
|
90
87
|
if newRoomData == nil then
|
|
91
|
-
|
|
92
|
-
Isaac.ExecuteCommand(command)
|
|
93
|
-
newRoomData = getRoomData(nil, GridRoom.DEBUG)
|
|
88
|
+
newRoomData = getRoomDataForTypeVariant(nil, roomType, randomRoom.variant, false)
|
|
94
89
|
if newRoomData == nil then
|
|
95
90
|
logError((("Failed to get the room data for room variant " .. tostring(randomRoom.variant)) .. " for custom stage: ") .. name)
|
|
96
91
|
goto __continue4
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/features/customTrapdoor/init.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAyBxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI,CAUzD"}
|
|
@@ -20,6 +20,8 @@ local getAllPlayers = ____playerIndex.getAllPlayers
|
|
|
20
20
|
local ____roomData = require("functions.roomData")
|
|
21
21
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
22
22
|
local getRoomListIndex = ____roomData.getRoomListIndex
|
|
23
|
+
local ____rooms = require("functions.rooms")
|
|
24
|
+
local teleport = ____rooms.teleport
|
|
23
25
|
local ____stage = require("functions.stage")
|
|
24
26
|
local setStage = ____stage.setStage
|
|
25
27
|
local ____types = require("functions.types")
|
|
@@ -66,7 +68,7 @@ function checkAllPlayersJumpComplete(self)
|
|
|
66
68
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
67
69
|
v.run.state = StageTravelState.PIXELATION_TO_BLACK
|
|
68
70
|
v.run.stateRenderFrame = renderFrameCount
|
|
69
|
-
|
|
71
|
+
teleport(nil, roomGridIndex, Direction.NO_DIRECTION, RoomTransitionAnim.PIXELATION)
|
|
70
72
|
end
|
|
71
73
|
function checkPixelationToBlackComplete(self)
|
|
72
74
|
if v.run.state ~= StageTravelState.PIXELATION_TO_BLACK or v.run.stateRenderFrame == nil then
|
|
@@ -83,7 +85,13 @@ function checkPixelationToBlackComplete(self)
|
|
|
83
85
|
v.run.stateRenderFrame = renderFrameCount
|
|
84
86
|
hud:SetVisible(false)
|
|
85
87
|
goToCustomDestination(nil)
|
|
86
|
-
|
|
88
|
+
teleport(
|
|
89
|
+
nil,
|
|
90
|
+
roomGridIndex,
|
|
91
|
+
Direction.NO_DIRECTION,
|
|
92
|
+
RoomTransitionAnim.PIXELATION,
|
|
93
|
+
true
|
|
94
|
+
)
|
|
87
95
|
end
|
|
88
96
|
function checkPausingOnBlackComplete(self)
|
|
89
97
|
if v.run.state ~= StageTravelState.PAUSING_ON_BLACK or v.run.stateRenderFrame == nil then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commandsSubroutines.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/commandsSubroutines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"commandsSubroutines.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/commandsSubroutines.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAIT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgBpD,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAcrE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAqBlD;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,wBAAwB,EAAE,OAAO,GAChC,IAAI,CAYN;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,IAAI,CAY5E;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAgBrE;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAUjE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAevD"}
|
|
@@ -11,6 +11,8 @@ local ____direction = require("functions.direction")
|
|
|
11
11
|
local directionToVector = ____direction.directionToVector
|
|
12
12
|
local ____gridEntities = require("functions.gridEntities")
|
|
13
13
|
local spawnGridEntityWithVariant = ____gridEntities.spawnGridEntityWithVariant
|
|
14
|
+
local ____levelGrid = require("functions.levelGrid")
|
|
15
|
+
local getRoomGridIndexesForType = ____levelGrid.getRoomGridIndexesForType
|
|
14
16
|
local ____log = require("functions.log")
|
|
15
17
|
local logAllEntities = ____log.logAllEntities
|
|
16
18
|
local logAllGridEntities = ____log.logAllGridEntities
|
|
@@ -21,7 +23,6 @@ local getRoomData = ____roomData.getRoomData
|
|
|
21
23
|
local getRoomDescriptor = ____roomData.getRoomDescriptor
|
|
22
24
|
local ____rooms = require("functions.rooms")
|
|
23
25
|
local changeRoom = ____rooms.changeRoom
|
|
24
|
-
local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
|
|
25
26
|
local ____utils = require("functions.utils")
|
|
26
27
|
local printConsole = ____utils.printConsole
|
|
27
28
|
local ____roomTypeNames = require("objects.roomTypeNames")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"listCommands.d.ts","sourceRoot":"","sources":["../../../src/features/extraConsoleCommands/listCommands.ts"],"names":[],"mappings":"AA2GA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA2C/C;AAED;;;GAGG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,gEAAgE;AAChE,wBAAgB,MAAM,IAAI,IAAI,CAK7B;AAED,sEAAsE;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AA+C;AAC/C,wBAAgB,YAAY,IAAI,IAAI,CAInC;AAED,4CAA4C;AAC5C,wBAAgB,SAAS,IAAI,IAAI,CAEhC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;;GAGG;AACH,wBAAgB,KAAK,IAAI,IAAI,CAQ5B;AAED,wCAAwC;AACxC,wBAAgB,KAAK,IAAI,IAAI,CAE5B;AAED,6CAA6C;AAC7C,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,qDAAqD;AACrD,wBAAgB,YAAY,IAAI,IAAI,CAEnC;AAED,yDAAyD;AACzD,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED,sFAAsF;AACtF,wBAAgB,MAAM,IAAI,IAAI,CAQ7B;AAED,wFAAwF;AACxF,wBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAEvC;AAED;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CA0BzC"}
|
|
@@ -52,6 +52,8 @@ local ____flag = require("functions.flag")
|
|
|
52
52
|
local addFlag = ____flag.addFlag
|
|
53
53
|
local ____gridEntities = require("functions.gridEntities")
|
|
54
54
|
local spawnGridEntity = ____gridEntities.spawnGridEntity
|
|
55
|
+
local ____levelGrid = require("functions.levelGrid")
|
|
56
|
+
local getRoomGridIndexesForType = ____levelGrid.getRoomGridIndexesForType
|
|
55
57
|
local ____log = require("functions.log")
|
|
56
58
|
local logPlayerEffects = ____log.logPlayerEffects
|
|
57
59
|
local logRoom = ____log.logRoom
|
|
@@ -78,7 +80,6 @@ local ____roomGrid = require("functions.roomGrid")
|
|
|
78
80
|
local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
|
|
79
81
|
local ____rooms = require("functions.rooms")
|
|
80
82
|
local changeRoom = ____rooms.changeRoom
|
|
81
|
-
local getRoomGridIndexesForType = ____rooms.getRoomGridIndexesForType
|
|
82
83
|
local ____run = require("functions.run")
|
|
83
84
|
local onSetSeed = ____run.onSetSeed
|
|
84
85
|
local restart = ____run.restart
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"playerInventory.d.ts","sourceRoot":"","sources":["../../src/features/playerInventory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAe,MAAM,8BAA8B,CAAC;AAyG5E;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,yBAAyB,UAAO,GAC/B,eAAe,EAAE,CAanB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__New = ____lualib.__TS__New
|
|
3
|
-
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
4
3
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
5
4
|
local ____exports = {}
|
|
6
5
|
local newPlayerInventory, resetInventory, useItemD4, postGameStarted, postCollectibleAdded, postCollectibleRemoved, v
|
|
@@ -19,7 +18,7 @@ local copyArray = ____array.copyArray
|
|
|
19
18
|
local ____collectibles = require("functions.collectibles")
|
|
20
19
|
local isActiveCollectible = ____collectibles.isActiveCollectible
|
|
21
20
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
22
|
-
local
|
|
21
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
23
22
|
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
24
23
|
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
25
24
|
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
@@ -32,8 +31,7 @@ local ____exports = require("features.saveDataManager.exports")
|
|
|
32
31
|
local saveDataManager = ____exports.saveDataManager
|
|
33
32
|
function newPlayerInventory(self, player)
|
|
34
33
|
local inventory = {}
|
|
35
|
-
|
|
36
|
-
for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
|
|
34
|
+
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
37
35
|
local numCollectibles = player:GetCollectibleNum(collectibleType, true)
|
|
38
36
|
____repeat(
|
|
39
37
|
nil,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curses.d.ts","sourceRoot":"","sources":["../../src/functions/curses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI1D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAInD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____cachedClasses = require("cachedClasses")
|
|
3
|
+
local game = ____cachedClasses.game
|
|
4
|
+
local ____flag = require("functions.flag")
|
|
5
|
+
local hasFlag = ____flag.hasFlag
|
|
6
|
+
function ____exports.hasCurse(self, curse)
|
|
7
|
+
local level = game:GetLevel()
|
|
8
|
+
local curses = level:GetCurses()
|
|
9
|
+
return hasFlag(nil, curses, curse)
|
|
10
|
+
end
|
|
11
|
+
return ____exports
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Dimension } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
|
|
4
|
+
*/
|
|
5
|
+
export declare function getAllDimensions(): Dimension[];
|
|
6
|
+
/**
|
|
7
|
+
* Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
|
|
8
|
+
* but it can change if e.g. the player is in the mirror world of Downpour/Dross.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getDimension(): Dimension;
|
|
11
|
+
export declare function inDimension(dimension: Dimension): boolean;
|
|
12
|
+
//# sourceMappingURL=dimensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../src/functions/dimensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAMzD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,EAAE,CAE9C;AAED;;;GAGG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAmBxC;AAED,wBAAgB,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
local ____exports = {}
|
|
2
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
3
|
+
local Dimension = ____isaac_2Dtypescript_2Ddefinitions.Dimension
|
|
4
|
+
local ____cachedClasses = require("cachedClasses")
|
|
5
|
+
local game = ____cachedClasses.game
|
|
6
|
+
local ____constants = require("constants")
|
|
7
|
+
local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
|
|
8
|
+
local ____roomData = require("functions.roomData")
|
|
9
|
+
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
10
|
+
local ____utils = require("functions.utils")
|
|
11
|
+
local erange = ____utils.erange
|
|
12
|
+
--- Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
|
|
13
|
+
function ____exports.getAllDimensions(self)
|
|
14
|
+
return erange(nil, NUM_DIMENSIONS)
|
|
15
|
+
end
|
|
16
|
+
--- Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
|
|
17
|
+
-- but it can change if e.g. the player is in the mirror world of Downpour/Dross.
|
|
18
|
+
function ____exports.getDimension(self)
|
|
19
|
+
local level = game:GetLevel()
|
|
20
|
+
local roomGridIndex = getRoomGridIndex(nil)
|
|
21
|
+
local roomDescription = level:GetRoomByIdx(roomGridIndex, Dimension.CURRENT)
|
|
22
|
+
local currentRoomHash = GetPtrHash(roomDescription)
|
|
23
|
+
for ____, dimension in ipairs(____exports.getAllDimensions(nil)) do
|
|
24
|
+
local dimensionRoomDescription = level:GetRoomByIdx(roomGridIndex, dimension)
|
|
25
|
+
local dimensionRoomHash = GetPtrHash(dimensionRoomDescription)
|
|
26
|
+
if dimensionRoomHash == currentRoomHash then
|
|
27
|
+
return dimension
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
error("Failed to get the current dimension.")
|
|
31
|
+
end
|
|
32
|
+
function ____exports.inDimension(self, dimension)
|
|
33
|
+
return dimension == ____exports.getDimension(nil)
|
|
34
|
+
end
|
|
35
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"eden.d.ts","sourceRoot":"","sources":["../../src/functions/eden.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,8BAA8B,CAAC;AAqB9E,wBAAgB,eAAe,IAAI,GAAG,CAAC,eAAe,CAAC,CAOtD;AAED,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAO,GAC9D,eAAe,CAWjB"}
|
package/dist/functions/eden.lua
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local Set = ____lualib.Set
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
|
-
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
5
4
|
local ____exports = {}
|
|
6
5
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
6
|
local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
|
|
@@ -9,7 +8,7 @@ local ____collectibles = require("functions.collectibles")
|
|
|
9
8
|
local isHiddenCollectible = ____collectibles.isHiddenCollectible
|
|
10
9
|
local isPassiveCollectible = ____collectibles.isPassiveCollectible
|
|
11
10
|
local ____collectibleSet = require("functions.collectibleSet")
|
|
12
|
-
local
|
|
11
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
13
12
|
local ____collectibleTag = require("functions.collectibleTag")
|
|
14
13
|
local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
15
14
|
local ____rng = require("functions.rng")
|
|
@@ -19,8 +18,7 @@ local copySet = ____set.copySet
|
|
|
19
18
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
20
19
|
local EDEN_PASSIVE_COLLECTIBLES_SET = __TS__New(Set)
|
|
21
20
|
local function initCollectibleSet(self)
|
|
22
|
-
|
|
23
|
-
for ____, collectibleType in __TS__Iterator(collectibleSet:values()) do
|
|
21
|
+
for ____, collectibleType in ipairs(getCollectibleArray(nil)) do
|
|
24
22
|
if isPassiveCollectible(nil, collectibleType) and not isHiddenCollectible(nil, collectibleType) and not collectibleHasTag(nil, collectibleType, ItemConfigTag.NO_EDEN) then
|
|
25
23
|
EDEN_PASSIVE_COLLECTIBLES_SET:add(collectibleType)
|
|
26
24
|
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get the remaining collectibles in a given item pool. This function is
|
|
4
|
+
* expensive, so only use it in situations where the lag is acceptable.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCollectiblesInItemPool(itemPoolType: ItemPoolType): CollectibleType[];
|
|
7
|
+
/**
|
|
8
|
+
* Helper function to see if the given collectible is still present in the given item pool.
|
|
9
|
+
*
|
|
10
|
+
* If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and
|
|
11
|
+
* then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
|
|
12
|
+
* collectibles from item pools).
|
|
13
|
+
*
|
|
14
|
+
* Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to blacklist
|
|
15
|
+
* every collectible except for the one provided.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isCollectibleInItemPool(collectibleType: CollectibleType, itemPoolType: ItemPoolType): boolean;
|
|
18
|
+
//# sourceMappingURL=itemPool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,YAAY,EAGb,MAAM,8BAA8B,CAAC;AAsBtC;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,YAAY,GACzB,eAAe,EAAE,CAKnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO,CA6DT"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
3
|
+
local Map = ____lualib.Map
|
|
4
|
+
local __TS__New = ____lualib.__TS__New
|
|
5
|
+
local ____exports = {}
|
|
6
|
+
local removeItemsAndTrinketsThatAffectItemPools, restoreItemsAndTrinketsThatAffectItemPools, COLLECTIBLES_THAT_AFFECT_ITEM_POOLS, TRINKETS_THAT_AFFECT_ITEM_POOLS, COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS
|
|
7
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
8
|
+
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
9
|
+
local ItemConfigTag = ____isaac_2Dtypescript_2Ddefinitions.ItemConfigTag
|
|
10
|
+
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
11
|
+
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
12
|
+
local ____cachedClasses = require("cachedClasses")
|
|
13
|
+
local game = ____cachedClasses.game
|
|
14
|
+
local ____collectibleSet = require("functions.collectibleSet")
|
|
15
|
+
local getCollectibleArray = ____collectibleSet.getCollectibleArray
|
|
16
|
+
local ____collectibleTag = require("functions.collectibleTag")
|
|
17
|
+
local collectibleHasTag = ____collectibleTag.collectibleHasTag
|
|
18
|
+
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
19
|
+
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
20
|
+
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
21
|
+
local ____playerIndex = require("functions.playerIndex")
|
|
22
|
+
local getPlayers = ____playerIndex.getPlayers
|
|
23
|
+
local ____players = require("functions.players")
|
|
24
|
+
local getPlayersOfType = ____players.getPlayersOfType
|
|
25
|
+
local ____utils = require("functions.utils")
|
|
26
|
+
local ____repeat = ____utils["repeat"]
|
|
27
|
+
--- Helper function to see if the given collectible is still present in the given item pool.
|
|
28
|
+
--
|
|
29
|
+
-- If the collectible is non-offensive, any Tainted Losts will be temporarily changed to Isaac and
|
|
30
|
+
-- then changed back. (This is because Tainted Lost is not able to retrieve non-offensive
|
|
31
|
+
-- collectibles from item pools).
|
|
32
|
+
--
|
|
33
|
+
-- Under the hood, this function works by using the `ItemPool.AddRoomBlacklist` method to blacklist
|
|
34
|
+
-- every collectible except for the one provided.
|
|
35
|
+
function ____exports.isCollectibleInItemPool(self, collectibleType, itemPoolType)
|
|
36
|
+
if collectibleType == COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS then
|
|
37
|
+
return false
|
|
38
|
+
end
|
|
39
|
+
local taintedLosts = getPlayersOfType(nil, PlayerType.THE_LOST_B)
|
|
40
|
+
local isOffensive = collectibleHasTag(nil, collectibleType, ItemConfigTag.OFFENSIVE)
|
|
41
|
+
local changedPlayerTypes = false
|
|
42
|
+
if not isOffensive then
|
|
43
|
+
changedPlayerTypes = true
|
|
44
|
+
for ____, player in ipairs(taintedLosts) do
|
|
45
|
+
player:ChangePlayerType(PlayerType.ISAAC)
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
local removedItemsMap, removedTrinketsMap = table.unpack(removeItemsAndTrinketsThatAffectItemPools(nil))
|
|
49
|
+
local itemPool = game:GetItemPool()
|
|
50
|
+
itemPool:ResetRoomBlacklist()
|
|
51
|
+
for ____, collectibleTypeInSet in ipairs(getCollectibleArray(nil)) do
|
|
52
|
+
if collectibleTypeInSet ~= collectibleType then
|
|
53
|
+
itemPool:AddRoomBlacklist(collectibleTypeInSet)
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
local seed = 1
|
|
57
|
+
local retrievedCollectibleType = itemPool:GetCollectible(itemPoolType, false, seed, COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS)
|
|
58
|
+
local collectibleUnlocked = retrievedCollectibleType == collectibleType
|
|
59
|
+
itemPool:ResetRoomBlacklist()
|
|
60
|
+
restoreItemsAndTrinketsThatAffectItemPools(nil, removedItemsMap, removedTrinketsMap)
|
|
61
|
+
if changedPlayerTypes then
|
|
62
|
+
for ____, player in ipairs(taintedLosts) do
|
|
63
|
+
player:ChangePlayerType(PlayerType.THE_LOST_B)
|
|
64
|
+
end
|
|
65
|
+
end
|
|
66
|
+
return collectibleUnlocked
|
|
67
|
+
end
|
|
68
|
+
function removeItemsAndTrinketsThatAffectItemPools(self)
|
|
69
|
+
local removedItemsMap = __TS__New(Map)
|
|
70
|
+
local removedTrinketsMap = __TS__New(Map)
|
|
71
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
72
|
+
local removedItems = {}
|
|
73
|
+
for ____, itemToRemove in ipairs(COLLECTIBLES_THAT_AFFECT_ITEM_POOLS) do
|
|
74
|
+
if player:HasCollectible(itemToRemove) then
|
|
75
|
+
local numCollectibles = player:GetCollectibleNum(itemToRemove)
|
|
76
|
+
____repeat(
|
|
77
|
+
nil,
|
|
78
|
+
numCollectibles,
|
|
79
|
+
function()
|
|
80
|
+
player:RemoveCollectible(itemToRemove)
|
|
81
|
+
removedItems[#removedItems + 1] = itemToRemove
|
|
82
|
+
end
|
|
83
|
+
)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
mapSetPlayer(nil, removedItemsMap, player, removedItems)
|
|
87
|
+
local removedTrinkets = {}
|
|
88
|
+
for ____, trinketToRemove in ipairs(TRINKETS_THAT_AFFECT_ITEM_POOLS) do
|
|
89
|
+
if player:HasTrinket(trinketToRemove) then
|
|
90
|
+
local numTrinkets = player:GetTrinketMultiplier(trinketToRemove)
|
|
91
|
+
____repeat(
|
|
92
|
+
nil,
|
|
93
|
+
numTrinkets,
|
|
94
|
+
function()
|
|
95
|
+
player:TryRemoveTrinket(trinketToRemove)
|
|
96
|
+
removedTrinkets[#removedTrinkets + 1] = trinketToRemove
|
|
97
|
+
end
|
|
98
|
+
)
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
mapSetPlayer(nil, removedTrinketsMap, player, removedTrinkets)
|
|
102
|
+
end
|
|
103
|
+
return {removedItemsMap, removedTrinketsMap}
|
|
104
|
+
end
|
|
105
|
+
function restoreItemsAndTrinketsThatAffectItemPools(self, removedItemsMap, removedTrinketsMap)
|
|
106
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
107
|
+
local removedItems = mapGetPlayer(nil, removedItemsMap, player)
|
|
108
|
+
if removedItems ~= nil then
|
|
109
|
+
for ____, collectibleType in ipairs(removedItems) do
|
|
110
|
+
player:AddCollectible(collectibleType, 0, false)
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
local removedTrinkets = mapGetPlayer(nil, removedTrinketsMap, player)
|
|
114
|
+
if removedTrinkets ~= nil then
|
|
115
|
+
for ____, trinketType in ipairs(removedTrinkets) do
|
|
116
|
+
player:AddTrinket(trinketType, false)
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
COLLECTIBLES_THAT_AFFECT_ITEM_POOLS = {CollectibleType.CHAOS, CollectibleType.SACRED_ORB, CollectibleType.TMTRAINER}
|
|
122
|
+
TRINKETS_THAT_AFFECT_ITEM_POOLS = {TrinketType.NO}
|
|
123
|
+
COLLECTIBLE_TYPE_THAT_IS_NOT_IN_ANY_POOLS = CollectibleType.KEY_PIECE_1
|
|
124
|
+
--- Helper function to get the remaining collectibles in a given item pool. This function is
|
|
125
|
+
-- expensive, so only use it in situations where the lag is acceptable.
|
|
126
|
+
function ____exports.getCollectiblesInItemPool(self, itemPoolType)
|
|
127
|
+
local collectibleArray = getCollectibleArray(nil)
|
|
128
|
+
return __TS__ArrayFilter(
|
|
129
|
+
collectibleArray,
|
|
130
|
+
function(____, collectibleType) return ____exports.isCollectibleInItemPool(nil, collectibleType, itemPoolType) end
|
|
131
|
+
)
|
|
132
|
+
end
|
|
133
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/functions/level.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"level.d.ts","sourceRoot":"","sources":["../../src/functions/level.ts"],"names":[],"mappings":"AAMA,wBAAgB,qBAAqB,IAAI,IAAI,CAqB5C"}
|
package/dist/functions/level.lua
CHANGED
|
@@ -5,18 +5,19 @@ local ____cachedClasses = require("cachedClasses")
|
|
|
5
5
|
local game = ____cachedClasses.game
|
|
6
6
|
local ____enums = require("functions.enums")
|
|
7
7
|
local getEnumValues = ____enums.getEnumValues
|
|
8
|
+
local ____levelGrid = require("functions.levelGrid")
|
|
9
|
+
local isDoorSlotValidAtGridIndexForRedRoom = ____levelGrid.isDoorSlotValidAtGridIndexForRedRoom
|
|
8
10
|
local ____rooms = require("functions.rooms")
|
|
9
11
|
local getNumRooms = ____rooms.getNumRooms
|
|
10
|
-
local
|
|
11
|
-
local isDoorSlotValidAtGridIndexForRedRoom = ____rooms.isDoorSlotValidAtGridIndexForRedRoom
|
|
12
|
+
local getRoomsInGrid = ____rooms.getRoomsInGrid
|
|
12
13
|
function ____exports.fillLevelWithRedRooms(self)
|
|
13
14
|
local level = game:GetLevel()
|
|
14
|
-
local
|
|
15
|
+
local numRoomsInGrid
|
|
15
16
|
repeat
|
|
16
17
|
do
|
|
17
|
-
local
|
|
18
|
-
|
|
19
|
-
for ____, roomDescriptor in ipairs(
|
|
18
|
+
local roomsInGrid = getRoomsInGrid(nil)
|
|
19
|
+
numRoomsInGrid = #roomsInGrid
|
|
20
|
+
for ____, roomDescriptor in ipairs(roomsInGrid) do
|
|
20
21
|
for ____, doorSlot in ipairs(getEnumValues(nil, DoorSlot)) do
|
|
21
22
|
if isDoorSlotValidAtGridIndexForRedRoom(nil, doorSlot, roomDescriptor.GridIndex) then
|
|
22
23
|
level:MakeRedRoomDoor(roomDescriptor.GridIndex, doorSlot)
|
|
@@ -24,6 +25,6 @@ function ____exports.fillLevelWithRedRooms(self)
|
|
|
24
25
|
end
|
|
25
26
|
end
|
|
26
27
|
end
|
|
27
|
-
until not (
|
|
28
|
+
until not (numRoomsInGrid ~= getNumRooms(nil))
|
|
28
29
|
end
|
|
29
30
|
return ____exports
|