isaacscript-common 1.2.278 → 1.2.279
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.
|
@@ -5,9 +5,9 @@ import { AnyEntity } from "../types/AnyEntity";
|
|
|
5
5
|
* `Isaac.CountEntities` method to avoid having to specify a spawner and to handle ignoring charmed
|
|
6
6
|
* enemies.
|
|
7
7
|
*
|
|
8
|
-
* @param entityType Default is -1.
|
|
9
|
-
* @param variant Default is -1.
|
|
10
|
-
* @param subType Default is -1.
|
|
8
|
+
* @param entityType Default is -1. -1 matches every entity type.
|
|
9
|
+
* @param variant Default is -1. -1 matches every variant.
|
|
10
|
+
* @param subType Default is -1. -1 matches every sub-type.
|
|
11
11
|
* @param ignoreFriendly Default is false.
|
|
12
12
|
*/
|
|
13
13
|
export declare function countEntities(entityType?: EntityType | int, variant?: number, subType?: number, ignoreFriendly?: boolean): int;
|
|
@@ -41,8 +41,10 @@ export declare function getClosestEntityTo<T extends AnyEntity>(referenceEntity:
|
|
|
41
41
|
*
|
|
42
42
|
* @param entityType Optional. If specified, will only return NPCs that match this entity
|
|
43
43
|
* type.
|
|
44
|
-
* @param variant Optional. If specified, will only return NPCs that match this variant.
|
|
45
|
-
*
|
|
44
|
+
* @param variant Optional. If specified, will only return NPCs that match this variant. Default is
|
|
45
|
+
* -1. -1 matches every variant.
|
|
46
|
+
* @param subType Optional. If specified, will only return NPCs that match this sub-type. Default is
|
|
47
|
+
* -1. -1 matches every sub-type.
|
|
46
48
|
* @param ignoreFriendly Optional. If set to true, it will exclude friendly NPCs from being
|
|
47
49
|
* returned. Default is false. Will only be taken into account if `matchingEntityType` is specified.
|
|
48
50
|
*/
|
|
@@ -89,10 +91,8 @@ export declare function parseEntityTypeVariantString(entityTypeVariantString: st
|
|
|
89
91
|
* Helper function to remove all of the matching entities in the room.
|
|
90
92
|
*
|
|
91
93
|
* @param entityType The entity type to match.
|
|
92
|
-
* @param entityVariant Optional. The variant to match. Default is -1
|
|
93
|
-
*
|
|
94
|
-
* @param entitySubType Optional. The sub-type to match. Default is -1 (which will match every
|
|
95
|
-
* sub-type).
|
|
94
|
+
* @param entityVariant Optional. The variant to match. Default is -1. -1 matches every variant.
|
|
95
|
+
* @param entitySubType Optional. The sub-type to match. Default is -1. -1 matches every sub-type.
|
|
96
96
|
* @param cap Optional. If specified, will only remove the given amount of collectibles.
|
|
97
97
|
* @returns True if one or more entities were removed, false otherwise.
|
|
98
98
|
*/
|
|
@@ -39,6 +39,11 @@ export declare function getRoomItemPoolType(): ItemPoolType;
|
|
|
39
39
|
* `RoomList`. Default is false.
|
|
40
40
|
*/
|
|
41
41
|
export declare function getRooms(includeExtraDimensionalRooms?: boolean): RoomDescriptor[];
|
|
42
|
+
/**
|
|
43
|
+
* Helper function to get the room descriptor for every room on the level in a specific dimension.
|
|
44
|
+
* Uses the `Level.GetRooms` method to accomplish this.
|
|
45
|
+
*/
|
|
46
|
+
export declare function getRoomsOfDimension(dimension: Dimension): RoomDescriptor[];
|
|
42
47
|
/**
|
|
43
48
|
* Helper function to determine if the current room shape is equal to `RoomShape.ROOMSHAPE_1x2` or
|
|
44
49
|
* `RoomShape.ROOMSHAPE_2x1`.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -134,6 +134,21 @@ function ____exports.getRoomItemPoolType(self)
|
|
|
134
134
|
local roomSeed = room:GetSpawnSeed()
|
|
135
135
|
return itemPool:GetPoolForRoom(roomType, roomSeed)
|
|
136
136
|
end
|
|
137
|
+
function ____exports.getRoomsOfDimension(self, dimension)
|
|
138
|
+
local level = game:GetLevel()
|
|
139
|
+
local rooms = {}
|
|
140
|
+
do
|
|
141
|
+
local i = 0
|
|
142
|
+
while i <= MAX_ROOM_INDEX do
|
|
143
|
+
local roomDescriptor = level:GetRoomByIdx(i, dimension)
|
|
144
|
+
if roomDescriptor ~= nil then
|
|
145
|
+
rooms[#rooms + 1] = roomDescriptor
|
|
146
|
+
end
|
|
147
|
+
i = i + 1
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
return rooms
|
|
151
|
+
end
|
|
137
152
|
function ____exports.in2x1Room(self)
|
|
138
153
|
local room = game:GetRoom()
|
|
139
154
|
local roomShape = room:GetRoomShape()
|
|
@@ -274,12 +289,12 @@ function ____exports.setRoomCleared(self)
|
|
|
274
289
|
for ____, door in ipairs(getDoors(nil)) do
|
|
275
290
|
do
|
|
276
291
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
277
|
-
goto
|
|
292
|
+
goto __continue55
|
|
278
293
|
end
|
|
279
294
|
openDoorFast(nil, door)
|
|
280
295
|
door.ExtraVisible = false
|
|
281
296
|
end
|
|
282
|
-
::
|
|
297
|
+
::__continue55::
|
|
283
298
|
end
|
|
284
299
|
sfxManager:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
285
300
|
game:ShakeScreen(0)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.279",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.393",
|
|
29
29
|
"isaacscript-lint": "^1.0.99",
|
|
30
|
-
"isaacscript-tsconfig": "^1.1.
|
|
30
|
+
"isaacscript-tsconfig": "^1.1.9",
|
|
31
31
|
"typedoc": "^0.22.15",
|
|
32
32
|
"typescript": "4.6.3",
|
|
33
33
|
"typescript-to-lua": "^1.4.3"
|