isaacscript-common 22.0.0 → 23.0.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.
@@ -619,6 +619,14 @@ declare interface AddCallbackParametersCustom {
619
619
  */
620
620
  export declare function addCharge(player: EntityPlayer, activeSlot?: ActiveSlot, numCharges?: number, playSoundEffect?: boolean): int;
621
621
 
622
+ /**
623
+ * Helper function to add one or more collectibles to a player.
624
+ *
625
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
626
+ * add.
627
+ */
628
+ export declare function addCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
629
+
622
630
  export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
623
631
 
624
632
  /**
@@ -4397,6 +4405,14 @@ export declare function getCharacterName(character: PlayerType): string;
4397
4405
  /** Helper function to get an array containing the characters of all of the current players. */
4398
4406
  export declare function getCharacters(): PlayerType[];
4399
4407
 
4408
+ /**
4409
+ * Helper function to get the collectibles that are granted to a particular character at the
4410
+ * beginning of a run.
4411
+ *
4412
+ * Note that this will return an empty array for Eden and Tainted Eden.
4413
+ */
4414
+ export declare function getCharacterStartingItems(character: PlayerType): readonly CollectibleType[];
4415
+
4400
4416
  /**
4401
4417
  * Helper function to get the amount of charges away from the maximum charge that a particular
4402
4418
  * player is.
@@ -6926,6 +6942,14 @@ export declare function gridPositionToWorldPosition(gridPosition: Vector): Reado
6926
6942
  */
6927
6943
  export declare function hasArmor(entity: Entity): boolean;
6928
6944
 
6945
+ /**
6946
+ * Helper function to check to see if a player has one or more collectibles.
6947
+ *
6948
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
6949
+ * check for. Returns true if the player has any of the supplied collectible types.
6950
+ */
6951
+ export declare function hasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
6952
+
6929
6953
  export declare function hasCurse(curse: LevelCurse): boolean;
6930
6954
 
6931
6955
  /**
@@ -6950,6 +6974,14 @@ export declare function hasFlag<T extends BitFlag | BitFlag128>(flags: T | BitFl
6950
6974
 
6951
6975
  export declare function hasFlyingTransformation(player: EntityPlayer): boolean;
6952
6976
 
6977
+ /**
6978
+ * Helper function to check to see if a player has one or more transformations.
6979
+ *
6980
+ * This function is variadic, meaning that you can supply as many transformations as you want to
6981
+ * check for. Returns true if the player has any of the supplied transformations.
6982
+ */
6983
+ export declare function hasForm(player: EntityPlayer, ...playerForms: PlayerForm[]): boolean;
6984
+
6953
6985
  /** Helper type to check if an object or class has one or more functions/methods. */
6954
6986
  export declare type HasFunction<T> = Record<string, unknown> extends {
6955
6987
  [K in keyof T as T[K] extends Function ? K : never]-?: 1;
@@ -7723,7 +7755,7 @@ export declare function isEntityMoving(entity: Entity, threshold?: number): bool
7723
7755
 
7724
7756
  export declare function isEven(num: int): boolean;
7725
7757
 
7726
- /** Helper function to detect if a variable is of type `EntityEffect`. */
7758
+ /** Helper function to detect if a variable is of type `EntityFamiliar`. */
7727
7759
  export declare function isFamiliar(variable: unknown): variable is EntityFamiliar;
7728
7760
 
7729
7761
  /**
@@ -12255,14 +12287,6 @@ export declare const PILL_NAME_TO_EFFECT_MAP: ReadonlyMap<string, PillEffect>;
12255
12287
  */
12256
12288
  export declare function playChargeSoundEffect(player: EntityPlayer, activeSlot?: ActiveSlot): void;
12257
12289
 
12258
- /**
12259
- * Helper function to add one or more collectibles to a player.
12260
- *
12261
- * This function is variadic, meaning that you can supply as many collectible types as you want to
12262
- * add.
12263
- */
12264
- export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
12265
-
12266
12290
  declare class PlayerCollectibleDetection extends Feature {
12267
12291
  v: {
12268
12292
  run: {
@@ -12314,22 +12338,6 @@ export declare function playerConvertBlackHeartsToSoulHearts(player: EntityPlaye
12314
12338
 
12315
12339
  export declare function playerConvertSoulHeartsToBlackHearts(player: EntityPlayer): void;
12316
12340
 
12317
- /**
12318
- * Helper function to check to see if a player has one or more collectibles.
12319
- *
12320
- * This function is variadic, meaning that you can supply as many collectible types as you want to
12321
- * check for. Returns true if the player has any of the supplied collectible types.
12322
- */
12323
- export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
12324
-
12325
- /**
12326
- * Helper function to check to see if a player has one or more transformations.
12327
- *
12328
- * This function is variadic, meaning that you can supply as many transformations as you want to
12329
- * check for. Returns true if the player has any of the supplied transformations.
12330
- */
12331
- export declare function playerHasForm(player: EntityPlayer, ...playerForms: PlayerForm[]): boolean;
12332
-
12333
12341
  /**
12334
12342
  * Helper function to see if the player is out of health.
12335
12343
  *
@@ -13186,6 +13194,14 @@ export declare function removeAllTrinkets(trinketType?: TrinketType, cap?: int):
13186
13194
  */
13187
13195
  export declare function removeCharactersBefore(string: string, substring: string): string;
13188
13196
 
13197
+ /**
13198
+ * Helper function to remove one or more collectibles to a player.
13199
+ *
13200
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
13201
+ * remove.
13202
+ */
13203
+ export declare function removeCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
13204
+
13189
13205
  /**
13190
13206
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
13191
13207
  * having to request the collectible from the item config.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 22.0.0
3
+ isaacscript-common 23.0.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -21766,6 +21766,57 @@ ____exports.CHARACTER_NAMES = {
21766
21766
  [PlayerType.JACOB_2_B] = "Dead Tainted Jacob",
21767
21767
  [PlayerType.SOUL_B] = "Tainted Soul"
21768
21768
  }
21769
+ return ____exports
21770
+ end,
21771
+ ["src.objects.characterStartingCollectibles"] = function(...)
21772
+ local ____exports = {}
21773
+ local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
21774
+ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
21775
+ local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
21776
+ ____exports.CHARACTER_STARTING_COLLECTIBLES = {
21777
+ [PlayerType.POSSESSOR] = {},
21778
+ [PlayerType.ISAAC] = {CollectibleType.D6},
21779
+ [PlayerType.MAGDALENE] = {CollectibleType.YUM_HEART},
21780
+ [PlayerType.CAIN] = {CollectibleType.LUCKY_FOOT},
21781
+ [PlayerType.JUDAS] = {CollectibleType.BOOK_OF_BELIAL},
21782
+ [PlayerType.BLUE_BABY] = {CollectibleType.POOP},
21783
+ [PlayerType.EVE] = {CollectibleType.DEAD_BIRD, CollectibleType.WHORE_OF_BABYLON, CollectibleType.RAZOR_BLADE},
21784
+ [PlayerType.SAMSON] = {CollectibleType.BLOODY_LUST},
21785
+ [PlayerType.AZAZEL] = {},
21786
+ [PlayerType.LAZARUS] = {CollectibleType.ANEMIC},
21787
+ [PlayerType.EDEN] = {},
21788
+ [PlayerType.LOST] = {CollectibleType.ETERNAL_D6},
21789
+ [PlayerType.LAZARUS_2] = {CollectibleType.ANEMIC},
21790
+ [PlayerType.DARK_JUDAS] = {},
21791
+ [PlayerType.LILITH] = {CollectibleType.BOX_OF_FRIENDS, CollectibleType.CAMBION_CONCEPTION},
21792
+ [PlayerType.KEEPER] = {CollectibleType.WOODEN_NICKEL},
21793
+ [PlayerType.APOLLYON] = {CollectibleType.VOID},
21794
+ [PlayerType.FORGOTTEN] = {},
21795
+ [PlayerType.SOUL] = {},
21796
+ [PlayerType.BETHANY] = {CollectibleType.BOOK_OF_VIRTUES},
21797
+ [PlayerType.JACOB] = {},
21798
+ [PlayerType.ESAU] = {},
21799
+ [PlayerType.ISAAC_B] = {},
21800
+ [PlayerType.MAGDALENE_B] = {CollectibleType.YUM_HEART},
21801
+ [PlayerType.CAIN_B] = {CollectibleType.BAG_OF_CRAFTING},
21802
+ [PlayerType.JUDAS_B] = {CollectibleType.DARK_ARTS},
21803
+ [PlayerType.BLUE_BABY_B] = {CollectibleType.HOLD},
21804
+ [PlayerType.EVE_B] = {CollectibleType.SUMPTORIUM},
21805
+ [PlayerType.SAMSON_B] = {},
21806
+ [PlayerType.AZAZEL_B] = {},
21807
+ [PlayerType.LAZARUS_B] = {CollectibleType.FLIP},
21808
+ [PlayerType.EDEN_B] = {},
21809
+ [PlayerType.LOST_B] = {},
21810
+ [PlayerType.LILITH_B] = {},
21811
+ [PlayerType.KEEPER_B] = {},
21812
+ [PlayerType.APOLLYON_B] = {CollectibleType.ABYSS},
21813
+ [PlayerType.FORGOTTEN_B] = {},
21814
+ [PlayerType.BETHANY_B] = {CollectibleType.LEMEGETON},
21815
+ [PlayerType.JACOB_B] = {CollectibleType.ANIMA_SOLA},
21816
+ [PlayerType.LAZARUS_2_B] = {CollectibleType.FLIP},
21817
+ [PlayerType.JACOB_2_B] = {CollectibleType.ANIMA_SOLA},
21818
+ [PlayerType.SOUL_B] = {}
21819
+ }
21769
21820
  return ____exports
21770
21821
  end,
21771
21822
  ["src.sets.charactersThatStartWithAnActiveItemSet"] = function(...)
@@ -21879,6 +21930,8 @@ local ____characterDamageMultipliers = require("src.objects.characterDamageMulti
21879
21930
  local CHARACTER_DAMAGE_MULTIPLIERS = ____characterDamageMultipliers.CHARACTER_DAMAGE_MULTIPLIERS
21880
21931
  local ____characterNames = require("src.objects.characterNames")
21881
21932
  local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
21933
+ local ____characterStartingCollectibles = require("src.objects.characterStartingCollectibles")
21934
+ local CHARACTER_STARTING_COLLECTIBLES = ____characterStartingCollectibles.CHARACTER_STARTING_COLLECTIBLES
21882
21935
  local ____charactersThatStartWithAnActiveItemSet = require("src.sets.charactersThatStartWithAnActiveItemSet")
21883
21936
  local CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET = ____charactersThatStartWithAnActiveItemSet.CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET
21884
21937
  local ____charactersWithBlackHeartFromEternalHeartSet = require("src.sets.charactersWithBlackHeartFromEternalHeartSet")
@@ -21961,6 +22014,9 @@ function ____exports.getCharacterName(self, character)
21961
22014
  end
21962
22015
  return CHARACTER_NAMES[character]
21963
22016
  end
22017
+ function ____exports.getCharacterStartingItems(self, character)
22018
+ return CHARACTER_STARTING_COLLECTIBLES[character]
22019
+ end
21964
22020
  function ____exports.isFlyingCharacter(self, player)
21965
22021
  local character = player:GetPlayerType()
21966
22022
  return FLYING_CHARACTERS:has(character)
@@ -21977,7 +22033,6 @@ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
21977
22033
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
21978
22034
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
21979
22035
  local ____exports = {}
21980
- local isTaintedModded
21981
22036
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
21982
22037
  local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
21983
22038
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
@@ -22025,16 +22080,16 @@ end
22025
22080
  function ____exports.isModdedPlayer(self, player)
22026
22081
  return not ____exports.isVanillaPlayer(nil, player)
22027
22082
  end
22028
- function isTaintedModded(self, player)
22029
- local character = player:GetPlayerType()
22030
- local name = player:GetName()
22031
- local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
22032
- return character == taintedCharacter
22033
- end
22034
22083
  function ____exports.isVanillaPlayer(self, player)
22035
22084
  local character = player:GetPlayerType()
22036
22085
  return isVanillaCharacter(nil, character)
22037
22086
  end
22087
+ function ____exports.addCollectible(self, player, ...)
22088
+ local collectibleTypes = {...}
22089
+ for ____, collectibleType in ipairs(collectibleTypes) do
22090
+ player:AddCollectible(collectibleType)
22091
+ end
22092
+ end
22038
22093
  function ____exports.addCollectibleCostume(self, player, collectibleType)
22039
22094
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
22040
22095
  if itemConfigItem == nil then
@@ -22264,6 +22319,20 @@ function ____exports.getTotalPlayerCollectibles(self, collectibleType)
22264
22319
  )
22265
22320
  return sumArray(nil, numCollectiblesArray)
22266
22321
  end
22322
+ function ____exports.hasCollectible(self, player, ...)
22323
+ local collectibleTypes = {...}
22324
+ return __TS__ArraySome(
22325
+ collectibleTypes,
22326
+ function(____, collectibleType) return player:HasCollectible(collectibleType) end
22327
+ )
22328
+ end
22329
+ function ____exports.hasForm(self, player, ...)
22330
+ local playerForms = {...}
22331
+ return __TS__ArraySome(
22332
+ playerForms,
22333
+ function(____, playerForm) return player:HasPlayerForm(playerForm) end
22334
+ )
22335
+ end
22267
22336
  function ____exports.hasLostCurse(self, player)
22268
22337
  local effects = player:GetEffects()
22269
22338
  return effects:HasNullEffect(NullItemID.LOST_CURSE)
@@ -22318,6 +22387,12 @@ function ____exports.isLost(self, player)
22318
22387
  local character = player:GetPlayerType()
22319
22388
  return character == PlayerType.LOST or character == PlayerType.LOST_B
22320
22389
  end
22390
+ local function isTaintedModded(self, player)
22391
+ local character = player:GetPlayerType()
22392
+ local name = player:GetName()
22393
+ local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
22394
+ return character == taintedCharacter
22395
+ end
22321
22396
  function ____exports.isPlayerAbleToAim(self, player)
22322
22397
  return player:IsExtraAnimationFinished()
22323
22398
  end
@@ -22335,26 +22410,6 @@ function ____exports.isTaintedLazarus(self, player)
22335
22410
  local character = player:GetPlayerType()
22336
22411
  return character == PlayerType.LAZARUS_B or character == PlayerType.LAZARUS_2_B
22337
22412
  end
22338
- function ____exports.playerAddCollectible(self, player, ...)
22339
- local collectibleTypes = {...}
22340
- for ____, collectibleType in ipairs(collectibleTypes) do
22341
- player:AddCollectible(collectibleType)
22342
- end
22343
- end
22344
- function ____exports.playerHasCollectible(self, player, ...)
22345
- local collectibleTypes = {...}
22346
- return __TS__ArraySome(
22347
- collectibleTypes,
22348
- function(____, collectibleType) return player:HasCollectible(collectibleType) end
22349
- )
22350
- end
22351
- function ____exports.playerHasForm(self, player, ...)
22352
- local playerForms = {...}
22353
- return __TS__ArraySome(
22354
- playerForms,
22355
- function(____, playerForm) return player:HasPlayerForm(playerForm) end
22356
- )
22357
- end
22358
22413
  function ____exports.removeAllActiveItems(self, player)
22359
22414
  for ____, activeSlot in ipairs(ACTIVE_SLOT_VALUES) do
22360
22415
  do
@@ -22362,13 +22417,13 @@ function ____exports.removeAllActiveItems(self, player)
22362
22417
  if collectibleType == CollectibleType.NULL then
22363
22418
  goto __continue93
22364
22419
  end
22365
- local hasCollectible
22420
+ local stillHasCollectible
22366
22421
  repeat
22367
22422
  do
22368
22423
  player:RemoveCollectible(collectibleType)
22369
- hasCollectible = player:HasCollectible(collectibleType)
22424
+ stillHasCollectible = player:HasCollectible(collectibleType)
22370
22425
  end
22371
- until not hasCollectible
22426
+ until not stillHasCollectible
22372
22427
  end
22373
22428
  ::__continue93::
22374
22429
  end
@@ -22391,6 +22446,12 @@ function ____exports.removeAllPlayerTrinkets(self, player)
22391
22446
  ::__continue98::
22392
22447
  end
22393
22448
  end
22449
+ function ____exports.removeCollectible(self, player, ...)
22450
+ local collectibleTypes = {...}
22451
+ for ____, collectibleType in ipairs(collectibleTypes) do
22452
+ player:RemoveCollectible(collectibleType)
22453
+ end
22454
+ end
22394
22455
  function ____exports.removeCollectibleCostume(self, player, collectibleType)
22395
22456
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
22396
22457
  if itemConfigItem == nil then
@@ -22442,9 +22503,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
22442
22503
  itemPool:RemoveCollectible(collectibleType)
22443
22504
  end
22444
22505
  repeat
22445
- local ____switch117 = activeSlot
22446
- local ____cond117 = ____switch117 == ActiveSlot.PRIMARY
22447
- if ____cond117 then
22506
+ local ____switch120 = activeSlot
22507
+ local ____cond120 = ____switch120 == ActiveSlot.PRIMARY
22508
+ if ____cond120 then
22448
22509
  do
22449
22510
  if primaryCollectibleType ~= CollectibleType.NULL then
22450
22511
  player:RemoveCollectible(primaryCollectibleType)
@@ -22453,8 +22514,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
22453
22514
  break
22454
22515
  end
22455
22516
  end
22456
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.SECONDARY
22457
- if ____cond117 then
22517
+ ____cond120 = ____cond120 or ____switch120 == ActiveSlot.SECONDARY
22518
+ if ____cond120 then
22458
22519
  do
22459
22520
  if primaryCollectibleType ~= CollectibleType.NULL then
22460
22521
  player:RemoveCollectible(primaryCollectibleType)
@@ -22469,16 +22530,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
22469
22530
  break
22470
22531
  end
22471
22532
  end
22472
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.POCKET
22473
- if ____cond117 then
22533
+ ____cond120 = ____cond120 or ____switch120 == ActiveSlot.POCKET
22534
+ if ____cond120 then
22474
22535
  do
22475
22536
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
22476
22537
  player:SetActiveCharge(charge, activeSlot)
22477
22538
  break
22478
22539
  end
22479
22540
  end
22480
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.POCKET_SINGLE_USE
22481
- if ____cond117 then
22541
+ ____cond120 = ____cond120 or ____switch120 == ActiveSlot.POCKET_SINGLE_USE
22542
+ if ____cond120 then
22482
22543
  do
22483
22544
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
22484
22545
  break
@@ -1,4 +1,4 @@
1
- import { PlayerType } from "isaac-typescript-definitions";
1
+ import { CollectibleType, PlayerType } from "isaac-typescript-definitions";
2
2
  /**
3
3
  * Helper function to determine if the given character can have red heart containers. Returns true
4
4
  * for characters like Isaac, Magdalene, or Cain. Returns true for Keeper and Tainted Keeper, even
@@ -46,6 +46,13 @@ export declare function getCharacterDeathAnimationName(character: PlayerType): s
46
46
  export declare function getCharacterMaxHeartContainers(character: PlayerType): int;
47
47
  /** Helper function to get the name of a character. Returns "Unknown" for modded characters. */
48
48
  export declare function getCharacterName(character: PlayerType): string;
49
+ /**
50
+ * Helper function to get the collectibles that are granted to a particular character at the
51
+ * beginning of a run.
52
+ *
53
+ * Note that this will return an empty array for Eden and Tainted Eden.
54
+ */
55
+ export declare function getCharacterStartingItems(character: PlayerType): readonly CollectibleType[];
49
56
  export declare function isFlyingCharacter(player: EntityPlayer): boolean;
50
57
  export declare function isModdedCharacter(character: PlayerType): boolean;
51
58
  export declare function isVanillaCharacter(character: PlayerType): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"characters.d.ts","sourceRoot":"","sources":["../../../src/functions/characters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAqB1D;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAExE;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAEzE;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE7E;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,UAAU,GACpB,OAAO,CAET;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAE5E;AAED,8EAA8E;AAC9E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,UAAU,EACrB,iBAAiB,UAAQ,GACxB,KAAK,CAMP;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAU5E;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAsBzE;AAED,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,MAAM,CAM9D;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAG/D;AAED,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,U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AAU,GAAG,OAAO,CAEjE"}
@@ -9,6 +9,8 @@ local ____characterDamageMultipliers = require("src.objects.characterDamageMulti
9
9
  local CHARACTER_DAMAGE_MULTIPLIERS = ____characterDamageMultipliers.CHARACTER_DAMAGE_MULTIPLIERS
10
10
  local ____characterNames = require("src.objects.characterNames")
11
11
  local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
12
+ local ____characterStartingCollectibles = require("src.objects.characterStartingCollectibles")
13
+ local CHARACTER_STARTING_COLLECTIBLES = ____characterStartingCollectibles.CHARACTER_STARTING_COLLECTIBLES
12
14
  local ____charactersThatStartWithAnActiveItemSet = require("src.sets.charactersThatStartWithAnActiveItemSet")
13
15
  local CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET = ____charactersThatStartWithAnActiveItemSet.CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET
14
16
  local ____charactersWithBlackHeartFromEternalHeartSet = require("src.sets.charactersWithBlackHeartFromEternalHeartSet")
@@ -115,6 +117,13 @@ function ____exports.getCharacterName(self, character)
115
117
  end
116
118
  return CHARACTER_NAMES[character]
117
119
  end
120
+ --- Helper function to get the collectibles that are granted to a particular character at the
121
+ -- beginning of a run.
122
+ --
123
+ -- Note that this will return an empty array for Eden and Tainted Eden.
124
+ function ____exports.getCharacterStartingItems(self, character)
125
+ return CHARACTER_STARTING_COLLECTIBLES[character]
126
+ end
118
127
  function ____exports.isFlyingCharacter(self, player)
119
128
  local character = player:GetPlayerType()
120
129
  return FLYING_CHARACTERS:has(character)
@@ -43,7 +43,7 @@ export declare function isEffect(variable: unknown): variable is EntityEffect;
43
43
  * classes such as `EntityPlayer` or `EntityTear`.
44
44
  */
45
45
  export declare function isEntity(variable: unknown): variable is Entity;
46
- /** Helper function to detect if a variable is of type `EntityEffect`. */
46
+ /** Helper function to detect if a variable is of type `EntityFamiliar`. */
47
47
  export declare function isFamiliar(variable: unknown): variable is EntityFamiliar;
48
48
  /** Helper function to detect if a variable is of type `GridEntity`. */
49
49
  export declare function isGridEntity(variable: unknown): variable is GridEntity;
@@ -1 +1 @@
1
- {"version":3,"file":"isaacAPIClass.d.ts","sourceRoot":"","sources":["../../../src/functions/isaacAPIClass.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAkBxE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAEpE;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,MAAM,CAE9D;AAED,yEAAyE;AACzE,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAExE;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,IAAI,aAAa,CAGxE;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EACf,SAAS,EAAE,MAAM,GAChB,OAAO,CAMT;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAElE;AAED,wEAAwE;AACxE,wBAAgB,OAAO,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,WAAW,CAElE;AAED,sEAAsE;AACtE,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OA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AAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,aAAa,CAElE;AAED,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,YAAY,CAEpE;AAED,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;AAED,oFAAoF;AACpF,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,OAAO,GAChB,QAAQ,IAAI,uBAAuB,CAErC;AAED,6EAA6E;AAC7E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,gBAAgB,CAE5E;AAED,2EAA2E;AAC3E,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,cAAc,CAEpE;AAED,6EAA6E;AAC7E,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,gBAAgB,CAExE;AAED,0EAA0E;AAC1E,wBAAgB,KAAK,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,aAAa,CAElE;AAED,uEAAuE;AACvE,wBAAgB,MAAM,CAAC,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,UAAU,CAEhE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,GACjC,OAAO,CAKT"}
@@ -48,7 +48,7 @@ end
48
48
  function ____exports.isEntity(self, variable)
49
49
  return ____exports.getIsaacAPIClassName(nil, variable) == "Entity"
50
50
  end
51
- --- Helper function to detect if a variable is of type `EntityEffect`.
51
+ --- Helper function to detect if a variable is of type `EntityFamiliar`.
52
52
  function ____exports.isFamiliar(self, variable)
53
53
  return ____exports.getIsaacAPIClassName(nil, variable) == "EntityEffect"
54
54
  end
@@ -1,4 +1,11 @@
1
1
  import { ActiveSlot, CollectibleType, ControllerIndex, PlayerForm, PlayerType, TrinketType } from "isaac-typescript-definitions";
2
+ /**
3
+ * Helper function to add one or more collectibles to a player.
4
+ *
5
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
6
+ * add.
7
+ */
8
+ export declare function addCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
2
9
  export declare function addCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
3
10
  export declare function addTrinketCostume(player: EntityPlayer, trinketType: TrinketType): void;
4
11
  export declare function anyPlayerHasCollectible(collectibleType: CollectibleType): boolean;
@@ -150,6 +157,20 @@ export declare function getPlayersWithTrinket(...trinketTypes: TrinketType[]): E
150
157
  * Note that this will filter out non-real collectibles like Lilith's Incubus.
151
158
  */
152
159
  export declare function getTotalPlayerCollectibles(collectibleType: CollectibleType): int;
160
+ /**
161
+ * Helper function to check to see if a player has one or more collectibles.
162
+ *
163
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
164
+ * check for. Returns true if the player has any of the supplied collectible types.
165
+ */
166
+ export declare function hasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
167
+ /**
168
+ * Helper function to check to see if a player has one or more transformations.
169
+ *
170
+ * This function is variadic, meaning that you can supply as many transformations as you want to
171
+ * check for. Returns true if the player has any of the supplied transformations.
172
+ */
173
+ export declare function hasForm(player: EntityPlayer, ...playerForms: PlayerForm[]): boolean;
153
174
  /** After touching a white fire, a player will turn into The Lost until they clear a room. */
154
175
  export declare function hasLostCurse(player: EntityPlayer): boolean;
155
176
  /**
@@ -216,27 +237,6 @@ export declare function isTainted(player: EntityPlayer): boolean;
216
237
  /** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
217
238
  export declare function isTaintedLazarus(player: EntityPlayer): boolean;
218
239
  export declare function isVanillaPlayer(player: EntityPlayer): boolean;
219
- /**
220
- * Helper function to add one or more collectibles to a player.
221
- *
222
- * This function is variadic, meaning that you can supply as many collectible types as you want to
223
- * add.
224
- */
225
- export declare function playerAddCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
226
- /**
227
- * Helper function to check to see if a player has one or more collectibles.
228
- *
229
- * This function is variadic, meaning that you can supply as many collectible types as you want to
230
- * check for. Returns true if the player has any of the supplied collectible types.
231
- */
232
- export declare function playerHasCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): boolean;
233
- /**
234
- * Helper function to check to see if a player has one or more transformations.
235
- *
236
- * This function is variadic, meaning that you can supply as many transformations as you want to
237
- * check for. Returns true if the player has any of the supplied transformations.
238
- */
239
- export declare function playerHasForm(player: EntityPlayer, ...playerForms: PlayerForm[]): boolean;
240
240
  /**
241
241
  * Helper function to remove all of the active items from a player. This includes the Schoolbag item
242
242
  * and any pocket actives.
@@ -249,6 +249,13 @@ export declare function removeAllActiveItems(player: EntityPlayer): void;
249
249
  * they also have smelted. (In that case, both the held and the smelted trinket will be removed.)
250
250
  */
251
251
  export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
252
+ /**
253
+ * Helper function to remove one or more collectibles to a player.
254
+ *
255
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
256
+ * remove.
257
+ */
258
+ export declare function removeCollectible(player: EntityPlayer, ...collectibleTypes: CollectibleType[]): void;
252
259
  /**
253
260
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
254
261
  * having to request the collectible from the item config.
@@ -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,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAiBtC,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,G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CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;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,EAEf,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAiBtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAIN;AAED,wBAAgB,qBAA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AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,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"}
@@ -7,7 +7,6 @@ local __TS__ArrayMap = ____lualib.__TS__ArrayMap
7
7
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
8
8
  local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
9
9
  local ____exports = {}
10
- local isTaintedModded
11
10
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
12
11
  local ActiveSlot = ____isaac_2Dtypescript_2Ddefinitions.ActiveSlot
13
12
  local Challenge = ____isaac_2Dtypescript_2Ddefinitions.Challenge
@@ -60,16 +59,20 @@ end
60
59
  function ____exports.isModdedPlayer(self, player)
61
60
  return not ____exports.isVanillaPlayer(nil, player)
62
61
  end
63
- function isTaintedModded(self, player)
64
- local character = player:GetPlayerType()
65
- local name = player:GetName()
66
- local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
67
- return character == taintedCharacter
68
- end
69
62
  function ____exports.isVanillaPlayer(self, player)
70
63
  local character = player:GetPlayerType()
71
64
  return isVanillaCharacter(nil, character)
72
65
  end
66
+ --- Helper function to add one or more collectibles to a player.
67
+ --
68
+ -- This function is variadic, meaning that you can supply as many collectible types as you want to
69
+ -- add.
70
+ function ____exports.addCollectible(self, player, ...)
71
+ local collectibleTypes = {...}
72
+ for ____, collectibleType in ipairs(collectibleTypes) do
73
+ player:AddCollectible(collectibleType)
74
+ end
75
+ end
73
76
  function ____exports.addCollectibleCostume(self, player, collectibleType)
74
77
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
75
78
  if itemConfigItem == nil then
@@ -383,6 +386,28 @@ function ____exports.getTotalPlayerCollectibles(self, collectibleType)
383
386
  )
384
387
  return sumArray(nil, numCollectiblesArray)
385
388
  end
389
+ --- Helper function to check to see if a player has one or more collectibles.
390
+ --
391
+ -- This function is variadic, meaning that you can supply as many collectible types as you want to
392
+ -- check for. Returns true if the player has any of the supplied collectible types.
393
+ function ____exports.hasCollectible(self, player, ...)
394
+ local collectibleTypes = {...}
395
+ return __TS__ArraySome(
396
+ collectibleTypes,
397
+ function(____, collectibleType) return player:HasCollectible(collectibleType) end
398
+ )
399
+ end
400
+ --- Helper function to check to see if a player has one or more transformations.
401
+ --
402
+ -- This function is variadic, meaning that you can supply as many transformations as you want to
403
+ -- check for. Returns true if the player has any of the supplied transformations.
404
+ function ____exports.hasForm(self, player, ...)
405
+ local playerForms = {...}
406
+ return __TS__ArraySome(
407
+ playerForms,
408
+ function(____, playerForm) return player:HasPlayerForm(playerForm) end
409
+ )
410
+ end
386
411
  --- After touching a white fire, a player will turn into The Lost until they clear a room.
387
412
  function ____exports.hasLostCurse(self, player)
388
413
  local effects = player:GetEffects()
@@ -459,6 +484,12 @@ function ____exports.isLost(self, player)
459
484
  local character = player:GetPlayerType()
460
485
  return character == PlayerType.LOST or character == PlayerType.LOST_B
461
486
  end
487
+ local function isTaintedModded(self, player)
488
+ local character = player:GetPlayerType()
489
+ local name = player:GetName()
490
+ local taintedCharacter = Isaac.GetPlayerTypeByName(name, true)
491
+ return character == taintedCharacter
492
+ end
462
493
  --- Helper function for determining if a player is able to turn their head by pressing the shooting
463
494
  -- buttons.
464
495
  --
@@ -482,38 +513,6 @@ function ____exports.isTaintedLazarus(self, player)
482
513
  local character = player:GetPlayerType()
483
514
  return character == PlayerType.LAZARUS_B or character == PlayerType.LAZARUS_2_B
484
515
  end
485
- --- Helper function to add one or more collectibles to a player.
486
- --
487
- -- This function is variadic, meaning that you can supply as many collectible types as you want to
488
- -- add.
489
- function ____exports.playerAddCollectible(self, player, ...)
490
- local collectibleTypes = {...}
491
- for ____, collectibleType in ipairs(collectibleTypes) do
492
- player:AddCollectible(collectibleType)
493
- end
494
- end
495
- --- Helper function to check to see if a player has one or more collectibles.
496
- --
497
- -- This function is variadic, meaning that you can supply as many collectible types as you want to
498
- -- check for. Returns true if the player has any of the supplied collectible types.
499
- function ____exports.playerHasCollectible(self, player, ...)
500
- local collectibleTypes = {...}
501
- return __TS__ArraySome(
502
- collectibleTypes,
503
- function(____, collectibleType) return player:HasCollectible(collectibleType) end
504
- )
505
- end
506
- --- Helper function to check to see if a player has one or more transformations.
507
- --
508
- -- This function is variadic, meaning that you can supply as many transformations as you want to
509
- -- check for. Returns true if the player has any of the supplied transformations.
510
- function ____exports.playerHasForm(self, player, ...)
511
- local playerForms = {...}
512
- return __TS__ArraySome(
513
- playerForms,
514
- function(____, playerForm) return player:HasPlayerForm(playerForm) end
515
- )
516
- end
517
516
  --- Helper function to remove all of the active items from a player. This includes the Schoolbag item
518
517
  -- and any pocket actives.
519
518
  function ____exports.removeAllActiveItems(self, player)
@@ -523,13 +522,13 @@ function ____exports.removeAllActiveItems(self, player)
523
522
  if collectibleType == CollectibleType.NULL then
524
523
  goto __continue93
525
524
  end
526
- local hasCollectible
525
+ local stillHasCollectible
527
526
  repeat
528
527
  do
529
528
  player:RemoveCollectible(collectibleType)
530
- hasCollectible = player:HasCollectible(collectibleType)
529
+ stillHasCollectible = player:HasCollectible(collectibleType)
531
530
  end
532
- until not hasCollectible
531
+ until not stillHasCollectible
533
532
  end
534
533
  ::__continue93::
535
534
  end
@@ -556,6 +555,16 @@ function ____exports.removeAllPlayerTrinkets(self, player)
556
555
  ::__continue98::
557
556
  end
558
557
  end
558
+ --- Helper function to remove one or more collectibles to a player.
559
+ --
560
+ -- This function is variadic, meaning that you can supply as many collectible types as you want to
561
+ -- remove.
562
+ function ____exports.removeCollectible(self, player, ...)
563
+ local collectibleTypes = {...}
564
+ for ____, collectibleType in ipairs(collectibleTypes) do
565
+ player:RemoveCollectible(collectibleType)
566
+ end
567
+ end
559
568
  --- Helper function to remove a collectible costume from a player. Use this helper function to avoid
560
569
  -- having to request the collectible from the item config.
561
570
  function ____exports.removeCollectibleCostume(self, player, collectibleType)
@@ -634,9 +643,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
634
643
  itemPool:RemoveCollectible(collectibleType)
635
644
  end
636
645
  repeat
637
- local ____switch117 = activeSlot
638
- local ____cond117 = ____switch117 == ActiveSlot.PRIMARY
639
- if ____cond117 then
646
+ local ____switch120 = activeSlot
647
+ local ____cond120 = ____switch120 == ActiveSlot.PRIMARY
648
+ if ____cond120 then
640
649
  do
641
650
  if primaryCollectibleType ~= CollectibleType.NULL then
642
651
  player:RemoveCollectible(primaryCollectibleType)
@@ -645,8 +654,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
645
654
  break
646
655
  end
647
656
  end
648
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.SECONDARY
649
- if ____cond117 then
657
+ ____cond120 = ____cond120 or ____switch120 == ActiveSlot.SECONDARY
658
+ if ____cond120 then
650
659
  do
651
660
  if primaryCollectibleType ~= CollectibleType.NULL then
652
661
  player:RemoveCollectible(primaryCollectibleType)
@@ -661,16 +670,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
661
670
  break
662
671
  end
663
672
  end
664
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.POCKET
665
- if ____cond117 then
673
+ ____cond120 = ____cond120 or ____switch120 == ActiveSlot.POCKET
674
+ if ____cond120 then
666
675
  do
667
676
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
668
677
  player:SetActiveCharge(charge, activeSlot)
669
678
  break
670
679
  end
671
680
  end
672
- ____cond117 = ____cond117 or ____switch117 == ActiveSlot.POCKET_SINGLE_USE
673
- if ____cond117 then
681
+ ____cond120 = ____cond120 or ____switch120 == ActiveSlot.POCKET_SINGLE_USE
682
+ if ____cond120 then
674
683
  do
675
684
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
676
685
  break
@@ -0,0 +1,46 @@
1
+ import { CollectibleType } from "isaac-typescript-definitions";
2
+ export declare const CHARACTER_STARTING_COLLECTIBLES: {
3
+ readonly [-1]: readonly [];
4
+ readonly 0: readonly [CollectibleType.D6];
5
+ readonly 1: readonly [CollectibleType.YUM_HEART];
6
+ readonly 2: readonly [CollectibleType.LUCKY_FOOT];
7
+ readonly 3: readonly [CollectibleType.BOOK_OF_BELIAL];
8
+ readonly 4: readonly [CollectibleType.POOP];
9
+ readonly 5: readonly [CollectibleType.DEAD_BIRD, CollectibleType.WHORE_OF_BABYLON, CollectibleType.RAZOR_BLADE];
10
+ readonly 6: readonly [CollectibleType.BLOODY_LUST];
11
+ readonly 7: readonly [];
12
+ readonly 8: readonly [CollectibleType.ANEMIC];
13
+ readonly 9: readonly [];
14
+ readonly 10: readonly [CollectibleType.ETERNAL_D6];
15
+ readonly 11: readonly [CollectibleType.ANEMIC];
16
+ readonly 12: readonly [];
17
+ readonly 13: readonly [CollectibleType.BOX_OF_FRIENDS, CollectibleType.CAMBION_CONCEPTION];
18
+ readonly 14: readonly [CollectibleType.WOODEN_NICKEL];
19
+ readonly 15: readonly [CollectibleType.VOID];
20
+ readonly 16: readonly [];
21
+ readonly 17: readonly [];
22
+ readonly 18: readonly [CollectibleType.BOOK_OF_VIRTUES];
23
+ readonly 19: readonly [];
24
+ readonly 20: readonly [];
25
+ readonly 21: readonly [];
26
+ readonly 22: readonly [CollectibleType.YUM_HEART];
27
+ readonly 23: readonly [CollectibleType.BAG_OF_CRAFTING];
28
+ readonly 24: readonly [CollectibleType.DARK_ARTS];
29
+ readonly 25: readonly [CollectibleType.HOLD];
30
+ readonly 26: readonly [CollectibleType.SUMPTORIUM];
31
+ readonly 27: readonly [];
32
+ readonly 28: readonly [];
33
+ readonly 29: readonly [CollectibleType.FLIP];
34
+ readonly 30: readonly [];
35
+ readonly 31: readonly [];
36
+ readonly 32: readonly [];
37
+ readonly 33: readonly [];
38
+ readonly 34: readonly [CollectibleType.ABYSS];
39
+ readonly 35: readonly [];
40
+ readonly 36: readonly [CollectibleType.LEMEGETON];
41
+ readonly 37: readonly [CollectibleType.ANIMA_SOLA];
42
+ readonly 38: readonly [CollectibleType.FLIP];
43
+ readonly 39: readonly [CollectibleType.ANIMA_SOLA];
44
+ readonly 40: readonly [];
45
+ };
46
+ //# sourceMappingURL=characterStartingCollectibles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"characterStartingCollectibles.d.ts","sourceRoot":"","sources":["../../../src/objects/characterStartingCollectibles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,8BAA8B,CAAC;AAE3E,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6IuB,CAAC"}
@@ -0,0 +1,49 @@
1
+ local ____exports = {}
2
+ local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
+ local CollectibleType = ____isaac_2Dtypescript_2Ddefinitions.CollectibleType
4
+ local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
5
+ ____exports.CHARACTER_STARTING_COLLECTIBLES = {
6
+ [PlayerType.POSSESSOR] = {},
7
+ [PlayerType.ISAAC] = {CollectibleType.D6},
8
+ [PlayerType.MAGDALENE] = {CollectibleType.YUM_HEART},
9
+ [PlayerType.CAIN] = {CollectibleType.LUCKY_FOOT},
10
+ [PlayerType.JUDAS] = {CollectibleType.BOOK_OF_BELIAL},
11
+ [PlayerType.BLUE_BABY] = {CollectibleType.POOP},
12
+ [PlayerType.EVE] = {CollectibleType.DEAD_BIRD, CollectibleType.WHORE_OF_BABYLON, CollectibleType.RAZOR_BLADE},
13
+ [PlayerType.SAMSON] = {CollectibleType.BLOODY_LUST},
14
+ [PlayerType.AZAZEL] = {},
15
+ [PlayerType.LAZARUS] = {CollectibleType.ANEMIC},
16
+ [PlayerType.EDEN] = {},
17
+ [PlayerType.LOST] = {CollectibleType.ETERNAL_D6},
18
+ [PlayerType.LAZARUS_2] = {CollectibleType.ANEMIC},
19
+ [PlayerType.DARK_JUDAS] = {},
20
+ [PlayerType.LILITH] = {CollectibleType.BOX_OF_FRIENDS, CollectibleType.CAMBION_CONCEPTION},
21
+ [PlayerType.KEEPER] = {CollectibleType.WOODEN_NICKEL},
22
+ [PlayerType.APOLLYON] = {CollectibleType.VOID},
23
+ [PlayerType.FORGOTTEN] = {},
24
+ [PlayerType.SOUL] = {},
25
+ [PlayerType.BETHANY] = {CollectibleType.BOOK_OF_VIRTUES},
26
+ [PlayerType.JACOB] = {},
27
+ [PlayerType.ESAU] = {},
28
+ [PlayerType.ISAAC_B] = {},
29
+ [PlayerType.MAGDALENE_B] = {CollectibleType.YUM_HEART},
30
+ [PlayerType.CAIN_B] = {CollectibleType.BAG_OF_CRAFTING},
31
+ [PlayerType.JUDAS_B] = {CollectibleType.DARK_ARTS},
32
+ [PlayerType.BLUE_BABY_B] = {CollectibleType.HOLD},
33
+ [PlayerType.EVE_B] = {CollectibleType.SUMPTORIUM},
34
+ [PlayerType.SAMSON_B] = {},
35
+ [PlayerType.AZAZEL_B] = {},
36
+ [PlayerType.LAZARUS_B] = {CollectibleType.FLIP},
37
+ [PlayerType.EDEN_B] = {},
38
+ [PlayerType.LOST_B] = {},
39
+ [PlayerType.LILITH_B] = {},
40
+ [PlayerType.KEEPER_B] = {},
41
+ [PlayerType.APOLLYON_B] = {CollectibleType.ABYSS},
42
+ [PlayerType.FORGOTTEN_B] = {},
43
+ [PlayerType.BETHANY_B] = {CollectibleType.LEMEGETON},
44
+ [PlayerType.JACOB_B] = {CollectibleType.ANIMA_SOLA},
45
+ [PlayerType.LAZARUS_2_B] = {CollectibleType.FLIP},
46
+ [PlayerType.JACOB_2_B] = {CollectibleType.ANIMA_SOLA},
47
+ [PlayerType.SOUL_B] = {}
48
+ }
49
+ return ____exports
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "22.0.0",
3
+ "version": "23.0.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -1,7 +1,8 @@
1
- import { PlayerType } from "isaac-typescript-definitions";
1
+ import { CollectibleType, PlayerType } from "isaac-typescript-definitions";
2
2
  import { LAST_VANILLA_CHARACTER } from "../core/constantsFirstLast";
3
3
  import { CHARACTER_DAMAGE_MULTIPLIERS } from "../objects/characterDamageMultipliers";
4
4
  import { CHARACTER_NAMES } from "../objects/characterNames";
5
+ import { CHARACTER_STARTING_COLLECTIBLES } from "../objects/characterStartingCollectibles";
5
6
  import { CHARACTERS_THAT_START_WITH_AN_ACTIVE_ITEM_SET } from "../sets/charactersThatStartWithAnActiveItemSet";
6
7
  import { CHARACTERS_WITH_BLACK_HEART_FROM_ETERNAL_HEART_SET } from "../sets/charactersWithBlackHeartFromEternalHeartSet";
7
8
  import { CHARACTERS_WITH_FREE_DEVIL_DEALS_SET } from "../sets/charactersWithFreeDevilDealsSet";
@@ -134,6 +135,18 @@ export function getCharacterName(character: PlayerType): string {
134
135
  return CHARACTER_NAMES[character];
135
136
  }
136
137
 
138
+ /**
139
+ * Helper function to get the collectibles that are granted to a particular character at the
140
+ * beginning of a run.
141
+ *
142
+ * Note that this will return an empty array for Eden and Tainted Eden.
143
+ */
144
+ export function getCharacterStartingItems(
145
+ character: PlayerType,
146
+ ): readonly CollectibleType[] {
147
+ return CHARACTER_STARTING_COLLECTIBLES[character];
148
+ }
149
+
137
150
  export function isFlyingCharacter(player: EntityPlayer): boolean {
138
151
  const character = player.GetPlayerType();
139
152
  return FLYING_CHARACTERS.has(character);
@@ -57,7 +57,7 @@ export function isEntity(variable: unknown): variable is Entity {
57
57
  return getIsaacAPIClassName(variable) === "Entity";
58
58
  }
59
59
 
60
- /** Helper function to detect if a variable is of type `EntityEffect`. */
60
+ /** Helper function to detect if a variable is of type `EntityFamiliar`. */
61
61
  export function isFamiliar(variable: unknown): variable is EntityFamiliar {
62
62
  return getIsaacAPIClassName(variable) === "EntityEffect";
63
63
  }
@@ -24,6 +24,21 @@ import {
24
24
  import { isNumber } from "./types";
25
25
  import { repeat } from "./utils";
26
26
 
27
+ /**
28
+ * Helper function to add one or more collectibles to a player.
29
+ *
30
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
31
+ * add.
32
+ */
33
+ export function addCollectible(
34
+ player: EntityPlayer,
35
+ ...collectibleTypes: CollectibleType[]
36
+ ): void {
37
+ for (const collectibleType of collectibleTypes) {
38
+ player.AddCollectible(collectibleType);
39
+ }
40
+ }
41
+
27
42
  export function addCollectibleCostume(
28
43
  player: EntityPlayer,
29
44
  collectibleType: CollectibleType,
@@ -438,6 +453,34 @@ export function getTotalPlayerCollectibles(
438
453
  return sumArray(numCollectiblesArray);
439
454
  }
440
455
 
456
+ /**
457
+ * Helper function to check to see if a player has one or more collectibles.
458
+ *
459
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
460
+ * check for. Returns true if the player has any of the supplied collectible types.
461
+ */
462
+ export function hasCollectible(
463
+ player: EntityPlayer,
464
+ ...collectibleTypes: CollectibleType[]
465
+ ): boolean {
466
+ return collectibleTypes.some((collectibleType) =>
467
+ player.HasCollectible(collectibleType),
468
+ );
469
+ }
470
+
471
+ /**
472
+ * Helper function to check to see if a player has one or more transformations.
473
+ *
474
+ * This function is variadic, meaning that you can supply as many transformations as you want to
475
+ * check for. Returns true if the player has any of the supplied transformations.
476
+ */
477
+ export function hasForm(
478
+ player: EntityPlayer,
479
+ ...playerForms: PlayerForm[]
480
+ ): boolean {
481
+ return playerForms.some((playerForm) => player.HasPlayerForm(playerForm));
482
+ }
483
+
441
484
  /** After touching a white fire, a player will turn into The Lost until they clear a room. */
442
485
  export function hasLostCurse(player: EntityPlayer): boolean {
443
486
  const effects = player.GetEffects();
@@ -565,6 +608,17 @@ export function isLost(player: EntityPlayer): boolean {
565
608
  return character === PlayerType.LOST || character === PlayerType.LOST_B;
566
609
  }
567
610
 
611
+ function isTaintedModded(player: EntityPlayer) {
612
+ // This algorithm only works for modded characters because the `Isaac.GetPlayerTypeByName` method
613
+ // is bugged.
614
+ // https://github.com/Meowlala/RepentanceAPIIssueTracker/issues/117
615
+ const character = player.GetPlayerType();
616
+ const name = player.GetName();
617
+ const taintedCharacter = Isaac.GetPlayerTypeByName(name, true);
618
+
619
+ return character === taintedCharacter;
620
+ }
621
+
568
622
  export function isModdedPlayer(player: EntityPlayer): boolean {
569
623
  return !isVanillaPlayer(player);
570
624
  }
@@ -588,17 +642,6 @@ export function isTainted(player: EntityPlayer): boolean {
588
642
  : isTaintedModded(player);
589
643
  }
590
644
 
591
- function isTaintedModded(player: EntityPlayer) {
592
- // This algorithm only works for modded characters because the `Isaac.GetPlayerTypeByName` method
593
- // is bugged.
594
- // https://github.com/Meowlala/RepentanceAPIIssueTracker/issues/117
595
- const character = player.GetPlayerType();
596
- const name = player.GetName();
597
- const taintedCharacter = Isaac.GetPlayerTypeByName(name, true);
598
-
599
- return character === taintedCharacter;
600
- }
601
-
602
645
  /** Helper function for detecting when a player is Tainted Lazarus or Dead Tainted Lazarus. */
603
646
  export function isTaintedLazarus(player: EntityPlayer): boolean {
604
647
  const character = player.GetPlayerType();
@@ -613,49 +656,6 @@ export function isVanillaPlayer(player: EntityPlayer): boolean {
613
656
  return isVanillaCharacter(character);
614
657
  }
615
658
 
616
- /**
617
- * Helper function to add one or more collectibles to a player.
618
- *
619
- * This function is variadic, meaning that you can supply as many collectible types as you want to
620
- * add.
621
- */
622
- export function playerAddCollectible(
623
- player: EntityPlayer,
624
- ...collectibleTypes: CollectibleType[]
625
- ): void {
626
- for (const collectibleType of collectibleTypes) {
627
- player.AddCollectible(collectibleType);
628
- }
629
- }
630
-
631
- /**
632
- * Helper function to check to see if a player has one or more collectibles.
633
- *
634
- * This function is variadic, meaning that you can supply as many collectible types as you want to
635
- * check for. Returns true if the player has any of the supplied collectible types.
636
- */
637
- export function playerHasCollectible(
638
- player: EntityPlayer,
639
- ...collectibleTypes: CollectibleType[]
640
- ): boolean {
641
- return collectibleTypes.some((collectibleType) =>
642
- player.HasCollectible(collectibleType),
643
- );
644
- }
645
-
646
- /**
647
- * Helper function to check to see if a player has one or more transformations.
648
- *
649
- * This function is variadic, meaning that you can supply as many transformations as you want to
650
- * check for. Returns true if the player has any of the supplied transformations.
651
- */
652
- export function playerHasForm(
653
- player: EntityPlayer,
654
- ...playerForms: PlayerForm[]
655
- ): boolean {
656
- return playerForms.some((playerForm) => player.HasPlayerForm(playerForm));
657
- }
658
-
659
659
  /**
660
660
  * Helper function to remove all of the active items from a player. This includes the Schoolbag item
661
661
  * and any pocket actives.
@@ -667,11 +667,11 @@ export function removeAllActiveItems(player: EntityPlayer): void {
667
667
  continue;
668
668
  }
669
669
 
670
- let hasCollectible: boolean;
670
+ let stillHasCollectible: boolean;
671
671
  do {
672
672
  player.RemoveCollectible(collectibleType);
673
- hasCollectible = player.HasCollectible(collectibleType);
674
- } while (hasCollectible);
673
+ stillHasCollectible = player.HasCollectible(collectibleType);
674
+ } while (stillHasCollectible);
675
675
  }
676
676
  }
677
677
 
@@ -696,6 +696,21 @@ export function removeAllPlayerTrinkets(player: EntityPlayer): void {
696
696
  }
697
697
  }
698
698
 
699
+ /**
700
+ * Helper function to remove one or more collectibles to a player.
701
+ *
702
+ * This function is variadic, meaning that you can supply as many collectible types as you want to
703
+ * remove.
704
+ */
705
+ export function removeCollectible(
706
+ player: EntityPlayer,
707
+ ...collectibleTypes: CollectibleType[]
708
+ ): void {
709
+ for (const collectibleType of collectibleTypes) {
710
+ player.RemoveCollectible(collectibleType);
711
+ }
712
+ }
713
+
699
714
  /**
700
715
  * Helper function to remove a collectible costume from a player. Use this helper function to avoid
701
716
  * having to request the collectible from the item config.
@@ -0,0 +1,144 @@
1
+ import { CollectibleType, PlayerType } from "isaac-typescript-definitions";
2
+
3
+ export const CHARACTER_STARTING_COLLECTIBLES = {
4
+ // -1
5
+ [PlayerType.POSSESSOR]: [],
6
+
7
+ // 0
8
+ [PlayerType.ISAAC]: [CollectibleType.D6],
9
+
10
+ // 1
11
+ [PlayerType.MAGDALENE]: [CollectibleType.YUM_HEART],
12
+
13
+ // 2
14
+ [PlayerType.CAIN]: [CollectibleType.LUCKY_FOOT],
15
+
16
+ // 3
17
+ [PlayerType.JUDAS]: [CollectibleType.BOOK_OF_BELIAL],
18
+
19
+ // 4
20
+ [PlayerType.BLUE_BABY]: [CollectibleType.POOP],
21
+
22
+ // 5
23
+ [PlayerType.EVE]: [
24
+ CollectibleType.DEAD_BIRD, // 117
25
+ CollectibleType.WHORE_OF_BABYLON, // 122
26
+ CollectibleType.RAZOR_BLADE, // 126
27
+ ],
28
+
29
+ // 6
30
+ [PlayerType.SAMSON]: [CollectibleType.BLOODY_LUST],
31
+
32
+ // 7
33
+ [PlayerType.AZAZEL]: [],
34
+
35
+ // 8
36
+ [PlayerType.LAZARUS]: [CollectibleType.ANEMIC],
37
+ // (Lazarus Rags is not granted; the extra life is innate.)
38
+
39
+ // 9
40
+ [PlayerType.EDEN]: [],
41
+
42
+ // 10
43
+ [PlayerType.LOST]: [CollectibleType.ETERNAL_D6],
44
+ // (Holy Mantle is not granted; the effect is innate.)
45
+
46
+ // 11
47
+ [PlayerType.LAZARUS_2]: [CollectibleType.ANEMIC],
48
+ // (Even if the run is started as Lazarus 2 using e.g. `restart 11`, Anemic is still granted.)
49
+
50
+ // 12
51
+ [PlayerType.DARK_JUDAS]: [],
52
+
53
+ // 13
54
+ [PlayerType.LILITH]: [
55
+ CollectibleType.BOX_OF_FRIENDS, // 357
56
+ CollectibleType.CAMBION_CONCEPTION, // 412
57
+ ],
58
+
59
+ // 14
60
+ [PlayerType.KEEPER]: [CollectibleType.WOODEN_NICKEL],
61
+
62
+ // 15
63
+ [PlayerType.APOLLYON]: [CollectibleType.VOID],
64
+
65
+ // 16
66
+ [PlayerType.FORGOTTEN]: [],
67
+
68
+ // 17
69
+ [PlayerType.SOUL]: [],
70
+
71
+ // 18
72
+ [PlayerType.BETHANY]: [CollectibleType.BOOK_OF_VIRTUES],
73
+
74
+ // 19
75
+ [PlayerType.JACOB]: [],
76
+
77
+ // 20
78
+ [PlayerType.ESAU]: [],
79
+
80
+ // 21
81
+ [PlayerType.ISAAC_B]: [],
82
+
83
+ // 22
84
+ [PlayerType.MAGDALENE_B]: [CollectibleType.YUM_HEART],
85
+
86
+ // 23
87
+ [PlayerType.CAIN_B]: [CollectibleType.BAG_OF_CRAFTING],
88
+
89
+ // 24
90
+ [PlayerType.JUDAS_B]: [CollectibleType.DARK_ARTS],
91
+
92
+ // 25
93
+ [PlayerType.BLUE_BABY_B]: [CollectibleType.HOLD],
94
+
95
+ // 26
96
+ [PlayerType.EVE_B]: [CollectibleType.SUMPTORIUM],
97
+
98
+ // 27
99
+ [PlayerType.SAMSON_B]: [],
100
+ // (Berserk is not granted; the rage is innate.)
101
+
102
+ // 28
103
+ [PlayerType.AZAZEL_B]: [],
104
+
105
+ // 29
106
+ [PlayerType.LAZARUS_B]: [CollectibleType.FLIP],
107
+
108
+ // 30
109
+ [PlayerType.EDEN_B]: [],
110
+
111
+ // 31
112
+ [PlayerType.LOST_B]: [],
113
+
114
+ // 32
115
+ [PlayerType.LILITH_B]: [],
116
+
117
+ // 33
118
+ [PlayerType.KEEPER_B]: [],
119
+
120
+ // 34
121
+ [PlayerType.APOLLYON_B]: [CollectibleType.ABYSS],
122
+
123
+ // 35
124
+ [PlayerType.FORGOTTEN_B]: [],
125
+
126
+ // 36
127
+ [PlayerType.BETHANY_B]: [CollectibleType.LEMEGETON],
128
+
129
+ // 37
130
+ [PlayerType.JACOB_B]: [CollectibleType.ANIMA_SOLA],
131
+
132
+ // 38
133
+ [PlayerType.LAZARUS_2_B]: [CollectibleType.FLIP],
134
+ // (Even if the run is started as Dead Tainted Lazarus using e.g. `restart 38`, Flip is still
135
+ // granted.)
136
+
137
+ // 39
138
+ [PlayerType.JACOB_2_B]: [CollectibleType.ANIMA_SOLA],
139
+ // (Even if the run is started as Tainted Jacob in "Lost" form using e.g. `restart 39`, Anima Sola
140
+ // is still granted.)
141
+
142
+ // 40
143
+ [PlayerType.SOUL_B]: [],
144
+ } as const satisfies Record<PlayerType, readonly CollectibleType[]>;