isaacscript-common 1.0.573 → 1.0.577
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 +1 -1
- package/dist/functions/rooms.lua +42 -41
- 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.lua +6 -14
- 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
|
@@ -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.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")
|
|
@@ -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
|