isaacscript-common 31.8.1 → 31.9.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.rollup.d.ts
CHANGED
|
@@ -8107,8 +8107,11 @@ declare type ISCFeatureTupleToClassTuple<T extends ISCFeature[]> = {
|
|
|
8107
8107
|
*/
|
|
8108
8108
|
export declare function isCharacter(player: EntityPlayer, ...characters: PlayerType[]): boolean;
|
|
8109
8109
|
|
|
8110
|
-
/**
|
|
8111
|
-
|
|
8110
|
+
/**
|
|
8111
|
+
* Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
8112
|
+
* variants.
|
|
8113
|
+
*/
|
|
8114
|
+
export declare function isChest(pickupOrPickupVariant: EntityPickup | PickupVariant): boolean;
|
|
8112
8115
|
|
|
8113
8116
|
/**
|
|
8114
8117
|
* Helper function to detect if a particular player is a "child" player, meaning that they have a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common 31.
|
|
3
|
+
isaacscript-common 31.9.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -39718,6 +39718,8 @@ local ____pickupVariants = require("src.functions.pickupVariants")
|
|
|
39718
39718
|
local isHeart = ____pickupVariants.isHeart
|
|
39719
39719
|
local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
39720
39720
|
local getHearts = ____pickupsSpecific.getHearts
|
|
39721
|
+
local ____types = require("src.functions.types")
|
|
39722
|
+
local isNumber = ____types.isNumber
|
|
39721
39723
|
function ____exports.getCoinValue(self, coinSubType)
|
|
39722
39724
|
local value = COIN_SUB_TYPE_TO_VALUE[coinSubType]
|
|
39723
39725
|
return value or DEFAULT_COIN_VALUE
|
|
@@ -39729,8 +39731,9 @@ function ____exports.getRedHearts(self)
|
|
|
39729
39731
|
function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
|
|
39730
39732
|
)
|
|
39731
39733
|
end
|
|
39732
|
-
function ____exports.isChest(self,
|
|
39733
|
-
|
|
39734
|
+
function ____exports.isChest(self, pickupOrPickupVariant)
|
|
39735
|
+
local pickupVariant = isNumber(nil, pickupOrPickupVariant) and pickupOrPickupVariant or pickupOrPickupVariant.Variant
|
|
39736
|
+
return CHEST_PICKUP_VARIANTS:has(pickupVariant)
|
|
39734
39737
|
end
|
|
39735
39738
|
function ____exports.isRedHeart(self, pickup)
|
|
39736
39739
|
return isHeart(nil, pickup) and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoinSubType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { CoinSubType, PickupVariant } from "isaac-typescript-definitions";
|
|
2
2
|
/**
|
|
3
3
|
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
4
4
|
* sub-types.
|
|
@@ -6,8 +6,11 @@ import type { CoinSubType } from "isaac-typescript-definitions";
|
|
|
6
6
|
export declare function getCoinValue(coinSubType: CoinSubType): int;
|
|
7
7
|
/** Helper function to get all of the red heart pickup entities in the room. */
|
|
8
8
|
export declare function getRedHearts(): EntityPickupHeart[];
|
|
9
|
-
/**
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
11
|
+
* variants.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isChest(pickupOrPickupVariant: EntityPickup | PickupVariant): boolean;
|
|
11
14
|
/**
|
|
12
15
|
* Helper function to test if the provided pickup matches one of the various red heart sub types.
|
|
13
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAY/E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,GAAG,CAK1D;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,iBAAiB,EAAE,CAGlD;AAED;;;GAGG;AACH,wBAAgB,OAAO,CACrB,qBAAqB,EAAE,YAAY,GAAG,aAAa,GAClD,OAAO,CAMT;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE,CAGjE"}
|
|
@@ -14,6 +14,8 @@ local ____pickupVariants = require("src.functions.pickupVariants")
|
|
|
14
14
|
local isHeart = ____pickupVariants.isHeart
|
|
15
15
|
local ____pickupsSpecific = require("src.functions.pickupsSpecific")
|
|
16
16
|
local getHearts = ____pickupsSpecific.getHearts
|
|
17
|
+
local ____types = require("src.functions.types")
|
|
18
|
+
local isNumber = ____types.isNumber
|
|
17
19
|
--- Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
18
20
|
-- sub-types.
|
|
19
21
|
function ____exports.getCoinValue(self, coinSubType)
|
|
@@ -28,9 +30,11 @@ function ____exports.getRedHearts(self)
|
|
|
28
30
|
function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
|
|
29
31
|
)
|
|
30
32
|
end
|
|
31
|
-
--- Helper function to test if the provided pickup matches one of the various chest
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
--- Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
34
|
+
-- variants.
|
|
35
|
+
function ____exports.isChest(self, pickupOrPickupVariant)
|
|
36
|
+
local pickupVariant = isNumber(nil, pickupOrPickupVariant) and pickupOrPickupVariant or pickupOrPickupVariant.Variant
|
|
37
|
+
return CHEST_PICKUP_VARIANTS:has(pickupVariant)
|
|
34
38
|
end
|
|
35
39
|
--- Helper function to test if the provided pickup matches one of the various red heart sub types.
|
|
36
40
|
function ____exports.isRedHeart(self, pickup)
|
package/package.json
CHANGED
package/src/functions/pickups.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoinSubType } from "isaac-typescript-definitions";
|
|
1
|
+
import type { CoinSubType, PickupVariant } from "isaac-typescript-definitions";
|
|
2
2
|
import {
|
|
3
3
|
COIN_SUB_TYPE_TO_VALUE,
|
|
4
4
|
DEFAULT_COIN_VALUE,
|
|
@@ -8,6 +8,7 @@ import { RED_HEART_SUB_TYPES_SET } from "../sets/redHeartSubTypesSet";
|
|
|
8
8
|
import { removeEntities } from "./entities";
|
|
9
9
|
import { isHeart } from "./pickupVariants";
|
|
10
10
|
import { getHearts } from "./pickupsSpecific";
|
|
11
|
+
import { isNumber } from "./types";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
@@ -26,9 +27,18 @@ export function getRedHearts(): EntityPickupHeart[] {
|
|
|
26
27
|
return hearts.filter((heart) => RED_HEART_SUB_TYPES_SET.has(heart.SubType));
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Helper function to test if the provided pickup or pickup variant matches one of the various chest
|
|
32
|
+
* variants.
|
|
33
|
+
*/
|
|
34
|
+
export function isChest(
|
|
35
|
+
pickupOrPickupVariant: EntityPickup | PickupVariant,
|
|
36
|
+
): boolean {
|
|
37
|
+
const pickupVariant = isNumber(pickupOrPickupVariant)
|
|
38
|
+
? pickupOrPickupVariant
|
|
39
|
+
: pickupOrPickupVariant.Variant;
|
|
40
|
+
|
|
41
|
+
return CHEST_PICKUP_VARIANTS.has(pickupVariant);
|
|
32
42
|
}
|
|
33
43
|
|
|
34
44
|
/**
|