isaacscript-common 16.0.0 → 16.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/index.d.ts CHANGED
@@ -12271,6 +12271,15 @@ export declare function removeCharactersBefore(string: string, substring: string
12271
12271
  */
12272
12272
  export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
12273
12273
 
12274
+ /**
12275
+ * Helper function to remove one or more collectibles from all players. If any player has more than
12276
+ * one copy of the item, then all copies of it will be removed.
12277
+ *
12278
+ * This function is variadic, meaning that you can specify as many collectibles as you want to
12279
+ * remove.
12280
+ */
12281
+ export declare function removeCollectibleFromAllPlayers(...collectibleTypes: CollectibleType[]): void;
12282
+
12274
12283
  /**
12275
12284
  * Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
12276
12285
  * should remove an item.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 16.0.0
3
+ isaacscript-common 16.1.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -21767,6 +21767,16 @@ function ____exports.removeCollectibleCostume(self, player, collectibleType)
21767
21767
  end
21768
21768
  player:RemoveCostume(itemConfigItem)
21769
21769
  end
21770
+ function ____exports.removeCollectibleFromAllPlayers(self, ...)
21771
+ local collectibleTypes = {...}
21772
+ for ____, player in ipairs(getAllPlayers(nil)) do
21773
+ for ____, collectibleType in ipairs(collectibleTypes) do
21774
+ while player:HasCollectible(collectibleType, true) do
21775
+ player:RemoveCollectible(collectibleType)
21776
+ end
21777
+ end
21778
+ end
21779
+ end
21770
21780
  function ____exports.removeDeadEyeMultiplier(self, player)
21771
21781
  ____repeat(
21772
21782
  nil,
@@ -21801,9 +21811,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
21801
21811
  itemPool:RemoveCollectible(collectibleType)
21802
21812
  end
21803
21813
  repeat
21804
- local ____switch107 = activeSlot
21805
- local ____cond107 = ____switch107 == ActiveSlot.PRIMARY
21806
- if ____cond107 then
21814
+ local ____switch113 = activeSlot
21815
+ local ____cond113 = ____switch113 == ActiveSlot.PRIMARY
21816
+ if ____cond113 then
21807
21817
  do
21808
21818
  if primaryCollectibleType ~= CollectibleType.NULL then
21809
21819
  player:RemoveCollectible(primaryCollectibleType)
@@ -21812,8 +21822,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
21812
21822
  break
21813
21823
  end
21814
21824
  end
21815
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.SECONDARY
21816
- if ____cond107 then
21825
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.SECONDARY
21826
+ if ____cond113 then
21817
21827
  do
21818
21828
  if primaryCollectibleType ~= CollectibleType.NULL then
21819
21829
  player:RemoveCollectible(primaryCollectibleType)
@@ -21828,16 +21838,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
21828
21838
  break
21829
21839
  end
21830
21840
  end
21831
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET
21832
- if ____cond107 then
21841
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET
21842
+ if ____cond113 then
21833
21843
  do
21834
21844
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
21835
21845
  player:SetActiveCharge(charge, activeSlot)
21836
21846
  break
21837
21847
  end
21838
21848
  end
21839
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET_SINGLE_USE
21840
- if ____cond107 then
21849
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET_SINGLE_USE
21850
+ if ____cond113 then
21841
21851
  do
21842
21852
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
21843
21853
  break
@@ -238,6 +238,14 @@ export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
238
238
  * having to request the collectible from the item config.
239
239
  */
240
240
  export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
241
+ /**
242
+ * Helper function to remove one or more collectibles from all players. If any player has more than
243
+ * one copy of the item, then all copies of it will be removed.
244
+ *
245
+ * This function is variadic, meaning that you can specify as many collectibles as you want to
246
+ * remove.
247
+ */
248
+ export declare function removeCollectibleFromAllPlayers(...collectibleTypes: CollectibleType[]): void;
241
249
  /**
242
250
  * Helper function to remove the Dead Eye multiplier from a player.
243
251
  *
@@ -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,EAGf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AActC,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,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,GAAG,SAAS,CAMxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,YAAY,GAAG,KAAK,GACvC,KAAK,CAMP;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,IAAI,UAAU,EAAE,CAG5C;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAiB/D;AAED;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Y,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,OAAO,CAIT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,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"}
@@ -540,6 +540,21 @@ function ____exports.removeCollectibleCostume(self, player, collectibleType)
540
540
  end
541
541
  player:RemoveCostume(itemConfigItem)
542
542
  end
543
+ --- Helper function to remove one or more collectibles from all players. If any player has more than
544
+ -- one copy of the item, then all copies of it will be removed.
545
+ --
546
+ -- This function is variadic, meaning that you can specify as many collectibles as you want to
547
+ -- remove.
548
+ function ____exports.removeCollectibleFromAllPlayers(self, ...)
549
+ local collectibleTypes = {...}
550
+ for ____, player in ipairs(getAllPlayers(nil)) do
551
+ for ____, collectibleType in ipairs(collectibleTypes) do
552
+ while player:HasCollectible(collectibleType, true) do
553
+ player:RemoveCollectible(collectibleType)
554
+ end
555
+ end
556
+ end
557
+ end
543
558
  --- Helper function to remove the Dead Eye multiplier from a player.
544
559
  --
545
560
  -- Note that each time the `EntityPlayer.ClearDeadEyeCharge` method is called, it only has a chance
@@ -594,9 +609,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
594
609
  itemPool:RemoveCollectible(collectibleType)
595
610
  end
596
611
  repeat
597
- local ____switch107 = activeSlot
598
- local ____cond107 = ____switch107 == ActiveSlot.PRIMARY
599
- if ____cond107 then
612
+ local ____switch113 = activeSlot
613
+ local ____cond113 = ____switch113 == ActiveSlot.PRIMARY
614
+ if ____cond113 then
600
615
  do
601
616
  if primaryCollectibleType ~= CollectibleType.NULL then
602
617
  player:RemoveCollectible(primaryCollectibleType)
@@ -605,8 +620,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
605
620
  break
606
621
  end
607
622
  end
608
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.SECONDARY
609
- if ____cond107 then
623
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.SECONDARY
624
+ if ____cond113 then
610
625
  do
611
626
  if primaryCollectibleType ~= CollectibleType.NULL then
612
627
  player:RemoveCollectible(primaryCollectibleType)
@@ -621,16 +636,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
621
636
  break
622
637
  end
623
638
  end
624
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET
625
- if ____cond107 then
639
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET
640
+ if ____cond113 then
626
641
  do
627
642
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
628
643
  player:SetActiveCharge(charge, activeSlot)
629
644
  break
630
645
  end
631
646
  end
632
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET_SINGLE_USE
633
- if ____cond107 then
647
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET_SINGLE_USE
648
+ if ____cond113 then
634
649
  do
635
650
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
636
651
  break
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "16.0.0",
3
+ "version": "16.1.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -677,6 +677,25 @@ export function removeCollectibleCostume(
677
677
  player.RemoveCostume(itemConfigItem);
678
678
  }
679
679
 
680
+ /**
681
+ * Helper function to remove one or more collectibles from all players. If any player has more than
682
+ * one copy of the item, then all copies of it will be removed.
683
+ *
684
+ * This function is variadic, meaning that you can specify as many collectibles as you want to
685
+ * remove.
686
+ */
687
+ export function removeCollectibleFromAllPlayers(
688
+ ...collectibleTypes: CollectibleType[]
689
+ ): void {
690
+ for (const player of getAllPlayers()) {
691
+ for (const collectibleType of collectibleTypes) {
692
+ while (player.HasCollectible(collectibleType, true)) {
693
+ player.RemoveCollectible(collectibleType);
694
+ }
695
+ }
696
+ }
697
+ }
698
+
680
699
  /**
681
700
  * Helper function to remove the Dead Eye multiplier from a player.
682
701
  *