isaacscript-common 87.6.2 → 87.8.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.
- package/dist/classes/ModUpgraded.lua +4 -4
- package/dist/classes/callbacks/InputActionFilter.lua +2 -2
- package/dist/classes/callbacks/InputActionPlayer.lua +2 -2
- package/dist/classes/callbacks/PostCollectibleEmpty.lua +2 -2
- package/dist/classes/callbacks/PostCursedTeleport.lua +2 -2
- package/dist/classes/callbacks/PostCustomRevive.lua +2 -2
- package/dist/classes/callbacks/PostDiceRoomActivated.lua +2 -2
- package/dist/classes/callbacks/PostGridEntityCollision.lua +2 -2
- package/dist/classes/callbacks/PostGridEntityCustomCollision.lua +2 -2
- package/dist/classes/callbacks/PostGridEntityCustomRemove.lua +2 -2
- package/dist/classes/callbacks/PostGridEntityRemove.lua +2 -2
- package/dist/classes/callbacks/PostItemDischarge.lua +2 -2
- package/dist/classes/callbacks/PostKeyboardChanged.lua +2 -2
- package/dist/classes/callbacks/PostPickupSelectionFilter.lua +2 -2
- package/dist/classes/callbacks/PostPurchase.lua +2 -2
- package/dist/classes/callbacks/PostRoomClearChanged.lua +2 -2
- package/dist/classes/callbacks/PostTransformation.lua +2 -2
- package/dist/classes/callbacks/PreEntitySpawnFilter.lua +2 -2
- package/dist/classes/callbacks/PreRoomEntitySpawnFilter.lua +2 -2
- package/dist/classes/features/callbackLogic/GridEntityUpdateDetection.lua +2 -2
- package/dist/classes/features/other/DeployJSONRoom.lua +1 -1
- package/dist/classes/features/other/ExtraConsoleCommands.lua +1 -1
- package/dist/classes/features/other/NoSirenSteal.lua +1 -1
- package/dist/classes/features/other/PersistentEntities.lua +1 -1
- package/dist/classes/features/other/extraConsoleCommands/commands.lua +5 -5
- package/dist/functions/array.d.ts +3 -17
- package/dist/functions/array.d.ts.map +1 -1
- package/dist/functions/array.js +13 -31
- package/dist/functions/array.lua +45 -61
- package/dist/functions/bitSet128.lua +10 -6
- package/dist/functions/color.lua +10 -6
- package/dist/functions/debugFunctions.d.ts.map +1 -1
- package/dist/functions/debugFunctions.js +0 -1
- package/dist/functions/doors.lua +1 -1
- package/dist/functions/entities.lua +8 -4
- package/dist/functions/globals.lua +1 -1
- package/dist/functions/gridEntities.lua +1 -1
- package/dist/functions/input.lua +1 -1
- package/dist/functions/kColor.lua +10 -6
- package/dist/functions/logMisc.lua +0 -1
- package/dist/functions/map.d.ts +1 -1
- package/dist/functions/map.d.ts.map +1 -1
- package/dist/functions/map.js +0 -1
- package/dist/functions/rng.lua +10 -6
- package/dist/functions/roomShapeWalls.lua +5 -5
- package/dist/functions/set.d.ts +1 -1
- package/dist/functions/set.d.ts.map +1 -1
- package/dist/functions/set.js +0 -4
- package/dist/functions/sort.d.ts.map +1 -1
- package/dist/functions/sort.js +0 -1
- package/dist/functions/utils.d.ts +11 -1
- package/dist/functions/utils.d.ts.map +1 -1
- package/dist/functions/utils.js +19 -1
- package/dist/functions/utils.lua +17 -1
- package/dist/functions/vector.lua +10 -6
- package/dist/functions/weighted.lua +1 -1
- package/dist/index.rollup.d.ts +17 -21
- package/dist/isaacscript-common.lua +8184 -8126
- package/dist/maps/entityTypeVariantToBossIDMap.lua +1 -1
- package/dist/shouldFire.lua +56 -56
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +7 -10
- package/src/functions/array.ts +9 -33
- package/src/functions/debugFunctions.ts +0 -1
- package/src/functions/map.ts +1 -2
- package/src/functions/set.ts +6 -5
- package/src/functions/sort.ts +1 -1
- package/src/functions/utils.ts +19 -1
|
@@ -34,7 +34,7 @@ function ____exports.getRandomIndexFromWeightedArray(self, weightedArray, seedOr
|
|
|
34
34
|
for ____, ____value in __TS__Iterator(__TS__ArrayEntries(weightedArray)) do
|
|
35
35
|
local i = ____value[1]
|
|
36
36
|
local tuple = ____value[2]
|
|
37
|
-
local _element, weight = table.unpack(tuple)
|
|
37
|
+
local _element, weight = table.unpack(tuple, 1, 2)
|
|
38
38
|
weightAccumulator = weightAccumulator + weight
|
|
39
39
|
if weightAccumulator >= randomWeight then
|
|
40
40
|
return i
|
package/dist/index.rollup.d.ts
CHANGED
|
@@ -1085,26 +1085,11 @@ export declare function arrayEquals<T>(array1: readonly T[], array2: readonly T[
|
|
|
1085
1085
|
* array. If the specified element(s) are not found in the array, it will simply return a shallow
|
|
1086
1086
|
* copy of the array.
|
|
1087
1087
|
*
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
* If there is more than one matching element in the array, this function will only remove the first
|
|
1091
|
-
* matching element. If you want to remove all of the elements, use the `arrayRemoveAll` function
|
|
1092
|
-
* instead.
|
|
1093
|
-
*/
|
|
1094
|
-
export declare function arrayRemove<T>(originalArray: readonly T[], ...elementsToRemove: readonly T[]): T[];
|
|
1095
|
-
|
|
1096
|
-
/**
|
|
1097
|
-
* Shallow copies and removes the specified element(s) from the array. Returns the copied array. If
|
|
1098
|
-
* the specified element(s) are not found in the array, it will simply return a shallow copy of the
|
|
1099
|
-
* array.
|
|
1088
|
+
* If there is more than one matching element in the array, this function will remove all of them.
|
|
1100
1089
|
*
|
|
1101
1090
|
* This function is variadic, meaning that you can specify N arguments to remove N elements.
|
|
1102
|
-
*
|
|
1103
|
-
* If there is more than one matching element in the array, this function will remove every matching
|
|
1104
|
-
* element. If you want to only remove the first matching element, use the `arrayRemove` function
|
|
1105
|
-
* instead.
|
|
1106
1091
|
*/
|
|
1107
|
-
export declare function
|
|
1092
|
+
export declare function arrayRemove<T>(originalArray: readonly T[], ...elementsToRemove: readonly T[]): T[];
|
|
1108
1093
|
|
|
1109
1094
|
/**
|
|
1110
1095
|
* Removes all of the specified element(s) from the array. If the specified element(s) are not found
|
|
@@ -1705,7 +1690,7 @@ export declare function combineArrays<T>(...arrays: ReadonlyArray<readonly T[]>)
|
|
|
1705
1690
|
*
|
|
1706
1691
|
* This function is variadic, meaning that you can specify N sets.
|
|
1707
1692
|
*/
|
|
1708
|
-
export declare function combineSets<T>(...sets: ReadonlyArray<ReadonlySet<T>>):
|
|
1693
|
+
export declare function combineSets<T>(...sets: ReadonlyArray<ReadonlySet<T>>): ReadonlySet<T>;
|
|
1709
1694
|
|
|
1710
1695
|
/**
|
|
1711
1696
|
* Helper type to validate that a union of interfaces with a field of `type` that is based on an
|
|
@@ -4625,7 +4610,7 @@ export declare function filter<T>(array: readonly T[], func: (value: T, index: n
|
|
|
4625
4610
|
* This is named `filterMap` after the Rust function:
|
|
4626
4611
|
* https://doc.rust-lang.org/std/iter/struct.FilterMap.html
|
|
4627
4612
|
*/
|
|
4628
|
-
export declare function filterMap<OldT, NewT>(array: readonly OldT[], func: (element: OldT) => NewT | undefined): NewT[];
|
|
4613
|
+
export declare function filterMap<OldT, NewT>(array: readonly OldT[], func: (element: OldT) => NewT | undefined): readonly NewT[];
|
|
4629
4614
|
|
|
4630
4615
|
/**
|
|
4631
4616
|
* Helper function for non-TypeScript users to find an element in an array.
|
|
@@ -10051,7 +10036,7 @@ export declare function isRedKeyRoom(roomGridIndex: int): boolean;
|
|
|
10051
10036
|
export declare function isReflectionRender(): boolean;
|
|
10052
10037
|
|
|
10053
10038
|
/**
|
|
10054
|
-
* Helper function to check if the player
|
|
10039
|
+
* Helper function to check if the player has the Repentance DLC installed.
|
|
10055
10040
|
*
|
|
10056
10041
|
* This function should always be used over the `REPENTANCE` constant, since the latter is not safe.
|
|
10057
10042
|
*
|
|
@@ -10075,6 +10060,17 @@ export declare function isRepentanceBoss(bossID: BossID): boolean;
|
|
|
10075
10060
|
*/
|
|
10076
10061
|
export declare function isRepentanceDoor(door: GridEntityDoor): boolean;
|
|
10077
10062
|
|
|
10063
|
+
/**
|
|
10064
|
+
* Helper function to check if the player has the Repentance+ DLC installed.
|
|
10065
|
+
*
|
|
10066
|
+
* This function should always be used over the `REPENTANCE_PLUS` constant, since the latter is not
|
|
10067
|
+
* safe.
|
|
10068
|
+
*
|
|
10069
|
+
* Specifically, this function checks for `Room:DamageGridWithSource` method:
|
|
10070
|
+
* https://bindingofisaacrebirth.wiki.gg/wiki/The_Binding_of_Isaac:_Repentance%2B#Modding_Changes
|
|
10071
|
+
*/
|
|
10072
|
+
export declare function isRepentancePlus(): boolean;
|
|
10073
|
+
|
|
10078
10074
|
/**
|
|
10079
10075
|
* Helper function to check if the provided stage type is equal to `StageType.REPENTANCE` or
|
|
10080
10076
|
* `StageType.REPENTANCE_B`.
|
|
@@ -15127,7 +15123,7 @@ export declare function objectKeysToSet<K extends string | number | symbol, V>(o
|
|
|
15127
15123
|
*
|
|
15128
15124
|
* Also see the `objectToReadonlyMap` function.
|
|
15129
15125
|
*/
|
|
15130
|
-
export declare function objectToMap<K extends string | number | symbol, V>(object: Record<K, V>):
|
|
15126
|
+
export declare function objectToMap<K extends string | number | symbol, V>(object: Record<K, V>): ReadonlyMap<K, V>;
|
|
15131
15127
|
|
|
15132
15128
|
/**
|
|
15133
15129
|
* Helper function to convert an object to a read-only map.
|