isaacscript-common 33.11.0 → 33.12.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
CHANGED
|
@@ -7572,6 +7572,16 @@ export declare function hasPiercing(player: EntityPlayer): boolean;
|
|
|
7572
7572
|
*/
|
|
7573
7573
|
export declare function hasSpectral(player: EntityPlayer): boolean;
|
|
7574
7574
|
|
|
7575
|
+
/**
|
|
7576
|
+
* Helper function to check to see if a player has one or more trinkets.
|
|
7577
|
+
*
|
|
7578
|
+
* This function is variadic, meaning that you can supply as many trinket types as you want to check
|
|
7579
|
+
* for. Returns true if the player has any of the supplied trinket types.
|
|
7580
|
+
*
|
|
7581
|
+
* This function always passes `false` to the `ignoreModifiers` argument.
|
|
7582
|
+
*/
|
|
7583
|
+
export declare function hasTrinket(player: EntityPlayer, ...trinketTypes: TrinketType[]): boolean;
|
|
7584
|
+
|
|
7575
7585
|
/**
|
|
7576
7586
|
* Helper function to check if the current room has one or more open door slots that can be used to
|
|
7577
7587
|
* make custom doors.
|
|
@@ -14786,8 +14796,8 @@ export declare function removeAllPlayerHealth(player: EntityPlayer): void;
|
|
|
14786
14796
|
/**
|
|
14787
14797
|
* Helper function to remove all of the held trinkets from a player.
|
|
14788
14798
|
*
|
|
14789
|
-
* This will not remove any smelted trinkets, unless the player happens to be holding a trinket
|
|
14790
|
-
* they
|
|
14799
|
+
* This will not remove any smelted trinkets, unless the player happens to also be holding a trinket
|
|
14800
|
+
* that they have smelted. (In that case, both the held and the smelted trinket will be removed.)
|
|
14791
14801
|
*/
|
|
14792
14802
|
export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
|
|
14793
14803
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 33.
|
|
3
|
+
isaacscript-common 33.12.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -22161,6 +22161,13 @@ end
|
|
|
22161
22161
|
function ____exports.hasSpectral(self, player)
|
|
22162
22162
|
return hasFlag(nil, player.TearFlags, TearFlag.SPECTRAL)
|
|
22163
22163
|
end
|
|
22164
|
+
function ____exports.hasTrinket(self, player, ...)
|
|
22165
|
+
local trinketTypes = {...}
|
|
22166
|
+
return __TS__ArraySome(
|
|
22167
|
+
trinketTypes,
|
|
22168
|
+
function(____, trinketType) return player:HasTrinket(trinketType) end
|
|
22169
|
+
)
|
|
22170
|
+
end
|
|
22164
22171
|
function ____exports.isActiveSlotEmpty(self, player, activeSlot)
|
|
22165
22172
|
if activeSlot == nil then
|
|
22166
22173
|
activeSlot = ActiveSlot.PRIMARY
|
|
@@ -22227,7 +22234,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22227
22234
|
do
|
|
22228
22235
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
22229
22236
|
if collectibleType == CollectibleType.NULL then
|
|
22230
|
-
goto
|
|
22237
|
+
goto __continue98
|
|
22231
22238
|
end
|
|
22232
22239
|
local stillHasCollectible
|
|
22233
22240
|
repeat
|
|
@@ -22237,7 +22244,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
22237
22244
|
end
|
|
22238
22245
|
until not stillHasCollectible
|
|
22239
22246
|
end
|
|
22240
|
-
::
|
|
22247
|
+
::__continue98::
|
|
22241
22248
|
end
|
|
22242
22249
|
end
|
|
22243
22250
|
function ____exports.removeAllPlayerTrinkets(self, player)
|
|
@@ -22245,17 +22252,17 @@ function ____exports.removeAllPlayerTrinkets(self, player)
|
|
|
22245
22252
|
do
|
|
22246
22253
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
22247
22254
|
if trinketType == TrinketType.NULL then
|
|
22248
|
-
goto
|
|
22255
|
+
goto __continue103
|
|
22249
22256
|
end
|
|
22250
|
-
local
|
|
22257
|
+
local alreadyHasTrinket
|
|
22251
22258
|
repeat
|
|
22252
22259
|
do
|
|
22253
22260
|
player:TryRemoveTrinket(trinketType)
|
|
22254
|
-
|
|
22261
|
+
alreadyHasTrinket = player:HasTrinket(trinketType)
|
|
22255
22262
|
end
|
|
22256
|
-
until not
|
|
22263
|
+
until not alreadyHasTrinket
|
|
22257
22264
|
end
|
|
22258
|
-
::
|
|
22265
|
+
::__continue103::
|
|
22259
22266
|
end
|
|
22260
22267
|
end
|
|
22261
22268
|
function ____exports.removeCollectible(self, player, ...)
|
|
@@ -22315,9 +22322,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22315
22322
|
itemPool:RemoveCollectible(collectibleType)
|
|
22316
22323
|
end
|
|
22317
22324
|
repeat
|
|
22318
|
-
local
|
|
22319
|
-
local
|
|
22320
|
-
if
|
|
22325
|
+
local ____switch125 = activeSlot
|
|
22326
|
+
local ____cond125 = ____switch125 == ActiveSlot.PRIMARY
|
|
22327
|
+
if ____cond125 then
|
|
22321
22328
|
do
|
|
22322
22329
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22323
22330
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22326,8 +22333,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22326
22333
|
break
|
|
22327
22334
|
end
|
|
22328
22335
|
end
|
|
22329
|
-
|
|
22330
|
-
if
|
|
22336
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.SECONDARY
|
|
22337
|
+
if ____cond125 then
|
|
22331
22338
|
do
|
|
22332
22339
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
22333
22340
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -22342,16 +22349,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
22342
22349
|
break
|
|
22343
22350
|
end
|
|
22344
22351
|
end
|
|
22345
|
-
|
|
22346
|
-
if
|
|
22352
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET
|
|
22353
|
+
if ____cond125 then
|
|
22347
22354
|
do
|
|
22348
22355
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22349
22356
|
player:SetActiveCharge(charge, activeSlot)
|
|
22350
22357
|
break
|
|
22351
22358
|
end
|
|
22352
22359
|
end
|
|
22353
|
-
|
|
22354
|
-
if
|
|
22360
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET_SINGLE_USE
|
|
22361
|
+
if ____cond125 then
|
|
22355
22362
|
do
|
|
22356
22363
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
22357
22364
|
break
|
|
@@ -229,6 +229,15 @@ export declare function hasPiercing(player: EntityPlayer): boolean;
|
|
|
229
229
|
* Under the hood, this checks the `EntityPlayer.TearFlags` variable.
|
|
230
230
|
*/
|
|
231
231
|
export declare function hasSpectral(player: EntityPlayer): boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Helper function to check to see if a player has one or more trinkets.
|
|
234
|
+
*
|
|
235
|
+
* This function is variadic, meaning that you can supply as many trinket types as you want to check
|
|
236
|
+
* for. Returns true if the player has any of the supplied trinket types.
|
|
237
|
+
*
|
|
238
|
+
* This function always passes `false` to the `ignoreModifiers` argument.
|
|
239
|
+
*/
|
|
240
|
+
export declare function hasTrinket(player: EntityPlayer, ...trinketTypes: TrinketType[]): boolean;
|
|
232
241
|
/**
|
|
233
242
|
* Helper function to check if the active slot of a particular player is empty.
|
|
234
243
|
*
|
|
@@ -293,8 +302,8 @@ export declare function removeAllActiveItems(player: EntityPlayer): void;
|
|
|
293
302
|
/**
|
|
294
303
|
* Helper function to remove all of the held trinkets from a player.
|
|
295
304
|
*
|
|
296
|
-
* This will not remove any smelted trinkets, unless the player happens to be holding a trinket
|
|
297
|
-
* they
|
|
305
|
+
* This will not remove any smelted trinkets, unless the player happens to also be holding a trinket
|
|
306
|
+
* that they have smelted. (In that case, both the held and the smelted trinket will be removed.)
|
|
298
307
|
*/
|
|
299
308
|
export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
|
|
300
309
|
/**
|
|
@@ -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,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAMT;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,WAAW,EACxB,eAAe,CAAC,EAAE,OAAO,GACxB,OAAO,CAMT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAG9C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAKxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAWzD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,EAAE,CAKd;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,YAAY,G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GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,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"}
|
|
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,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,EAChC,eAAe,CAAC,EAAE,OAAO,GACxB,OAA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a,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
|
|
@@ -481,6 +481,19 @@ end
|
|
|
481
481
|
function ____exports.hasSpectral(self, player)
|
|
482
482
|
return hasFlag(nil, player.TearFlags, TearFlag.SPECTRAL)
|
|
483
483
|
end
|
|
484
|
+
--- Helper function to check to see if a player has one or more trinkets.
|
|
485
|
+
--
|
|
486
|
+
-- This function is variadic, meaning that you can supply as many trinket types as you want to check
|
|
487
|
+
-- for. Returns true if the player has any of the supplied trinket types.
|
|
488
|
+
--
|
|
489
|
+
-- This function always passes `false` to the `ignoreModifiers` argument.
|
|
490
|
+
function ____exports.hasTrinket(self, player, ...)
|
|
491
|
+
local trinketTypes = {...}
|
|
492
|
+
return __TS__ArraySome(
|
|
493
|
+
trinketTypes,
|
|
494
|
+
function(____, trinketType) return player:HasTrinket(trinketType) end
|
|
495
|
+
)
|
|
496
|
+
end
|
|
484
497
|
--- Helper function to check if the active slot of a particular player is empty.
|
|
485
498
|
--
|
|
486
499
|
-- @param player The player to check.
|
|
@@ -571,7 +584,7 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
571
584
|
do
|
|
572
585
|
local collectibleType = player:GetActiveItem(activeSlot)
|
|
573
586
|
if collectibleType == CollectibleType.NULL then
|
|
574
|
-
goto
|
|
587
|
+
goto __continue98
|
|
575
588
|
end
|
|
576
589
|
local stillHasCollectible
|
|
577
590
|
repeat
|
|
@@ -581,29 +594,29 @@ function ____exports.removeAllActiveItems(self, player)
|
|
|
581
594
|
end
|
|
582
595
|
until not stillHasCollectible
|
|
583
596
|
end
|
|
584
|
-
::
|
|
597
|
+
::__continue98::
|
|
585
598
|
end
|
|
586
599
|
end
|
|
587
600
|
--- Helper function to remove all of the held trinkets from a player.
|
|
588
601
|
--
|
|
589
|
-
-- This will not remove any smelted trinkets, unless the player happens to be holding a trinket
|
|
590
|
-
-- they
|
|
602
|
+
-- This will not remove any smelted trinkets, unless the player happens to also be holding a trinket
|
|
603
|
+
-- that they have smelted. (In that case, both the held and the smelted trinket will be removed.)
|
|
591
604
|
function ____exports.removeAllPlayerTrinkets(self, player)
|
|
592
605
|
for ____, trinketSlot in ipairs(TRINKET_SLOT_VALUES) do
|
|
593
606
|
do
|
|
594
607
|
local trinketType = player:GetTrinket(trinketSlot)
|
|
595
608
|
if trinketType == TrinketType.NULL then
|
|
596
|
-
goto
|
|
609
|
+
goto __continue103
|
|
597
610
|
end
|
|
598
|
-
local
|
|
611
|
+
local alreadyHasTrinket
|
|
599
612
|
repeat
|
|
600
613
|
do
|
|
601
614
|
player:TryRemoveTrinket(trinketType)
|
|
602
|
-
|
|
615
|
+
alreadyHasTrinket = player:HasTrinket(trinketType)
|
|
603
616
|
end
|
|
604
|
-
until not
|
|
617
|
+
until not alreadyHasTrinket
|
|
605
618
|
end
|
|
606
|
-
::
|
|
619
|
+
::__continue103::
|
|
607
620
|
end
|
|
608
621
|
end
|
|
609
622
|
--- Helper function to remove one or more collectibles to a player.
|
|
@@ -694,9 +707,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
694
707
|
itemPool:RemoveCollectible(collectibleType)
|
|
695
708
|
end
|
|
696
709
|
repeat
|
|
697
|
-
local
|
|
698
|
-
local
|
|
699
|
-
if
|
|
710
|
+
local ____switch125 = activeSlot
|
|
711
|
+
local ____cond125 = ____switch125 == ActiveSlot.PRIMARY
|
|
712
|
+
if ____cond125 then
|
|
700
713
|
do
|
|
701
714
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
702
715
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -705,8 +718,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
705
718
|
break
|
|
706
719
|
end
|
|
707
720
|
end
|
|
708
|
-
|
|
709
|
-
if
|
|
721
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.SECONDARY
|
|
722
|
+
if ____cond125 then
|
|
710
723
|
do
|
|
711
724
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
712
725
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -721,16 +734,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
721
734
|
break
|
|
722
735
|
end
|
|
723
736
|
end
|
|
724
|
-
|
|
725
|
-
if
|
|
737
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET
|
|
738
|
+
if ____cond125 then
|
|
726
739
|
do
|
|
727
740
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
728
741
|
player:SetActiveCharge(charge, activeSlot)
|
|
729
742
|
break
|
|
730
743
|
end
|
|
731
744
|
end
|
|
732
|
-
|
|
733
|
-
if
|
|
745
|
+
____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET_SINGLE_USE
|
|
746
|
+
if ____cond125 then
|
|
734
747
|
do
|
|
735
748
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
736
749
|
break
|
package/package.json
CHANGED
package/src/functions/players.ts
CHANGED
|
@@ -599,6 +599,21 @@ export function hasSpectral(player: EntityPlayer): boolean {
|
|
|
599
599
|
return hasFlag(player.TearFlags, TearFlag.SPECTRAL);
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
+
/**
|
|
603
|
+
* Helper function to check to see if a player has one or more trinkets.
|
|
604
|
+
*
|
|
605
|
+
* This function is variadic, meaning that you can supply as many trinket types as you want to check
|
|
606
|
+
* for. Returns true if the player has any of the supplied trinket types.
|
|
607
|
+
*
|
|
608
|
+
* This function always passes `false` to the `ignoreModifiers` argument.
|
|
609
|
+
*/
|
|
610
|
+
export function hasTrinket(
|
|
611
|
+
player: EntityPlayer,
|
|
612
|
+
...trinketTypes: TrinketType[]
|
|
613
|
+
): boolean {
|
|
614
|
+
return trinketTypes.some((trinketType) => player.HasTrinket(trinketType));
|
|
615
|
+
}
|
|
616
|
+
|
|
602
617
|
/**
|
|
603
618
|
* Helper function to check if the active slot of a particular player is empty.
|
|
604
619
|
*
|
|
@@ -760,8 +775,8 @@ export function removeAllActiveItems(player: EntityPlayer): void {
|
|
|
760
775
|
/**
|
|
761
776
|
* Helper function to remove all of the held trinkets from a player.
|
|
762
777
|
*
|
|
763
|
-
* This will not remove any smelted trinkets, unless the player happens to be holding a trinket
|
|
764
|
-
* they
|
|
778
|
+
* This will not remove any smelted trinkets, unless the player happens to also be holding a trinket
|
|
779
|
+
* that they have smelted. (In that case, both the held and the smelted trinket will be removed.)
|
|
765
780
|
*/
|
|
766
781
|
export function removeAllPlayerTrinkets(player: EntityPlayer): void {
|
|
767
782
|
for (const trinketSlot of TRINKET_SLOT_VALUES) {
|
|
@@ -770,11 +785,11 @@ export function removeAllPlayerTrinkets(player: EntityPlayer): void {
|
|
|
770
785
|
continue;
|
|
771
786
|
}
|
|
772
787
|
|
|
773
|
-
let
|
|
788
|
+
let alreadyHasTrinket: boolean;
|
|
774
789
|
do {
|
|
775
790
|
player.TryRemoveTrinket(trinketType);
|
|
776
|
-
|
|
777
|
-
} while (
|
|
791
|
+
alreadyHasTrinket = player.HasTrinket(trinketType);
|
|
792
|
+
} while (alreadyHasTrinket);
|
|
778
793
|
}
|
|
779
794
|
}
|
|
780
795
|
|