isaacscript-common 1.2.223 → 1.2.226
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/functions/deepCopy.lua +1 -4
- package/dist/functions/flying.lua +1 -1
- package/dist/functions/math.d.ts +1 -0
- package/dist/functions/math.lua +5 -0
- package/dist/functions/player.lua +3 -3
- package/dist/functions/revive.lua +2 -2
- package/dist/functions/roomShape.d.ts +9 -0
- package/dist/functions/roomShape.lua +18 -0
- package/dist/functions/rooms.d.ts +0 -7
- package/dist/functions/rooms.lua +6 -13
- package/dist/functions/serialization.lua +17 -102
- package/dist/functions/utils.d.ts +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.lua +8 -0
- package/dist/objects/directionToDegrees.d.ts +4 -0
- package/dist/objects/directionToDegrees.lua +10 -0
- package/dist/objects/roomShapeToBottomRightPosition.d.ts +8 -0
- package/dist/objects/roomShapeToBottomRightPosition.lua +20 -0
- package/dist/objects/serializableIsaacAPIClassTypeToCopyFunction.d.ts +5 -0
- package/dist/objects/serializableIsaacAPIClassTypeToCopyFunction.lua +14 -0
- package/dist/objects/serializableIsaacAPIClassTypeToIdentityFunction.d.ts +4 -0
- package/dist/objects/serializableIsaacAPIClassTypeToIdentityFunction.lua +14 -0
- package/package.json +2 -2
|
@@ -236,10 +236,7 @@ function validateValue(self, value, valueType, traversalDescription)
|
|
|
236
236
|
end
|
|
237
237
|
end
|
|
238
238
|
function getNewValue(self, key, value, traversalDescription, serializationType)
|
|
239
|
-
if isSerializableIsaacAPIClass(nil, value) then
|
|
240
|
-
return copySerializableIsaacAPIClass(nil, value, serializationType)
|
|
241
|
-
end
|
|
242
|
-
if isSerializedIsaacAPIClass(nil, value) and serializationType == SerializationType.DESERIALIZE then
|
|
239
|
+
if isSerializableIsaacAPIClass(nil, value) or isSerializedIsaacAPIClass(nil, value) and serializationType == SerializationType.DESERIALIZE then
|
|
243
240
|
return copySerializableIsaacAPIClass(nil, value, serializationType)
|
|
244
241
|
end
|
|
245
242
|
if type(value) == "table" then
|
|
@@ -17,7 +17,7 @@ local FLYING_CHARACTERS = __TS__New(Set, {
|
|
|
17
17
|
PlayerType.PLAYER_THESOUL_B
|
|
18
18
|
})
|
|
19
19
|
local FLYING_TRINKETS = __TS__New(Set, {TrinketType.TRINKET_BAT_WING, TrinketType.TRINKET_AZAZELS_STUMP})
|
|
20
|
-
local FLYING_NULL_ITEMS = {
|
|
20
|
+
local FLYING_NULL_ITEMS = {NullItemID.ID_REVERSE_SUN, NullItemID.ID_SPIRIT_SHACKLES_SOUL, NullItemID.ID_LOST_CURSE}
|
|
21
21
|
function ____exports.getFlyingCollectibles(self, pruneConditionalItems)
|
|
22
22
|
local collectiblesWithFlyingCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.CACHE_FLYING)
|
|
23
23
|
local collectiblesWithAllCacheFlag = getCollectiblesForCacheFlag(nil, CacheFlag.CACHE_ALL)
|
package/dist/functions/math.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
export declare function directionToDegrees(direction: Direction): int;
|
|
2
3
|
export declare function getAngleDifference(angle1: float, angle2: float): float;
|
|
3
4
|
/**
|
|
4
5
|
* Helper function to get an array of equidistant points on the circumference around a circle.
|
package/dist/functions/math.lua
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
3
3
|
local ____exports = {}
|
|
4
|
+
local ____directionToDegrees = require("objects.directionToDegrees")
|
|
5
|
+
local DIRECTION_TO_DEGREES = ____directionToDegrees.DIRECTION_TO_DEGREES
|
|
4
6
|
local ____vector = require("functions.vector")
|
|
5
7
|
local directionToVector = ____vector.directionToVector
|
|
8
|
+
function ____exports.directionToDegrees(self, direction)
|
|
9
|
+
return DIRECTION_TO_DEGREES[direction]
|
|
10
|
+
end
|
|
6
11
|
function ____exports.getAngleDifference(self, angle1, angle2)
|
|
7
12
|
local subtractedAngle = angle1 - angle2
|
|
8
13
|
return (subtractedAngle + 180) % 360 - 180
|
|
@@ -394,7 +394,7 @@ function ____exports.getTotalPlayerCollectibles(self, collectibleType)
|
|
|
394
394
|
end
|
|
395
395
|
function ____exports.hasLostCurse(self, player)
|
|
396
396
|
local effects = player:GetEffects()
|
|
397
|
-
return effects:HasNullEffect(
|
|
397
|
+
return effects:HasNullEffect(NullItemID.ID_LOST_CURSE)
|
|
398
398
|
end
|
|
399
399
|
function ____exports.hasOpenActiveItemSlot(self, player)
|
|
400
400
|
if ____exports.isCharacter(nil, player, PlayerType.PLAYER_THESOUL_B) then
|
|
@@ -543,14 +543,14 @@ function ____exports.setBlindfold(self, player, enabled, modifyCostume)
|
|
|
543
543
|
player:ChangePlayerType(character)
|
|
544
544
|
game.Challenge = challenge
|
|
545
545
|
if not modifyCostume then
|
|
546
|
-
player:TryRemoveNullCostume(
|
|
546
|
+
player:TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)
|
|
547
547
|
end
|
|
548
548
|
else
|
|
549
549
|
game.Challenge = Challenge.CHALLENGE_NULL
|
|
550
550
|
player:ChangePlayerType(character)
|
|
551
551
|
game.Challenge = challenge
|
|
552
552
|
if modifyCostume then
|
|
553
|
-
player:TryRemoveNullCostume(
|
|
553
|
+
player:TryRemoveNullCostume(NullItemID.ID_BLINDFOLD)
|
|
554
554
|
end
|
|
555
555
|
end
|
|
556
556
|
end
|
|
@@ -32,8 +32,8 @@ function ____exports.willReviveFromSpiritShackles(self, player)
|
|
|
32
32
|
return false
|
|
33
33
|
end
|
|
34
34
|
local effects = player:GetEffects()
|
|
35
|
-
local spiritShacklesEnabled = not effects:HasNullEffect(
|
|
36
|
-
local playerInSoulForm = effects:HasNullEffect(
|
|
35
|
+
local spiritShacklesEnabled = not effects:HasNullEffect(NullItemID.ID_SPIRIT_SHACKLES_DISABLED)
|
|
36
|
+
local playerInSoulForm = effects:HasNullEffect(NullItemID.ID_SPIRIT_SHACKLES_SOUL)
|
|
37
37
|
return spiritShacklesEnabled and not playerInSoulForm
|
|
38
38
|
end
|
|
39
39
|
function ____exports.isDamageToPlayerFatal(self, player, damageAmount, damageSource, lastDamageGameFrame)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* Helper function to get the grid index delta that a door out of the given room shape would lead
|
|
4
|
+
* to. For example, if you went through the bottom door in a room of `RoomShape.ROOMSHAPE_1x2`, you
|
|
5
|
+
* would end up in a room with a grid index that is +26 units from the `SafeGridIndex` of where you
|
|
6
|
+
* started.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
|
|
9
|
+
export declare function getRoomShapeBottomRightPosition(roomShape: RoomShape): Vector;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local Map = ____lualib.Map
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local ____roomShapeToBottomRightPosition = require("objects.roomShapeToBottomRightPosition")
|
|
5
|
+
local ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION = ____roomShapeToBottomRightPosition.ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION
|
|
6
|
+
local ____roomShapeToGridIndexDelta = require("objects.roomShapeToGridIndexDelta")
|
|
7
|
+
local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
|
|
8
|
+
function ____exports.getGridIndexDelta(self, roomShape, doorSlot)
|
|
9
|
+
local doorSlotToGridIndexMap = ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]
|
|
10
|
+
if doorSlotToGridIndexMap == nil then
|
|
11
|
+
return nil
|
|
12
|
+
end
|
|
13
|
+
return doorSlotToGridIndexMap:get(doorSlot)
|
|
14
|
+
end
|
|
15
|
+
function ____exports.getRoomShapeBottomRightPosition(self, roomShape)
|
|
16
|
+
return ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION[roomShape]
|
|
17
|
+
end
|
|
18
|
+
return ____exports
|
|
@@ -15,13 +15,6 @@ export declare function getAllRoomGridIndexes(): int[];
|
|
|
15
15
|
* tricky to properly detect.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getCurrentDimension(): Dimension;
|
|
18
|
-
/**
|
|
19
|
-
* Helper function to get the grid index delta that a door out of the given room shape would lead
|
|
20
|
-
* to. For example, if you went through the bottom door in a room of `RoomShape.ROOMSHAPE_1x2`, you
|
|
21
|
-
* would end up in a room with a grid index that is +26 units from the `SafeGridIndex` of where you
|
|
22
|
-
* started.
|
|
23
|
-
*/
|
|
24
|
-
export declare function getGridIndexDelta(roomShape: RoomShape, doorSlot: DoorSlot): int | undefined;
|
|
25
18
|
/**
|
|
26
19
|
* Helper function to get an array of all of the safe grid indexes for rooms that match the
|
|
27
20
|
* specified room type.
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
local ____lualib = require("lualib_bundle")
|
|
2
2
|
local __TS__ArrayMap = ____lualib.__TS__ArrayMap
|
|
3
|
-
local Map = ____lualib.Map
|
|
4
3
|
local Set = ____lualib.Set
|
|
5
4
|
local __TS__New = ____lualib.__TS__New
|
|
6
5
|
local __TS__ArrayFilter = ____lualib.__TS__ArrayFilter
|
|
7
6
|
local __TS__ArrayPush = ____lualib.__TS__ArrayPush
|
|
8
7
|
local __TS__ArrayEvery = ____lualib.__TS__ArrayEvery
|
|
8
|
+
local Map = ____lualib.Map
|
|
9
9
|
local ____exports = {}
|
|
10
10
|
local ____cachedClasses = require("cachedClasses")
|
|
11
11
|
local game = ____cachedClasses.game
|
|
@@ -13,8 +13,6 @@ local sfxManager = ____cachedClasses.sfxManager
|
|
|
13
13
|
local ____constants = require("constants")
|
|
14
14
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
15
15
|
local NUM_DIMENSIONS = ____constants.NUM_DIMENSIONS
|
|
16
|
-
local ____roomShapeToGridIndexDelta = require("objects.roomShapeToGridIndexDelta")
|
|
17
|
-
local ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA = ____roomShapeToGridIndexDelta.ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA
|
|
18
16
|
local ____doors = require("functions.doors")
|
|
19
17
|
local closeAllDoors = ____doors.closeAllDoors
|
|
20
18
|
local getDoors = ____doors.getDoors
|
|
@@ -40,6 +38,8 @@ local getRoomGridIndex = ____roomData.getRoomGridIndex
|
|
|
40
38
|
local getRoomShape = ____roomData.getRoomShape
|
|
41
39
|
local getRoomStageID = ____roomData.getRoomStageID
|
|
42
40
|
local getRoomSubType = ____roomData.getRoomSubType
|
|
41
|
+
local ____roomShape = require("functions.roomShape")
|
|
42
|
+
local getGridIndexDelta = ____roomShape.getGridIndexDelta
|
|
43
43
|
function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
44
44
|
if includeExtraDimensionalRooms == nil then
|
|
45
45
|
includeExtraDimensionalRooms = false
|
|
@@ -114,13 +114,6 @@ function ____exports.getCurrentDimension(self)
|
|
|
114
114
|
end
|
|
115
115
|
return error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
|
|
116
116
|
end
|
|
117
|
-
function ____exports.getGridIndexDelta(self, roomShape, doorSlot)
|
|
118
|
-
local doorSlotToGridIndexMap = ROOM_SHAPE_TO_DOOR_SLOTS_TO_GRID_INDEX_DELTA[roomShape]
|
|
119
|
-
if doorSlotToGridIndexMap == nil then
|
|
120
|
-
return nil
|
|
121
|
-
end
|
|
122
|
-
return doorSlotToGridIndexMap:get(doorSlot)
|
|
123
|
-
end
|
|
124
117
|
function ____exports.getRoomGridIndexesForType(self, ...)
|
|
125
118
|
local roomTypesSet = __TS__New(Set, {...})
|
|
126
119
|
local rooms = ____exports.getRooms(nil)
|
|
@@ -245,7 +238,7 @@ function ____exports.isDoorSlotValidAtGridIndexForRedRoom(self, doorSlot, roomGr
|
|
|
245
238
|
if roomShape == nil then
|
|
246
239
|
return false
|
|
247
240
|
end
|
|
248
|
-
local delta =
|
|
241
|
+
local delta = getGridIndexDelta(nil, roomShape, doorSlot)
|
|
249
242
|
if delta == nil then
|
|
250
243
|
return false
|
|
251
244
|
end
|
|
@@ -281,12 +274,12 @@ function ____exports.setRoomCleared(self)
|
|
|
281
274
|
for ____, door in ipairs(getDoors(nil)) do
|
|
282
275
|
do
|
|
283
276
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
284
|
-
goto
|
|
277
|
+
goto __continue52
|
|
285
278
|
end
|
|
286
279
|
openDoorFast(nil, door)
|
|
287
280
|
door.ExtraVisible = false
|
|
288
281
|
end
|
|
289
|
-
::
|
|
282
|
+
::__continue52::
|
|
290
283
|
end
|
|
291
284
|
sfxManager:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
292
285
|
game:ShakeScreen(0)
|
|
@@ -1,115 +1,30 @@
|
|
|
1
|
-
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__ObjectValues = ____lualib.__TS__ObjectValues
|
|
3
|
+
local __TS__ArraySome = ____lualib.__TS__ArraySome
|
|
2
4
|
local ____exports = {}
|
|
3
|
-
local
|
|
4
|
-
local
|
|
5
|
-
local
|
|
6
|
-
local
|
|
7
|
-
local isSerializedColor = ____color.isSerializedColor
|
|
5
|
+
local ____serializableIsaacAPIClassTypeToCopyFunction = require("objects.serializableIsaacAPIClassTypeToCopyFunction")
|
|
6
|
+
local SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_COPY_FUNCTION = ____serializableIsaacAPIClassTypeToCopyFunction.SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_COPY_FUNCTION
|
|
7
|
+
local ____serializableIsaacAPIClassTypeToIdentityFunction = require("objects.serializableIsaacAPIClassTypeToIdentityFunction")
|
|
8
|
+
local SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_IDENTITY_FUNCTION = ____serializableIsaacAPIClassTypeToIdentityFunction.SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_IDENTITY_FUNCTION
|
|
8
9
|
local ____isaacAPIClass = require("functions.isaacAPIClass")
|
|
9
10
|
local getIsaacAPIClassType = ____isaacAPIClass.getIsaacAPIClassType
|
|
10
|
-
local ____kColor = require("functions.kColor")
|
|
11
|
-
local copyKColor = ____kColor.copyKColor
|
|
12
|
-
local isSerializedKColor = ____kColor.isSerializedKColor
|
|
13
|
-
local ____rng = require("functions.rng")
|
|
14
|
-
local copyRNG = ____rng.copyRNG
|
|
15
|
-
local isSerializedRNG = ____rng.isSerializedRNG
|
|
16
|
-
local ____utils = require("functions.utils")
|
|
17
|
-
local ensureAllCases = ____utils.ensureAllCases
|
|
18
|
-
local getEnumValues = ____utils.getEnumValues
|
|
19
|
-
local ____vector = require("functions.vector")
|
|
20
|
-
local copyVector = ____vector.copyVector
|
|
21
|
-
local isSerializedVector = ____vector.isSerializedVector
|
|
22
11
|
function ____exports.copySerializableIsaacAPIClass(self, isaacAPIClassOrSerializedTable, serializationType)
|
|
23
12
|
local isaacAPIClassType = getIsaacAPIClassType(nil, isaacAPIClassOrSerializedTable)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
local color = isaacAPIClassOrSerializedTable
|
|
30
|
-
return copyColor(nil, color, serializationType)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
____cond3 = ____cond3 or ____switch3 == SerializableIsaacAPIClassType.KCOLOR
|
|
34
|
-
if ____cond3 then
|
|
35
|
-
do
|
|
36
|
-
local kColor = isaacAPIClassOrSerializedTable
|
|
37
|
-
return copyKColor(nil, kColor, serializationType)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
40
|
-
____cond3 = ____cond3 or ____switch3 == SerializableIsaacAPIClassType.RNG
|
|
41
|
-
if ____cond3 then
|
|
42
|
-
do
|
|
43
|
-
local rng = isaacAPIClassOrSerializedTable
|
|
44
|
-
return copyRNG(nil, rng)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
____cond3 = ____cond3 or ____switch3 == SerializableIsaacAPIClassType.VECTOR
|
|
48
|
-
if ____cond3 then
|
|
49
|
-
do
|
|
50
|
-
local vector = isaacAPIClassOrSerializedTable
|
|
51
|
-
return copyVector(nil, vector)
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
do
|
|
55
|
-
do
|
|
56
|
-
return ensureAllCases(nil, isaacAPIClassType)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
until true
|
|
13
|
+
local copyFunction = SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_COPY_FUNCTION[isaacAPIClassType]
|
|
14
|
+
if copyFunction == nil then
|
|
15
|
+
error(("Failed to copy Isaac API class \"" .. isaacAPIClassType) .. "\" since there is not a defined copy function for this class type.")
|
|
16
|
+
end
|
|
17
|
+
return copyFunction(nil, isaacAPIClassOrSerializedTable, serializationType)
|
|
60
18
|
end
|
|
61
19
|
function ____exports.isSerializedIsaacAPIClass(self, object)
|
|
62
20
|
local objectType = type(object)
|
|
63
21
|
if objectType ~= "table" then
|
|
64
22
|
return false
|
|
65
23
|
end
|
|
66
|
-
local
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if ____cond12 then
|
|
72
|
-
do
|
|
73
|
-
if isSerializedColor(nil, object) then
|
|
74
|
-
return true
|
|
75
|
-
end
|
|
76
|
-
break
|
|
77
|
-
end
|
|
78
|
-
end
|
|
79
|
-
____cond12 = ____cond12 or ____switch12 == SerializableIsaacAPIClassType.KCOLOR
|
|
80
|
-
if ____cond12 then
|
|
81
|
-
do
|
|
82
|
-
if isSerializedKColor(nil, object) then
|
|
83
|
-
return true
|
|
84
|
-
end
|
|
85
|
-
break
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
____cond12 = ____cond12 or ____switch12 == SerializableIsaacAPIClassType.RNG
|
|
89
|
-
if ____cond12 then
|
|
90
|
-
do
|
|
91
|
-
if isSerializedRNG(nil, object) then
|
|
92
|
-
return true
|
|
93
|
-
end
|
|
94
|
-
break
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
____cond12 = ____cond12 or ____switch12 == SerializableIsaacAPIClassType.VECTOR
|
|
98
|
-
if ____cond12 then
|
|
99
|
-
do
|
|
100
|
-
if isSerializedVector(nil, object) then
|
|
101
|
-
return true
|
|
102
|
-
end
|
|
103
|
-
break
|
|
104
|
-
end
|
|
105
|
-
end
|
|
106
|
-
do
|
|
107
|
-
do
|
|
108
|
-
ensureAllCases(nil, serializableIsaacAPIClassType)
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
until true
|
|
112
|
-
end
|
|
113
|
-
return false
|
|
24
|
+
local identityFunctions = __TS__ObjectValues(SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_IDENTITY_FUNCTION)
|
|
25
|
+
return __TS__ArraySome(
|
|
26
|
+
identityFunctions,
|
|
27
|
+
function(____, identityFunction) return identityFunction(nil, object) end
|
|
28
|
+
)
|
|
114
29
|
end
|
|
115
30
|
return ____exports
|
|
@@ -122,5 +122,14 @@ export declare function repeat(n: int, func: (i: int) => void): void;
|
|
|
122
122
|
/**
|
|
123
123
|
* Helper function to check every value of a custom enum for -1. This is helpful as a run-time check
|
|
124
124
|
* because many methods of the Isaac class return -1 if they fail.
|
|
125
|
+
*
|
|
126
|
+
* Example:
|
|
127
|
+
* ```ts
|
|
128
|
+
* enum EntityTypeCustom {
|
|
129
|
+
* FOO = Isaac.GetEntityTypeByName("Foo"),
|
|
130
|
+
* }
|
|
131
|
+
*
|
|
132
|
+
* validateCustomEnum("EntityTypeCustom", EntityTypeCustom);
|
|
133
|
+
* ```
|
|
125
134
|
*/
|
|
126
135
|
export declare function validateCustomEnum(transpiledEnumName: string, transpiledEnum: unknown): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export * from "./functions/revive";
|
|
|
74
74
|
export * from "./functions/rng";
|
|
75
75
|
export * from "./functions/roomData";
|
|
76
76
|
export * from "./functions/rooms";
|
|
77
|
+
export * from "./functions/roomShape";
|
|
77
78
|
export * from "./functions/run";
|
|
78
79
|
export * from "./functions/seeds";
|
|
79
80
|
export * from "./functions/serialization";
|
package/dist/index.lua
CHANGED
|
@@ -592,6 +592,14 @@ do
|
|
|
592
592
|
end
|
|
593
593
|
end
|
|
594
594
|
end
|
|
595
|
+
do
|
|
596
|
+
local ____export = require("functions.roomShape")
|
|
597
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
598
|
+
if ____exportKey ~= "default" then
|
|
599
|
+
____exports[____exportKey] = ____exportValue
|
|
600
|
+
end
|
|
601
|
+
end
|
|
602
|
+
end
|
|
595
603
|
do
|
|
596
604
|
local ____export = require("functions.run")
|
|
597
605
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
____exports.DIRECTION_TO_DEGREES = {
|
|
4
|
+
[Direction.NO_DIRECTION] = 0,
|
|
5
|
+
[Direction.LEFT] = 180,
|
|
6
|
+
[Direction.UP] = 270,
|
|
7
|
+
[Direction.RIGHT] = 0,
|
|
8
|
+
[Direction.DOWN] = 90
|
|
9
|
+
}
|
|
10
|
+
return ____exports
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
/**
|
|
3
|
+
* "Vector(0, 0)" corresponds to the top left tile of a room, not including the walls. (The top-left
|
|
4
|
+
* wall would be at "Vector(-1, -1)".)
|
|
5
|
+
*/
|
|
6
|
+
export declare const ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION: {
|
|
7
|
+
readonly [key in RoomShape]: Vector;
|
|
8
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local TWO_BY_TWO_BOTTOM_RIGHT_POSITION = Vector(25, 13)
|
|
4
|
+
local ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION = Vector(12, 13)
|
|
5
|
+
____exports.ROOM_SHAPE_TO_BOTTOM_RIGHT_POSITION = {
|
|
6
|
+
[RoomShape.ROOMSHAPE_1x1] = Vector(12, 6),
|
|
7
|
+
[RoomShape.ROOMSHAPE_IH] = Vector(12, 4),
|
|
8
|
+
[RoomShape.ROOMSHAPE_IV] = Vector(8, 6),
|
|
9
|
+
[RoomShape.ROOMSHAPE_1x2] = ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION,
|
|
10
|
+
[RoomShape.ROOMSHAPE_IIV] = Vector(8, 13),
|
|
11
|
+
[RoomShape.ROOMSHAPE_2x1] = Vector(25, 6),
|
|
12
|
+
[RoomShape.ROOMSHAPE_IIH] = Vector(25, 4),
|
|
13
|
+
[RoomShape.ROOMSHAPE_2x2] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
14
|
+
[RoomShape.ROOMSHAPE_LTL] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
15
|
+
[RoomShape.ROOMSHAPE_LTR] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
16
|
+
[RoomShape.ROOMSHAPE_LBL] = TWO_BY_TWO_BOTTOM_RIGHT_POSITION,
|
|
17
|
+
[RoomShape.ROOMSHAPE_LBR] = ONE_BY_TWO_VERTICAL_BOTTOM_RIGHT_POSITION,
|
|
18
|
+
[RoomShape.NUM_ROOMSHAPES] = Vector.Zero
|
|
19
|
+
}
|
|
20
|
+
return ____exports
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SerializableIsaacAPIClassType } from "../enums/private/SerializableIsaacAPIClassType";
|
|
2
|
+
import { SerializationType } from "../enums/SerializationType";
|
|
3
|
+
export declare const SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_COPY_FUNCTION: {
|
|
4
|
+
readonly [key in SerializableIsaacAPIClassType]: (object: unknown, serializationType: SerializationType) => boolean;
|
|
5
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____SerializableIsaacAPIClassType = require("enums.private.SerializableIsaacAPIClassType")
|
|
4
|
+
local SerializableIsaacAPIClassType = ____SerializableIsaacAPIClassType.SerializableIsaacAPIClassType
|
|
5
|
+
local ____color = require("functions.color")
|
|
6
|
+
local copyColor = ____color.copyColor
|
|
7
|
+
local ____kColor = require("functions.kColor")
|
|
8
|
+
local copyKColor = ____kColor.copyKColor
|
|
9
|
+
local ____rng = require("functions.rng")
|
|
10
|
+
local copyRNG = ____rng.copyRNG
|
|
11
|
+
local ____vector = require("functions.vector")
|
|
12
|
+
local copyVector = ____vector.copyVector
|
|
13
|
+
____exports.SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_COPY_FUNCTION = {[SerializableIsaacAPIClassType.COLOR] = copyColor, [SerializableIsaacAPIClassType.KCOLOR] = copyKColor, [SerializableIsaacAPIClassType.RNG] = copyRNG, [SerializableIsaacAPIClassType.VECTOR] = copyVector}
|
|
14
|
+
return ____exports
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local ____SerializableIsaacAPIClassType = require("enums.private.SerializableIsaacAPIClassType")
|
|
4
|
+
local SerializableIsaacAPIClassType = ____SerializableIsaacAPIClassType.SerializableIsaacAPIClassType
|
|
5
|
+
local ____color = require("functions.color")
|
|
6
|
+
local isColor = ____color.isColor
|
|
7
|
+
local ____kColor = require("functions.kColor")
|
|
8
|
+
local isKColor = ____kColor.isKColor
|
|
9
|
+
local ____rng = require("functions.rng")
|
|
10
|
+
local isRNG = ____rng.isRNG
|
|
11
|
+
local ____vector = require("functions.vector")
|
|
12
|
+
local isVector = ____vector.isVector
|
|
13
|
+
____exports.SERIALIZABLE_ISAAC_API_CLASS_TYPE_TO_IDENTITY_FUNCTION = {[SerializableIsaacAPIClassType.COLOR] = isColor, [SerializableIsaacAPIClassType.KCOLOR] = isKColor, [SerializableIsaacAPIClassType.RNG] = isRNG, [SerializableIsaacAPIClassType.VECTOR] = isVector}
|
|
14
|
+
return ____exports
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.226",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist/**/*.d.ts"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"isaac-typescript-definitions": "^1.0.
|
|
28
|
+
"isaac-typescript-definitions": "^1.0.384",
|
|
29
29
|
"isaacscript-lint": "^1.0.95",
|
|
30
30
|
"isaacscript-tsconfig": "^1.1.8",
|
|
31
31
|
"typedoc": "^0.22.13",
|