isaacscript-common 1.0.486 → 1.0.490
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/README.md +2 -0
- package/dist/callbacks/itemPickup.lua +2 -6
- package/dist/callbacks/postBombInitLate.lua +6 -8
- package/dist/callbacks/postCursedTeleport.lua +8 -10
- package/dist/callbacks/postEffectInitLate.lua +6 -8
- package/dist/callbacks/postEsauJr.lua +2 -4
- package/dist/callbacks/postFamiliarInitLate.lua +6 -8
- package/dist/callbacks/postFlip.lua +2 -4
- package/dist/callbacks/postGridEntity.lua +8 -18
- package/dist/callbacks/postKnifeInitLate.lua +6 -8
- package/dist/callbacks/postLaserInitLate.lua +6 -8
- package/dist/callbacks/postNPCInitLate.lua +6 -8
- package/dist/callbacks/postPickupCollect.lua +1 -5
- package/dist/callbacks/postPickupInitLate.lua +6 -8
- package/dist/callbacks/postPlayerChangeHealth.lua +9 -13
- package/dist/callbacks/postPlayerChangeType.lua +1 -5
- package/dist/callbacks/postPlayerFatalDamage.lua +2 -2
- package/dist/callbacks/postPlayerInitLate.lua +1 -5
- package/dist/callbacks/postPlayerReordered.lua +1 -1
- package/dist/callbacks/postProjectileInitLate.lua +6 -8
- package/dist/callbacks/postPurchase.lua +10 -14
- 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 +6 -8
- package/dist/callbacks/postTransformation.lua +1 -5
- 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/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 +8 -2
- 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.d.ts +0 -6
- package/dist/constants.lua +38 -6
- package/dist/features/deployJSONRoom.lua +90 -61
- package/dist/features/disableInputs.lua +9 -3
- package/dist/features/forgottenSwitch.lua +1 -1
- package/dist/features/getCollectibleItemPoolType.lua +10 -14
- 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 -5
- package/dist/functions/array.d.ts +19 -7
- package/dist/functions/array.lua +32 -19
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/cards.d.ts +17 -11
- package/dist/functions/cards.lua +40 -30
- package/dist/functions/charge.lua +10 -12
- package/dist/functions/collectibles.d.ts +23 -2
- package/dist/functions/collectibles.lua +26 -21
- package/dist/functions/color.lua +9 -1
- package/dist/functions/deepCopy.lua +42 -22
- package/dist/functions/deepCopyTests.lua +12 -20
- package/dist/functions/doors.lua +7 -19
- package/dist/functions/entity.lua +7 -1
- package/dist/functions/flag.lua +1 -1
- package/dist/functions/gridEntity.lua +15 -10
- package/dist/functions/input.lua +14 -18
- package/dist/functions/jsonRoom.lua +3 -9
- package/dist/functions/language.lua +9 -1
- package/dist/functions/log.lua +18 -46
- package/dist/functions/math.lua +15 -17
- package/dist/functions/npc.lua +15 -17
- package/dist/functions/pickups.d.ts +7 -2
- package/dist/functions/pickups.lua +19 -3
- package/dist/functions/pills.d.ts +1 -1
- package/dist/functions/player.lua +25 -47
- package/dist/functions/playerHealth.lua +19 -9
- package/dist/functions/pocketItems.lua +10 -10
- package/dist/functions/random.lua +2 -2
- package/dist/functions/revive.lua +4 -4
- package/dist/functions/rooms.lua +15 -18
- package/dist/functions/spawnCollectible.lua +10 -2
- 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 +4 -10
- package/dist/functions/trinketGive.lua +2 -2
- package/dist/functions/trinkets.d.ts +6 -2
- package/dist/functions/trinkets.lua +3 -5
- package/dist/functions/ui.lua +3 -3
- package/dist/functions/util.lua +4 -8
- package/dist/functions/vector.lua +8 -8
- package/dist/index.d.ts +3 -0
- package/dist/index.lua +24 -0
- package/dist/lualib_bundle.lua +603 -555
- package/dist/maps/cardDescriptionMap.lua +99 -1
- package/dist/maps/cardNameMap.lua +99 -1
- package/dist/maps/collectibleDescriptionMap.lua +722 -1
- package/dist/maps/collectibleNameMap.lua +722 -1
- package/dist/maps/gridEntityXMLMap.d.ts +6 -0
- package/dist/maps/gridEntityXMLMap.lua +40 -0
- package/dist/maps/pillEffectNameMap.lua +52 -1
- package/dist/maps/roomTypeToItemPoolMap.d.ts +2 -0
- package/dist/maps/roomTypeToItemPoolMap.lua +19 -0
- package/dist/maps/transformationMap.lua +19 -12
- package/dist/maps/trinketDescriptionMap.lua +190 -1
- package/dist/maps/trinketNameMap.lua +190 -1
- package/dist/sets/cards.d.ts +25 -0
- package/dist/sets/cards.lua +106 -0
- package/dist/types/ModUpgraded.lua +82 -166
- package/dist/types/PocketItemDescription.d.ts +1 -0
- package/package.json +5 -5
package/dist/functions/rooms.lua
CHANGED
|
@@ -6,7 +6,8 @@ local DEFAULT_ITEM_POOL_TYPE = ____constants.DEFAULT_ITEM_POOL_TYPE
|
|
|
6
6
|
local GENESIS_ROOM_SUBTYPE = ____constants.GENESIS_ROOM_SUBTYPE
|
|
7
7
|
local GENESIS_ROOM_VARIANT = ____constants.GENESIS_ROOM_VARIANT
|
|
8
8
|
local MAX_ROOM_INDEX = ____constants.MAX_ROOM_INDEX
|
|
9
|
-
local
|
|
9
|
+
local ____roomTypeToItemPoolMap = require("maps.roomTypeToItemPoolMap")
|
|
10
|
+
local ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP = ____roomTypeToItemPoolMap.ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP
|
|
10
11
|
local ____doors = require("functions.doors")
|
|
11
12
|
local closeAllDoors = ____doors.closeAllDoors
|
|
12
13
|
local getDoors = ____doors.getDoors
|
|
@@ -52,9 +53,7 @@ function ____exports.getCurrentDimension(self)
|
|
|
52
53
|
dimension = dimension + 1
|
|
53
54
|
end
|
|
54
55
|
end
|
|
55
|
-
error(
|
|
56
|
-
"Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomIndex)
|
|
57
|
-
)
|
|
56
|
+
error("Failed to get the current dimension using the starting room index of: " .. tostring(startingRoomIndex))
|
|
58
57
|
return 0
|
|
59
58
|
end
|
|
60
59
|
function ____exports.getRoomData(self)
|
|
@@ -79,7 +78,7 @@ function ____exports.getRoomIndexesForType(self, roomType)
|
|
|
79
78
|
local i = 0
|
|
80
79
|
while i <= MAX_ROOM_INDEX do
|
|
81
80
|
local room = level:GetRoomByIdx(i)
|
|
82
|
-
if
|
|
81
|
+
if room ~= nil and room.Data ~= nil and room.Data.Type == roomType then
|
|
83
82
|
roomIndexes:add(room.SafeGridIndex)
|
|
84
83
|
end
|
|
85
84
|
i = i + 1
|
|
@@ -92,7 +91,7 @@ function ____exports.getRoomItemPoolType(self)
|
|
|
92
91
|
local room = game:GetRoom()
|
|
93
92
|
local roomType = room:GetType()
|
|
94
93
|
local itemPoolType = ROOM_TYPE_TO_ITEM_POOL_TYPE_MAP:get(roomType)
|
|
95
|
-
return
|
|
94
|
+
return itemPoolType == nil and DEFAULT_ITEM_POOL_TYPE or itemPoolType
|
|
96
95
|
end
|
|
97
96
|
function ____exports.getRoomName(self)
|
|
98
97
|
local roomData = ____exports.getRoomData(nil)
|
|
@@ -133,26 +132,26 @@ function ____exports.gridToPos(self, x, y)
|
|
|
133
132
|
local room = game:GetRoom()
|
|
134
133
|
x = x + 1
|
|
135
134
|
y = y + 1
|
|
136
|
-
local gridIndex =
|
|
135
|
+
local gridIndex = y * room:GetGridWidth() + x
|
|
137
136
|
return room:GetGridPosition(gridIndex)
|
|
138
137
|
end
|
|
139
138
|
function ____exports.in2x1Room(self)
|
|
140
139
|
local game = Game()
|
|
141
140
|
local room = game:GetRoom()
|
|
142
141
|
local roomShape = room:GetRoomShape()
|
|
143
|
-
return
|
|
142
|
+
return roomShape == RoomShape.ROOMSHAPE_1x2 or roomShape == RoomShape.ROOMSHAPE_2x1
|
|
144
143
|
end
|
|
145
144
|
function ____exports.inAngelShop(self)
|
|
146
145
|
local game = Game()
|
|
147
146
|
local room = game:GetRoom()
|
|
148
147
|
local roomType = room:GetType()
|
|
149
148
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
150
|
-
return
|
|
149
|
+
return roomType == RoomType.ROOM_ANGEL and roomSubType == 1
|
|
151
150
|
end
|
|
152
151
|
function ____exports.inBeastRoom(self)
|
|
153
152
|
local roomIndex = ____exports.getRoomIndex(nil)
|
|
154
153
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
155
|
-
return
|
|
154
|
+
return roomIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType == 4
|
|
156
155
|
end
|
|
157
156
|
function ____exports.inBossRoomOf(self, bossID)
|
|
158
157
|
local game = Game()
|
|
@@ -160,17 +159,17 @@ function ____exports.inBossRoomOf(self, bossID)
|
|
|
160
159
|
local roomType = room:GetType()
|
|
161
160
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
162
161
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
163
|
-
return
|
|
162
|
+
return roomType == RoomType.ROOM_BOSS and roomStageID == 0 and roomSubType == bossID
|
|
164
163
|
end
|
|
165
164
|
function ____exports.inCrawlspace(self)
|
|
166
165
|
local roomIndex = ____exports.getRoomIndex(nil)
|
|
167
166
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
168
|
-
return
|
|
167
|
+
return roomIndex == GridRooms.ROOM_DUNGEON_IDX and roomSubType ~= 4
|
|
169
168
|
end
|
|
170
169
|
function ____exports.inDeathCertificateArea(self)
|
|
171
170
|
local roomStageID = ____exports.getRoomStageID(nil)
|
|
172
171
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
173
|
-
return
|
|
172
|
+
return roomStageID == 35 and (roomSubType == 33 or roomSubType == 33)
|
|
174
173
|
end
|
|
175
174
|
function ____exports.isDevilsCrownTreasureRoom(self)
|
|
176
175
|
local game = Game()
|
|
@@ -185,7 +184,7 @@ function ____exports.inLRoom(self)
|
|
|
185
184
|
local game = Game()
|
|
186
185
|
local room = game:GetRoom()
|
|
187
186
|
local roomShape = room:GetRoomShape()
|
|
188
|
-
return
|
|
187
|
+
return roomShape == RoomShape.ROOMSHAPE_LTL or roomShape == RoomShape.ROOMSHAPE_LTR or roomShape == RoomShape.ROOMSHAPE_LBL or roomShape == RoomShape.ROOMSHAPE_LBR
|
|
189
188
|
end
|
|
190
189
|
function ____exports.inGenesisRoom(self)
|
|
191
190
|
local game = Game()
|
|
@@ -193,7 +192,7 @@ function ____exports.inGenesisRoom(self)
|
|
|
193
192
|
local roomType = room:GetType()
|
|
194
193
|
local roomVariant = ____exports.getRoomVariant(nil)
|
|
195
194
|
local roomSubType = ____exports.getRoomSubType(nil)
|
|
196
|
-
return
|
|
195
|
+
return roomType == RoomType.ROOM_ISAACS and roomVariant == GENESIS_ROOM_VARIANT and roomSubType == GENESIS_ROOM_SUBTYPE
|
|
197
196
|
end
|
|
198
197
|
function ____exports.inStartingRoom(self)
|
|
199
198
|
local game = Game()
|
|
@@ -221,9 +220,7 @@ function ____exports.setRoomCleared(self)
|
|
|
221
220
|
return
|
|
222
221
|
end
|
|
223
222
|
room:SetClear(true)
|
|
224
|
-
for ____, door in ipairs(
|
|
225
|
-
getDoors(nil)
|
|
226
|
-
) do
|
|
223
|
+
for ____, door in ipairs(getDoors(nil)) do
|
|
227
224
|
do
|
|
228
225
|
if isHiddenSecretRoomDoor(nil, door) then
|
|
229
226
|
goto __continue39
|
|
@@ -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
|
|
@@ -3,12 +3,12 @@ local ____exports = {}
|
|
|
3
3
|
function ____exports.getFinalFrameOfAnimation(self, sprite, animation)
|
|
4
4
|
local currentAnimation = sprite:GetAnimation()
|
|
5
5
|
local currentFrame = sprite:GetFrame()
|
|
6
|
-
if
|
|
6
|
+
if animation ~= nil and animation ~= currentAnimation then
|
|
7
7
|
sprite:SetAnimation(animation)
|
|
8
8
|
end
|
|
9
9
|
sprite:SetLastFrame()
|
|
10
10
|
local finalFrame = sprite:GetFrame()
|
|
11
|
-
if
|
|
11
|
+
if animation ~= nil and animation ~= currentAnimation then
|
|
12
12
|
sprite:Play(currentAnimation, true)
|
|
13
13
|
end
|
|
14
14
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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,26 +9,20 @@ 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(
|
|
13
|
-
("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function."
|
|
14
|
-
)
|
|
12
|
+
error(("The transformation of " .. tostring(playerForm)) .. " cannot be tracked by this function.")
|
|
15
13
|
end
|
|
16
14
|
local itemsForTransformation = TRANSFORMATION_TO_ITEMS_MAP:get(playerForm)
|
|
17
15
|
if itemsForTransformation == nil then
|
|
18
|
-
error(
|
|
19
|
-
("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum."
|
|
20
|
-
)
|
|
16
|
+
error(("The transformation of " .. tostring(playerForm)) .. " is not a valid value of the PlayerForm enum.")
|
|
21
17
|
end
|
|
22
18
|
local numCollectibles = 0
|
|
23
|
-
for ____, collectibleType in __TS__Iterator(
|
|
24
|
-
itemsForTransformation:values()
|
|
25
|
-
) do
|
|
19
|
+
for ____, collectibleType in __TS__Iterator(itemsForTransformation:values()) do
|
|
26
20
|
numCollectibles = numCollectibles + player:GetCollectibleNum(collectibleType)
|
|
27
21
|
end
|
|
28
22
|
return numCollectibles
|
|
29
23
|
end
|
|
30
24
|
function ____exports.getTransformationsForItem(self, collectibleType)
|
|
31
25
|
local transformations = ITEM_TO_TRANSFORMATION_MAP:get(collectibleType)
|
|
32
|
-
return
|
|
26
|
+
return transformations == nil and __TS__New(Set) or copySet(nil, transformations)
|
|
33
27
|
end
|
|
34
28
|
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 =
|
|
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
|
|
@@ -16,10 +16,14 @@ export declare function getMaxTrinketID(): int;
|
|
|
16
16
|
export declare function getOpenTrinketSlot(player: EntityPlayer): int | undefined;
|
|
17
17
|
/** Helper function to get all of the trinket entities in the room. */
|
|
18
18
|
export declare function getTrinkets(matchingSubType?: number): EntityPickup[];
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* Helper function to get the in-game description for a trinket. Returns "Unknown" if the provided
|
|
21
|
+
* trinket type was not valid.
|
|
22
|
+
*/
|
|
20
23
|
export declare function getTrinketDescription(trinketType: TrinketType | int): string;
|
|
21
24
|
/**
|
|
22
|
-
*
|
|
25
|
+
* Helper function to get the name of a trinket. Returns "Unknown" if the provided trinket type is
|
|
26
|
+
* not valid.
|
|
23
27
|
*
|
|
24
28
|
* Example:
|
|
25
29
|
* ```
|
|
@@ -16,17 +16,15 @@ 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
|
|
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
|
|
25
|
+
return trinket1 == TrinketType.TRINKET_NULL and 1 or nil
|
|
26
26
|
end
|
|
27
|
-
error(
|
|
28
|
-
"The player has an unknown number of trinket slots: " .. tostring(maxTrinkets)
|
|
29
|
-
)
|
|
27
|
+
error("The player has an unknown number of trinket slots: " .. tostring(maxTrinkets))
|
|
30
28
|
return nil
|
|
31
29
|
end
|
|
32
30
|
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 =
|
|
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.lua
CHANGED
|
@@ -4,9 +4,7 @@ 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(
|
|
8
|
-
oldSet:values()
|
|
9
|
-
) do
|
|
7
|
+
for ____, value in __TS__Iterator(oldSet:values()) do
|
|
10
8
|
newSet:add(value)
|
|
11
9
|
end
|
|
12
10
|
return newSet
|
|
@@ -25,9 +23,7 @@ end
|
|
|
25
23
|
function ____exports.hexToKColor(self, hexString, alpha)
|
|
26
24
|
hexString = __TS__StringReplace(hexString, "#", "")
|
|
27
25
|
if #hexString ~= HEX_STRING_LENGTH then
|
|
28
|
-
error(
|
|
29
|
-
("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. "."
|
|
30
|
-
)
|
|
26
|
+
error(("Hex strings must be of length " .. tostring(HEX_STRING_LENGTH)) .. ".")
|
|
31
27
|
end
|
|
32
28
|
local rString = __TS__StringSubstr(hexString, 0, 2)
|
|
33
29
|
local R = tonumber("0x" .. rString)
|
|
@@ -49,14 +45,14 @@ function ____exports.hexToKColor(self, hexString, alpha)
|
|
|
49
45
|
end
|
|
50
46
|
function ____exports.isGreedMode(self)
|
|
51
47
|
local game = Game()
|
|
52
|
-
return
|
|
48
|
+
return game.Difficulty == Difficulty.DIFFICULTY_GREED or game.Difficulty == Difficulty.DIFFICULTY_GREEDIER
|
|
53
49
|
end
|
|
54
50
|
function ____exports.onSetSeed(self)
|
|
55
51
|
local game = Game()
|
|
56
52
|
local seeds = game:GetSeeds()
|
|
57
53
|
local customRun = seeds:IsCustomRun()
|
|
58
54
|
local challenge = Isaac.GetChallenge()
|
|
59
|
-
return
|
|
55
|
+
return challenge == Challenge.CHALLENGE_NULL and customRun
|
|
60
56
|
end
|
|
61
57
|
function ____exports.printConsole(self, msg)
|
|
62
58
|
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
|
|
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
|
package/dist/index.d.ts
CHANGED
|
@@ -50,9 +50,12 @@ export * from "./functions/util";
|
|
|
50
50
|
export * from "./functions/vector";
|
|
51
51
|
export * from "./maps/cardNameMap";
|
|
52
52
|
export * from "./maps/collectibleNameMap";
|
|
53
|
+
export * from "./maps/gridEntityXMLMap";
|
|
53
54
|
export * from "./maps/pillEffectNameMap";
|
|
55
|
+
export * from "./maps/roomTypeToItemPoolMap";
|
|
54
56
|
export * from "./maps/transformationMap";
|
|
55
57
|
export * from "./maps/trinketNameMap";
|
|
58
|
+
export * from "./sets/cards";
|
|
56
59
|
export * from "./types/CallbackParametersCustom";
|
|
57
60
|
export * from "./types/HealthType";
|
|
58
61
|
export * from "./types/JSONDoor";
|
package/dist/index.lua
CHANGED
|
@@ -406,6 +406,14 @@ do
|
|
|
406
406
|
end
|
|
407
407
|
end
|
|
408
408
|
end
|
|
409
|
+
do
|
|
410
|
+
local ____export = require("maps.gridEntityXMLMap")
|
|
411
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
412
|
+
if ____exportKey ~= "default" then
|
|
413
|
+
____exports[____exportKey] = ____exportValue
|
|
414
|
+
end
|
|
415
|
+
end
|
|
416
|
+
end
|
|
409
417
|
do
|
|
410
418
|
local ____export = require("maps.pillEffectNameMap")
|
|
411
419
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -414,6 +422,14 @@ do
|
|
|
414
422
|
end
|
|
415
423
|
end
|
|
416
424
|
end
|
|
425
|
+
do
|
|
426
|
+
local ____export = require("maps.roomTypeToItemPoolMap")
|
|
427
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
428
|
+
if ____exportKey ~= "default" then
|
|
429
|
+
____exports[____exportKey] = ____exportValue
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
end
|
|
417
433
|
do
|
|
418
434
|
local ____export = require("maps.transformationMap")
|
|
419
435
|
for ____exportKey, ____exportValue in pairs(____export) do
|
|
@@ -430,6 +446,14 @@ do
|
|
|
430
446
|
end
|
|
431
447
|
end
|
|
432
448
|
end
|
|
449
|
+
do
|
|
450
|
+
local ____export = require("sets.cards")
|
|
451
|
+
for ____exportKey, ____exportValue in pairs(____export) do
|
|
452
|
+
if ____exportKey ~= "default" then
|
|
453
|
+
____exports[____exportKey] = ____exportValue
|
|
454
|
+
end
|
|
455
|
+
end
|
|
456
|
+
end
|
|
433
457
|
do
|
|
434
458
|
local ____export = require("types.HealthType")
|
|
435
459
|
for ____exportKey, ____exportValue in pairs(____export) do
|