isaacscript-common 2.0.26 → 2.0.29

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.
@@ -1,5 +1,4 @@
1
- import { PickupVariant } from "isaac-typescript-definitions";
2
- export declare type PostPickupCollectRegisterParameters = [
3
- callback: (pickup: EntityPickup, player: EntityPlayer) => void,
4
- pickupVariant?: PickupVariant
5
- ];
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPickupCollectRegisterParameters = PickupRegisterParameters<[
3
+ player: EntityPlayer
4
+ ], void>;
@@ -1,5 +1,3 @@
1
- import { PickupVariant } from "isaac-typescript-definitions";
2
- export declare type PostPickupInitLateRegisterParameters = [
3
- callback: (pickup: EntityPickup) => void,
4
- pickupVariant?: PickupVariant
5
- ];
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPickupInitLateRegisterParameters = PickupRegisterParameters<[
3
+ ], void>;
@@ -1,5 +1,5 @@
1
- import { PickupVariant } from "isaac-typescript-definitions";
2
- export declare type PostPickupStateChangedRegisterParameters = [
3
- callback: (pickup: EntityPickup, previousState: int, currentState: int) => void,
4
- pickupVariant?: PickupVariant
5
- ];
1
+ /// <reference types="isaac-typescript-definitions" />
2
+ export declare type PostPickupStateChangedRegisterParameters = PickupRegisterParameters<[
3
+ previousState: int,
4
+ currentState: int
5
+ ], void>;
@@ -1,6 +1,6 @@
1
- declare type FactoryFunction<V, A extends unknown[]> = (...extraArgs: A) => V;
2
- declare type FirstArg<K, V, A extends unknown[]> = Iterable<[K, V]> | V | FactoryFunction<V, A>;
3
- declare type SecondArg<V, A extends unknown[]> = V | FactoryFunction<V, A>;
1
+ declare type FactoryFunction<V, Args extends unknown[]> = (...extraArgs: Args) => V;
2
+ declare type FirstArg<K, V, Args extends unknown[]> = Iterable<[K, V]> | V | FactoryFunction<V, Args>;
3
+ declare type SecondArg<V, Args extends unknown[]> = V | FactoryFunction<V, Args>;
4
4
  /**
5
5
  * An extended Map with some new methods:
6
6
  *
@@ -48,28 +48,28 @@ declare type SecondArg<V, A extends unknown[]> = V | FactoryFunction<V, A>;
48
48
  * const defaultMapWithExtraArgs = new DefaultMap<string, string, [arg: boolean]>(factoryFunction);
49
49
  * ```
50
50
  */
51
- export declare class DefaultMap<K, V, A extends unknown[] = []> extends Map<K, V> {
51
+ export declare class DefaultMap<K, V, Args extends unknown[] = []> extends Map<K, V> {
52
52
  private defaultValue;
53
53
  private defaultValueFactory;
54
54
  /**
55
55
  * See the DefaultMap documentation:
56
56
  * https://isaacscript.github.io/isaacscript-common/classes/types_DefaultMap.DefaultMap.html
57
57
  */
58
- constructor(iterableOrDefaultValueOrDefaultValueFactory: FirstArg<K, V, A>, defaultValueOrDefaultValueFactory?: SecondArg<V, A>);
58
+ constructor(iterableOrDefaultValueOrDefaultValueFactory: FirstArg<K, V, Args>, defaultValueOrDefaultValueFactory?: SecondArg<V, Args>);
59
59
  /**
60
60
  * If the key exists, this will return the same thing as the `get` method. Otherwise, it will set
61
61
  * a default value to the key, and then return the default value.
62
62
  */
63
- getAndSetDefault(key: K, ...extraArgs: A): V;
63
+ getAndSetDefault(key: K, ...extraArgs: Args): V;
64
64
  /**
65
65
  * Returns the default value to be used for a new key. (If a factory function was provided during
66
66
  * instantiation, this will execute the factory function.)
67
67
  */
68
- getDefaultValue(...extraArgs: A): V;
68
+ getDefaultValue(...extraArgs: Args): V;
69
69
  /**
70
70
  * Helper method for cloning the map. Returns either the default value or a reference to the
71
71
  * factory function.
72
72
  */
73
- getConstructorArg(): V | FactoryFunction<V, A>;
73
+ getConstructorArg(): V | FactoryFunction<V, Args>;
74
74
  }
75
75
  export {};
@@ -71,14 +71,14 @@ export declare const MAX_PLAYER_HEART_CONTAINERS = 18;
71
71
  export declare const MAX_PLAYER_SPEED_IN_UNITS = 9.8;
72
72
  export declare const MAX_PLAYER_TRINKET_SLOTS: number;
73
73
  export declare const FIRST_ROOM_TYPE = RoomType.DEFAULT;
74
- export declare const MAX_ROOM_TYPE: RoomType;
74
+ export declare const LAST_ROOM_TYPE: RoomType;
75
75
  /**
76
76
  * The maximum speed stat that a player can have. Any additional speed beyond this will not take
77
77
  * effect.
78
78
  */
79
79
  export declare const MAX_SPEED_STAT = 2;
80
80
  export declare const FIRST_STAGE = LevelStage.BASEMENT_1;
81
- export declare const MAX_STAGE: LevelStage;
81
+ export declare const LAST_STAGE: LevelStage;
82
82
  /** Corresponds to the maximum value for `EntityPlayer.SamsonBerserkCharge`. */
83
83
  export declare const MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000;
84
84
  export declare const NUM_DIMENSIONS: number;
@@ -29,10 +29,10 @@ ____exports.MAX_PLAYER_HEART_CONTAINERS = 18
29
29
  ____exports.MAX_PLAYER_SPEED_IN_UNITS = 9.8
30
30
  ____exports.MAX_PLAYER_TRINKET_SLOTS = getEnumLength(nil, TrinketSlot)
31
31
  ____exports.FIRST_ROOM_TYPE = RoomType.DEFAULT
32
- ____exports.MAX_ROOM_TYPE = getLastEnumValue(nil, RoomType)
32
+ ____exports.LAST_ROOM_TYPE = getLastEnumValue(nil, RoomType)
33
33
  ____exports.MAX_SPEED_STAT = 2
34
34
  ____exports.FIRST_STAGE = LevelStage.BASEMENT_1
35
- ____exports.MAX_STAGE = getLastEnumValue(nil, LevelStage)
35
+ ____exports.LAST_STAGE = getLastEnumValue(nil, LevelStage)
36
36
  ____exports.MAX_TAINTED_SAMSON_BERSERK_CHARGE = 100000
37
37
  ____exports.NUM_DIMENSIONS = getEnumLength(nil, Dimension) - 1
38
38
  ____exports.SECOND_IN_MILLISECONDS = 1000
@@ -1,22 +1,4 @@
1
1
  import { Card, CollectibleType, PillColor, PillEffect, PlayerType, TrinketType } from "isaac-typescript-definitions";
2
- /** Equal to `Card.FOOL`. */
3
- export declare const FIRST_CARD = Card.FOOL;
4
- /**
5
- * Will change depending on how many modded cards there are.
6
- *
7
- * Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
8
- */
9
- export declare const NUM_CARDS: number;
10
- /**
11
- * Will change depending on how many modded cards there are.
12
- *
13
- * Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
14
- */
15
- export declare const MAX_CARD: Card;
16
- /** Calculated from the `Card` enum. `Card.NULL` is not included. */
17
- export declare const NUM_VANILLA_CARDS: number;
18
- /** Calculated from the `Card` enum. */
19
- export declare const MAX_VANILLA_CARD: Card;
20
2
  /** Equal to `CollectibleType.SAD_ONION`. */
21
3
  export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
22
4
  /**
@@ -25,64 +7,100 @@ export declare const FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION;
25
7
  * Equal to `itemConfig.GetCollectibles().Size - 1`. (`Size` includes invalid collectibles. We
26
8
  * subtract one to account for `CollectibleType.NULL`.)
27
9
  */
28
- export declare const MAX_COLLECTIBLE_TYPE: CollectibleType;
29
- /** Calculated from the `CollectibleType` enum. `CollectibleType.NULL` is not included. */
30
- export declare const NUM_VANILLA_COLLECTIBLE_TYPES: number;
10
+ export declare const LAST_COLLECTIBLE_TYPE: CollectibleType;
31
11
  /**
32
12
  * Calculated from the `CollectibleType` enum.
33
13
  *
34
14
  * Note that this cannot be calculated from the length of the enum, because unlike all of the other
35
- * enums, the collectible types are not contiguous.
15
+ * enums, collectible types are not contiguous.
36
16
  */
37
- export declare const MAX_VANILLA_COLLECTIBLE_TYPE: CollectibleType;
38
- /** Equal to `PillEffect.BAD_GAS`. */
39
- export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
17
+ export declare const LAST_VANILLA_COLLECTIBLE_TYPE: CollectibleType;
40
18
  /**
41
- * Will change depending on how many modded pill effects there are.
19
+ * If there are no modded collectibles, this constant will represent a collectible type that does
20
+ * not exist.
21
+ */
22
+ export declare const FIRST_MODDED_COLLECTIBLE_TYPE: CollectibleType;
23
+ /** Calculated from the `CollectibleType` enum. `CollectibleType.NULL` is not included. */
24
+ export declare const NUM_VANILLA_COLLECTIBLE_TYPES: number;
25
+ /** Unlike vanilla collectible types, modded collectible types are always contiguous. */
26
+ export declare const NUM_MODDED_COLLECTIBLE_TYPES: number;
27
+ export declare const NUM_COLLECTIBLE_TYPES: number;
28
+ /**
29
+ * Will change depending on how many modded cards there are.
42
30
  *
43
- * Equal to `itemConfig.GetPillEffects().Size - 1`. (We subtract one to account for
44
- * `PillEffect.NULL`.)
31
+ * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
32
+ * `TrinketType.NULL`.)
45
33
  */
46
- export declare const NUM_PILL_EFFECTS: number;
34
+ export declare const NUM_TRINKET_TYPES: number;
35
+ /** Calculated from the `TrinketType` enum. `TrinketType.NULL` is not included. */
36
+ export declare const NUM_VANILLA_TRINKET_TYPES: number;
37
+ export declare const NUM_MODDED_TRINKET_TYPES: number;
38
+ /** Equal to `TrinketType.SWALLOWED_PENNY`. */
39
+ export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
40
+ /**
41
+ * Will change depending on how many modded cards there are.
42
+ *
43
+ * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
44
+ * `TrinketType.NULL`.)
45
+ */
46
+ export declare const LAST_TRINKET_TYPE: TrinketType;
47
+ /** Calculated from the `TrinketType` enum. */
48
+ export declare const LAST_VANILLA_TRINKET_TYPE: TrinketType;
49
+ /**
50
+ * If there are no modded trinkets, this constant will represent a trinket type that does not exist.
51
+ */
52
+ export declare const FIRST_MODDED_TRINKET_TYPE: TrinketType;
53
+ /**
54
+ * Will change depending on how many modded cards there are.
55
+ *
56
+ * Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
57
+ */
58
+ export declare const NUM_CARDS: number;
59
+ /** Calculated from the `Card` enum. `Card.NULL` is not included. */
60
+ export declare const NUM_VANILLA_CARDS: number;
61
+ export declare const NUM_MODDED_CARDS: number;
62
+ /** Equal to `Card.FOOL`. */
63
+ export declare const FIRST_CARD = Card.FOOL;
64
+ /**
65
+ * Will change depending on how many modded cards there are.
66
+ *
67
+ * Equal to `itemConfig.GetCards().Size - 1`. (We subtract one to account for `Card.NULL`.)
68
+ */
69
+ export declare const LAST_CARD: Card;
70
+ /** Calculated from the `Card` enum. */
71
+ export declare const MAX_VANILLA_CARD: Card;
72
+ /** If there are no modded cards, this constant will represent a card that does not exist. */
73
+ export declare const FIRST_MODDED_CARD: Card;
47
74
  /**
48
75
  * Will change depending on how many modded pill effects there are.
49
76
  *
50
77
  * Equal to `itemConfig.GetPillEffects().Size - 1`. (We subtract one to account for
51
78
  * `PillEffect.NULL`.)
52
79
  */
53
- export declare const MAX_PILL_EFFECT: PillEffect;
80
+ export declare const NUM_PILL_EFFECTS: number;
54
81
  /**
55
82
  * Calculated from the `PillEffect` enum.
56
83
  *
57
84
  * (There is no `PillEffect.NULL` in the custom enum, so we don't have to subtract one here.)
58
85
  */
59
86
  export declare const NUM_VANILLA_PILL_EFFECTS: number;
60
- /** Calculated from the `PillEffect` enum. */
61
- export declare const MAX_VANILLA_PILL_EFFECT: PillEffect;
62
- /** Equal to `TrinketType.SWALLOWED_PENNY`. */
63
- export declare const FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY;
87
+ export declare const NUM_MODDED_PILL_EFFECTS: number;
88
+ /** Equal to `PillEffect.BAD_GAS`. */
89
+ export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
64
90
  /**
65
- * Will change depending on how many modded cards there are.
91
+ * Will change depending on how many modded pill effects there are.
66
92
  *
67
- * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
68
- * `TrinketType.NULL`.)
93
+ * Equal to `itemConfig.GetPillEffects().Size - 1`. (We subtract one to account for
94
+ * `PillEffect.NULL`.)
69
95
  */
70
- export declare const NUM_TRINKET_TYPES: number;
96
+ export declare const LAST_PILL_EFFECT: PillEffect;
97
+ /** Calculated from the `PillEffect` enum. */
98
+ export declare const LAST_VANILLA_PILL_EFFECT: PillEffect;
71
99
  /**
72
- * Will change depending on how many modded cards there are.
73
- *
74
- * Equal to `itemConfig.GetTrinkets().Size - 1`. (We subtract one to account for
75
- * `TrinketType.NULL`.)
100
+ * If there are no modded pill effects, this constant will represent a pill effect that does not
101
+ * exist.
76
102
  */
77
- export declare const MAX_TRINKET_TYPE: TrinketType;
78
- /** Calculated from the `TrinketType` enum. `TrinketType.NULL` is not included. */
79
- export declare const NUM_VANILLA_TRINKET_TYPES: number;
80
- /** Calculated from the `TrinketType` enum. */
81
- export declare const MAX_VANILLA_TRINKET_TYPE: TrinketType;
82
- /** Equal to `PlayerType.ISAAC`. */
83
- export declare const FIRST_CHARACTER = PlayerType.ISAAC;
84
- /** Calculated from the `PlayerType` enum. */
85
- export declare const MAX_VANILLA_CHARACTER: PlayerType;
103
+ export declare const FIRST_MODDED_PILL_EFFECT: PillEffect;
86
104
  /** Equal to `PillColor.BLUE_BLUE`. */
87
105
  export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
88
106
  /**
@@ -91,7 +109,7 @@ export declare const FIRST_PILL_COLOR = PillColor.BLUE_BLUE;
91
109
  * Note that `PillColor.GOLD` is technically higher, but that is not considered for the purposes of
92
110
  * this constant.
93
111
  */
94
- export declare const MAX_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW;
112
+ export declare const LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW;
95
113
  /** Equal to `PillColor.HORSE_BLUE_BLUE`. */
96
114
  export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
97
115
  /**
@@ -100,4 +118,13 @@ export declare const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
100
118
  * Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
101
119
  * purposes of this constant.
102
120
  */
103
- export declare const MAX_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
121
+ export declare const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
122
+ export declare const NUM_NORMAL_PILL_COLORS: number;
123
+ /** Equal to `PlayerType.ISAAC`. */
124
+ export declare const FIRST_CHARACTER = PlayerType.ISAAC;
125
+ /** Calculated from the `PlayerType` enum. */
126
+ export declare const LAST_VANILLA_CHARACTER: PlayerType;
127
+ /**
128
+ * If there are no modded characters, this constant will represent a character that does not exist.
129
+ */
130
+ export declare const FIRST_MODDED_CHARACTER: PlayerType;
@@ -11,29 +11,40 @@ local itemConfig = ____cachedClasses.itemConfig
11
11
  local ____enums = require("functions.enums")
12
12
  local getEnumLength = ____enums.getEnumLength
13
13
  local getLastEnumValue = ____enums.getLastEnumValue
14
- ____exports.FIRST_CARD = Card.FOOL
14
+ ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
15
+ ____exports.LAST_COLLECTIBLE_TYPE = itemConfig:GetCollectibles().Size - 1
16
+ ____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getLastEnumValue(nil, CollectibleType)
17
+ ____exports.FIRST_MODDED_COLLECTIBLE_TYPE = ____exports.LAST_VANILLA_COLLECTIBLE_TYPE + 1
18
+ ____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
19
+ ____exports.NUM_MODDED_COLLECTIBLE_TYPES = ____exports.LAST_COLLECTIBLE_TYPE - ____exports.LAST_VANILLA_COLLECTIBLE_TYPE
20
+ ____exports.NUM_COLLECTIBLE_TYPES = ____exports.NUM_VANILLA_COLLECTIBLE_TYPES + ____exports.NUM_MODDED_COLLECTIBLE_TYPES
21
+ ____exports.NUM_TRINKET_TYPES = itemConfig:GetTrinkets().Size - 1
22
+ ____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
23
+ ____exports.NUM_MODDED_TRINKET_TYPES = ____exports.NUM_TRINKET_TYPES - ____exports.NUM_VANILLA_TRINKET_TYPES
24
+ ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
25
+ ____exports.LAST_TRINKET_TYPE = ____exports.NUM_TRINKET_TYPES
26
+ ____exports.LAST_VANILLA_TRINKET_TYPE = getLastEnumValue(nil, TrinketType)
27
+ ____exports.FIRST_MODDED_TRINKET_TYPE = ____exports.LAST_VANILLA_TRINKET_TYPE + 1
15
28
  ____exports.NUM_CARDS = itemConfig:GetCards().Size - 1
16
- ____exports.MAX_CARD = ____exports.NUM_CARDS
17
29
  ____exports.NUM_VANILLA_CARDS = getEnumLength(nil, Card) - 1
30
+ ____exports.NUM_MODDED_CARDS = ____exports.NUM_CARDS - ____exports.NUM_VANILLA_CARDS
31
+ ____exports.FIRST_CARD = Card.FOOL
32
+ ____exports.LAST_CARD = ____exports.NUM_CARDS
18
33
  ____exports.MAX_VANILLA_CARD = getLastEnumValue(nil, Card)
19
- ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
20
- ____exports.MAX_COLLECTIBLE_TYPE = itemConfig:GetCollectibles().Size - 1
21
- ____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
22
- ____exports.MAX_VANILLA_COLLECTIBLE_TYPE = getLastEnumValue(nil, CollectibleType)
23
- ____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
34
+ ____exports.FIRST_MODDED_CARD = ____exports.MAX_VANILLA_CARD + 1
24
35
  ____exports.NUM_PILL_EFFECTS = itemConfig:GetPillEffects().Size - 1
25
- ____exports.MAX_PILL_EFFECT = ____exports.NUM_PILL_EFFECTS
26
36
  ____exports.NUM_VANILLA_PILL_EFFECTS = getEnumLength(nil, PillEffect)
27
- ____exports.MAX_VANILLA_PILL_EFFECT = getLastEnumValue(nil, PillEffect)
28
- ____exports.FIRST_TRINKET_TYPE = TrinketType.SWALLOWED_PENNY
29
- ____exports.NUM_TRINKET_TYPES = itemConfig:GetTrinkets().Size - 1
30
- ____exports.MAX_TRINKET_TYPE = ____exports.NUM_TRINKET_TYPES
31
- ____exports.NUM_VANILLA_TRINKET_TYPES = getEnumLength(nil, TrinketType) - 1
32
- ____exports.MAX_VANILLA_TRINKET_TYPE = getLastEnumValue(nil, TrinketType)
33
- ____exports.FIRST_CHARACTER = PlayerType.ISAAC
34
- ____exports.MAX_VANILLA_CHARACTER = getLastEnumValue(nil, PlayerType)
37
+ ____exports.NUM_MODDED_PILL_EFFECTS = ____exports.NUM_PILL_EFFECTS - ____exports.NUM_VANILLA_PILL_EFFECTS
38
+ ____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
39
+ ____exports.LAST_PILL_EFFECT = ____exports.NUM_PILL_EFFECTS
40
+ ____exports.LAST_VANILLA_PILL_EFFECT = getLastEnumValue(nil, PillEffect)
41
+ ____exports.FIRST_MODDED_PILL_EFFECT = ____exports.LAST_VANILLA_PILL_EFFECT + 1
35
42
  ____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
36
- ____exports.MAX_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
43
+ ____exports.LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
37
44
  ____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
38
- ____exports.MAX_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
45
+ ____exports.LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
46
+ ____exports.NUM_NORMAL_PILL_COLORS = ____exports.LAST_NORMAL_PILL_COLOR - ____exports.FIRST_PILL_COLOR
47
+ ____exports.FIRST_CHARACTER = PlayerType.ISAAC
48
+ ____exports.LAST_VANILLA_CHARACTER = getLastEnumValue(nil, PlayerType)
49
+ ____exports.FIRST_MODDED_CHARACTER = ____exports.LAST_VANILLA_CHARACTER + 1
39
50
  return ____exports
@@ -21,16 +21,16 @@ local sfxManager = ____cachedClasses.sfxManager
21
21
  local ____constants = require("constants")
22
22
  local FIRST_ROOM_TYPE = ____constants.FIRST_ROOM_TYPE
23
23
  local FIRST_STAGE = ____constants.FIRST_STAGE
24
+ local LAST_ROOM_TYPE = ____constants.LAST_ROOM_TYPE
25
+ local LAST_STAGE = ____constants.LAST_STAGE
24
26
  local MAX_LEVEL_GRID_INDEX = ____constants.MAX_LEVEL_GRID_INDEX
25
- local MAX_ROOM_TYPE = ____constants.MAX_ROOM_TYPE
26
- local MAX_STAGE = ____constants.MAX_STAGE
27
27
  local ____constantsMax = require("constantsMax")
28
28
  local FIRST_CARD = ____constantsMax.FIRST_CARD
29
29
  local FIRST_CHARACTER = ____constantsMax.FIRST_CHARACTER
30
30
  local FIRST_PILL_EFFECT = ____constantsMax.FIRST_PILL_EFFECT
31
- local MAX_CARD = ____constantsMax.MAX_CARD
32
- local MAX_PILL_EFFECT = ____constantsMax.MAX_PILL_EFFECT
33
- local MAX_VANILLA_CHARACTER = ____constantsMax.MAX_VANILLA_CHARACTER
31
+ local LAST_CARD = ____constantsMax.LAST_CARD
32
+ local LAST_PILL_EFFECT = ____constantsMax.LAST_PILL_EFFECT
33
+ local LAST_VANILLA_CHARACTER = ____constantsMax.LAST_VANILLA_CHARACTER
34
34
  local ____HealthType = require("enums.HealthType")
35
35
  local HealthType = ____HealthType.HealthType
36
36
  local ____cards = require("functions.cards")
@@ -282,7 +282,7 @@ function ____exports.card(self, params)
282
282
  end
283
283
  cardNum = match[2]
284
284
  else
285
- if num < FIRST_CARD or num > MAX_CARD then
285
+ if num < FIRST_CARD or num > LAST_CARD then
286
286
  printConsole(
287
287
  nil,
288
288
  "Invalid card sub-type: " .. tostring(num)
@@ -306,7 +306,7 @@ function ____exports.cards(self)
306
306
  do
307
307
  local x = 0
308
308
  while x <= 12 do
309
- if cardType == MAX_CARD then
309
+ if cardType == LAST_CARD then
310
310
  return
311
311
  end
312
312
  local position = gridCoordinatesToWorldPosition(nil, x, y)
@@ -337,7 +337,7 @@ function ____exports.characterCommand(self, params)
337
337
  end
338
338
  character = match[2]
339
339
  else
340
- if num < FIRST_CHARACTER or num > MAX_VANILLA_CHARACTER then
340
+ if num < FIRST_CHARACTER or num > LAST_VANILLA_CHARACTER then
341
341
  printConsole(
342
342
  nil,
343
343
  "Invalid player sub-type: " .. tostring(num)
@@ -559,7 +559,7 @@ function ____exports.pill(self, params)
559
559
  end
560
560
  pillEffect = match[2]
561
561
  else
562
- if num < FIRST_PILL_EFFECT or num > MAX_PILL_EFFECT then
562
+ if num < FIRST_PILL_EFFECT or num > LAST_PILL_EFFECT then
563
563
  printConsole(
564
564
  nil,
565
565
  "Invalid pill effect ID: " .. tostring(num)
@@ -678,10 +678,10 @@ function ____exports.s(self, params)
678
678
  )
679
679
  return
680
680
  end
681
- if stage < FIRST_STAGE or stage > MAX_STAGE then
681
+ if stage < FIRST_STAGE or stage > LAST_STAGE then
682
682
  printConsole(
683
683
  nil,
684
- ((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(MAX_STAGE)) .. "."
684
+ ((("Invalid stage number; must be between " .. tostring(FIRST_STAGE)) .. " and ") .. tostring(LAST_STAGE)) .. "."
685
685
  )
686
686
  return
687
687
  end
@@ -882,7 +882,7 @@ function ____exports.warp(self, params)
882
882
  end
883
883
  roomType = match[2]
884
884
  else
885
- if num < FIRST_ROOM_TYPE or num > MAX_ROOM_TYPE then
885
+ if num < FIRST_ROOM_TYPE or num > LAST_ROOM_TYPE then
886
886
  printConsole(
887
887
  nil,
888
888
  "Invalid room type: " .. tostring(num)
@@ -31,6 +31,12 @@ export declare function getCardType(card: Card): ItemConfigCardType;
31
31
  * containing cards that match any of the specified types.
32
32
  */
33
33
  export declare function getCardsOfType(...cardTypes: ItemConfigCardType[]): Set<Card>;
34
+ /**
35
+ * Helper function to get an array with every modded card sub-type.
36
+ *
37
+ * Returns an empty array if there are no modded cards.
38
+ */
39
+ export declare function getModdedCards(): Card[];
34
40
  /**
35
41
  * Has an equal chance of returning any card (e.g. Fool, Reverse Fool, Wild Card, etc.).
36
42
  *
@@ -61,6 +67,8 @@ export declare function getRandomCardOfType(cardType: ItemConfigCardType, seedOr
61
67
  * @param exceptions Optional. An array of runes to not select.
62
68
  */
63
69
  export declare function getRandomRune(seedOrRNG?: Seed | RNG, exceptions?: Card[]): Card;
70
+ /** Helper function to get an array with every valid vanilla card sub-type. */
71
+ export declare function getVanillaCards(): Card[];
64
72
  /**
65
73
  * Returns true for cards that have the following card type:
66
74
  * - CardType.TAROT
@@ -12,7 +12,9 @@ local ____cachedClasses = require("cachedClasses")
12
12
  local itemConfig = ____cachedClasses.itemConfig
13
13
  local ____constantsMax = require("constantsMax")
14
14
  local FIRST_CARD = ____constantsMax.FIRST_CARD
15
- local MAX_CARD = ____constantsMax.MAX_CARD
15
+ local FIRST_MODDED_CARD = ____constantsMax.FIRST_MODDED_CARD
16
+ local LAST_CARD = ____constantsMax.LAST_CARD
17
+ local MAX_VANILLA_CARD = ____constantsMax.MAX_VANILLA_CARD
16
18
  local ____cardDescriptions = require("objects.cardDescriptions")
17
19
  local CARD_DESCRIPTIONS = ____cardDescriptions.CARD_DESCRIPTIONS
18
20
  local DEFAULT_CARD_DESCRIPTION = ____cardDescriptions.DEFAULT_CARD_DESCRIPTION
@@ -56,7 +58,7 @@ function initCardObjects(self)
56
58
  addSetsToSet(nil, CARD_SET, cards)
57
59
  end
58
60
  function ____exports.getAllCards(self)
59
- return irange(nil, FIRST_CARD, MAX_CARD)
61
+ return irange(nil, FIRST_CARD, LAST_CARD)
60
62
  end
61
63
  function ____exports.getCardType(self, card)
62
64
  local cardType = CARD_TYPES[card]
@@ -103,6 +105,12 @@ function ____exports.getCardName(self, card)
103
105
  end
104
106
  return DEFAULT_CARD_NAME
105
107
  end
108
+ function ____exports.getModdedCards(self)
109
+ if MAX_VANILLA_CARD == LAST_CARD then
110
+ return {}
111
+ end
112
+ return irange(nil, FIRST_MODDED_CARD, LAST_CARD)
113
+ end
106
114
  function ____exports.getRandomCard(self, seedOrRNG, exceptions)
107
115
  if seedOrRNG == nil then
108
116
  seedOrRNG = getRandomSeed(nil)
@@ -133,6 +141,9 @@ function ____exports.getRandomRune(self, seedOrRNG, exceptions)
133
141
  runesSet:delete(Card.RUNE_SHARD)
134
142
  return getRandomSetElement(nil, runesSet, seedOrRNG, exceptions)
135
143
  end
144
+ function ____exports.getVanillaCards(self)
145
+ return irange(nil, FIRST_CARD, MAX_VANILLA_CARD)
146
+ end
136
147
  function ____exports.isCard(self, card)
137
148
  return CARD_SET:has(card)
138
149
  end
@@ -2,7 +2,7 @@ local ____exports = {}
2
2
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
3
3
  local PlayerType = ____isaac_2Dtypescript_2Ddefinitions.PlayerType
4
4
  local ____constantsMax = require("constantsMax")
5
- local MAX_VANILLA_CHARACTER = ____constantsMax.MAX_VANILLA_CHARACTER
5
+ local LAST_VANILLA_CHARACTER = ____constantsMax.LAST_VANILLA_CHARACTER
6
6
  local ____characterNames = require("objects.characterNames")
7
7
  local CHARACTER_NAMES = ____characterNames.CHARACTER_NAMES
8
8
  local DEFAULT_CHARACTER_NAME = ____characterNames.DEFAULT_CHARACTER_NAME
@@ -19,7 +19,7 @@ local CHARACTERS_WITH_NO_SOUL_HEARTS_SET = ____charactersWithNoSoulHeartsSet.CHA
19
19
  local ____lostStyleCharactersSet = require("sets.lostStyleCharactersSet")
20
20
  local LOST_STYLE_CHARACTERS_SET = ____lostStyleCharactersSet.LOST_STYLE_CHARACTERS_SET
21
21
  function ____exports.isVanillaCharacter(self, character)
22
- return character <= MAX_VANILLA_CHARACTER
22
+ return character <= LAST_VANILLA_CHARACTER
23
23
  end
24
24
  function ____exports.characterCanHaveRedHearts(self, character)
25
25
  return not CHARACTERS_WITH_NO_RED_HEARTS_SET:has(character)
@@ -1,11 +1,9 @@
1
1
  import { CollectibleType } from "isaac-typescript-definitions";
2
- /** Returns a set containing every valid collectible type in the game, including modded items. */
3
- export declare function getCollectibleSet(): Set<CollectibleType>;
4
2
  /**
5
- * Helper function to get the number of valid collectibles that exist. (This is not simply equal to
6
- * the highest collectible type, because collectible types are not contiguous.)
7
- *
8
- * Note that there is no corresponding `getTrinketsNum` function because trinket types are
9
- * contiguous. Use the `NUM_TRINKET_TYPES` constant instead.
3
+ * Returns a set containing every valid collectible type in the game, including modded collectibles.
10
4
  */
11
- export declare function getCollectiblesNum(): int;
5
+ export declare function getCollectibleSet(): Set<CollectibleType>;
6
+ /** Returns a set containing every modded collectible type in the game. */
7
+ export declare function getModdedCollectibleSet(): Set<CollectibleType>;
8
+ /** Returns a set containing every valid vanilla collectible type in the game. */
9
+ export declare function getVanillaCollectibleSet(): Set<CollectibleType>;
@@ -4,29 +4,44 @@ local __TS__New = ____lualib.__TS__New
4
4
  local ____exports = {}
5
5
  local ____cachedClasses = require("cachedClasses")
6
6
  local itemConfig = ____cachedClasses.itemConfig
7
+ local ____constantsMax = require("constantsMax")
8
+ local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsMax.LAST_VANILLA_COLLECTIBLE_TYPE
7
9
  local ____collectibles = require("functions.collectibles")
8
10
  local getCollectibleTypeRange = ____collectibles.getCollectibleTypeRange
9
11
  local ____set = require("functions.set")
10
12
  local copySet = ____set.copySet
11
- local COLLECTIBLE_SET = __TS__New(Set)
12
- local function initCollectibleSet(self)
13
+ local ALL_COLLECTIBLES_SET = __TS__New(Set)
14
+ local VANILLA_COLLECTIBLES_SET = __TS__New(Set)
15
+ local MODDED_COLLECTIBLES_SET = __TS__New(Set)
16
+ local function initCollectibleSets(self)
13
17
  for ____, collectibleType in ipairs(getCollectibleTypeRange(nil)) do
14
18
  local itemConfigItem = itemConfig:GetCollectible(collectibleType)
15
19
  if itemConfigItem ~= nil then
16
- COLLECTIBLE_SET:add(collectibleType)
20
+ ALL_COLLECTIBLES_SET:add(collectibleType)
21
+ if collectibleType <= LAST_VANILLA_COLLECTIBLE_TYPE then
22
+ VANILLA_COLLECTIBLES_SET:add(collectibleType)
23
+ else
24
+ MODDED_COLLECTIBLES_SET:add(collectibleType)
25
+ end
17
26
  end
18
27
  end
19
28
  end
20
29
  function ____exports.getCollectibleSet(self)
21
- if COLLECTIBLE_SET.size == 0 then
22
- initCollectibleSet(nil)
30
+ if ALL_COLLECTIBLES_SET.size == 0 then
31
+ initCollectibleSets(nil)
23
32
  end
24
- return copySet(nil, COLLECTIBLE_SET)
33
+ return copySet(nil, ALL_COLLECTIBLES_SET)
25
34
  end
26
- function ____exports.getCollectiblesNum(self)
27
- if COLLECTIBLE_SET.size == 0 then
28
- initCollectibleSet(nil)
35
+ function ____exports.getModdedCollectibleSet(self)
36
+ if ALL_COLLECTIBLES_SET.size == 0 then
37
+ initCollectibleSets(nil)
29
38
  end
30
- return COLLECTIBLE_SET.size
39
+ return copySet(nil, MODDED_COLLECTIBLES_SET)
40
+ end
41
+ function ____exports.getVanillaCollectibleSet(self)
42
+ if ALL_COLLECTIBLES_SET.size == 0 then
43
+ initCollectibleSets(nil)
44
+ end
45
+ return copySet(nil, VANILLA_COLLECTIBLES_SET)
31
46
  end
32
47
  return ____exports
@@ -110,6 +110,28 @@ export declare function getCollectibleTags(collectibleType: CollectibleType): Bi
110
110
  * should use the `getCollectibleSet` helper function instead.
111
111
  */
112
112
  export declare function getCollectibleTypeRange(): CollectibleType[];
113
+ /**
114
+ * Helper function to get an array that represents the all modded collectible types.
115
+ *
116
+ * This function is only useful when building collectible type objects. For most purposes, you
117
+ * should use the `getModdedCollectibleSet` helper function instead.
118
+ *
119
+ * Returns an empty array if there are no modded collectible types.
120
+ *
121
+ * (This function is named differently from the `getVanillaCollectibleTypeRange` function because
122
+ * all modded collectible types are contiguous. Thus, each value represents a real
123
+ * `CollectibleType`.)
124
+ */
125
+ export declare function getModdedCollectibleTypes(): CollectibleType[];
126
+ /**
127
+ * Helper function to get an array that represents the range from the first collectible type to the
128
+ * last vanilla collectible type. This will include integers that do not represent any valid
129
+ * collectible types.
130
+ *
131
+ * This function is only useful when building collectible type objects. For most purposes, you
132
+ * should use the `getVanillaCollectibleSet` helper function instead.
133
+ */
134
+ export declare function getVanillaCollectibleTypeRange(): CollectibleType[];
113
135
  /** Returns true if the item type in the item config is equal to `ItemType.ITEM_ACTIVE`. */
114
136
  export declare function isActiveCollectible(collectibleType: CollectibleType): boolean;
115
137
  /** Returns true if the collectible has a red question mark sprite. */
@@ -15,7 +15,9 @@ local ____constants = require("constants")
15
15
  local BLIND_ITEM_PNG_PATH = ____constants.BLIND_ITEM_PNG_PATH
16
16
  local ____constantsMax = require("constantsMax")
17
17
  local FIRST_COLLECTIBLE_TYPE = ____constantsMax.FIRST_COLLECTIBLE_TYPE
18
- local MAX_COLLECTIBLE_TYPE = ____constantsMax.MAX_COLLECTIBLE_TYPE
18
+ local FIRST_MODDED_COLLECTIBLE_TYPE = ____constantsMax.FIRST_MODDED_COLLECTIBLE_TYPE
19
+ local LAST_COLLECTIBLE_TYPE = ____constantsMax.LAST_COLLECTIBLE_TYPE
20
+ local LAST_VANILLA_COLLECTIBLE_TYPE = ____constantsMax.LAST_VANILLA_COLLECTIBLE_TYPE
19
21
  local ____collectibleDescriptionMap = require("maps.collectibleDescriptionMap")
20
22
  local COLLECTIBLE_DESCRIPTION_MAP = ____collectibleDescriptionMap.COLLECTIBLE_DESCRIPTION_MAP
21
23
  local DEFAULT_COLLECTIBLE_DESCRIPTION = ____collectibleDescriptionMap.DEFAULT_COLLECTIBLE_DESCRIPTION
@@ -185,7 +187,16 @@ function ____exports.getCollectibleTags(self, collectibleType)
185
187
  return itemConfigItem == nil and ItemConfigTagZero or itemConfigItem.Tags
186
188
  end
187
189
  function ____exports.getCollectibleTypeRange(self)
188
- return irange(nil, FIRST_COLLECTIBLE_TYPE, MAX_COLLECTIBLE_TYPE)
190
+ return irange(nil, FIRST_COLLECTIBLE_TYPE, LAST_COLLECTIBLE_TYPE)
191
+ end
192
+ function ____exports.getModdedCollectibleTypes(self)
193
+ if LAST_VANILLA_COLLECTIBLE_TYPE == LAST_COLLECTIBLE_TYPE then
194
+ return {}
195
+ end
196
+ return irange(nil, FIRST_MODDED_COLLECTIBLE_TYPE, LAST_COLLECTIBLE_TYPE)
197
+ end
198
+ function ____exports.getVanillaCollectibleTypeRange(self)
199
+ return irange(nil, FIRST_COLLECTIBLE_TYPE, LAST_VANILLA_COLLECTIBLE_TYPE)
189
200
  end
190
201
  function ____exports.isActiveCollectible(self, collectibleType)
191
202
  local itemType = ____exports.getCollectibleItemType(nil, collectibleType)
@@ -19,7 +19,7 @@ export declare function getKeys(matchingSubType?: number): EntityPickupKey[];
19
19
  /** Helper function to get all of the pill entities in the room. */
20
20
  export declare function getPills(matchingSubType?: number): EntityPickupPill[];
21
21
  /** Helper function to get all of the red heart pickup entities in the room. */
22
- export declare function getRedHearts(): EntityPickup[];
22
+ export declare function getRedHearts(): EntityPickupHeart[];
23
23
  /** Helper function to get all of the sack (i.e. grab bag) entities in the room. */
24
24
  export declare function getSacks(matchingSubType?: number): EntityPickupSack[];
25
25
  /** Helper function to get all of the trinket entities in the room. */
@@ -1,8 +1,4 @@
1
1
  import { ItemConfigPillEffectClass, ItemConfigPillEffectType, PillColor, PillEffect } from "isaac-typescript-definitions";
2
- /** Helper function to get an array with every non-gold horse pill color. */
3
- export declare function getAllHorsePillColors(): PillColor[];
4
- /** Helper function to get an array with every non-gold and non-horse pill color. */
5
- export declare function getAllNormalPillColors(): PillColor[];
6
2
  /**
7
3
  * Helper function to get an array with every non-null pill color. This includes all gold colors and
8
4
  * all horse colors.
@@ -19,6 +15,14 @@ export declare function getAllPillEffects(): PillEffect[];
19
15
  * corresponds to the horse pill color for blue/blue.
20
16
  */
21
17
  export declare function getHorsePillColor(pillColor: PillColor): PillColor;
18
+ /** Helper function to get an array with every non-gold horse pill color. */
19
+ export declare function getHorsePillColors(): PillColor[];
20
+ /**
21
+ * Helper function to get an array with every modded pill effect.
22
+ *
23
+ * Returns an empty array if there are no modded pill effects.
24
+ */
25
+ export declare function getModdedPillEffects(): PillEffect[];
22
26
  /**
23
27
  * Helper function to get the corresponding normal pill color from a horse pill color.
24
28
  *
@@ -27,6 +31,8 @@ export declare function getHorsePillColor(pillColor: PillColor): PillColor;
27
31
  * If called with a non-horse pill color, this function will return back the same color.
28
32
  */
29
33
  export declare function getNormalPillColorFromHorse(pillColor: PillColor): PillColor;
34
+ /** Helper function to get an array with every non-gold and non-horse pill color. */
35
+ export declare function getNormalPillColors(): PillColor[];
30
36
  /**
31
37
  * Helper function to get a pill effect class from a PillEffect enum value. In this context, the
32
38
  * class is equal to the numerical prefix in the "class" tag in the "pocketitems.xml" file. Use the
@@ -58,4 +64,6 @@ export declare function getPillEffectName(pillEffect: PillEffect): string;
58
64
  * will always return `DEFAULT_PILL_EFFECT_TYPE` in those cases.
59
65
  */
60
66
  export declare function getPillEffectType(pillEffect: PillEffect): ItemConfigPillEffectType;
67
+ /** Helper function to get an array with every vanilla pill effect. */
68
+ export declare function getVanillaPillEffects(): PillEffect[];
61
69
  export declare function isHorsePill(pillColor: PillColor): boolean;
@@ -7,11 +7,13 @@ local ____cachedClasses = require("cachedClasses")
7
7
  local itemConfig = ____cachedClasses.itemConfig
8
8
  local ____constantsMax = require("constantsMax")
9
9
  local FIRST_HORSE_PILL_COLOR = ____constantsMax.FIRST_HORSE_PILL_COLOR
10
+ local FIRST_MODDED_PILL_EFFECT = ____constantsMax.FIRST_MODDED_PILL_EFFECT
10
11
  local FIRST_PILL_COLOR = ____constantsMax.FIRST_PILL_COLOR
11
12
  local FIRST_PILL_EFFECT = ____constantsMax.FIRST_PILL_EFFECT
12
- local MAX_HORSE_PILL_COLOR = ____constantsMax.MAX_HORSE_PILL_COLOR
13
- local MAX_NORMAL_PILL_COLOR = ____constantsMax.MAX_NORMAL_PILL_COLOR
14
- local MAX_PILL_EFFECT = ____constantsMax.MAX_PILL_EFFECT
13
+ local LAST_HORSE_PILL_COLOR = ____constantsMax.LAST_HORSE_PILL_COLOR
14
+ local LAST_NORMAL_PILL_COLOR = ____constantsMax.LAST_NORMAL_PILL_COLOR
15
+ local LAST_PILL_EFFECT = ____constantsMax.LAST_PILL_EFFECT
16
+ local LAST_VANILLA_PILL_EFFECT = ____constantsMax.LAST_VANILLA_PILL_EFFECT
15
17
  local ____pillEffectClasses = require("objects.pillEffectClasses")
16
18
  local DEFAULT_PILL_EFFECT_CLASS = ____pillEffectClasses.DEFAULT_PILL_EFFECT_CLASS
17
19
  local PILL_EFFECT_CLASSES = ____pillEffectClasses.PILL_EFFECT_CLASSES
@@ -29,27 +31,33 @@ local ____utils = require("functions.utils")
29
31
  local irange = ____utils.irange
30
32
  local HORSE_PILL_FLAG = 2047
31
33
  local HORSE_PILL_ADJUSTMENT = 2048
32
- function ____exports.getAllHorsePillColors(self)
33
- return irange(nil, FIRST_HORSE_PILL_COLOR, MAX_HORSE_PILL_COLOR)
34
- end
35
- function ____exports.getAllNormalPillColors(self)
36
- return irange(nil, FIRST_PILL_COLOR, MAX_NORMAL_PILL_COLOR)
37
- end
38
34
  function ____exports.getAllPillColors(self)
39
35
  local pillColors = getEnumValues(nil, PillColor)
40
36
  __TS__ArraySlice(pillColors)
41
37
  return pillColors
42
38
  end
43
39
  function ____exports.getAllPillEffects(self)
44
- return irange(nil, FIRST_PILL_EFFECT, MAX_PILL_EFFECT)
40
+ return irange(nil, FIRST_PILL_EFFECT, LAST_PILL_EFFECT)
45
41
  end
46
42
  function ____exports.getHorsePillColor(self, pillColor)
47
43
  return pillColor + HORSE_PILL_ADJUSTMENT
48
44
  end
45
+ function ____exports.getHorsePillColors(self)
46
+ return irange(nil, FIRST_HORSE_PILL_COLOR, LAST_HORSE_PILL_COLOR)
47
+ end
48
+ function ____exports.getModdedPillEffects(self)
49
+ if LAST_VANILLA_PILL_EFFECT == LAST_PILL_EFFECT then
50
+ return {}
51
+ end
52
+ return irange(nil, FIRST_MODDED_PILL_EFFECT, LAST_PILL_EFFECT)
53
+ end
49
54
  function ____exports.getNormalPillColorFromHorse(self, pillColor)
50
55
  local normalPillColor = pillColor - HORSE_PILL_ADJUSTMENT
51
56
  return normalPillColor > PillColor.NULL and normalPillColor or pillColor
52
57
  end
58
+ function ____exports.getNormalPillColors(self)
59
+ return irange(nil, FIRST_PILL_COLOR, LAST_NORMAL_PILL_COLOR)
60
+ end
53
61
  function ____exports.getPillEffectClass(self, pillEffect)
54
62
  local pillEffectClass = PILL_EFFECT_CLASSES[pillEffect]
55
63
  return pillEffectClass == nil and DEFAULT_PILL_EFFECT_CLASS or pillEffectClass
@@ -69,6 +77,9 @@ function ____exports.getPillEffectType(self, pillEffect)
69
77
  local pillEffectClass = PILL_EFFECT_TYPES[pillEffect]
70
78
  return pillEffectClass == nil and DEFAULT_PILL_EFFECT_TYPE or pillEffectClass
71
79
  end
80
+ function ____exports.getVanillaPillEffects(self)
81
+ return irange(nil, FIRST_PILL_EFFECT, LAST_VANILLA_PILL_EFFECT)
82
+ end
72
83
  function ____exports.isHorsePill(self, pillColor)
73
84
  return hasFlag(nil, pillColor, HORSE_PILL_FLAG)
74
85
  end
@@ -12,12 +12,12 @@ local getEnumValues = ____enums.getEnumValues
12
12
  local ____set = require("functions.set")
13
13
  local copySet = ____set.copySet
14
14
  local ____trinkets = require("functions.trinkets")
15
- local getTrinketTypeRange = ____trinkets.getTrinketTypeRange
15
+ local getTrinketTypes = ____trinkets.getTrinketTypes
16
16
  local trinketHasCacheFlag = ____trinkets.trinketHasCacheFlag
17
17
  function initCacheFlagMap(self)
18
18
  for ____, cacheFlag in ipairs(getEnumValues(nil, CacheFlag)) do
19
19
  local trinketsSet = __TS__New(Set)
20
- for ____, trinketType in ipairs(getTrinketTypeRange(nil)) do
20
+ for ____, trinketType in ipairs(getTrinketTypes(nil)) do
21
21
  if trinketHasCacheFlag(nil, trinketType, cacheFlag) then
22
22
  trinketsSet:add(trinketType)
23
23
  end
@@ -6,6 +6,12 @@ import { CacheFlag, TrinketType } from "isaac-typescript-definitions";
6
6
  * corresponds to the golden trinket sub-type for Swallowed Penny.
7
7
  */
8
8
  export declare function getGoldenTrinketType(trinketType: TrinketType): TrinketType;
9
+ /**
10
+ * Helper function to get an array that represents every modded trinket type.
11
+ *
12
+ * Returns an empty array if there are no modded trinket types.
13
+ */
14
+ export declare function getModdedTrinketTypes(): TrinketType[];
9
15
  /**
10
16
  * Returns the slot number corresponding to where a trinket can be safely inserted.
11
17
  *
@@ -38,14 +44,10 @@ export declare function getTrinketDescription(trinketType: TrinketType): string;
38
44
  * ```
39
45
  */
40
46
  export declare function getTrinketName(trinketType: TrinketType): string;
41
- /**
42
- * Helper function to get an array that represents the range from the first trinket type to the last
43
- * trinket type. This will include integers that do not represent any valid trinket types.
44
- *
45
- * This function is only useful when building trinket type objects. For most purposes, you should
46
- * use the `getTrinketSet` helper function instead.
47
- */
48
- export declare function getTrinketTypeRange(): TrinketType[];
47
+ /** Helper function to get an array that contains every trinket type. */
48
+ export declare function getTrinketTypes(): TrinketType[];
49
+ /** Helper function to get an array that represents every vanilla trinket type. */
50
+ export declare function getVanillaTrinketTypes(): TrinketType[];
49
51
  /**
50
52
  * Returns whether or not the player can hold an additional trinket, beyond what they are currently
51
53
  * carrying. This takes into account items that modify the max number of trinkets, like Mom's Purse.
@@ -6,8 +6,10 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
6
6
  local ____cachedClasses = require("cachedClasses")
7
7
  local itemConfig = ____cachedClasses.itemConfig
8
8
  local ____constantsMax = require("constantsMax")
9
+ local FIRST_MODDED_TRINKET_TYPE = ____constantsMax.FIRST_MODDED_TRINKET_TYPE
9
10
  local FIRST_TRINKET_TYPE = ____constantsMax.FIRST_TRINKET_TYPE
10
- local MAX_TRINKET_TYPE = ____constantsMax.MAX_TRINKET_TYPE
11
+ local LAST_TRINKET_TYPE = ____constantsMax.LAST_TRINKET_TYPE
12
+ local LAST_VANILLA_TRINKET_TYPE = ____constantsMax.LAST_VANILLA_TRINKET_TYPE
11
13
  local ____trinketDescriptionMap = require("maps.trinketDescriptionMap")
12
14
  local DEFAULT_TRINKET_DESCRIPTION = ____trinketDescriptionMap.DEFAULT_TRINKET_DESCRIPTION
13
15
  local TRINKET_DESCRIPTION_MAP = ____trinketDescriptionMap.TRINKET_DESCRIPTION_MAP
@@ -32,6 +34,12 @@ local TRINKET_SPRITE_LAYER = 0
32
34
  function ____exports.getGoldenTrinketType(self, trinketType)
33
35
  return trinketType + GOLDEN_TRINKET_ADJUSTMENT
34
36
  end
37
+ function ____exports.getModdedTrinketTypes(self)
38
+ if LAST_VANILLA_TRINKET_TYPE == LAST_TRINKET_TYPE then
39
+ return {}
40
+ end
41
+ return irange(nil, FIRST_MODDED_TRINKET_TYPE, LAST_TRINKET_TYPE)
42
+ end
35
43
  function ____exports.getOpenTrinketSlot(self, player)
36
44
  local maxTrinkets = player:GetMaxTrinkets()
37
45
  local trinketType1 = player:GetTrinket(TrinketSlot.SLOT_1)
@@ -69,8 +77,11 @@ function ____exports.getTrinketName(self, trinketType)
69
77
  end
70
78
  return DEFAULT_TRINKET_NAME
71
79
  end
72
- function ____exports.getTrinketTypeRange(self)
73
- return irange(nil, FIRST_TRINKET_TYPE, MAX_TRINKET_TYPE)
80
+ function ____exports.getTrinketTypes(self)
81
+ return irange(nil, FIRST_TRINKET_TYPE, LAST_TRINKET_TYPE)
82
+ end
83
+ function ____exports.getVanillaTrinketTypes(self)
84
+ return irange(nil, FIRST_TRINKET_TYPE, LAST_VANILLA_TRINKET_TYPE)
74
85
  end
75
86
  function ____exports.hasOpenTrinketSlot(self, player)
76
87
  if isCharacter(nil, player, PlayerType.THE_SOUL_B) then
package/dist/index.d.ts CHANGED
@@ -101,7 +101,6 @@ export * from "./functions/transformations";
101
101
  export * from "./functions/trinketCacheFlag";
102
102
  export * from "./functions/trinketGive";
103
103
  export * from "./functions/trinkets";
104
- export * from "./functions/trinketSet";
105
104
  export * from "./functions/tstlClass";
106
105
  export * from "./functions/ui";
107
106
  export * from "./functions/utils";
package/dist/index.lua CHANGED
@@ -818,14 +818,6 @@ do
818
818
  end
819
819
  end
820
820
  end
821
- do
822
- local ____export = require("functions.trinketSet")
823
- for ____exportKey, ____exportValue in pairs(____export) do
824
- if ____exportKey ~= "default" then
825
- ____exports[____exportKey] = ____exportValue
826
- end
827
- end
828
- end
829
821
  do
830
822
  local ____export = require("functions.tstlClass")
831
823
  for ____exportKey, ____exportValue in pairs(____export) do
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "2.0.26",
3
+ "version": "2.0.29",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -25,10 +25,10 @@
25
25
  "dist/**/*.d.ts"
26
26
  ],
27
27
  "dependencies": {
28
- "isaac-typescript-definitions": "^2.0.45"
28
+ "isaac-typescript-definitions": "^2.0.46"
29
29
  },
30
30
  "devDependencies": {
31
- "isaacscript-lint": "^1.0.157",
31
+ "isaacscript-lint": "^1.0.159",
32
32
  "isaacscript-spell": "^1.0.3",
33
33
  "isaacscript-tsconfig": "^1.1.16",
34
34
  "npm-check-updates": "^13.0.1",