isaacscript-common 16.0.0 → 16.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.
package/dist/index.d.ts CHANGED
@@ -1422,7 +1422,7 @@ export declare function copyIsaacAPIClass<T extends CopyableIsaacAPIClass>(isaac
1422
1422
  export declare function copyKColor(kColor: KColor): KColor;
1423
1423
 
1424
1424
  /** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
1425
- export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
1425
+ export declare function copyMap<K, V>(oldMap: Map<K, V> | ReadonlyMap<K, V>): Map<K, V>;
1426
1426
 
1427
1427
  /** Helper function to copy an `RNG` Isaac API class. */
1428
1428
  export declare function copyRNG(rng: RNG): RNG;
@@ -5843,7 +5843,7 @@ export declare function getRocks(variant?: number): GridEntityRock[];
5843
5843
  * @param roomGridIndex Optional. Default is the current room index.
5844
5844
  * @returns A map of `DoorSlot` to the corresponding room grid index.
5845
5845
  */
5846
- export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): Map<DoorSlot, int>;
5846
+ export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): ReadonlyMap<DoorSlot, int>;
5847
5847
 
5848
5848
  /**
5849
5849
  * Helper function to get the set of allowed door slots for the room at the supplied grid index.
@@ -5987,7 +5987,7 @@ export declare function getRoomShape(roomGridIndex?: int): RoomShape | undefined
5987
5987
  * This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
5988
5988
  * that function for more information.
5989
5989
  */
5990
- export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
5990
+ export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
5991
5991
 
5992
5992
  /**
5993
5993
  * Helper function to get the room grid index delta that each hypothetical door in a given room
@@ -5997,7 +5997,7 @@ export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridInde
5997
5997
  *
5998
5998
  * @returns A map of `DoorSlot` to the corresponding room grid index delta.
5999
5999
  */
6000
- export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): Map<DoorSlot, int>;
6000
+ export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
6001
6001
 
6002
6002
  /**
6003
6003
  * Helper function to get the room grid index that each hypothetical door in a given room shape
@@ -6008,7 +6008,7 @@ export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape
6008
6008
  * @param roomShape The shape of the room.
6009
6009
  * @returns A map of `DoorSlot` to the corresponding room grid index.
6010
6010
  */
6011
- export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
6011
+ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
6012
6012
 
6013
6013
  /**
6014
6014
  * Helper function to get only the adjacent room grid indexes for a room shape that do not exist
@@ -6017,7 +6017,7 @@ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int,
6017
6017
  * This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
6018
6018
  * that function for more information.
6019
6019
  */
6020
- export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
6020
+ export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
6021
6021
 
6022
6022
  /**
6023
6023
  * Helper function to see if a given room shape will grant a single charge or a double charge to the
@@ -12271,6 +12271,15 @@ export declare function removeCharactersBefore(string: string, substring: string
12271
12271
  */
12272
12272
  export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
12273
12273
 
12274
+ /**
12275
+ * Helper function to remove one or more collectibles from all players. If any player has more than
12276
+ * one copy of the item, then all copies of it will be removed.
12277
+ *
12278
+ * This function is variadic, meaning that you can specify as many collectibles as you want to
12279
+ * remove.
12280
+ */
12281
+ export declare function removeCollectibleFromAllPlayers(...collectibleTypes: CollectibleType[]): void;
12282
+
12274
12283
  /**
12275
12284
  * Helper function to put a message in the log.txt file to let the Rebirth Item Tracker know that it
12276
12285
  * should remove an item.
@@ -1,6 +1,6 @@
1
1
  --[[
2
2
 
3
- isaacscript-common 16.0.0
3
+ isaacscript-common 16.1.1
4
4
 
5
5
  This is the "isaacscript-common" library, which was created with the IsaacScript tool.
6
6
 
@@ -21767,6 +21767,16 @@ function ____exports.removeCollectibleCostume(self, player, collectibleType)
21767
21767
  end
21768
21768
  player:RemoveCostume(itemConfigItem)
21769
21769
  end
21770
+ function ____exports.removeCollectibleFromAllPlayers(self, ...)
21771
+ local collectibleTypes = {...}
21772
+ for ____, player in ipairs(getAllPlayers(nil)) do
21773
+ for ____, collectibleType in ipairs(collectibleTypes) do
21774
+ while player:HasCollectible(collectibleType, true) do
21775
+ player:RemoveCollectible(collectibleType)
21776
+ end
21777
+ end
21778
+ end
21779
+ end
21770
21780
  function ____exports.removeDeadEyeMultiplier(self, player)
21771
21781
  ____repeat(
21772
21782
  nil,
@@ -21801,9 +21811,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
21801
21811
  itemPool:RemoveCollectible(collectibleType)
21802
21812
  end
21803
21813
  repeat
21804
- local ____switch107 = activeSlot
21805
- local ____cond107 = ____switch107 == ActiveSlot.PRIMARY
21806
- if ____cond107 then
21814
+ local ____switch113 = activeSlot
21815
+ local ____cond113 = ____switch113 == ActiveSlot.PRIMARY
21816
+ if ____cond113 then
21807
21817
  do
21808
21818
  if primaryCollectibleType ~= CollectibleType.NULL then
21809
21819
  player:RemoveCollectible(primaryCollectibleType)
@@ -21812,8 +21822,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
21812
21822
  break
21813
21823
  end
21814
21824
  end
21815
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.SECONDARY
21816
- if ____cond107 then
21825
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.SECONDARY
21826
+ if ____cond113 then
21817
21827
  do
21818
21828
  if primaryCollectibleType ~= CollectibleType.NULL then
21819
21829
  player:RemoveCollectible(primaryCollectibleType)
@@ -21828,16 +21838,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
21828
21838
  break
21829
21839
  end
21830
21840
  end
21831
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET
21832
- if ____cond107 then
21841
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET
21842
+ if ____cond113 then
21833
21843
  do
21834
21844
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
21835
21845
  player:SetActiveCharge(charge, activeSlot)
21836
21846
  break
21837
21847
  end
21838
21848
  end
21839
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET_SINGLE_USE
21840
- if ____cond107 then
21849
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET_SINGLE_USE
21850
+ if ____cond113 then
21841
21851
  do
21842
21852
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
21843
21853
  break
@@ -42875,8 +42885,8 @@ return ____exports
42875
42885
  local ____lualib = require("lualib_bundle")
42876
42886
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
42877
42887
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
42878
- local Map = ____lualib.Map
42879
42888
  local __TS__Iterator = ____lualib.__TS__Iterator
42889
+ local Map = ____lualib.Map
42880
42890
  local __TS__New = ____lualib.__TS__New
42881
42891
  local Set = ____lualib.Set
42882
42892
  local ____exports = {}
@@ -42904,6 +42914,8 @@ local ____flag = require("src.functions.flag")
42904
42914
  local addFlag = ____flag.addFlag
42905
42915
  local hasFlag = ____flag.hasFlag
42906
42916
  local removeFlag = ____flag.removeFlag
42917
+ local ____map = require("src.functions.map")
42918
+ local copyMap = ____map.copyMap
42907
42919
  local ____rng = require("src.functions.rng")
42908
42920
  local getRandomSeed = ____rng.getRandomSeed
42909
42921
  local isRNG = ____rng.isRNG
@@ -42988,7 +43000,10 @@ function ____exports.getNewRoomCandidatesForLevel(self)
42988
43000
  return newRoomCandidates
42989
43001
  end
42990
43002
  function ____exports.getRoomShapeAdjacentExistingGridIndexes(self, safeRoomGridIndex, roomShape)
42991
- local roomShapeAdjacentGridIndexes = ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
43003
+ local roomShapeAdjacentGridIndexes = copyMap(
43004
+ nil,
43005
+ ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
43006
+ )
42992
43007
  for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
42993
43008
  local doorSlot = ____value[1]
42994
43009
  local roomGridIndex = ____value[2]
@@ -43016,7 +43031,10 @@ function ____exports.getRoomShapeAdjacentGridIndexes(self, safeRoomGridIndex, ro
43016
43031
  return adjacentGridIndexes
43017
43032
  end
43018
43033
  function ____exports.getRoomShapeAdjacentNonExistingGridIndexes(self, safeRoomGridIndex, roomShape)
43019
- local roomShapeAdjacentGridIndexes = ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
43034
+ local roomShapeAdjacentGridIndexes = copyMap(
43035
+ nil,
43036
+ ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
43037
+ )
43020
43038
  for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
43021
43039
  local doorSlot = ____value[1]
43022
43040
  local roomGridIndex = ____value[2]
@@ -44679,7 +44697,6 @@ return ____exports
44679
44697
  end,
44680
44698
  ["src.classes.features.other.extraConsoleCommands.subroutines"] = function(...)
44681
44699
  local ____lualib = require("lualib_bundle")
44682
- local Map = ____lualib.Map
44683
44700
  local __TS__Iterator = ____lualib.__TS__Iterator
44684
44701
  local ____exports = {}
44685
44702
  local ____isaac_2Dtypescript_2Ddefinitions = require("lua_modules.isaac-typescript-definitions.dist.src.index")
@@ -1,5 +1,4 @@
1
1
  local ____lualib = require("lualib_bundle")
2
- local Map = ____lualib.Map
3
2
  local __TS__Iterator = ____lualib.__TS__Iterator
4
3
  local ____exports = {}
5
4
  local ____isaac_2Dtypescript_2Ddefinitions = require("isaac-typescript-definitions")
@@ -82,7 +82,7 @@ export declare function getNewRoomCandidatesForLevel(): Array<[
82
82
  * @param roomGridIndex Optional. Default is the current room index.
83
83
  * @returns A map of `DoorSlot` to the corresponding room grid index.
84
84
  */
85
- export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): Map<DoorSlot, int>;
85
+ export declare function getRoomAdjacentGridIndexes(roomGridIndex?: int): ReadonlyMap<DoorSlot, int>;
86
86
  /**
87
87
  * Helper function to get an array of all of the safe grid indexes for rooms that match the
88
88
  * specified room type.
@@ -100,7 +100,7 @@ export declare function getRoomGridIndexesForType(...roomTypes: RoomType[]): int
100
100
  * This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
101
101
  * that function for more information.
102
102
  */
103
- export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
103
+ export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
104
104
  /**
105
105
  * Helper function to get the room grid index delta that each hypothetical door in a given room
106
106
  * shape would go to.
@@ -109,7 +109,7 @@ export declare function getRoomShapeAdjacentExistingGridIndexes(safeRoomGridInde
109
109
  *
110
110
  * @returns A map of `DoorSlot` to the corresponding room grid index delta.
111
111
  */
112
- export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): Map<DoorSlot, int>;
112
+ export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
113
113
  /**
114
114
  * Helper function to get the room grid index that each hypothetical door in a given room shape
115
115
  * would go to. (This will not include room grid indexes that are outside of the grid.)
@@ -119,7 +119,7 @@ export declare function getRoomShapeAdjacentGridIndexDeltas(roomShape: RoomShape
119
119
  * @param roomShape The shape of the room.
120
120
  * @returns A map of `DoorSlot` to the corresponding room grid index.
121
121
  */
122
- export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
122
+ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
123
123
  /**
124
124
  * Helper function to get only the adjacent room grid indexes for a room shape that do not exist
125
125
  * (i.e. do not have room data).
@@ -127,7 +127,7 @@ export declare function getRoomShapeAdjacentGridIndexes(safeRoomGridIndex: int,
127
127
  * This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
128
128
  * that function for more information.
129
129
  */
130
- export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): Map<DoorSlot, int>;
130
+ export declare function getRoomShapeAdjacentNonExistingGridIndexes(safeRoomGridIndex: int, roomShape: RoomShape): ReadonlyMap<DoorSlot, int>;
131
131
  /**
132
132
  * Helper function to check if the given room grid index is a dead end. Specifically, this is
133
133
  * defined as having only one adjacent room that exists.
@@ -1 +1 @@
1
- {"version":3,"file":"levelGrid.d.ts","sourceRoot":"","sources":["../../../src/functions/levelGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,QAAQ,EAKR,SAAS,EACT,QAAQ,EACT,MAAM,8BAA8B,CAAC;AA8BtC;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,CAK7E;AAED;;;;;;GAMG;AACH,wBAAgB,qCAAqC,CACnD,aAAa,CAAC,EAAE,GAAG,GAClB,GAAG,EAAE,CAKP;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CAA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wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAa5B;AAED;;;;;;GAMG;AACH,wBAAgB,0CAA0C,CACxD,iBAAiB,EAAE,GAAG,EACtB,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAgB5B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAKtD;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAGT;AAED,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,GAAG,GACjB,OAAO,CAqBT;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAGzD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,CAAC,EAAE,GAAG,GAAG,OAAO,CAM7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,OAAO,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAmD/D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,aAAa,EAAE,GAAG,GAAG,OAAO,CAGtD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,GAAG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAKtE"}
@@ -1,8 +1,8 @@
1
1
  local ____lualib = require("lualib_bundle")
2
2
  local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
3
3
  local __TS__ArrayMap = ____lualib.__TS__ArrayMap
4
- local Map = ____lualib.Map
5
4
  local __TS__Iterator = ____lualib.__TS__Iterator
5
+ local Map = ____lualib.Map
6
6
  local __TS__New = ____lualib.__TS__New
7
7
  local Set = ____lualib.Set
8
8
  local ____exports = {}
@@ -30,6 +30,8 @@ local ____flag = require("src.functions.flag")
30
30
  local addFlag = ____flag.addFlag
31
31
  local hasFlag = ____flag.hasFlag
32
32
  local removeFlag = ____flag.removeFlag
33
+ local ____map = require("src.functions.map")
34
+ local copyMap = ____map.copyMap
33
35
  local ____rng = require("src.functions.rng")
34
36
  local getRandomSeed = ____rng.getRandomSeed
35
37
  local isRNG = ____rng.isRNG
@@ -147,7 +149,10 @@ end
147
149
  -- This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
148
150
  -- that function for more information.
149
151
  function ____exports.getRoomShapeAdjacentExistingGridIndexes(self, safeRoomGridIndex, roomShape)
150
- local roomShapeAdjacentGridIndexes = ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
152
+ local roomShapeAdjacentGridIndexes = copyMap(
153
+ nil,
154
+ ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
155
+ )
151
156
  for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
152
157
  local doorSlot = ____value[1]
153
158
  local roomGridIndex = ____value[2]
@@ -193,7 +198,10 @@ end
193
198
  -- This is just a filtering of the results of the `getRoomShapeAdjacentGridIndexes` function. See
194
199
  -- that function for more information.
195
200
  function ____exports.getRoomShapeAdjacentNonExistingGridIndexes(self, safeRoomGridIndex, roomShape)
196
- local roomShapeAdjacentGridIndexes = ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
201
+ local roomShapeAdjacentGridIndexes = copyMap(
202
+ nil,
203
+ ____exports.getRoomShapeAdjacentGridIndexes(nil, safeRoomGridIndex, roomShape)
204
+ )
197
205
  for ____, ____value in __TS__Iterator(roomShapeAdjacentGridIndexes:entries()) do
198
206
  local doorSlot = ____value[1]
199
207
  local roomGridIndex = ____value[2]
@@ -2,7 +2,7 @@
2
2
  /// <reference types="isaac-typescript-definitions" />
3
3
  import { DefaultMap } from "../classes/DefaultMap";
4
4
  /** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
5
- export declare function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V>;
5
+ export declare function copyMap<K, V>(oldMap: Map<K, V> | ReadonlyMap<K, V>): Map<K, V>;
6
6
  /**
7
7
  * Helper function to get the value from a `DefaultMap` that corresponds to an entity, assuming that
8
8
  * the map uses `PtrHash` as an index.
@@ -1 +1 @@
1
- {"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../../src/functions/map.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAInD,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAO1D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,EACtD,GAAG,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,EAC9B,MAAM,EAAE,MAAM,EACd,GAAG,SAAS,EAAE,CAAC,GACd,CAAC,CAGH;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GACP,IAAI,CAEN;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAClC,UAAU,EAAE,MAAM,EAClB,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,GAC1B,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,CAgBzB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,C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EAC1B,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,EACpB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,CAAC,GACP,IAAI,CAGN;AAED,4DAA4D;AAC5D,wBAAgB,MAAM,CACpB,GAAG,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,GACvD,MAAM,CAGR"}
@@ -238,6 +238,14 @@ export declare function removeAllPlayerTrinkets(player: EntityPlayer): void;
238
238
  * having to request the collectible from the item config.
239
239
  */
240
240
  export declare function removeCollectibleCostume(player: EntityPlayer, collectibleType: CollectibleType): void;
241
+ /**
242
+ * Helper function to remove one or more collectibles from all players. If any player has more than
243
+ * one copy of the item, then all copies of it will be removed.
244
+ *
245
+ * This function is variadic, meaning that you can specify as many collectibles as you want to
246
+ * remove.
247
+ */
248
+ export declare function removeCollectibleFromAllPlayers(...collectibleTypes: CollectibleType[]): void;
241
249
  /**
242
250
  * Helper function to remove the Dead Eye multiplier from a player.
243
251
  *
@@ -1 +1 @@
1
- {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAGf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AActC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAI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G;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
1
+ {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAGf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AActC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,GAAG,SAAS,CAMxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,YAAY,GAAG,KAAK,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,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
@@ -540,6 +540,21 @@ function ____exports.removeCollectibleCostume(self, player, collectibleType)
540
540
  end
541
541
  player:RemoveCostume(itemConfigItem)
542
542
  end
543
+ --- Helper function to remove one or more collectibles from all players. If any player has more than
544
+ -- one copy of the item, then all copies of it will be removed.
545
+ --
546
+ -- This function is variadic, meaning that you can specify as many collectibles as you want to
547
+ -- remove.
548
+ function ____exports.removeCollectibleFromAllPlayers(self, ...)
549
+ local collectibleTypes = {...}
550
+ for ____, player in ipairs(getAllPlayers(nil)) do
551
+ for ____, collectibleType in ipairs(collectibleTypes) do
552
+ while player:HasCollectible(collectibleType, true) do
553
+ player:RemoveCollectible(collectibleType)
554
+ end
555
+ end
556
+ end
557
+ end
543
558
  --- Helper function to remove the Dead Eye multiplier from a player.
544
559
  --
545
560
  -- Note that each time the `EntityPlayer.ClearDeadEyeCharge` method is called, it only has a chance
@@ -594,9 +609,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
594
609
  itemPool:RemoveCollectible(collectibleType)
595
610
  end
596
611
  repeat
597
- local ____switch107 = activeSlot
598
- local ____cond107 = ____switch107 == ActiveSlot.PRIMARY
599
- if ____cond107 then
612
+ local ____switch113 = activeSlot
613
+ local ____cond113 = ____switch113 == ActiveSlot.PRIMARY
614
+ if ____cond113 then
600
615
  do
601
616
  if primaryCollectibleType ~= CollectibleType.NULL then
602
617
  player:RemoveCollectible(primaryCollectibleType)
@@ -605,8 +620,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
605
620
  break
606
621
  end
607
622
  end
608
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.SECONDARY
609
- if ____cond107 then
623
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.SECONDARY
624
+ if ____cond113 then
610
625
  do
611
626
  if primaryCollectibleType ~= CollectibleType.NULL then
612
627
  player:RemoveCollectible(primaryCollectibleType)
@@ -621,16 +636,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
621
636
  break
622
637
  end
623
638
  end
624
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET
625
- if ____cond107 then
639
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET
640
+ if ____cond113 then
626
641
  do
627
642
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
628
643
  player:SetActiveCharge(charge, activeSlot)
629
644
  break
630
645
  end
631
646
  end
632
- ____cond107 = ____cond107 or ____switch107 == ActiveSlot.POCKET_SINGLE_USE
633
- if ____cond107 then
647
+ ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET_SINGLE_USE
648
+ if ____cond113 then
634
649
  do
635
650
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
636
651
  break
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "16.0.0",
3
+ "version": "16.1.1",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -27,6 +27,7 @@ import { ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA } from "../objects/roomSha
27
27
  import { getRandomArrayElement } from "./array";
28
28
  import { doorSlotToDoorSlotFlag } from "./doors";
29
29
  import { addFlag, hasFlag, removeFlag } from "./flag";
30
+ import { copyMap } from "./map";
30
31
  import { getRandomSeed, isRNG, newRNG } from "./rng";
31
32
  import {
32
33
  getRoomAllowedDoors,
@@ -244,7 +245,7 @@ export function getNewRoomCandidatesForLevel(): Array<
244
245
  */
245
246
  export function getRoomAdjacentGridIndexes(
246
247
  roomGridIndex?: int,
247
- ): Map<DoorSlot, int> {
248
+ ): ReadonlyMap<DoorSlot, int> {
248
249
  const roomDescriptor = getRoomDescriptor(roomGridIndex);
249
250
 
250
251
  if (!isRoomInsideGrid(roomDescriptor.SafeGridIndex)) {
@@ -294,10 +295,9 @@ export function getRoomGridIndexesForType(...roomTypes: RoomType[]): int[] {
294
295
  export function getRoomShapeAdjacentExistingGridIndexes(
295
296
  safeRoomGridIndex: int,
296
297
  roomShape: RoomShape,
297
- ): Map<DoorSlot, int> {
298
- const roomShapeAdjacentGridIndexes = getRoomShapeAdjacentGridIndexes(
299
- safeRoomGridIndex,
300
- roomShape,
298
+ ): ReadonlyMap<DoorSlot, int> {
299
+ const roomShapeAdjacentGridIndexes = copyMap(
300
+ getRoomShapeAdjacentGridIndexes(safeRoomGridIndex, roomShape),
301
301
  );
302
302
 
303
303
  for (const [
@@ -323,7 +323,7 @@ export function getRoomShapeAdjacentExistingGridIndexes(
323
323
  */
324
324
  export function getRoomShapeAdjacentGridIndexDeltas(
325
325
  roomShape: RoomShape,
326
- ): Map<DoorSlot, int> {
326
+ ): ReadonlyMap<DoorSlot, int> {
327
327
  return ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape];
328
328
  }
329
329
 
@@ -339,7 +339,7 @@ export function getRoomShapeAdjacentGridIndexDeltas(
339
339
  export function getRoomShapeAdjacentGridIndexes(
340
340
  safeRoomGridIndex: int,
341
341
  roomShape: RoomShape,
342
- ): Map<DoorSlot, int> {
342
+ ): ReadonlyMap<DoorSlot, int> {
343
343
  const roomShapeAdjacentGridIndexDeltas =
344
344
  getRoomShapeAdjacentGridIndexDeltas(roomShape);
345
345
 
@@ -364,10 +364,9 @@ export function getRoomShapeAdjacentGridIndexes(
364
364
  export function getRoomShapeAdjacentNonExistingGridIndexes(
365
365
  safeRoomGridIndex: int,
366
366
  roomShape: RoomShape,
367
- ): Map<DoorSlot, int> {
368
- const roomShapeAdjacentGridIndexes = getRoomShapeAdjacentGridIndexes(
369
- safeRoomGridIndex,
370
- roomShape,
367
+ ): ReadonlyMap<DoorSlot, int> {
368
+ const roomShapeAdjacentGridIndexes = copyMap(
369
+ getRoomShapeAdjacentGridIndexes(safeRoomGridIndex, roomShape),
371
370
  );
372
371
 
373
372
  for (const [
@@ -3,7 +3,9 @@ import { sumArray } from "./array";
3
3
  import { getPartialMatch } from "./string";
4
4
 
5
5
  /** Helper function to copy a map. (You can also use a Map constructor to accomplish this task.) */
6
- export function copyMap<K, V>(oldMap: Map<K, V>): Map<K, V> {
6
+ export function copyMap<K, V>(
7
+ oldMap: Map<K, V> | ReadonlyMap<K, V>,
8
+ ): Map<K, V> {
7
9
  const newMap = new Map<K, V>();
8
10
  for (const [key, value] of oldMap.entries()) {
9
11
  newMap.set(key, value);
@@ -677,6 +677,25 @@ export function removeCollectibleCostume(
677
677
  player.RemoveCostume(itemConfigItem);
678
678
  }
679
679
 
680
+ /**
681
+ * Helper function to remove one or more collectibles from all players. If any player has more than
682
+ * one copy of the item, then all copies of it will be removed.
683
+ *
684
+ * This function is variadic, meaning that you can specify as many collectibles as you want to
685
+ * remove.
686
+ */
687
+ export function removeCollectibleFromAllPlayers(
688
+ ...collectibleTypes: CollectibleType[]
689
+ ): void {
690
+ for (const player of getAllPlayers()) {
691
+ for (const collectibleType of collectibleTypes) {
692
+ while (player.HasCollectible(collectibleType, true)) {
693
+ player.RemoveCollectible(collectibleType);
694
+ }
695
+ }
696
+ }
697
+ }
698
+
680
699
  /**
681
700
  * Helper function to remove the Dead Eye multiplier from a player.
682
701
  *