isaacscript-common 39.5.0 → 39.6.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.
@@ -54,6 +54,7 @@ import type { MinibossID } from 'isaac-typescript-definitions';
54
54
  import { ModCallback } from 'isaac-typescript-definitions';
55
55
  import type { Music } from 'isaac-typescript-definitions';
56
56
  import type { NPCState } from 'isaac-typescript-definitions';
57
+ import { NullItemID } from 'isaac-typescript-definitions';
57
58
  import { PickupPrice } from 'isaac-typescript-definitions';
58
59
  import type { PickupVariant } from 'isaac-typescript-definitions';
59
60
  import { PillColor } from 'isaac-typescript-definitions';
@@ -1018,6 +1019,12 @@ export declare function anyPlayerCloserThan(position: Vector, distance: float):
1018
1019
  */
1019
1020
  export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
1020
1021
 
1022
+ /** Helper function to check to see if any player has a temporary collectible effect. */
1023
+ export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
1024
+
1025
+ /** Helper function to check to see if any player has a temporary null effect. */
1026
+ export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
1027
+
1021
1028
  /**
1022
1029
  * Helper function to check to see if any player has a particular trinket.
1023
1030
  *
@@ -1027,6 +1034,9 @@ export declare function anyPlayerHasCollectible(collectibleType: CollectibleType
1027
1034
  */
1028
1035
  export declare function anyPlayerHasTrinket(trinketType: TrinketType, ignoreModifiers?: boolean): boolean;
1029
1036
 
1037
+ /** Helper function to check to see if any player has a temporary trinket effect. */
1038
+ export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
1039
+
1030
1040
  /**
1031
1041
  * Helper function to check to see if any player is holding up an item (from e.g. an active item
1032
1042
  * activation, a poop from IBS, etc.).
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 39.5.0
3
+ isaacscript-common 39.6.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -21995,6 +21995,26 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType, ignoreModifi
21995
21995
  function(____, player) return player:HasCollectible(collectibleType, ignoreModifiers) end
21996
21996
  )
21997
21997
  end
21998
+ function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
21999
+ local players = getAllPlayers(nil)
22000
+ return __TS__ArraySome(
22001
+ players,
22002
+ function(____, player)
22003
+ local effects = player:GetEffects()
22004
+ return effects:HasCollectibleEffect(collectibleType)
22005
+ end
22006
+ )
22007
+ end
22008
+ function ____exports.anyPlayerHasNullEffect(self, nullItemID)
22009
+ local players = getAllPlayers(nil)
22010
+ return __TS__ArraySome(
22011
+ players,
22012
+ function(____, player)
22013
+ local effects = player:GetEffects()
22014
+ return effects:HasNullEffect(nullItemID)
22015
+ end
22016
+ )
22017
+ end
21998
22018
  function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
21999
22019
  local players = getAllPlayers(nil)
22000
22020
  return __TS__ArraySome(
@@ -22002,6 +22022,16 @@ function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
22002
22022
  function(____, player) return player:HasTrinket(trinketType, ignoreModifiers) end
22003
22023
  )
22004
22024
  end
22025
+ function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
22026
+ local players = getAllPlayers(nil)
22027
+ return __TS__ArraySome(
22028
+ players,
22029
+ function(____, player)
22030
+ local effects = player:GetEffects()
22031
+ return effects:HasTrinketEffect(trinketType)
22032
+ end
22033
+ )
22034
+ end
22005
22035
  function ____exports.anyPlayerHoldingItem(self)
22006
22036
  local players = getAllPlayers(nil)
22007
22037
  return __TS__ArraySome(
@@ -22322,7 +22352,7 @@ function ____exports.removeAllActiveItems(self, player)
22322
22352
  do
22323
22353
  local collectibleType = player:GetActiveItem(activeSlot)
22324
22354
  if collectibleType == CollectibleType.NULL then
22325
- goto __continue98
22355
+ goto __continue104
22326
22356
  end
22327
22357
  local stillHasCollectible
22328
22358
  repeat
@@ -22332,7 +22362,7 @@ function ____exports.removeAllActiveItems(self, player)
22332
22362
  end
22333
22363
  until not stillHasCollectible
22334
22364
  end
22335
- ::__continue98::
22365
+ ::__continue104::
22336
22366
  end
22337
22367
  end
22338
22368
  function ____exports.removeAllPlayerTrinkets(self, player)
@@ -22340,7 +22370,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
22340
22370
  do
22341
22371
  local trinketType = player:GetTrinket(trinketSlot)
22342
22372
  if trinketType == TrinketType.NULL then
22343
- goto __continue103
22373
+ goto __continue109
22344
22374
  end
22345
22375
  local alreadyHasTrinket
22346
22376
  repeat
@@ -22350,7 +22380,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
22350
22380
  end
22351
22381
  until not alreadyHasTrinket
22352
22382
  end
22353
- ::__continue103::
22383
+ ::__continue109::
22354
22384
  end
22355
22385
  end
22356
22386
  function ____exports.removeCollectible(self, player, ...)
@@ -22410,9 +22440,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
22410
22440
  itemPool:RemoveCollectible(collectibleType)
22411
22441
  end
22412
22442
  repeat
22413
- local ____switch125 = activeSlot
22414
- local ____cond125 = ____switch125 == ActiveSlot.PRIMARY
22415
- if ____cond125 then
22443
+ local ____switch131 = activeSlot
22444
+ local ____cond131 = ____switch131 == ActiveSlot.PRIMARY
22445
+ if ____cond131 then
22416
22446
  do
22417
22447
  if primaryCollectibleType ~= CollectibleType.NULL then
22418
22448
  player:RemoveCollectible(primaryCollectibleType)
@@ -22421,8 +22451,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
22421
22451
  break
22422
22452
  end
22423
22453
  end
22424
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.SECONDARY
22425
- if ____cond125 then
22454
+ ____cond131 = ____cond131 or ____switch131 == ActiveSlot.SECONDARY
22455
+ if ____cond131 then
22426
22456
  do
22427
22457
  if primaryCollectibleType ~= CollectibleType.NULL then
22428
22458
  player:RemoveCollectible(primaryCollectibleType)
@@ -22437,16 +22467,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
22437
22467
  break
22438
22468
  end
22439
22469
  end
22440
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET
22441
- if ____cond125 then
22470
+ ____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET
22471
+ if ____cond131 then
22442
22472
  do
22443
22473
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
22444
22474
  player:SetActiveCharge(charge, activeSlot)
22445
22475
  break
22446
22476
  end
22447
22477
  end
22448
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET_SINGLE_USE
22449
- if ____cond125 then
22478
+ ____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET_SINGLE_USE
22479
+ if ____cond131 then
22450
22480
  do
22451
22481
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
22452
22482
  break
@@ -1,4 +1,4 @@
1
- import { ActiveSlot, CollectibleType, ControllerIndex, PlayerForm, PlayerType, TrinketType } from "isaac-typescript-definitions";
1
+ import { ActiveSlot, CollectibleType, ControllerIndex, NullItemID, PlayerForm, PlayerType, TrinketType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function to add one or more collectibles to a player.
4
4
  *
@@ -17,6 +17,10 @@ export declare function addTrinketCostume(player: EntityPlayer, trinketType: Tri
17
17
  * Default is false.
18
18
  */
19
19
  export declare function anyPlayerHasCollectible(collectibleType: CollectibleType, ignoreModifiers?: boolean): boolean;
20
+ /** Helper function to check to see if any player has a temporary collectible effect. */
21
+ export declare function anyPlayerHasCollectibleEffect(collectibleType: CollectibleType): boolean;
22
+ /** Helper function to check to see if any player has a temporary null effect. */
23
+ export declare function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean;
20
24
  /**
21
25
  * Helper function to check to see if any player has a particular trinket.
22
26
  *
@@ -25,6 +29,8 @@ export declare function anyPlayerHasCollectible(collectibleType: CollectibleType
25
29
  * effects granted by other items. Default is false.
26
30
  */
27
31
  export declare function anyPlayerHasTrinket(trinketType: TrinketType, ignoreModifiers?: boolean): boolean;
32
+ /** Helper function to check to see if any player has a temporary trinket effect. */
33
+ export declare function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean;
28
34
  /**
29
35
  * Helper function to check to see if any player is holding up an item (from e.g. an active item
30
36
  * activation, a poop from IBS, etc.).
@@ -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,C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AAE,YAAY,GAAG,IAAI,CAalE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;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"}
1
+ {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EACf,UAAU,EACV,UAAU,EACV,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAmBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,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BAAgB,+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"}
@@ -105,6 +105,28 @@ function ____exports.anyPlayerHasCollectible(self, collectibleType, ignoreModifi
105
105
  function(____, player) return player:HasCollectible(collectibleType, ignoreModifiers) end
106
106
  )
107
107
  end
108
+ --- Helper function to check to see if any player has a temporary collectible effect.
109
+ function ____exports.anyPlayerHasCollectibleEffect(self, collectibleType)
110
+ local players = getAllPlayers(nil)
111
+ return __TS__ArraySome(
112
+ players,
113
+ function(____, player)
114
+ local effects = player:GetEffects()
115
+ return effects:HasCollectibleEffect(collectibleType)
116
+ end
117
+ )
118
+ end
119
+ --- Helper function to check to see if any player has a temporary null effect.
120
+ function ____exports.anyPlayerHasNullEffect(self, nullItemID)
121
+ local players = getAllPlayers(nil)
122
+ return __TS__ArraySome(
123
+ players,
124
+ function(____, player)
125
+ local effects = player:GetEffects()
126
+ return effects:HasNullEffect(nullItemID)
127
+ end
128
+ )
129
+ end
108
130
  --- Helper function to check to see if any player has a particular trinket.
109
131
  --
110
132
  -- @param trinketType The trinket type to check for.
@@ -117,6 +139,17 @@ function ____exports.anyPlayerHasTrinket(self, trinketType, ignoreModifiers)
117
139
  function(____, player) return player:HasTrinket(trinketType, ignoreModifiers) end
118
140
  )
119
141
  end
142
+ --- Helper function to check to see if any player has a temporary trinket effect.
143
+ function ____exports.anyPlayerHasTrinketEffect(self, trinketType)
144
+ local players = getAllPlayers(nil)
145
+ return __TS__ArraySome(
146
+ players,
147
+ function(____, player)
148
+ local effects = player:GetEffects()
149
+ return effects:HasTrinketEffect(trinketType)
150
+ end
151
+ )
152
+ end
120
153
  --- Helper function to check to see if any player is holding up an item (from e.g. an active item
121
154
  -- activation, a poop from IBS, etc.).
122
155
  function ____exports.anyPlayerHoldingItem(self)
@@ -584,7 +617,7 @@ function ____exports.removeAllActiveItems(self, player)
584
617
  do
585
618
  local collectibleType = player:GetActiveItem(activeSlot)
586
619
  if collectibleType == CollectibleType.NULL then
587
- goto __continue98
620
+ goto __continue104
588
621
  end
589
622
  local stillHasCollectible
590
623
  repeat
@@ -594,7 +627,7 @@ function ____exports.removeAllActiveItems(self, player)
594
627
  end
595
628
  until not stillHasCollectible
596
629
  end
597
- ::__continue98::
630
+ ::__continue104::
598
631
  end
599
632
  end
600
633
  --- Helper function to remove all of the held trinkets from a player.
@@ -606,7 +639,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
606
639
  do
607
640
  local trinketType = player:GetTrinket(trinketSlot)
608
641
  if trinketType == TrinketType.NULL then
609
- goto __continue103
642
+ goto __continue109
610
643
  end
611
644
  local alreadyHasTrinket
612
645
  repeat
@@ -616,7 +649,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
616
649
  end
617
650
  until not alreadyHasTrinket
618
651
  end
619
- ::__continue103::
652
+ ::__continue109::
620
653
  end
621
654
  end
622
655
  --- Helper function to remove one or more collectibles to a player.
@@ -707,9 +740,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
707
740
  itemPool:RemoveCollectible(collectibleType)
708
741
  end
709
742
  repeat
710
- local ____switch125 = activeSlot
711
- local ____cond125 = ____switch125 == ActiveSlot.PRIMARY
712
- if ____cond125 then
743
+ local ____switch131 = activeSlot
744
+ local ____cond131 = ____switch131 == ActiveSlot.PRIMARY
745
+ if ____cond131 then
713
746
  do
714
747
  if primaryCollectibleType ~= CollectibleType.NULL then
715
748
  player:RemoveCollectible(primaryCollectibleType)
@@ -718,8 +751,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
718
751
  break
719
752
  end
720
753
  end
721
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.SECONDARY
722
- if ____cond125 then
754
+ ____cond131 = ____cond131 or ____switch131 == ActiveSlot.SECONDARY
755
+ if ____cond131 then
723
756
  do
724
757
  if primaryCollectibleType ~= CollectibleType.NULL then
725
758
  player:RemoveCollectible(primaryCollectibleType)
@@ -734,16 +767,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
734
767
  break
735
768
  end
736
769
  end
737
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET
738
- if ____cond125 then
770
+ ____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET
771
+ if ____cond131 then
739
772
  do
740
773
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
741
774
  player:SetActiveCharge(charge, activeSlot)
742
775
  break
743
776
  end
744
777
  end
745
- ____cond125 = ____cond125 or ____switch125 == ActiveSlot.POCKET_SINGLE_USE
746
- if ____cond125 then
778
+ ____cond131 = ____cond131 or ____switch131 == ActiveSlot.POCKET_SINGLE_USE
779
+ if ____cond131 then
747
780
  do
748
781
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
749
782
  break
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "39.5.0",
3
+ "version": "39.6.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -85,6 +85,28 @@ export function anyPlayerHasCollectible(
85
85
  );
86
86
  }
87
87
 
88
+ /** Helper function to check to see if any player has a temporary collectible effect. */
89
+ export function anyPlayerHasCollectibleEffect(
90
+ collectibleType: CollectibleType,
91
+ ): boolean {
92
+ const players = getAllPlayers();
93
+
94
+ return players.some((player) => {
95
+ const effects = player.GetEffects();
96
+ return effects.HasCollectibleEffect(collectibleType);
97
+ });
98
+ }
99
+
100
+ /** Helper function to check to see if any player has a temporary null effect. */
101
+ export function anyPlayerHasNullEffect(nullItemID: NullItemID): boolean {
102
+ const players = getAllPlayers();
103
+
104
+ return players.some((player) => {
105
+ const effects = player.GetEffects();
106
+ return effects.HasNullEffect(nullItemID);
107
+ });
108
+ }
109
+
88
110
  /**
89
111
  * Helper function to check to see if any player has a particular trinket.
90
112
  *
@@ -103,6 +125,16 @@ export function anyPlayerHasTrinket(
103
125
  );
104
126
  }
105
127
 
128
+ /** Helper function to check to see if any player has a temporary trinket effect. */
129
+ export function anyPlayerHasTrinketEffect(trinketType: TrinketType): boolean {
130
+ const players = getAllPlayers();
131
+
132
+ return players.some((player) => {
133
+ const effects = player.GetEffects();
134
+ return effects.HasTrinketEffect(trinketType);
135
+ });
136
+ }
137
+
106
138
  /**
107
139
  * Helper function to check to see if any player is holding up an item (from e.g. an active item
108
140
  * activation, a poop from IBS, etc.).