isaacscript-common 20.16.0 → 20.18.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.
- package/dist/index.d.ts +35 -18
- package/dist/isaacscript-common.lua +249 -187
- package/dist/src/functions/collectibles.d.ts +24 -18
- package/dist/src/functions/collectibles.d.ts.map +1 -1
- package/dist/src/functions/collectibles.lua +68 -24
- package/dist/src/functions/entities.d.ts +9 -0
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +27 -1
- package/dist/src/functions/pickupVariants.d.ts.map +1 -1
- package/dist/src/functions/pickupVariants.lua +12 -11
- package/package.json +1 -1
- package/src/functions/collectibles.ts +149 -24
- package/src/functions/entities.ts +26 -0
- package/src/functions/pickupVariants.ts +38 -12
package/dist/index.d.ts
CHANGED
|
@@ -1318,7 +1318,7 @@ export declare function closeDoorFast(door: GridEntityDoor): void;
|
|
|
1318
1318
|
export declare const COLLECTIBLE_INITIAL_WAIT = 20;
|
|
1319
1319
|
|
|
1320
1320
|
/** Helper function to check in the item config if a given collectible has a given cache flag. */
|
|
1321
|
-
export declare function collectibleHasCacheFlag(
|
|
1321
|
+
export declare function collectibleHasCacheFlag(collectibleOrCollectibleType: EntityPickup | CollectibleType, cacheFlag: CacheFlag): boolean;
|
|
1322
1322
|
|
|
1323
1323
|
export declare function collectibleHasTag(collectibleType: CollectibleType, tag: ItemConfigTag): boolean;
|
|
1324
1324
|
|
|
@@ -3269,6 +3269,16 @@ declare class DisableInputs extends Feature {
|
|
|
3269
3269
|
/** This is also the distance that a player spawns from the door that they enter a room from. */
|
|
3270
3270
|
export declare const DISTANCE_OF_GRID_TILE = 40;
|
|
3271
3271
|
|
|
3272
|
+
/**
|
|
3273
|
+
* Helper function to check if one or more matching entities exist in the current room. It uses the
|
|
3274
|
+
* `doesEntityExist` helper function to determine this.
|
|
3275
|
+
*
|
|
3276
|
+
* @param entityTypes An array or set of the entity types that you want to check for. Will return
|
|
3277
|
+
* true if any of the provided entity types exist.
|
|
3278
|
+
* @param ignoreFriendly Optional. Default is false.
|
|
3279
|
+
*/
|
|
3280
|
+
export declare function doesAnyEntityExist(entityTypes: EntityType[] | readonly EntityType[] | Set<EntityType> | ReadonlySet<EntityType>, ignoreFriendly?: boolean): boolean;
|
|
3281
|
+
|
|
3272
3282
|
/**
|
|
3273
3283
|
* Helper function to check if one or more of a specific kind of entity is present in the current
|
|
3274
3284
|
* room. It uses the `countEntities` helper function to determine this.
|
|
@@ -4356,7 +4366,7 @@ export declare function getCoinValue(coinSubType: CoinSubType): int;
|
|
|
4356
4366
|
* Helper function to get the charge type that a collectible has. Returns
|
|
4357
4367
|
* `ItemConfigChargeType.NORMAL` if the provided collectible type was not valid.
|
|
4358
4368
|
*/
|
|
4359
|
-
export declare function getCollectibleChargeType(
|
|
4369
|
+
export declare function getCollectibleChargeType(collectibleOrCollectibleType: EntityPickup | CollectibleType): ItemConfigChargeType;
|
|
4360
4370
|
|
|
4361
4371
|
/**
|
|
4362
4372
|
* Helper function to get the in-game description for a collectible. Returns "Unknown" if the
|
|
@@ -4364,19 +4374,19 @@ export declare function getCollectibleChargeType(collectibleType: CollectibleTyp
|
|
|
4364
4374
|
*
|
|
4365
4375
|
* This function works for both vanilla and modded collectibles.
|
|
4366
4376
|
*/
|
|
4367
|
-
export declare function getCollectibleDescription(
|
|
4377
|
+
export declare function getCollectibleDescription(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
|
|
4368
4378
|
|
|
4369
4379
|
/**
|
|
4370
4380
|
* Helper function to get the coin cost that a collectible item would be if it were being offered in
|
|
4371
4381
|
* a Devil Room deal. Returns 0 if passed `CollectibleType.NULL`.
|
|
4372
4382
|
*/
|
|
4373
|
-
export declare function getCollectibleDevilCoinPrice(
|
|
4383
|
+
export declare function getCollectibleDevilCoinPrice(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
|
|
4374
4384
|
|
|
4375
4385
|
/**
|
|
4376
4386
|
* Helper function to get the heart cost that a collectible item would be if it were being offered
|
|
4377
4387
|
* in a Devil Room deal. Returns 0 if passed `CollectibleType.NULL`.
|
|
4378
4388
|
*/
|
|
4379
|
-
export declare function getCollectibleDevilHeartPrice(
|
|
4389
|
+
export declare function getCollectibleDevilHeartPrice(collectibleOrCollectibleType: EntityPickup | CollectibleType, player: EntityPlayer): PickupPrice;
|
|
4380
4390
|
|
|
4381
4391
|
/**
|
|
4382
4392
|
* Helper function to get the path to a collectible PNG file. Returns the path to the question mark
|
|
@@ -4386,7 +4396,7 @@ export declare function getCollectibleDevilHeartPrice(collectibleType: Collectib
|
|
|
4386
4396
|
* The function is named "GfxFilename" to correspond to the associated `ItemConfigItem.GfxFileName`
|
|
4387
4397
|
* field.
|
|
4388
4398
|
*/
|
|
4389
|
-
export declare function getCollectibleGfxFilename(
|
|
4399
|
+
export declare function getCollectibleGfxFilename(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
|
|
4390
4400
|
|
|
4391
4401
|
/**
|
|
4392
4402
|
* Mods may have to keep track of data relating to a collectible. Finding an index for these kinds
|
|
@@ -4444,19 +4454,19 @@ export declare function getCollectibleIndex(collectible: EntityPickup): Collecti
|
|
|
4444
4454
|
* Helper function to get the initial amount of charges that a collectible has. Returns 0 if the
|
|
4445
4455
|
* provided collectible type was not valid.
|
|
4446
4456
|
*/
|
|
4447
|
-
export declare function getCollectibleInitCharge(
|
|
4457
|
+
export declare function getCollectibleInitCharge(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
|
|
4448
4458
|
|
|
4449
4459
|
/**
|
|
4450
4460
|
* Helper function to get the `ItemType` of a collectible. Returns `ItemType.ITEM_NULL` if the
|
|
4451
4461
|
* provided collectible type was not valid.
|
|
4452
4462
|
*/
|
|
4453
|
-
export declare function getCollectibleItemType(
|
|
4463
|
+
export declare function getCollectibleItemType(collectibleOrCollectibleType: EntityPickup | CollectibleType): ItemType;
|
|
4454
4464
|
|
|
4455
4465
|
/**
|
|
4456
4466
|
* Helper function to get the maximum amount of charges that a collectible has. Returns 0 if the
|
|
4457
4467
|
* provided collectible type was not valid.
|
|
4458
4468
|
*/
|
|
4459
|
-
export declare function getCollectibleMaxCharges(
|
|
4469
|
+
export declare function getCollectibleMaxCharges(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
|
|
4460
4470
|
|
|
4461
4471
|
/**
|
|
4462
4472
|
* Helper function to get the name of a collectible. Returns "Unknown" if the provided collectible
|
|
@@ -4466,7 +4476,7 @@ export declare function getCollectibleMaxCharges(collectibleType: CollectibleTyp
|
|
|
4466
4476
|
*
|
|
4467
4477
|
* This function works for both vanilla and modded collectibles.
|
|
4468
4478
|
*/
|
|
4469
|
-
export declare function getCollectibleName(
|
|
4479
|
+
export declare function getCollectibleName(collectibleOrCollectibleType: EntityPickup | CollectibleType): string;
|
|
4470
4480
|
|
|
4471
4481
|
/**
|
|
4472
4482
|
* Helper function to get the "pedestal type" of a collectible. For example, it might be sitting on
|
|
@@ -4478,7 +4488,7 @@ export declare function getCollectiblePedestalType(collectible: EntityPickup): C
|
|
|
4478
4488
|
* Helper function to get a collectible's quality. For example, Mom's Knife has a quality of 4.
|
|
4479
4489
|
* Returns 0 if the provided collectible type was not valid.
|
|
4480
4490
|
*/
|
|
4481
|
-
export declare function getCollectibleQuality(
|
|
4491
|
+
export declare function getCollectibleQuality(collectibleOrCollectibleType: EntityPickup | CollectibleType): int;
|
|
4482
4492
|
|
|
4483
4493
|
/**
|
|
4484
4494
|
* Helper function to get all of the collectible entities in the room.
|
|
@@ -4499,7 +4509,7 @@ export declare function getCollectibles(collectibleType?: CollectibleType): Enti
|
|
|
4499
4509
|
* const itemConfigTags = getCollectibleTags(collectibleType); // itemConfigTags is "18350080"
|
|
4500
4510
|
* ```
|
|
4501
4511
|
*/
|
|
4502
|
-
export declare function getCollectibleTags(
|
|
4512
|
+
export declare function getCollectibleTags(collectibleOrCollectibleType: EntityPickup | CollectibleType): BitFlags<ItemConfigTag>;
|
|
4503
4513
|
|
|
4504
4514
|
/**
|
|
4505
4515
|
* Gets the entities that have a hitbox that overlaps with any part of the square that the grid
|
|
@@ -7617,7 +7627,7 @@ export declare function isFunction(variable: unknown): variable is Function;
|
|
|
7617
7627
|
* glitched items once a player has TMTRAINER. However, glitched items can also "naturally" appear
|
|
7618
7628
|
* in secret rooms and I AM ERROR rooms if the "Corrupted Data" achievement is unlocked.
|
|
7619
7629
|
*/
|
|
7620
|
-
export declare function isGlitchedCollectible(
|
|
7630
|
+
export declare function isGlitchedCollectible(collectible: EntityPickup): boolean;
|
|
7621
7631
|
|
|
7622
7632
|
export declare function isGoldenTrinketType(trinketType: TrinketType): boolean;
|
|
7623
7633
|
|
|
@@ -7654,7 +7664,7 @@ export declare function isHeart(pickup: EntityPickup): pickup is EntityPickupHea
|
|
|
7654
7664
|
*
|
|
7655
7665
|
* Hidden collectibles will not show up in any pools and Eden will not start with them.
|
|
7656
7666
|
*/
|
|
7657
|
-
export declare function isHiddenCollectible(
|
|
7667
|
+
export declare function isHiddenCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean;
|
|
7658
7668
|
|
|
7659
7669
|
export declare function isHiddenSecretRoomDoor(door: GridEntityDoor): boolean;
|
|
7660
7670
|
|
|
@@ -7766,7 +7776,7 @@ export declare function isOdd(num: int): boolean;
|
|
|
7766
7776
|
* Returns true if the item type in the item config is equal to `ItemType.ITEM_PASSIVE` or
|
|
7767
7777
|
* `ItemType.ITEM_FAMILIAR`.
|
|
7768
7778
|
*/
|
|
7769
|
-
export declare function isPassiveCollectible(
|
|
7779
|
+
export declare function isPassiveCollectible(collectibleOrCollectibleType: EntityPickup | CollectibleType): boolean;
|
|
7770
7780
|
|
|
7771
7781
|
/** Helper function to narrow the type of `PickingUpItem`. */
|
|
7772
7782
|
export declare function isPickingUpItemCollectible(pickingUpItem: PickingUpItem): pickingUpItem is PickingUpItemCollectible;
|
|
@@ -7822,7 +7832,7 @@ export declare function isPrimitive(variable: unknown): variable is boolean | nu
|
|
|
7822
7832
|
export declare function isProjectile(variable: unknown): variable is EntityProjectile;
|
|
7823
7833
|
|
|
7824
7834
|
/** Helper function to check if a collectible type is a particular quality. */
|
|
7825
|
-
export declare function isQuality(
|
|
7835
|
+
export declare function isQuality(collectibleOrCollectibleType: EntityPickup | CollectibleType, quality: int): boolean;
|
|
7826
7836
|
|
|
7827
7837
|
export declare function isQuestCollectible(collectibleType: CollectibleType): boolean;
|
|
7828
7838
|
|
|
@@ -7969,8 +7979,8 @@ export declare function isSin(npc: EntityNPC): boolean;
|
|
|
7969
7979
|
|
|
7970
7980
|
/**
|
|
7971
7981
|
* Helper function to determine if a particular collectible will disappear from the player's
|
|
7972
|
-
* inventory upon use. Note that this will not work will modded
|
|
7973
|
-
* dynamically know if a modded
|
|
7982
|
+
* inventory upon use. Note that this will not work will modded collectibles, as there is no way to
|
|
7983
|
+
* dynamically know if a modded collectible will disappear.
|
|
7974
7984
|
*/
|
|
7975
7985
|
export declare function isSingleUseCollectible(collectibleType: CollectibleType): boolean;
|
|
7976
7986
|
|
|
@@ -14007,6 +14017,13 @@ export declare function setCollectibleEmpty(collectible: EntityPickup): void;
|
|
|
14007
14017
|
*/
|
|
14008
14018
|
export declare function setCollectibleGlitched(collectible: EntityPickup): void;
|
|
14009
14019
|
|
|
14020
|
+
/**
|
|
14021
|
+
* Helper function to set the "pedestal type" of a collectible. For example, it might be sitting on
|
|
14022
|
+
* top of a broken Blood Donation Machine and you want to change it to be sitting on top of an
|
|
14023
|
+
* opened Spiked Chest.
|
|
14024
|
+
*/
|
|
14025
|
+
export declare function setCollectiblePedestalType(collectible: EntityPickup, collectiblePedestalType: CollectiblePedestalType): void;
|
|
14026
|
+
|
|
14010
14027
|
/**
|
|
14011
14028
|
* Helper function to change the sprite of a collectible pedestal entity.
|
|
14012
14029
|
*
|