isaacscript-common 1.2.89 → 1.2.92

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.
@@ -10,18 +10,18 @@ export declare function getDebugPrependString(msg: string, numParentFunctions?:
10
10
  * and the line number before the string.
11
11
  */
12
12
  export declare function log(this: void, msg: string): void;
13
- /** Helper function for printing out every damage flag that is turned on. Helpful when debugging. */
13
+ /** Helper function for printing out every damage flag that is turned on. Useful when debugging. */
14
14
  export declare function logAllDamageFlags(this: void, flags: int): void;
15
- /** Helper function for printing out every entity flag that is turned on. Helpful when debugging. */
15
+ /** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
16
16
  export declare function logAllEntityFlags(this: void, flags: int): void;
17
- /** Helper function for printing out every flag that is turned on. Helpful when debugging. */
17
+ /** Helper function for printing out every flag that is turned on. Useful when debugging. */
18
18
  export declare function logAllFlags(this: void, flags: int, flagEnum: LuaTable, description?: string): void;
19
19
  /**
20
- * Helper function for printing out every game state flag that is turned on. Helpful when debugging.
20
+ * Helper function for printing out every game state flag that is turned on. Useful when debugging.
21
21
  */
22
22
  export declare function logAllGameStateFlags(this: void): void;
23
23
  /**
24
- * Helper function for printing out every projectile flag that is turned on. Helpful when debugging.
24
+ * Helper function for printing out every projectile flag that is turned on. Useful when debugging.
25
25
  */
26
26
  export declare function logAllProjectileFlags(this: void, flags: int): void;
27
27
  /**
@@ -29,15 +29,16 @@ export declare function logAllProjectileFlags(this: void, flags: int): void;
29
29
  * particular run.
30
30
  */
31
31
  export declare function logAllSeedEffects(this: void): void;
32
- /** Helper function for printing out every use flag that is turned on. Helpful when debugging. */
32
+ /** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
33
33
  export declare function logAllTearFlags(this: void, flags: int): void;
34
- /** Helper function for printing out every use flag that is turned on. Helpful when debugging. */
34
+ /** Helper function for printing out every use flag that is turned on. Useful when debugging. */
35
35
  export declare function logAllUseFlags(this: void, flags: int): void;
36
36
  export declare function logArray<T>(this: void, array: T[]): void;
37
37
  export declare function logColor(this: void, color: Color): void;
38
38
  export declare function logEntity(this: void, entity: Entity): void;
39
39
  export declare function logKColor(this: void, kColor: KColor): void;
40
40
  export declare function logMap(this: void, map: Map<AnyNotNil, unknown>): void;
41
+ /** Helper function for printing out information about the current room. */
41
42
  export declare function logTable(this: void, table: unknown, parentTables?: number): void;
42
43
  export declare function logTemporaryEffects(this: void, player: EntityPlayer): void;
43
44
  export declare function logSet(this: void, set: Set<AnyNotNil>): void;
@@ -1,7 +1,8 @@
1
1
  --[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
2
2
  local ____lualib = require("lualib_bundle")
3
3
  local Map = ____lualib.Map
4
- local __TS__Iterator = ____lualib.__TS__Iterator
4
+ local __TS__Spread = ____lualib.__TS__Spread
5
+ local __TS__ArraySort = ____lualib.__TS__ArraySort
5
6
  local __TS__ArrayForEach = ____lualib.__TS__ArrayForEach
6
7
  local Set = ____lualib.Set
7
8
  local ____exports = {}
@@ -115,9 +116,10 @@ function ____exports.logKColor(kColor)
115
116
  end
116
117
  function ____exports.logMap(map)
117
118
  ____exports.log("Printing out a TSTL Map:")
118
- for ____, ____value in __TS__Iterator(map:entries()) do
119
- local key = ____value[1]
120
- local value = ____value[2]
119
+ local mapKeys = {__TS__Spread(map:keys())}
120
+ __TS__ArraySort(mapKeys)
121
+ for ____, key in ipairs(mapKeys) do
122
+ local value = map:get(key)
121
123
  ____exports.log(((" Key: " .. tostring(key)) .. ", Value: ") .. tostring(value))
122
124
  end
123
125
  ____exports.log("The size of the map was: " .. tostring(map.size))
@@ -134,13 +136,16 @@ function ____exports.logTable(____table, parentTables)
134
136
  " ",
135
137
  math.floor(numSpaces)
136
138
  )
139
+ local numKeys = 0
137
140
  for key, value in pairs(____table) do
138
141
  ____exports.log((((indentation .. "Key: ") .. tostring(key)) .. ", Value: ") .. tostring(value))
139
142
  local valueType = type(value)
140
143
  if valueType == "table" then
141
144
  ____exports.logTable(value, parentTables + 1)
142
145
  end
146
+ numKeys = numKeys + 1
143
147
  end
148
+ ____exports.log("The size of the table was: " .. tostring(numKeys))
144
149
  end
145
150
  function ____exports.logTemporaryEffects(player)
146
151
  local effects = getEffectsList(nil, player)
@@ -168,7 +173,9 @@ function ____exports.logTemporaryEffects(player)
168
173
  end
169
174
  function ____exports.logSet(set)
170
175
  ____exports.log("Printing out a TSTL Set:")
171
- for ____, value in __TS__Iterator(set:values()) do
176
+ local setValues = {__TS__Spread(set:values())}
177
+ __TS__ArraySort(setValues)
178
+ for ____, value in ipairs(setValues) do
172
179
  ____exports.log(" Value: " .. tostring(value))
173
180
  end
174
181
  ____exports.log("The size of the set was: " .. tostring(set.size))
@@ -171,6 +171,14 @@ export declare function inGenesisRoom(): boolean;
171
171
  * will only work for minibosses that have dedicated boss rooms in the "00.special rooms.stb" file.
172
172
  */
173
173
  export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
174
+ /**
175
+ * Helper function for checking if the room room is a secret shop from the Member Card collectible.
176
+ *
177
+ * Secret shops are simply copies of normal shops but with the backdrop of a secret room. In other
178
+ * words, they will have the same room type, room variant, and room sub-type of a normal shop. Thus,
179
+ * the only way to detect them is by using the grid index.
180
+ */
181
+ export declare function inSecretShop(): boolean;
174
182
  /**
175
183
  * Helper function to determine whether or not the current room is the starting room of a floor.
176
184
  * Only returns true for the starting room of the primary dimension (meaning that being in the
@@ -245,6 +245,9 @@ function ____exports.inMinibossRoomOf(self, minibossID)
245
245
  local roomSubType = ____exports.getRoomSubType(nil)
246
246
  return roomType == RoomType.ROOM_MINIBOSS and roomStageID == 0 and roomSubType == minibossID
247
247
  end
248
+ function ____exports.inSecretShop(self)
249
+ return ____exports.getRoomSafeGridIndex(nil) == GridRooms.ROOM_SECRET_SHOP_IDX
250
+ end
248
251
  function ____exports.inStartingRoom(self)
249
252
  local game = Game()
250
253
  local level = game:GetLevel()
@@ -302,12 +305,12 @@ function ____exports.setRoomCleared(self)
302
305
  for ____, door in ipairs(getDoors(nil)) do
303
306
  do
304
307
  if isHiddenSecretRoomDoor(nil, door) then
305
- goto __continue56
308
+ goto __continue57
306
309
  end
307
310
  openDoorFast(nil, door)
308
311
  door.ExtraVisible = false
309
312
  end
310
- ::__continue56::
313
+ ::__continue57::
311
314
  end
312
315
  sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
313
316
  game:ShakeScreen(0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "1.2.89",
3
+ "version": "1.2.92",
4
4
  "description": "Helper functions for IsaacScript mods",
5
5
  "keywords": [
6
6
  "isaac",
@@ -27,9 +27,9 @@
27
27
  "devDependencies": {
28
28
  "@zamiell/typescript-to-lua": "^1.4.0",
29
29
  "isaac-typescript-definitions": "^1.0.355",
30
- "isaacscript-lint": "^1.0.81",
30
+ "isaacscript-lint": "^1.0.83",
31
31
  "isaacscript-tsconfig": "^1.1.8",
32
32
  "typedoc": "^0.22.12",
33
- "typescript": "^4.5.5"
33
+ "typescript": "4.5.5"
34
34
  }
35
35
  }