isaacscript-common 84.2.4 → 84.3.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.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 84.2.3
3
+ isaacscript-common 84.2.5
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -22287,6 +22287,7 @@ return ____exports
22287
22287
  local ____lualib = require("lualib_bundle")
22288
22288
  local __TS__New = ____lualib.__TS__New
22289
22289
  local ____exports = {}
22290
+ local MAIN_CHARACTERS_SET
22290
22291
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.index")
22291
22292
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
22292
22293
  local ____constants = require("core.constants")
@@ -22318,6 +22319,11 @@ local ____lostStyleCharactersSet = require("sets.lostStyleCharactersSet")
22318
22319
  local LOST_STYLE_CHARACTERS_SET = ____lostStyleCharactersSet.LOST_STYLE_CHARACTERS_SET
22319
22320
  local ____ReadonlySet = require("types.ReadonlySet")
22320
22321
  local ReadonlySet = ____ReadonlySet.ReadonlySet
22322
+ --- Helper function to check if the provided character is one of the characters that are selectable
22323
+ -- from the main menu (and have achievements related to completing the various bosses and so on).
22324
+ function ____exports.isMainCharacter(self, character)
22325
+ return MAIN_CHARACTERS_SET:has(character)
22326
+ end
22321
22327
  function ____exports.isModdedCharacter(self, character)
22322
22328
  return not ____exports.isVanillaCharacter(nil, character)
22323
22329
  end
@@ -22325,37 +22331,37 @@ function ____exports.isVanillaCharacter(self, character)
22325
22331
  return character <= LAST_VANILLA_CHARACTER
22326
22332
  end
22327
22333
  local FLYING_CHARACTERS_SET = __TS__New(ReadonlySet, FLYING_CHARACTERS)
22328
- local MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, MAIN_CHARACTERS)
22334
+ MAIN_CHARACTERS_SET = __TS__New(ReadonlySet, MAIN_CHARACTERS)
22329
22335
  local PNG_PATH_PREFIX = "characters/costumes"
22336
+ --- Normally, characters get a red heart container upon reaching a new floor with an eternal heart,
22337
+ -- but some characters grant a black heart instead. Returns true for Dark Judas and Tainted Judas.
22338
+ -- Otherwise, returns false.
22339
+ function ____exports.canCharacterGetBlackHeartFromEternalHeart(self, character)
22340
+ return CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART_SET:has(character)
22341
+ end
22330
22342
  --- Helper function to determine if the given character can have red heart containers. Returns true
22331
22343
  -- for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
22332
22344
  -- though coin containers are not technically the same as red heart containers. Returns false for
22333
22345
  -- characters like Blue Baby. Returns false for The Lost and Tainted Lost.
22334
- function ____exports.characterCanHaveRedHearts(self, character)
22346
+ function ____exports.canCharacterHaveRedHearts(self, character)
22335
22347
  return not CHARACTERS_WITH_NO_RED_HEARTS_SET:has(character)
22336
22348
  end
22337
22349
  --- Helper function to determine if the given character can have soul hearts. Returns true for
22338
22350
  -- characters like Isaac, Magdalene, or Cain. Returns false for characters like Bethany. Returns
22339
22351
  -- false for The Lost and Tainted Lost.
22340
- function ____exports.characterCanHaveSoulHearts(self, character)
22352
+ function ____exports.canCharacterHaveSoulHearts(self, character)
22341
22353
  return not CHARACTERS_WITH_NO_SOUL_HEARTS_SET:has(character)
22342
22354
  end
22343
22355
  --- Helper function for determining whether the given character can take free Devil Deals. (e.g. The
22344
22356
  -- Lost, Tainted Lost, etc.)
22345
- function ____exports.characterCanTakeFreeDevilDeals(self, character)
22357
+ function ____exports.canCharacterTakeFreeDevilDeals(self, character)
22346
22358
  return CHARACTERS_WITH_FREE_DEVIL_DEALS_SET:has(character)
22347
22359
  end
22348
- --- Normally, characters get a red heart container upon reaching a new floor with an eternal heart,
22349
- -- but some characters grant a black heart instead. Returns true for Dark Judas and Tainted Judas.
22350
- -- Otherwise, returns false.
22351
- function ____exports.characterGetsBlackHeartFromEternalHeart(self, character)
22352
- return CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART_SET:has(character)
22353
- end
22354
22360
  --- Helper function to determine if the specified character starts with an active item.
22355
22361
  --
22356
22362
  -- For the purposes of this function, the save file is considered to be fully unlocked (e.g. Isaac
22357
22363
  -- is considered to starts with the D6, but this is not the case on a brand new save file).
22358
- function ____exports.characterStartsWithActiveItem(self, character)
22364
+ function ____exports.doesCharacterStartWithActiveItem(self, character)
22359
22365
  return CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET:has(character)
22360
22366
  end
22361
22367
  --- Helper function to get the numerical damage multiplier for a character.
@@ -22433,14 +22439,73 @@ end
22433
22439
  function ____exports.getCharacterStartingTrinketType(self, character)
22434
22440
  return CHARACTER_STARTING_TRINKET_TYPE[character]
22435
22441
  end
22442
+ --- Helper function to get the "main" version of the character. In other words, this is the character
22443
+ -- that selectable from the main menu (and has achievements related to completing the various bosses
22444
+ -- and so on).
22445
+ --
22446
+ -- For example, the main character for `PlayerType.MAGDALENE` (1) is also `PlayerType.MAGDALENE`
22447
+ -- (1), but the main character for `PlayerType.LAZARUS_2` (11) would be `PlayerType.LAZARUS` (8).
22448
+ --
22449
+ -- For `PlayerType.POSSESSOR` (-1) and modded characters, the same character will be returned.
22450
+ function ____exports.getMainCharacter(self, character)
22451
+ if ____exports.isMainCharacter(nil, character) or ____exports.isModdedCharacter(nil, character) then
22452
+ return character
22453
+ end
22454
+ repeat
22455
+ local ____switch24 = character
22456
+ local ____cond24 = ____switch24 == PlayerType.POSSESSOR
22457
+ if ____cond24 then
22458
+ do
22459
+ return PlayerType.POSSESSOR
22460
+ end
22461
+ end
22462
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.LAZARUS_2
22463
+ if ____cond24 then
22464
+ do
22465
+ return PlayerType.LAZARUS
22466
+ end
22467
+ end
22468
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.DARK_JUDAS
22469
+ if ____cond24 then
22470
+ do
22471
+ return PlayerType.JUDAS
22472
+ end
22473
+ end
22474
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.SOUL
22475
+ if ____cond24 then
22476
+ do
22477
+ return PlayerType.FORGOTTEN
22478
+ end
22479
+ end
22480
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.ESAU
22481
+ if ____cond24 then
22482
+ do
22483
+ return PlayerType.JACOB
22484
+ end
22485
+ end
22486
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.LAZARUS_2_B
22487
+ if ____cond24 then
22488
+ do
22489
+ return PlayerType.LAZARUS_2
22490
+ end
22491
+ end
22492
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.JACOB_2_B
22493
+ if ____cond24 then
22494
+ do
22495
+ return PlayerType.JACOB_B
22496
+ end
22497
+ end
22498
+ ____cond24 = ____cond24 or ____switch24 == PlayerType.SOUL_B
22499
+ if ____cond24 then
22500
+ do
22501
+ return PlayerType.FORGOTTEN_B
22502
+ end
22503
+ end
22504
+ until true
22505
+ end
22436
22506
  function ____exports.isFlyingCharacter(self, character)
22437
22507
  return FLYING_CHARACTERS_SET:has(character)
22438
22508
  end
22439
- --- Helper function to check if the provided character is one of the characters that are selectable
22440
- -- from the main menu (and have achievements related to completing the various bosses and so on).
22441
- function ____exports.isMainCharacter(self, character)
22442
- return MAIN_CHARACTERS_SET:has(character)
22443
- end
22444
22509
  return ____exports
22445
22510
  end,
22446
22511
  ["functions.players"] = function(...)