isaacscript-common 24.1.0 → 24.1.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.
@@ -12030,9 +12030,8 @@ export declare const NUM_VANILLA_CARD_TYPES: number;
12030
12030
  export declare const NUM_VANILLA_COLLECTIBLE_TYPES: number;
12031
12031
 
12032
12032
  /**
12033
- * Calculated from the `PillEffect` enum.
12034
- *
12035
- * (There is no `PillEffect.NULL` in the custom enum, so we do not have to subtract one here.)
12033
+ * Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
12034
+ * do not have to subtract one here.)
12036
12035
  */
12037
12036
  export declare const NUM_VANILLA_PILL_EFFECTS: number;
12038
12037
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 24.1.0
3
+ isaacscript-common 24.1.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -17314,6 +17314,8 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
17314
17314
  local ____enums = require("src.functions.enums")
17315
17315
  local getEnumLength = ____enums.getEnumLength
17316
17316
  local getLastEnumValue = ____enums.getLastEnumValue
17317
+ local ____utils = require("src.functions.utils")
17318
+ local iRange = ____utils.iRange
17317
17319
  ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
17318
17320
  ____exports.LAST_VANILLA_COLLECTIBLE_TYPE = getLastEnumValue(nil, CollectibleType)
17319
17321
  ____exports.NUM_VANILLA_COLLECTIBLE_TYPES = getEnumLength(nil, CollectibleType) - 1
@@ -17330,7 +17332,7 @@ ____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
17330
17332
  ____exports.LAST_NORMAL_PILL_COLOR = PillColor.WHITE_YELLOW
17331
17333
  ____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
17332
17334
  ____exports.LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
17333
- ____exports.NUM_NORMAL_PILL_COLORS = ____exports.LAST_NORMAL_PILL_COLOR - ____exports.FIRST_PILL_COLOR
17335
+ ____exports.NUM_NORMAL_PILL_COLORS = #iRange(nil, ____exports.FIRST_PILL_COLOR, ____exports.LAST_NORMAL_PILL_COLOR)
17334
17336
  ____exports.FIRST_CHARACTER = PlayerType.ISAAC
17335
17337
  ____exports.LAST_VANILLA_CHARACTER = getLastEnumValue(nil, PlayerType)
17336
17338
  ____exports.FIRST_ROOM_TYPE = RoomType.DEFAULT
@@ -27,9 +27,8 @@ export declare const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
27
27
  /** Calculated from the `PillEffect` enum. */
28
28
  export declare const LAST_VANILLA_PILL_EFFECT: PillEffect;
29
29
  /**
30
- * Calculated from the `PillEffect` enum.
31
- *
32
- * (There is no `PillEffect.NULL` in the custom enum, so we do not have to subtract one here.)
30
+ * Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
31
+ * do not have to subtract one here.)
33
32
  */
34
33
  export declare const NUM_VANILLA_PILL_EFFECTS: number;
35
34
  /** Equal to `PillColor.BLUE_BLUE`. */
@@ -1 +1 @@
1
- {"version":3,"file":"constantsFirstLast.d.ts","sourceRoot":"","sources":["../../../src/core/constantsFirstLast.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,MAAM,8BAA8B,CAAC;AAOtC,4CAA4C;AAC5C,eAAO,MAAM,sBAAsB,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,iBAAoC,CAAC;AAE/E,4FAA4F;AAC5F,eAAO,MAAM,6BAA6B,QAAqC,CAAC;AAMhF,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB,aAAgC,CAA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M,6BAA6B,iBAAoC,CAAC;AAE/E,4FAA4F;AAC5F,eAAO,MAAM,6BAA6B,QAAqC,CAAC;AAMhF,8CAA8C;AAC9C,eAAO,MAAM,kBAAkB,8BAA8B,CAAC;AAE9D,8CAA8C;AAC9C,eAAO,MAAM,yBAAyB,aAAgC,CAAC;AAEvE,oFAAoF;AACpF,eAAO,MAAM,yBAAyB,QAAiC,CAAC;AAMxE,4BAA4B;AAC5B,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAE7C,uCAAuC;AACvC,eAAO,MAAM,sBAAsB,UAA6B,CAAC;AAEjE,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAMlE,qCAAqC;AACrC,eAAO,MAAM,iBAAiB,qBAAqB,CAAC;AAEpD,6CAA6C;AAC7C,eAAO,MAAM,wBAAwB,YAA+B,CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAA4B,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,mCAAmC;AACnC,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAIhD,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,YAA+B,CAAC;AAMnE,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,cAAc,UAA6B,CAAC;AAMzD,eAAO,MAAM,WAAW,wBAAwB,CAAC;AACjD,eAAO,MAAM,UAAU,YAA+B,CAAC"}
@@ -11,6 +11,8 @@ local TrinketType = ____isaac_2Dtypescript_2Ddefinitions.TrinketType
11
11
  local ____enums = require("src.functions.enums")
12
12
  local getEnumLength = ____enums.getEnumLength
13
13
  local getLastEnumValue = ____enums.getLastEnumValue
14
+ local ____utils = require("src.functions.utils")
15
+ local iRange = ____utils.iRange
14
16
  --- Equal to `CollectibleType.SAD_ONION`.
15
17
  ____exports.FIRST_COLLECTIBLE_TYPE = CollectibleType.SAD_ONION
16
18
  --- Calculated from the `CollectibleType` enum.
@@ -36,9 +38,8 @@ ____exports.NUM_VANILLA_CARD_TYPES = getEnumLength(nil, CardType) - 1
36
38
  ____exports.FIRST_PILL_EFFECT = PillEffect.BAD_GAS
37
39
  --- Calculated from the `PillEffect` enum.
38
40
  ____exports.LAST_VANILLA_PILL_EFFECT = getLastEnumValue(nil, PillEffect)
39
- --- Calculated from the `PillEffect` enum.
40
- --
41
- -- (There is no `PillEffect.NULL` in the custom enum, so we do not have to subtract one here.)
41
+ --- Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
42
+ -- do not have to subtract one here.)
42
43
  ____exports.NUM_VANILLA_PILL_EFFECTS = getEnumLength(nil, PillEffect)
43
44
  --- Equal to `PillColor.BLUE_BLUE`.
44
45
  ____exports.FIRST_PILL_COLOR = PillColor.BLUE_BLUE
@@ -54,7 +55,7 @@ ____exports.FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE
54
55
  -- Note that `PillColor.HORSE_GOLD` is technically higher, but that is not considered for the
55
56
  -- purposes of this constant.
56
57
  ____exports.LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW
57
- ____exports.NUM_NORMAL_PILL_COLORS = ____exports.LAST_NORMAL_PILL_COLOR - ____exports.FIRST_PILL_COLOR
58
+ ____exports.NUM_NORMAL_PILL_COLORS = #iRange(nil, ____exports.FIRST_PILL_COLOR, ____exports.LAST_NORMAL_PILL_COLOR)
58
59
  --- Equal to `PlayerType.ISAAC`.
59
60
  ____exports.FIRST_CHARACTER = PlayerType.ISAAC
60
61
  --- Calculated from the `PlayerType` enum.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "24.1.0",
3
+ "version": "24.1.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -11,6 +11,7 @@ import {
11
11
  TrinketType,
12
12
  } from "isaac-typescript-definitions";
13
13
  import { getEnumLength, getLastEnumValue } from "../functions/enums";
14
+ import { iRange } from "../functions/utils";
14
15
 
15
16
  // ------------
16
17
  // Collectibles
@@ -67,9 +68,8 @@ export const FIRST_PILL_EFFECT = PillEffect.BAD_GAS;
67
68
  export const LAST_VANILLA_PILL_EFFECT = getLastEnumValue(PillEffect);
68
69
 
69
70
  /**
70
- * Calculated from the `PillEffect` enum.
71
- *
72
- * (There is no `PillEffect.NULL` in the custom enum, so we do not have to subtract one here.)
71
+ * Calculated from the `PillEffect` enum. (There is no `PillEffect.NULL` in the custom enum, so we
72
+ * do not have to subtract one here.)
73
73
  */
74
74
  export const NUM_VANILLA_PILL_EFFECTS = getEnumLength(PillEffect);
75
75
 
@@ -99,7 +99,10 @@ export const FIRST_HORSE_PILL_COLOR = PillColor.HORSE_BLUE_BLUE;
99
99
  */
100
100
  export const LAST_HORSE_PILL_COLOR = PillColor.HORSE_WHITE_YELLOW;
101
101
 
102
- export const NUM_NORMAL_PILL_COLORS = LAST_NORMAL_PILL_COLOR - FIRST_PILL_COLOR;
102
+ export const NUM_NORMAL_PILL_COLORS = iRange(
103
+ FIRST_PILL_COLOR,
104
+ LAST_NORMAL_PILL_COLOR,
105
+ ).length;
103
106
 
104
107
  // -------
105
108
  // Players