isaacscript-common 79.3.0 → 80.0.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.
|
@@ -363,14 +363,6 @@ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: Minib
|
|
|
363
363
|
* rooms are marked with a specific sub-type.)
|
|
364
364
|
*/
|
|
365
365
|
export declare function isMirrorRoom(roomData: RoomConfig): boolean;
|
|
366
|
-
/**
|
|
367
|
-
* Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
368
|
-
* the player.
|
|
369
|
-
*
|
|
370
|
-
* This is useful to check to see if it is safe to pause the game or display some informational
|
|
371
|
-
* text.
|
|
372
|
-
*/
|
|
373
|
-
export declare function isRoomDangerous(): boolean;
|
|
374
366
|
/**
|
|
375
367
|
* Helper function to check if the provided room matches one of the given room shapes.
|
|
376
368
|
*
|
|
@@ -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,EACV,SAAS,EACV,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,EACV,SAAS,EACV,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,SAAS,EAQT,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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,UAAU,GAAG,OAAO,CAO1D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,QAAQ,EAAE,UAAU,EACpB,GAAG,UAAU,EAAE,SAAS,EAAE,GACzB,OAAO,CAET;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,UAAU,EACpB,GAAG,SAAS,EAAE,QAAQ,EAAE,GACvB,OAAO,CAET;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAExD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAExD;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"}
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -9,7 +9,6 @@ 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
|
|
13
12
|
local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
|
|
14
13
|
local ____exports = {}
|
|
15
14
|
local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
|
|
@@ -21,7 +20,6 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
|
|
|
21
20
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
22
21
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
23
22
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
24
|
-
local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
|
|
25
23
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
26
24
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
27
25
|
local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
|
|
@@ -47,7 +45,6 @@ local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
|
|
|
47
45
|
local openDoorFast = ____doors.openDoorFast
|
|
48
46
|
local ____entities = require("functions.entities")
|
|
49
47
|
local getEntities = ____entities.getEntities
|
|
50
|
-
local isActiveEnemy = ____entities.isActiveEnemy
|
|
51
48
|
local ____flag = require("functions.flag")
|
|
52
49
|
local hasFlag = ____flag.hasFlag
|
|
53
50
|
local ____positionVelocity = require("functions.positionVelocity")
|
|
@@ -621,38 +618,6 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretRoom
|
|
|
621
618
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
622
619
|
)
|
|
623
620
|
end
|
|
624
|
-
--- Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
625
|
-
-- the player.
|
|
626
|
-
--
|
|
627
|
-
-- This is useful to check to see if it is safe to pause the game or display some informational
|
|
628
|
-
-- text.
|
|
629
|
-
function ____exports.isRoomDangerous(self)
|
|
630
|
-
local room = game:GetRoom()
|
|
631
|
-
local isClear = room:IsClear()
|
|
632
|
-
if not isClear then
|
|
633
|
-
return true
|
|
634
|
-
end
|
|
635
|
-
local entities = getEntities(nil)
|
|
636
|
-
if __TS__ArraySome(
|
|
637
|
-
entities,
|
|
638
|
-
function(____, entity) return isActiveEnemy(nil, entity) end
|
|
639
|
-
) then
|
|
640
|
-
return true
|
|
641
|
-
end
|
|
642
|
-
if __TS__ArraySome(
|
|
643
|
-
entities,
|
|
644
|
-
function(____, entity)
|
|
645
|
-
local projectile = entity:ToProjectile()
|
|
646
|
-
if projectile == nil then
|
|
647
|
-
return false
|
|
648
|
-
end
|
|
649
|
-
return not projectile:HasProjectileFlags(ProjectileFlag.CANT_HIT_PLAYER)
|
|
650
|
-
end
|
|
651
|
-
) then
|
|
652
|
-
return true
|
|
653
|
-
end
|
|
654
|
-
return false
|
|
655
|
-
end
|
|
656
621
|
--- Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
|
|
657
622
|
-- Secret Room.
|
|
658
623
|
function ____exports.isSecretRoomType(self, roomType)
|
|
@@ -689,12 +654,12 @@ function ____exports.setRoomCleared(self)
|
|
|
689
654
|
for ____, door in ipairs(getDoors(nil)) do
|
|
690
655
|
do
|
|
691
656
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
692
|
-
goto
|
|
657
|
+
goto __continue86
|
|
693
658
|
end
|
|
694
659
|
openDoorFast(nil, door)
|
|
695
660
|
door.ExtraVisible = false
|
|
696
661
|
end
|
|
697
|
-
::
|
|
662
|
+
::__continue86::
|
|
698
663
|
end
|
|
699
664
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
700
665
|
game:ShakeScreen(0)
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -9935,15 +9935,6 @@ export declare function isRNG(object: unknown): object is RNG;
|
|
|
9935
9935
|
/** Helper function to detect if a variable is of type `GridEntityRock`. */
|
|
9936
9936
|
export declare function isRock(variable: unknown): variable is GridEntityRock;
|
|
9937
9937
|
|
|
9938
|
-
/**
|
|
9939
|
-
* Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
9940
|
-
* the player.
|
|
9941
|
-
*
|
|
9942
|
-
* This is useful to check to see if it is safe to pause the game or display some informational
|
|
9943
|
-
* text.
|
|
9944
|
-
*/
|
|
9945
|
-
export declare function isRoomDangerous(): boolean;
|
|
9946
|
-
|
|
9947
9938
|
/**
|
|
9948
9939
|
* Helper function to determine if a given room grid index is inside of the normal 13x13 level grid.
|
|
9949
9940
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 79.
|
|
3
|
+
isaacscript-common 79.3.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -32438,7 +32438,6 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
|
32438
32438
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
32439
32439
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
32440
32440
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
32441
|
-
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
32442
32441
|
local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
|
|
32443
32442
|
local ____exports = {}
|
|
32444
32443
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
|
|
@@ -32450,7 +32449,6 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
|
|
|
32450
32449
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
32451
32450
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
32452
32451
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
32453
|
-
local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
|
|
32454
32452
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
32455
32453
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
32456
32454
|
local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
|
|
@@ -32476,7 +32474,6 @@ local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
|
|
|
32476
32474
|
local openDoorFast = ____doors.openDoorFast
|
|
32477
32475
|
local ____entities = require("functions.entities")
|
|
32478
32476
|
local getEntities = ____entities.getEntities
|
|
32479
|
-
local isActiveEnemy = ____entities.isActiveEnemy
|
|
32480
32477
|
local ____flag = require("functions.flag")
|
|
32481
32478
|
local hasFlag = ____flag.hasFlag
|
|
32482
32479
|
local ____positionVelocity = require("functions.positionVelocity")
|
|
@@ -33050,38 +33047,6 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretRoom
|
|
|
33050
33047
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
33051
33048
|
)
|
|
33052
33049
|
end
|
|
33053
|
-
--- Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
33054
|
-
-- the player.
|
|
33055
|
-
--
|
|
33056
|
-
-- This is useful to check to see if it is safe to pause the game or display some informational
|
|
33057
|
-
-- text.
|
|
33058
|
-
function ____exports.isRoomDangerous(self)
|
|
33059
|
-
local room = game:GetRoom()
|
|
33060
|
-
local isClear = room:IsClear()
|
|
33061
|
-
if not isClear then
|
|
33062
|
-
return true
|
|
33063
|
-
end
|
|
33064
|
-
local entities = getEntities(nil)
|
|
33065
|
-
if __TS__ArraySome(
|
|
33066
|
-
entities,
|
|
33067
|
-
function(____, entity) return isActiveEnemy(nil, entity) end
|
|
33068
|
-
) then
|
|
33069
|
-
return true
|
|
33070
|
-
end
|
|
33071
|
-
if __TS__ArraySome(
|
|
33072
|
-
entities,
|
|
33073
|
-
function(____, entity)
|
|
33074
|
-
local projectile = entity:ToProjectile()
|
|
33075
|
-
if projectile == nil then
|
|
33076
|
-
return false
|
|
33077
|
-
end
|
|
33078
|
-
return not projectile:HasProjectileFlags(ProjectileFlag.CANT_HIT_PLAYER)
|
|
33079
|
-
end
|
|
33080
|
-
) then
|
|
33081
|
-
return true
|
|
33082
|
-
end
|
|
33083
|
-
return false
|
|
33084
|
-
end
|
|
33085
33050
|
--- Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
|
|
33086
33051
|
-- Secret Room.
|
|
33087
33052
|
function ____exports.isSecretRoomType(self, roomType)
|
|
@@ -33118,12 +33083,12 @@ function ____exports.setRoomCleared(self)
|
|
|
33118
33083
|
for ____, door in ipairs(getDoors(nil)) do
|
|
33119
33084
|
do
|
|
33120
33085
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
33121
|
-
goto
|
|
33086
|
+
goto __continue86
|
|
33122
33087
|
end
|
|
33123
33088
|
openDoorFast(nil, door)
|
|
33124
33089
|
door.ExtraVisible = false
|
|
33125
33090
|
end
|
|
33126
|
-
::
|
|
33091
|
+
::__continue86::
|
|
33127
33092
|
end
|
|
33128
33093
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
33129
33094
|
game:ShakeScreen(0)
|
package/package.json
CHANGED
package/src/functions/rooms.ts
CHANGED
|
@@ -14,7 +14,6 @@ import {
|
|
|
14
14
|
DungeonSubType,
|
|
15
15
|
GridRoom,
|
|
16
16
|
HomeRoomSubType,
|
|
17
|
-
ProjectileFlag,
|
|
18
17
|
RoomDescriptorFlag,
|
|
19
18
|
RoomType,
|
|
20
19
|
SoundEffect,
|
|
@@ -32,7 +31,7 @@ import {
|
|
|
32
31
|
isHiddenSecretRoomDoor,
|
|
33
32
|
openDoorFast,
|
|
34
33
|
} from "./doors";
|
|
35
|
-
import { getEntities
|
|
34
|
+
import { getEntities } from "./entities";
|
|
36
35
|
import { hasFlag } from "./flag";
|
|
37
36
|
import {
|
|
38
37
|
getEntityPositions,
|
|
@@ -800,43 +799,6 @@ export function isMirrorRoom(roomData: RoomConfig): boolean {
|
|
|
800
799
|
);
|
|
801
800
|
}
|
|
802
801
|
|
|
803
|
-
/**
|
|
804
|
-
* Helper function to check if the room contains one or more enemies/projectiles that could damage
|
|
805
|
-
* the player.
|
|
806
|
-
*
|
|
807
|
-
* This is useful to check to see if it is safe to pause the game or display some informational
|
|
808
|
-
* text.
|
|
809
|
-
*/
|
|
810
|
-
export function isRoomDangerous(): boolean {
|
|
811
|
-
const room = game.GetRoom();
|
|
812
|
-
|
|
813
|
-
const isClear = room.IsClear();
|
|
814
|
-
if (!isClear) {
|
|
815
|
-
return true;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
const entities = getEntities();
|
|
819
|
-
|
|
820
|
-
if (entities.some((entity) => isActiveEnemy(entity))) {
|
|
821
|
-
return true;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
if (
|
|
825
|
-
entities.some((entity) => {
|
|
826
|
-
const projectile = entity.ToProjectile();
|
|
827
|
-
if (projectile === undefined) {
|
|
828
|
-
return false;
|
|
829
|
-
}
|
|
830
|
-
|
|
831
|
-
return !projectile.HasProjectileFlags(ProjectileFlag.CANT_HIT_PLAYER);
|
|
832
|
-
})
|
|
833
|
-
) {
|
|
834
|
-
return true;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
return false;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
802
|
/**
|
|
841
803
|
* Helper function to check if the provided room matches one of the given room shapes.
|
|
842
804
|
*
|