isaacscript-common 1.0.574 → 1.0.578
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/callbacks/itemPickup.lua +2 -6
- package/dist/callbacks/postBombInitLate.lua +1 -5
- package/dist/callbacks/postCursedTeleport.lua +8 -10
- package/dist/callbacks/postEffectInitLate.lua +1 -5
- package/dist/callbacks/postEsauJr.lua +2 -4
- package/dist/callbacks/postFamiliarInitLate.lua +1 -5
- package/dist/callbacks/postFlip.lua +2 -4
- package/dist/callbacks/postGridEntity.lua +8 -20
- package/dist/callbacks/postKnifeInitLate.lua +1 -5
- package/dist/callbacks/postLaserInitLate.lua +1 -5
- package/dist/callbacks/postNPCInitLate.lua +1 -5
- package/dist/callbacks/postPickupCollect.lua +1 -5
- package/dist/callbacks/postPickupInitLate.lua +1 -5
- package/dist/callbacks/postPlayerChangeHealth.lua +19 -23
- package/dist/callbacks/postPlayerChangeType.lua +1 -5
- package/dist/callbacks/postPlayerFatalDamage.lua +5 -9
- package/dist/callbacks/postPlayerInitLate.lua +1 -5
- package/dist/callbacks/postPlayerReordered.lua +8 -2
- package/dist/callbacks/postProjectileInitLate.lua +1 -5
- package/dist/callbacks/postPurchase.lua +19 -19
- package/dist/callbacks/postSacrifice.lua +3 -3
- package/dist/callbacks/postSlotInitUpdate.lua +3 -11
- package/dist/callbacks/postSlotRenderBroken.lua +2 -8
- package/dist/callbacks/postTearInitLate.lua +1 -5
- package/dist/callbacks/postTearInitVeryLate.lua +1 -5
- package/dist/callbacks/postTransformation.lua +1 -5
- package/dist/callbacks/postTrinketBreak.lua +5 -9
- package/dist/callbacks/preNewLevel.lua +1 -1
- package/dist/callbacks/reorderedCallbacks.lua +4 -4
- package/dist/callbacks/subscriptions/PreNewLevel.lua +1 -2
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -2
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -5
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postEsauJr.lua +1 -2
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -2
- package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -2
- package/dist/callbacks/subscriptions/postFlip.lua +1 -2
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -2
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -5
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -5
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -5
- package/dist/callbacks/subscriptions/postItemPickup.lua +5 -8
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -2
- package/dist/callbacks/subscriptions/postNewRoomEarly.lua +1 -2
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -2
- package/dist/callbacks/subscriptions/postPEffectUpdateReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -5
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -2
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -5
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postPurchase.lua +8 -3
- package/dist/callbacks/subscriptions/postSacrifice.lua +1 -2
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -5
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -5
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -5
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -5
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -5
- package/dist/callbacks/subscriptions/postTearInitVeryLate.lua +3 -5
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -5
- package/dist/callbacks/subscriptions/postTrinketBreak.lua +3 -5
- package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -2
- package/dist/callbacks/subscriptions/preItemPickup.lua +5 -8
- package/dist/constants.lua +57 -6
- package/dist/features/deployJSONRoom.lua +95 -68
- package/dist/features/disableInputs.lua +9 -3
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +4 -10
- package/dist/features/preventCollectibleRotate.lua +3 -9
- package/dist/features/saveDataManager/load.lua +2 -6
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/features/saveDataManager/merge.lua +2 -4
- package/dist/features/sirenHelpers.lua +5 -7
- package/dist/functions/array.lua +6 -10
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/challenges.lua +1 -1
- package/dist/functions/charge.lua +10 -12
- package/dist/functions/collectibles.lua +18 -23
- package/dist/functions/color.lua +9 -1
- package/dist/functions/deepCopy.lua +46 -28
- package/dist/functions/deepCopyTests.lua +12 -20
- package/dist/functions/doors.d.ts +10 -0
- package/dist/functions/doors.lua +19 -21
- package/dist/functions/entity.lua +8 -2
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/gridEntity.lua +14 -9
- package/dist/functions/input.lua +17 -27
- package/dist/functions/jsonRoom.lua +3 -9
- package/dist/functions/language.lua +9 -1
- package/dist/functions/log.lua +33 -85
- package/dist/functions/math.lua +15 -17
- package/dist/functions/npc.lua +15 -17
- package/dist/functions/pickups.lua +14 -1
- package/dist/functions/player.lua +38 -60
- package/dist/functions/playerHealth.lua +19 -9
- package/dist/functions/pocketItems.lua +4 -4
- package/dist/functions/random.lua +2 -2
- package/dist/functions/revive.lua +4 -4
- package/dist/functions/rooms.d.ts +14 -2
- package/dist/functions/rooms.lua +58 -43
- package/dist/functions/spawnCollectible.lua +10 -2
- package/dist/functions/sprite.lua +2 -2
- package/dist/functions/stage.lua +11 -11
- package/dist/functions/tears.lua +1 -1
- package/dist/functions/transformations.lua +4 -10
- package/dist/functions/trinketGive.lua +3 -3
- package/dist/functions/trinkets.lua +10 -6
- package/dist/functions/ui.lua +3 -3
- package/dist/functions/util.d.ts +0 -11
- package/dist/functions/util.lua +6 -26
- package/dist/functions/vector.lua +8 -8
- package/dist/lualib_bundle.lua +795 -735
- package/dist/maps/cardDescriptionMap.lua +99 -1
- package/dist/maps/cardNameMap.lua +99 -1
- package/dist/maps/challengeNameMap.lua +47 -1
- package/dist/maps/collectibleDescriptionMap.lua +722 -1
- package/dist/maps/collectibleNameMap.lua +722 -1
- package/dist/maps/gridEntityXMLMap.lua +36 -1
- package/dist/maps/pillEffectNameMap.lua +52 -1
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +7 -1
- package/dist/maps/transformationMaps.lua +21 -16
- package/dist/maps/transformationNameMap.lua +17 -1
- package/dist/maps/trinketDescriptionMap.lua +190 -1
- package/dist/maps/trinketNameMap.lua +190 -1
- package/dist/sets/cards.lua +98 -2
- package/dist/types/ModUpgraded.lua +95 -105
- package/package.json +5 -5
package/dist/functions/rooms.lua
CHANGED
|
@@ -9,6 +9,7 @@ local ____doors = require("functions.doors")
|
|
|
9
9
|
local closeAllDoors = ____doors.closeAllDoors
|
|
10
10
|
local getDoors = ____doors.getDoors
|
|
11
11
|
local isHiddenSecretRoomDoor = ____doors.isHiddenSecretRoomDoor
|
|
12
|
+
local openDoorFast = ____doors.openDoorFast
|
|
12
13
|
local ____entity = require("functions.entity")
|
|
13
14
|
local getEntities = ____entity.getEntities
|
|
14
15
|
local getEntityPositions = ____entity.getEntityPositions
|
|
@@ -37,11 +38,11 @@ function ____exports.getRoomDescriptor(self, roomGridIndex)
|
|
|
37
38
|
end
|
|
38
39
|
function ____exports.getRoomStageID(self, roomGridIndex)
|
|
39
40
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
40
|
-
return
|
|
41
|
+
return roomData == nil and -1 or roomData.StageID
|
|
41
42
|
end
|
|
42
43
|
function ____exports.getRoomSubType(self, roomGridIndex)
|
|
43
44
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
44
|
-
return
|
|
45
|
+
return roomData == nil and -1 or roomData.Subtype
|
|
45
46
|
end
|
|
46
47
|
function ____exports.getRooms(self, includeExtraDimensionalRooms)
|
|
47
48
|
if includeExtraDimensionalRooms == nil then
|
|
@@ -79,19 +80,21 @@ end
|
|
|
79
80
|
function ____exports.inDeathCertificateArea(self)
|
|
80
81
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
81
82
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
82
|
-
return
|
|
83
|
+
return roomStageID == 35 and (roomSubType == 33 or roomSubType == 33)
|
|
83
84
|
end
|
|
84
85
|
function ____exports.changeRoom(self, roomGridIndex)
|
|
85
86
|
local game = Game()
|
|
86
87
|
local level = game:GetLevel()
|
|
88
|
+
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
89
|
+
if roomData == nil then
|
|
90
|
+
error(("Failed to change the room to to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
|
|
91
|
+
end
|
|
87
92
|
level.LeaveDoor = -1
|
|
88
93
|
game:ChangeRoom(roomGridIndex)
|
|
89
94
|
end
|
|
90
95
|
function ____exports.getAllRoomGridIndexes(self)
|
|
91
96
|
local allRoomGridIndexes = {}
|
|
92
|
-
for ____, roomDescriptor in ipairs(
|
|
93
|
-
____exports.getRooms(nil)
|
|
94
|
-
) do
|
|
97
|
+
for ____, roomDescriptor in ipairs(____exports.getRooms(nil)) do
|
|
95
98
|
__TS__ArrayPush(allRoomGridIndexes, roomDescriptor.SafeGridIndex)
|
|
96
99
|
end
|
|
97
100
|
return allRoomGridIndexes
|
|
@@ -116,21 +119,17 @@ function ____exports.getCurrentDimension(self)
|
|
|
116
119
|
dimension = dimension + 1
|
|
117
120
|
end
|
|
118
121
|
end
|
|
119
|
-
error(
|
|
120
|
-
"Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex)
|
|
121
|
-
)
|
|
122
|
+
error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex))
|
|
122
123
|
return 0
|
|
123
124
|
end
|
|
124
125
|
function ____exports.getRoomDataType(self, roomGridIndex)
|
|
125
126
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
126
|
-
return
|
|
127
|
+
return roomData == nil and -1 or roomData.Type
|
|
127
128
|
end
|
|
128
129
|
function ____exports.getRoomGridIndexesForType(self, roomType)
|
|
129
130
|
local roomGridIndexes = {}
|
|
130
|
-
for ____, roomDescriptor in ipairs(
|
|
131
|
-
|
|
132
|
-
) do
|
|
133
|
-
if (roomDescriptor.Data ~= nil) and (roomDescriptor.Data.Type == roomType) then
|
|
131
|
+
for ____, roomDescriptor in ipairs(____exports.getRooms(nil)) do
|
|
132
|
+
if roomDescriptor.Data ~= nil and roomDescriptor.Data.Type == roomType then
|
|
134
133
|
__TS__ArrayPush(roomGridIndexes, roomDescriptor.SafeGridIndex)
|
|
135
134
|
end
|
|
136
135
|
end
|
|
@@ -150,15 +149,15 @@ function ____exports.getRoomListIndex(self, roomGridIndex)
|
|
|
150
149
|
end
|
|
151
150
|
function ____exports.getRoomName(self, roomGridIndex)
|
|
152
151
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
153
|
-
return
|
|
152
|
+
return roomData == nil and "Unknown" or roomData.Name
|
|
154
153
|
end
|
|
155
154
|
function ____exports.getRoomSafeGridIndex(self, roomGridIndex)
|
|
156
|
-
local roomDescriptor =
|
|
155
|
+
local roomDescriptor = roomGridIndex == nil and ____exports.getCurrentRoomDescriptorReadOnly(nil) or ____exports.getRoomDescriptor(nil, roomGridIndex)
|
|
157
156
|
return roomDescriptor.SafeGridIndex
|
|
158
157
|
end
|
|
159
158
|
function ____exports.getRoomVariant(self, roomGridIndex)
|
|
160
159
|
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
161
|
-
return
|
|
160
|
+
return roomData == nil and -1 or roomData.Variant
|
|
162
161
|
end
|
|
163
162
|
function ____exports.getRoomVisitedCount(self, roomGridIndex)
|
|
164
163
|
local roomDescriptor = ____exports.getRoomDescriptor(nil, roomGridIndex)
|
|
@@ -169,26 +168,26 @@ function ____exports.gridToPos(self, x, y)
|
|
|
169
168
|
local room = game:GetRoom()
|
|
170
169
|
x = x + 1
|
|
171
170
|
y = y + 1
|
|
172
|
-
local gridIndex =
|
|
171
|
+
local gridIndex = y * room:GetGridWidth() + x
|
|
173
172
|
return room:GetGridPosition(gridIndex)
|
|
174
173
|
end
|
|
175
174
|
function ____exports.in2x1Room(self)
|
|
176
175
|
local game = Game()
|
|
177
176
|
local room = game:GetRoom()
|
|
178
177
|
local roomShape = room:GetRoomShape()
|
|
179
|
-
return
|
|
178
|
+
return roomShape == RoomShape.ROOMSHAPE_1x2 or roomShape == RoomShape.ROOMSHAPE_2x1
|
|
180
179
|
end
|
|
181
180
|
function ____exports.inAngelShop(self)
|
|
182
181
|
local game = Game()
|
|
183
182
|
local room = game:GetRoom()
|
|
184
183
|
local roomType = room:GetType()
|
|
185
184
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
186
|
-
return
|
|
185
|
+
return roomType == RoomType.ROOM_ANGEL and roomSubType == 1
|
|
187
186
|
end
|
|
188
187
|
function ____exports.inBeastRoom(self)
|
|
189
188
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
190
189
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
191
|
-
return
|
|
190
|
+
return roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType == 4
|
|
192
191
|
end
|
|
193
192
|
function ____exports.inBossRoomOf(self, bossID)
|
|
194
193
|
local game = Game()
|
|
@@ -196,12 +195,12 @@ function ____exports.inBossRoomOf(self, bossID)
|
|
|
196
195
|
local roomType = room:GetType()
|
|
197
196
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
198
197
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
199
|
-
return
|
|
198
|
+
return roomType == RoomType.ROOM_BOSS and roomStageID == 0 and roomSubType == bossID
|
|
200
199
|
end
|
|
201
200
|
function ____exports.inCrawlspace(self)
|
|
202
201
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
203
202
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
204
|
-
return
|
|
203
|
+
return roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType ~= 4
|
|
205
204
|
end
|
|
206
205
|
function ____exports.inDevilsCrownTreasureRoom(self)
|
|
207
206
|
local roomDescriptor = ____exports.getCurrentRoomDescriptorReadOnly(nil)
|
|
@@ -214,7 +213,7 @@ function ____exports.inLRoom(self)
|
|
|
214
213
|
local game = Game()
|
|
215
214
|
local room = game:GetRoom()
|
|
216
215
|
local roomShape = room:GetRoomShape()
|
|
217
|
-
return
|
|
216
|
+
return roomShape == RoomShape.ROOMSHAPE_LTL or roomShape == RoomShape.ROOMSHAPE_LTR or roomShape == RoomShape.ROOMSHAPE_LBL or roomShape == RoomShape.ROOMSHAPE_LBR
|
|
218
217
|
end
|
|
219
218
|
function ____exports.inGenesisRoom(self)
|
|
220
219
|
local game = Game()
|
|
@@ -222,7 +221,7 @@ function ____exports.inGenesisRoom(self)
|
|
|
222
221
|
local roomType = room:GetType()
|
|
223
222
|
local roomVariant = ____exports.getRoomVariant(nil)
|
|
224
223
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
225
|
-
return
|
|
224
|
+
return roomType == RoomType.ROOM_ISAACS and roomVariant == GENESIS_ROOM_VARIANT and roomSubType == GENESIS_ROOM_SUBTYPE
|
|
226
225
|
end
|
|
227
226
|
function ____exports.inMinibossRoomOf(self, minibossID)
|
|
228
227
|
local game = Game()
|
|
@@ -230,34 +229,38 @@ function ____exports.inMinibossRoomOf(self, minibossID)
|
|
|
230
229
|
local roomType = room:GetType()
|
|
231
230
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
232
231
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
233
|
-
return
|
|
232
|
+
return roomType == RoomType.ROOM_MINIBOSS and roomStageID == 0 and roomSubType == minibossID
|
|
234
233
|
end
|
|
235
234
|
function ____exports.inStartingRoom(self)
|
|
236
235
|
local game = Game()
|
|
237
236
|
local level = game:GetLevel()
|
|
238
237
|
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
239
238
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
240
|
-
return
|
|
239
|
+
return roomSafeGridIndex == startingRoomGridIndex and ____exports.inDimension(nil, 0)
|
|
241
240
|
end
|
|
242
241
|
function ____exports.isAllRoomsClear(self, onlyCheckRoomTypes)
|
|
243
|
-
local
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
local ____temp_0
|
|
243
|
+
if onlyCheckRoomTypes == nil then
|
|
244
|
+
____temp_0 = nil
|
|
245
|
+
else
|
|
246
|
+
____temp_0 = __TS__New(Set, onlyCheckRoomTypes)
|
|
247
|
+
end
|
|
248
|
+
local roomTypeWhitelist = ____temp_0
|
|
249
|
+
for ____, roomDescriptor in ipairs(____exports.getRooms(nil)) do
|
|
247
250
|
do
|
|
248
251
|
local roomData = roomDescriptor.Data
|
|
249
252
|
if roomData == nil then
|
|
250
|
-
goto
|
|
253
|
+
goto __continue49
|
|
251
254
|
end
|
|
252
255
|
local roomType = roomData.Type
|
|
253
|
-
if
|
|
254
|
-
goto
|
|
256
|
+
if roomTypeWhitelist ~= nil and not roomTypeWhitelist:has(roomType) then
|
|
257
|
+
goto __continue49
|
|
255
258
|
end
|
|
256
259
|
if not roomDescriptor.Clear then
|
|
257
260
|
return false
|
|
258
261
|
end
|
|
259
262
|
end
|
|
260
|
-
::
|
|
263
|
+
::__continue49::
|
|
261
264
|
end
|
|
262
265
|
return true
|
|
263
266
|
end
|
|
@@ -290,19 +293,15 @@ function ____exports.setRoomCleared(self)
|
|
|
290
293
|
return
|
|
291
294
|
end
|
|
292
295
|
room:SetClear(true)
|
|
293
|
-
for ____, door in ipairs(
|
|
294
|
-
getDoors(nil)
|
|
295
|
-
) do
|
|
296
|
+
for ____, door in ipairs(getDoors(nil)) do
|
|
296
297
|
do
|
|
297
298
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
298
|
-
goto
|
|
299
|
+
goto __continue60
|
|
299
300
|
end
|
|
300
|
-
door
|
|
301
|
-
local sprite = door:GetSprite()
|
|
302
|
-
sprite:Play("Opened", true)
|
|
301
|
+
openDoorFast(nil, door)
|
|
303
302
|
door.ExtraVisible = false
|
|
304
303
|
end
|
|
305
|
-
::
|
|
304
|
+
::__continue60::
|
|
306
305
|
end
|
|
307
306
|
sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
308
307
|
game:ShakeScreen(0)
|
|
@@ -313,4 +312,20 @@ function ____exports.setRoomUncleared(self)
|
|
|
313
312
|
room:SetClear(false)
|
|
314
313
|
closeAllDoors(nil)
|
|
315
314
|
end
|
|
315
|
+
function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim)
|
|
316
|
+
if direction == nil then
|
|
317
|
+
direction = Direction.NO_DIRECTION
|
|
318
|
+
end
|
|
319
|
+
if roomTransitionAnim == nil then
|
|
320
|
+
roomTransitionAnim = RoomTransitionAnim.TELEPORT
|
|
321
|
+
end
|
|
322
|
+
local game = Game()
|
|
323
|
+
local level = game:GetLevel()
|
|
324
|
+
local roomData = ____exports.getRoomData(nil, roomGridIndex)
|
|
325
|
+
if roomData == nil then
|
|
326
|
+
error(("Failed to change the room to to grid index " .. tostring(roomGridIndex)) .. " because that room does not exist.")
|
|
327
|
+
end
|
|
328
|
+
level.LeaveDoor = -1
|
|
329
|
+
game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
|
|
330
|
+
end
|
|
316
331
|
return ____exports
|
|
@@ -22,14 +22,22 @@ function ____exports.spawnCollectible(self, collectibleType, position, seed, opt
|
|
|
22
22
|
error("Failed to spawn a collectible since the provided seed was 0, which is not allowed. (It will cause the game to crash.)")
|
|
23
23
|
end
|
|
24
24
|
local game = Game()
|
|
25
|
-
local collectible = game:Spawn(
|
|
25
|
+
local collectible = game:Spawn(
|
|
26
|
+
EntityType.ENTITY_PICKUP,
|
|
27
|
+
PickupVariant.PICKUP_COLLECTIBLE,
|
|
28
|
+
position,
|
|
29
|
+
Vector.Zero,
|
|
30
|
+
nil,
|
|
31
|
+
collectibleType,
|
|
32
|
+
seed
|
|
33
|
+
):ToPickup()
|
|
26
34
|
if collectible == nil then
|
|
27
35
|
error("Failed to spawn a collectible.")
|
|
28
36
|
end
|
|
29
37
|
if options then
|
|
30
38
|
collectible.OptionsPickupIndex = 1
|
|
31
39
|
end
|
|
32
|
-
if
|
|
40
|
+
if anyPlayerIs(nil, PlayerType.PLAYER_KEEPER_B) and not isQuestCollectible(nil, collectibleType) and not forceFreeItem then
|
|
33
41
|
collectible.ShopItemId = -1
|
|
34
42
|
collectible.Price = 15
|
|
35
43
|
end
|
|
@@ -24,12 +24,12 @@ end
|
|
|
24
24
|
function ____exports.getFinalFrameOfAnimation(self, sprite, animation)
|
|
25
25
|
local currentAnimation = sprite:GetAnimation()
|
|
26
26
|
local currentFrame = sprite:GetFrame()
|
|
27
|
-
if
|
|
27
|
+
if animation ~= nil and animation ~= currentAnimation then
|
|
28
28
|
sprite:SetAnimation(animation)
|
|
29
29
|
end
|
|
30
30
|
sprite:SetLastFrame()
|
|
31
31
|
local finalFrame = sprite:GetFrame()
|
|
32
|
-
if
|
|
32
|
+
if animation ~= nil and animation ~= currentAnimation then
|
|
33
33
|
sprite:Play(currentAnimation, true)
|
|
34
34
|
end
|
|
35
35
|
sprite:SetFrame(currentFrame)
|
package/dist/functions/stage.lua
CHANGED
|
@@ -6,7 +6,7 @@ function ____exports.onRepentanceStage(self)
|
|
|
6
6
|
local game = Game()
|
|
7
7
|
local level = game:GetLevel()
|
|
8
8
|
local stageType = level:GetStageType()
|
|
9
|
-
return
|
|
9
|
+
return stageType == StageType.STAGETYPE_REPENTANCE or stageType == StageType.STAGETYPE_REPENTANCE_B
|
|
10
10
|
end
|
|
11
11
|
function ____exports.stageTypeToLetter(self, stageType)
|
|
12
12
|
repeat
|
|
@@ -17,31 +17,31 @@ function ____exports.stageTypeToLetter(self, stageType)
|
|
|
17
17
|
return ""
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
|
-
____cond14 = ____cond14 or
|
|
20
|
+
____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_WOTL
|
|
21
21
|
if ____cond14 then
|
|
22
22
|
do
|
|
23
23
|
return "a"
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
|
-
____cond14 = ____cond14 or
|
|
26
|
+
____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_AFTERBIRTH
|
|
27
27
|
if ____cond14 then
|
|
28
28
|
do
|
|
29
29
|
return "b"
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
|
-
____cond14 = ____cond14 or
|
|
32
|
+
____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_GREEDMODE
|
|
33
33
|
if ____cond14 then
|
|
34
34
|
do
|
|
35
35
|
return ""
|
|
36
36
|
end
|
|
37
37
|
end
|
|
38
|
-
____cond14 = ____cond14 or
|
|
38
|
+
____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_REPENTANCE
|
|
39
39
|
if ____cond14 then
|
|
40
40
|
do
|
|
41
41
|
return "c"
|
|
42
42
|
end
|
|
43
43
|
end
|
|
44
|
-
____cond14 = ____cond14 or
|
|
44
|
+
____cond14 = ____cond14 or ____switch14 == StageType.STAGETYPE_REPENTANCE_B
|
|
45
45
|
if ____cond14 then
|
|
46
46
|
do
|
|
47
47
|
return "d"
|
|
@@ -84,33 +84,33 @@ function ____exports.onCathedral(self)
|
|
|
84
84
|
local level = game:GetLevel()
|
|
85
85
|
local stage = level:GetStage()
|
|
86
86
|
local stageType = level:GetStageType()
|
|
87
|
-
return
|
|
87
|
+
return stage == 10 and stageType == 1
|
|
88
88
|
end
|
|
89
89
|
function ____exports.onChest(self)
|
|
90
90
|
local game = Game()
|
|
91
91
|
local level = game:GetLevel()
|
|
92
92
|
local stage = level:GetStage()
|
|
93
93
|
local stageType = level:GetStageType()
|
|
94
|
-
return
|
|
94
|
+
return stage == 11 and stageType == 1
|
|
95
95
|
end
|
|
96
96
|
function ____exports.onDarkRoom(self)
|
|
97
97
|
local game = Game()
|
|
98
98
|
local level = game:GetLevel()
|
|
99
99
|
local stage = level:GetStage()
|
|
100
100
|
local stageType = level:GetStageType()
|
|
101
|
-
return
|
|
101
|
+
return stage == 11 and stageType == 0
|
|
102
102
|
end
|
|
103
103
|
function ____exports.onFinalFloor(self)
|
|
104
104
|
local game = Game()
|
|
105
105
|
local level = game:GetLevel()
|
|
106
106
|
local stage = level:GetStage()
|
|
107
|
-
return
|
|
107
|
+
return stage == 11 or stage == 12 or stage == 13 or stage == 8 and ____exports.onRepentanceStage(nil)
|
|
108
108
|
end
|
|
109
109
|
function ____exports.onSheol(self)
|
|
110
110
|
local game = Game()
|
|
111
111
|
local level = game:GetLevel()
|
|
112
112
|
local stage = level:GetStage()
|
|
113
113
|
local stageType = level:GetStageType()
|
|
114
|
-
return
|
|
114
|
+
return stage == 10 and stageType == 0
|
|
115
115
|
end
|
|
116
116
|
return ____exports
|
package/dist/functions/tears.lua
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
2
|
local ____exports = {}
|
|
3
3
|
function ____exports.getFireDelay(self, tearsStat)
|
|
4
|
-
return math.max(
|
|
4
|
+
return math.max(30 / tearsStat - 1, -0.9999)
|
|
5
5
|
end
|
|
6
6
|
function ____exports.getTearsStat(self, fireDelay)
|
|
7
7
|
return 30 / (fireDelay + 1)
|
|
@@ -8,15 +8,11 @@ local ____transformationNameMap = require("maps.transformationNameMap")
|
|
|
8
8
|
local TRANSFORMATION_NAME_MAP = ____transformationNameMap.TRANSFORMATION_NAME_MAP
|
|
9
9
|
function ____exports.getPlayerNumTransformationCollectibles(self, player, playerForm)
|
|
10
10
|
if TRANSFORMATIONS_NOT_BASED_ON_ITEMS:has(playerForm) then
|
|
11
|
-
error(
|
|
12
|
-
("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function."
|
|
13
|
-
)
|
|
11
|
+
error(("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function.")
|
|
14
12
|
end
|
|
15
13
|
local itemsForTransformation = TRANSFORMATION_TO_ITEMS_MAP:get(playerForm)
|
|
16
14
|
if itemsForTransformation == nil then
|
|
17
|
-
error(
|
|
18
|
-
("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum."
|
|
19
|
-
)
|
|
15
|
+
error(("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum.")
|
|
20
16
|
end
|
|
21
17
|
local numCollectibles = 0
|
|
22
18
|
for ____, collectibleType in ipairs(itemsForTransformation) do
|
|
@@ -26,13 +22,11 @@ function ____exports.getPlayerNumTransformationCollectibles(self, player, player
|
|
|
26
22
|
end
|
|
27
23
|
function ____exports.getTransformationsForItem(self, collectibleType)
|
|
28
24
|
local transformations = ITEM_TO_TRANSFORMATION_MAP:get(collectibleType)
|
|
29
|
-
return
|
|
30
|
-
table.unpack(transformations)
|
|
31
|
-
})
|
|
25
|
+
return transformations == nil and ({}) or ({table.unpack(transformations)})
|
|
32
26
|
end
|
|
33
27
|
function ____exports.getTransformationName(self, transformation)
|
|
34
28
|
local defaultName = "Unknown"
|
|
35
29
|
local transformationName = TRANSFORMATION_NAME_MAP:get(transformation)
|
|
36
|
-
return
|
|
30
|
+
return transformationName == nil and defaultName or transformationName
|
|
37
31
|
end
|
|
38
32
|
return ____exports
|
|
@@ -14,11 +14,11 @@ function ____exports.temporarilyRemoveTrinket(self, player, trinketType)
|
|
|
14
14
|
numTrinkets = numTrinkets + 1
|
|
15
15
|
end
|
|
16
16
|
local numSmeltedTrinkets = numTrinkets
|
|
17
|
-
local trinketWasInSlot1 =
|
|
17
|
+
local trinketWasInSlot1 = trinket1 == trinketType or trinket1 + GOLDEN_TRINKET_SHIFT == trinketType
|
|
18
18
|
if trinketWasInSlot1 then
|
|
19
19
|
numSmeltedTrinkets = numSmeltedTrinkets - 1
|
|
20
20
|
end
|
|
21
|
-
local trinketWasInSlot2 =
|
|
21
|
+
local trinketWasInSlot2 = trinket2 == trinketType or trinket2 + GOLDEN_TRINKET_SHIFT == trinketType
|
|
22
22
|
if trinketWasInSlot2 then
|
|
23
23
|
numSmeltedTrinkets = numSmeltedTrinkets - 1
|
|
24
24
|
end
|
|
@@ -27,7 +27,7 @@ end
|
|
|
27
27
|
function ____exports.temporarilyRemoveTrinkets(self, player)
|
|
28
28
|
local trinket1 = player:GetTrinket(0)
|
|
29
29
|
local trinket2 = player:GetTrinket(1)
|
|
30
|
-
if
|
|
30
|
+
if trinket1 == TrinketType.TRINKET_NULL and trinket2 == TrinketType.TRINKET_NULL then
|
|
31
31
|
return nil
|
|
32
32
|
end
|
|
33
33
|
if trinket1 ~= TrinketType.TRINKET_NULL then
|
|
@@ -19,17 +19,15 @@ function ____exports.getOpenTrinketSlot(self, player)
|
|
|
19
19
|
local trinket0 = player:GetTrinket(0)
|
|
20
20
|
local trinket1 = player:GetTrinket(1)
|
|
21
21
|
if maxTrinkets == 1 then
|
|
22
|
-
return
|
|
22
|
+
return trinket0 == TrinketType.TRINKET_NULL and 0 or nil
|
|
23
23
|
end
|
|
24
24
|
if maxTrinkets == 2 then
|
|
25
25
|
if trinket0 == TrinketType.TRINKET_NULL then
|
|
26
26
|
return 0
|
|
27
27
|
end
|
|
28
|
-
return
|
|
28
|
+
return trinket1 == TrinketType.TRINKET_NULL and 1 or nil
|
|
29
29
|
end
|
|
30
|
-
error(
|
|
31
|
-
"The player has an unknown number of trinket slots: " .. tostring(maxTrinkets)
|
|
32
|
-
)
|
|
30
|
+
error("The player has an unknown number of trinket slots: " .. tostring(maxTrinkets))
|
|
33
31
|
return nil
|
|
34
32
|
end
|
|
35
33
|
function ____exports.getTrinkets(self, matchingSubType)
|
|
@@ -98,7 +96,13 @@ function ____exports.smeltTrinket(self, player, trinketType, numTrinkets)
|
|
|
98
96
|
local i = 0
|
|
99
97
|
while i < numTrinkets do
|
|
100
98
|
player:AddTrinket(trinketType)
|
|
101
|
-
player:UseActiveItem(
|
|
99
|
+
player:UseActiveItem(
|
|
100
|
+
CollectibleType.COLLECTIBLE_SMELTER,
|
|
101
|
+
false,
|
|
102
|
+
false,
|
|
103
|
+
true,
|
|
104
|
+
false
|
|
105
|
+
)
|
|
102
106
|
i = i + 1
|
|
103
107
|
end
|
|
104
108
|
end
|
package/dist/functions/ui.lua
CHANGED
|
@@ -16,14 +16,14 @@ function ____exports.getHeartsUIWidth(self)
|
|
|
16
16
|
local soulHearts = player:GetSoulHearts()
|
|
17
17
|
local boneHearts = player:GetBoneHearts()
|
|
18
18
|
local extraLives = player:GetExtraLives()
|
|
19
|
-
local combinedHearts =
|
|
19
|
+
local combinedHearts = maxHearts + soulHearts + boneHearts * 2
|
|
20
20
|
if combinedHearts > 12 then
|
|
21
21
|
combinedHearts = 12
|
|
22
22
|
end
|
|
23
23
|
if curses == LevelCurse.CURSE_OF_THE_UNKNOWN then
|
|
24
24
|
combinedHearts = 2
|
|
25
25
|
end
|
|
26
|
-
local width =
|
|
26
|
+
local width = combinedHearts / 2 * UI_HEART_WIDTH
|
|
27
27
|
if extraLives > 9 then
|
|
28
28
|
width = width + 20
|
|
29
29
|
if player:HasCollectible(CollectibleType.COLLECTIBLE_GUPPYS_COLLAR) then
|
|
@@ -40,7 +40,7 @@ end
|
|
|
40
40
|
function ____exports.getHUDOffsetVector(self)
|
|
41
41
|
local defaultVector = Vector.Zero
|
|
42
42
|
local hudOffset = math.floor(Options.HUDOffset * 10)
|
|
43
|
-
if
|
|
43
|
+
if hudOffset < 1 or hudOffset > 10 then
|
|
44
44
|
return defaultVector
|
|
45
45
|
end
|
|
46
46
|
local x = hudOffset * 2
|
package/dist/functions/util.d.ts
CHANGED
|
@@ -90,14 +90,3 @@ export declare function printConsole(msg: string): void;
|
|
|
90
90
|
* `clear` method does not exist. Use this helper function as a drop-in replacement for this.
|
|
91
91
|
*/
|
|
92
92
|
export declare function tableClear(table: LuaTable): void;
|
|
93
|
-
/**
|
|
94
|
-
* Helper function to change the current room. It can be used for both teleportation and "normal"
|
|
95
|
-
* room transitions, depending on what is passed for the `direction` and `roomTransitionAnim`
|
|
96
|
-
* arguments. Use this function instead of invoking `Game.StartRoomTransition()` directly so that
|
|
97
|
-
* you don't forget to set `Level.LeaveDoor` property.
|
|
98
|
-
*
|
|
99
|
-
* @param roomGridIndex The room grid index of the destination room.
|
|
100
|
-
* @param direction Optional. Default is `Direction.NO_DIRECTION`.
|
|
101
|
-
* @param roomTransitionAnim Optional. Default is `RoomTransitionAnim.TELEPORT`.
|
|
102
|
-
*/
|
|
103
|
-
export declare function teleport(roomGridIndex: int, direction?: Direction, roomTransitionAnim?: RoomTransitionAnim): void;
|
package/dist/functions/util.lua
CHANGED
|
@@ -4,22 +4,16 @@ local ____exports = {}
|
|
|
4
4
|
local HEX_STRING_LENGTH = 6
|
|
5
5
|
function ____exports.copyMap(self, oldMap)
|
|
6
6
|
local newMap = __TS__New(Map)
|
|
7
|
-
for ____, ____value in __TS__Iterator(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
local key
|
|
11
|
-
key = ____value[1]
|
|
12
|
-
local value
|
|
13
|
-
value = ____value[2]
|
|
7
|
+
for ____, ____value in __TS__Iterator(oldMap:entries()) do
|
|
8
|
+
local key = ____value[1]
|
|
9
|
+
local value = ____value[2]
|
|
14
10
|
newMap:set(key, value)
|
|
15
11
|
end
|
|
16
12
|
return newMap
|
|
17
13
|
end
|
|
18
14
|
function ____exports.copySet(self, oldSet)
|
|
19
15
|
local newSet = __TS__New(Set)
|
|
20
|
-
for ____, value in __TS__Iterator(
|
|
21
|
-
oldSet:values()
|
|
22
|
-
) do
|
|
16
|
+
for ____, value in __TS__Iterator(oldSet:values()) do
|
|
23
17
|
newSet:add(value)
|
|
24
18
|
end
|
|
25
19
|
return newSet
|
|
@@ -38,9 +32,7 @@ end
|
|
|
38
32
|
function ____exports.hexToKColor(self, hexString, alpha)
|
|
39
33
|
hexString = __TS__StringReplace(hexString, "#", "")
|
|
40
34
|
if #hexString ~= HEX_STRING_LENGTH then
|
|
41
|
-
error(
|
|
42
|
-
("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. "."
|
|
43
|
-
)
|
|
35
|
+
error(("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. ".")
|
|
44
36
|
end
|
|
45
37
|
local rString = __TS__StringSubstr(hexString, 0, 2)
|
|
46
38
|
local R = tonumber("0x" .. rString)
|
|
@@ -68,7 +60,7 @@ function ____exports.onSetSeed(self)
|
|
|
68
60
|
local seeds = game:GetSeeds()
|
|
69
61
|
local customRun = seeds:IsCustomRun()
|
|
70
62
|
local challenge = Isaac.GetChallenge()
|
|
71
|
-
return
|
|
63
|
+
return challenge == Challenge.CHALLENGE_NULL and customRun
|
|
72
64
|
end
|
|
73
65
|
function ____exports.printConsole(self, msg)
|
|
74
66
|
Isaac.ConsoleOutput(msg .. "\n")
|
|
@@ -78,16 +70,4 @@ function ____exports.tableClear(self, ____table)
|
|
|
78
70
|
____table[key] = nil
|
|
79
71
|
end
|
|
80
72
|
end
|
|
81
|
-
function ____exports.teleport(self, roomGridIndex, direction, roomTransitionAnim)
|
|
82
|
-
if direction == nil then
|
|
83
|
-
direction = Direction.NO_DIRECTION
|
|
84
|
-
end
|
|
85
|
-
if roomTransitionAnim == nil then
|
|
86
|
-
roomTransitionAnim = RoomTransitionAnim.TELEPORT
|
|
87
|
-
end
|
|
88
|
-
local game = Game()
|
|
89
|
-
local level = game:GetLevel()
|
|
90
|
-
level.LeaveDoor = -1
|
|
91
|
-
game:StartRoomTransition(roomGridIndex, direction, roomTransitionAnim)
|
|
92
|
-
end
|
|
93
73
|
return ____exports
|
|
@@ -14,25 +14,25 @@ function ____exports.directionToVector(self, direction)
|
|
|
14
14
|
return Vector(0, 1)
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
|
-
____cond4 = ____cond4 or
|
|
17
|
+
____cond4 = ____cond4 or ____switch4 == Direction.LEFT
|
|
18
18
|
if ____cond4 then
|
|
19
19
|
do
|
|
20
20
|
return Vector(-1, 0)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
____cond4 = ____cond4 or
|
|
23
|
+
____cond4 = ____cond4 or ____switch4 == Direction.RIGHT
|
|
24
24
|
if ____cond4 then
|
|
25
25
|
do
|
|
26
26
|
return Vector(1, 0)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
|
-
____cond4 = ____cond4 or
|
|
29
|
+
____cond4 = ____cond4 or ____switch4 == Direction.UP
|
|
30
30
|
if ____cond4 then
|
|
31
31
|
do
|
|
32
32
|
return Vector(0, -1)
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
|
-
____cond4 = ____cond4 or
|
|
35
|
+
____cond4 = ____cond4 or ____switch4 == Direction.NO_DIRECTION
|
|
36
36
|
if ____cond4 then
|
|
37
37
|
do
|
|
38
38
|
return Vector.Zero
|
|
@@ -66,16 +66,16 @@ function ____exports.isVector(self, object)
|
|
|
66
66
|
end
|
|
67
67
|
function ____exports.vectorToDirection(self, vector)
|
|
68
68
|
local degrees = vector:GetAngleDegrees()
|
|
69
|
-
if
|
|
69
|
+
if degrees > -45 and degrees < 45 then
|
|
70
70
|
return Direction.RIGHT
|
|
71
71
|
end
|
|
72
|
-
if
|
|
72
|
+
if degrees >= 45 and degrees <= 135 then
|
|
73
73
|
return Direction.DOWN
|
|
74
74
|
end
|
|
75
|
-
if
|
|
75
|
+
if degrees <= -45 and degrees >= -135 then
|
|
76
76
|
return Direction.UP
|
|
77
77
|
end
|
|
78
|
-
if
|
|
78
|
+
if degrees > 135 or degrees < -135 then
|
|
79
79
|
return Direction.LEFT
|
|
80
80
|
end
|
|
81
81
|
return Direction.NO_DIRECTION
|