isaacscript-common 33.10.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.
@@ -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.
@@ -8600,6 +8610,15 @@ export declare function isMinibossRoomOf(roomData: RoomConfig, minibossID: Minib
8600
8610
  */
8601
8611
  export declare function isMirrorRoom(roomData: RoomConfig): boolean;
8602
8612
 
8613
+ /**
8614
+ * Helper function to check if a tear hit an enemy. A tear is considered to be missed if it hit the
8615
+ * ground, a wall, or a grid entity.
8616
+ *
8617
+ * Under the hood, this function uses the `Entity.IsDead` method to determine this. (Tears will not
8618
+ * die if they hit an enemy, but they will die if they hit a wall or object.)
8619
+ */
8620
+ export declare function isMissedTear(tear: EntityTear): boolean;
8621
+
8603
8622
  /** Returns true for any card or rune added by a mod. */
8604
8623
  export declare function isModdedCardType(cardType: CardType): boolean;
8605
8624
 
@@ -14777,8 +14796,8 @@ export declare function removeAllPlayerHealth(player: EntityPlayer): void;
14777
14796
  /**
14778
14797
  * Helper function to remove all of the held trinkets from a player.
14779
14798
  *
14780
- * This will not remove any smelted trinkets, unless the player happens to be holding a trinket that
14781
- * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
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.)
14782
14801
  */
14783
14802
  export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
14784
14803
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 33.10.0
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 __continue96
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
- ::__continue96::
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 __continue101
22255
+ goto __continue103
22249
22256
  end
22250
- local hasTrinket
22257
+ local alreadyHasTrinket
22251
22258
  repeat
22252
22259
  do
22253
22260
  player:TryRemoveTrinket(trinketType)
22254
- hasTrinket = player:HasTrinket(trinketType)
22261
+ alreadyHasTrinket = player:HasTrinket(trinketType)
22255
22262
  end
22256
- until not hasTrinket
22263
+ until not alreadyHasTrinket
22257
22264
  end
22258
- ::__continue101::
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 ____switch123 = activeSlot
22319
- local ____cond123 = ____switch123 == ActiveSlot.PRIMARY
22320
- if ____cond123 then
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
- ____cond123 = ____cond123 or ____switch123 == ActiveSlot.SECONDARY
22330
- if ____cond123 then
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
- ____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET
22346
- if ____cond123 then
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
- ____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET_SINGLE_USE
22354
- if ____cond123 then
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
@@ -30871,6 +30878,9 @@ function ____exports.addTearsStat(self, player, tearsStat)
30871
30878
  local newMaxFireDelay = ____exports.getFireDelay(nil, newTearsStat)
30872
30879
  player.MaxFireDelay = newMaxFireDelay
30873
30880
  end
30881
+ function ____exports.isMissedTear(self, tear)
30882
+ return tear:IsDead()
30883
+ end
30874
30884
  function ____exports.isTearFromFamiliar(self, tear, familiarVariant, subType)
30875
30885
  if tear.FrameCount == 0 then
30876
30886
  error("Failed to check if the given tear was from a player since the tear's frame count was equal to 0. (The \"isTearFromFamiliar\" function must only be used in the \"POST_TEAR_INIT_VERY_LATE\" callback or on frame 1 and onwards.)")
@@ -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 that
297
- * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
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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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,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,eA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AE,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"}
@@ -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 __continue96
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
- ::__continue96::
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 that
590
- -- they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
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 __continue101
609
+ goto __continue103
597
610
  end
598
- local hasTrinket
611
+ local alreadyHasTrinket
599
612
  repeat
600
613
  do
601
614
  player:TryRemoveTrinket(trinketType)
602
- hasTrinket = player:HasTrinket(trinketType)
615
+ alreadyHasTrinket = player:HasTrinket(trinketType)
603
616
  end
604
- until not hasTrinket
617
+ until not alreadyHasTrinket
605
618
  end
606
- ::__continue101::
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 ____switch123 = activeSlot
698
- local ____cond123 = ____switch123 == ActiveSlot.PRIMARY
699
- if ____cond123 then
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
- ____cond123 = ____cond123 or ____switch123 == ActiveSlot.SECONDARY
709
- if ____cond123 then
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
- ____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET
725
- if ____cond123 then
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
- ____cond123 = ____cond123 or ____switch123 == ActiveSlot.POCKET_SINGLE_USE
733
- if ____cond123 then
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
@@ -31,6 +31,14 @@ export declare function getFireDelay(tearsStat: float): float;
31
31
  * this function.
32
32
  */
33
33
  export declare function getTearsStat(fireDelay: float): float;
34
+ /**
35
+ * Helper function to check if a tear hit an enemy. A tear is considered to be missed if it hit the
36
+ * ground, a wall, or a grid entity.
37
+ *
38
+ * Under the hood, this function uses the `Entity.IsDead` method to determine this. (Tears will not
39
+ * die if they hit an enemy, but they will die if they hit a wall or object.)
40
+ */
41
+ export declare function isMissedTear(tear: EntityTear): boolean;
34
42
  /**
35
43
  * Helper function to check if a given tear is from a familiar (as opposed to e.g. a player). This
36
44
  * is determined by looking at the parent.
@@ -1 +1 @@
1
- {"version":3,"file":"tears.d.ts","sourceRoot":"","sources":["../../../src/functions/tears.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,EAChB,eAAe,CAAC,EAAE,eAAe,EACjC,OAAO,CAAC,EAAE,GAAG,GACZ,OAAO,CAuBT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAgB1D"}
1
+ {"version":3,"file":"tears.d.ts","sourceRoot":"","sources":["../../../src/functions/tears.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,CAKzE;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,KAAK,GAAG,KAAK,CAEpD;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAEtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,UAAU,EAChB,eAAe,CAAC,EAAE,eAAe,EACjC,OAAO,CAAC,EAAE,GAAG,GACZ,OAAO,CAuBT;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAgB1D"}
@@ -34,6 +34,14 @@ function ____exports.addTearsStat(self, player, tearsStat)
34
34
  local newMaxFireDelay = ____exports.getFireDelay(nil, newTearsStat)
35
35
  player.MaxFireDelay = newMaxFireDelay
36
36
  end
37
+ --- Helper function to check if a tear hit an enemy. A tear is considered to be missed if it hit the
38
+ -- ground, a wall, or a grid entity.
39
+ --
40
+ -- Under the hood, this function uses the `Entity.IsDead` method to determine this. (Tears will not
41
+ -- die if they hit an enemy, but they will die if they hit a wall or object.)
42
+ function ____exports.isMissedTear(self, tear)
43
+ return tear:IsDead()
44
+ end
37
45
  --- Helper function to check if a given tear is from a familiar (as opposed to e.g. a player). This
38
46
  -- is determined by looking at the parent.
39
47
  --
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "33.10.0",
3
+ "version": "33.12.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -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 that
764
- * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
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 hasTrinket: boolean;
788
+ let alreadyHasTrinket: boolean;
774
789
  do {
775
790
  player.TryRemoveTrinket(trinketType);
776
- hasTrinket = player.HasTrinket(trinketType);
777
- } while (hasTrinket);
791
+ alreadyHasTrinket = player.HasTrinket(trinketType);
792
+ } while (alreadyHasTrinket);
778
793
  }
779
794
  }
780
795
 
@@ -44,6 +44,17 @@ export function getTearsStat(fireDelay: float): float {
44
44
  return 30 / (fireDelay + 1);
45
45
  }
46
46
 
47
+ /**
48
+ * Helper function to check if a tear hit an enemy. A tear is considered to be missed if it hit the
49
+ * ground, a wall, or a grid entity.
50
+ *
51
+ * Under the hood, this function uses the `Entity.IsDead` method to determine this. (Tears will not
52
+ * die if they hit an enemy, but they will die if they hit a wall or object.)
53
+ */
54
+ export function isMissedTear(tear: EntityTear): boolean {
55
+ return tear.IsDead();
56
+ }
57
+
47
58
  /**
48
59
  * Helper function to check if a given tear is from a familiar (as opposed to e.g. a player). This
49
60
  * is determined by looking at the parent.