isaacscript-common 1.2.262 → 1.2.265

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.
@@ -217,6 +217,20 @@ export declare function isTainted(player: EntityPlayer): boolean;
217
217
  /** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
218
218
  export declare function isTaintedLazarus(player: EntityPlayer): boolean;
219
219
  export declare function isVanillaCharacter(player: EntityPlayer): boolean;
220
+ /**
221
+ * Helper function to add one or more collectibles to a player.
222
+ *
223
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
224
+ * add.
225
+ */
226
+ export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: Array<CollectibleType | int>): void;
227
+ /**
228
+ * Helper function to check to see if a player has one or more collectibles.
229
+ *
230
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
231
+ * check for. Returns true if the player has any of the supplied collectible types.
232
+ */
233
+ export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: Array<CollectibleType | int>): boolean;
220
234
  /**
221
235
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
222
236
  * having to request the collectible from the item config.
@@ -444,6 +444,19 @@ function ____exports.isTaintedLazarus(self, player)
444
444
  local character = player:GetPlayerType()
445
445
  return character == PlayerType.PLAYER_LAZARUS_B or character == PlayerType.PLAYER_LAZARUS2_B
446
446
  end
447
+ function ____exports.playerAddCollectible(self, player, ...)
448
+ local collectibleTypes = {...}
449
+ for ____, collectibleType in ipairs(collectibleTypes) do
450
+ player:AddCollectible(collectibleType)
451
+ end
452
+ end
453
+ function ____exports.playerHasCollectible(self, player, ...)
454
+ local collectibleTypes = {...}
455
+ return __TS__ArraySome(
456
+ collectibleTypes,
457
+ function(____, collectibleType) return player:HasCollectible(collectibleType) end
458
+ )
459
+ end
447
460
  function ____exports.removeCollectibleCostume(self, player, collectibleType)
448
461
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
449
462
  if itemConfigItem == nil then
@@ -482,9 +495,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
482
495
  itemPool:RemoveCollectible(collectibleType)
483
496
  end
484
497
  repeat
485
- local ____switch101 = activeSlot
486
- local ____cond101 = ____switch101 == ActiveSlot.SLOT_PRIMARY
487
- if ____cond101 then
498
+ local ____switch106 = activeSlot
499
+ local ____cond106 = ____switch106 == ActiveSlot.SLOT_PRIMARY
500
+ if ____cond106 then
488
501
  do
489
502
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
490
503
  player:RemoveCollectible(primaryCollectibleType)
@@ -493,8 +506,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
493
506
  break
494
507
  end
495
508
  end
496
- ____cond101 = ____cond101 or ____switch101 == ActiveSlot.SLOT_SECONDARY
497
- if ____cond101 then
509
+ ____cond106 = ____cond106 or ____switch106 == ActiveSlot.SLOT_SECONDARY
510
+ if ____cond106 then
498
511
  do
499
512
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
500
513
  player:RemoveCollectible(primaryCollectibleType)
@@ -509,16 +522,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
509
522
  break
510
523
  end
511
524
  end
512
- ____cond101 = ____cond101 or ____switch101 == ActiveSlot.SLOT_POCKET
513
- if ____cond101 then
525
+ ____cond106 = ____cond106 or ____switch106 == ActiveSlot.SLOT_POCKET
526
+ if ____cond106 then
514
527
  do
515
528
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
516
529
  player:SetActiveCharge(charge, activeSlot)
517
530
  break
518
531
  end
519
532
  end
520
- ____cond101 = ____cond101 or ____switch101 == ActiveSlot.SLOT_POCKET2
521
- if ____cond101 then
533
+ ____cond106 = ____cond106 or ____switch106 == ActiveSlot.SLOT_POCKET2
534
+ if ____cond106 then
522
535
  do
523
536
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
524
537
  break
@@ -11,6 +11,7 @@ ____exports.CARD_MAP = __TS__New(Map, {
11
11
  {"empress", 4},
12
12
  {"emperor", 5},
13
13
  {"hierophant", 6},
14
+ {"hiero", 6},
14
15
  {"lovers", 7},
15
16
  {"chariot", 8},
16
17
  {"justice", 9},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.262",
3
+ "version": "1.2.265",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",