isaacscript-common 13.0.0 → 13.1.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/index.d.ts +96 -26
- package/dist/isaacscript-common.lua +613 -168
- package/dist/src/features/customStage/backdrop.lua +4 -4
- package/dist/src/features/customStage/versusScreen.lua +2 -2
- package/dist/src/features/deployJSONRoom.d.ts +0 -11
- package/dist/src/features/deployJSONRoom.d.ts.map +1 -1
- package/dist/src/features/deployJSONRoom.lua +10 -74
- package/dist/src/features/extraConsoleCommands/listCommands.lua +2 -2
- package/dist/src/features/firstLast.lua +8 -8
- package/dist/src/features/setHotkey.d.ts +27 -8
- package/dist/src/features/setHotkey.d.ts.map +1 -1
- package/dist/src/features/setHotkey.lua +41 -30
- package/dist/src/functions/array.lua +2 -2
- package/dist/src/functions/cards.lua +2 -2
- package/dist/src/functions/collectibles.lua +2 -2
- package/dist/src/functions/dimensions.lua +2 -2
- package/dist/src/functions/emptyRoom.d.ts +8 -0
- package/dist/src/functions/emptyRoom.d.ts.map +1 -0
- package/dist/src/functions/emptyRoom.lua +79 -0
- package/dist/src/functions/enums.d.ts.map +1 -1
- package/dist/src/functions/enums.lua +3 -3
- package/dist/src/functions/gridEntities.lua +2 -2
- package/dist/src/functions/gridIndex.d.ts +10 -0
- package/dist/src/functions/gridIndex.d.ts.map +1 -0
- package/dist/src/functions/gridIndex.lua +32 -0
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/log.lua +9 -8
- package/dist/src/functions/logEntities.d.ts.map +1 -1
- package/dist/src/functions/logEntities.lua +17 -9
- package/dist/src/functions/pills.lua +4 -4
- package/dist/src/functions/roomShape.d.ts +6 -1
- package/dist/src/functions/roomShape.d.ts.map +1 -1
- package/dist/src/functions/roomShape.lua +3 -0
- package/dist/src/functions/roomShapeWalls.d.ts +11 -0
- package/dist/src/functions/roomShapeWalls.d.ts.map +1 -0
- package/dist/src/functions/roomShapeWalls.lua +273 -0
- package/dist/src/functions/rooms.d.ts +7 -0
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +16 -5
- package/dist/src/functions/set.d.ts +7 -0
- package/dist/src/functions/set.d.ts.map +1 -1
- package/dist/src/functions/set.lua +10 -0
- package/dist/src/functions/sprites.lua +2 -2
- package/dist/src/functions/trinkets.lua +2 -2
- package/dist/src/functions/utils.d.ts +18 -12
- package/dist/src/functions/utils.d.ts.map +1 -1
- package/dist/src/functions/utils.lua +26 -14
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +24 -0
- package/dist/src/interfaces/Corner.d.ts +8 -0
- package/dist/src/interfaces/Corner.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.d.ts +6 -1
- package/dist/src/objects/roomShapeCorners.d.ts.map +1 -1
- package/dist/src/objects/roomShapeCorners.lua +71 -14
- package/package.json +2 -2
- package/src/features/customStage/backdrop.ts +3 -3
- package/src/features/customStage/versusScreen.ts +2 -2
- package/src/features/deployJSONRoom.ts +8 -98
- package/src/features/extraConsoleCommands/listCommands.ts +2 -2
- package/src/features/firstLast.ts +8 -8
- package/src/features/setHotkey.ts +60 -40
- package/src/functions/array.ts +2 -2
- package/src/functions/cards.ts +2 -2
- package/src/functions/collectibles.ts +2 -2
- package/src/functions/dimensions.ts +2 -2
- package/src/functions/emptyRoom.ts +92 -0
- package/src/functions/enums.ts +4 -3
- package/src/functions/gridEntities.ts +2 -2
- package/src/functions/gridIndex.ts +40 -0
- package/src/functions/log.ts +9 -10
- package/src/functions/logEntities.ts +25 -9
- package/src/functions/pills.ts +4 -4
- package/src/functions/roomShape.ts +6 -1
- package/src/functions/roomShapeWalls.ts +342 -0
- package/src/functions/rooms.ts +22 -3
- package/src/functions/set.ts +12 -0
- package/src/functions/sprites.ts +2 -2
- package/src/functions/trinkets.ts +2 -2
- package/src/functions/utils.ts +20 -14
- package/src/index.ts +3 -0
- package/src/interfaces/Corner.ts +9 -0
- package/src/objects/roomShapeCorners.ts +74 -16
|
@@ -25,8 +25,8 @@ local ____string = require("src.functions.string")
|
|
|
25
25
|
local removeCharactersBefore = ____string.removeCharactersBefore
|
|
26
26
|
local trimPrefix = ____string.trimPrefix
|
|
27
27
|
local ____utils = require("src.functions.utils")
|
|
28
|
-
local
|
|
29
|
-
local
|
|
28
|
+
local eRange = ____utils.eRange
|
|
29
|
+
local iRange = ____utils.iRange
|
|
30
30
|
local ____constants = require("src.features.customStage.constants")
|
|
31
31
|
local ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH = ____constants.ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH
|
|
32
32
|
function getBackdropPNGPath(self, customStage, backdropKind, rng)
|
|
@@ -58,7 +58,7 @@ function spawnWallEntity(self, customStage, rng, isExtraWall)
|
|
|
58
58
|
local cornerPNGPath = getBackdropPNGPath(nil, customStage, BackdropKind.CORNER, rng)
|
|
59
59
|
sprite:ReplaceSpritesheet(0, cornerPNGPath)
|
|
60
60
|
end
|
|
61
|
-
for ____, layerID in ipairs(
|
|
61
|
+
for ____, layerID in ipairs(iRange(nil, 1, numWallLayers)) do
|
|
62
62
|
local wallPNGPath = getBackdropPNGPath(nil, customStage, BackdropKind.WALL, rng)
|
|
63
63
|
sprite:ReplaceSpritesheet(layerID, wallPNGPath)
|
|
64
64
|
end
|
|
@@ -97,7 +97,7 @@ function spawnFloorEntity(self, customStage, rng)
|
|
|
97
97
|
sprite:Load(ISAACSCRIPT_CUSTOM_STAGE_GFX_PATH .. "/floor-backdrop.anm2", false)
|
|
98
98
|
local numFloorLayers = getNumFloorLayers(nil, roomShape)
|
|
99
99
|
if numFloorLayers ~= nil then
|
|
100
|
-
for ____, layerID in ipairs(
|
|
100
|
+
for ____, layerID in ipairs(eRange(nil, 0, numFloorLayers)) do
|
|
101
101
|
local wallPNGPath = getBackdropPNGPath(nil, customStage, BackdropKind.WALL, rng)
|
|
102
102
|
sprite:ReplaceSpritesheet(layerID, wallPNGPath)
|
|
103
103
|
end
|
|
@@ -21,7 +21,7 @@ local getRoomSubType = ____roomData.getRoomSubType
|
|
|
21
21
|
local ____string = require("src.functions.string")
|
|
22
22
|
local removeCharactersBefore = ____string.removeCharactersBefore
|
|
23
23
|
local ____utils = require("src.functions.utils")
|
|
24
|
-
local
|
|
24
|
+
local eRange = ____utils.eRange
|
|
25
25
|
local ____bossNamePNGFileNames = require("src.objects.bossNamePNGFileNames")
|
|
26
26
|
local BOSS_NAME_PNG_FILE_NAMES = ____bossNamePNGFileNames.BOSS_NAME_PNG_FILE_NAMES
|
|
27
27
|
local ____bossPortraitPNGFileNames = require("src.objects.bossPortraitPNGFileNames")
|
|
@@ -127,7 +127,7 @@ local PLAYER_PORTRAIT_ALT_ANM2_LAYER = 12
|
|
|
127
127
|
--- These are the non-special layers that we will render last.
|
|
128
128
|
local OTHER_ANM2_LAYERS = arrayRemove(
|
|
129
129
|
nil,
|
|
130
|
-
|
|
130
|
+
eRange(nil, NUM_VERSUS_SCREEN_ANM2_LAYERS),
|
|
131
131
|
BACKGROUND_ANM2_LAYER,
|
|
132
132
|
BOSS_DIRT_SPOT_ANM2_LAYER,
|
|
133
133
|
PLAYER_DIRT_SPOT_ANM2_LAYER,
|
|
@@ -63,15 +63,4 @@ export declare function deployJSONRoom(jsonRoom: JSONRoom | Readonly<JSONRoom>,
|
|
|
63
63
|
* what the function is doing. Default is false.
|
|
64
64
|
*/
|
|
65
65
|
export declare function deployRandomJSONRoom(jsonRooms: JSONRoom[], seedOrRNG?: Seed | RNG, verbose?: boolean): void;
|
|
66
|
-
/**
|
|
67
|
-
* Helper function to remove all naturally spawning entities and grid entities from a room. Notably,
|
|
68
|
-
* this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8), projectiles
|
|
69
|
-
* (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent NPCs, most
|
|
70
|
-
* effects (1000), doors, and walls.
|
|
71
|
-
*
|
|
72
|
-
* @param fillWithDecorations Optional. Set to true to fill every grid tile with an invisible
|
|
73
|
-
* decoration, which prevents vanilla entities in the room from
|
|
74
|
-
* respawning the next time that the player enters. Default is false.
|
|
75
|
-
*/
|
|
76
|
-
export declare function emptyRoom(fillWithDecorations: boolean): void;
|
|
77
66
|
//# sourceMappingURL=deployJSONRoom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"deployJSONRoom.d.ts","sourceRoot":"","sources":["../../../src/features/deployJSONRoom.ts"],"names":[],"mappings":";;AAgDA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAwKvD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,EACvC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CA4BN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,QAAQ,EAAE,EACrB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,GACd,IAAI,CAaN"}
|
|
@@ -4,11 +4,10 @@ local __TS__New = ____lualib.__TS__New
|
|
|
4
4
|
local Map = ____lualib.Map
|
|
5
5
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local preUseItemWeNeedToGoDeeper, postNewRoomReordered, setDecorationsInvisible, respawnPersistentEntities,
|
|
7
|
+
local preUseItemWeNeedToGoDeeper, postNewRoomReordered, setDecorationsInvisible, respawnPersistentEntities, fillRoomWithDecorations, spawnAllEntities, spawnGridEntityForJSONRoom, spawnNormalEntityForJSONRoom, storePersistentEntity, fixPitGraphics, getPitMap, getPitFrame, PERSISTENT_ENTITY_TYPES, GRID_ENTITY_XML_TYPE_SET, v
|
|
8
8
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
9
9
|
local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
|
|
10
10
|
local EntityCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityCollisionClass
|
|
11
|
-
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
12
11
|
local EntityGridCollisionClass = ____isaac_2Dtypescript_2Ddefinitions.EntityGridCollisionClass
|
|
13
12
|
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
14
13
|
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
@@ -27,8 +26,9 @@ local ____featuresInitialized = require("src.featuresInitialized")
|
|
|
27
26
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
28
27
|
local ____array = require("src.functions.array")
|
|
29
28
|
local emptyArray = ____array.emptyArray
|
|
29
|
+
local ____emptyRoom = require("src.functions.emptyRoom")
|
|
30
|
+
local emptyRoom = ____emptyRoom.emptyRoom
|
|
30
31
|
local ____entities = require("src.functions.entities")
|
|
31
|
-
local getEntities = ____entities.getEntities
|
|
32
32
|
local getEntityIDFromConstituents = ____entities.getEntityIDFromConstituents
|
|
33
33
|
local spawn = ____entities.spawn
|
|
34
34
|
local spawnWithSeed = ____entities.spawnWithSeed
|
|
@@ -55,7 +55,6 @@ local getRoomListIndex = ____roomData.getRoomListIndex
|
|
|
55
55
|
local ____roomGrid = require("src.functions.roomGrid")
|
|
56
56
|
local gridCoordinatesToWorldPosition = ____roomGrid.gridCoordinatesToWorldPosition
|
|
57
57
|
local ____rooms = require("src.functions.rooms")
|
|
58
|
-
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
59
58
|
local setRoomCleared = ____rooms.setRoomCleared
|
|
60
59
|
local setRoomUncleared = ____rooms.setRoomUncleared
|
|
61
60
|
local ____spawnCollectible = require("src.functions.spawnCollectible")
|
|
@@ -138,62 +137,6 @@ function respawnPersistentEntities(self)
|
|
|
138
137
|
)
|
|
139
138
|
end
|
|
140
139
|
end
|
|
141
|
-
--- Helper function to remove all naturally spawning entities and grid entities from a room. Notably,
|
|
142
|
-
-- this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8), projectiles
|
|
143
|
-
-- (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent NPCs, most
|
|
144
|
-
-- effects (1000), doors, and walls.
|
|
145
|
-
--
|
|
146
|
-
-- @param fillWithDecorations Optional. Set to true to fill every grid tile with an invisible
|
|
147
|
-
-- decoration, which prevents vanilla entities in the room from
|
|
148
|
-
-- respawning the next time that the player enters. Default is false.
|
|
149
|
-
function ____exports.emptyRoom(self, fillWithDecorations)
|
|
150
|
-
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
151
|
-
local roomListIndex = getRoomListIndex(nil)
|
|
152
|
-
v.level.deployedRoomListIndexes:add(roomListIndex)
|
|
153
|
-
emptyRoomEntities(nil)
|
|
154
|
-
emptyRoomGridEntities(nil)
|
|
155
|
-
setRoomCleared(nil)
|
|
156
|
-
if fillWithDecorations then
|
|
157
|
-
fillRoomWithDecorations(nil)
|
|
158
|
-
end
|
|
159
|
-
end
|
|
160
|
-
function emptyRoomEntities(self)
|
|
161
|
-
local room = game:GetRoom()
|
|
162
|
-
for ____, entity in ipairs(getEntities(nil)) do
|
|
163
|
-
do
|
|
164
|
-
if EMPTY_ROOM_BLACKLIST_ENTITY_SET:has(entity.Type) then
|
|
165
|
-
goto __continue33
|
|
166
|
-
end
|
|
167
|
-
if entity:HasEntityFlags(EntityFlag.CHARM) or entity:HasEntityFlags(EntityFlag.FRIENDLY) or entity:HasEntityFlags(EntityFlag.PERSISTENT) then
|
|
168
|
-
goto __continue33
|
|
169
|
-
end
|
|
170
|
-
entity:ClearEntityFlags(EntityFlag.APPEAR)
|
|
171
|
-
entity:Remove()
|
|
172
|
-
if entity.Type == EntityType.FIREPLACE then
|
|
173
|
-
local gridIndex = room:GetGridIndex(entity.Position)
|
|
174
|
-
room:SetGridPath(gridIndex, 0)
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
::__continue33::
|
|
178
|
-
end
|
|
179
|
-
end
|
|
180
|
-
function emptyRoomGridEntities(self)
|
|
181
|
-
local removedOneOrMoreGridEntities = false
|
|
182
|
-
for ____, gridEntity in ipairs(getGridEntities(nil)) do
|
|
183
|
-
do
|
|
184
|
-
local gridEntityType = gridEntity:GetType()
|
|
185
|
-
if EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET:has(gridEntityType) then
|
|
186
|
-
goto __continue39
|
|
187
|
-
end
|
|
188
|
-
removeGridEntity(nil, gridEntity, false)
|
|
189
|
-
removedOneOrMoreGridEntities = true
|
|
190
|
-
end
|
|
191
|
-
::__continue39::
|
|
192
|
-
end
|
|
193
|
-
if removedOneOrMoreGridEntities then
|
|
194
|
-
roomUpdateSafe(nil)
|
|
195
|
-
end
|
|
196
|
-
end
|
|
197
140
|
function fillRoomWithDecorations(self)
|
|
198
141
|
local room = game:GetRoom()
|
|
199
142
|
local roomListIndex = getRoomListIndex(nil)
|
|
@@ -202,7 +145,7 @@ function fillRoomWithDecorations(self)
|
|
|
202
145
|
do
|
|
203
146
|
local existingGridEntity = room:GetGridEntity(gridIndex)
|
|
204
147
|
if existingGridEntity ~= nil then
|
|
205
|
-
goto
|
|
148
|
+
goto __continue31
|
|
206
149
|
end
|
|
207
150
|
local position = room:GetGridPosition(gridIndex)
|
|
208
151
|
local decoration = Isaac.GridSpawn(GridEntityType.DECORATION, 0, position)
|
|
@@ -211,7 +154,7 @@ function fillRoomWithDecorations(self)
|
|
|
211
154
|
end
|
|
212
155
|
decorationGridIndexes[#decorationGridIndexes + 1] = gridIndex
|
|
213
156
|
end
|
|
214
|
-
::
|
|
157
|
+
::__continue31::
|
|
215
158
|
end
|
|
216
159
|
end
|
|
217
160
|
function spawnAllEntities(self, jsonRoom, rng, verbose)
|
|
@@ -468,20 +411,10 @@ function getPitFrame(self, L, R, U, D, UL, UR, DL, DR)
|
|
|
468
411
|
end
|
|
469
412
|
return F
|
|
470
413
|
end
|
|
471
|
-
FEATURE_NAME = "deployJSONRoom"
|
|
414
|
+
local FEATURE_NAME = "deployJSONRoom"
|
|
472
415
|
PERSISTENT_ENTITY_TYPES = __TS__New(Set, {EntityType.WALL_HUGGER})
|
|
473
416
|
local gridEntityXMLTypes = getEnumValues(nil, GridEntityXMLType)
|
|
474
417
|
GRID_ENTITY_XML_TYPE_SET = __TS__New(Set, gridEntityXMLTypes)
|
|
475
|
-
EMPTY_ROOM_BLACKLIST_ENTITY_SET = __TS__New(Set, {
|
|
476
|
-
EntityType.PLAYER,
|
|
477
|
-
EntityType.TEAR,
|
|
478
|
-
EntityType.FAMILIAR,
|
|
479
|
-
EntityType.LASER,
|
|
480
|
-
EntityType.KNIFE,
|
|
481
|
-
EntityType.PROJECTILE,
|
|
482
|
-
EntityType.DARK_ESAU
|
|
483
|
-
})
|
|
484
|
-
EMPTY_ROOM_BLACKLIST_GRID_ENTITY_SET = __TS__New(Set, {GridEntityType.WALL, GridEntityType.DOOR})
|
|
485
418
|
v = {
|
|
486
419
|
level = {
|
|
487
420
|
deployedRoomListIndexes = __TS__New(Set),
|
|
@@ -538,13 +471,16 @@ function ____exports.deployJSONRoom(self, jsonRoom, seedOrRNG, verbose)
|
|
|
538
471
|
end
|
|
539
472
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
540
473
|
local rng = isRNG(nil, seedOrRNG) and seedOrRNG or newRNG(nil, seedOrRNG)
|
|
474
|
+
local roomListIndex = getRoomListIndex(nil)
|
|
475
|
+
v.level.deployedRoomListIndexes:add(roomListIndex)
|
|
541
476
|
if verbose then
|
|
542
477
|
log(nil, "Starting to empty the room of entities and grid entities.")
|
|
543
478
|
end
|
|
544
|
-
|
|
479
|
+
emptyRoom(nil)
|
|
545
480
|
if verbose then
|
|
546
481
|
log(nil, "Finished emptying the room of entities and grid entities.")
|
|
547
482
|
end
|
|
483
|
+
setRoomCleared(nil)
|
|
548
484
|
if verbose then
|
|
549
485
|
log(nil, "Starting to spawn all of the new entities and grid entities.")
|
|
550
486
|
end
|
|
@@ -107,7 +107,7 @@ local asCardType = ____types.asCardType
|
|
|
107
107
|
local asCollectibleType = ____types.asCollectibleType
|
|
108
108
|
local asTrinketType = ____types.asTrinketType
|
|
109
109
|
local ____utils = require("src.functions.utils")
|
|
110
|
-
local
|
|
110
|
+
local iRange = ____utils.iRange
|
|
111
111
|
local printConsole = ____utils.printConsole
|
|
112
112
|
local printEnabled = ____utils.printEnabled
|
|
113
113
|
local ____cardNameToTypeMap = require("src.maps.cardNameToTypeMap")
|
|
@@ -875,7 +875,7 @@ end
|
|
|
875
875
|
function ____exports.map(self)
|
|
876
876
|
local level = game:GetLevel()
|
|
877
877
|
local displayFlags = addFlag(nil, DisplayFlag.VISIBLE, DisplayFlag.SHADOW, DisplayFlag.SHOW_ICON)
|
|
878
|
-
for ____, roomGridIndex in ipairs(
|
|
878
|
+
for ____, roomGridIndex in ipairs(iRange(nil, MAX_LEVEL_GRID_INDEX)) do
|
|
879
879
|
local roomDesc = level:GetRoomByIdx(roomGridIndex)
|
|
880
880
|
roomDesc.DisplayFlags = displayFlags
|
|
881
881
|
end
|
|
@@ -25,7 +25,7 @@ local asNumber = ____types.asNumber
|
|
|
25
25
|
local asPillEffect = ____types.asPillEffect
|
|
26
26
|
local asTrinketType = ____types.asTrinketType
|
|
27
27
|
local ____utils = require("src.functions.utils")
|
|
28
|
-
local
|
|
28
|
+
local iRange = ____utils.iRange
|
|
29
29
|
function postNewRoomEarly(self)
|
|
30
30
|
atLeastOneCallbackFired = true
|
|
31
31
|
end
|
|
@@ -165,7 +165,7 @@ function ____exports.getModdedCollectibleTypes(self)
|
|
|
165
165
|
return {}
|
|
166
166
|
end
|
|
167
167
|
local lastCollectibleType = ____exports.getLastCollectibleType(nil)
|
|
168
|
-
return
|
|
168
|
+
return iRange(nil, firstModdedCollectibleType, lastCollectibleType)
|
|
169
169
|
end
|
|
170
170
|
--- This function can only be called if at least one callback has been executed. This is because not
|
|
171
171
|
-- all collectibles will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -223,7 +223,7 @@ function ____exports.getModdedTrinketTypes(self)
|
|
|
223
223
|
return {}
|
|
224
224
|
end
|
|
225
225
|
local lastTrinketType = ____exports.getLastTrinketType(nil)
|
|
226
|
-
return
|
|
226
|
+
return iRange(nil, firstModdedTrinketType, lastTrinketType)
|
|
227
227
|
end
|
|
228
228
|
--- This function can only be called if at least one callback has been executed. This is because not
|
|
229
229
|
-- all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -239,7 +239,7 @@ end
|
|
|
239
239
|
-- all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
240
240
|
function ____exports.getTrinketTypes(self)
|
|
241
241
|
local lastTrinketType = ____exports.getLastTrinketType(nil)
|
|
242
|
-
return
|
|
242
|
+
return iRange(nil, FIRST_TRINKET_TYPE, lastTrinketType)
|
|
243
243
|
end
|
|
244
244
|
--- Helper function to get an array with every valid card sub-type. This includes modded cards.
|
|
245
245
|
--
|
|
@@ -247,7 +247,7 @@ end
|
|
|
247
247
|
-- all cards will necessarily be present when a mod first loads (due to mod load order).
|
|
248
248
|
function ____exports.getAllCardTypes(self)
|
|
249
249
|
local lastCardType = ____exports.getLastCardType(nil)
|
|
250
|
-
return
|
|
250
|
+
return iRange(nil, FIRST_CARD_TYPE, lastCardType)
|
|
251
251
|
end
|
|
252
252
|
--- Returns the first modded card sub-type, or undefined if there are no modded cards.
|
|
253
253
|
--
|
|
@@ -281,7 +281,7 @@ function ____exports.getModdedCardTypes(self)
|
|
|
281
281
|
return {}
|
|
282
282
|
end
|
|
283
283
|
local lastCardType = ____exports.getLastCardType(nil)
|
|
284
|
-
return
|
|
284
|
+
return iRange(nil, firstModdedCardType, lastCardType)
|
|
285
285
|
end
|
|
286
286
|
--- This function can only be called if at least one callback has been executed. This is because not
|
|
287
287
|
-- all trinkets will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -297,7 +297,7 @@ end
|
|
|
297
297
|
-- all pill effects will necessarily be present when a mod first loads (due to mod load order).
|
|
298
298
|
function ____exports.getAllPillEffects(self)
|
|
299
299
|
local lastPillEffect = ____exports.getLastPillEffect(nil)
|
|
300
|
-
return
|
|
300
|
+
return iRange(nil, FIRST_PILL_EFFECT, lastPillEffect)
|
|
301
301
|
end
|
|
302
302
|
--- Returns the first modded pill effect, or undefined if there are no modded pill effects.
|
|
303
303
|
--
|
|
@@ -331,7 +331,7 @@ function ____exports.getModdedPillEffects(self)
|
|
|
331
331
|
return {}
|
|
332
332
|
end
|
|
333
333
|
local lastPillEffect = ____exports.getLastPillEffect(nil)
|
|
334
|
-
return
|
|
334
|
+
return iRange(nil, firstModdedPillEffect, lastPillEffect)
|
|
335
335
|
end
|
|
336
336
|
--- This function can only be called if at least one callback has been executed. This is because not
|
|
337
337
|
-- all pill effects will necessarily be present when a mod first loads (due to mod load order).
|
|
@@ -5,19 +5,38 @@ import { Keyboard } from "isaac-typescript-definitions";
|
|
|
5
5
|
* This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
|
|
6
6
|
* in debugging.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
8
|
+
* This is different from the `setHotkey` function in that the keyboard activation key is not
|
|
9
|
+
* hardcoded and is instead the return value of a provided function. This is useful for situations
|
|
10
|
+
* where the key can change (like if end-users can specify a custom hotkey using Mod Config Menu).
|
|
11
|
+
*
|
|
12
|
+
* @param getKeyFunc The function that returns the key that will trigger the hotkey.
|
|
13
13
|
* @param triggerFunc A function containing the arbitrary code that you want to execute when the
|
|
14
14
|
* hotkey is triggered.
|
|
15
15
|
*/
|
|
16
|
-
export declare function
|
|
16
|
+
export declare function setConditionalHotkey(getKeyFunc: () => Keyboard | undefined, triggerFunc: () => void): void;
|
|
17
|
+
/**
|
|
18
|
+
* Helper function to run arbitrary code when you press and release a specific keyboard key.
|
|
19
|
+
*
|
|
20
|
+
* This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
|
|
21
|
+
* in debugging.
|
|
22
|
+
*
|
|
23
|
+
* @param keyboard The key that you want to trigger the hotkey.
|
|
24
|
+
* @param triggerFunc A function containing the arbitrary code that you want to execute when the
|
|
25
|
+
* hotkey is triggered.
|
|
26
|
+
*/
|
|
27
|
+
export declare function setHotkey(keyboard: Keyboard, triggerFunc: () => void): void;
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to remove a hotkey created with the `setConditionalHotkey` function.
|
|
30
|
+
*
|
|
31
|
+
* @param getKeyFunc Equal to the `getKeyFunc` that you passed when initially registering the
|
|
32
|
+
* hotkey.
|
|
33
|
+
*/
|
|
34
|
+
export declare function unsetConditionalHotkey(getKeyFunc: () => Keyboard | undefined): void;
|
|
17
35
|
/**
|
|
18
36
|
* Helper function to remove a hotkey created with the `setHotkey` function.
|
|
19
37
|
*
|
|
20
|
-
* @param
|
|
38
|
+
* @param keyboard Equal to the keyboard value that you passed when initially registering the
|
|
39
|
+
* hotkey.
|
|
21
40
|
*/
|
|
22
|
-
export declare function unsetHotkey(
|
|
41
|
+
export declare function unsetHotkey(keyboard: Keyboard): void;
|
|
23
42
|
//# sourceMappingURL=setHotkey.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setHotkey.d.ts","sourceRoot":"","sources":["../../../src/features/setHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"setHotkey.d.ts","sourceRoot":"","sources":["../../../src/features/setHotkey.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,8BAA8B,CAAC;AAwDrE;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,MAAM,QAAQ,GAAG,SAAS,EACtC,WAAW,EAAE,MAAM,IAAI,GACtB,IAAI,CAUN;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,IAAI,GAAG,IAAI,CAU3E;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,MAAM,QAAQ,GAAG,SAAS,GACrC,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAUpD"}
|
|
@@ -13,8 +13,6 @@ local ____featuresInitialized = require("src.featuresInitialized")
|
|
|
13
13
|
local errorIfFeaturesNotInitialized = ____featuresInitialized.errorIfFeaturesNotInitialized
|
|
14
14
|
local ____input = require("src.functions.input")
|
|
15
15
|
local isKeyboardPressed = ____input.isKeyboardPressed
|
|
16
|
-
local ____types = require("src.functions.types")
|
|
17
|
-
local isFunction = ____types.isFunction
|
|
18
16
|
function postRender(self)
|
|
19
17
|
for ____, ____value in __TS__Iterator(staticHotkeyFunctionMap:entries()) do
|
|
20
18
|
local keyboard = ____value[1]
|
|
@@ -52,42 +50,55 @@ end
|
|
|
52
50
|
-- This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
|
|
53
51
|
-- in debugging.
|
|
54
52
|
--
|
|
55
|
-
--
|
|
56
|
-
--
|
|
57
|
-
--
|
|
58
|
-
--
|
|
59
|
-
--
|
|
53
|
+
-- This is different from the `setHotkey` function in that the keyboard activation key is not
|
|
54
|
+
-- hardcoded and is instead the return value of a provided function. This is useful for situations
|
|
55
|
+
-- where the key can change (like if end-users can specify a custom hotkey using Mod Config Menu).
|
|
56
|
+
--
|
|
57
|
+
-- @param getKeyFunc The function that returns the key that will trigger the hotkey.
|
|
60
58
|
-- @param triggerFunc A function containing the arbitrary code that you want to execute when the
|
|
61
59
|
-- hotkey is triggered.
|
|
62
|
-
function ____exports.
|
|
60
|
+
function ____exports.setConditionalHotkey(self, getKeyFunc, triggerFunc)
|
|
63
61
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
64
|
-
if
|
|
65
|
-
|
|
66
|
-
error("Failed to register a hotkey due to a custom hotkey already being defined for the submitted function.")
|
|
67
|
-
end
|
|
68
|
-
dynamicHotkeyFunctionMap:set(keyboardOrFunc, triggerFunc)
|
|
69
|
-
else
|
|
70
|
-
if staticHotkeyFunctionMap:has(keyboardOrFunc) then
|
|
71
|
-
error(((("Failed to register a hotkey due to a hotkey already being defined for key: Keyboard." .. tostring(Keyboard[keyboardOrFunc])) .. " (") .. tostring(keyboardOrFunc)) .. ")")
|
|
72
|
-
end
|
|
73
|
-
staticHotkeyFunctionMap:set(keyboardOrFunc, triggerFunc)
|
|
62
|
+
if dynamicHotkeyFunctionMap:has(getKeyFunc) then
|
|
63
|
+
error("Failed to register a hotkey due to a custom hotkey already being defined for the submitted function.")
|
|
74
64
|
end
|
|
65
|
+
dynamicHotkeyFunctionMap:set(getKeyFunc, triggerFunc)
|
|
66
|
+
end
|
|
67
|
+
--- Helper function to run arbitrary code when you press and release a specific keyboard key.
|
|
68
|
+
--
|
|
69
|
+
-- This can be used to easily set up custom hotkeys to facilitate custom game features or to assist
|
|
70
|
+
-- in debugging.
|
|
71
|
+
--
|
|
72
|
+
-- @param keyboard The key that you want to trigger the hotkey.
|
|
73
|
+
-- @param triggerFunc A function containing the arbitrary code that you want to execute when the
|
|
74
|
+
-- hotkey is triggered.
|
|
75
|
+
function ____exports.setHotkey(self, keyboard, triggerFunc)
|
|
76
|
+
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
77
|
+
if staticHotkeyFunctionMap:has(keyboard) then
|
|
78
|
+
error(((("Failed to register a hotkey due to a hotkey already being defined for: Keyboard." .. tostring(Keyboard[keyboard])) .. " (") .. tostring(keyboard)) .. ")")
|
|
79
|
+
end
|
|
80
|
+
staticHotkeyFunctionMap:set(keyboard, triggerFunc)
|
|
81
|
+
end
|
|
82
|
+
--- Helper function to remove a hotkey created with the `setConditionalHotkey` function.
|
|
83
|
+
--
|
|
84
|
+
-- @param getKeyFunc Equal to the `getKeyFunc` that you passed when initially registering the
|
|
85
|
+
-- hotkey.
|
|
86
|
+
function ____exports.unsetConditionalHotkey(self, getKeyFunc)
|
|
87
|
+
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
88
|
+
if not dynamicHotkeyFunctionMap:has(getKeyFunc) then
|
|
89
|
+
error("Failed to unregister a hotkey since there is no existing hotkey defined for the submitted function.")
|
|
90
|
+
end
|
|
91
|
+
dynamicHotkeyFunctionMap:delete(getKeyFunc)
|
|
75
92
|
end
|
|
76
93
|
--- Helper function to remove a hotkey created with the `setHotkey` function.
|
|
77
94
|
--
|
|
78
|
-
-- @param
|
|
79
|
-
|
|
95
|
+
-- @param keyboard Equal to the keyboard value that you passed when initially registering the
|
|
96
|
+
-- hotkey.
|
|
97
|
+
function ____exports.unsetHotkey(self, keyboard)
|
|
80
98
|
errorIfFeaturesNotInitialized(nil, FEATURE_NAME)
|
|
81
|
-
if
|
|
82
|
-
|
|
83
|
-
error("Failed to unregister a hotkey since there is no existing hotkey defined for the submitted function.")
|
|
84
|
-
end
|
|
85
|
-
dynamicHotkeyFunctionMap:delete(keyboardOrFunc)
|
|
86
|
-
else
|
|
87
|
-
if not staticHotkeyFunctionMap:has(keyboardOrFunc) then
|
|
88
|
-
error(((("Failed to unregister a hotkey since there is no existing hotkey defined for key: Keyboard." .. tostring(Keyboard[keyboardOrFunc])) .. " (") .. tostring(keyboardOrFunc)) .. ")")
|
|
89
|
-
end
|
|
90
|
-
staticHotkeyFunctionMap:delete(keyboardOrFunc)
|
|
99
|
+
if not staticHotkeyFunctionMap:has(keyboard) then
|
|
100
|
+
error(((("Failed to unregister a hotkey since there is no existing hotkey defined for: Keyboard." .. tostring(Keyboard[keyboard])) .. " (") .. tostring(keyboard)) .. ")")
|
|
91
101
|
end
|
|
102
|
+
staticHotkeyFunctionMap:delete(keyboard)
|
|
92
103
|
end
|
|
93
104
|
return ____exports
|
|
@@ -25,7 +25,7 @@ local ____types = require("src.functions.types")
|
|
|
25
25
|
local isNumber = ____types.isNumber
|
|
26
26
|
local isTable = ____types.isTable
|
|
27
27
|
local ____utils = require("src.functions.utils")
|
|
28
|
-
local
|
|
28
|
+
local eRange = ____utils.eRange
|
|
29
29
|
--- Removes all of the specified element(s) from the array. If the specified element(s) are not found
|
|
30
30
|
-- in the array, this function will do nothing.
|
|
31
31
|
--
|
|
@@ -343,7 +343,7 @@ end
|
|
|
343
343
|
--
|
|
344
344
|
-- For example, an array of `["Apple", "Banana"]` would return an array of `[0, 1]`.
|
|
345
345
|
function ____exports.getArrayIndexes(self, array)
|
|
346
|
-
return
|
|
346
|
+
return eRange(nil, #array)
|
|
347
347
|
end
|
|
348
348
|
--- Helper function to return the last element of an array.
|
|
349
349
|
--
|
|
@@ -30,7 +30,7 @@ local ____set = require("src.functions.set")
|
|
|
30
30
|
local addSetsToSet = ____set.addSetsToSet
|
|
31
31
|
local getRandomSetElement = ____set.getRandomSetElement
|
|
32
32
|
local ____utils = require("src.functions.utils")
|
|
33
|
-
local
|
|
33
|
+
local iRange = ____utils.iRange
|
|
34
34
|
function lazyInitCardMapsSets(self)
|
|
35
35
|
for ____, cardType in ipairs(getEnumValues(nil, ItemConfigCardType)) do
|
|
36
36
|
ITEM_CONFIG_CARD_TYPE_TO_CARD_TYPE_MAP:set(
|
|
@@ -82,7 +82,7 @@ function ____exports.getItemConfigCardType(self, cardType)
|
|
|
82
82
|
end
|
|
83
83
|
--- Helper function to get an array with every valid vanilla card sub-type.
|
|
84
84
|
function ____exports.getVanillaCardTypes(self)
|
|
85
|
-
return
|
|
85
|
+
return iRange(nil, FIRST_CARD_TYPE, LAST_VANILLA_CARD_TYPE)
|
|
86
86
|
end
|
|
87
87
|
--- Returns true for any vanilla card or rune.
|
|
88
88
|
function ____exports.isVanillaCardType(self, cardType)
|
|
@@ -38,7 +38,7 @@ local ____sprites = require("src.functions.sprites")
|
|
|
38
38
|
local clearSprite = ____sprites.clearSprite
|
|
39
39
|
local spriteEquals = ____sprites.spriteEquals
|
|
40
40
|
local ____utils = require("src.functions.utils")
|
|
41
|
-
local
|
|
41
|
+
local iRange = ____utils.iRange
|
|
42
42
|
function initQuestionMarkSprite(self)
|
|
43
43
|
local sprite = Sprite()
|
|
44
44
|
sprite:Load("gfx/005.100_collectible.anm2", false)
|
|
@@ -349,7 +349,7 @@ end
|
|
|
349
349
|
-- should use the `getVanillaCollectibleArray` or `getVanillaCollectibleSet` helper functions
|
|
350
350
|
-- instead.
|
|
351
351
|
function ____exports.getVanillaCollectibleTypeRange(self)
|
|
352
|
-
return
|
|
352
|
+
return iRange(nil, FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE)
|
|
353
353
|
end
|
|
354
354
|
--- Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`.
|
|
355
355
|
function ____exports.isActiveCollectible(self, collectibleType)
|
|
@@ -8,10 +8,10 @@ local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
|
|
|
8
8
|
local ____roomData = require("src.functions.roomData")
|
|
9
9
|
local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
10
10
|
local ____utils = require("src.functions.utils")
|
|
11
|
-
local
|
|
11
|
+
local eRange = ____utils.eRange
|
|
12
12
|
--- Helper function to get an array with every valid `Dimension` (not including `Dimension.CURRENT`).
|
|
13
13
|
function ____exports.getAllDimensions(self)
|
|
14
|
-
return
|
|
14
|
+
return eRange(nil, NUM_DIMENSIONS)
|
|
15
15
|
end
|
|
16
16
|
--- Helper function to get the current dimension. Most of the time, this will be `Dimension.MAIN`,
|
|
17
17
|
-- but it can change if e.g. the player is in the mirror world of Downpour/Dross.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to remove all naturally spawning entities and grid entities from a room. Notably,
|
|
3
|
+
* this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8), projectiles
|
|
4
|
+
* (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent NPCs, most
|
|
5
|
+
* effects (1000), doors, and walls.
|
|
6
|
+
*/
|
|
7
|
+
export declare function emptyRoom(): void;
|
|
8
|
+
//# sourceMappingURL=emptyRoom.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emptyRoom.d.ts","sourceRoot":"","sources":["../../../src/functions/emptyRoom.ts"],"names":[],"mappings":"AAqBA;;;;;GAKG;AACH,wBAAgB,SAAS,IAAI,IAAI,CAGhC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Set = ____lualib.Set
|
|
3
|
+
local __TS__New = ____lualib.__TS__New
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local emptyRoomEntities, emptyRoomGridEntities, EMPTY_ROOM_BLACKLIST_ENTITY_SET
|
|
6
|
+
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
7
|
+
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
8
|
+
local EntityType = ____isaac_2Dtypescript_2Ddefinitions.EntityType
|
|
9
|
+
local GridEntityType = ____isaac_2Dtypescript_2Ddefinitions.GridEntityType
|
|
10
|
+
local ____cachedClasses = require("src.core.cachedClasses")
|
|
11
|
+
local game = ____cachedClasses.game
|
|
12
|
+
local ____entities = require("src.functions.entities")
|
|
13
|
+
local getEntities = ____entities.getEntities
|
|
14
|
+
local ____gridEntities = require("src.functions.gridEntities")
|
|
15
|
+
local getGridEntities = ____gridEntities.getGridEntities
|
|
16
|
+
local removeGridEntity = ____gridEntities.removeGridEntity
|
|
17
|
+
local ____rooms = require("src.functions.rooms")
|
|
18
|
+
local roomUpdateSafe = ____rooms.roomUpdateSafe
|
|
19
|
+
local ____roomShapeWalls = require("src.functions.roomShapeWalls")
|
|
20
|
+
local isVanillaWallGridIndex = ____roomShapeWalls.isVanillaWallGridIndex
|
|
21
|
+
function emptyRoomEntities(self)
|
|
22
|
+
local room = game:GetRoom()
|
|
23
|
+
for ____, entity in ipairs(getEntities(nil)) do
|
|
24
|
+
do
|
|
25
|
+
if EMPTY_ROOM_BLACKLIST_ENTITY_SET:has(entity.Type) then
|
|
26
|
+
goto __continue4
|
|
27
|
+
end
|
|
28
|
+
if entity:HasEntityFlags(EntityFlag.CHARM) or entity:HasEntityFlags(EntityFlag.FRIENDLY) or entity:HasEntityFlags(EntityFlag.PERSISTENT) then
|
|
29
|
+
goto __continue4
|
|
30
|
+
end
|
|
31
|
+
entity:ClearEntityFlags(EntityFlag.APPEAR)
|
|
32
|
+
entity:Remove()
|
|
33
|
+
if entity.Type == EntityType.FIREPLACE then
|
|
34
|
+
local gridIndex = room:GetGridIndex(entity.Position)
|
|
35
|
+
room:SetGridPath(gridIndex, 0)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
::__continue4::
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
function emptyRoomGridEntities(self)
|
|
42
|
+
local removedOneOrMoreGridEntities = false
|
|
43
|
+
for ____, gridEntity in ipairs(getGridEntities(nil)) do
|
|
44
|
+
do
|
|
45
|
+
local gridEntityType = gridEntity:GetType()
|
|
46
|
+
local gridIndex = gridEntity:GetGridIndex()
|
|
47
|
+
if gridEntityType == GridEntityType.WALL and isVanillaWallGridIndex(nil, gridIndex) then
|
|
48
|
+
goto __continue10
|
|
49
|
+
end
|
|
50
|
+
if gridEntityType == GridEntityType.DOOR then
|
|
51
|
+
goto __continue10
|
|
52
|
+
end
|
|
53
|
+
removeGridEntity(nil, gridEntity, false)
|
|
54
|
+
removedOneOrMoreGridEntities = true
|
|
55
|
+
end
|
|
56
|
+
::__continue10::
|
|
57
|
+
end
|
|
58
|
+
if removedOneOrMoreGridEntities then
|
|
59
|
+
roomUpdateSafe(nil)
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
EMPTY_ROOM_BLACKLIST_ENTITY_SET = __TS__New(Set, {
|
|
63
|
+
EntityType.PLAYER,
|
|
64
|
+
EntityType.TEAR,
|
|
65
|
+
EntityType.FAMILIAR,
|
|
66
|
+
EntityType.LASER,
|
|
67
|
+
EntityType.KNIFE,
|
|
68
|
+
EntityType.PROJECTILE,
|
|
69
|
+
EntityType.DARK_ESAU
|
|
70
|
+
})
|
|
71
|
+
--- Helper function to remove all naturally spawning entities and grid entities from a room. Notably,
|
|
72
|
+
-- this will not remove players (1), tears (2), familiars (3), lasers (7), knives (8), projectiles
|
|
73
|
+
-- (9), blacklisted NPCs such as Dark Esau, charmed NPCs, friendly NPCs, persistent NPCs, most
|
|
74
|
+
-- effects (1000), doors, and walls.
|
|
75
|
+
function ____exports.emptyRoom(self)
|
|
76
|
+
emptyRoomEntities(nil)
|
|
77
|
+
emptyRoomGridEntities(nil)
|
|
78
|
+
end
|
|
79
|
+
return ____exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/functions/enums.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,cAAc,EAAE,CAAC,GAChB,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAmBzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,MAAM,EAAE,CAG1D;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,GAAG,CAGvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAWjE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,cAAc,EAAE,CAAC,EACjB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAM,GAC7D,CAAC,CAAC,MAAM,CAAC,CAAC,CAGZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,OAAO,GACtB,IAAI,CAQN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,CAAC,GAChB,IAAI,
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../src/functions/enums.ts"],"names":[],"mappings":";;;AAKA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAC9B,cAAc,EAAE,CAAC,GAChB,KAAK,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAmBzC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,MAAM,EAAE,CAG1D;AAED,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,GAAG,CAGvD;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAWjE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,cAAc,EAAE,CAAC,EACjB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,UAAU,GAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAM,GAC7D,CAAC,CAAC,MAAM,CAAC,CAAC,CAGZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,kBAAkB,CAChC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,OAAO,GACtB,IAAI,CAQN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,kBAAkB,EAAE,MAAM,EAC1B,cAAc,EAAE,CAAC,GAChB,IAAI,CAsBN"}
|