isaacscript-common 72.4.1 → 72.6.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.
@@ -13,6 +13,10 @@ export declare function getDefaultCollectibleTypesInItemPool(itemPoolType: ItemP
13
13
  * "normal" item pools when playing in Greed Mode.
14
14
  */
15
15
  export declare function getDefaultItemPoolsForCollectibleType(collectibleType: CollectibleType): ItemPoolType[];
16
+ /**
17
+ * Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
18
+ */
19
+ export declare function getItemPoolName(itemPoolType: ItemPoolType): string;
16
20
  /**
17
21
  * Helper function to get a random item pool. This is not as simple as getting a random value from
18
22
  * the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
@@ -1 +1 @@
1
- {"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAwC5D;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,YAAY,GACzB,GAAG,CAAC,eAAe,CAAC,CAEtB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,eAAe,EAAE,eAAe,GAC/B,YAAY,EAAE,CAgBhB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,GAChC,YAAY,CAMd;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAM3E"}
1
+ {"version":3,"file":"itemPool.d.ts","sourceRoot":"","sources":["../../../src/functions/itemPool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAyC5D;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,YAAY,GACzB,GAAG,CAAC,eAAe,CAAC,CAEtB;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,eAAe,EAAE,eAAe,GAC/B,YAAY,EAAE,CAgBhB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,MAAM,CAElE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,IAAI,GAAG,GAAG,GAAG,SAAS,GAChC,YAAY,CAMd;AAED;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,eAAe,EAAE,eAAe,EAChC,YAAY,EAAE,YAAY,GACzB,OAAO,CAIT;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAMN;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,YAAY,EAAE,WAAW,EAAE,GAAG,IAAI,CAM3E"}
@@ -10,6 +10,8 @@ local ____cachedEnumValues = require("src.arrays.cachedEnumValues")
10
10
  local ITEM_POOL_TYPE_VALUES = ____cachedEnumValues.ITEM_POOL_TYPE_VALUES
11
11
  local ____cachedClasses = require("src.core.cachedClasses")
12
12
  local game = ____cachedClasses.game
13
+ local ____itemPoolTypeToItemPoolName = require("src.maps.itemPoolTypeToItemPoolName")
14
+ local ITEM_POOL_TYPE_TO_ITEM_POOL_NAME = ____itemPoolTypeToItemPoolName.ITEM_POOL_TYPE_TO_ITEM_POOL_NAME
13
15
  local ____itemPoolTypeToCollectibleTypesSet = require("src.objects.itemPoolTypeToCollectibleTypesSet")
14
16
  local ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET = ____itemPoolTypeToCollectibleTypesSet.ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET
15
17
  local ____array = require("src.functions.array")
@@ -77,6 +79,10 @@ function ____exports.getDefaultItemPoolsForCollectibleType(self, collectibleType
77
79
  end
78
80
  return collectibleItemPoolTypes
79
81
  end
82
+ --- Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
83
+ function ____exports.getItemPoolName(self, itemPoolType)
84
+ return ITEM_POOL_TYPE_TO_ITEM_POOL_NAME[itemPoolType]
85
+ end
80
86
  --- Helper function to get a random item pool. This is not as simple as getting a random value from
81
87
  -- the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
82
88
  -- Greed Mode item pools should be excluded if not playing in Greed Mode.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="@typescript-to-lua/language-extensions" />
2
- import type { CollectibleType } from "isaac-typescript-definitions";
2
+ import type { CollectibleType, ItemPoolType } from "isaac-typescript-definitions";
3
3
  import { DamageFlag, DisplayFlag, EntityFlag, ProjectileFlag, TearFlag, UseFlag } from "isaac-typescript-definitions";
4
4
  /**
5
5
  * Helper function to log all of the values in an array.
@@ -33,6 +33,13 @@ export declare function logEntityID(this: void, entity: Entity): void;
33
33
  export declare function logFlags<T extends BitFlag | BitFlag128>(this: void, flags: T | BitFlags<T>, flagEnum: Record<string, T>, description?: string): void;
34
34
  /** Helper function for logging every game state flag that is turned on. Useful when debugging. */
35
35
  export declare function logGameStateFlags(this: void): void;
36
+ /**
37
+ * Helper function to log the names of a item pool type array.
38
+ *
39
+ * @param itemPoolTypes The item pool types to log.
40
+ * @param name Optional. The name of the array, which will be logged before the elements.
41
+ */
42
+ export declare function logItemPoolTypes(this: void, itemPoolTypes: ItemPoolType[] | readonly ItemPoolType[], name?: string): void;
36
43
  /**
37
44
  * Helper function to log a `KColor` object.
38
45
  *
@@ -1 +1 @@
1
- {"version":3,"file":"logMisc.d.ts","sourceRoot":"","sources":["../../../src/functions/logMisc.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,UAAU,EACV,WAAW,EACX,UAAU,EAMV,cAAc,EAGd,QAAQ,EACR,OAAO,EACR,MAAM,8BAA8B,CAAC;AAsBtC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,EACzB,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,IAAI,EACV,gBAAgB,EAAE,eAAe,EAAE,GAAG,SAAS,eAAe,EAAE,EAChE,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAQtE;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,GAC7C,IAAI,CAEN;AAED,0FAA0F;AAC1F,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,GAChD,IAAI,CAEN;AAED,yFAAyF;AACzF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC,GAC7C,IAAI,CAEN;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE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CAAC,CAAC,EAAE,CAAC,CAAC,GACrB,IAAI,CAqBN;AAED,wFAAwF;AACxF,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC,GACvC,IAAI,CAEN;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CACzB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,GACpC,IAAI,CAEN;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAoB/D;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,UAAQ,GACZ,IAAI,CAON"}
@@ -19,6 +19,7 @@ local HeartSubType = ____isaac_2Dtypescript_2Ddefinitions.HeartSubType
19
19
  local LevelStateFlag = ____isaac_2Dtypescript_2Ddefinitions.LevelStateFlag
20
20
  local Music = ____isaac_2Dtypescript_2Ddefinitions.Music
21
21
  local ProjectileFlag = ____isaac_2Dtypescript_2Ddefinitions.ProjectileFlag
22
+ local RoomType = ____isaac_2Dtypescript_2Ddefinitions.RoomType
22
23
  local SeedEffect = ____isaac_2Dtypescript_2Ddefinitions.SeedEffect
23
24
  local SoundEffect = ____isaac_2Dtypescript_2Ddefinitions.SoundEffect
24
25
  local TearFlag = ____isaac_2Dtypescript_2Ddefinitions.TearFlag
@@ -44,6 +45,8 @@ local ____flag = require("src.functions.flag")
44
45
  local hasFlag = ____flag.hasFlag
45
46
  local ____isaacAPIClass = require("src.functions.isaacAPIClass")
46
47
  local getIsaacAPIClassName = ____isaacAPIClass.getIsaacAPIClassName
48
+ local ____itemPool = require("src.functions.itemPool")
49
+ local getItemPoolName = ____itemPool.getItemPoolName
47
50
  local ____log = require("src.functions.log")
48
51
  local log = ____log.log
49
52
  local ____playerHealth = require("src.functions.playerHealth")
@@ -168,6 +171,22 @@ function ____exports.logGameStateFlags()
168
171
  log(" n/a (no flags)")
169
172
  end
170
173
  end
174
+ --- Helper function to log the names of a item pool type array.
175
+ --
176
+ -- @param itemPoolTypes The item pool types to log.
177
+ -- @param name Optional. The name of the array, which will be logged before the elements.
178
+ function ____exports.logItemPoolTypes(itemPoolTypes, name)
179
+ if name == nil then
180
+ name = "item pool types"
181
+ end
182
+ log(("Logging " .. name) .. ":")
183
+ local i = 1
184
+ for ____, itemPoolType in ipairs(itemPoolTypes) do
185
+ local itemPoolName = getItemPoolName(nil, itemPoolType)
186
+ log(((((tostring(i) .. ") ") .. itemPoolName) .. " (") .. tostring(itemPoolType)) .. ")")
187
+ i = i + 1
188
+ end
189
+ end
171
190
  --- Helper function to log a `KColor` object.
172
191
  --
173
192
  -- @param kColor The `KColor` object to log.
@@ -277,7 +296,9 @@ function ____exports.logRoom()
277
296
  local roomData = getRoomData(nil)
278
297
  log("Logging room information:")
279
298
  log("- Room stage ID: " .. tostring(roomData.StageID))
280
- log((((("- Type/variant/sub-type: " .. tostring(roomData.Type)) .. ".") .. tostring(roomData.Variant)) .. ".") .. tostring(roomData.Subtype))
299
+ log(((("- Room type: " .. RoomType[roomData.Type]) .. " (") .. tostring(roomData.Type)) .. ")")
300
+ log("- Variant: " .. tostring(roomData.Variant))
301
+ log("- Sub-type: " .. tostring(roomData.Subtype))
281
302
  log("- Name: " .. roomData.Name)
282
303
  local roomGridIndexName = GridRoom[roomGridIndex]
283
304
  if roomGridIndexName == nil then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "72.4.1",
3
+ "version": "72.6.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -5,6 +5,7 @@ import type {
5
5
  import { ItemPoolType } from "isaac-typescript-definitions";
6
6
  import { ITEM_POOL_TYPE_VALUES } from "../arrays/cachedEnumValues";
7
7
  import { game } from "../core/cachedClasses";
8
+ import { ITEM_POOL_TYPE_TO_ITEM_POOL_NAME } from "../maps/itemPoolTypeToItemPoolName";
8
9
  import { ITEM_POOL_TYPE_TO_COLLECTIBLE_TYPES_SET } from "../objects/itemPoolTypeToCollectibleTypesSet";
9
10
  import { arrayRemove, getRandomArrayElement } from "./array";
10
11
 
@@ -79,6 +80,13 @@ export function getDefaultItemPoolsForCollectibleType(
79
80
  return collectibleItemPoolTypes;
80
81
  }
81
82
 
83
+ /**
84
+ * Helper function to get the name for an item pool type as it appears in the "itempools.xml" file.
85
+ */
86
+ export function getItemPoolName(itemPoolType: ItemPoolType): string {
87
+ return ITEM_POOL_TYPE_TO_ITEM_POOL_NAME[itemPoolType];
88
+ }
89
+
82
90
  /**
83
91
  * Helper function to get a random item pool. This is not as simple as getting a random value from
84
92
  * the `ItemPoolType` enum, since `ItemPoolType.SHELL_GAME` (7) is not a real item pool and the
@@ -1,4 +1,7 @@
1
- import type { CollectibleType } from "isaac-typescript-definitions";
1
+ import type {
2
+ CollectibleType,
3
+ ItemPoolType,
4
+ } from "isaac-typescript-definitions";
2
5
  import {
3
6
  DamageFlag,
4
7
  DisplayFlag,
@@ -9,6 +12,7 @@ import {
9
12
  LevelStateFlag,
10
13
  Music,
11
14
  ProjectileFlag,
15
+ RoomType,
12
16
  SeedEffect,
13
17
  SoundEffect,
14
18
  TearFlag,
@@ -24,6 +28,7 @@ import { getEntityID } from "./entities";
24
28
  import { getEnumEntries } from "./enums";
25
29
  import { hasFlag } from "./flag";
26
30
  import { getIsaacAPIClassName } from "./isaacAPIClass";
31
+ import { getItemPoolName } from "./itemPool";
27
32
  import { log } from "./log";
28
33
  import { getPlayerHealth } from "./playerHealth";
29
34
  import { getEffectsList, getPlayerName } from "./players";
@@ -177,6 +182,31 @@ export function logGameStateFlags(this: void): void {
177
182
  }
178
183
  }
179
184
 
185
+ /**
186
+ * Helper function to log the names of a item pool type array.
187
+ *
188
+ * @param itemPoolTypes The item pool types to log.
189
+ * @param name Optional. The name of the array, which will be logged before the elements.
190
+ */
191
+ export function logItemPoolTypes(
192
+ this: void,
193
+ itemPoolTypes: ItemPoolType[] | readonly ItemPoolType[],
194
+ name?: string,
195
+ ): void {
196
+ if (name === undefined) {
197
+ name = "item pool types";
198
+ }
199
+
200
+ log(`Logging ${name}:`);
201
+
202
+ let i = 1;
203
+ for (const itemPoolType of itemPoolTypes) {
204
+ const itemPoolName = getItemPoolName(itemPoolType);
205
+ log(`${i}) ${itemPoolName} (${itemPoolType})`);
206
+ i++;
207
+ }
208
+ }
209
+
180
210
  /**
181
211
  * Helper function to log a `KColor` object.
182
212
  *
@@ -319,9 +349,9 @@ export function logRoom(this: void): void {
319
349
 
320
350
  log("Logging room information:");
321
351
  log(`- Room stage ID: ${roomData.StageID}`);
322
- log(
323
- `- Type/variant/sub-type: ${roomData.Type}.${roomData.Variant}.${roomData.Subtype}`,
324
- );
352
+ log(`- Room type: ${RoomType[roomData.Type]} (${roomData.Type})`);
353
+ log(`- Variant: ${roomData.Variant}`);
354
+ log(`- Sub-type: ${roomData.Subtype}`);
325
355
  log(`- Name: ${roomData.Name}`);
326
356
 
327
357
  const roomGridIndexName = GridRoom[roomGridIndex];