isaacscript-common 83.5.0 → 84.0.1
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/core/constantsFirstLast.d.ts +13 -9
- package/dist/core/constantsFirstLast.d.ts.map +1 -1
- package/dist/core/constantsFirstLast.lua +12 -12
- package/dist/functions/gridIndex.d.ts +2 -0
- package/dist/functions/gridIndex.d.ts.map +1 -1
- package/dist/functions/gridIndex.lua +2 -0
- package/dist/functions/utils.d.ts +4 -4
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.lua +10 -22
- package/dist/index.rollup.d.ts +19 -13
- package/dist/isaacscript-common.lua +28 -35
- package/package.json +2 -2
- package/src/core/constantsFirstLast.ts +15 -14
- package/src/functions/gridIndex.ts +2 -0
- package/src/functions/utils.ts +7 -15
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { CardType, CollectibleType, PillColor, PillEffect, PlayerType, TrinketType } from "isaac-typescript-definitions";
|
|
7
|
-
/** Equal to `CollectibleType.SAD_ONION
|
|
7
|
+
/** Equal to `CollectibleType.SAD_ONION` (1). */
|
|
8
8
|
export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
9
9
|
/**
|
|
10
10
|
* Calculated from the `CollectibleType` enum.
|
|
@@ -15,7 +15,7 @@ export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
|
15
15
|
export declare const LAST_VANILLA_COLLECTIBLE_TYPE: CollectibleType;
|
|
16
16
|
/** Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.) */
|
|
17
17
|
export declare const NUM_VANILLA_COLLECTIBLE_TYPES: number;
|
|
18
|
-
/** Equal to `TrinketType.SWALLOWED_PENNY
|
|
18
|
+
/** Equal to `TrinketType.SWALLOWED_PENNY` (1). */
|
|
19
19
|
export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
|
|
20
20
|
/**
|
|
21
21
|
* Calculated from the `TrinketType` enum.
|
|
@@ -26,13 +26,13 @@ export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
|
|
|
26
26
|
export declare const LAST_VANILLA_TRINKET_TYPE: TrinketType;
|
|
27
27
|
/** Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.) */
|
|
28
28
|
export declare const NUM_VANILLA_TRINKET_TYPES: number;
|
|
29
|
-
/** Equal to `Card.FOOL
|
|
29
|
+
/** Equal to `Card.FOOL` (1). */
|
|
30
30
|
export declare const FIRST_CARD_TYPE = CardType.FOOL;
|
|
31
31
|
/** Calculated from the `CardType` enum. */
|
|
32
32
|
export declare const LAST_VANILLA_CARD_TYPE: CardType;
|
|
33
33
|
/** Calculated from the `Card` enum. `Card.NULL` is not included. */
|
|
34
34
|
export declare const NUM_VANILLA_CARD_TYPES: number;
|
|
35
|
-
/** Equal to `PillEffect.BAD_GAS
|
|
35
|
+
/** Equal to `PillEffect.BAD_GAS` (0). */
|
|
36
36
|
export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
|
|
37
37
|
/** Calculated from the `PillEffect` enum. */
|
|
38
38
|
export declare const LAST_VANILLA_PILL_EFFECT: PillEffect;
|
|
@@ -41,26 +41,30 @@ export declare const LAST_VANILLA_PILL_EFFECT: PillEffect;
|
|
|
41
41
|
* do not have to subtract one here.)
|
|
42
42
|
*/
|
|
43
43
|
export declare const NUM_VANILLA_PILL_EFFECTS: int;
|
|
44
|
-
/** Equal to `PillColor.BLUE_BLUE
|
|
44
|
+
/** Equal to `PillColor.BLUE_BLUE` (1). */
|
|
45
45
|
export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
|
|
46
46
|
/**
|
|
47
|
-
* Equal to `PillColor.WHITE_YELLOW
|
|
47
|
+
* Equal to `PillColor.WHITE_YELLOW` (13).
|
|
48
48
|
*
|
|
49
49
|
* Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
|
|
50
50
|
* this constant.
|
|
51
51
|
*/
|
|
52
52
|
export declare const LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW;
|
|
53
|
-
/** Equal to `PillColor.HORSE_BLUE_BLUE
|
|
53
|
+
/** Equal to `PillColor.HORSE_BLUE_BLUE` (2049). */
|
|
54
54
|
export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
|
|
55
55
|
/**
|
|
56
|
-
* Equal to `PillColor.HORSE_WHITE_YELLOW
|
|
56
|
+
* Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
|
|
57
57
|
*
|
|
58
58
|
* Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
|
|
59
59
|
* purposes of this constant.
|
|
60
60
|
*/
|
|
61
61
|
export declare const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
|
|
62
|
+
/**
|
|
63
|
+
* Calculated from the difference between the first pill color and the last pill color. This does
|
|
64
|
+
* not include Gold Pills. In Repentance, this should be equal to 13.
|
|
65
|
+
*/
|
|
62
66
|
export declare const NUM_NORMAL_PILL_COLORS: number;
|
|
63
|
-
/** Equal to `PlayerType.ISAAC
|
|
67
|
+
/** Equal to `PlayerType.ISAAC` (0). */
|
|
64
68
|
export declare const FIRST_CHARACTER = PlayerType.ISAAC;
|
|
65
69
|
/** Calculated from the `PlayerType` enum. */
|
|
66
70
|
export declare const LAST_VANILLA_CHARACTER: PlayerType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constantsFirstLast.d.ts","sourceRoot":"","sources":["../../src/core/constantsFirstLast.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ,EAER,eAAe,EACf,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"constantsFirstLast.d.ts","sourceRoot":"","sources":["../../src/core/constantsFirstLast.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,QAAQ,EAER,eAAe,EACf,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAOtC,gDAAgD;AAChD,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,iBACJ,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6BAA6B,QAAqC,CAAC;AAMhF,kDAAkD;AAClD,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,aAAmC,CAAC;AAE1E,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,QAAiC,CAAC;AAMxE,gCAAgC;AAChC,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,UAAgC,CAAC;AAEpE,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAMlE,yCAAyC;AACzC,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,YAAkC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAA4B,CAAC;AAMlE,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAE7D,mDAAmD;AACnD,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QACY,CAAC;AAMhD,uCAAuC;AACvC,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAIhD,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,YAAkC,CAAC;AAMtE,8EAA8E;AAC9E,eAAO,MAAM,sBAAsB,QAA+B,CAAC"}
|
|
@@ -10,9 +10,7 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
|
10
10
|
local ____enums = require("functions.enums")
|
|
11
11
|
local getEnumLength = ____enums.getEnumLength
|
|
12
12
|
local getHighestEnumValue = ____enums.getHighestEnumValue
|
|
13
|
-
|
|
14
|
-
local iRange = ____utils.iRange
|
|
15
|
-
--- Equal to `CollectibleType.SAD_ONION`.
|
|
13
|
+
--- Equal to `CollectibleType.SAD_ONION` (1).
|
|
16
14
|
____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
|
|
17
15
|
--- Calculated from the `CollectibleType` enum.
|
|
18
16
|
--
|
|
@@ -21,7 +19,7 @@ ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
|
|
|
21
19
|
____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getHighestEnumValue(nil, CollectibleType)
|
|
22
20
|
--- Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.)
|
|
23
21
|
____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
|
|
24
|
-
--- Equal to `TrinketType.SWALLOWED_PENNY
|
|
22
|
+
--- Equal to `TrinketType.SWALLOWED_PENNY` (1).
|
|
25
23
|
____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
|
|
26
24
|
--- Calculated from the `TrinketType` enum.
|
|
27
25
|
--
|
|
@@ -30,35 +28,37 @@ ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
|
|
|
30
28
|
____exports.LAST_VANILLA_TRINKET_TYPE = getHighestEnumValue(nil, TrinketType)
|
|
31
29
|
--- Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.)
|
|
32
30
|
____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
|
|
33
|
-
--- Equal to `Card.FOOL
|
|
31
|
+
--- Equal to `Card.FOOL` (1).
|
|
34
32
|
____exports.FIRST_CARD_TYPE = CardType.FOOL
|
|
35
33
|
--- Calculated from the `CardType` enum.
|
|
36
34
|
____exports.LAST_VANILLA_CARD_TYPE = getHighestEnumValue(nil, CardType)
|
|
37
35
|
--- Calculated from the `Card` enum. `Card.NULL` is not included.
|
|
38
36
|
____exports.NUM_VANILLA_CARD_TYPES = getEnumLength(nil, CardType) - 1
|
|
39
|
-
--- Equal to `PillEffect.BAD_GAS
|
|
37
|
+
--- Equal to `PillEffect.BAD_GAS` (0).
|
|
40
38
|
____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
|
|
41
39
|
--- Calculated from the `PillEffect` enum.
|
|
42
40
|
____exports.LAST_VANILLA_PILL_EFFECT = getHighestEnumValue(nil, PillEffect)
|
|
43
41
|
--- Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
|
|
44
42
|
-- do not have to subtract one here.)
|
|
45
43
|
____exports.NUM_VANILLA_PILL_EFFECTS = getEnumLength(nil, PillEffect)
|
|
46
|
-
--- Equal to `PillColor.BLUE_BLUE
|
|
44
|
+
--- Equal to `PillColor.BLUE_BLUE` (1).
|
|
47
45
|
____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
|
|
48
|
-
--- Equal to `PillColor.WHITE_YELLOW
|
|
46
|
+
--- Equal to `PillColor.WHITE_YELLOW` (13).
|
|
49
47
|
--
|
|
50
48
|
-- Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
|
|
51
49
|
-- this constant.
|
|
52
50
|
____exports.LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
|
|
53
|
-
--- Equal to `PillColor.HORSE_BLUE_BLUE
|
|
51
|
+
--- Equal to `PillColor.HORSE_BLUE_BLUE` (2049).
|
|
54
52
|
____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
|
|
55
|
-
--- Equal to `PillColor.HORSE_WHITE_YELLOW
|
|
53
|
+
--- Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
|
|
56
54
|
--
|
|
57
55
|
-- Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
|
|
58
56
|
-- purposes of this constant.
|
|
59
57
|
____exports.LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
--- Calculated from the difference between the first pill color and the last pill color. This does
|
|
59
|
+
-- not include Gold Pills. In Repentance, this should be equal to 13.
|
|
60
|
+
____exports.NUM_NORMAL_PILL_COLORS = ____exports.LAST_NORMAL_PILL_COLOR - ____exports.FIRST_PILL_COLOR + 1
|
|
61
|
+
--- Equal to `PlayerType.ISAAC` (0).
|
|
62
62
|
____exports.FIRST_CHARACTER = PlayerType.ISAAC
|
|
63
63
|
--- Calculated from the `PlayerType` enum.
|
|
64
64
|
____exports.LAST_VANILLA_CHARACTER = getHighestEnumValue(nil, PlayerType)
|
|
@@ -3,6 +3,8 @@ import { RoomShape } from "isaac-typescript-definitions";
|
|
|
3
3
|
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
4
4
|
* vertical line, inclusive on both ends.
|
|
5
5
|
*
|
|
6
|
+
* If the first grid index is greater than the second grid index, the two will be swapped.
|
|
7
|
+
*
|
|
6
8
|
* This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
7
9
|
* horizontal or vertical line.
|
|
8
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridIndex.d.ts","sourceRoot":"","sources":["../../src/functions/gridIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAIzD
|
|
1
|
+
{"version":3,"file":"gridIndex.d.ts","sourceRoot":"","sources":["../../src/functions/gridIndex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAIzD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,GAAG,EACf,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,SAAS,GACnB,SAAS,GAAG,EAAE,CAwBhB"}
|
|
@@ -8,6 +8,8 @@ local iRange = ____utils.iRange
|
|
|
8
8
|
--- Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
9
9
|
-- vertical line, inclusive on both ends.
|
|
10
10
|
--
|
|
11
|
+
-- If the first grid index is greater than the second grid index, the two will be swapped.
|
|
12
|
+
--
|
|
11
13
|
-- This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
12
14
|
-- horizontal or vertical line.
|
|
13
15
|
function ____exports.getGridIndexesBetween(self, gridIndex1, gridIndex2, roomShape)
|
|
@@ -22,7 +22,7 @@ export declare function assertNotNull<T>(value: T, ...[msg]: [null] extends [T]
|
|
|
22
22
|
* end and exclusive on the high end. (The "e" in the function name stands for exclusive.) Thus,
|
|
23
23
|
* this function works in a similar way as the built-in `range` function from Python.
|
|
24
24
|
*
|
|
25
|
-
* If the end is lower than the start,
|
|
25
|
+
* If the end is lower than the start, an empty array will be returned.
|
|
26
26
|
*
|
|
27
27
|
* For example:
|
|
28
28
|
*
|
|
@@ -31,7 +31,7 @@ export declare function assertNotNull<T>(value: T, ...[msg]: [null] extends [T]
|
|
|
31
31
|
* - `eRange(-3)` returns `[0, -1, -2]`.
|
|
32
32
|
* - `eRange(1, 3)` returns `[1, 2]`.
|
|
33
33
|
* - `eRange(2, 5)` returns `[2, 3, 4]`.
|
|
34
|
-
* - `eRange(5, 2)` returns `[
|
|
34
|
+
* - `eRange(5, 2)` returns `[]`.
|
|
35
35
|
*
|
|
36
36
|
* @param start The integer to start at.
|
|
37
37
|
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -48,7 +48,7 @@ export declare function getTraversalDescription(key: unknown, traversalDescripti
|
|
|
48
48
|
* Helper function to return an array of integers with the specified range, inclusive on both ends.
|
|
49
49
|
* (The "i" in the function name stands for inclusive.)
|
|
50
50
|
*
|
|
51
|
-
* If the end is lower than the start,
|
|
51
|
+
* If the end is lower than the start, an empty array will be returned.
|
|
52
52
|
*
|
|
53
53
|
* For example:
|
|
54
54
|
*
|
|
@@ -57,7 +57,7 @@ export declare function getTraversalDescription(key: unknown, traversalDescripti
|
|
|
57
57
|
* - `iRange(-3)` returns `[0, -1, -2, -3]`.
|
|
58
58
|
* - `iRange(1, 3)` returns `[1, 2, 3]`.
|
|
59
59
|
* - `iRange(2, 5)` returns `[2, 3, 4, 5]`.
|
|
60
|
-
* - `iRange(5, 2)` returns `[
|
|
60
|
+
* - `iRange(5, 2)` returns `[]`.
|
|
61
61
|
*
|
|
62
62
|
* @param start The integer to start at.
|
|
63
63
|
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/functions/utils.ts"],"names":[],"mappings":";AAIA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EACR,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GAC7B,CAAC,MAAM,CAAC,GACR;IACE,iFAAiF;CAClF,GACJ,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAIxC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EACR,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GACxB,CAAC,MAAM,CAAC,GACR;IACE,4EAA4E;CAC7E,GACJ,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAInC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,SAAS,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/functions/utils.ts"],"names":[],"mappings":";AAIA;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EACR,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,GAC7B,CAAC,MAAM,CAAC,GACR;IACE,iFAAiF;CAClF,GACJ,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,SAAS,CAAC,CAIxC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAC7B,KAAK,EAAE,CAAC,EACR,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GACxB,CAAC,MAAM,CAAC,GACR;IACE,4EAA4E;CAC7E,GACJ,OAAO,CAAC,KAAK,IAAI,OAAO,CAAC,CAAC,EAAE,IAAI,CAAC,CAInC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,SAAS,GAAG,EAAE,CAY3E;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,OAAO,EACZ,oBAAoB,EAAE,MAAM,GAC3B,MAAM,CAQR;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,SAAS,SAAI,GAAG,SAAS,GAAG,EAAE,CAM3E;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAE/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAMvC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAiBtC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI,CAI7D;AAED;;;;;;;;;;;;;;GAcG;AAEH,wBAAgB,IAAI,CAAC,GAAG,IAAI,EAAE,SAAS,OAAO,EAAE,GAAG,IAAI,CAAG"}
|
package/dist/functions/utils.lua
CHANGED
|
@@ -36,7 +36,7 @@ end
|
|
|
36
36
|
-- end and exclusive on the high end. (The "e" in the function name stands for exclusive.) Thus,
|
|
37
37
|
-- this function works in a similar way as the built-in `range` function from Python.
|
|
38
38
|
--
|
|
39
|
-
-- If the end is lower than the start,
|
|
39
|
+
-- If the end is lower than the start, an empty array will be returned.
|
|
40
40
|
--
|
|
41
41
|
-- For example:
|
|
42
42
|
--
|
|
@@ -45,7 +45,7 @@ end
|
|
|
45
45
|
-- - `eRange(-3)` returns `[0, -1, -2]`.
|
|
46
46
|
-- - `eRange(1, 3)` returns `[1, 2]`.
|
|
47
47
|
-- - `eRange(2, 5)` returns `[2, 3, 4]`.
|
|
48
|
-
-- - `eRange(5, 2)` returns `[
|
|
48
|
+
-- - `eRange(5, 2)` returns `[]`.
|
|
49
49
|
--
|
|
50
50
|
-- @param start The integer to start at.
|
|
51
51
|
-- @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -59,21 +59,11 @@ function ____exports.eRange(self, start, ____end, increment)
|
|
|
59
59
|
return ____exports.eRange(nil, 0, start, increment)
|
|
60
60
|
end
|
|
61
61
|
local array = {}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
i = i + increment
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
else
|
|
71
|
-
do
|
|
72
|
-
local i = start
|
|
73
|
-
while i > ____end do
|
|
74
|
-
array[#array + 1] = i
|
|
75
|
-
i = i - increment
|
|
76
|
-
end
|
|
62
|
+
do
|
|
63
|
+
local i = start
|
|
64
|
+
while i < ____end do
|
|
65
|
+
array[#array + 1] = i
|
|
66
|
+
i = i + increment
|
|
77
67
|
end
|
|
78
68
|
end
|
|
79
69
|
return array
|
|
@@ -90,7 +80,7 @@ end
|
|
|
90
80
|
--- Helper function to return an array of integers with the specified range, inclusive on both ends.
|
|
91
81
|
-- (The "i" in the function name stands for inclusive.)
|
|
92
82
|
--
|
|
93
|
-
-- If the end is lower than the start,
|
|
83
|
+
-- If the end is lower than the start, an empty array will be returned.
|
|
94
84
|
--
|
|
95
85
|
-- For example:
|
|
96
86
|
--
|
|
@@ -99,7 +89,7 @@ end
|
|
|
99
89
|
-- - `iRange(-3)` returns `[0, -1, -2, -3]`.
|
|
100
90
|
-- - `iRange(1, 3)` returns `[1, 2, 3]`.
|
|
101
91
|
-- - `iRange(2, 5)` returns `[2, 3, 4, 5]`.
|
|
102
|
-
-- - `iRange(5, 2)` returns `[
|
|
92
|
+
-- - `iRange(5, 2)` returns `[]`.
|
|
103
93
|
--
|
|
104
94
|
-- @param start The integer to start at.
|
|
105
95
|
-- @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -112,9 +102,7 @@ function ____exports.iRange(self, start, ____end, increment)
|
|
|
112
102
|
if ____end == nil then
|
|
113
103
|
return ____exports.iRange(nil, 0, start, increment)
|
|
114
104
|
end
|
|
115
|
-
|
|
116
|
-
local exclusiveEnd = rangeIncreasing and ____end + 1 or ____end - 1
|
|
117
|
-
return ____exports.eRange(nil, start, exclusiveEnd, increment)
|
|
105
|
+
return ____exports.eRange(nil, start, ____end + 1, increment)
|
|
118
106
|
end
|
|
119
107
|
--- Helper function to check if a variable is within a certain range, inclusive on both ends.
|
|
120
108
|
--
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -4387,7 +4387,7 @@ export declare type ERange<Low extends number, High extends number> = Exclude<Na
|
|
|
4387
4387
|
* end and exclusive on the high end. (The "e" in the function name stands for exclusive.) Thus,
|
|
4388
4388
|
* this function works in a similar way as the built-in `range` function from Python.
|
|
4389
4389
|
*
|
|
4390
|
-
* If the end is lower than the start,
|
|
4390
|
+
* If the end is lower than the start, an empty array will be returned.
|
|
4391
4391
|
*
|
|
4392
4392
|
* For example:
|
|
4393
4393
|
*
|
|
@@ -4396,7 +4396,7 @@ export declare type ERange<Low extends number, High extends number> = Exclude<Na
|
|
|
4396
4396
|
* - `eRange(-3)` returns `[0, -1, -2]`.
|
|
4397
4397
|
* - `eRange(1, 3)` returns `[1, 2]`.
|
|
4398
4398
|
* - `eRange(2, 5)` returns `[2, 3, 4]`.
|
|
4399
|
-
* - `eRange(5, 2)` returns `[
|
|
4399
|
+
* - `eRange(5, 2)` returns `[]`.
|
|
4400
4400
|
*
|
|
4401
4401
|
* @param start The integer to start at.
|
|
4402
4402
|
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -4664,13 +4664,13 @@ export declare function fireProjectiles(npc: EntityNPC | undefined, position: Ve
|
|
|
4664
4664
|
*/
|
|
4665
4665
|
export declare function fireProjectilesInCircle(npc: EntityNPC | undefined, position: Vector, speed: float, numProjectiles: int): readonly EntityProjectile[];
|
|
4666
4666
|
|
|
4667
|
-
/** Equal to `Card.FOOL
|
|
4667
|
+
/** Equal to `Card.FOOL` (1). */
|
|
4668
4668
|
export declare const FIRST_CARD_TYPE = CardType.FOOL;
|
|
4669
4669
|
|
|
4670
|
-
/** Equal to `PlayerType.ISAAC
|
|
4670
|
+
/** Equal to `PlayerType.ISAAC` (0). */
|
|
4671
4671
|
export declare const FIRST_CHARACTER = PlayerType.ISAAC;
|
|
4672
4672
|
|
|
4673
|
-
/** Equal to `CollectibleType.SAD_ONION
|
|
4673
|
+
/** Equal to `CollectibleType.SAD_ONION` (1). */
|
|
4674
4674
|
export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
4675
4675
|
|
|
4676
4676
|
/**
|
|
@@ -4682,16 +4682,16 @@ export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
|
4682
4682
|
*/
|
|
4683
4683
|
export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: CollectibleType;
|
|
4684
4684
|
|
|
4685
|
-
/** Equal to `PillColor.HORSE_BLUE_BLUE
|
|
4685
|
+
/** Equal to `PillColor.HORSE_BLUE_BLUE` (2049). */
|
|
4686
4686
|
export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
|
|
4687
4687
|
|
|
4688
|
-
/** Equal to `PillColor.BLUE_BLUE
|
|
4688
|
+
/** Equal to `PillColor.BLUE_BLUE` (1). */
|
|
4689
4689
|
export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
|
|
4690
4690
|
|
|
4691
|
-
/** Equal to `PillEffect.BAD_GAS
|
|
4691
|
+
/** Equal to `PillEffect.BAD_GAS` (0). */
|
|
4692
4692
|
export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
|
|
4693
4693
|
|
|
4694
|
-
/** Equal to `TrinketType.SWALLOWED_PENNY
|
|
4694
|
+
/** Equal to `TrinketType.SWALLOWED_PENNY` (1). */
|
|
4695
4695
|
export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
|
|
4696
4696
|
|
|
4697
4697
|
declare class FlipDetection extends Feature {
|
|
@@ -6089,6 +6089,8 @@ export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSl
|
|
|
6089
6089
|
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
6090
6090
|
* vertical line, inclusive on both ends.
|
|
6091
6091
|
*
|
|
6092
|
+
* If the first grid index is greater than the second grid index, the two will be swapped.
|
|
6093
|
+
*
|
|
6092
6094
|
* This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
6093
6095
|
* horizontal or vertical line.
|
|
6094
6096
|
*/
|
|
@@ -8870,7 +8872,7 @@ export declare type IRange<Low extends number, High extends number> = Exclude<Na
|
|
|
8870
8872
|
* Helper function to return an array of integers with the specified range, inclusive on both ends.
|
|
8871
8873
|
* (The "i" in the function name stands for inclusive.)
|
|
8872
8874
|
*
|
|
8873
|
-
* If the end is lower than the start,
|
|
8875
|
+
* If the end is lower than the start, an empty array will be returned.
|
|
8874
8876
|
*
|
|
8875
8877
|
* For example:
|
|
8876
8878
|
*
|
|
@@ -8879,7 +8881,7 @@ export declare type IRange<Low extends number, High extends number> = Exclude<Na
|
|
|
8879
8881
|
* - `iRange(-3)` returns `[0, -1, -2, -3]`.
|
|
8880
8882
|
* - `iRange(1, 3)` returns `[1, 2, 3]`.
|
|
8881
8883
|
* - `iRange(2, 5)` returns `[2, 3, 4, 5]`.
|
|
8882
|
-
* - `iRange(5, 2)` returns `[
|
|
8884
|
+
* - `iRange(5, 2)` returns `[]`.
|
|
8883
8885
|
*
|
|
8884
8886
|
* @param start The integer to start at.
|
|
8885
8887
|
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -10645,7 +10647,7 @@ export declare enum LadderSubTypeCustom {
|
|
|
10645
10647
|
}
|
|
10646
10648
|
|
|
10647
10649
|
/**
|
|
10648
|
-
* Equal to `PillColor.HORSE_WHITE_YELLOW
|
|
10650
|
+
* Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
|
|
10649
10651
|
*
|
|
10650
10652
|
* Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
|
|
10651
10653
|
* purposes of this constant.
|
|
@@ -10653,7 +10655,7 @@ export declare enum LadderSubTypeCustom {
|
|
|
10653
10655
|
export declare const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
|
|
10654
10656
|
|
|
10655
10657
|
/**
|
|
10656
|
-
* Equal to `PillColor.WHITE_YELLOW
|
|
10658
|
+
* Equal to `PillColor.WHITE_YELLOW` (13).
|
|
10657
10659
|
*
|
|
10658
10660
|
* Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
|
|
10659
10661
|
* this constant.
|
|
@@ -14952,6 +14954,10 @@ declare class NoSirenSteal extends Feature {
|
|
|
14952
14954
|
*/
|
|
14953
14955
|
export declare const NUM_DIMENSIONS: number;
|
|
14954
14956
|
|
|
14957
|
+
/**
|
|
14958
|
+
* Calculated from the difference between the first pill color and the last pill color. This does
|
|
14959
|
+
* not include Gold Pills. In Repentance, this should be equal to 13.
|
|
14960
|
+
*/
|
|
14955
14961
|
export declare const NUM_NORMAL_PILL_COLORS: number;
|
|
14956
14962
|
|
|
14957
14963
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 84.0.0
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -13067,6 +13067,9 @@ return ____exports
|
|
|
13067
13067
|
["lua_modules.isaac-typescript-definitions.dist.enums.PillEffect"] = function(...)
|
|
13068
13068
|
local ____exports = {}
|
|
13069
13069
|
--- This enum is contiguous. (Every value is satisfied between 0 and 49, inclusive.)
|
|
13070
|
+
--
|
|
13071
|
+
-- Note that the vanilla enum includes `NULL` (-1). Since it should be impossible to ever retrieve
|
|
13072
|
+
-- this value from the API, it is removed from the IsaacScript enum.
|
|
13070
13073
|
____exports.PillEffect = {}
|
|
13071
13074
|
____exports.PillEffect.BAD_GAS = 0
|
|
13072
13075
|
____exports.PillEffect[____exports.PillEffect.BAD_GAS] = "BAD_GAS"
|
|
@@ -17807,7 +17810,7 @@ end
|
|
|
17807
17810
|
-- end and exclusive on the high end. (The "e" in the function name stands for exclusive.) Thus,
|
|
17808
17811
|
-- this function works in a similar way as the built-in `range` function from Python.
|
|
17809
17812
|
--
|
|
17810
|
-
-- If the end is lower than the start,
|
|
17813
|
+
-- If the end is lower than the start, an empty array will be returned.
|
|
17811
17814
|
--
|
|
17812
17815
|
-- For example:
|
|
17813
17816
|
--
|
|
@@ -17816,7 +17819,7 @@ end
|
|
|
17816
17819
|
-- - `eRange(-3)` returns `[0, -1, -2]`.
|
|
17817
17820
|
-- - `eRange(1, 3)` returns `[1, 2]`.
|
|
17818
17821
|
-- - `eRange(2, 5)` returns `[2, 3, 4]`.
|
|
17819
|
-
-- - `eRange(5, 2)` returns `[
|
|
17822
|
+
-- - `eRange(5, 2)` returns `[]`.
|
|
17820
17823
|
--
|
|
17821
17824
|
-- @param start The integer to start at.
|
|
17822
17825
|
-- @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -17830,21 +17833,11 @@ function ____exports.eRange(self, start, ____end, increment)
|
|
|
17830
17833
|
return ____exports.eRange(nil, 0, start, increment)
|
|
17831
17834
|
end
|
|
17832
17835
|
local array = {}
|
|
17833
|
-
|
|
17834
|
-
|
|
17835
|
-
|
|
17836
|
-
|
|
17837
|
-
|
|
17838
|
-
i = i + increment
|
|
17839
|
-
end
|
|
17840
|
-
end
|
|
17841
|
-
else
|
|
17842
|
-
do
|
|
17843
|
-
local i = start
|
|
17844
|
-
while i > ____end do
|
|
17845
|
-
array[#array + 1] = i
|
|
17846
|
-
i = i - increment
|
|
17847
|
-
end
|
|
17836
|
+
do
|
|
17837
|
+
local i = start
|
|
17838
|
+
while i < ____end do
|
|
17839
|
+
array[#array + 1] = i
|
|
17840
|
+
i = i + increment
|
|
17848
17841
|
end
|
|
17849
17842
|
end
|
|
17850
17843
|
return array
|
|
@@ -17861,7 +17854,7 @@ end
|
|
|
17861
17854
|
--- Helper function to return an array of integers with the specified range, inclusive on both ends.
|
|
17862
17855
|
-- (The "i" in the function name stands for inclusive.)
|
|
17863
17856
|
--
|
|
17864
|
-
-- If the end is lower than the start,
|
|
17857
|
+
-- If the end is lower than the start, an empty array will be returned.
|
|
17865
17858
|
--
|
|
17866
17859
|
-- For example:
|
|
17867
17860
|
--
|
|
@@ -17870,7 +17863,7 @@ end
|
|
|
17870
17863
|
-- - `iRange(-3)` returns `[0, -1, -2, -3]`.
|
|
17871
17864
|
-- - `iRange(1, 3)` returns `[1, 2, 3]`.
|
|
17872
17865
|
-- - `iRange(2, 5)` returns `[2, 3, 4, 5]`.
|
|
17873
|
-
-- - `iRange(5, 2)` returns `[
|
|
17866
|
+
-- - `iRange(5, 2)` returns `[]`.
|
|
17874
17867
|
--
|
|
17875
17868
|
-- @param start The integer to start at.
|
|
17876
17869
|
-- @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -17883,9 +17876,7 @@ function ____exports.iRange(self, start, ____end, increment)
|
|
|
17883
17876
|
if ____end == nil then
|
|
17884
17877
|
return ____exports.iRange(nil, 0, start, increment)
|
|
17885
17878
|
end
|
|
17886
|
-
|
|
17887
|
-
local exclusiveEnd = rangeIncreasing and ____end + 1 or ____end - 1
|
|
17888
|
-
return ____exports.eRange(nil, start, exclusiveEnd, increment)
|
|
17879
|
+
return ____exports.eRange(nil, start, ____end + 1, increment)
|
|
17889
17880
|
end
|
|
17890
17881
|
--- Helper function to check if a variable is within a certain range, inclusive on both ends.
|
|
17891
17882
|
--
|
|
@@ -20189,9 +20180,7 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
|
|
|
20189
20180
|
local ____enums = require("functions.enums")
|
|
20190
20181
|
local getEnumLength = ____enums.getEnumLength
|
|
20191
20182
|
local getHighestEnumValue = ____enums.getHighestEnumValue
|
|
20192
|
-
|
|
20193
|
-
local iRange = ____utils.iRange
|
|
20194
|
-
--- Equal to `CollectibleType.SAD_ONION`.
|
|
20183
|
+
--- Equal to `CollectibleType.SAD_ONION` (1).
|
|
20195
20184
|
____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
|
|
20196
20185
|
--- Calculated from the `CollectibleType` enum.
|
|
20197
20186
|
--
|
|
@@ -20200,7 +20189,7 @@ ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
|
|
|
20200
20189
|
____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getHighestEnumValue(nil, CollectibleType)
|
|
20201
20190
|
--- Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.)
|
|
20202
20191
|
____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
|
|
20203
|
-
--- Equal to `TrinketType.SWALLOWED_PENNY
|
|
20192
|
+
--- Equal to `TrinketType.SWALLOWED_PENNY` (1).
|
|
20204
20193
|
____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
|
|
20205
20194
|
--- Calculated from the `TrinketType` enum.
|
|
20206
20195
|
--
|
|
@@ -20209,35 +20198,37 @@ ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
|
|
|
20209
20198
|
____exports.LAST_VANILLA_TRINKET_TYPE = getHighestEnumValue(nil, TrinketType)
|
|
20210
20199
|
--- Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.)
|
|
20211
20200
|
____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
|
|
20212
|
-
--- Equal to `Card.FOOL
|
|
20201
|
+
--- Equal to `Card.FOOL` (1).
|
|
20213
20202
|
____exports.FIRST_CARD_TYPE = CardType.FOOL
|
|
20214
20203
|
--- Calculated from the `CardType` enum.
|
|
20215
20204
|
____exports.LAST_VANILLA_CARD_TYPE = getHighestEnumValue(nil, CardType)
|
|
20216
20205
|
--- Calculated from the `Card` enum. `Card.NULL` is not included.
|
|
20217
20206
|
____exports.NUM_VANILLA_CARD_TYPES = getEnumLength(nil, CardType) - 1
|
|
20218
|
-
--- Equal to `PillEffect.BAD_GAS
|
|
20207
|
+
--- Equal to `PillEffect.BAD_GAS` (0).
|
|
20219
20208
|
____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
|
|
20220
20209
|
--- Calculated from the `PillEffect` enum.
|
|
20221
20210
|
____exports.LAST_VANILLA_PILL_EFFECT = getHighestEnumValue(nil, PillEffect)
|
|
20222
20211
|
--- Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
|
|
20223
20212
|
-- do not have to subtract one here.)
|
|
20224
20213
|
____exports.NUM_VANILLA_PILL_EFFECTS = getEnumLength(nil, PillEffect)
|
|
20225
|
-
--- Equal to `PillColor.BLUE_BLUE
|
|
20214
|
+
--- Equal to `PillColor.BLUE_BLUE` (1).
|
|
20226
20215
|
____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
|
|
20227
|
-
--- Equal to `PillColor.WHITE_YELLOW
|
|
20216
|
+
--- Equal to `PillColor.WHITE_YELLOW` (13).
|
|
20228
20217
|
--
|
|
20229
20218
|
-- Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
|
|
20230
20219
|
-- this constant.
|
|
20231
20220
|
____exports.LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
|
|
20232
|
-
--- Equal to `PillColor.HORSE_BLUE_BLUE
|
|
20221
|
+
--- Equal to `PillColor.HORSE_BLUE_BLUE` (2049).
|
|
20233
20222
|
____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
|
|
20234
|
-
--- Equal to `PillColor.HORSE_WHITE_YELLOW
|
|
20223
|
+
--- Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
|
|
20235
20224
|
--
|
|
20236
20225
|
-- Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
|
|
20237
20226
|
-- purposes of this constant.
|
|
20238
20227
|
____exports.LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
|
|
20239
|
-
|
|
20240
|
-
|
|
20228
|
+
--- Calculated from the difference between the first pill color and the last pill color. This does
|
|
20229
|
+
-- not include Gold Pills. In Repentance, this should be equal to 13.
|
|
20230
|
+
____exports.NUM_NORMAL_PILL_COLORS = ____exports.LAST_NORMAL_PILL_COLOR - ____exports.FIRST_PILL_COLOR + 1
|
|
20231
|
+
--- Equal to `PlayerType.ISAAC` (0).
|
|
20241
20232
|
____exports.FIRST_CHARACTER = PlayerType.ISAAC
|
|
20242
20233
|
--- Calculated from the `PlayerType` enum.
|
|
20243
20234
|
____exports.LAST_VANILLA_CHARACTER = getHighestEnumValue(nil, PlayerType)
|
|
@@ -53742,6 +53733,8 @@ local iRange = ____utils.iRange
|
|
|
53742
53733
|
--- Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
53743
53734
|
-- vertical line, inclusive on both ends.
|
|
53744
53735
|
--
|
|
53736
|
+
-- If the first grid index is greater than the second grid index, the two will be swapped.
|
|
53737
|
+
--
|
|
53745
53738
|
-- This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
53746
53739
|
-- horizontal or vertical line.
|
|
53747
53740
|
function ____exports.getGridIndexesBetween(self, gridIndex1, gridIndex2, roomShape)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "84.0.1",
|
|
4
4
|
"description": "Helper functions and features for IsaacScript mods.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
"lint": "tsx --tsconfig ./scripts/tsconfig.json ./scripts/lint.mts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"isaac-typescript-definitions": "^40.0.
|
|
40
|
+
"isaac-typescript-definitions": "^40.0.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -14,13 +14,12 @@ import {
|
|
|
14
14
|
TrinketType,
|
|
15
15
|
} from "isaac-typescript-definitions";
|
|
16
16
|
import { getEnumLength, getHighestEnumValue } from "../functions/enums";
|
|
17
|
-
import { iRange } from "../functions/utils";
|
|
18
17
|
|
|
19
18
|
// ------------
|
|
20
19
|
// Collectibles
|
|
21
20
|
// ------------
|
|
22
21
|
|
|
23
|
-
/** Equal to `CollectibleType.SAD_ONION
|
|
22
|
+
/** Equal to `CollectibleType.SAD_ONION` (1). */
|
|
24
23
|
export const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
|
|
25
24
|
|
|
26
25
|
/**
|
|
@@ -39,7 +38,7 @@ export const NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(CollectibleType) - 1;
|
|
|
39
38
|
// Trinkets
|
|
40
39
|
// --------
|
|
41
40
|
|
|
42
|
-
/** Equal to `TrinketType.SWALLOWED_PENNY
|
|
41
|
+
/** Equal to `TrinketType.SWALLOWED_PENNY` (1). */
|
|
43
42
|
export const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
|
|
44
43
|
|
|
45
44
|
/**
|
|
@@ -57,7 +56,7 @@ export const NUM_VANILLA_TRINKET_TYPES = getEnumLength(TrinketType) - 1;
|
|
|
57
56
|
// Cards
|
|
58
57
|
// -----
|
|
59
58
|
|
|
60
|
-
/** Equal to `Card.FOOL
|
|
59
|
+
/** Equal to `Card.FOOL` (1). */
|
|
61
60
|
export const FIRST_CARD_TYPE = CardType.FOOL;
|
|
62
61
|
|
|
63
62
|
/** Calculated from the `CardType` enum. */
|
|
@@ -70,7 +69,7 @@ export const NUM_VANILLA_CARD_TYPES = getEnumLength(CardType) - 1;
|
|
|
70
69
|
// Pill Effects
|
|
71
70
|
// ------------
|
|
72
71
|
|
|
73
|
-
/** Equal to `PillEffect.BAD_GAS
|
|
72
|
+
/** Equal to `PillEffect.BAD_GAS` (0). */
|
|
74
73
|
export const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
|
|
75
74
|
|
|
76
75
|
/** Calculated from the `PillEffect` enum. */
|
|
@@ -86,38 +85,40 @@ export const NUM_VANILLA_PILL_EFFECTS = getEnumLength(PillEffect);
|
|
|
86
85
|
// Pill Colors
|
|
87
86
|
// -----------
|
|
88
87
|
|
|
89
|
-
/** Equal to `PillColor.BLUE_BLUE
|
|
88
|
+
/** Equal to `PillColor.BLUE_BLUE` (1). */
|
|
90
89
|
export const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
|
|
91
90
|
|
|
92
91
|
/**
|
|
93
|
-
* Equal to `PillColor.WHITE_YELLOW
|
|
92
|
+
* Equal to `PillColor.WHITE_YELLOW` (13).
|
|
94
93
|
*
|
|
95
94
|
* Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
|
|
96
95
|
* this constant.
|
|
97
96
|
*/
|
|
98
97
|
export const LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW;
|
|
99
98
|
|
|
100
|
-
/** Equal to `PillColor.HORSE_BLUE_BLUE
|
|
99
|
+
/** Equal to `PillColor.HORSE_BLUE_BLUE` (2049). */
|
|
101
100
|
export const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
|
|
102
101
|
|
|
103
102
|
/**
|
|
104
|
-
* Equal to `PillColor.HORSE_WHITE_YELLOW
|
|
103
|
+
* Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
|
|
105
104
|
*
|
|
106
105
|
* Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
|
|
107
106
|
* purposes of this constant.
|
|
108
107
|
*/
|
|
109
108
|
export const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
/**
|
|
111
|
+
* Calculated from the difference between the first pill color and the last pill color. This does
|
|
112
|
+
* not include Gold Pills. In Repentance, this should be equal to 13.
|
|
113
|
+
*/
|
|
114
|
+
export const NUM_NORMAL_PILL_COLORS =
|
|
115
|
+
LAST_NORMAL_PILL_COLOR - FIRST_PILL_COLOR + 1;
|
|
115
116
|
|
|
116
117
|
// -------
|
|
117
118
|
// Players
|
|
118
119
|
// -------
|
|
119
120
|
|
|
120
|
-
/** Equal to `PlayerType.ISAAC
|
|
121
|
+
/** Equal to `PlayerType.ISAAC` (0). */
|
|
121
122
|
export const FIRST_CHARACTER = PlayerType.ISAAC;
|
|
122
123
|
|
|
123
124
|
// It is not possible to determine "LAST_PLAYER_TYPE", since there is no associated config.
|
|
@@ -6,6 +6,8 @@ import { iRange } from "./utils";
|
|
|
6
6
|
* Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
|
|
7
7
|
* vertical line, inclusive on both ends.
|
|
8
8
|
*
|
|
9
|
+
* If the first grid index is greater than the second grid index, the two will be swapped.
|
|
10
|
+
*
|
|
9
11
|
* This function will throw a run-time error if the two provided grid indexes are not on the same
|
|
10
12
|
* horizontal or vertical line.
|
|
11
13
|
*/
|
package/src/functions/utils.ts
CHANGED
|
@@ -45,7 +45,7 @@ export function assertNotNull<T>(
|
|
|
45
45
|
* end and exclusive on the high end. (The "e" in the function name stands for exclusive.) Thus,
|
|
46
46
|
* this function works in a similar way as the built-in `range` function from Python.
|
|
47
47
|
*
|
|
48
|
-
* If the end is lower than the start,
|
|
48
|
+
* If the end is lower than the start, an empty array will be returned.
|
|
49
49
|
*
|
|
50
50
|
* For example:
|
|
51
51
|
*
|
|
@@ -54,7 +54,7 @@ export function assertNotNull<T>(
|
|
|
54
54
|
* - `eRange(-3)` returns `[0, -1, -2]`.
|
|
55
55
|
* - `eRange(1, 3)` returns `[1, 2]`.
|
|
56
56
|
* - `eRange(2, 5)` returns `[2, 3, 4]`.
|
|
57
|
-
* - `eRange(5, 2)` returns `[
|
|
57
|
+
* - `eRange(5, 2)` returns `[]`.
|
|
58
58
|
*
|
|
59
59
|
* @param start The integer to start at.
|
|
60
60
|
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -68,14 +68,8 @@ export function eRange(start: int, end?: int, increment = 1): readonly int[] {
|
|
|
68
68
|
|
|
69
69
|
const array: int[] = [];
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
array.push(i);
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
for (let i = start; i > end; i -= increment) {
|
|
77
|
-
array.push(i);
|
|
78
|
-
}
|
|
71
|
+
for (let i = start; i < end; i += increment) {
|
|
72
|
+
array.push(i);
|
|
79
73
|
}
|
|
80
74
|
|
|
81
75
|
return array;
|
|
@@ -102,7 +96,7 @@ export function getTraversalDescription(
|
|
|
102
96
|
* Helper function to return an array of integers with the specified range, inclusive on both ends.
|
|
103
97
|
* (The "i" in the function name stands for inclusive.)
|
|
104
98
|
*
|
|
105
|
-
* If the end is lower than the start,
|
|
99
|
+
* If the end is lower than the start, an empty array will be returned.
|
|
106
100
|
*
|
|
107
101
|
* For example:
|
|
108
102
|
*
|
|
@@ -111,7 +105,7 @@ export function getTraversalDescription(
|
|
|
111
105
|
* - `iRange(-3)` returns `[0, -1, -2, -3]`.
|
|
112
106
|
* - `iRange(1, 3)` returns `[1, 2, 3]`.
|
|
113
107
|
* - `iRange(2, 5)` returns `[2, 3, 4, 5]`.
|
|
114
|
-
* - `iRange(5, 2)` returns `[
|
|
108
|
+
* - `iRange(5, 2)` returns `[]`.
|
|
115
109
|
*
|
|
116
110
|
* @param start The integer to start at.
|
|
117
111
|
* @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
|
|
@@ -123,9 +117,7 @@ export function iRange(start: int, end?: int, increment = 1): readonly int[] {
|
|
|
123
117
|
return iRange(0, start, increment);
|
|
124
118
|
}
|
|
125
119
|
|
|
126
|
-
|
|
127
|
-
const exclusiveEnd = rangeIncreasing ? end + 1 : end - 1;
|
|
128
|
-
return eRange(start, exclusiveEnd, increment);
|
|
120
|
+
return eRange(start, end + 1, increment);
|
|
129
121
|
}
|
|
130
122
|
|
|
131
123
|
/**
|