isaacscript-common 33.1.0 → 33.3.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 +36 -0
- package/dist/isaacscript-common.lua +33 -16
- package/dist/src/functions/playerHealth.d.ts +8 -0
- package/dist/src/functions/playerHealth.d.ts.map +1 -1
- package/dist/src/functions/playerHealth.lua +4 -0
- package/dist/src/functions/players.d.ts +12 -0
- package/dist/src/functions/players.d.ts.map +1 -1
- package/dist/src/functions/players.lua +28 -13
- package/dist/src/functions/rooms.d.ts +13 -1
- package/dist/src/functions/rooms.d.ts.map +1 -1
- package/dist/src/functions/rooms.lua +16 -2
- package/package.json +1 -1
- package/src/functions/playerHealth.ts +8 -0
- package/src/functions/players.ts +20 -0
- package/src/functions/rooms.ts +22 -0
package/dist/index.rollup.d.ts
CHANGED
|
@@ -7504,6 +7504,20 @@ export declare function hasOpenPocketItemSlot(player: EntityPlayer): boolean;
|
|
|
7504
7504
|
*/
|
|
7505
7505
|
export declare function hasOpenTrinketSlot(player: EntityPlayer): boolean;
|
|
7506
7506
|
|
|
7507
|
+
/**
|
|
7508
|
+
* Helper function to check if a player has piercing tears.
|
|
7509
|
+
*
|
|
7510
|
+
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
7511
|
+
*/
|
|
7512
|
+
export declare function hasPiercing(player: EntityPlayer): boolean;
|
|
7513
|
+
|
|
7514
|
+
/**
|
|
7515
|
+
* Helper function to check if a player has spectral tears.
|
|
7516
|
+
*
|
|
7517
|
+
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
7518
|
+
*/
|
|
7519
|
+
export declare function hasSpectral(player: EntityPlayer): boolean;
|
|
7520
|
+
|
|
7507
7521
|
/**
|
|
7508
7522
|
* Helper function to check if the current room has one or more open door slots that can be used to
|
|
7509
7523
|
* make custom doors.
|
|
@@ -7723,6 +7737,13 @@ export declare function inRange(num: int, start: int, end: int): boolean;
|
|
|
7723
7737
|
*/
|
|
7724
7738
|
export declare function inRectangle(position: Vector, topLeft: Vector, bottomRight: Vector): boolean;
|
|
7725
7739
|
|
|
7740
|
+
/**
|
|
7741
|
+
* Helper function to check if the current room shape matches one of the given room shapes.
|
|
7742
|
+
*
|
|
7743
|
+
* This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
7744
|
+
*/
|
|
7745
|
+
export declare function inRoomShape(...roomShapes: RoomShape[]): boolean;
|
|
7746
|
+
|
|
7726
7747
|
/**
|
|
7727
7748
|
* Helper function to check if the current room matches one of the given room types.
|
|
7728
7749
|
*
|
|
@@ -8717,6 +8738,13 @@ export declare function isRock(variable: unknown): variable is GridEntityRock;
|
|
|
8717
8738
|
*/
|
|
8718
8739
|
export declare function isRoomInsideGrid(roomGridIndex?: int): boolean;
|
|
8719
8740
|
|
|
8741
|
+
/**
|
|
8742
|
+
* Helper function to check if the provided room matches one of the given room shapes.
|
|
8743
|
+
*
|
|
8744
|
+
* This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
8745
|
+
*/
|
|
8746
|
+
export declare function isRoomShape(roomData: RoomConfig, ...roomShapes: RoomShape[]): boolean;
|
|
8747
|
+
|
|
8720
8748
|
/**
|
|
8721
8749
|
* Helper function to see if a given room shape will grant a single charge or a double charge to the
|
|
8722
8750
|
* player's active item(s).
|
|
@@ -13889,8 +13917,16 @@ declare class PlayerCollectibleDetection extends Feature {
|
|
|
13889
13917
|
private checkActiveItemsChanged;
|
|
13890
13918
|
}
|
|
13891
13919
|
|
|
13920
|
+
/**
|
|
13921
|
+
* Helper function to remove all of a player's black hearts and add the corresponding amount of soul
|
|
13922
|
+
* hearts.
|
|
13923
|
+
*/
|
|
13892
13924
|
export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
|
|
13893
13925
|
|
|
13926
|
+
/**
|
|
13927
|
+
* Helper function to remove all of a player's soul hearts and add the corresponding amount of black
|
|
13928
|
+
* hearts.
|
|
13929
|
+
*/
|
|
13894
13930
|
export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
|
|
13895
13931
|
|
|
13896
13932
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 33.
|
|
3
|
+
isaacscript-common 33.3.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -21811,6 +21811,7 @@ local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
|
21811
21811
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
21812
21812
|
local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
21813
21813
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
21814
|
+
local TearFlag = ____isaac_2Dtypescript_2Ddefinitions.TearFlag
|
|
21814
21815
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
21815
21816
|
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
21816
21817
|
local ACTIVE_SLOT_VALUES = ____cachedEnumValues.ACTIVE_SLOT_VALUES
|
|
@@ -21828,6 +21829,8 @@ local getCharacterName = ____characters.getCharacterName
|
|
|
21828
21829
|
local isVanillaCharacter = ____characters.isVanillaCharacter
|
|
21829
21830
|
local ____collectibles = require("src.functions.collectibles")
|
|
21830
21831
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
21832
|
+
local ____flag = require("src.functions.flag")
|
|
21833
|
+
local hasFlag = ____flag.hasFlag
|
|
21831
21834
|
local ____playerIndex = require("src.functions.playerIndex")
|
|
21832
21835
|
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
21833
21836
|
local getPlayerIndexVanilla = ____playerIndex.getPlayerIndexVanilla
|
|
@@ -22132,6 +22135,12 @@ function ____exports.hasOpenActiveItemSlot(self, player)
|
|
|
22132
22135
|
end
|
|
22133
22136
|
return activeItemPrimary == CollectibleType.NULL
|
|
22134
22137
|
end
|
|
22138
|
+
function ____exports.hasPiercing(self, player)
|
|
22139
|
+
return hasFlag(nil, player.TearFlags, TearFlag.PIERCING)
|
|
22140
|
+
end
|
|
22141
|
+
function ____exports.hasSpectral(self, player)
|
|
22142
|
+
return hasFlag(nil, player.TearFlags, TearFlag.SPECTRAL)
|
|
22143
|
+
end
|
|
22135
22144
|
function ____exports.isActiveSlotEmpty(self, player, activeSlot)
|
|
22136
22145
|
if activeSlot == nil then
|
|
22137
22146
|
activeSlot = ActiveSlot.PRIMARY
|
|
@@ -22198,7 +22207,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22198
22207
|
do
|
|
22199
22208
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
22200
22209
|
if collectibleType == CollectibleType.NULL then
|
|
22201
|
-
goto
|
|
22210
|
+
goto __continue96
|
|
22202
22211
|
end
|
|
22203
22212
|
local stillHasCollectible
|
|
22204
22213
|
repeat
|
|
@@ -22208,7 +22217,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22208
22217
|
end
|
|
22209
22218
|
until not stillHasCollectible
|
|
22210
22219
|
end
|
|
22211
|
-
::
|
|
22220
|
+
::__continue96::
|
|
22212
22221
|
end
|
|
22213
22222
|
end
|
|
22214
22223
|
function ____exports.removeAllPlayerTrinkets(self, player)
|
|
@@ -22216,7 +22225,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22216
22225
|
do
|
|
22217
22226
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
22218
22227
|
if trinketType == TrinketType.NULL then
|
|
22219
|
-
goto
|
|
22228
|
+
goto __continue101
|
|
22220
22229
|
end
|
|
22221
22230
|
local hasTrinket
|
|
22222
22231
|
repeat
|
|
@@ -22226,7 +22235,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22226
22235
|
end
|
|
22227
22236
|
until not hasTrinket
|
|
22228
22237
|
end
|
|
22229
|
-
::
|
|
22238
|
+
::__continue101::
|
|
22230
22239
|
end
|
|
22231
22240
|
end
|
|
22232
22241
|
function ____exports.removeCollectible(self, player, ...)
|
|
@@ -22286,9 +22295,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22286
22295
|
itemPool:RemoveCollectible(collectibleType)
|
|
22287
22296
|
end
|
|
22288
22297
|
repeat
|
|
22289
|
-
local
|
|
22290
|
-
local
|
|
22291
|
-
if
|
|
22298
|
+
local ____switch123 = activeSlot
|
|
22299
|
+
local ____cond123 = ____switch123 == ActiveSlot.PRIMARY
|
|
22300
|
+
if ____cond123 then
|
|
22292
22301
|
do
|
|
22293
22302
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22294
22303
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22297,8 +22306,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22297
22306
|
break
|
|
22298
22307
|
end
|
|
22299
22308
|
end
|
|
22300
|
-
|
|
22301
|
-
if
|
|
22309
|
+
____cond123 = ____cond123 or ____switch123 == ActiveSlot.SECONDARY
|
|
22310
|
+
if ____cond123 then
|
|
22302
22311
|
do
|
|
22303
22312
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22304
22313
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22313,16 +22322,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22313
22322
|
break
|
|
22314
22323
|
end
|
|
22315
22324
|
end
|
|
22316
|
-
|
|
22317
|
-
if
|
|
22325
|
+
____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET
|
|
22326
|
+
if ____cond123 then
|
|
22318
22327
|
do
|
|
22319
22328
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22320
22329
|
player:SetActiveCharge(charge, activeSlot)
|
|
22321
22330
|
break
|
|
22322
22331
|
end
|
|
22323
22332
|
end
|
|
22324
|
-
|
|
22325
|
-
if
|
|
22333
|
+
____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET_SINGLE_USE
|
|
22334
|
+
if ____cond123 then
|
|
22326
22335
|
do
|
|
22327
22336
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22328
22337
|
break
|
|
@@ -27677,6 +27686,10 @@ end
|
|
|
27677
27686
|
function ____exports.isMirrorRoom(self, roomData)
|
|
27678
27687
|
return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == asNumber(nil, DownpourRoomSubType.MIRROR)
|
|
27679
27688
|
end
|
|
27689
|
+
function ____exports.isRoomShape(self, roomData, ...)
|
|
27690
|
+
local roomShapes = {...}
|
|
27691
|
+
return __TS__ArrayIncludes(roomShapes, roomData.Shape)
|
|
27692
|
+
end
|
|
27680
27693
|
function ____exports.isRoomType(self, roomData, ...)
|
|
27681
27694
|
local roomTypes = {...}
|
|
27682
27695
|
return __TS__ArrayIncludes(roomTypes, roomData.Type)
|
|
@@ -27813,6 +27826,10 @@ function ____exports.inMirrorRoom(self)
|
|
|
27813
27826
|
local roomData = getRoomData(nil)
|
|
27814
27827
|
return ____exports.isMirrorRoom(nil, roomData)
|
|
27815
27828
|
end
|
|
27829
|
+
function ____exports.inRoomShape(self, ...)
|
|
27830
|
+
local roomData = getRoomData(nil)
|
|
27831
|
+
return ____exports.isRoomShape(nil, roomData, ...)
|
|
27832
|
+
end
|
|
27816
27833
|
function ____exports.inRoomType(self, ...)
|
|
27817
27834
|
local roomData = getRoomData(nil)
|
|
27818
27835
|
return ____exports.isRoomType(nil, roomData, ...)
|
|
@@ -27892,12 +27909,12 @@ function ____exports.setRoomCleared(self)
|
|
|
27892
27909
|
for ____, door in ipairs(getDoors(nil)) do
|
|
27893
27910
|
do
|
|
27894
27911
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
27895
|
-
goto
|
|
27912
|
+
goto __continue78
|
|
27896
27913
|
end
|
|
27897
27914
|
openDoorFast(nil, door)
|
|
27898
27915
|
door.ExtraVisible = false
|
|
27899
27916
|
end
|
|
27900
|
-
::
|
|
27917
|
+
::__continue78::
|
|
27901
27918
|
end
|
|
27902
27919
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
27903
27920
|
game:ShakeScreen(0)
|
|
@@ -104,7 +104,15 @@ export declare function getPlayerSoulHearts(player: EntityPlayer): int;
|
|
|
104
104
|
export declare function getTaintedMagdaleneNonTemporaryMaxHearts(player: EntityPlayer): int;
|
|
105
105
|
/** Returns a `PlayerHealth` object with all zeros. */
|
|
106
106
|
export declare function newPlayerHealth(): PlayerHealth;
|
|
107
|
+
/**
|
|
108
|
+
* Helper function to remove all of a player's black hearts and add the corresponding amount of soul
|
|
109
|
+
* hearts.
|
|
110
|
+
*/
|
|
107
111
|
export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlayer): void;
|
|
112
|
+
/**
|
|
113
|
+
* Helper function to remove all of a player's soul hearts and add the corresponding amount of black
|
|
114
|
+
* hearts.
|
|
115
|
+
*/
|
|
108
116
|
export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
|
|
109
117
|
/**
|
|
110
118
|
* Helper function to see if the player is out of health.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAY9E,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,GAAG,GACb,IAAI,CA+CN;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4B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eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,YAAY,GACzB,IAAI,CAyHN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
1
|
+
{"version":3,"file":"playerHealth.d.ts","sourceRoot":"","sources":["../../../src/functions/playerHealth.ts"],"names":[],"mappings":";;AAQA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,4BAA4B,CAAC;AAY9E,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,GAAG,GACb,IAAI,CA+CN;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMlE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAK1E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAKzE;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAYtE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,CA2ElE;AAED,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,YAAY,EACpB,UAAU,EAAE,UAAU,GACrB,GAAG,CAmDL;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAKzD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,UAAU,CAoDnE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAqCrE;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,GAAG,CAK7D;AAED;;;;;;;;;GASG;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,YAAY,GACnB,GAAG,CAML;AAED,sDAAsD;AACtD,wBAAgB,eAAe,IAAI,YAAY,CAc9C;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,MAAM,EAAE,YAAY,GACnB,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAMjE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAwBhE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,YAAY,GACzB,IAAI,CAyHN;AAED;;;;;;;;;GASG;AACH,wBAAgB,sDAAsD,CACpE,MAAM,EAAE,YAAY,EACpB,YAAY,EAAE,KAAK,GAClB,OAAO,CAyBT"}
|
|
@@ -520,6 +520,8 @@ function ____exports.newPlayerHealth(self)
|
|
|
520
520
|
soulHeartTypes = {}
|
|
521
521
|
}
|
|
522
522
|
end
|
|
523
|
+
--- Helper function to remove all of a player's black hearts and add the corresponding amount of soul
|
|
524
|
+
-- hearts.
|
|
523
525
|
function ____exports.playerConvertBlackHeartsToSoulHearts(self, player)
|
|
524
526
|
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
525
527
|
____exports.removeAllPlayerHealth(nil, player)
|
|
@@ -529,6 +531,8 @@ function ____exports.playerConvertBlackHeartsToSoulHearts(self, player)
|
|
|
529
531
|
)
|
|
530
532
|
____exports.setPlayerHealth(nil, player, playerHealth)
|
|
531
533
|
end
|
|
534
|
+
--- Helper function to remove all of a player's soul hearts and add the corresponding amount of black
|
|
535
|
+
-- hearts.
|
|
532
536
|
function ____exports.playerConvertSoulHeartsToBlackHearts(self, player)
|
|
533
537
|
local playerHealth = ____exports.getPlayerHealth(nil, player)
|
|
534
538
|
____exports.removeAllPlayerHealth(nil, player)
|
|
@@ -217,6 +217,18 @@ export declare function hasLostCurse(player: EntityPlayer): boolean;
|
|
|
217
217
|
* items. (Only Tainted Forgotten can pick up items.)
|
|
218
218
|
*/
|
|
219
219
|
export declare function hasOpenActiveItemSlot(player: EntityPlayer): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Helper function to check if a player has piercing tears.
|
|
222
|
+
*
|
|
223
|
+
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
224
|
+
*/
|
|
225
|
+
export declare function hasPiercing(player: EntityPlayer): boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Helper function to check if a player has spectral tears.
|
|
228
|
+
*
|
|
229
|
+
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
230
|
+
*/
|
|
231
|
+
export declare function hasSpectral(player: EntityPlayer): boolean;
|
|
220
232
|
/**
|
|
221
233
|
* Helper function to check if the active slot of a particular player is empty.
|
|
222
234
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAEf,UAAU,EACV,UAAU,
|
|
1
|
+
{"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAEf,UAAU,EACV,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YA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,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -14,6 +14,7 @@ local ControllerIndex = ____isaac_2Dtypescript_2Ddefinitions.ControllerIndex
|
|
|
14
14
|
local NullItemID = ____isaac_2Dtypescript_2Ddefinitions.NullItemID
|
|
15
15
|
local PlayerForm = ____isaac_2Dtypescript_2Ddefinitions.PlayerForm
|
|
16
16
|
local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
|
|
17
|
+
local TearFlag = ____isaac_2Dtypescript_2Ddefinitions.TearFlag
|
|
17
18
|
local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
18
19
|
local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
|
|
19
20
|
local ACTIVE_SLOT_VALUES = ____cachedEnumValues.ACTIVE_SLOT_VALUES
|
|
@@ -31,6 +32,8 @@ local getCharacterName = ____characters.getCharacterName
|
|
|
31
32
|
local isVanillaCharacter = ____characters.isVanillaCharacter
|
|
32
33
|
local ____collectibles = require("src.functions.collectibles")
|
|
33
34
|
local getCollectibleMaxCharges = ____collectibles.getCollectibleMaxCharges
|
|
35
|
+
local ____flag = require("src.functions.flag")
|
|
36
|
+
local hasFlag = ____flag.hasFlag
|
|
34
37
|
local ____playerIndex = require("src.functions.playerIndex")
|
|
35
38
|
local getAllPlayers = ____playerIndex.getAllPlayers
|
|
36
39
|
local getPlayerIndexVanilla = ____playerIndex.getPlayerIndexVanilla
|
|
@@ -466,6 +469,18 @@ function ____exports.hasOpenActiveItemSlot(self, player)
|
|
|
466
469
|
end
|
|
467
470
|
return activeItemPrimary == CollectibleType.NULL
|
|
468
471
|
end
|
|
472
|
+
--- Helper function to check if a player has piercing tears.
|
|
473
|
+
--
|
|
474
|
+
-- Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
475
|
+
function ____exports.hasPiercing(self, player)
|
|
476
|
+
return hasFlag(nil, player.TearFlags, TearFlag.PIERCING)
|
|
477
|
+
end
|
|
478
|
+
--- Helper function to check if a player has spectral tears.
|
|
479
|
+
--
|
|
480
|
+
-- Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
481
|
+
function ____exports.hasSpectral(self, player)
|
|
482
|
+
return hasFlag(nil, player.TearFlags, TearFlag.SPECTRAL)
|
|
483
|
+
end
|
|
469
484
|
--- Helper function to check if the active slot of a particular player is empty.
|
|
470
485
|
--
|
|
471
486
|
-- @param player The player to check.
|
|
@@ -556,7 +571,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
556
571
|
do
|
|
557
572
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
558
573
|
if collectibleType == CollectibleType.NULL then
|
|
559
|
-
goto
|
|
574
|
+
goto __continue96
|
|
560
575
|
end
|
|
561
576
|
local stillHasCollectible
|
|
562
577
|
repeat
|
|
@@ -566,7 +581,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
566
581
|
end
|
|
567
582
|
until not stillHasCollectible
|
|
568
583
|
end
|
|
569
|
-
::
|
|
584
|
+
::__continue96::
|
|
570
585
|
end
|
|
571
586
|
end
|
|
572
587
|
--- Helper function to remove all of the held trinkets from a player.
|
|
@@ -578,7 +593,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
578
593
|
do
|
|
579
594
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
580
595
|
if trinketType == TrinketType.NULL then
|
|
581
|
-
goto
|
|
596
|
+
goto __continue101
|
|
582
597
|
end
|
|
583
598
|
local hasTrinket
|
|
584
599
|
repeat
|
|
@@ -588,7 +603,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
588
603
|
end
|
|
589
604
|
until not hasTrinket
|
|
590
605
|
end
|
|
591
|
-
::
|
|
606
|
+
::__continue101::
|
|
592
607
|
end
|
|
593
608
|
end
|
|
594
609
|
--- Helper function to remove one or more collectibles to a player.
|
|
@@ -679,9 +694,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
679
694
|
itemPool:RemoveCollectible(collectibleType)
|
|
680
695
|
end
|
|
681
696
|
repeat
|
|
682
|
-
local
|
|
683
|
-
local
|
|
684
|
-
if
|
|
697
|
+
local ____switch123 = activeSlot
|
|
698
|
+
local ____cond123 = ____switch123 == ActiveSlot.PRIMARY
|
|
699
|
+
if ____cond123 then
|
|
685
700
|
do
|
|
686
701
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
687
702
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -690,8 +705,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
690
705
|
break
|
|
691
706
|
end
|
|
692
707
|
end
|
|
693
|
-
|
|
694
|
-
if
|
|
708
|
+
____cond123 = ____cond123 or ____switch123 == ActiveSlot.SECONDARY
|
|
709
|
+
if ____cond123 then
|
|
695
710
|
do
|
|
696
711
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
697
712
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -706,16 +721,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
706
721
|
break
|
|
707
722
|
end
|
|
708
723
|
end
|
|
709
|
-
|
|
710
|
-
if
|
|
724
|
+
____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET
|
|
725
|
+
if ____cond123 then
|
|
711
726
|
do
|
|
712
727
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
713
728
|
player:SetActiveCharge(charge, activeSlot)
|
|
714
729
|
break
|
|
715
730
|
end
|
|
716
731
|
end
|
|
717
|
-
|
|
718
|
-
if
|
|
732
|
+
____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET_SINGLE_USE
|
|
733
|
+
if ____cond123 then
|
|
719
734
|
do
|
|
720
735
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
721
736
|
break
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BackdropType, BossID, ItemPoolType, MinibossID } from "isaac-typescript-definitions";
|
|
2
|
-
import { Dimension, RoomType } from "isaac-typescript-definitions";
|
|
2
|
+
import { Dimension, RoomShape, RoomType } from "isaac-typescript-definitions";
|
|
3
3
|
/**
|
|
4
4
|
* Helper function for quickly switching to a new room without playing a particular animation. Use
|
|
5
5
|
* this helper function over invoking the `Game.ChangeRoom` method directly to ensure that you do
|
|
@@ -167,6 +167,12 @@ export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
|
|
|
167
167
|
* rooms are marked with a specific sub-type.)
|
|
168
168
|
*/
|
|
169
169
|
export declare function inMirrorRoom(): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Helper function to check if the current room shape matches one of the given room shapes.
|
|
172
|
+
*
|
|
173
|
+
* This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
174
|
+
*/
|
|
175
|
+
export declare function inRoomShape(...roomShapes: RoomShape[]): boolean;
|
|
170
176
|
/**
|
|
171
177
|
* Helper function to check if the current room matches one of the given room types.
|
|
172
178
|
*
|
|
@@ -280,6 +286,12 @@ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: Minib
|
|
|
280
286
|
* rooms are marked with a specific sub-type.)
|
|
281
287
|
*/
|
|
282
288
|
export declare function isMirrorRoom(roomData: RoomConfig): boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Helper function to check if the provided room matches one of the given room shapes.
|
|
291
|
+
*
|
|
292
|
+
* This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
293
|
+
*/
|
|
294
|
+
export declare function isRoomShape(roomData: RoomConfig, ...roomShapes: RoomShape[]): boolean;
|
|
283
295
|
/**
|
|
284
296
|
* Helper function to check if the provided room matches one of the given room types.
|
|
285
297
|
*
|
|
@@ -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,EAOT,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,EAA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AgB,eAAe,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEvE;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,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAEpE;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"}
|
|
@@ -213,6 +213,13 @@ end
|
|
|
213
213
|
function ____exports.isMirrorRoom(self, roomData)
|
|
214
214
|
return roomData.Type == RoomType.DEFAULT and (roomData.StageID == StageID.DOWNPOUR or roomData.StageID == StageID.DROSS) and roomData.Subtype == asNumber(nil, DownpourRoomSubType.MIRROR)
|
|
215
215
|
end
|
|
216
|
+
--- Helper function to check if the provided room matches one of the given room shapes.
|
|
217
|
+
--
|
|
218
|
+
-- This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
219
|
+
function ____exports.isRoomShape(self, roomData, ...)
|
|
220
|
+
local roomShapes = {...}
|
|
221
|
+
return __TS__ArrayIncludes(roomShapes, roomData.Shape)
|
|
222
|
+
end
|
|
216
223
|
--- Helper function to check if the provided room matches one of the given room types.
|
|
217
224
|
--
|
|
218
225
|
-- This function is variadic, which means you can pass as many room types as you want to match for.
|
|
@@ -442,6 +449,13 @@ function ____exports.inMirrorRoom(self)
|
|
|
442
449
|
local roomData = getRoomData(nil)
|
|
443
450
|
return ____exports.isMirrorRoom(nil, roomData)
|
|
444
451
|
end
|
|
452
|
+
--- Helper function to check if the current room shape matches one of the given room shapes.
|
|
453
|
+
--
|
|
454
|
+
-- This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
455
|
+
function ____exports.inRoomShape(self, ...)
|
|
456
|
+
local roomData = getRoomData(nil)
|
|
457
|
+
return ____exports.isRoomShape(nil, roomData, ...)
|
|
458
|
+
end
|
|
445
459
|
--- Helper function to check if the current room matches one of the given room types.
|
|
446
460
|
--
|
|
447
461
|
-- This function is variadic, which means you can pass as many room types as you want to match for.
|
|
@@ -557,12 +571,12 @@ function ____exports.setRoomCleared(self)
|
|
|
557
571
|
for ____, door in ipairs(getDoors(nil)) do
|
|
558
572
|
do
|
|
559
573
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
560
|
-
goto
|
|
574
|
+
goto __continue78
|
|
561
575
|
end
|
|
562
576
|
openDoorFast(nil, door)
|
|
563
577
|
door.ExtraVisible = false
|
|
564
578
|
end
|
|
565
|
-
::
|
|
579
|
+
::__continue78::
|
|
566
580
|
end
|
|
567
581
|
sfxManager:Stop(SoundEffect.DOOR_HEAVY_OPEN)
|
|
568
582
|
game:ShakeScreen(0)
|
package/package.json
CHANGED
|
@@ -469,6 +469,10 @@ export function newPlayerHealth(): PlayerHealth {
|
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
471
|
|
|
472
|
+
/**
|
|
473
|
+
* Helper function to remove all of a player's black hearts and add the corresponding amount of soul
|
|
474
|
+
* hearts.
|
|
475
|
+
*/
|
|
472
476
|
export function playerConvertBlackHeartsToSoulHearts(
|
|
473
477
|
player: EntityPlayer,
|
|
474
478
|
): void {
|
|
@@ -481,6 +485,10 @@ export function playerConvertBlackHeartsToSoulHearts(
|
|
|
481
485
|
setPlayerHealth(player, playerHealth);
|
|
482
486
|
}
|
|
483
487
|
|
|
488
|
+
/**
|
|
489
|
+
* Helper function to remove all of a player's soul hearts and add the corresponding amount of black
|
|
490
|
+
* hearts.
|
|
491
|
+
*/
|
|
484
492
|
export function playerConvertSoulHeartsToBlackHearts(
|
|
485
493
|
player: EntityPlayer,
|
|
486
494
|
): void {
|
package/src/functions/players.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
NullItemID,
|
|
7
7
|
PlayerForm,
|
|
8
8
|
PlayerType,
|
|
9
|
+
TearFlag,
|
|
9
10
|
TrinketType,
|
|
10
11
|
} from "isaac-typescript-definitions";
|
|
11
12
|
import {
|
|
@@ -17,6 +18,7 @@ import { ReadonlySet } from "../types/ReadonlySet";
|
|
|
17
18
|
import { getLastElement, sumArray } from "./array";
|
|
18
19
|
import { getCharacterName, isVanillaCharacter } from "./characters";
|
|
19
20
|
import { getCollectibleMaxCharges } from "./collectibles";
|
|
21
|
+
import { hasFlag } from "./flag";
|
|
20
22
|
import {
|
|
21
23
|
getAllPlayers,
|
|
22
24
|
getPlayerIndexVanilla,
|
|
@@ -579,6 +581,24 @@ export function hasOpenActiveItemSlot(player: EntityPlayer): boolean {
|
|
|
579
581
|
return activeItemPrimary === CollectibleType.NULL;
|
|
580
582
|
}
|
|
581
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Helper function to check if a player has piercing tears.
|
|
586
|
+
*
|
|
587
|
+
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
588
|
+
*/
|
|
589
|
+
export function hasPiercing(player: EntityPlayer): boolean {
|
|
590
|
+
return hasFlag(player.TearFlags, TearFlag.PIERCING);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* Helper function to check if a player has spectral tears.
|
|
595
|
+
*
|
|
596
|
+
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
597
|
+
*/
|
|
598
|
+
export function hasSpectral(player: EntityPlayer): boolean {
|
|
599
|
+
return hasFlag(player.TearFlags, TearFlag.SPECTRAL);
|
|
600
|
+
}
|
|
601
|
+
|
|
582
602
|
/**
|
|
583
603
|
* Helper function to check if the active slot of a particular player is empty.
|
|
584
604
|
*
|
package/src/functions/rooms.ts
CHANGED
|
@@ -413,6 +413,16 @@ export function inMirrorRoom(): boolean {
|
|
|
413
413
|
return isMirrorRoom(roomData);
|
|
414
414
|
}
|
|
415
415
|
|
|
416
|
+
/**
|
|
417
|
+
* Helper function to check if the current room shape matches one of the given room shapes.
|
|
418
|
+
*
|
|
419
|
+
* This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
420
|
+
*/
|
|
421
|
+
export function inRoomShape(...roomShapes: RoomShape[]): boolean {
|
|
422
|
+
const roomData = getRoomData();
|
|
423
|
+
return isRoomShape(roomData, ...roomShapes);
|
|
424
|
+
}
|
|
425
|
+
|
|
416
426
|
/**
|
|
417
427
|
* Helper function to check if the current room matches one of the given room types.
|
|
418
428
|
*
|
|
@@ -674,6 +684,18 @@ export function isMirrorRoom(roomData: RoomConfig): boolean {
|
|
|
674
684
|
);
|
|
675
685
|
}
|
|
676
686
|
|
|
687
|
+
/**
|
|
688
|
+
* Helper function to check if the provided room matches one of the given room shapes.
|
|
689
|
+
*
|
|
690
|
+
* This function is variadic, which means you can pass as many room shapes as you want to match for.
|
|
691
|
+
*/
|
|
692
|
+
export function isRoomShape(
|
|
693
|
+
roomData: RoomConfig,
|
|
694
|
+
...roomShapes: RoomShape[]
|
|
695
|
+
): boolean {
|
|
696
|
+
return roomShapes.includes(roomData.Shape);
|
|
697
|
+
}
|
|
698
|
+
|
|
677
699
|
/**
|
|
678
700
|
* Helper function to check if the provided room matches one of the given room types.
|
|
679
701
|
*
|