isaacscript-common 79.3.0 → 80.1.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/functions/rooms.d.ts +0 -8
- package/dist/functions/rooms.d.ts.map +1 -1
- package/dist/functions/rooms.lua +2 -37
- package/dist/functions/string.d.ts +1 -0
- package/dist/functions/string.d.ts.map +1 -1
- package/dist/functions/string.lua +9 -0
- package/dist/index.rollup.d.ts +2 -9
- package/dist/isaacscript-common.lua +12 -38
- package/package.json +1 -1
- package/src/functions/rooms.ts +1 -39
- package/src/functions/string.ts +12 -0
|
@@ -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;AACt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AC,aAAa,EAAE,GAAG,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAOzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,UAAU,EACpB,UAAU,EAAE,UAAU,GACrB,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,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)
|
|
@@ -98,4 +98,5 @@ export declare function removeSubstring(string: string, ...substrings: string[])
|
|
|
98
98
|
export declare function trimPrefix(string: string, prefix: string): string;
|
|
99
99
|
/** Helper function to trim a suffix from a string, if it exists. Returns the trimmed string. */
|
|
100
100
|
export declare function trimSuffix(string: string, prefix: string): string;
|
|
101
|
+
export declare function uncapitalizeFirstLetter(string: string): string;
|
|
101
102
|
//# sourceMappingURL=string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/functions/string.ts"],"names":[],"mappings":";AAEA,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAU5D;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC1B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAezB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GACxB,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAezB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,EAAE,GACd,MAAM,GAAG,SAAS,CAYpB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GACtD;IACE,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;CACnB,GACD,SAAS,CAyBZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,E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Y,EAAE,GAAG,CAAC;IAClB,YAAY,EAAE,GAAG,CAAC;CACnB,GACD,SAAS,CAyBZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE7E;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,MAAM,CAGR;AAED,8FAA8F;AAC9F,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGnE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,GAAG,UAAU,EAAE,MAAM,EAAE,GACtB,MAAM,CAMR;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMjE;AAED,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOjE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAU9D"}
|
|
@@ -169,4 +169,13 @@ function ____exports.trimSuffix(self, ____string, prefix)
|
|
|
169
169
|
local endCharacter = #____string - #prefix
|
|
170
170
|
return __TS__StringSlice(____string, 0, endCharacter)
|
|
171
171
|
end
|
|
172
|
+
function ____exports.uncapitalizeFirstLetter(self, ____string)
|
|
173
|
+
if ____string == "" then
|
|
174
|
+
return ____string
|
|
175
|
+
end
|
|
176
|
+
local firstCharacter = string.sub(____string, 1, 1)
|
|
177
|
+
local uncapitalizedFirstLetter = string.lower(firstCharacter)
|
|
178
|
+
local restOfString = string.sub(____string, 2)
|
|
179
|
+
return uncapitalizedFirstLetter .. restOfString
|
|
180
|
+
end
|
|
172
181
|
return ____exports
|
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
|
*
|
|
@@ -18979,6 +18970,8 @@ export declare type TupleWithMaxLength<T, MaxLength extends number> = (T[] | rea
|
|
|
18979
18970
|
*/
|
|
18980
18971
|
export declare const UI_HEART_WIDTH = 12;
|
|
18981
18972
|
|
|
18973
|
+
export declare function uncapitalizeFirstLetter(string: string): string;
|
|
18974
|
+
|
|
18982
18975
|
/** Helper type to convert a union to an intersection. */
|
|
18983
18976
|
export declare type UnionToIntersection<U> = (U extends U ? (u: U) => 0 : never) extends (i: infer I) => 0 ? Extract<I, U> : never;
|
|
18984
18977
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 80.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -18095,6 +18095,15 @@ function ____exports.trimSuffix(self, ____string, prefix)
|
|
|
18095
18095
|
local endCharacter = #____string - #prefix
|
|
18096
18096
|
return __TS__StringSlice(____string, 0, endCharacter)
|
|
18097
18097
|
end
|
|
18098
|
+
function ____exports.uncapitalizeFirstLetter(self, ____string)
|
|
18099
|
+
if ____string == "" then
|
|
18100
|
+
return ____string
|
|
18101
|
+
end
|
|
18102
|
+
local firstCharacter = string.sub(____string, 1, 1)
|
|
18103
|
+
local uncapitalizedFirstLetter = string.lower(firstCharacter)
|
|
18104
|
+
local restOfString = string.sub(____string, 2)
|
|
18105
|
+
return uncapitalizedFirstLetter .. restOfString
|
|
18106
|
+
end
|
|
18098
18107
|
return ____exports
|
|
18099
18108
|
end,
|
|
18100
18109
|
["functions.isaacAPIClass"] = function(...)
|
|
@@ -32438,7 +32447,6 @@ local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
|
32438
32447
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
32439
32448
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
32440
32449
|
local __TS__StringIncludes = ____lualib.__TS__StringIncludes
|
|
32441
|
-
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
32442
32450
|
local __TS__ArrayIncludes = ____lualib.__TS__ArrayIncludes
|
|
32443
32451
|
local ____exports = {}
|
|
32444
32452
|
local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
|
|
@@ -32450,7 +32458,6 @@ local DownpourRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.DownpourRoomSub
|
|
|
32450
32458
|
local DungeonSubType = ____isaac_2Dtypescript_2Ddefinitions.DungeonSubType
|
|
32451
32459
|
local GridRoom = ____isaac_2Dtypescript_2Ddefinitions.GridRoom
|
|
32452
32460
|
local HomeRoomSubType = ____isaac_2Dtypescript_2Ddefinitions.HomeRoomSubType
|
|
32453
|
-
local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
|
|
32454
32461
|
local RoomDescriptorFlag = ____isaac_2Dtypescript_2Ddefinitions.RoomDescriptorFlag
|
|
32455
32462
|
local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
|
|
32456
32463
|
local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
|
|
@@ -32476,7 +32483,6 @@ local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
|
|
|
32476
32483
|
local openDoorFast = ____doors.openDoorFast
|
|
32477
32484
|
local ____entities = require("functions.entities")
|
|
32478
32485
|
local getEntities = ____entities.getEntities
|
|
32479
|
-
local isActiveEnemy = ____entities.isActiveEnemy
|
|
32480
32486
|
local ____flag = require("functions.flag")
|
|
32481
32487
|
local hasFlag = ____flag.hasFlag
|
|
32482
32488
|
local ____positionVelocity = require("functions.positionVelocity")
|
|
@@ -33050,38 +33056,6 @@ function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes, includeSecretRoom
|
|
|
33050
33056
|
function(____, roomDescriptor) return roomDescriptor.Clear end
|
|
33051
33057
|
)
|
|
33052
33058
|
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
33059
|
--- Helper function to detect if a room type is a Secret Room, a Super Secret Room, or an Ultra
|
|
33086
33060
|
-- Secret Room.
|
|
33087
33061
|
function ____exports.isSecretRoomType(self, roomType)
|
|
@@ -33118,12 +33092,12 @@ function ____exports.setRoomCleared(self)
|
|
|
33118
33092
|
for ____, door in ipairs(getDoors(nil)) do
|
|
33119
33093
|
do
|
|
33120
33094
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
33121
|
-
goto
|
|
33095
|
+
goto __continue86
|
|
33122
33096
|
end
|
|
33123
33097
|
openDoorFast(nil, door)
|
|
33124
33098
|
door.ExtraVisible = false
|
|
33125
33099
|
end
|
|
33126
|
-
::
|
|
33100
|
+
::__continue86::
|
|
33127
33101
|
end
|
|
33128
33102
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
33129
33103
|
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
|
*
|
package/src/functions/string.ts
CHANGED
|
@@ -230,3 +230,15 @@ export function trimSuffix(string: string, prefix: string): string {
|
|
|
230
230
|
const endCharacter = string.length - prefix.length;
|
|
231
231
|
return string.slice(0, endCharacter);
|
|
232
232
|
}
|
|
233
|
+
|
|
234
|
+
export function uncapitalizeFirstLetter(string: string): string {
|
|
235
|
+
if (string === "") {
|
|
236
|
+
return string;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const firstCharacter = string.charAt(0);
|
|
240
|
+
const uncapitalizedFirstLetter = firstCharacter.toLowerCase();
|
|
241
|
+
const restOfString = string.slice(1);
|
|
242
|
+
|
|
243
|
+
return `${uncapitalizedFirstLetter}${restOfString}`;
|
|
244
|
+
}
|