isaacscript-common 1.0.509 → 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 +11 -2
- package/dist/functions/rooms.lua +29 -17
- 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 +3 -3
|
@@ -37,7 +37,7 @@ function queueEmpty(self, player, pickingUpItem)
|
|
|
37
37
|
end
|
|
38
38
|
function queueNotEmpty(self, player, pickingUpItem)
|
|
39
39
|
local queuedItem = player.QueuedItem.Item
|
|
40
|
-
if queuedItem ~= nil and queuedItem.ID ~= pickingUpItem.id then
|
|
40
|
+
if (queuedItem ~= nil) and (queuedItem.ID ~= pickingUpItem.id) then
|
|
41
41
|
pickingUpItem.id = queuedItem.ID
|
|
42
42
|
pickingUpItem.type = queuedItem.Type
|
|
43
43
|
preItemPickupFire(nil, player, pickingUpItem)
|
|
@@ -52,7 +52,11 @@ function getPickingUpItemForPlayer(self, player)
|
|
|
52
52
|
end
|
|
53
53
|
return pickingUpItem
|
|
54
54
|
end
|
|
55
|
-
v = {
|
|
55
|
+
v = {
|
|
56
|
+
run = {
|
|
57
|
+
pickingUpItem = __TS__New(Map)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
56
60
|
function ____exports.itemPickupCallbacksInit(self, mod)
|
|
57
61
|
saveDataManager(nil, "itemPickup", v, hasSubscriptions)
|
|
58
62
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReorderedPlayer, 0)
|
|
@@ -20,7 +20,11 @@ function postBombUpdate(self, bomb)
|
|
|
20
20
|
postBombInitLateFire(nil, bomb)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postBombInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postBombInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_BOMB_UPDATE, postBombUpdate)
|
|
@@ -33,7 +33,7 @@ function setDamageFrame(self, tookDamage, damageFlags)
|
|
|
33
33
|
local trackingArray = v.run.damageFrameMap:get(playerIndex)
|
|
34
34
|
if trackingArray ~= nil then
|
|
35
35
|
local lastDamageFrame, callbackActivatedOnThisFrame = table.unpack(trackingArray)
|
|
36
|
-
if lastDamageFrame == gameFrameCount and callbackActivatedOnThisFrame then
|
|
36
|
+
if (lastDamageFrame == gameFrameCount) and callbackActivatedOnThisFrame then
|
|
37
37
|
return
|
|
38
38
|
end
|
|
39
39
|
end
|
|
@@ -47,16 +47,16 @@ function isPotentialNaturalTeleportFromSacrificeRoom(self, damageFlags)
|
|
|
47
47
|
local room = game:GetRoom()
|
|
48
48
|
local roomType = room:GetType()
|
|
49
49
|
local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
|
|
50
|
-
return roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage and (v.level.numSacrifices == 6 or v.level.numSacrifices >= 12)
|
|
50
|
+
return ((roomType == RoomType.ROOM_SACRIFICE) and isSpikeDamage) and ((v.level.numSacrifices == 6) or (v.level.numSacrifices >= 12))
|
|
51
51
|
end
|
|
52
52
|
function incrementNumSacrifices(self, damageFlags)
|
|
53
53
|
local game = Game()
|
|
54
54
|
local room = game:GetRoom()
|
|
55
55
|
local roomType = room:GetType()
|
|
56
56
|
local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
|
|
57
|
-
if roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage then
|
|
58
|
-
local
|
|
59
|
-
|
|
57
|
+
if (roomType == RoomType.ROOM_SACRIFICE) and isSpikeDamage then
|
|
58
|
+
local ____obj, ____index = v.level, "numSacrifices"
|
|
59
|
+
____obj[____index] = ____obj[____index] + 1
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
62
|
function postPlayerRenderPlayer(self, player)
|
|
@@ -87,20 +87,22 @@ function playerIsTeleportingFromCursedTeleport(self, player, lastDamageFrame)
|
|
|
87
87
|
return false
|
|
88
88
|
end
|
|
89
89
|
local sprite = player:GetSprite()
|
|
90
|
-
if not sprite:IsPlaying("TeleportUp") or sprite:GetFrame() ~= 1 then
|
|
90
|
+
if (not sprite:IsPlaying("TeleportUp")) or (sprite:GetFrame() ~= 1) then
|
|
91
91
|
return false
|
|
92
92
|
end
|
|
93
93
|
if player:HasCollectible(CollectibleType.COLLECTIBLE_CURSED_EYE) then
|
|
94
94
|
return true
|
|
95
95
|
end
|
|
96
96
|
local numHitsLeft = getPlayerNumAllHearts(nil, player)
|
|
97
|
-
if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and numHitsLeft == 1 then
|
|
97
|
+
if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and (numHitsLeft == 1) then
|
|
98
98
|
return true
|
|
99
99
|
end
|
|
100
100
|
return false
|
|
101
101
|
end
|
|
102
102
|
v = {
|
|
103
|
-
run = {
|
|
103
|
+
run = {
|
|
104
|
+
damageFrameMap = __TS__New(Map)
|
|
105
|
+
},
|
|
104
106
|
level = {numSacrifices = 0}
|
|
105
107
|
}
|
|
106
108
|
function ____exports.postCursedTeleportCallbackInit(self, mod)
|
|
@@ -20,7 +20,11 @@ function postEffectUpdate(self, effect)
|
|
|
20
20
|
postEffectInitLateFire(nil, effect)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postEffectInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postEffectInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdate)
|
|
@@ -20,7 +20,7 @@ function postUpdate(self)
|
|
|
20
20
|
end
|
|
21
21
|
local game = Game()
|
|
22
22
|
local gameFrameCount = game:GetFrameCount()
|
|
23
|
-
if v.run.usedEsauJrFrame == nil or gameFrameCount < v.run.usedEsauJrFrame + 1 then
|
|
23
|
+
if (v.run.usedEsauJrFrame == nil) or (gameFrameCount < (v.run.usedEsauJrFrame + 1)) then
|
|
24
24
|
return
|
|
25
25
|
end
|
|
26
26
|
v.run.usedEsauJrFrame = nil
|
|
@@ -39,7 +39,9 @@ function postUpdate(self)
|
|
|
39
39
|
postEsauJrFire(nil, player)
|
|
40
40
|
end
|
|
41
41
|
function getPlayerWithControllerIndex(self, controllerIndex)
|
|
42
|
-
for ____, player in ipairs(
|
|
42
|
+
for ____, player in ipairs(
|
|
43
|
+
getPlayers(nil)
|
|
44
|
+
) do
|
|
43
45
|
if player.ControllerIndex == controllerIndex then
|
|
44
46
|
return player
|
|
45
47
|
end
|
|
@@ -20,7 +20,11 @@ function postFamiliarUpdate(self, familiar)
|
|
|
20
20
|
postFamiliarInitLateFire(nil, familiar)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
run = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postFamiliarInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postFamiliarInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, postFamiliarUpdate)
|
|
@@ -39,9 +39,11 @@ function getNewLazarus(self, oldLazarus)
|
|
|
39
39
|
else
|
|
40
40
|
error("Failed to determine the character in the postFlip callback.")
|
|
41
41
|
end
|
|
42
|
-
for ____, player in ipairs(
|
|
42
|
+
for ____, player in ipairs(
|
|
43
|
+
getPlayers(nil)
|
|
44
|
+
) do
|
|
43
45
|
local character = player:GetPlayerType()
|
|
44
|
-
if character == newCharacter and player.FrameCount == oldLazarus.FrameCount then
|
|
46
|
+
if (character == newCharacter) and (player.FrameCount == oldLazarus.FrameCount) then
|
|
45
47
|
return player
|
|
46
48
|
end
|
|
47
49
|
end
|
|
@@ -16,13 +16,15 @@ local ____postGridEntityUpdate = require("callbacks.subscriptions.postGridEntity
|
|
|
16
16
|
local postGridEntityUpdateFire = ____postGridEntityUpdate.postGridEntityUpdateFire
|
|
17
17
|
local postGridEntityUpdateHasSubscriptions = ____postGridEntityUpdate.postGridEntityUpdateHasSubscriptions
|
|
18
18
|
function hasSubscriptions(self)
|
|
19
|
-
return postGridEntityInitHasSubscriptions(nil) or postGridEntityUpdateHasSubscriptions(nil) or postGridEntityRemoveHasSubscriptions(nil)
|
|
19
|
+
return (postGridEntityInitHasSubscriptions(nil) or postGridEntityUpdateHasSubscriptions(nil)) or postGridEntityRemoveHasSubscriptions(nil)
|
|
20
20
|
end
|
|
21
21
|
function postUpdate(self)
|
|
22
22
|
if not hasSubscriptions(nil) then
|
|
23
23
|
return
|
|
24
24
|
end
|
|
25
|
-
for ____, gridEntity in ipairs(
|
|
25
|
+
for ____, gridEntity in ipairs(
|
|
26
|
+
getGridEntities(nil)
|
|
27
|
+
) do
|
|
26
28
|
checkNewGridEntity(nil, gridEntity)
|
|
27
29
|
postGridEntityUpdateFire(nil, gridEntity)
|
|
28
30
|
end
|
|
@@ -31,13 +33,15 @@ end
|
|
|
31
33
|
function checkGridEntityRemoved(self)
|
|
32
34
|
local game = Game()
|
|
33
35
|
local room = game:GetRoom()
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
for ____, ____value in __TS__Iterator(
|
|
37
|
+
v.room.initializedGridEntities:entries()
|
|
38
|
+
) do
|
|
39
|
+
local gridIndex
|
|
37
40
|
gridIndex = ____value[1]
|
|
41
|
+
local gridEntityType
|
|
38
42
|
gridEntityType = ____value[2]
|
|
39
43
|
local gridEntity = room:GetGridEntity(gridIndex)
|
|
40
|
-
if gridEntity == nil or gridEntity:GetType() ~= gridEntityType then
|
|
44
|
+
if (gridEntity == nil) or (gridEntity:GetType() ~= gridEntityType) then
|
|
41
45
|
v.room.initializedGridEntities:delete(gridIndex)
|
|
42
46
|
postGridEntityRemoveFire(nil, gridIndex, gridEntityType)
|
|
43
47
|
end
|
|
@@ -47,7 +51,9 @@ function postNewRoom(self)
|
|
|
47
51
|
if not hasSubscriptions(nil) then
|
|
48
52
|
return
|
|
49
53
|
end
|
|
50
|
-
for ____, gridEntity in ipairs(
|
|
54
|
+
for ____, gridEntity in ipairs(
|
|
55
|
+
getGridEntities(nil)
|
|
56
|
+
) do
|
|
51
57
|
checkNewGridEntity(nil, gridEntity)
|
|
52
58
|
end
|
|
53
59
|
end
|
|
@@ -60,7 +66,11 @@ function checkNewGridEntity(self, gridEntity)
|
|
|
60
66
|
postGridEntityInitFire(nil, gridEntity)
|
|
61
67
|
end
|
|
62
68
|
end
|
|
63
|
-
v = {
|
|
69
|
+
v = {
|
|
70
|
+
room = {
|
|
71
|
+
initializedGridEntities = __TS__New(Map)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
64
74
|
function ____exports.postGridEntityCallbacksInit(self, mod)
|
|
65
75
|
saveDataManager(nil, "postGridEntity", v, hasSubscriptions)
|
|
66
76
|
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
|
|
@@ -20,7 +20,11 @@ function postKnifeUpdate(self, knife)
|
|
|
20
20
|
postKnifeInitLateFire(nil, knife)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postKnifeInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postKnifeInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_KNIFE_UPDATE, postKnifeUpdate)
|
|
@@ -20,7 +20,11 @@ function postLaserUpdate(self, laser)
|
|
|
20
20
|
postLaserInitLateFire(nil, laser)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postLaserInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postLaserInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_LASER_UPDATE, postLaserUpdate)
|
|
@@ -20,7 +20,11 @@ function postNPCUpdate(self, npc)
|
|
|
20
20
|
postNPCInitLateFire(nil, npc)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postNPCInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postNPCInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, postNPCUpdate)
|
|
@@ -28,7 +28,11 @@ function postPickupRender(self, pickup)
|
|
|
28
28
|
postPickupCollectFire(nil, pickup, player)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
31
|
+
v = {
|
|
32
|
+
room = {
|
|
33
|
+
firedSet = __TS__New(Set)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
32
36
|
function ____exports.postPickupCollectCallbackInit(self, mod)
|
|
33
37
|
saveDataManager(nil, "postPickupCollect", v, hasSubscriptions)
|
|
34
38
|
mod:AddCallback(ModCallbacks.MC_POST_PICKUP_RENDER, postPickupRender)
|
|
@@ -20,7 +20,11 @@ function postPickupUpdate(self, pickup)
|
|
|
20
20
|
postPickupInitLateFire(nil, pickup)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postPickupInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postPickupInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, postPickupUpdate)
|
|
@@ -32,7 +32,7 @@ function postPlayerUpdateReordered(self, player)
|
|
|
32
32
|
for ____, healthType in ipairs(healthTypes) do
|
|
33
33
|
local storedHealthValue = storedHealth:get(healthType)
|
|
34
34
|
local currentHealthValue = getCurrentHealthValue(nil, player, healthType)
|
|
35
|
-
if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
|
|
35
|
+
if (storedHealthValue ~= nil) and (storedHealthValue ~= currentHealthValue) then
|
|
36
36
|
local amount = currentHealthValue - storedHealthValue
|
|
37
37
|
postPlayerChangeHealthFire(nil, player, healthType, amount)
|
|
38
38
|
end
|
|
@@ -47,43 +47,43 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
47
47
|
return player:GetHearts()
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.SOUL
|
|
50
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.SOUL)
|
|
51
51
|
if ____cond10 then
|
|
52
52
|
do
|
|
53
53
|
return player:GetSoulHearts()
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.ETERNAL
|
|
56
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.ETERNAL)
|
|
57
57
|
if ____cond10 then
|
|
58
58
|
do
|
|
59
59
|
return player:GetEternalHearts()
|
|
60
60
|
end
|
|
61
61
|
end
|
|
62
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.BLACK
|
|
62
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.BLACK)
|
|
63
63
|
if ____cond10 then
|
|
64
64
|
do
|
|
65
65
|
return player:GetBlackHearts()
|
|
66
66
|
end
|
|
67
67
|
end
|
|
68
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.GOLDEN
|
|
68
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.GOLDEN)
|
|
69
69
|
if ____cond10 then
|
|
70
70
|
do
|
|
71
71
|
return player:GetGoldenHearts()
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.BONE
|
|
74
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.BONE)
|
|
75
75
|
if ____cond10 then
|
|
76
76
|
do
|
|
77
77
|
return player:GetBoneHearts()
|
|
78
78
|
end
|
|
79
79
|
end
|
|
80
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.ROTTEN
|
|
80
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.ROTTEN)
|
|
81
81
|
if ____cond10 then
|
|
82
82
|
do
|
|
83
83
|
return player:GetRottenHearts()
|
|
84
84
|
end
|
|
85
85
|
end
|
|
86
|
-
____cond10 = ____cond10 or ____switch10 == HealthType.MAX_HEARTS
|
|
86
|
+
____cond10 = ____cond10 or (____switch10 == HealthType.MAX_HEARTS)
|
|
87
87
|
if ____cond10 then
|
|
88
88
|
do
|
|
89
89
|
return player:GetMaxHearts()
|
|
@@ -97,7 +97,11 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
97
97
|
end
|
|
98
98
|
until true
|
|
99
99
|
end
|
|
100
|
-
v = {
|
|
100
|
+
v = {
|
|
101
|
+
run = {
|
|
102
|
+
healthMap = __TS__New(Map)
|
|
103
|
+
}
|
|
104
|
+
}
|
|
101
105
|
function ____exports.postPlayerChangeHealthCallbackInit(self, mod)
|
|
102
106
|
saveDataManager(nil, "postPlayerChangeHealth", v, hasSubscriptions)
|
|
103
107
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReordered)
|
|
@@ -30,7 +30,11 @@ function postPlayerUpdateReorderedPlayer(self, player)
|
|
|
30
30
|
postPlayerChangeTypeFire(nil, player)
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
|
-
v = {
|
|
33
|
+
v = {
|
|
34
|
+
run = {
|
|
35
|
+
characterMap = __TS__New(Map)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
34
38
|
function ____exports.postPlayerChangeTypeCallbackInit(self, mod)
|
|
35
39
|
saveDataManager(nil, "postPlayerChangeType", v, hasSubscriptions)
|
|
36
40
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReorderedPlayer, 0)
|
|
@@ -23,7 +23,7 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, _damageFlags, _dama
|
|
|
23
23
|
if willPlayerRevive(nil, player) then
|
|
24
24
|
return nil
|
|
25
25
|
end
|
|
26
|
-
if not damageIsFatal(nil, player, damageAmount) and not hasLostCurse(nil, player) then
|
|
26
|
+
if (not damageIsFatal(nil, player, damageAmount)) and (not hasLostCurse(nil, player)) then
|
|
27
27
|
return nil
|
|
28
28
|
end
|
|
29
29
|
local shouldSustainDeath = postPlayerFatalDamageFire(nil, player)
|
|
@@ -45,7 +45,7 @@ function damageIsFatal(self, player, damageAmount)
|
|
|
45
45
|
local eternalHearts = player:GetEternalHearts()
|
|
46
46
|
local soulHearts = player:GetSoulHearts()
|
|
47
47
|
local boneHearts = player:GetBoneHearts()
|
|
48
|
-
if hearts > 0 and soulHearts > 0 or hearts > 0 and boneHearts > 0 or soulHearts > 0 and boneHearts > 0 or soulHearts > 0 and eternalHearts > 0 or boneHearts >= 2 then
|
|
48
|
+
if (((((hearts > 0) and (soulHearts > 0)) or ((hearts > 0) and (boneHearts > 0))) or ((soulHearts > 0) and (boneHearts > 0))) or ((soulHearts > 0) and (eternalHearts > 0))) or (boneHearts >= 2) then
|
|
49
49
|
return false
|
|
50
50
|
end
|
|
51
51
|
return true
|
|
@@ -22,7 +22,11 @@ function postPlayerUpdate(self, player)
|
|
|
22
22
|
postPlayerInitLateFire(nil, player)
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
|
-
v = {
|
|
25
|
+
v = {
|
|
26
|
+
run = {
|
|
27
|
+
firedSet = __TS__New(Set)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
26
30
|
function ____exports.postPlayerInitLateCallbackInit(self, mod)
|
|
27
31
|
saveDataManager(nil, "postPlayerInitLate", v, hasSubscriptions)
|
|
28
32
|
mod:AddCallback(ModCallbacks.MC_POST_PLAYER_UPDATE, postPlayerUpdate)
|
|
@@ -19,7 +19,7 @@ local ____postPlayerUpdateReordered = require("callbacks.subscriptions.postPlaye
|
|
|
19
19
|
local postPlayerUpdateReorderedFire = ____postPlayerUpdateReordered.postPlayerUpdateReorderedFire
|
|
20
20
|
local postPlayerUpdateReorderedHasSubscriptions = ____postPlayerUpdateReordered.postPlayerUpdateReorderedHasSubscriptions
|
|
21
21
|
function hasSubscriptions(self)
|
|
22
|
-
return postPlayerInitReorderedHasSubscriptions(nil) or postPlayerUpdateReorderedHasSubscriptions(nil) or postPlayerRenderReorderedHasSubscriptions(nil)
|
|
22
|
+
return (postPlayerInitReorderedHasSubscriptions(nil) or postPlayerUpdateReorderedHasSubscriptions(nil)) or postPlayerRenderReorderedHasSubscriptions(nil)
|
|
23
23
|
end
|
|
24
24
|
function postPlayerInit(self, player)
|
|
25
25
|
if not hasSubscriptions(nil) then
|
|
@@ -20,7 +20,11 @@ function postProjectileUpdate(self, projectile)
|
|
|
20
20
|
postProjectileInitLateFire(nil, projectile)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postProjectileInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postProjectileInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_PROJECTILE_UPDATE, postProjectileUpdate)
|
|
@@ -24,10 +24,12 @@ function postUpdate(self)
|
|
|
24
24
|
storePlayersInMap(nil, players)
|
|
25
25
|
end
|
|
26
26
|
function checkPickupsPurchased(self, pickups, players)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
for ____, ____value in __TS__Iterator(
|
|
28
|
+
v.room.pickupMap:entries()
|
|
29
|
+
) do
|
|
30
|
+
local index
|
|
30
31
|
index = ____value[1]
|
|
32
|
+
local pickupDescription
|
|
31
33
|
pickupDescription = ____value[2]
|
|
32
34
|
do
|
|
33
35
|
if pickupIndexExists(nil, index, pickups) then
|
|
@@ -42,14 +44,8 @@ function checkPickupsPurchased(self, pickups, players)
|
|
|
42
44
|
if playerHoldingItemLastFrame == nil then
|
|
43
45
|
goto __continue9
|
|
44
46
|
end
|
|
45
|
-
if not playerHoldingItemLastFrame and playerHoldingItem then
|
|
46
|
-
postPurchaseFire(
|
|
47
|
-
nil,
|
|
48
|
-
player,
|
|
49
|
-
pickupDescription.variant,
|
|
50
|
-
pickupDescription.subtype,
|
|
51
|
-
pickupDescription.price
|
|
52
|
-
)
|
|
47
|
+
if (not playerHoldingItemLastFrame) and playerHoldingItem then
|
|
48
|
+
postPurchaseFire(nil, player, pickupDescription.variant, pickupDescription.subtype, pickupDescription.price)
|
|
53
49
|
break
|
|
54
50
|
end
|
|
55
51
|
end
|
|
@@ -63,7 +59,7 @@ function storePickupsInMap(self, pickups)
|
|
|
63
59
|
for ____, entity in ipairs(pickups) do
|
|
64
60
|
do
|
|
65
61
|
local pickup = entity:ToPickup()
|
|
66
|
-
if pickup == nil or pickup.Price == 0 then
|
|
62
|
+
if (pickup == nil) or (pickup.Price == 0) then
|
|
67
63
|
goto __continue13
|
|
68
64
|
end
|
|
69
65
|
v.room.pickupMap:set(pickup.Index, {variant = pickup.Variant, subtype = pickup.SubType, price = pickup.Price})
|
|
@@ -80,16 +76,18 @@ function storePlayersInMap(self, players)
|
|
|
80
76
|
end
|
|
81
77
|
function pickupIndexExists(self, index, pickups)
|
|
82
78
|
for ____, entity in ipairs(pickups) do
|
|
83
|
-
if entity.Index == index and entity:Exists() then
|
|
79
|
+
if (entity.Index == index) and entity:Exists() then
|
|
84
80
|
return true
|
|
85
81
|
end
|
|
86
82
|
end
|
|
87
83
|
return false
|
|
88
84
|
end
|
|
89
|
-
v = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
v = {
|
|
86
|
+
room = {
|
|
87
|
+
pickupMap = __TS__New(Map),
|
|
88
|
+
playerHoldingItemLastFrameMap = __TS__New(Map)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
93
91
|
function ____exports.postPurchaseCallbackInit(self, mod)
|
|
94
92
|
saveDataManager(nil, "postPurchase", v, hasSubscriptions)
|
|
95
93
|
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
|
|
@@ -23,9 +23,9 @@ function entityTakeDmgPlayer(self, tookDamage, _damageAmount, damageFlags, _dama
|
|
|
23
23
|
local room = game:GetRoom()
|
|
24
24
|
local roomType = room:GetType()
|
|
25
25
|
local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
|
|
26
|
-
if roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage then
|
|
27
|
-
local
|
|
28
|
-
|
|
26
|
+
if (roomType == RoomType.ROOM_SACRIFICE) and isSpikeDamage then
|
|
27
|
+
local ____obj, ____index = v.level, "numSacrifices"
|
|
28
|
+
____obj[____index] = ____obj[____index] + 1
|
|
29
29
|
postSacrificeFire(nil, player, v.level.numSacrifices)
|
|
30
30
|
end
|
|
31
31
|
end
|
|
@@ -19,7 +19,9 @@ function postUpdate(self)
|
|
|
19
19
|
if not hasSubscriptions(nil) then
|
|
20
20
|
return
|
|
21
21
|
end
|
|
22
|
-
for ____, slot in ipairs(
|
|
22
|
+
for ____, slot in ipairs(
|
|
23
|
+
getSlots(nil)
|
|
24
|
+
) do
|
|
23
25
|
checkNewEntity(nil, slot)
|
|
24
26
|
postSlotUpdateFire(nil, slot)
|
|
25
27
|
end
|
|
@@ -28,7 +30,9 @@ function postNewRoom(self)
|
|
|
28
30
|
if not hasSubscriptions(nil) then
|
|
29
31
|
return
|
|
30
32
|
end
|
|
31
|
-
for ____, slot in ipairs(
|
|
33
|
+
for ____, slot in ipairs(
|
|
34
|
+
getSlots(nil)
|
|
35
|
+
) do
|
|
32
36
|
checkNewEntity(nil, slot)
|
|
33
37
|
end
|
|
34
38
|
end
|
|
@@ -39,7 +43,11 @@ function checkNewEntity(self, slot)
|
|
|
39
43
|
postSlotInitFire(nil, slot)
|
|
40
44
|
end
|
|
41
45
|
end
|
|
42
|
-
v = {
|
|
46
|
+
v = {
|
|
47
|
+
room = {
|
|
48
|
+
initializedSlots = __TS__New(Set)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
43
51
|
function ____exports.postSlotInitUpdateCallbacksInit(self, mod)
|
|
44
52
|
saveDataManager(nil, "postSlotInitUpdate", v, hasSubscriptions)
|
|
45
53
|
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
|
|
@@ -19,7 +19,9 @@ function postRender(self)
|
|
|
19
19
|
if not hasSubscriptions(nil) then
|
|
20
20
|
return
|
|
21
21
|
end
|
|
22
|
-
for ____, slot in ipairs(
|
|
22
|
+
for ____, slot in ipairs(
|
|
23
|
+
getSlots(nil)
|
|
24
|
+
) do
|
|
23
25
|
postSlotRenderFire(nil, slot)
|
|
24
26
|
checkSlotBroken(nil, slot)
|
|
25
27
|
end
|
|
@@ -38,7 +40,11 @@ function checkSlotBroken(self, slot)
|
|
|
38
40
|
end
|
|
39
41
|
end
|
|
40
42
|
BROKEN_ANIMATIONS = __TS__New(Set, {"Broken", "Death"})
|
|
41
|
-
v = {
|
|
43
|
+
v = {
|
|
44
|
+
room = {
|
|
45
|
+
brokenSlots = __TS__New(Set)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
42
48
|
function ____exports.postSlotRenderBrokenCallbacksInit(self, mod)
|
|
43
49
|
saveDataManager(nil, "postSlotRenderBroken", v, hasSubscriptions)
|
|
44
50
|
mod:AddCallback(ModCallbacks.MC_POST_RENDER, postRender)
|
|
@@ -20,7 +20,11 @@ function postTearUpdate(self, tear)
|
|
|
20
20
|
postTearInitLateFire(nil, tear)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
23
|
+
v = {
|
|
24
|
+
room = {
|
|
25
|
+
firedSet = __TS__New(Set)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
24
28
|
function ____exports.postTearInitLateCallbackInit(self, mod)
|
|
25
29
|
saveDataManager(nil, "postTearInitLate", v, hasSubscriptions)
|
|
26
30
|
mod:AddCallback(ModCallbacks.MC_POST_TEAR_UPDATE, postTearUpdate)
|
|
@@ -39,7 +39,11 @@ function postPlayerUpdateReorderedPlayer(self, player)
|
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
end
|
|
42
|
-
v = {
|
|
42
|
+
v = {
|
|
43
|
+
run = {
|
|
44
|
+
transformations = __TS__New(Map)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
43
47
|
function ____exports.postTransformationCallbackInit(self, mod)
|
|
44
48
|
saveDataManager(nil, "postTransformation", v, hasSubscriptions)
|
|
45
49
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReorderedPlayer, 0)
|
|
@@ -11,7 +11,7 @@ local ____postNewRoomReordered = require("callbacks.subscriptions.postNewRoomReo
|
|
|
11
11
|
local postNewRoomReorderedFire = ____postNewRoomReordered.postNewRoomReorderedFire
|
|
12
12
|
local postNewRoomReorderedHasSubscriptions = ____postNewRoomReordered.postNewRoomReorderedHasSubscriptions
|
|
13
13
|
function hasSubscriptions(self)
|
|
14
|
-
return postGameStartedReorderedHasSubscriptions(nil) or postNewLevelReorderedHasSubscriptions(nil) or postNewRoomReorderedHasSubscriptions(nil)
|
|
14
|
+
return (postGameStartedReorderedHasSubscriptions(nil) or postNewLevelReorderedHasSubscriptions(nil)) or postNewRoomReorderedHasSubscriptions(nil)
|
|
15
15
|
end
|
|
16
16
|
function useItemGlowingHourGlass(self)
|
|
17
17
|
usedGlowingHourGlass = true
|
|
@@ -31,7 +31,7 @@ function postNewLevelVanilla(self)
|
|
|
31
31
|
end
|
|
32
32
|
local game = Game()
|
|
33
33
|
local gameFrameCount = game:GetFrameCount()
|
|
34
|
-
if gameFrameCount == 0 and not forceNewLevel then
|
|
34
|
+
if (gameFrameCount == 0) and (not forceNewLevel) then
|
|
35
35
|
return
|
|
36
36
|
end
|
|
37
37
|
forceNewLevel = false
|
|
@@ -50,14 +50,14 @@ function postNewRoomVanilla(self)
|
|
|
50
50
|
local stageType = level:GetStageType()
|
|
51
51
|
if usedGlowingHourGlass then
|
|
52
52
|
usedGlowingHourGlass = false
|
|
53
|
-
if currentStage ~= stage or currentStageType ~= stageType then
|
|
53
|
+
if (currentStage ~= stage) or (currentStageType ~= stageType) then
|
|
54
54
|
recordCurrentStage(nil)
|
|
55
55
|
postNewLevelReorderedFire(nil)
|
|
56
56
|
postNewRoomReorderedFire(nil)
|
|
57
57
|
return
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
|
-
if (gameFrameCount == 0 or currentStage ~= stage or currentStageType ~= stageType) and not forceNewRoom then
|
|
60
|
+
if (((gameFrameCount == 0) or (currentStage ~= stage)) or (currentStageType ~= stageType)) and (not forceNewRoom) then
|
|
61
61
|
return
|
|
62
62
|
end
|
|
63
63
|
forceNewRoom = false
|
|
@@ -9,13 +9,13 @@ function ____exports.postBombInitLateRegister(self, callback, bombVariant)
|
|
|
9
9
|
__TS__ArrayPush(subscriptions, {callback, bombVariant})
|
|
10
10
|
end
|
|
11
11
|
function ____exports.postBombInitLateFire(self, bomb)
|
|
12
|
-
local bombVariant
|
|
13
|
-
local callback
|
|
14
12
|
for ____, ____value in ipairs(subscriptions) do
|
|
13
|
+
local callback
|
|
15
14
|
callback = ____value[1]
|
|
15
|
+
local bombVariant
|
|
16
16
|
bombVariant = ____value[2]
|
|
17
17
|
do
|
|
18
|
-
if bombVariant ~= nil and bombVariant ~= bomb.Variant then
|
|
18
|
+
if (bombVariant ~= nil) and (bombVariant ~= bomb.Variant) then
|
|
19
19
|
goto __continue5
|
|
20
20
|
end
|
|
21
21
|
callback(nil, bomb)
|