isaacscript-common 15.4.4 → 15.4.5
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
CHANGED
|
@@ -6892,6 +6892,13 @@ export declare function inMirrorRoom(): boolean;
|
|
|
6892
6892
|
*/
|
|
6893
6893
|
export declare function inRectangle(position: Vector, topLeft: Vector, bottomRight: Vector): boolean;
|
|
6894
6894
|
|
|
6895
|
+
/**
|
|
6896
|
+
* Helper function to check if the current room matches one of the given room types.
|
|
6897
|
+
*
|
|
6898
|
+
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
6899
|
+
*/
|
|
6900
|
+
export declare function inRoomType(...roomTypes: RoomType[]): boolean;
|
|
6901
|
+
|
|
6895
6902
|
/**
|
|
6896
6903
|
* Helper function for checking if the current room is a secret exit that leads to a Repentance
|
|
6897
6904
|
* floor.
|
|
@@ -7685,13 +7692,6 @@ export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
|
|
|
7685
7692
|
*/
|
|
7686
7693
|
export declare function isRoomShapeDoubleCharge(roomShape: RoomShape): boolean;
|
|
7687
7694
|
|
|
7688
|
-
/**
|
|
7689
|
-
* Helper function to check if the current room matches one of the given room types.
|
|
7690
|
-
*
|
|
7691
|
-
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
7692
|
-
*/
|
|
7693
|
-
export declare function isRoomType(...roomTypes: RoomType[]): boolean;
|
|
7694
|
-
|
|
7695
7695
|
/** Returns true for cards that have `CardType.RUNE`. */
|
|
7696
7696
|
export declare function isRune(cardType: CardType): boolean;
|
|
7697
7697
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 15.4.
|
|
3
|
+
isaacscript-common 15.4.5
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -11199,6 +11199,7 @@ local TearFlagInternal = {
|
|
|
11199
11199
|
CARD_DROP_DEATH = getTearFlag(nil, 79),
|
|
11200
11200
|
RUNE_DROP_DEATH = getTearFlag(nil, 80),
|
|
11201
11201
|
TELEPORT = getTearFlag(nil, 81),
|
|
11202
|
+
SHORT_RANGE = getTearFlag(nil, 82),
|
|
11202
11203
|
REROLL_ROCK_WISP = getTearFlag(nil, 115),
|
|
11203
11204
|
MOM_STOMP_WISP = getTearFlag(nil, 116),
|
|
11204
11205
|
ENEMY_TO_WISP = getTearFlag(nil, 117),
|
|
@@ -25229,9 +25230,9 @@ local __TS__Spread = ____lualib.__TS__Spread
|
|
|
25229
25230
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
25230
25231
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
25231
25232
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
25233
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
25232
25234
|
local Set = ____lualib.Set
|
|
25233
25235
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
25234
|
-
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
25235
25236
|
local ____exports = {}
|
|
25236
25237
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
25237
25238
|
local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
|
|
@@ -25477,6 +25478,15 @@ function ____exports.inMirrorRoom(self)
|
|
|
25477
25478
|
local roomSubType = getRoomSubType(nil)
|
|
25478
25479
|
return roomType == RoomType.DEFAULT and (roomStageID == StageID.DOWNPOUR or roomStageID == StageID.DROSS) and roomSubType == asNumber(nil, DownpourRoomSubType.MIRROR)
|
|
25479
25480
|
end
|
|
25481
|
+
function ____exports.inRoomType(self, ...)
|
|
25482
|
+
local roomTypes = {...}
|
|
25483
|
+
local room = game:GetRoom()
|
|
25484
|
+
local thisRoomType = room:GetType()
|
|
25485
|
+
return __TS__ArraySome(
|
|
25486
|
+
roomTypes,
|
|
25487
|
+
function(____, roomType) return roomType == thisRoomType end
|
|
25488
|
+
)
|
|
25489
|
+
end
|
|
25480
25490
|
function ____exports.inSecretExit(self)
|
|
25481
25491
|
local roomGridIndex = getRoomGridIndex(nil)
|
|
25482
25492
|
return roomGridIndex == asNumber(nil, GridRoom.SECRET_EXIT)
|
|
@@ -25508,15 +25518,6 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
|
25508
25518
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
25509
25519
|
)
|
|
25510
25520
|
end
|
|
25511
|
-
function ____exports.isRoomType(self, ...)
|
|
25512
|
-
local roomTypes = {...}
|
|
25513
|
-
local room = game:GetRoom()
|
|
25514
|
-
local thisRoomType = room:GetType()
|
|
25515
|
-
return __TS__ArraySome(
|
|
25516
|
-
roomTypes,
|
|
25517
|
-
function(____, roomType) return roomType == thisRoomType end
|
|
25518
|
-
)
|
|
25519
|
-
end
|
|
25520
25521
|
function ____exports.roomUpdateSafe(self)
|
|
25521
25522
|
local room = game:GetRoom()
|
|
25522
25523
|
local entities = getEntities(nil)
|
|
@@ -151,6 +151,12 @@ export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
|
|
|
151
151
|
* rooms are marked with a specific sub-type.)
|
|
152
152
|
*/
|
|
153
153
|
export declare function inMirrorRoom(): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Helper function to check if the current room matches one of the given room types.
|
|
156
|
+
*
|
|
157
|
+
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
158
|
+
*/
|
|
159
|
+
export declare function inRoomType(...roomTypes: RoomType[]): boolean;
|
|
154
160
|
/**
|
|
155
161
|
* Helper function for checking if the current room is a secret exit that leads to a Repentance
|
|
156
162
|
* floor.
|
|
@@ -181,12 +187,6 @@ export declare function inStartingRoom(): boolean;
|
|
|
181
187
|
* checked. Undefined by default.
|
|
182
188
|
*/
|
|
183
189
|
export declare function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean;
|
|
184
|
-
/**
|
|
185
|
-
* Helper function to check if the current room matches one of the given room types.
|
|
186
|
-
*
|
|
187
|
-
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
188
|
-
*/
|
|
189
|
-
export declare function isRoomType(...roomTypes: RoomType[]): boolean;
|
|
190
190
|
/**
|
|
191
191
|
* If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
|
|
192
192
|
* slide around (such as the player). Since those entity velocities are already at zero, setting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,YAAY,EACZ,MAAM,EACN,SAAS,EAMT,YAAY,EAEZ,UAAU,EAGV,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAkCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAenD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,GAC1B,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAUlC;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,CAOlD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CACtB,4BAA4B,UAAQ,GACnC,cAAc,EAAE,CAOlB;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,4BAA4B,UAAQ,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lualib.__TS__Spread
|
|
|
8
8
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
9
9
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
10
10
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
11
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
11
12
|
local Set = ____lualib.Set
|
|
12
13
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
13
|
-
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
14
14
|
local ____exports = {}
|
|
15
15
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
16
16
|
local AngelRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.AngelRoomSubType
|
|
@@ -347,6 +347,18 @@ function ____exports.inMirrorRoom(self)
|
|
|
347
347
|
local roomSubType = getRoomSubType(nil)
|
|
348
348
|
return roomType == RoomType.DEFAULT and (roomStageID == StageID.DOWNPOUR or roomStageID == StageID.DROSS) and roomSubType == asNumber(nil, DownpourRoomSubType.MIRROR)
|
|
349
349
|
end
|
|
350
|
+
--- Helper function to check if the current room matches one of the given room types.
|
|
351
|
+
--
|
|
352
|
+
-- This function is variadic, which means you can pass as many room types as you want to match for.
|
|
353
|
+
function ____exports.inRoomType(self, ...)
|
|
354
|
+
local roomTypes = {...}
|
|
355
|
+
local room = game:GetRoom()
|
|
356
|
+
local thisRoomType = room:GetType()
|
|
357
|
+
return __TS__ArraySome(
|
|
358
|
+
roomTypes,
|
|
359
|
+
function(____, roomType) return roomType == thisRoomType end
|
|
360
|
+
)
|
|
361
|
+
end
|
|
350
362
|
--- Helper function for checking if the current room is a secret exit that leads to a Repentance
|
|
351
363
|
-- floor.
|
|
352
364
|
function ____exports.inSecretExit(self)
|
|
@@ -396,18 +408,6 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
|
396
408
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
397
409
|
)
|
|
398
410
|
end
|
|
399
|
-
--- Helper function to check if the current room matches one of the given room types.
|
|
400
|
-
--
|
|
401
|
-
-- This function is variadic, which means you can pass as many room types as you want to match for.
|
|
402
|
-
function ____exports.isRoomType(self, ...)
|
|
403
|
-
local roomTypes = {...}
|
|
404
|
-
local room = game:GetRoom()
|
|
405
|
-
local thisRoomType = room:GetType()
|
|
406
|
-
return __TS__ArraySome(
|
|
407
|
-
roomTypes,
|
|
408
|
-
function(____, roomType) return roomType == thisRoomType end
|
|
409
|
-
)
|
|
410
|
-
end
|
|
411
411
|
--- If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
|
|
412
412
|
-- slide around (such as the player). Since those entity velocities are already at zero, setting
|
|
413
413
|
-- them to zero will have no effect. Thus, a generic solution is to record all of the entity
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "15.4.
|
|
3
|
+
"version": "15.4.5",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"main": "dist/src/index",
|
|
23
23
|
"types": "dist/src/index.d.ts",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"isaac-typescript-definitions": "^9.
|
|
25
|
+
"isaac-typescript-definitions": "^9.4.1"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/functions/rooms.ts
CHANGED
|
@@ -463,6 +463,17 @@ export function inMirrorRoom(): boolean {
|
|
|
463
463
|
);
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
+
/**
|
|
467
|
+
* Helper function to check if the current room matches one of the given room types.
|
|
468
|
+
*
|
|
469
|
+
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
470
|
+
*/
|
|
471
|
+
export function inRoomType(...roomTypes: RoomType[]): boolean {
|
|
472
|
+
const room = game.GetRoom();
|
|
473
|
+
const thisRoomType = room.GetType();
|
|
474
|
+
return roomTypes.some((roomType) => roomType === thisRoomType);
|
|
475
|
+
}
|
|
476
|
+
|
|
466
477
|
/**
|
|
467
478
|
* Helper function for checking if the current room is a secret exit that leads to a Repentance
|
|
468
479
|
* floor.
|
|
@@ -527,17 +538,6 @@ export function isAllRoomsClear(onlyCheckRoomTypes?: RoomType[]): boolean {
|
|
|
527
538
|
return matchingRooms.every((roomDescriptor) => roomDescriptor.Clear);
|
|
528
539
|
}
|
|
529
540
|
|
|
530
|
-
/**
|
|
531
|
-
* Helper function to check if the current room matches one of the given room types.
|
|
532
|
-
*
|
|
533
|
-
* This function is variadic, which means you can pass as many room types as you want to match for.
|
|
534
|
-
*/
|
|
535
|
-
export function isRoomType(...roomTypes: RoomType[]): boolean {
|
|
536
|
-
const room = game.GetRoom();
|
|
537
|
-
const thisRoomType = room.GetType();
|
|
538
|
-
return roomTypes.some((roomType) => roomType === thisRoomType);
|
|
539
|
-
}
|
|
540
|
-
|
|
541
541
|
/**
|
|
542
542
|
* If the `Room.Update` method is called in a `POST_NEW_ROOM` callback, then some entities will
|
|
543
543
|
* slide around (such as the player). Since those entity velocities are already at zero, setting
|