isaacscript-common 69.3.0 → 69.4.0
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.rollup.d.ts +15 -1
- package/dist/isaacscript-common.lua +33 -3
- package/dist/src/functions/players.d.ts +6 -1
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +6 -1
- package/dist/src/functions/rooms.d.ts +8 -0
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +37 -2
- package/package.json +1 -1
- package/src/functions/players.ts +6 -1
- package/src/functions/rooms.ts +45 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -9594,6 +9594,15 @@ export declare function isRNG(object: unknown): object is RNG;
|
|
|
9594
9594
|
/** Helper function to detect if a variable is of type `GridEntityRock`. */
|
|
9595
9595
|
export declare function isRock(variable: unknown): variable is GridEntityRock;
|
|
9596
9596
|
|
|
9597
|
+
/**
|
|
9598
|
+
* Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
9599
|
+
* the player.
|
|
9600
|
+
*
|
|
9601
|
+
* This is useful to check to see if it is safe to pause the game or display some informational
|
|
9602
|
+
* text.
|
|
9603
|
+
*/
|
|
9604
|
+
export declare function isRoomDangerous(): boolean;
|
|
9605
|
+
|
|
9597
9606
|
/**
|
|
9598
9607
|
* Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
|
|
9599
9608
|
*
|
|
@@ -16919,7 +16928,12 @@ export declare function setBackdrop(backdropType: BackdropType): void;
|
|
|
16919
16928
|
/**
|
|
16920
16929
|
* Helper function to blindfold the player by using a hack with the challenge variable.
|
|
16921
16930
|
*
|
|
16922
|
-
*
|
|
16931
|
+
* Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
|
|
16932
|
+
* reapplied.
|
|
16933
|
+
*
|
|
16934
|
+
* Under the hood, this function sets the challenge to one with a blindfold, changes the player to
|
|
16935
|
+
* the same character that they currently are, and then changes the challenge back. This method was
|
|
16936
|
+
* discovered by im_tem.
|
|
16923
16937
|
*
|
|
16924
16938
|
* @param player The player to apply or remove the blindfold state from.
|
|
16925
16939
|
* @param enabled Whether to apply or remove the blindfold.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 69.
|
|
3
|
+
isaacscript-common 69.4.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -28142,6 +28142,7 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
|
28142
28142
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
28143
28143
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
28144
28144
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
28145
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
28145
28146
|
local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
|
|
28146
28147
|
local ____exports = {}
|
|
28147
28148
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
|
|
@@ -28151,8 +28152,10 @@ local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
|
|
|
28151
28152
|
local DoorSlotFlag = ____isaac_2Dtypescript_2Ddefinitions.DoorSlotFlag
|
|
28152
28153
|
local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSubType
|
|
28153
28154
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
28155
|
+
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
28154
28156
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
28155
28157
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
28158
|
+
local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
|
|
28156
28159
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
28157
28160
|
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
28158
28161
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
@@ -28511,6 +28514,33 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretAndS
|
|
|
28511
28514
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
28512
28515
|
)
|
|
28513
28516
|
end
|
|
28517
|
+
function ____exports.isRoomDangerous(self)
|
|
28518
|
+
local room = game:GetRoom()
|
|
28519
|
+
local isClear = room:IsClear()
|
|
28520
|
+
if not isClear then
|
|
28521
|
+
return true
|
|
28522
|
+
end
|
|
28523
|
+
local entities = getEntities(nil)
|
|
28524
|
+
if __TS__ArraySome(
|
|
28525
|
+
entities,
|
|
28526
|
+
function(____, entity) return entity:IsActiveEnemy(false) and not entity:HasEntityFlags(EntityFlag.FRIENDLY) end
|
|
28527
|
+
) then
|
|
28528
|
+
return true
|
|
28529
|
+
end
|
|
28530
|
+
if __TS__ArraySome(
|
|
28531
|
+
entities,
|
|
28532
|
+
function(____, entity)
|
|
28533
|
+
local projectile = entity:ToProjectile()
|
|
28534
|
+
if projectile == nil then
|
|
28535
|
+
return false
|
|
28536
|
+
end
|
|
28537
|
+
return not projectile:HasProjectileFlags(ProjectileFlag.CANT_HIT_PLAYER)
|
|
28538
|
+
end
|
|
28539
|
+
) then
|
|
28540
|
+
return true
|
|
28541
|
+
end
|
|
28542
|
+
return false
|
|
28543
|
+
end
|
|
28514
28544
|
function ____exports.isSecretRoomType(self, roomType)
|
|
28515
28545
|
return SECRET_ROOM_TYPES:has(roomType)
|
|
28516
28546
|
end
|
|
@@ -28537,12 +28567,12 @@ function ____exports.setRoomCleared(self)
|
|
|
28537
28567
|
for ____, door in ipairs(getDoors(nil)) do
|
|
28538
28568
|
do
|
|
28539
28569
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
28540
|
-
goto
|
|
28570
|
+
goto __continue91
|
|
28541
28571
|
end
|
|
28542
28572
|
openDoorFast(nil, door)
|
|
28543
28573
|
door.ExtraVisible = false
|
|
28544
28574
|
end
|
|
28545
|
-
::
|
|
28575
|
+
::__continue91::
|
|
28546
28576
|
end
|
|
28547
28577
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
28548
28578
|
game:ShakeScreen(0)
|
|
@@ -216,7 +216,12 @@ export declare function removeDeadEyeMultiplier(player: EntityPlayer): void;
|
|
|
216
216
|
/**
|
|
217
217
|
* Helper function to blindfold the player by using a hack with the challenge variable.
|
|
218
218
|
*
|
|
219
|
-
*
|
|
219
|
+
* Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
|
|
220
|
+
* reapplied.
|
|
221
|
+
*
|
|
222
|
+
* Under the hood, this function sets the challenge to one with a blindfold, changes the player to
|
|
223
|
+
* the same character that they currently are, and then changes the challenge back. This method was
|
|
224
|
+
* discovered by im_tem.
|
|
220
225
|
*
|
|
221
226
|
* @param player The player to apply or remove the blindfold state from.
|
|
222
227
|
* @param enabled Whether to apply or remove the blindfold.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAEL,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EAEX,MAAM,8BAA8B,CAAC;AAatC,wFAAwF;AACxF,wBAAgB,6BAA6B,CAC3C,eAAe,EAAE,eAAe,GAC/B,OAAO,CAOT;AAED,iFAAiF;AACjF,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAOtE;AAED,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,WAAW,EAAE,WAAW,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AE,YAAY,GAAG,OAAO,CAMvD;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAM9D;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG7D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN"}
|
|
@@ -437,7 +437,12 @@ function ____exports.removeDeadEyeMultiplier(self, player)
|
|
|
437
437
|
end
|
|
438
438
|
--- Helper function to blindfold the player by using a hack with the challenge variable.
|
|
439
439
|
--
|
|
440
|
-
--
|
|
440
|
+
-- Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
|
|
441
|
+
-- reapplied.
|
|
442
|
+
--
|
|
443
|
+
-- Under the hood, this function sets the challenge to one with a blindfold, changes the player to
|
|
444
|
+
-- the same character that they currently are, and then changes the challenge back. This method was
|
|
445
|
+
-- discovered by im_tem.
|
|
441
446
|
--
|
|
442
447
|
-- @param player The player to apply or remove the blindfold state from.
|
|
443
448
|
-- @param enabled Whether to apply or remove the blindfold.
|
|
@@ -362,6 +362,14 @@ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: Minib
|
|
|
362
362
|
* rooms are marked with a specific sub-type.)
|
|
363
363
|
*/
|
|
364
364
|
export declare function isMirrorRoom(roomData: RoomConfig): boolean;
|
|
365
|
+
/**
|
|
366
|
+
* Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
367
|
+
* the player.
|
|
368
|
+
*
|
|
369
|
+
* This is useful to check to see if it is safe to pause the game or display some informational
|
|
370
|
+
* text.
|
|
371
|
+
*/
|
|
372
|
+
export declare function isRoomDangerous(): boolean;
|
|
365
373
|
/**
|
|
366
374
|
* Helper function to check if the provided room matches one of the given room shapes.
|
|
367
375
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,
|
|
1
|
+
{"version":3,"file":"rooms.d.ts","sourceRoot":"","sources":["../../../src/functions/rooms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAUT,SAAS,EACT,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAuCtC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,IAAI,CAcnD;AAED;;;GAGG;AACH,wBAAgB,WAAW,IAAI,GAAG,CAGjC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,IAAI,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAiBlE;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,GAAG,EAChB,oBAAoB,UAAO,EAC3B,iCAAiC,UAAQ,GACxC,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAclC;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,G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pE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,IAAI,CAWrC;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,IAAI,CA8BrC;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC"}
|
|
@@ -9,6 +9,7 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
|
9
9
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
10
10
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
11
11
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
12
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
12
13
|
local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
|
|
13
14
|
local ____exports = {}
|
|
14
15
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
@@ -18,8 +19,10 @@ local DoorSlot = ____isaac_2Dtypescript_2Ddefinitions.DoorSlot
|
|
|
18
19
|
local DoorSlotFlag = ____isaac_2Dtypescript_2Ddefinitions.DoorSlotFlag
|
|
19
20
|
local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSubType
|
|
20
21
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
22
|
+
local EntityFlag = ____isaac_2Dtypescript_2Ddefinitions.EntityFlag
|
|
21
23
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
22
24
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
25
|
+
local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
|
|
23
26
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
24
27
|
local RoomShape = ____isaac_2Dtypescript_2Ddefinitions.RoomShape
|
|
25
28
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
@@ -608,6 +611,38 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretAndS
|
|
|
608
611
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
609
612
|
)
|
|
610
613
|
end
|
|
614
|
+
--- Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
615
|
+
-- the player.
|
|
616
|
+
--
|
|
617
|
+
-- This is useful to check to see if it is safe to pause the game or display some informational
|
|
618
|
+
-- text.
|
|
619
|
+
function ____exports.isRoomDangerous(self)
|
|
620
|
+
local room = game:GetRoom()
|
|
621
|
+
local isClear = room:IsClear()
|
|
622
|
+
if not isClear then
|
|
623
|
+
return true
|
|
624
|
+
end
|
|
625
|
+
local entities = getEntities(nil)
|
|
626
|
+
if __TS__ArraySome(
|
|
627
|
+
entities,
|
|
628
|
+
function(____, entity) return entity:IsActiveEnemy(false) and not entity:HasEntityFlags(EntityFlag.FRIENDLY) end
|
|
629
|
+
) then
|
|
630
|
+
return true
|
|
631
|
+
end
|
|
632
|
+
if __TS__ArraySome(
|
|
633
|
+
entities,
|
|
634
|
+
function(____, entity)
|
|
635
|
+
local projectile = entity:ToProjectile()
|
|
636
|
+
if projectile == nil then
|
|
637
|
+
return false
|
|
638
|
+
end
|
|
639
|
+
return not projectile:HasProjectileFlags(ProjectileFlag.CANT_HIT_PLAYER)
|
|
640
|
+
end
|
|
641
|
+
) then
|
|
642
|
+
return true
|
|
643
|
+
end
|
|
644
|
+
return false
|
|
645
|
+
end
|
|
611
646
|
--- Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
|
|
612
647
|
-- Secret Room.
|
|
613
648
|
function ____exports.isSecretRoomType(self, roomType)
|
|
@@ -644,12 +679,12 @@ function ____exports.setRoomCleared(self)
|
|
|
644
679
|
for ____, door in ipairs(getDoors(nil)) do
|
|
645
680
|
do
|
|
646
681
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
647
|
-
goto
|
|
682
|
+
goto __continue91
|
|
648
683
|
end
|
|
649
684
|
openDoorFast(nil, door)
|
|
650
685
|
door.ExtraVisible = false
|
|
651
686
|
end
|
|
652
|
-
::
|
|
687
|
+
::__continue91::
|
|
653
688
|
end
|
|
654
689
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
655
690
|
game:ShakeScreen(0)
|
package/package.json
CHANGED
package/src/functions/players.ts
CHANGED
|
@@ -548,7 +548,12 @@ export function removeDeadEyeMultiplier(player: EntityPlayer): void {
|
|
|
548
548
|
/**
|
|
549
549
|
* Helper function to blindfold the player by using a hack with the challenge variable.
|
|
550
550
|
*
|
|
551
|
-
*
|
|
551
|
+
* Note that if the player dies and respawns (from e.g. Dead Cat), the blindfold will have to be
|
|
552
|
+
* reapplied.
|
|
553
|
+
*
|
|
554
|
+
* Under the hood, this function sets the challenge to one with a blindfold, changes the player to
|
|
555
|
+
* the same character that they currently are, and then changes the challenge back. This method was
|
|
556
|
+
* discovered by im_tem.
|
|
552
557
|
*
|
|
553
558
|
* @param player The player to apply or remove the blindfold state from.
|
|
554
559
|
* @param enabled Whether to apply or remove the blindfold.
|
package/src/functions/rooms.ts
CHANGED
|
@@ -11,8 +11,10 @@ import {
|
|
|
11
11
|
DoorSlotFlag,
|
|
12
12
|
DownpourRoomSubType,
|
|
13
13
|
DungeonSubType,
|
|
14
|
+
EntityFlag,
|
|
14
15
|
GridRoom,
|
|
15
16
|
HomeRoomSubType,
|
|
17
|
+
ProjectileFlag,
|
|
16
18
|
RoomDescriptorFlag,
|
|
17
19
|
RoomShape,
|
|
18
20
|
RoomType,
|
|
@@ -791,6 +793,49 @@ export function isMirrorRoom(roomData: RoomConfig): boolean {
|
|
|
791
793
|
);
|
|
792
794
|
}
|
|
793
795
|
|
|
796
|
+
/**
|
|
797
|
+
* Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
798
|
+
* the player.
|
|
799
|
+
*
|
|
800
|
+
* This is useful to check to see if it is safe to pause the game or display some informational
|
|
801
|
+
* text.
|
|
802
|
+
*/
|
|
803
|
+
export function isRoomDangerous(): boolean {
|
|
804
|
+
const room = game.GetRoom();
|
|
805
|
+
|
|
806
|
+
const isClear = room.IsClear();
|
|
807
|
+
if (!isClear) {
|
|
808
|
+
return true;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
const entities = getEntities();
|
|
812
|
+
|
|
813
|
+
if (
|
|
814
|
+
entities.some(
|
|
815
|
+
(entity) =>
|
|
816
|
+
entity.IsActiveEnemy(false) &&
|
|
817
|
+
!entity.HasEntityFlags(EntityFlag.FRIENDLY),
|
|
818
|
+
)
|
|
819
|
+
) {
|
|
820
|
+
return true;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
if (
|
|
824
|
+
entities.some((entity) => {
|
|
825
|
+
const projectile = entity.ToProjectile();
|
|
826
|
+
if (projectile === undefined) {
|
|
827
|
+
return false;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
return !projectile.HasProjectileFlags(ProjectileFlag.CANT_HIT_PLAYER);
|
|
831
|
+
})
|
|
832
|
+
) {
|
|
833
|
+
return true;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
return false;
|
|
837
|
+
}
|
|
838
|
+
|
|
794
839
|
/**
|
|
795
840
|
* Helper function to check if the provided room matches one of the given room shapes.
|
|
796
841
|
*
|