isaacscript-common 9.19.3 → 10.0.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 +8 -6
- package/dist/isaacscript-common.lua +83 -55
- package/dist/lualib_bundle.lua +53 -37
- package/dist/package.lua +2 -2
- package/dist/src/features/saveDataManager/load.d.ts +1 -1
- package/dist/src/features/saveDataManager/maps.d.ts +1 -1
- package/dist/src/features/saveDataManager/merge.d.ts +1 -1
- package/dist/src/features/saveDataManager/save.d.ts +1 -1
- package/dist/src/functions/bitSet128.d.ts +1 -1
- package/dist/src/functions/bitSet128.d.ts.map +1 -1
- package/dist/src/functions/bitSet128.lua +2 -2
- package/dist/src/functions/color.d.ts +1 -1
- package/dist/src/functions/color.d.ts.map +1 -1
- package/dist/src/functions/color.lua +2 -2
- package/dist/src/functions/entities.d.ts +1 -1
- package/dist/src/functions/globals.d.ts +1 -1
- package/dist/src/functions/jsonHelpers.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts +1 -1
- package/dist/src/functions/kColor.d.ts.map +1 -1
- package/dist/src/functions/kColor.lua +2 -2
- package/dist/src/functions/log.d.ts +2 -2
- package/dist/src/functions/log.d.ts.map +1 -1
- package/dist/src/functions/positionVelocity.d.ts +3 -1
- package/dist/src/functions/positionVelocity.d.ts.map +1 -1
- package/dist/src/functions/positionVelocity.lua +9 -1
- package/dist/src/functions/rng.d.ts +1 -1
- package/dist/src/functions/table.d.ts +4 -4
- package/dist/src/functions/table.d.ts.map +1 -1
- package/dist/src/functions/table.lua +8 -4
- package/dist/src/functions/tstlClass.d.ts +1 -1
- package/dist/src/functions/types.d.ts +1 -1
- package/dist/src/functions/vector.d.ts +1 -1
- package/dist/src/functions/vector.d.ts.map +1 -1
- package/dist/src/functions/vector.lua +2 -2
- package/dist/src/interfaces/private/TSTLClassMetatable.d.ts +1 -1
- package/dist/src/types/SerializedIsaacAPIClass.d.ts +1 -1
- package/dist/src/types/TSTLClass.d.ts +1 -1
- package/package.json +2 -2
- package/src/functions/bitSet128.ts +6 -2
- package/src/functions/color.ts +6 -2
- package/src/functions/kColor.ts +6 -2
- package/src/functions/log.ts +8 -6
- package/src/functions/positionVelocity.ts +10 -0
- package/src/functions/table.ts +15 -6
- package/src/functions/vector.ts +6 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
/// <reference types="@typescript-to-lua/language-extensions" />
|
|
1
2
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
3
|
/// <reference types="lua-types/5.3" />
|
|
3
|
-
/// <reference types="typescript-to-lua/language-extensions" />
|
|
4
4
|
|
|
5
5
|
import { ActiveSlot } from 'isaac-typescript-definitions';
|
|
6
6
|
import { BackdropType } from 'isaac-typescript-definitions';
|
|
@@ -950,8 +950,8 @@ export declare function copyRNG(rng: RNG): RNG;
|
|
|
950
950
|
/** Helper function to copy a set. (You can also use a Set constructor to accomplish this task.) */
|
|
951
951
|
export declare function copySet<T>(oldSet: Set<T> | ReadonlySet<T>): Set<T>;
|
|
952
952
|
|
|
953
|
-
/** Helper function to copy specific values from a object to a table. */
|
|
954
|
-
export declare function
|
|
953
|
+
/** Helper function to copy specific values from a userdata object (e.g. `Vector`) to a table. */
|
|
954
|
+
export declare function copyUserdataValuesToTable(object: unknown, keys: string[], luaMap: LuaMap<string, unknown>): void;
|
|
955
955
|
|
|
956
956
|
/** Helper function to copy a `Vector` Isaac API class. */
|
|
957
957
|
export declare function copyVector(vector: Vector): Vector;
|
|
@@ -2157,8 +2157,10 @@ export declare function find<T>(array: T[], func: (value: T, index: number, arra
|
|
|
2157
2157
|
* @param startingPosition The position to start searching from. If this position is not overlapping
|
|
2158
2158
|
* with anything, then it will be returned.
|
|
2159
2159
|
* @param avoidActiveEntities Optional. Default is false.
|
|
2160
|
+
* @param minimumDistance Optional. If specified, will ensure that the randomly generated position
|
|
2161
|
+
* is equal to or greater than the distance provided.
|
|
2160
2162
|
*/
|
|
2161
|
-
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean): Vector;
|
|
2163
|
+
export declare function findFreePosition(startingPosition: Vector, avoidActiveEntities?: boolean, minimumDistance?: float): Vector;
|
|
2162
2164
|
|
|
2163
2165
|
/**
|
|
2164
2166
|
* Helper function to make an NPC fire one or more projectiles. Returns the fired projectile(s).
|
|
@@ -6475,7 +6477,7 @@ export declare const itemConfig: ItemConfig;
|
|
|
6475
6477
|
* false in situations where iterating randomly would not matter and you need the
|
|
6476
6478
|
* extra performance.
|
|
6477
6479
|
*/
|
|
6478
|
-
export declare function iterateTableInOrder<K, V>(luaMap: LuaMap<K, V>, func: (key: K, value: V) => void, inOrder?: boolean): void;
|
|
6480
|
+
export declare function iterateTableInOrder<K extends AnyNotNil, V>(luaMap: LuaMap<K, V>, func: (key: K, value: V) => void, inOrder?: boolean): void;
|
|
6479
6481
|
|
|
6480
6482
|
/**
|
|
6481
6483
|
* Helper function for non-TypeScript users to convert an array to a string with the specified
|
|
@@ -6824,7 +6826,7 @@ export declare function logTable(luaTable: unknown, parentTables?: number): void
|
|
|
6824
6826
|
* Helper function to print out the differences between the entries of two tables. Note that this
|
|
6825
6827
|
* will only do a shallow comparison.
|
|
6826
6828
|
*/
|
|
6827
|
-
export declare function logTableDifferences<K, V>(table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
|
|
6829
|
+
export declare function logTableDifferences<K extends AnyNotNil, V>(table1: LuaMap<K, V>, table2: LuaMap<K, V>): void;
|
|
6828
6830
|
|
|
6829
6831
|
/** Helper function for printing out every tear flag that is turned on. Useful when debugging. */
|
|
6830
6832
|
export declare function logTearFlags(flags: TearFlag | BitFlags<TearFlag>): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
--[[
|
|
2
2
|
|
|
3
|
-
isaacscript-common
|
|
3
|
+
isaacscript-common 10.0.1
|
|
4
4
|
|
|
5
5
|
This is the "isaacscript-common" library, which was created with the IsaacScript tool.
|
|
6
6
|
|
|
@@ -304,11 +304,15 @@ local function __TS__ArrayPushArray(self, items)
|
|
|
304
304
|
return len
|
|
305
305
|
end
|
|
306
306
|
|
|
307
|
+
local function __TS__CountVarargs(...)
|
|
308
|
+
return select("#", ...)
|
|
309
|
+
end
|
|
310
|
+
|
|
307
311
|
local function __TS__ArrayReduce(self, callbackFn, ...)
|
|
308
312
|
local len = #self
|
|
309
313
|
local k = 0
|
|
310
314
|
local accumulator = nil
|
|
311
|
-
if
|
|
315
|
+
if __TS__CountVarargs(...) ~= 0 then
|
|
312
316
|
accumulator = ...
|
|
313
317
|
elseif len > 0 then
|
|
314
318
|
accumulator = self[1]
|
|
@@ -332,7 +336,7 @@ local function __TS__ArrayReduceRight(self, callbackFn, ...)
|
|
|
332
336
|
local len = #self
|
|
333
337
|
local k = len - 1
|
|
334
338
|
local accumulator = nil
|
|
335
|
-
if
|
|
339
|
+
if __TS__CountVarargs(...) ~= 0 then
|
|
336
340
|
accumulator = ...
|
|
337
341
|
elseif len > 0 then
|
|
338
342
|
accumulator = self[k + 1]
|
|
@@ -448,7 +452,7 @@ end
|
|
|
448
452
|
local function __TS__ArraySplice(self, ...)
|
|
449
453
|
local args = {...}
|
|
450
454
|
local len = #self
|
|
451
|
-
local actualArgumentCount =
|
|
455
|
+
local actualArgumentCount = __TS__CountVarargs(...)
|
|
452
456
|
local start = args[1]
|
|
453
457
|
local deleteCount = args[2]
|
|
454
458
|
if start < 0 then
|
|
@@ -1065,6 +1069,16 @@ local function __TS__DecorateParam(paramIndex, decorator)
|
|
|
1065
1069
|
return function(____, target, key) return decorator(nil, target, key, paramIndex) end
|
|
1066
1070
|
end
|
|
1067
1071
|
|
|
1072
|
+
local function __TS__StringIncludes(self, searchString, position)
|
|
1073
|
+
if not position then
|
|
1074
|
+
position = 1
|
|
1075
|
+
else
|
|
1076
|
+
position = position + 1
|
|
1077
|
+
end
|
|
1078
|
+
local index = string.find(self, searchString, position, true)
|
|
1079
|
+
return index ~= nil
|
|
1080
|
+
end
|
|
1081
|
+
|
|
1068
1082
|
local Error, RangeError, ReferenceError, SyntaxError, TypeError, URIError
|
|
1069
1083
|
do
|
|
1070
1084
|
local function getErrorStack(self, constructor)
|
|
@@ -1079,13 +1093,18 @@ do
|
|
|
1079
1093
|
break
|
|
1080
1094
|
end
|
|
1081
1095
|
end
|
|
1082
|
-
|
|
1096
|
+
if __TS__StringIncludes(_VERSION, "Lua 5.0") then
|
|
1097
|
+
return debug.traceback(("[Level " .. tostring(level)) .. "]")
|
|
1098
|
+
else
|
|
1099
|
+
return debug.traceback(nil, level)
|
|
1100
|
+
end
|
|
1083
1101
|
end
|
|
1084
1102
|
local function wrapErrorToString(self, getDescription)
|
|
1085
1103
|
return function(self)
|
|
1086
1104
|
local description = getDescription(self)
|
|
1087
1105
|
local caller = debug.getinfo(3, "f")
|
|
1088
|
-
|
|
1106
|
+
local isClassicLua = __TS__StringIncludes(_VERSION, "Lua 5.0") or _VERSION == "Lua 5.1"
|
|
1107
|
+
if isClassicLua or caller and caller.func ~= error then
|
|
1089
1108
|
return description
|
|
1090
1109
|
else
|
|
1091
1110
|
return (tostring(description) .. "\n") .. self.stack
|
|
@@ -1234,16 +1253,9 @@ do
|
|
|
1234
1253
|
function __TS__Generator(fn)
|
|
1235
1254
|
return function(...)
|
|
1236
1255
|
local args = {...}
|
|
1237
|
-
local argsLength =
|
|
1256
|
+
local argsLength = __TS__CountVarargs(...)
|
|
1238
1257
|
return {
|
|
1239
|
-
____coroutine = coroutine.create(function()
|
|
1240
|
-
local ____fn_1 = fn
|
|
1241
|
-
local ____unpack_0 = unpack
|
|
1242
|
-
if ____unpack_0 == nil then
|
|
1243
|
-
____unpack_0 = table.unpack
|
|
1244
|
-
end
|
|
1245
|
-
return ____fn_1(____unpack_0(args, 1, argsLength))
|
|
1246
|
-
end),
|
|
1258
|
+
____coroutine = coroutine.create(function() return fn(__TS__Unpack(args, 1, argsLength)) end),
|
|
1247
1259
|
[Symbol.iterator] = generatorIterator,
|
|
1248
1260
|
next = generatorNext
|
|
1249
1261
|
}
|
|
@@ -1407,8 +1419,12 @@ do
|
|
|
1407
1419
|
Map[Symbol.species] = Map
|
|
1408
1420
|
end
|
|
1409
1421
|
|
|
1422
|
+
local __TS__Match = string.match
|
|
1423
|
+
|
|
1410
1424
|
local __TS__MathAtan2 = math.atan2 or math.atan
|
|
1411
1425
|
|
|
1426
|
+
local __TS__MathModf = math.modf
|
|
1427
|
+
|
|
1412
1428
|
local function __TS__MathSign(val)
|
|
1413
1429
|
if val > 0 then
|
|
1414
1430
|
return 1
|
|
@@ -1418,6 +1434,10 @@ local function __TS__MathSign(val)
|
|
|
1418
1434
|
return 0
|
|
1419
1435
|
end
|
|
1420
1436
|
|
|
1437
|
+
local function __TS__Modulo50(a, b)
|
|
1438
|
+
return a - math.floor(a / b) * b
|
|
1439
|
+
end
|
|
1440
|
+
|
|
1421
1441
|
local function __TS__Number(value)
|
|
1422
1442
|
local valueType = type(value)
|
|
1423
1443
|
if valueType == "number" then
|
|
@@ -1464,7 +1484,7 @@ do
|
|
|
1464
1484
|
if radix < 2 or radix > 36 then
|
|
1465
1485
|
error("toString() radix argument must be between 2 and 36", 0)
|
|
1466
1486
|
end
|
|
1467
|
-
local integer, fraction =
|
|
1487
|
+
local integer, fraction = __TS__MathModf(math.abs(self))
|
|
1468
1488
|
local result = ""
|
|
1469
1489
|
if radix == 8 then
|
|
1470
1490
|
result = string.format("%o", integer)
|
|
@@ -1620,7 +1640,7 @@ local function __TS__ObjectValues(obj)
|
|
|
1620
1640
|
end
|
|
1621
1641
|
|
|
1622
1642
|
local function __TS__ParseFloat(numberString)
|
|
1623
|
-
local infinityMatch =
|
|
1643
|
+
local infinityMatch = __TS__Match(numberString, "^%s*(-?Infinity)")
|
|
1624
1644
|
if infinityMatch then
|
|
1625
1645
|
local ____temp_0
|
|
1626
1646
|
if __TS__StringAccess(infinityMatch, 0) == "-" then
|
|
@@ -1630,7 +1650,7 @@ local function __TS__ParseFloat(numberString)
|
|
|
1630
1650
|
end
|
|
1631
1651
|
return ____temp_0
|
|
1632
1652
|
end
|
|
1633
|
-
local number = tonumber(
|
|
1653
|
+
local number = tonumber(__TS__Match(numberString, "^%s*(-?%d+%.?%d*)"))
|
|
1634
1654
|
local ____number_1 = number
|
|
1635
1655
|
if ____number_1 == nil then
|
|
1636
1656
|
____number_1 = 0 / 0
|
|
@@ -1678,16 +1698,16 @@ do
|
|
|
1678
1698
|
function __TS__ParseInt(numberString, base)
|
|
1679
1699
|
if base == nil then
|
|
1680
1700
|
base = 10
|
|
1681
|
-
local hexMatch =
|
|
1701
|
+
local hexMatch = __TS__Match(numberString, "^%s*-?0[xX]")
|
|
1682
1702
|
if hexMatch then
|
|
1683
1703
|
base = 16
|
|
1684
|
-
local
|
|
1685
|
-
if
|
|
1686
|
-
|
|
1704
|
+
local ____TS__Match_result__0_0
|
|
1705
|
+
if __TS__Match(hexMatch, "-") then
|
|
1706
|
+
____TS__Match_result__0_0 = "-" .. __TS__StringSubstr(numberString, #hexMatch)
|
|
1687
1707
|
else
|
|
1688
|
-
|
|
1708
|
+
____TS__Match_result__0_0 = __TS__StringSubstr(numberString, #hexMatch)
|
|
1689
1709
|
end
|
|
1690
|
-
numberString =
|
|
1710
|
+
numberString = ____TS__Match_result__0_0
|
|
1691
1711
|
end
|
|
1692
1712
|
end
|
|
1693
1713
|
if base < 2 or base > 36 then
|
|
@@ -1702,7 +1722,7 @@ do
|
|
|
1702
1722
|
local allowedDigits = ____temp_1
|
|
1703
1723
|
local pattern = ("^%s*(-?[" .. allowedDigits) .. "]*)"
|
|
1704
1724
|
local number = tonumber(
|
|
1705
|
-
|
|
1725
|
+
__TS__Match(numberString, pattern),
|
|
1706
1726
|
base
|
|
1707
1727
|
)
|
|
1708
1728
|
if number == nil then
|
|
@@ -2014,13 +2034,13 @@ end
|
|
|
2014
2034
|
|
|
2015
2035
|
local function __TS__SparseArrayNew(...)
|
|
2016
2036
|
local sparseArray = {...}
|
|
2017
|
-
sparseArray.sparseLength =
|
|
2037
|
+
sparseArray.sparseLength = __TS__CountVarargs(...)
|
|
2018
2038
|
return sparseArray
|
|
2019
2039
|
end
|
|
2020
2040
|
|
|
2021
2041
|
local function __TS__SparseArrayPush(sparseArray, ...)
|
|
2022
2042
|
local args = {...}
|
|
2023
|
-
local argsLen =
|
|
2043
|
+
local argsLen = __TS__CountVarargs(...)
|
|
2024
2044
|
local listLen = sparseArray.sparseLength
|
|
2025
2045
|
for i = 1, argsLen do
|
|
2026
2046
|
sparseArray[listLen + i] = args[i]
|
|
@@ -2135,6 +2155,8 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2135
2155
|
local trace
|
|
2136
2156
|
if thread == nil and message == nil and level == nil then
|
|
2137
2157
|
trace = originalTraceback()
|
|
2158
|
+
elseif __TS__StringIncludes(_VERSION, "Lua 5.0") then
|
|
2159
|
+
trace = originalTraceback((("[Level " .. tostring(level)) .. "] ") .. message)
|
|
2138
2160
|
else
|
|
2139
2161
|
trace = originalTraceback(thread, message, level)
|
|
2140
2162
|
end
|
|
@@ -2160,7 +2182,7 @@ local function __TS__SourceMapTraceBack(fileName, sourceMap)
|
|
|
2160
2182
|
local function stringReplacer(____, file, line)
|
|
2161
2183
|
local fileSourceMap = _G.__TS__sourcemap[file]
|
|
2162
2184
|
if fileSourceMap and fileSourceMap[line] then
|
|
2163
|
-
local chunkName =
|
|
2185
|
+
local chunkName = __TS__Match(file, "%[string \"([^\"]+)\"%]")
|
|
2164
2186
|
local sourceName = string.gsub(chunkName, ".lua$", ".ts")
|
|
2165
2187
|
local data = fileSourceMap[line]
|
|
2166
2188
|
if type(data) == "number" then
|
|
@@ -2227,16 +2249,6 @@ local function __TS__StringEndsWith(self, searchString, endPosition)
|
|
|
2227
2249
|
return string.sub(self, endPosition - #searchString + 1, endPosition) == searchString
|
|
2228
2250
|
end
|
|
2229
2251
|
|
|
2230
|
-
local function __TS__StringIncludes(self, searchString, position)
|
|
2231
|
-
if not position then
|
|
2232
|
-
position = 1
|
|
2233
|
-
else
|
|
2234
|
-
position = position + 1
|
|
2235
|
-
end
|
|
2236
|
-
local index = string.find(self, searchString, position, true)
|
|
2237
|
-
return index ~= nil
|
|
2238
|
-
end
|
|
2239
|
-
|
|
2240
2252
|
local function __TS__StringPadEnd(self, maxLength, fillString)
|
|
2241
2253
|
if fillString == nil then
|
|
2242
2254
|
fillString = " "
|
|
@@ -2492,6 +2504,7 @@ return {
|
|
|
2492
2504
|
__TS__Class = __TS__Class,
|
|
2493
2505
|
__TS__ClassExtends = __TS__ClassExtends,
|
|
2494
2506
|
__TS__CloneDescriptor = __TS__CloneDescriptor,
|
|
2507
|
+
__TS__CountVarargs = __TS__CountVarargs,
|
|
2495
2508
|
__TS__Decorate = __TS__Decorate,
|
|
2496
2509
|
__TS__DecorateParam = __TS__DecorateParam,
|
|
2497
2510
|
__TS__Delete = __TS__Delete,
|
|
@@ -2509,8 +2522,11 @@ return {
|
|
|
2509
2522
|
__TS__Iterator = __TS__Iterator,
|
|
2510
2523
|
__TS__LuaIteratorSpread = __TS__LuaIteratorSpread,
|
|
2511
2524
|
Map = Map,
|
|
2525
|
+
__TS__Match = __TS__Match,
|
|
2512
2526
|
__TS__MathAtan2 = __TS__MathAtan2,
|
|
2527
|
+
__TS__MathModf = __TS__MathModf,
|
|
2513
2528
|
__TS__MathSign = __TS__MathSign,
|
|
2529
|
+
__TS__Modulo50 = __TS__Modulo50,
|
|
2514
2530
|
__TS__New = __TS__New,
|
|
2515
2531
|
__TS__Number = __TS__Number,
|
|
2516
2532
|
__TS__NumberIsFinite = __TS__NumberIsFinite,
|
|
@@ -4837,7 +4853,7 @@ return ____exports
|
|
|
4837
4853
|
["lua_modules.isaac-typescript-definitions.dist.package"] = function(...)
|
|
4838
4854
|
return {
|
|
4839
4855
|
name = "isaac-typescript-definitions",
|
|
4840
|
-
version = "
|
|
4856
|
+
version = "7.0.0",
|
|
4841
4857
|
description = "TypeScript definitions for The Binding of Isaac: Repentance.",
|
|
4842
4858
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
4843
4859
|
homepage = "https://isaacscript.github.io/",
|
|
@@ -4848,7 +4864,7 @@ return {
|
|
|
4848
4864
|
type = "commonjs",
|
|
4849
4865
|
main = "dist/src/index",
|
|
4850
4866
|
types = "dist/src/index.d.ts",
|
|
4851
|
-
dependencies = {["lua-types"] = "^2.
|
|
4867
|
+
dependencies = {["lua-types"] = "^2.13.0"}
|
|
4852
4868
|
}
|
|
4853
4869
|
end,
|
|
4854
4870
|
["lua_modules.isaac-typescript-definitions.dist.src.enums.ActiveSlot"] = function(...)
|
|
@@ -18391,6 +18407,7 @@ local ____types = require("src.functions.types")
|
|
|
18391
18407
|
local isBoolean = ____types.isBoolean
|
|
18392
18408
|
local isNumber = ____types.isNumber
|
|
18393
18409
|
local isString = ____types.isString
|
|
18410
|
+
local isUserdata = ____types.isUserdata
|
|
18394
18411
|
--- In a `Map`, you can use the `clear` method to delete every element. However, in a `LuaMap`, the
|
|
18395
18412
|
-- `clear` method does not exist. Use this helper function as a drop-in replacement for this.
|
|
18396
18413
|
function ____exports.clearTable(self, luaMap)
|
|
@@ -18398,11 +18415,14 @@ function ____exports.clearTable(self, luaMap)
|
|
|
18398
18415
|
luaMap[key] = nil
|
|
18399
18416
|
end
|
|
18400
18417
|
end
|
|
18401
|
-
--- Helper function to copy specific values from a object to a table.
|
|
18402
|
-
function ____exports.
|
|
18403
|
-
|
|
18418
|
+
--- Helper function to copy specific values from a userdata object (e.g. `Vector`) to a table.
|
|
18419
|
+
function ____exports.copyUserdataValuesToTable(self, object, keys, luaMap)
|
|
18420
|
+
if not isUserdata(nil, object) then
|
|
18421
|
+
error("Failed to copy an object values to a table, since the object was of type: " .. type(object))
|
|
18422
|
+
end
|
|
18423
|
+
local userdata = object
|
|
18404
18424
|
for ____, key in ipairs(keys) do
|
|
18405
|
-
local value =
|
|
18425
|
+
local value = userdata[key]
|
|
18406
18426
|
luaMap[key] = value
|
|
18407
18427
|
end
|
|
18408
18428
|
end
|
|
@@ -20182,7 +20202,7 @@ local getRandomSeed = ____rng.getRandomSeed
|
|
|
20182
20202
|
local isRNG = ____rng.isRNG
|
|
20183
20203
|
local newRNG = ____rng.newRNG
|
|
20184
20204
|
local ____table = require("src.functions.table")
|
|
20185
|
-
local
|
|
20205
|
+
local copyUserdataValuesToTable = ____table.copyUserdataValuesToTable
|
|
20186
20206
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
20187
20207
|
local tableHasKeys = ____table.tableHasKeys
|
|
20188
20208
|
local ____types = require("src.functions.types")
|
|
@@ -20256,7 +20276,7 @@ function ____exports.serializeVector(self, vector)
|
|
|
20256
20276
|
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
20257
20277
|
end
|
|
20258
20278
|
local vectorTable = {}
|
|
20259
|
-
|
|
20279
|
+
copyUserdataValuesToTable(nil, vector, KEYS, vectorTable)
|
|
20260
20280
|
vectorTable[SerializationBrand.VECTOR] = ""
|
|
20261
20281
|
return vectorTable
|
|
20262
20282
|
end
|
|
@@ -24900,7 +24920,7 @@ local getRandomSeed = ____rng.getRandomSeed
|
|
|
24900
24920
|
local isRNG = ____rng.isRNG
|
|
24901
24921
|
local newRNG = ____rng.newRNG
|
|
24902
24922
|
local ____table = require("src.functions.table")
|
|
24903
|
-
local
|
|
24923
|
+
local copyUserdataValuesToTable = ____table.copyUserdataValuesToTable
|
|
24904
24924
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
24905
24925
|
local tableHasKeys = ____table.tableHasKeys
|
|
24906
24926
|
local ____types = require("src.functions.types")
|
|
@@ -24984,7 +25004,7 @@ function ____exports.serializeKColor(self, kColor)
|
|
|
24984
25004
|
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
24985
25005
|
end
|
|
24986
25006
|
local kColorTable = {}
|
|
24987
|
-
|
|
25007
|
+
copyUserdataValuesToTable(nil, kColor, KEYS, kColorTable)
|
|
24988
25008
|
kColorTable[SerializationBrand.K_COLOR] = ""
|
|
24989
25009
|
return kColorTable
|
|
24990
25010
|
end
|
|
@@ -26728,7 +26748,9 @@ end
|
|
|
26728
26748
|
-- @param startingPosition The position to start searching from. If this position is not overlapping
|
|
26729
26749
|
-- with anything, then it will be returned.
|
|
26730
26750
|
-- @param avoidActiveEntities Optional. Default is false.
|
|
26731
|
-
|
|
26751
|
+
-- @param minimumDistance Optional. If specified, will ensure that the randomly generated position
|
|
26752
|
+
-- is equal to or greater than the distance provided.
|
|
26753
|
+
function ____exports.findFreePosition(self, startingPosition, avoidActiveEntities, minimumDistance)
|
|
26732
26754
|
if avoidActiveEntities == nil then
|
|
26733
26755
|
avoidActiveEntities = false
|
|
26734
26756
|
end
|
|
@@ -26747,6 +26769,12 @@ function ____exports.findFreePosition(self, startingPosition, avoidActiveEntitie
|
|
|
26747
26769
|
if isCloseHeavenDoor then
|
|
26748
26770
|
goto __continue7
|
|
26749
26771
|
end
|
|
26772
|
+
if minimumDistance ~= nil then
|
|
26773
|
+
local distance = startingPosition:Distance(position)
|
|
26774
|
+
if distance < minimumDistance then
|
|
26775
|
+
goto __continue7
|
|
26776
|
+
end
|
|
26777
|
+
end
|
|
26750
26778
|
return position
|
|
26751
26779
|
end
|
|
26752
26780
|
::__continue7::
|
|
@@ -29612,7 +29640,7 @@ local SerializationBrand = ____SerializationBrand.SerializationBrand
|
|
|
29612
29640
|
local ____isaacAPIClass = require("src.functions.isaacAPIClass")
|
|
29613
29641
|
local isIsaacAPIClassOfType = ____isaacAPIClass.isIsaacAPIClassOfType
|
|
29614
29642
|
local ____table = require("src.functions.table")
|
|
29615
|
-
local
|
|
29643
|
+
local copyUserdataValuesToTable = ____table.copyUserdataValuesToTable
|
|
29616
29644
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
29617
29645
|
local tableHasKeys = ____table.tableHasKeys
|
|
29618
29646
|
local ____types = require("src.functions.types")
|
|
@@ -29671,7 +29699,7 @@ function ____exports.serializeBitSet128(self, bitSet128)
|
|
|
29671
29699
|
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
29672
29700
|
end
|
|
29673
29701
|
local bitSet128Table = {}
|
|
29674
|
-
|
|
29702
|
+
copyUserdataValuesToTable(nil, bitSet128, KEYS, bitSet128Table)
|
|
29675
29703
|
bitSet128Table[SerializationBrand.BIT_SET_128] = ""
|
|
29676
29704
|
return bitSet128Table
|
|
29677
29705
|
end
|
|
@@ -29692,7 +29720,7 @@ local getRandomSeed = ____rng.getRandomSeed
|
|
|
29692
29720
|
local isRNG = ____rng.isRNG
|
|
29693
29721
|
local newRNG = ____rng.newRNG
|
|
29694
29722
|
local ____table = require("src.functions.table")
|
|
29695
|
-
local
|
|
29723
|
+
local copyUserdataValuesToTable = ____table.copyUserdataValuesToTable
|
|
29696
29724
|
local getNumbersFromTable = ____table.getNumbersFromTable
|
|
29697
29725
|
local tableHasKeys = ____table.tableHasKeys
|
|
29698
29726
|
local ____types = require("src.functions.types")
|
|
@@ -29797,7 +29825,7 @@ function ____exports.serializeColor(self, color)
|
|
|
29797
29825
|
error(((("Failed to serialize a " .. OBJECT_NAME) .. " object since the provided object was not a userdata ") .. OBJECT_NAME) .. " class.")
|
|
29798
29826
|
end
|
|
29799
29827
|
local colorTable = {}
|
|
29800
|
-
|
|
29828
|
+
copyUserdataValuesToTable(nil, color, KEYS, colorTable)
|
|
29801
29829
|
colorTable[SerializationBrand.COLOR] = ""
|
|
29802
29830
|
return colorTable
|
|
29803
29831
|
end
|
|
@@ -46818,7 +46846,7 @@ return ____exports
|
|
|
46818
46846
|
["package"] = function(...)
|
|
46819
46847
|
return {
|
|
46820
46848
|
name = "isaacscript-common",
|
|
46821
|
-
version = "
|
|
46849
|
+
version = "10.0.1",
|
|
46822
46850
|
description = "Helper functions and features for IsaacScript mods.",
|
|
46823
46851
|
keywords = {"isaac", "rebirth", "afterbirth", "repentance"},
|
|
46824
46852
|
homepage = "https://isaacscript.github.io/",
|
|
@@ -46829,7 +46857,7 @@ return {
|
|
|
46829
46857
|
type = "commonjs",
|
|
46830
46858
|
main = "dist/src/index",
|
|
46831
46859
|
types = "dist/src/index.d.ts",
|
|
46832
|
-
dependencies = {["isaac-typescript-definitions"] = "^
|
|
46860
|
+
dependencies = {["isaac-typescript-definitions"] = "^7.0.0"}
|
|
46833
46861
|
}
|
|
46834
46862
|
end,
|
|
46835
46863
|
["src.functions.map"] = function(...)
|