isaacscript-common 87.1.0 → 87.2.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.
@@ -83,9 +83,20 @@ export declare function getPillEffectType(pillEffect: PillEffect): ItemConfigPil
83
83
  export declare function getVanillaPillEffectsOfType(pillEffectType: ItemConfigPillEffectType): readonly PillEffect[];
84
84
  /** Helper function to see if the given pill color is either a gold pill or a horse gold pill. */
85
85
  export declare function isGoldPill(pillColor: PillColor): boolean;
86
- /** Helper function to see if the given pill color is a horse pill. */
86
+ /**
87
+ * Helper function to see if the given pill color is a horse pill.
88
+ *
89
+ * Under the hood, this checks for `pillColor > 2048`.
90
+ */
87
91
  export declare function isHorsePill(pillColor: PillColor): boolean;
88
92
  export declare function isModdedPillEffect(pillEffect: PillEffect): boolean;
93
+ /**
94
+ * Helper function to see if the given pill color is not a gold pill and not a horse pill and not
95
+ * the null value.
96
+ *
97
+ * Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants.
98
+ */
99
+ export declare function isNormalPillColor(pillColor: PillColor): boolean;
89
100
  export declare function isValidPillEffect(pillEffect: int): pillEffect is PillEffect;
90
101
  export declare function isVanillaPillEffect(pillEffect: PillEffect): boolean;
91
102
  //# sourceMappingURL=pills.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pills.d.ts","sourceRoot":"","sources":["../../src/functions/pills.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,wBAAwB,EACxB,UAAU,EACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAqCzD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,SAAS,SAAS,EAAE,CAEvD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAGxE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,S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AC,UAAU,EAAE,UAAU,GAAG,OAAO,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAE/D;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,GAAG,GAAG,UAAU,IAAI,UAAU,CAI3E;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAEnE"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isVanillaPillEffect = exports.isValidPillEffect = exports.isModdedPillEffect = exports.isHorsePill = exports.isGoldPill = exports.getVanillaPillEffectsOfType = exports.getPillEffectType = exports.getPillEffectName = exports.getPillEffectClass = exports.getPillColorFromEffect = exports.getPHDPillEffect = exports.getNormalPillColors = exports.getNormalPillColorFromHorse = exports.getHorsePillColors = exports.getHorsePillColor = exports.getFalsePHDPillEffect = exports.getAllPillColors = void 0;
3
+ exports.isVanillaPillEffect = exports.isValidPillEffect = exports.isNormalPillColor = exports.isModdedPillEffect = exports.isHorsePill = exports.isGoldPill = exports.getVanillaPillEffectsOfType = exports.getPillEffectType = exports.getPillEffectName = exports.getPillEffectClass = exports.getPillColorFromEffect = exports.getPHDPillEffect = exports.getNormalPillColors = exports.getNormalPillColorFromHorse = exports.getHorsePillColors = exports.getHorsePillColor = exports.getFalsePHDPillEffect = exports.getAllPillColors = void 0;
4
4
  const isaac_typescript_definitions_1 = require("isaac-typescript-definitions");
5
5
  const cachedEnumValues_1 = require("../cachedEnumValues");
6
6
  const cachedClasses_1 = require("../core/cachedClasses");
@@ -179,7 +179,11 @@ function isGoldPill(pillColor) {
179
179
  return pillColor === isaac_typescript_definitions_1.PillColor.GOLD || pillColor === isaac_typescript_definitions_1.PillColor.HORSE_GOLD;
180
180
  }
181
181
  exports.isGoldPill = isGoldPill;
182
- /** Helper function to see if the given pill color is a horse pill. */
182
+ /**
183
+ * Helper function to see if the given pill color is a horse pill.
184
+ *
185
+ * Under the hood, this checks for `pillColor > 2048`.
186
+ */
183
187
  function isHorsePill(pillColor) {
184
188
  return (0, types_1.asNumber)(pillColor) > HORSE_PILL_COLOR_ADJUSTMENT;
185
189
  }
@@ -188,6 +192,16 @@ function isModdedPillEffect(pillEffect) {
188
192
  return !isVanillaPillEffect(pillEffect);
189
193
  }
190
194
  exports.isModdedPillEffect = isModdedPillEffect;
195
+ /**
196
+ * Helper function to see if the given pill color is not a gold pill and not a horse pill and not
197
+ * the null value.
198
+ *
199
+ * Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants.
200
+ */
201
+ function isNormalPillColor(pillColor) {
202
+ return pillColor <= constantsFirstLast_1.FIRST_PILL_COLOR && pillColor <= constantsFirstLast_1.LAST_NORMAL_PILL_COLOR;
203
+ }
204
+ exports.isNormalPillColor = isNormalPillColor;
191
205
  function isValidPillEffect(pillEffect) {
192
206
  const potentialPillEffect = (0, types_1.asPillEffect)(pillEffect);
193
207
  const itemConfigPillEffect = cachedClasses_1.itemConfig.GetPillEffect(potentialPillEffect);
@@ -37,6 +37,8 @@ local asPillEffect = ____types.asPillEffect
37
37
  local ____utils = require("functions.utils")
38
38
  local iRange = ____utils.iRange
39
39
  --- Helper function to see if the given pill color is a horse pill.
40
+ --
41
+ -- Under the hood, this checks for `pillColor > 2048`.
40
42
  function ____exports.isHorsePill(self, pillColor)
41
43
  return asNumber(nil, pillColor) > HORSE_PILL_COLOR_ADJUSTMENT
42
44
  end
@@ -158,6 +160,13 @@ end
158
160
  function ____exports.isModdedPillEffect(self, pillEffect)
159
161
  return not ____exports.isVanillaPillEffect(nil, pillEffect)
160
162
  end
163
+ --- Helper function to see if the given pill color is not a gold pill and not a horse pill and not
164
+ -- the null value.
165
+ --
166
+ -- Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants.
167
+ function ____exports.isNormalPillColor(self, pillColor)
168
+ return pillColor <= FIRST_PILL_COLOR and pillColor <= LAST_NORMAL_PILL_COLOR
169
+ end
161
170
  function ____exports.isValidPillEffect(self, pillEffect)
162
171
  local potentialPillEffect = asPillEffect(nil, pillEffect)
163
172
  local itemConfigPillEffect = itemConfig:GetPillEffect(potentialPillEffect)
@@ -9728,7 +9728,11 @@ export declare function isHiddenSecretRoomDoor(door: GridEntityDoor): boolean;
9728
9728
  */
9729
9729
  export declare function isHomeCloset(roomData: RoomConfig): boolean;
9730
9730
 
9731
- /** Helper function to see if the given pill color is a horse pill. */
9731
+ /**
9732
+ * Helper function to see if the given pill color is a horse pill.
9733
+ *
9734
+ * Under the hood, this checks for `pillColor > 2048`.
9735
+ */
9732
9736
  export declare function isHorsePill(pillColor: PillColor): boolean;
9733
9737
 
9734
9738
  export declare function isInteger(variable: unknown): variable is int;
@@ -9898,6 +9902,14 @@ export declare function isMultiplayer(): boolean;
9898
9902
  */
9899
9903
  export declare function isNarrowRoom(roomShape: RoomShape): boolean;
9900
9904
 
9905
+ /**
9906
+ * Helper function to see if the given pill color is not a gold pill and not a horse pill and not
9907
+ * the null value.
9908
+ *
9909
+ * Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants.
9910
+ */
9911
+ export declare function isNormalPillColor(pillColor: PillColor): boolean;
9912
+
9901
9913
  /** Helper function to detect if a variable is of type `EntityNPC`. */
9902
9914
  export declare function isNPC(variable: unknown): variable is EntityNPC;
9903
9915
 
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 87.0.0
3
+ isaacscript-common 87.2.0
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -39183,6 +39183,8 @@ local asPillEffect = ____types.asPillEffect
39183
39183
  local ____utils = require("functions.utils")
39184
39184
  local iRange = ____utils.iRange
39185
39185
  --- Helper function to see if the given pill color is a horse pill.
39186
+ --
39187
+ -- Under the hood, this checks for `pillColor > 2048`.
39186
39188
  function ____exports.isHorsePill(self, pillColor)
39187
39189
  return asNumber(nil, pillColor) > HORSE_PILL_COLOR_ADJUSTMENT
39188
39190
  end
@@ -39304,6 +39306,13 @@ end
39304
39306
  function ____exports.isModdedPillEffect(self, pillEffect)
39305
39307
  return not ____exports.isVanillaPillEffect(nil, pillEffect)
39306
39308
  end
39309
+ --- Helper function to see if the given pill color is not a gold pill and not a horse pill and not
39310
+ -- the null value.
39311
+ --
39312
+ -- Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants.
39313
+ function ____exports.isNormalPillColor(self, pillColor)
39314
+ return pillColor <= FIRST_PILL_COLOR and pillColor <= LAST_NORMAL_PILL_COLOR
39315
+ end
39307
39316
  function ____exports.isValidPillEffect(self, pillEffect)
39308
39317
  local potentialPillEffect = asPillEffect(nil, pillEffect)
39309
39318
  local itemConfigPillEffect = itemConfig:GetPillEffect(potentialPillEffect)
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.39.1"
8
+ "packageVersion": "7.39.4"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "87.1.0",
3
+ "version": "87.2.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -209,7 +209,11 @@ export function isGoldPill(pillColor: PillColor): boolean {
209
209
  return pillColor === PillColor.GOLD || pillColor === PillColor.HORSE_GOLD;
210
210
  }
211
211
 
212
- /** Helper function to see if the given pill color is a horse pill. */
212
+ /**
213
+ * Helper function to see if the given pill color is a horse pill.
214
+ *
215
+ * Under the hood, this checks for `pillColor > 2048`.
216
+ */
213
217
  export function isHorsePill(pillColor: PillColor): boolean {
214
218
  return asNumber(pillColor) > HORSE_PILL_COLOR_ADJUSTMENT;
215
219
  }
@@ -218,6 +222,16 @@ export function isModdedPillEffect(pillEffect: PillEffect): boolean {
218
222
  return !isVanillaPillEffect(pillEffect);
219
223
  }
220
224
 
225
+ /**
226
+ * Helper function to see if the given pill color is not a gold pill and not a horse pill and not
227
+ * the null value.
228
+ *
229
+ * Under the hood, this checks using the `FIRST_PILL_COLOR` and `LAST_NORMAL_PILL_COLOR` constants.
230
+ */
231
+ export function isNormalPillColor(pillColor: PillColor): boolean {
232
+ return pillColor <= FIRST_PILL_COLOR && pillColor <= LAST_NORMAL_PILL_COLOR;
233
+ }
234
+
221
235
  export function isValidPillEffect(pillEffect: int): pillEffect is PillEffect {
222
236
  const potentialPillEffect = asPillEffect(pillEffect);
223
237
  const itemConfigPillEffect = itemConfig.GetPillEffect(potentialPillEffect);