isaacscript-common 2.0.15 → 2.0.16
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.
|
@@ -160,6 +160,13 @@ export declare function getPlayersOfType(...characters: PlayerType[]): EntityPla
|
|
|
160
160
|
* check for. It only returns the players that have all of the collectibles.
|
|
161
161
|
*/
|
|
162
162
|
export declare function getPlayersWithCollectible(...collectibleTypes: CollectibleType[]): EntityPlayer[];
|
|
163
|
+
/**
|
|
164
|
+
* Helper function to get only the players that have a certain trinket.
|
|
165
|
+
*
|
|
166
|
+
* This function is variadic, meaning that you can supply as many trinket types as you want to check
|
|
167
|
+
* for. It only returns the players that have all of the trinkets.
|
|
168
|
+
*/
|
|
169
|
+
export declare function getPlayersWithTrinket(...trinketTypes: TrinketType[]): EntityPlayer[];
|
|
163
170
|
/**
|
|
164
171
|
* Helper function to determine how many heart containers that Tainted Magdalene has that will not
|
|
165
172
|
* be automatically depleted over time. By default, this is 2, but this function will return 4 so
|
|
@@ -398,6 +398,17 @@ function ____exports.getPlayersWithCollectible(self, ...)
|
|
|
398
398
|
) end
|
|
399
399
|
)
|
|
400
400
|
end
|
|
401
|
+
function ____exports.getPlayersWithTrinket(self, ...)
|
|
402
|
+
local trinketTypes = {...}
|
|
403
|
+
local players = getPlayers(nil)
|
|
404
|
+
return __TS__ArrayFilter(
|
|
405
|
+
players,
|
|
406
|
+
function(____, player) return __TS__ArrayEvery(
|
|
407
|
+
trinketTypes,
|
|
408
|
+
function(____, trinketType) return player:HasTrinket(trinketType) end
|
|
409
|
+
) end
|
|
410
|
+
)
|
|
411
|
+
end
|
|
401
412
|
function ____exports.getTaintedMagdaleneNonTemporaryMaxHearts(self, player)
|
|
402
413
|
local maxHearts = player:GetMaxHearts()
|
|
403
414
|
local hasBirthright = player:HasCollectible(CollectibleType.BIRTHRIGHT)
|
|
@@ -516,9 +527,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
516
527
|
itemPool:RemoveCollectible(collectibleType)
|
|
517
528
|
end
|
|
518
529
|
repeat
|
|
519
|
-
local
|
|
520
|
-
local
|
|
521
|
-
if
|
|
530
|
+
local ____switch113 = activeSlot
|
|
531
|
+
local ____cond113 = ____switch113 == ActiveSlot.PRIMARY
|
|
532
|
+
if ____cond113 then
|
|
522
533
|
do
|
|
523
534
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
524
535
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -527,8 +538,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
527
538
|
break
|
|
528
539
|
end
|
|
529
540
|
end
|
|
530
|
-
|
|
531
|
-
if
|
|
541
|
+
____cond113 = ____cond113 or ____switch113 == ActiveSlot.SECONDARY
|
|
542
|
+
if ____cond113 then
|
|
532
543
|
do
|
|
533
544
|
if primaryCollectibleType ~= CollectibleType.NULL then
|
|
534
545
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -543,16 +554,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
543
554
|
break
|
|
544
555
|
end
|
|
545
556
|
end
|
|
546
|
-
|
|
547
|
-
if
|
|
557
|
+
____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET
|
|
558
|
+
if ____cond113 then
|
|
548
559
|
do
|
|
549
560
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
550
561
|
player:SetActiveCharge(charge, activeSlot)
|
|
551
562
|
break
|
|
552
563
|
end
|
|
553
564
|
end
|
|
554
|
-
|
|
555
|
-
if
|
|
565
|
+
____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET_SINGLE_USE
|
|
566
|
+
if ____cond113 then
|
|
556
567
|
do
|
|
557
568
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
558
569
|
break
|