isaacscript-common 1.2.68 → 1.2.69
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/functions/doors.d.ts +3 -1
- package/dist/functions/doors.lua +17 -31
- package/package.json +1 -1
|
@@ -88,8 +88,10 @@ export declare function openDoorFast(door: GridEntityDoor): void;
|
|
|
88
88
|
* @returns The number of doors removed.
|
|
89
89
|
*/
|
|
90
90
|
export declare function removeAllDoors(...roomTypes: RoomType[]): int;
|
|
91
|
+
/** Helper function to remove a single door. */
|
|
92
|
+
export declare function removeDoor(door: GridEntityDoor): void;
|
|
91
93
|
/**
|
|
92
|
-
* Helper function to remove the
|
|
94
|
+
* Helper function to remove the doors provided.
|
|
93
95
|
*
|
|
94
96
|
* This function is variadic, meaning that you can specify as many doors as you want to remove.
|
|
95
97
|
*/
|
package/dist/functions/doors.lua
CHANGED
|
@@ -40,6 +40,17 @@ function ____exports.isSecretRoomDoor(self, door)
|
|
|
40
40
|
local filename = sprite:GetFilename()
|
|
41
41
|
return filename == "gfx/grid/Door_08_HoleInWall.anm2"
|
|
42
42
|
end
|
|
43
|
+
function ____exports.removeDoor(self, door)
|
|
44
|
+
local game = Game()
|
|
45
|
+
local room = game:GetRoom()
|
|
46
|
+
room:RemoveDoor(door.Slot)
|
|
47
|
+
end
|
|
48
|
+
function ____exports.removeDoors(self, ...)
|
|
49
|
+
local doors = {...}
|
|
50
|
+
for ____, door in ipairs(doors) do
|
|
51
|
+
____exports.removeDoor(nil, door)
|
|
52
|
+
end
|
|
53
|
+
end
|
|
43
54
|
function ____exports.closeAllDoors(self)
|
|
44
55
|
for ____, door in ipairs(____exports.getDoors(nil)) do
|
|
45
56
|
door:Close(true)
|
|
@@ -167,36 +178,11 @@ function ____exports.openDoorFast(self, door)
|
|
|
167
178
|
sprite:Play("Opened", true)
|
|
168
179
|
end
|
|
169
180
|
function ____exports.removeAllDoors(self, ...)
|
|
170
|
-
local
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
local i = 0
|
|
177
|
-
while i < MAX_NUM_DOORS do
|
|
178
|
-
do
|
|
179
|
-
local door = room:GetDoor(i)
|
|
180
|
-
if door == nil then
|
|
181
|
-
goto __continue38
|
|
182
|
-
end
|
|
183
|
-
if #roomTypes == 0 or roomTypesSet:has(door.TargetRoomType) then
|
|
184
|
-
room:RemoveDoor(i)
|
|
185
|
-
numDoorsRemoved = numDoorsRemoved + 1
|
|
186
|
-
end
|
|
187
|
-
end
|
|
188
|
-
::__continue38::
|
|
189
|
-
i = i + 1
|
|
190
|
-
end
|
|
191
|
-
end
|
|
192
|
-
return numDoorsRemoved
|
|
193
|
-
end
|
|
194
|
-
function ____exports.removeDoors(self, ...)
|
|
195
|
-
local doors = {...}
|
|
196
|
-
local game = Game()
|
|
197
|
-
local room = game:GetRoom()
|
|
198
|
-
for ____, door in ipairs(doors) do
|
|
199
|
-
room:RemoveDoor(door.Slot)
|
|
200
|
-
end
|
|
181
|
+
local doors = ____exports.getDoors(nil, ...)
|
|
182
|
+
____exports.removeDoors(
|
|
183
|
+
nil,
|
|
184
|
+
table.unpack(doors)
|
|
185
|
+
)
|
|
186
|
+
return #doors
|
|
201
187
|
end
|
|
202
188
|
return ____exports
|