isaacscript-common 83.5.0 → 84.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.
@@ -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;AAQtC,4CAA4C;AAC5C,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,iBACJ,CAAC;AAEvC,4FAA4F;AAC5F,eAAO,MAAM,6BAA6B,QAAqC,CAAC;AAMhF,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,aAAmC,CAAC;AAE1E,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,QAAiC,CAAC;AAMxE,4BAA4B;AAC5B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C,2CAA2C;AAC3C,eAAO,MAAM,sBAAsB,UAAgC,CAAC;AAEpE,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAMlE,qCAAqC;AACrC,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,YAAkC,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,KAA4B,CAAC;AAMlE,sCAAsC;AACtC,eAAO,MAAM,gBAAgB,sBAAsB,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,yBAAyB,CAAC;AAE7D,4CAA4C;AAC5C,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAElE,eAAO,MAAM,sBAAsB,QAG3B,CAAC;AAMT,mC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AAO,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
- local ____utils = require("functions.utils")
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
- ____exports.NUM_NORMAL_PILL_COLORS = #iRange(nil, ____exports.FIRST_PILL_COLOR, ____exports.LAST_NORMAL_PILL_COLOR)
61
- --- Equal to `PlayerType.ISAAC`.
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;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,GAAG,EACf,UAAU,EAAE,GAAG,EACf,SAAS,EAAE,SAAS,GACnB,SAAS,GAAG,EAAE,CAwBhB"}
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, then the range will be reversed.
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,6 @@ 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 `[5, 4, 3]`.
35
34
  *
36
35
  * @param start The integer to start at.
37
36
  * @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
@@ -48,7 +47,7 @@ export declare function getTraversalDescription(key: unknown, traversalDescripti
48
47
  * Helper function to return an array of integers with the specified range, inclusive on both ends.
49
48
  * (The "i" in the function name stands for inclusive.)
50
49
  *
51
- * If the end is lower than the start, then the range will be reversed.
50
+ * If the end is lower than the start, an empty array will be returned.
52
51
  *
53
52
  * For example:
54
53
  *
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/functions/utils.ts"],"names":[],"mappings":";AAIA;;;;;GAKG;AACH,wBA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,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"}
@@ -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, then the range will be reversed.
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,6 @@ 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 `[5, 4, 3]`.
49
48
  --
50
49
  -- @param start The integer to start at.
51
50
  -- @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
@@ -59,21 +58,11 @@ function ____exports.eRange(self, start, ____end, increment)
59
58
  return ____exports.eRange(nil, 0, start, increment)
60
59
  end
61
60
  local array = {}
62
- if start < ____end then
63
- do
64
- local i = start
65
- while i < ____end do
66
- array[#array + 1] = i
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
61
+ do
62
+ local i = start
63
+ while i < ____end do
64
+ array[#array + 1] = i
65
+ i = i + increment
77
66
  end
78
67
  end
79
68
  return array
@@ -90,7 +79,7 @@ end
90
79
  --- Helper function to return an array of integers with the specified range, inclusive on both ends.
91
80
  -- (The "i" in the function name stands for inclusive.)
92
81
  --
93
- -- If the end is lower than the start, then the range will be reversed.
82
+ -- If the end is lower than the start, an empty array will be returned.
94
83
  --
95
84
  -- For example:
96
85
  --
@@ -112,9 +101,7 @@ function ____exports.iRange(self, start, ____end, increment)
112
101
  if ____end == nil then
113
102
  return ____exports.iRange(nil, 0, start, increment)
114
103
  end
115
- local rangeIncreasing = start <= ____end
116
- local exclusiveEnd = rangeIncreasing and ____end + 1 or ____end - 1
117
- return ____exports.eRange(nil, start, exclusiveEnd, increment)
104
+ return ____exports.eRange(nil, start, ____end + 1, increment)
118
105
  end
119
106
  --- Helper function to check if a variable is within a certain range, inclusive on both ends.
120
107
  --
@@ -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, then the range will be reversed.
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,6 @@ 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 `[5, 4, 3]`.
4400
4399
  *
4401
4400
  * @param start The integer to start at.
4402
4401
  * @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
@@ -4664,13 +4663,13 @@ export declare function fireProjectiles(npc: EntityNPC | undefined, position: Ve
4664
4663
  */
4665
4664
  export declare function fireProjectilesInCircle(npc: EntityNPC | undefined, position: Vector, speed: float, numProjectiles: int): readonly EntityProjectile[];
4666
4665
 
4667
- /** Equal to `Card.FOOL`. */
4666
+ /** Equal to `Card.FOOL` (1). */
4668
4667
  export declare const FIRST_CARD_TYPE = CardType.FOOL;
4669
4668
 
4670
- /** Equal to `PlayerType.ISAAC`. */
4669
+ /** Equal to `PlayerType.ISAAC` (0). */
4671
4670
  export declare const FIRST_CHARACTER = PlayerType.ISAAC;
4672
4671
 
4673
- /** Equal to `CollectibleType.SAD_ONION`. */
4672
+ /** Equal to `CollectibleType.SAD_ONION` (1). */
4674
4673
  export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
4675
4674
 
4676
4675
  /**
@@ -4682,16 +4681,16 @@ export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
4682
4681
  */
4683
4682
  export declare const FIRST_GLITCHED_COLLECTIBLE_TYPE: CollectibleType;
4684
4683
 
4685
- /** Equal to `PillColor.HORSE_BLUE_BLUE`. */
4684
+ /** Equal to `PillColor.HORSE_BLUE_BLUE` (2049). */
4686
4685
  export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
4687
4686
 
4688
- /** Equal to `PillColor.BLUE_BLUE`. */
4687
+ /** Equal to `PillColor.BLUE_BLUE` (1). */
4689
4688
  export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
4690
4689
 
4691
- /** Equal to `PillEffect.BAD_GAS`. */
4690
+ /** Equal to `PillEffect.BAD_GAS` (0). */
4692
4691
  export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
4693
4692
 
4694
- /** Equal to `TrinketType.SWALLOWED_PENNY`. */
4693
+ /** Equal to `TrinketType.SWALLOWED_PENNY` (1). */
4695
4694
  export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
4696
4695
 
4697
4696
  declare class FlipDetection extends Feature {
@@ -6089,6 +6088,8 @@ export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSl
6089
6088
  * Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
6090
6089
  * vertical line, inclusive on both ends.
6091
6090
  *
6091
+ * If the first grid index is greater than the second grid index, the two will be swapped.
6092
+ *
6092
6093
  * This function will throw a run-time error if the two provided grid indexes are not on the same
6093
6094
  * horizontal or vertical line.
6094
6095
  */
@@ -8870,7 +8871,7 @@ export declare type IRange<Low extends number, High extends number> = Exclude<Na
8870
8871
  * Helper function to return an array of integers with the specified range, inclusive on both ends.
8871
8872
  * (The "i" in the function name stands for inclusive.)
8872
8873
  *
8873
- * If the end is lower than the start, then the range will be reversed.
8874
+ * If the end is lower than the start, an empty array will be returned.
8874
8875
  *
8875
8876
  * For example:
8876
8877
  *
@@ -10645,7 +10646,7 @@ export declare enum LadderSubTypeCustom {
10645
10646
  }
10646
10647
 
10647
10648
  /**
10648
- * Equal to `PillColor.HORSE_WHITE_YELLOW`.
10649
+ * Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
10649
10650
  *
10650
10651
  * Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
10651
10652
  * purposes of this constant.
@@ -10653,7 +10654,7 @@ export declare enum LadderSubTypeCustom {
10653
10654
  export declare const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
10654
10655
 
10655
10656
  /**
10656
- * Equal to `PillColor.WHITE_YELLOW`.
10657
+ * Equal to `PillColor.WHITE_YELLOW` (13).
10657
10658
  *
10658
10659
  * Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
10659
10660
  * this constant.
@@ -14952,6 +14953,10 @@ declare class NoSirenSteal extends Feature {
14952
14953
  */
14953
14954
  export declare const NUM_DIMENSIONS: number;
14954
14955
 
14956
+ /**
14957
+ * Calculated from the difference between the first pill color and the last pill color. This does
14958
+ * not include Gold Pills. In Repentance, this should be equal to 13.
14959
+ */
14955
14960
  export declare const NUM_NORMAL_PILL_COLORS: number;
14956
14961
 
14957
14962
  /**
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 83.4.1
3
+ isaacscript-common 83.5.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, then the range will be reversed.
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,6 @@ 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 `[5, 4, 3]`.
17820
17822
  --
17821
17823
  -- @param start The integer to start at.
17822
17824
  -- @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
@@ -17830,21 +17832,11 @@ function ____exports.eRange(self, start, ____end, increment)
17830
17832
  return ____exports.eRange(nil, 0, start, increment)
17831
17833
  end
17832
17834
  local array = {}
17833
- if start < ____end then
17834
- do
17835
- local i = start
17836
- while i < ____end do
17837
- array[#array + 1] = i
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
17835
+ do
17836
+ local i = start
17837
+ while i < ____end do
17838
+ array[#array + 1] = i
17839
+ i = i + increment
17848
17840
  end
17849
17841
  end
17850
17842
  return array
@@ -17861,7 +17853,7 @@ end
17861
17853
  --- Helper function to return an array of integers with the specified range, inclusive on both ends.
17862
17854
  -- (The "i" in the function name stands for inclusive.)
17863
17855
  --
17864
- -- If the end is lower than the start, then the range will be reversed.
17856
+ -- If the end is lower than the start, an empty array will be returned.
17865
17857
  --
17866
17858
  -- For example:
17867
17859
  --
@@ -17883,9 +17875,7 @@ function ____exports.iRange(self, start, ____end, increment)
17883
17875
  if ____end == nil then
17884
17876
  return ____exports.iRange(nil, 0, start, increment)
17885
17877
  end
17886
- local rangeIncreasing = start <= ____end
17887
- local exclusiveEnd = rangeIncreasing and ____end + 1 or ____end - 1
17888
- return ____exports.eRange(nil, start, exclusiveEnd, increment)
17878
+ return ____exports.eRange(nil, start, ____end + 1, increment)
17889
17879
  end
17890
17880
  --- Helper function to check if a variable is within a certain range, inclusive on both ends.
17891
17881
  --
@@ -20189,9 +20179,7 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
20189
20179
  local ____enums = require("functions.enums")
20190
20180
  local getEnumLength = ____enums.getEnumLength
20191
20181
  local getHighestEnumValue = ____enums.getHighestEnumValue
20192
- local ____utils = require("functions.utils")
20193
- local iRange = ____utils.iRange
20194
- --- Equal to `CollectibleType.SAD_ONION`.
20182
+ --- Equal to `CollectibleType.SAD_ONION` (1).
20195
20183
  ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
20196
20184
  --- Calculated from the `CollectibleType` enum.
20197
20185
  --
@@ -20200,7 +20188,7 @@ ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
20200
20188
  ____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getHighestEnumValue(nil, CollectibleType)
20201
20189
  --- Calculated from the `CollectibleType` enum. (`CollectibleType.NULL` is not included.)
20202
20190
  ____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
20203
- --- Equal to `TrinketType.SWALLOWED_PENNY`.
20191
+ --- Equal to `TrinketType.SWALLOWED_PENNY` (1).
20204
20192
  ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
20205
20193
  --- Calculated from the `TrinketType` enum.
20206
20194
  --
@@ -20209,35 +20197,37 @@ ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
20209
20197
  ____exports.LAST_VANILLA_TRINKET_TYPE = getHighestEnumValue(nil, TrinketType)
20210
20198
  --- Calculated from the `TrinketType` enum. (`TrinketType.NULL` is not included.)
20211
20199
  ____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
20212
- --- Equal to `Card.FOOL`.
20200
+ --- Equal to `Card.FOOL` (1).
20213
20201
  ____exports.FIRST_CARD_TYPE = CardType.FOOL
20214
20202
  --- Calculated from the `CardType` enum.
20215
20203
  ____exports.LAST_VANILLA_CARD_TYPE = getHighestEnumValue(nil, CardType)
20216
20204
  --- Calculated from the `Card` enum. `Card.NULL` is not included.
20217
20205
  ____exports.NUM_VANILLA_CARD_TYPES = getEnumLength(nil, CardType) - 1
20218
- --- Equal to `PillEffect.BAD_GAS`.
20206
+ --- Equal to `PillEffect.BAD_GAS` (0).
20219
20207
  ____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
20220
20208
  --- Calculated from the `PillEffect` enum.
20221
20209
  ____exports.LAST_VANILLA_PILL_EFFECT = getHighestEnumValue(nil, PillEffect)
20222
20210
  --- Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
20223
20211
  -- do not have to subtract one here.)
20224
20212
  ____exports.NUM_VANILLA_PILL_EFFECTS = getEnumLength(nil, PillEffect)
20225
- --- Equal to `PillColor.BLUE_BLUE`.
20213
+ --- Equal to `PillColor.BLUE_BLUE` (1).
20226
20214
  ____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
20227
- --- Equal to `PillColor.WHITE_YELLOW`.
20215
+ --- Equal to `PillColor.WHITE_YELLOW` (13).
20228
20216
  --
20229
20217
  -- Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
20230
20218
  -- this constant.
20231
20219
  ____exports.LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
20232
- --- Equal to `PillColor.HORSE_BLUE_BLUE`.
20220
+ --- Equal to `PillColor.HORSE_BLUE_BLUE` (2049).
20233
20221
  ____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
20234
- --- Equal to `PillColor.HORSE_WHITE_YELLOW`.
20222
+ --- Equal to `PillColor.HORSE_WHITE_YELLOW` (2061).
20235
20223
  --
20236
20224
  -- Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
20237
20225
  -- purposes of this constant.
20238
20226
  ____exports.LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
20239
- ____exports.NUM_NORMAL_PILL_COLORS = #iRange(nil, ____exports.FIRST_PILL_COLOR, ____exports.LAST_NORMAL_PILL_COLOR)
20240
- --- Equal to `PlayerType.ISAAC`.
20227
+ --- Calculated from the difference between the first pill color and the last pill color. This does
20228
+ -- not include Gold Pills. In Repentance, this should be equal to 13.
20229
+ ____exports.NUM_NORMAL_PILL_COLORS = ____exports.LAST_NORMAL_PILL_COLOR - ____exports.FIRST_PILL_COLOR + 1
20230
+ --- Equal to `PlayerType.ISAAC` (0).
20241
20231
  ____exports.FIRST_CHARACTER = PlayerType.ISAAC
20242
20232
  --- Calculated from the `PlayerType` enum.
20243
20233
  ____exports.LAST_VANILLA_CHARACTER = getHighestEnumValue(nil, PlayerType)
@@ -53742,6 +53732,8 @@ local iRange = ____utils.iRange
53742
53732
  --- Helper function to get all of the grid indexes between two grid indexes on either a horizontal or
53743
53733
  -- vertical line, inclusive on both ends.
53744
53734
  --
53735
+ -- If the first grid index is greater than the second grid index, the two will be swapped.
53736
+ --
53745
53737
  -- This function will throw a run-time error if the two provided grid indexes are not on the same
53746
53738
  -- horizontal or vertical line.
53747
53739
  function ____exports.getGridIndexesBetween(self, gridIndex1, gridIndex2, roomShape)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "83.5.0",
3
+ "version": "84.0.0",
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.1"
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
- export const NUM_NORMAL_PILL_COLORS = iRange(
112
- FIRST_PILL_COLOR,
113
- LAST_NORMAL_PILL_COLOR,
114
- ).length;
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
  */
@@ -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, then the range will be reversed.
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,6 @@ 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 `[5, 4, 3]`.
58
57
  *
59
58
  * @param start The integer to start at.
60
59
  * @param end Optional. The integer to end at. If not specified, then the start will be 0 and the
@@ -68,14 +67,8 @@ export function eRange(start: int, end?: int, increment = 1): readonly int[] {
68
67
 
69
68
  const array: int[] = [];
70
69
 
71
- if (start < end) {
72
- for (let i = start; i < end; i += increment) {
73
- array.push(i);
74
- }
75
- } else {
76
- for (let i = start; i > end; i -= increment) {
77
- array.push(i);
78
- }
70
+ for (let i = start; i < end; i += increment) {
71
+ array.push(i);
79
72
  }
80
73
 
81
74
  return array;
@@ -102,7 +95,7 @@ export function getTraversalDescription(
102
95
  * Helper function to return an array of integers with the specified range, inclusive on both ends.
103
96
  * (The "i" in the function name stands for inclusive.)
104
97
  *
105
- * If the end is lower than the start, then the range will be reversed.
98
+ * If the end is lower than the start, an empty array will be returned.
106
99
  *
107
100
  * For example:
108
101
  *
@@ -123,9 +116,7 @@ export function iRange(start: int, end?: int, increment = 1): readonly int[] {
123
116
  return iRange(0, start, increment);
124
117
  }
125
118
 
126
- const rangeIncreasing = start <= end;
127
- const exclusiveEnd = rangeIncreasing ? end + 1 : end - 1;
128
- return eRange(start, exclusiveEnd, increment);
119
+ return eRange(start, end + 1, increment);
129
120
  }
130
121
 
131
122
  /**