isaacscript-common 1.0.599 → 1.0.600

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.
@@ -13,6 +13,7 @@ export declare const BLIND_ITEM_PNG_PATH = "gfx/items/collectibles/questionmark.
13
13
  export declare const BOMB_EXPLODE_FRAME = 45;
14
14
  export declare const CHARACTERS_WITH_AN_ACTIVE_ITEM: Set<PlayerType>;
15
15
  export declare const CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART: Set<PlayerType>;
16
+ export declare const CHARACTERS_WITH_FREE_DEVIL_DEALS: Set<PlayerType>;
16
17
  /**
17
18
  * The set of characters where red heart containers will be turned into soul hearts (e.g. Blue
18
19
  * Baby). This includes The Lost and Tainted Lost. This does not include Keeper or Tainted Keeper.
@@ -18,6 +18,7 @@ ____exports.CHARACTERS_WITH_AN_ACTIVE_ITEM = __TS__New(Set, {
18
18
  PlayerType.PLAYER_EDEN_B
19
19
  })
20
20
  ____exports.CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART = __TS__New(Set, {PlayerType.PLAYER_BLACKJUDAS, PlayerType.PLAYER_JUDAS_B})
21
+ ____exports.CHARACTERS_WITH_FREE_DEVIL_DEALS = __TS__New(Set, {PlayerType.PLAYER_THELOST, PlayerType.PLAYER_THELOST_B, PlayerType.PLAYER_JACOB2_B})
21
22
  ____exports.CHARACTERS_WITH_NO_RED_HEARTS = __TS__New(Set, {
22
23
  PlayerType.PLAYER_BLUEBABY,
23
24
  PlayerType.PLAYER_THELOST,
@@ -195,6 +195,11 @@ export declare function isJacobOrEsau(player: EntityPlayer): boolean;
195
195
  export declare function isKeeper(player: EntityPlayer): boolean;
196
196
  /** Helper function for detecting when a player is The Lost or Tainted Lost. */
197
197
  export declare function isLost(player: EntityPlayer): boolean;
198
+ /**
199
+ * Helper function for detecting when a player is one of the characters that can take free Devil
200
+ * Deals. (e.g. The Lost, Tainted Lost, etc.)
201
+ */
202
+ export declare function canTakeFreeDevilDeals(player: EntityPlayer): boolean;
198
203
  /** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
199
204
  export declare function isTaintedLazarus(player: EntityPlayer): boolean;
200
205
  export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType | int): void;
@@ -4,6 +4,7 @@ local ____exports = {}
4
4
  local EXCLUDED_CHARACTERS
5
5
  local ____constants = require("constants")
6
6
  local CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART = ____constants.CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART
7
+ local CHARACTERS_WITH_FREE_DEVIL_DEALS = ____constants.CHARACTERS_WITH_FREE_DEVIL_DEALS
7
8
  local CHARACTERS_WITH_NO_RED_HEARTS = ____constants.CHARACTERS_WITH_NO_RED_HEARTS
8
9
  local CHARACTERS_WITH_NO_SOUL_HEARTS = ____constants.CHARACTERS_WITH_NO_SOUL_HEARTS
9
10
  local LOST_STYLE_PLAYER_TYPES = ____constants.LOST_STYLE_PLAYER_TYPES
@@ -400,6 +401,10 @@ function ____exports.isLost(self, player)
400
401
  local character = player:GetPlayerType()
401
402
  return character == PlayerType.PLAYER_THELOST or character == PlayerType.PLAYER_THELOST_B
402
403
  end
404
+ function ____exports.canTakeFreeDevilDeals(self, player)
405
+ local character = player:GetPlayerType()
406
+ return CHARACTERS_WITH_FREE_DEVIL_DEALS:has(character)
407
+ end
403
408
  function ____exports.isTaintedLazarus(self, player)
404
409
  local character = player:GetPlayerType()
405
410
  return character == PlayerType.PLAYER_LAZARUS_B or character == PlayerType.PLAYER_LAZARUS2_B
@@ -445,9 +450,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
445
450
  itemPool:RemoveCollectible(collectibleType)
446
451
  end
447
452
  repeat
448
- local ____switch117 = activeSlot
449
- local ____cond117 = ____switch117 == ActiveSlot.SLOT_PRIMARY
450
- if ____cond117 then
453
+ local ____switch118 = activeSlot
454
+ local ____cond118 = ____switch118 == ActiveSlot.SLOT_PRIMARY
455
+ if ____cond118 then
451
456
  do
452
457
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
453
458
  player:RemoveCollectible(primaryCollectibleType)
@@ -456,8 +461,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
456
461
  break
457
462
  end
458
463
  end
459
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.SLOT_SECONDARY
460
- if ____cond117 then
464
+ ____cond118 = ____cond118 or ____switch118 == ActiveSlot.SLOT_SECONDARY
465
+ if ____cond118 then
461
466
  do
462
467
  if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
463
468
  player:RemoveCollectible(primaryCollectibleType)
@@ -472,16 +477,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
472
477
  break
473
478
  end
474
479
  end
475
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.SLOT_POCKET
476
- if ____cond117 then
480
+ ____cond118 = ____cond118 or ____switch118 == ActiveSlot.SLOT_POCKET
481
+ if ____cond118 then
477
482
  do
478
483
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
479
484
  player:SetActiveCharge(charge, activeSlot)
480
485
  break
481
486
  end
482
487
  end
483
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.SLOT_POCKET2
484
- if ____cond117 then
488
+ ____cond118 = ____cond118 or ____switch118 == ActiveSlot.SLOT_POCKET2
489
+ if ____cond118 then
485
490
  do
486
491
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
487
492
  break
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.0.599",
3
+ "version": "1.0.600",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",