isaacscript-common 1.0.512 → 1.0.513
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 +6 -2
- package/dist/callbacks/postBombInitLate.lua +5 -1
- package/dist/callbacks/postCursedTeleport.lua +10 -8
- package/dist/callbacks/postEffectInitLate.lua +5 -1
- package/dist/callbacks/postEsauJr.lua +4 -2
- package/dist/callbacks/postFamiliarInitLate.lua +5 -1
- package/dist/callbacks/postFlip.lua +4 -2
- package/dist/callbacks/postGridEntity.lua +18 -8
- package/dist/callbacks/postKnifeInitLate.lua +5 -1
- package/dist/callbacks/postLaserInitLate.lua +5 -1
- package/dist/callbacks/postNPCInitLate.lua +5 -1
- package/dist/callbacks/postPickupCollect.lua +5 -1
- package/dist/callbacks/postPickupInitLate.lua +5 -1
- package/dist/callbacks/postPlayerChangeHealth.lua +13 -9
- package/dist/callbacks/postPlayerChangeType.lua +5 -1
- package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
- package/dist/callbacks/postPlayerInitLate.lua +5 -1
- package/dist/callbacks/postPlayerReordered.lua +1 -1
- package/dist/callbacks/postProjectileInitLate.lua +5 -1
- package/dist/callbacks/postPurchase.lua +15 -17
- package/dist/callbacks/postSacrifice.lua +3 -3
- package/dist/callbacks/postSlotInitUpdate.lua +11 -3
- package/dist/callbacks/postSlotRenderBroken.lua +8 -2
- package/dist/callbacks/postTearInitLate.lua +5 -1
- package/dist/callbacks/postTransformation.lua +5 -1
- package/dist/callbacks/reorderedCallbacks.lua +4 -4
- package/dist/callbacks/subscriptions/postBombInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postCursedTeleport.lua +1 -1
- package/dist/callbacks/subscriptions/postCustomRevive.lua +3 -3
- package/dist/callbacks/subscriptions/postEffectInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postEsauJr.lua +1 -1
- package/dist/callbacks/subscriptions/postFamiliarInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postFirstEsauJr.lua +1 -1
- package/dist/callbacks/subscriptions/postFirstFlip.lua +1 -1
- package/dist/callbacks/subscriptions/postFlip.lua +1 -1
- package/dist/callbacks/subscriptions/postGameStartedReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postGridEntityInit.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityRemove.lua +3 -3
- package/dist/callbacks/subscriptions/postGridEntityUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postItemPickup.lua +5 -5
- package/dist/callbacks/subscriptions/postKnifeInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postLaserInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNPCInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postNewLevelReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postNewRoomEarly.lua +1 -1
- package/dist/callbacks/subscriptions/postNewRoomReordered.lua +1 -1
- package/dist/callbacks/subscriptions/postPickupCollect.lua +3 -3
- package/dist/callbacks/subscriptions/postPickupInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeHealth.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerChangeType.lua +1 -1
- package/dist/callbacks/subscriptions/postPlayerFatalDamage.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerInitReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerRenderReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postPlayerUpdateReordered.lua +3 -3
- package/dist/callbacks/subscriptions/postProjectileInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postPurchase.lua +2 -8
- package/dist/callbacks/subscriptions/postSacrifice.lua +1 -1
- package/dist/callbacks/subscriptions/postSlotDestroyed.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotInit.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotRender.lua +3 -3
- package/dist/callbacks/subscriptions/postSlotUpdate.lua +3 -3
- package/dist/callbacks/subscriptions/postTearInitLate.lua +3 -3
- package/dist/callbacks/subscriptions/postTransformation.lua +3 -3
- package/dist/callbacks/subscriptions/preCustomRevive.lua +1 -1
- package/dist/callbacks/subscriptions/preItemPickup.lua +5 -5
- package/dist/constants.lua +5 -47
- package/dist/features/deployJSONRoom.lua +61 -90
- package/dist/features/disableInputs.lua +3 -9
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +10 -4
- package/dist/features/preventCollectibleRotate.lua +9 -3
- package/dist/features/saveDataManager/load.lua +6 -2
- package/dist/features/saveDataManager/main.lua +1 -1
- package/dist/features/saveDataManager/merge.lua +4 -2
- package/dist/features/sirenHelpers.lua +5 -5
- package/dist/functions/array.lua +7 -5
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/charge.lua +12 -10
- package/dist/functions/collectibles.lua +23 -18
- package/dist/functions/color.lua +1 -9
- package/dist/functions/deepCopy.lua +22 -42
- package/dist/functions/deepCopyTests.lua +20 -12
- package/dist/functions/doors.lua +19 -7
- package/dist/functions/entity.lua +2 -8
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/gridEntity.lua +9 -14
- package/dist/functions/input.lua +18 -14
- package/dist/functions/jsonRoom.lua +9 -3
- package/dist/functions/language.lua +1 -9
- package/dist/functions/log.lua +46 -18
- package/dist/functions/math.lua +17 -15
- package/dist/functions/npc.lua +17 -15
- package/dist/functions/pickups.lua +1 -14
- package/dist/functions/player.lua +47 -25
- package/dist/functions/playerHealth.lua +9 -19
- 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 +5 -0
- package/dist/functions/rooms.lua +27 -15
- package/dist/functions/spawnCollectible.lua +2 -10
- package/dist/functions/sprite.lua +2 -2
- package/dist/functions/stage.lua +6 -6
- package/dist/functions/tears.lua +1 -1
- package/dist/functions/transformations.lua +10 -4
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.lua +5 -3
- package/dist/functions/ui.lua +3 -3
- package/dist/functions/util.lua +8 -4
- package/dist/functions/vector.lua +8 -8
- package/dist/lualib_bundle.lua +555 -603
- package/dist/maps/cardDescriptionMap.lua +1 -99
- package/dist/maps/cardNameMap.lua +1 -99
- package/dist/maps/collectibleDescriptionMap.lua +1 -722
- package/dist/maps/collectibleNameMap.lua +1 -722
- package/dist/maps/gridEntityXMLMap.lua +1 -36
- package/dist/maps/pillEffectNameMap.lua +1 -52
- package/dist/maps/roomShapeToTopLeftWallGridIndexMap.lua +1 -7
- package/dist/maps/transformationMap.lua +12 -19
- package/dist/maps/trinketDescriptionMap.lua +1 -190
- package/dist/maps/trinketNameMap.lua +1 -190
- package/dist/sets/cards.lua +2 -98
- package/dist/types/ModUpgraded.lua +50 -44
- package/package.json +2 -2
|
@@ -121,6 +121,11 @@ export declare function inDimension(dimension: Dimension): boolean;
|
|
|
121
121
|
/** Helper function to determine if the current room shape is one of the four L room shapes. */
|
|
122
122
|
export declare function inLRoom(): boolean;
|
|
123
123
|
export declare function inGenesisRoom(): boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Helper function to check if the current room is a miniboss room for a particular miniboss. This
|
|
126
|
+
* will only work for minibosses that have dedicated boss rooms in the "00.special rooms.stb" file.
|
|
127
|
+
*/
|
|
128
|
+
export declare function inMinibossRoomOf(minibossID: MinibossID): boolean;
|
|
124
129
|
/**
|
|
125
130
|
* Helper function to determine whether or not the current room is the starting room of a floor.
|
|
126
131
|
* Only returns true for the starting room of the primary dimension (meaning that being in the
|
package/dist/functions/rooms.lua
CHANGED
|
@@ -47,7 +47,7 @@ end
|
|
|
47
47
|
function ____exports.inDeathCertificateArea(self)
|
|
48
48
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
49
49
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
50
|
-
return roomStageID == 35 and (roomSubType == 33 or roomSubType == 33)
|
|
50
|
+
return (roomStageID == 35) and ((roomSubType == 33) or (roomSubType == 33))
|
|
51
51
|
end
|
|
52
52
|
function ____exports.changeRoom(self, roomGridIndex)
|
|
53
53
|
local game = Game()
|
|
@@ -75,7 +75,9 @@ function ____exports.getCurrentDimension(self)
|
|
|
75
75
|
dimension = dimension + 1
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
|
-
error(
|
|
78
|
+
error(
|
|
79
|
+
"Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomGridIndex)
|
|
80
|
+
)
|
|
79
81
|
return 0
|
|
80
82
|
end
|
|
81
83
|
function ____exports.getRoomDataType(self)
|
|
@@ -99,7 +101,7 @@ function ____exports.getRoomGridIndexesForType(self, roomType)
|
|
|
99
101
|
local i = 0
|
|
100
102
|
while i <= MAX_ROOM_INDEX do
|
|
101
103
|
local room = level:GetRoomByIdx(i)
|
|
102
|
-
if room ~= nil and room.Data ~= nil and room.Data.Type == roomType then
|
|
104
|
+
if ((room ~= nil) and (room.Data ~= nil)) and (room.Data.Type == roomType) then
|
|
103
105
|
__TS__ArrayPush(roomGridIndexes, room.SafeGridIndex)
|
|
104
106
|
end
|
|
105
107
|
i = i + 1
|
|
@@ -140,26 +142,26 @@ function ____exports.gridToPos(self, x, y)
|
|
|
140
142
|
local room = game:GetRoom()
|
|
141
143
|
x = x + 1
|
|
142
144
|
y = y + 1
|
|
143
|
-
local gridIndex = y * room:GetGridWidth() + x
|
|
145
|
+
local gridIndex = (y * room:GetGridWidth()) + x
|
|
144
146
|
return room:GetGridPosition(gridIndex)
|
|
145
147
|
end
|
|
146
148
|
function ____exports.in2x1Room(self)
|
|
147
149
|
local game = Game()
|
|
148
150
|
local room = game:GetRoom()
|
|
149
151
|
local roomShape = room:GetRoomShape()
|
|
150
|
-
return roomShape == RoomShape.ROOMSHAPE_1x2 or roomShape == RoomShape.ROOMSHAPE_2x1
|
|
152
|
+
return (roomShape == RoomShape.ROOMSHAPE_1x2) or (roomShape == RoomShape.ROOMSHAPE_2x1)
|
|
151
153
|
end
|
|
152
154
|
function ____exports.inAngelShop(self)
|
|
153
155
|
local game = Game()
|
|
154
156
|
local room = game:GetRoom()
|
|
155
157
|
local roomType = room:GetType()
|
|
156
158
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
157
|
-
return roomType == RoomType.ROOM_ANGEL and roomSubType == 1
|
|
159
|
+
return (roomType == RoomType.ROOM_ANGEL) and (roomSubType == 1)
|
|
158
160
|
end
|
|
159
161
|
function ____exports.inBeastRoom(self)
|
|
160
162
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
161
163
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
162
|
-
return roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType == 4
|
|
164
|
+
return (roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType == 4)
|
|
163
165
|
end
|
|
164
166
|
function ____exports.inBossRoomOf(self, bossID)
|
|
165
167
|
local game = Game()
|
|
@@ -167,12 +169,12 @@ function ____exports.inBossRoomOf(self, bossID)
|
|
|
167
169
|
local roomType = room:GetType()
|
|
168
170
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
169
171
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
170
|
-
return roomType == RoomType.ROOM_BOSS and roomStageID == 0 and roomSubType == bossID
|
|
172
|
+
return ((roomType == RoomType.ROOM_BOSS) and (roomStageID == 0)) and (roomSubType == bossID)
|
|
171
173
|
end
|
|
172
174
|
function ____exports.inCrawlspace(self)
|
|
173
175
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
174
176
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
175
|
-
return roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType ~= 4
|
|
177
|
+
return (roomSafeGridIndex == GridRooms.ROOM_DUNGEON_IDX) and (roomSubType ~= 4)
|
|
176
178
|
end
|
|
177
179
|
function ____exports.inDevilsCrownTreasureRoom(self)
|
|
178
180
|
local game = Game()
|
|
@@ -187,7 +189,7 @@ function ____exports.inLRoom(self)
|
|
|
187
189
|
local game = Game()
|
|
188
190
|
local room = game:GetRoom()
|
|
189
191
|
local roomShape = room:GetRoomShape()
|
|
190
|
-
return roomShape == RoomShape.ROOMSHAPE_LTL or roomShape == RoomShape.ROOMSHAPE_LTR or roomShape == RoomShape.ROOMSHAPE_LBL or roomShape == RoomShape.ROOMSHAPE_LBR
|
|
192
|
+
return (((roomShape == RoomShape.ROOMSHAPE_LTL) or (roomShape == RoomShape.ROOMSHAPE_LTR)) or (roomShape == RoomShape.ROOMSHAPE_LBL)) or (roomShape == RoomShape.ROOMSHAPE_LBR)
|
|
191
193
|
end
|
|
192
194
|
function ____exports.inGenesisRoom(self)
|
|
193
195
|
local game = Game()
|
|
@@ -195,14 +197,22 @@ function ____exports.inGenesisRoom(self)
|
|
|
195
197
|
local roomType = room:GetType()
|
|
196
198
|
local roomVariant = ____exports.getRoomVariant(nil)
|
|
197
199
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
198
|
-
return roomType == RoomType.ROOM_ISAACS and roomVariant == GENESIS_ROOM_VARIANT and roomSubType == GENESIS_ROOM_SUBTYPE
|
|
200
|
+
return ((roomType == RoomType.ROOM_ISAACS) and (roomVariant == GENESIS_ROOM_VARIANT)) and (roomSubType == GENESIS_ROOM_SUBTYPE)
|
|
201
|
+
end
|
|
202
|
+
function ____exports.inMinibossRoomOf(self, minibossID)
|
|
203
|
+
local game = Game()
|
|
204
|
+
local room = game:GetRoom()
|
|
205
|
+
local roomType = room:GetType()
|
|
206
|
+
local roomStageID = ____exports.getRoomStageID(nil)
|
|
207
|
+
local roomSubType = ____exports.getRoomSubType(nil)
|
|
208
|
+
return ((roomType == RoomType.ROOM_MINIBOSS) and (roomStageID == 0)) and (roomSubType == minibossID)
|
|
199
209
|
end
|
|
200
210
|
function ____exports.inStartingRoom(self)
|
|
201
211
|
local game = Game()
|
|
202
212
|
local level = game:GetLevel()
|
|
203
213
|
local startingRoomGridIndex = level:GetStartingRoomIndex()
|
|
204
214
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
205
|
-
return roomSafeGridIndex == startingRoomGridIndex and ____exports.inDimension(nil, 0)
|
|
215
|
+
return (roomSafeGridIndex == startingRoomGridIndex) and ____exports.inDimension(nil, 0)
|
|
206
216
|
end
|
|
207
217
|
function ____exports.isRoomInsideMap(self)
|
|
208
218
|
local roomSafeGridIndex = ____exports.getRoomSafeGridIndex(nil)
|
|
@@ -227,17 +237,19 @@ function ____exports.setRoomCleared(self)
|
|
|
227
237
|
return
|
|
228
238
|
end
|
|
229
239
|
room:SetClear(true)
|
|
230
|
-
for ____, door in ipairs(
|
|
240
|
+
for ____, door in ipairs(
|
|
241
|
+
getDoors(nil)
|
|
242
|
+
) do
|
|
231
243
|
do
|
|
232
244
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
233
|
-
goto
|
|
245
|
+
goto __continue42
|
|
234
246
|
end
|
|
235
247
|
door.State = DoorState.STATE_OPEN
|
|
236
248
|
local sprite = door:GetSprite()
|
|
237
249
|
sprite:Play("Opened", true)
|
|
238
250
|
door.ExtraVisible = false
|
|
239
251
|
end
|
|
240
|
-
::
|
|
252
|
+
::__continue42::
|
|
241
253
|
end
|
|
242
254
|
sfx:Stop(SoundEffect.SOUND_DOOR_HEAVY_OPEN)
|
|
243
255
|
game:ShakeScreen(0)
|
|
@@ -22,22 +22,14 @@ 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(
|
|
26
|
-
EntityType.ENTITY_PICKUP,
|
|
27
|
-
PickupVariant.PICKUP_COLLECTIBLE,
|
|
28
|
-
position,
|
|
29
|
-
Vector.Zero,
|
|
30
|
-
nil,
|
|
31
|
-
collectibleType,
|
|
32
|
-
seed
|
|
33
|
-
):ToPickup()
|
|
25
|
+
local collectible = game:Spawn(EntityType.ENTITY_PICKUP, PickupVariant.PICKUP_COLLECTIBLE, position, Vector.Zero, nil, collectibleType, seed):ToPickup()
|
|
34
26
|
if collectible == nil then
|
|
35
27
|
error("Failed to spawn a collectible.")
|
|
36
28
|
end
|
|
37
29
|
if options then
|
|
38
30
|
collectible.OptionsPickupIndex = 1
|
|
39
31
|
end
|
|
40
|
-
if anyPlayerIs(nil, PlayerType.PLAYER_KEEPER_B) and not isQuestCollectible(nil, collectibleType) and not forceFreeItem then
|
|
32
|
+
if (anyPlayerIs(nil, PlayerType.PLAYER_KEEPER_B) and (not isQuestCollectible(nil, collectibleType))) and (not forceFreeItem) then
|
|
41
33
|
collectible.ShopItemId = -1
|
|
42
34
|
collectible.Price = 15
|
|
43
35
|
end
|
|
@@ -12,12 +12,12 @@ end
|
|
|
12
12
|
function ____exports.getFinalFrameOfAnimation(self, sprite, animation)
|
|
13
13
|
local currentAnimation = sprite:GetAnimation()
|
|
14
14
|
local currentFrame = sprite:GetFrame()
|
|
15
|
-
if animation ~= nil and animation ~= currentAnimation then
|
|
15
|
+
if (animation ~= nil) and (animation ~= currentAnimation) then
|
|
16
16
|
sprite:SetAnimation(animation)
|
|
17
17
|
end
|
|
18
18
|
sprite:SetLastFrame()
|
|
19
19
|
local finalFrame = sprite:GetFrame()
|
|
20
|
-
if animation ~= nil and animation ~= currentAnimation then
|
|
20
|
+
if (animation ~= nil) and (animation ~= currentAnimation) then
|
|
21
21
|
sprite:Play(currentAnimation, true)
|
|
22
22
|
end
|
|
23
23
|
sprite:SetFrame(currentFrame)
|
package/dist/functions/stage.lua
CHANGED
|
@@ -4,7 +4,7 @@ function ____exports.onRepentanceStage(self)
|
|
|
4
4
|
local game = Game()
|
|
5
5
|
local level = game:GetLevel()
|
|
6
6
|
local stageType = level:GetStageType()
|
|
7
|
-
return stageType == StageType.STAGETYPE_REPENTANCE or stageType == StageType.STAGETYPE_REPENTANCE_B
|
|
7
|
+
return (stageType == StageType.STAGETYPE_REPENTANCE) or (stageType == StageType.STAGETYPE_REPENTANCE_B)
|
|
8
8
|
end
|
|
9
9
|
function ____exports.getEffectiveStage(self)
|
|
10
10
|
local game = Game()
|
|
@@ -20,33 +20,33 @@ function ____exports.onCathedral(self)
|
|
|
20
20
|
local level = game:GetLevel()
|
|
21
21
|
local stage = level:GetStage()
|
|
22
22
|
local stageType = level:GetStageType()
|
|
23
|
-
return stage == 10 and stageType == 1
|
|
23
|
+
return (stage == 10) and (stageType == 1)
|
|
24
24
|
end
|
|
25
25
|
function ____exports.onChest(self)
|
|
26
26
|
local game = Game()
|
|
27
27
|
local level = game:GetLevel()
|
|
28
28
|
local stage = level:GetStage()
|
|
29
29
|
local stageType = level:GetStageType()
|
|
30
|
-
return stage == 11 and stageType == 1
|
|
30
|
+
return (stage == 11) and (stageType == 1)
|
|
31
31
|
end
|
|
32
32
|
function ____exports.onDarkRoom(self)
|
|
33
33
|
local game = Game()
|
|
34
34
|
local level = game:GetLevel()
|
|
35
35
|
local stage = level:GetStage()
|
|
36
36
|
local stageType = level:GetStageType()
|
|
37
|
-
return stage == 11 and stageType == 0
|
|
37
|
+
return (stage == 11) and (stageType == 0)
|
|
38
38
|
end
|
|
39
39
|
function ____exports.onFinalFloor(self)
|
|
40
40
|
local game = Game()
|
|
41
41
|
local level = game:GetLevel()
|
|
42
42
|
local stage = level:GetStage()
|
|
43
|
-
return stage == 11 or stage == 12 or stage == 13 or stage == 8 and ____exports.onRepentanceStage(nil)
|
|
43
|
+
return (((stage == 11) or (stage == 12)) or (stage == 13)) or ((stage == 8) and ____exports.onRepentanceStage(nil))
|
|
44
44
|
end
|
|
45
45
|
function ____exports.onSheol(self)
|
|
46
46
|
local game = Game()
|
|
47
47
|
local level = game:GetLevel()
|
|
48
48
|
local stage = level:GetStage()
|
|
49
49
|
local stageType = level:GetStageType()
|
|
50
|
-
return stage == 10 and stageType == 0
|
|
50
|
+
return (stage == 10) and (stageType == 0)
|
|
51
51
|
end
|
|
52
52
|
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(30 / tearsStat - 1, -0.9999)
|
|
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)
|
|
@@ -9,20 +9,26 @@ local ____util = require("functions.util")
|
|
|
9
9
|
local copySet = ____util.copySet
|
|
10
10
|
function ____exports.getPlayerNumTransformationCollectibles(self, player, playerForm)
|
|
11
11
|
if TRANSFORMATIONS_NOT_BASED_ON_ITEMS:has(playerForm) then
|
|
12
|
-
error(
|
|
12
|
+
error(
|
|
13
|
+
("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function."
|
|
14
|
+
)
|
|
13
15
|
end
|
|
14
16
|
local itemsForTransformation = TRANSFORMATION_TO_ITEMS_MAP:get(playerForm)
|
|
15
17
|
if itemsForTransformation == nil then
|
|
16
|
-
error(
|
|
18
|
+
error(
|
|
19
|
+
("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum."
|
|
20
|
+
)
|
|
17
21
|
end
|
|
18
22
|
local numCollectibles = 0
|
|
19
|
-
for ____, collectibleType in __TS__Iterator(
|
|
23
|
+
for ____, collectibleType in __TS__Iterator(
|
|
24
|
+
itemsForTransformation:values()
|
|
25
|
+
) do
|
|
20
26
|
numCollectibles = numCollectibles + player:GetCollectibleNum(collectibleType)
|
|
21
27
|
end
|
|
22
28
|
return numCollectibles
|
|
23
29
|
end
|
|
24
30
|
function ____exports.getTransformationsForItem(self, collectibleType)
|
|
25
31
|
local transformations = ITEM_TO_TRANSFORMATION_MAP:get(collectibleType)
|
|
26
|
-
return transformations == nil and __TS__New(Set) or copySet(nil, transformations)
|
|
32
|
+
return ((transformations == nil) and __TS__New(Set)) or copySet(nil, transformations)
|
|
27
33
|
end
|
|
28
34
|
return ____exports
|
|
@@ -14,11 +14,11 @@ function ____exports.temporarilyRemoveTrinkets(self, player, trinketType)
|
|
|
14
14
|
numTrinkets = numTrinkets + 1
|
|
15
15
|
end
|
|
16
16
|
local numSmeltedTrinkets = numTrinkets
|
|
17
|
-
local trinketWasInSlot1 = trinket1 == trinketType or trinket1 + GOLDEN_TRINKET_SHIFT == trinketType
|
|
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 = trinket2 == trinketType or trinket2 + GOLDEN_TRINKET_SHIFT == trinketType
|
|
21
|
+
local trinketWasInSlot2 = (trinket2 == trinketType) or ((trinket2 + GOLDEN_TRINKET_SHIFT) == trinketType)
|
|
22
22
|
if trinketWasInSlot2 then
|
|
23
23
|
numSmeltedTrinkets = numSmeltedTrinkets - 1
|
|
24
24
|
end
|
|
@@ -16,15 +16,17 @@ function ____exports.getOpenTrinketSlot(self, player)
|
|
|
16
16
|
local trinket0 = player:GetTrinket(0)
|
|
17
17
|
local trinket1 = player:GetTrinket(1)
|
|
18
18
|
if maxTrinkets == 1 then
|
|
19
|
-
return trinket0 == TrinketType.TRINKET_NULL and 0 or nil
|
|
19
|
+
return ((trinket0 == TrinketType.TRINKET_NULL) and 0) or nil
|
|
20
20
|
end
|
|
21
21
|
if maxTrinkets == 2 then
|
|
22
22
|
if trinket0 == TrinketType.TRINKET_NULL then
|
|
23
23
|
return 0
|
|
24
24
|
end
|
|
25
|
-
return trinket1 == TrinketType.TRINKET_NULL and 1 or nil
|
|
25
|
+
return ((trinket1 == TrinketType.TRINKET_NULL) and 1) or nil
|
|
26
26
|
end
|
|
27
|
-
error(
|
|
27
|
+
error(
|
|
28
|
+
"The player has an unknown number of trinket slots: " .. tostring(maxTrinkets)
|
|
29
|
+
)
|
|
28
30
|
return nil
|
|
29
31
|
end
|
|
30
32
|
function ____exports.getTrinkets(self, matchingSubType)
|
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 = maxHearts + soulHearts + boneHearts * 2
|
|
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 = combinedHearts / 2 * UI_HEART_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 hudOffset < 1 or hudOffset > 10 then
|
|
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.lua
CHANGED
|
@@ -4,7 +4,9 @@ local ____exports = {}
|
|
|
4
4
|
local HEX_STRING_LENGTH = 6
|
|
5
5
|
function ____exports.copySet(self, oldSet)
|
|
6
6
|
local newSet = __TS__New(Set)
|
|
7
|
-
for ____, value in __TS__Iterator(
|
|
7
|
+
for ____, value in __TS__Iterator(
|
|
8
|
+
oldSet:values()
|
|
9
|
+
) do
|
|
8
10
|
newSet:add(value)
|
|
9
11
|
end
|
|
10
12
|
return newSet
|
|
@@ -23,7 +25,9 @@ end
|
|
|
23
25
|
function ____exports.hexToKColor(self, hexString, alpha)
|
|
24
26
|
hexString = __TS__StringReplace(hexString, "#", "")
|
|
25
27
|
if #hexString ~= HEX_STRING_LENGTH then
|
|
26
|
-
error(
|
|
28
|
+
error(
|
|
29
|
+
("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. "."
|
|
30
|
+
)
|
|
27
31
|
end
|
|
28
32
|
local rString = __TS__StringSubstr(hexString, 0, 2)
|
|
29
33
|
local R = tonumber("0x" .. rString)
|
|
@@ -45,14 +49,14 @@ function ____exports.hexToKColor(self, hexString, alpha)
|
|
|
45
49
|
end
|
|
46
50
|
function ____exports.isGreedMode(self)
|
|
47
51
|
local game = Game()
|
|
48
|
-
return game.Difficulty == Difficulty.DIFFICULTY_GREED or game.Difficulty == Difficulty.DIFFICULTY_GREEDIER
|
|
52
|
+
return (game.Difficulty == Difficulty.DIFFICULTY_GREED) or (game.Difficulty == Difficulty.DIFFICULTY_GREEDIER)
|
|
49
53
|
end
|
|
50
54
|
function ____exports.onSetSeed(self)
|
|
51
55
|
local game = Game()
|
|
52
56
|
local seeds = game:GetSeeds()
|
|
53
57
|
local customRun = seeds:IsCustomRun()
|
|
54
58
|
local challenge = Isaac.GetChallenge()
|
|
55
|
-
return challenge == Challenge.CHALLENGE_NULL and customRun
|
|
59
|
+
return (challenge == Challenge.CHALLENGE_NULL) and customRun
|
|
56
60
|
end
|
|
57
61
|
function ____exports.printConsole(self, msg)
|
|
58
62
|
Isaac.ConsoleOutput(msg .. "\n")
|
|
@@ -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 ____switch4 == Direction.LEFT
|
|
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 ____switch4 == Direction.RIGHT
|
|
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 ____switch4 == Direction.UP
|
|
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 ____switch4 == Direction.NO_DIRECTION
|
|
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 degrees > -45 and degrees < 45 then
|
|
69
|
+
if (degrees > -45) and (degrees < 45) then
|
|
70
70
|
return Direction.RIGHT
|
|
71
71
|
end
|
|
72
|
-
if degrees >= 45 and degrees <= 135 then
|
|
72
|
+
if (degrees >= 45) and (degrees <= 135) then
|
|
73
73
|
return Direction.DOWN
|
|
74
74
|
end
|
|
75
|
-
if degrees <= -45 and degrees >= -135 then
|
|
75
|
+
if (degrees <= -45) and (degrees >= -135) then
|
|
76
76
|
return Direction.UP
|
|
77
77
|
end
|
|
78
|
-
if degrees > 135 or degrees < -135 then
|
|
78
|
+
if (degrees > 135) or (degrees < -135) then
|
|
79
79
|
return Direction.LEFT
|
|
80
80
|
end
|
|
81
81
|
return Direction.NO_DIRECTION
|