isaacscript-common 1.0.488 → 1.0.492
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 +9 -0
- package/dist/constants.lua +41 -4
- 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.lua +5 -7
- package/dist/functions/bitwise.lua +1 -1
- package/dist/functions/cards.d.ts +2 -2
- 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 +45 -25
- 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 +13 -8
- 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.lua +14 -1
- package/dist/functions/pills.d.ts +1 -1
- package/dist/functions/player.d.ts +12 -0
- package/dist/functions/player.lua +45 -59
- 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.lua +13 -17
- 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/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.lua +36 -1
- package/dist/maps/pillEffectNameMap.lua +52 -1
- package/dist/maps/roomTypeToItemPoolMap.lua +15 -1
- 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.lua +98 -2
- package/dist/types/ModUpgraded.lua +82 -166
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
[](https://www.npmjs.com/package/isaacscript-common)
|
|
2
|
+
|
|
1
3
|
# isaacscript-common
|
|
2
4
|
|
|
3
5
|
This repository contains helper functions and extra features for IsaacScript mods. You can browse the auto-generated documentation [here](https://isaacscript.github.io/isaacscript-common/index.html).
|
|
@@ -33,7 +33,7 @@ function queueEmpty(self, player, pickingUpItem)
|
|
|
33
33
|
end
|
|
34
34
|
function queueNotEmpty(self, player, pickingUpItem)
|
|
35
35
|
local queuedItem = player.QueuedItem.Item
|
|
36
|
-
if
|
|
36
|
+
if queuedItem ~= nil and queuedItem.ID ~= pickingUpItem.id then
|
|
37
37
|
pickingUpItem.id = queuedItem.ID
|
|
38
38
|
pickingUpItem.type = queuedItem.Type
|
|
39
39
|
preItemPickup:fire(player, pickingUpItem)
|
|
@@ -48,11 +48,7 @@ function getPickingUpItemForPlayer(self, player)
|
|
|
48
48
|
end
|
|
49
49
|
return pickingUpItem
|
|
50
50
|
end
|
|
51
|
-
v = {
|
|
52
|
-
run = {
|
|
53
|
-
pickingUpItem = __TS__New(Map)
|
|
54
|
-
}
|
|
55
|
-
}
|
|
51
|
+
v = {run = {pickingUpItem = __TS__New(Map)}}
|
|
56
52
|
function ____exports.itemPickupCallbacksInit(self, mod)
|
|
57
53
|
saveDataManager(nil, "itemPickup", v, hasSubscriptions)
|
|
58
54
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReorderedPlayer, 0)
|
|
@@ -17,7 +17,7 @@ function postBombUpdate(self, bomb)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postBombUpdate(self, bomb)
|
|
|
28
28
|
postBombInitLate:fire(bomb)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postBombInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postBombInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_POST_BOMB_UPDATE, postBombUpdate)
|
|
@@ -31,7 +31,7 @@ function setDamageFrame(self, tookDamage, damageFlags)
|
|
|
31
31
|
local trackingArray = v.run.damageFrameMap:get(playerIndex)
|
|
32
32
|
if trackingArray ~= nil then
|
|
33
33
|
local lastDamageFrame, callbackActivatedOnThisFrame = table.unpack(trackingArray)
|
|
34
|
-
if
|
|
34
|
+
if lastDamageFrame == gameFrameCount and callbackActivatedOnThisFrame then
|
|
35
35
|
return
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -45,16 +45,16 @@ function isPotentialNaturalTeleportFromSacrificeRoom(self, damageFlags)
|
|
|
45
45
|
local room = game:GetRoom()
|
|
46
46
|
local roomType = room:GetType()
|
|
47
47
|
local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
|
|
48
|
-
return
|
|
48
|
+
return roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage and (v.level.numSacrifices == 6 or v.level.numSacrifices >= 12)
|
|
49
49
|
end
|
|
50
50
|
function incrementNumSacrifices(self, damageFlags)
|
|
51
51
|
local game = Game()
|
|
52
52
|
local room = game:GetRoom()
|
|
53
53
|
local roomType = room:GetType()
|
|
54
54
|
local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
|
|
55
|
-
if
|
|
56
|
-
local
|
|
57
|
-
|
|
55
|
+
if roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage then
|
|
56
|
+
local ____v_level_0, ____numSacrifices_1 = v.level, "numSacrifices"
|
|
57
|
+
____v_level_0[____numSacrifices_1] = ____v_level_0[____numSacrifices_1] + 1
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
function postPlayerRenderPlayer(self, player)
|
|
@@ -85,22 +85,20 @@ function playerIsTeleportingFromCursedTeleport(self, player, lastDamageFrame)
|
|
|
85
85
|
return false
|
|
86
86
|
end
|
|
87
87
|
local sprite = player:GetSprite()
|
|
88
|
-
if
|
|
88
|
+
if not sprite:IsPlaying("TeleportUp") or sprite:GetFrame() ~= 1 then
|
|
89
89
|
return false
|
|
90
90
|
end
|
|
91
91
|
if player:HasCollectible(CollectibleType.COLLECTIBLE_CURSED_EYE) then
|
|
92
92
|
return true
|
|
93
93
|
end
|
|
94
94
|
local numHitsLeft = getPlayerNumAllHearts(nil, player)
|
|
95
|
-
if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and
|
|
95
|
+
if player:HasTrinket(TrinketType.TRINKET_CURSED_SKULL) and numHitsLeft == 1 then
|
|
96
96
|
return true
|
|
97
97
|
end
|
|
98
98
|
return false
|
|
99
99
|
end
|
|
100
100
|
v = {
|
|
101
|
-
run = {
|
|
102
|
-
damageFrameMap = __TS__New(Map)
|
|
103
|
-
},
|
|
101
|
+
run = {damageFrameMap = __TS__New(Map)},
|
|
104
102
|
level = {numSacrifices = 0}
|
|
105
103
|
}
|
|
106
104
|
function ____exports.postCursedTeleportCallbackInit(self, mod)
|
|
@@ -17,7 +17,7 @@ function postEffectUpdate(self, effect)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postEffectUpdate(self, effect)
|
|
|
28
28
|
postEffectInitLate:fire(effect)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postEffectInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postEffectInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdate)
|
|
@@ -16,7 +16,7 @@ function postUpdate(self)
|
|
|
16
16
|
end
|
|
17
17
|
local game = Game()
|
|
18
18
|
local gameFrameCount = game:GetFrameCount()
|
|
19
|
-
if
|
|
19
|
+
if v.run.usedEsauJrFrame == nil or gameFrameCount < v.run.usedEsauJrFrame + 1 then
|
|
20
20
|
return
|
|
21
21
|
end
|
|
22
22
|
v.run.usedEsauJrFrame = nil
|
|
@@ -35,9 +35,7 @@ function postUpdate(self)
|
|
|
35
35
|
postEsauJr:fire(player)
|
|
36
36
|
end
|
|
37
37
|
function getPlayerWithControllerIndex(self, controllerIndex)
|
|
38
|
-
for ____, player in ipairs(
|
|
39
|
-
getPlayers(nil)
|
|
40
|
-
) do
|
|
38
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
41
39
|
if player.ControllerIndex == controllerIndex then
|
|
42
40
|
return player
|
|
43
41
|
end
|
|
@@ -17,7 +17,7 @@ function postFamiliarUpdate(self, familiar)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postFamiliarUpdate(self, familiar)
|
|
|
28
28
|
postFamiliarInitLate:fire(familiar)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postFamiliarInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postFamiliarInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_FAMILIAR_UPDATE, postFamiliarUpdate)
|
|
@@ -35,11 +35,9 @@ function getNewLazarus(self, oldLazarus)
|
|
|
35
35
|
else
|
|
36
36
|
error("Failed to determine the character in the postFlip callback.")
|
|
37
37
|
end
|
|
38
|
-
for ____, player in ipairs(
|
|
39
|
-
getPlayers(nil)
|
|
40
|
-
) do
|
|
38
|
+
for ____, player in ipairs(getPlayers(nil)) do
|
|
41
39
|
local character = player:GetPlayerType()
|
|
42
|
-
if
|
|
40
|
+
if character == newCharacter and player.FrameCount == oldLazarus.FrameCount then
|
|
43
41
|
return player
|
|
44
42
|
end
|
|
45
43
|
end
|
|
@@ -10,15 +10,13 @@ local postGridEntityInit = require("callbacks.subscriptions.postGridEntityInit")
|
|
|
10
10
|
local postGridEntityRemove = require("callbacks.subscriptions.postGridEntityRemove")
|
|
11
11
|
local postGridEntityUpdate = require("callbacks.subscriptions.postGridEntityUpdate")
|
|
12
12
|
function hasSubscriptions(self)
|
|
13
|
-
return
|
|
13
|
+
return postGridEntityInit:hasSubscriptions() or postGridEntityUpdate:hasSubscriptions() or postGridEntityRemove:hasSubscriptions()
|
|
14
14
|
end
|
|
15
15
|
function postUpdate(self)
|
|
16
16
|
if not hasSubscriptions(nil) then
|
|
17
17
|
return
|
|
18
18
|
end
|
|
19
|
-
for ____, gridEntity in ipairs(
|
|
20
|
-
getGridEntities(nil)
|
|
21
|
-
) do
|
|
19
|
+
for ____, gridEntity in ipairs(getGridEntities(nil)) do
|
|
22
20
|
checkNewGridEntity(nil, gridEntity)
|
|
23
21
|
postGridEntityUpdate:fire(gridEntity)
|
|
24
22
|
end
|
|
@@ -27,15 +25,13 @@ end
|
|
|
27
25
|
function checkGridEntityRemoved(self)
|
|
28
26
|
local game = Game()
|
|
29
27
|
local room = game:GetRoom()
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
) do
|
|
33
|
-
local gridIndex
|
|
28
|
+
local gridEntityType
|
|
29
|
+
local gridIndex
|
|
30
|
+
for ____, ____value in __TS__Iterator(v.room.initializedGridEntities:entries()) do
|
|
34
31
|
gridIndex = ____value[1]
|
|
35
|
-
local gridEntityType
|
|
36
32
|
gridEntityType = ____value[2]
|
|
37
33
|
local gridEntity = room:GetGridEntity(gridIndex)
|
|
38
|
-
if
|
|
34
|
+
if gridEntity == nil or gridEntity:GetType() ~= gridEntityType then
|
|
39
35
|
v.room.initializedGridEntities:delete(gridIndex)
|
|
40
36
|
postGridEntityRemove:fire(gridIndex, gridEntityType)
|
|
41
37
|
end
|
|
@@ -45,9 +41,7 @@ function postNewRoom(self)
|
|
|
45
41
|
if not hasSubscriptions(nil) then
|
|
46
42
|
return
|
|
47
43
|
end
|
|
48
|
-
for ____, gridEntity in ipairs(
|
|
49
|
-
getGridEntities(nil)
|
|
50
|
-
) do
|
|
44
|
+
for ____, gridEntity in ipairs(getGridEntities(nil)) do
|
|
51
45
|
checkNewGridEntity(nil, gridEntity)
|
|
52
46
|
end
|
|
53
47
|
end
|
|
@@ -60,11 +54,7 @@ function checkNewGridEntity(self, gridEntity)
|
|
|
60
54
|
postGridEntityInit:fire(gridEntity)
|
|
61
55
|
end
|
|
62
56
|
end
|
|
63
|
-
v = {
|
|
64
|
-
room = {
|
|
65
|
-
initializedGridEntities = __TS__New(Map)
|
|
66
|
-
}
|
|
67
|
-
}
|
|
57
|
+
v = {room = {initializedGridEntities = __TS__New(Map)}}
|
|
68
58
|
function ____exports.postGridEntityCallbacksInit(self, mod)
|
|
69
59
|
saveDataManager(nil, "postGridEntity", v, hasSubscriptions)
|
|
70
60
|
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
|
|
@@ -17,7 +17,7 @@ function postKnifeUpdate(self, knife)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postKnifeUpdate(self, knife)
|
|
|
28
28
|
postKnifeInitLate:fire(knife)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postKnifeInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postKnifeInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_POST_KNIFE_UPDATE, postKnifeUpdate)
|
|
@@ -17,7 +17,7 @@ function postLaserUpdate(self, laser)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postLaserUpdate(self, laser)
|
|
|
28
28
|
postLaserInitLate:fire(laser)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postLaserInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postLaserInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_POST_LASER_UPDATE, postLaserUpdate)
|
|
@@ -17,7 +17,7 @@ function postNPCUpdate(self, npc)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postNPCUpdate(self, npc)
|
|
|
28
28
|
postNPCInitLate:fire(npc)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postNPCInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postNPCInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_NPC_UPDATE, postNPCUpdate)
|
|
@@ -26,11 +26,7 @@ function postPickupRender(self, pickup)
|
|
|
26
26
|
postPickupCollect:fire(pickup, player)
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
|
-
v = {
|
|
30
|
-
room = {
|
|
31
|
-
firedSet = __TS__New(Set)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
29
|
+
v = {room = {firedSet = __TS__New(Set)}}
|
|
34
30
|
function ____exports.postPickupCollectCallbackInit(self, mod)
|
|
35
31
|
saveDataManager(nil, "postPickupCollect", v, hasSubscriptions)
|
|
36
32
|
mod:AddCallback(ModCallbacks.MC_POST_PICKUP_RENDER, postPickupRender)
|
|
@@ -17,7 +17,7 @@ function postPickupUpdate(self, pickup)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postPickupUpdate(self, pickup)
|
|
|
28
28
|
postPickupInitLate:fire(pickup)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postPickupInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postPickupInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_POST_PICKUP_UPDATE, postPickupUpdate)
|
|
@@ -30,7 +30,7 @@ function postPlayerUpdateReordered(self, player)
|
|
|
30
30
|
for ____, healthType in ipairs(healthTypes) do
|
|
31
31
|
local storedHealthValue = storedHealth:get(healthType)
|
|
32
32
|
local currentHealthValue = getCurrentHealthValue(nil, player, healthType)
|
|
33
|
-
if
|
|
33
|
+
if storedHealthValue ~= nil and storedHealthValue ~= currentHealthValue then
|
|
34
34
|
local amount = currentHealthValue - storedHealthValue
|
|
35
35
|
postPlayerChangeHealth:fire(player, healthType, amount)
|
|
36
36
|
end
|
|
@@ -45,43 +45,43 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
45
45
|
return player:GetHearts()
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
|
-
____cond10 = ____cond10 or
|
|
48
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.SOUL
|
|
49
49
|
if ____cond10 then
|
|
50
50
|
do
|
|
51
51
|
return player:GetSoulHearts()
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
|
-
____cond10 = ____cond10 or
|
|
54
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.ETERNAL
|
|
55
55
|
if ____cond10 then
|
|
56
56
|
do
|
|
57
57
|
return player:GetEternalHearts()
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
|
-
____cond10 = ____cond10 or
|
|
60
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.BLACK
|
|
61
61
|
if ____cond10 then
|
|
62
62
|
do
|
|
63
63
|
return player:GetBlackHearts()
|
|
64
64
|
end
|
|
65
65
|
end
|
|
66
|
-
____cond10 = ____cond10 or
|
|
66
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.GOLDEN
|
|
67
67
|
if ____cond10 then
|
|
68
68
|
do
|
|
69
69
|
return player:GetGoldenHearts()
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
|
-
____cond10 = ____cond10 or
|
|
72
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.BONE
|
|
73
73
|
if ____cond10 then
|
|
74
74
|
do
|
|
75
75
|
return player:GetBoneHearts()
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
|
-
____cond10 = ____cond10 or
|
|
78
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.ROTTEN
|
|
79
79
|
if ____cond10 then
|
|
80
80
|
do
|
|
81
81
|
return player:GetRottenHearts()
|
|
82
82
|
end
|
|
83
83
|
end
|
|
84
|
-
____cond10 = ____cond10 or
|
|
84
|
+
____cond10 = ____cond10 or ____switch10 == HealthType.MAX_HEARTS
|
|
85
85
|
if ____cond10 then
|
|
86
86
|
do
|
|
87
87
|
return player:GetMaxHearts()
|
|
@@ -95,11 +95,7 @@ function getCurrentHealthValue(self, player, healthType)
|
|
|
95
95
|
end
|
|
96
96
|
until true
|
|
97
97
|
end
|
|
98
|
-
v = {
|
|
99
|
-
run = {
|
|
100
|
-
healthMap = __TS__New(Map)
|
|
101
|
-
}
|
|
102
|
-
}
|
|
98
|
+
v = {run = {healthMap = __TS__New(Map)}}
|
|
103
99
|
function ____exports.postPlayerChangeHealthCallbackInit(self, mod)
|
|
104
100
|
saveDataManager(nil, "postPlayerChangeHealth", v, hasSubscriptions)
|
|
105
101
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReordered)
|
|
@@ -28,11 +28,7 @@ function postPlayerUpdateReorderedPlayer(self, player)
|
|
|
28
28
|
postPlayerChangeType:fire(player)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
run = {
|
|
33
|
-
characterMap = __TS__New(Map)
|
|
34
|
-
}
|
|
35
|
-
}
|
|
31
|
+
v = {run = {characterMap = __TS__New(Map)}}
|
|
36
32
|
function ____exports.postPlayerChangeTypeCallbackInit(self, mod)
|
|
37
33
|
saveDataManager(nil, "postPlayerChangeType", v, hasSubscriptions)
|
|
38
34
|
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED, postPlayerUpdateReorderedPlayer, 0)
|
|
@@ -21,7 +21,7 @@ function entityTakeDmgPlayer(self, tookDamage, damageAmount, _damageFlags, _dama
|
|
|
21
21
|
if willPlayerRevive(nil, player) then
|
|
22
22
|
return nil
|
|
23
23
|
end
|
|
24
|
-
if
|
|
24
|
+
if not damageIsFatal(nil, player, damageAmount) and not hasLostCurse(nil, player) then
|
|
25
25
|
return nil
|
|
26
26
|
end
|
|
27
27
|
local shouldSustainDeath = postPlayerFatalDamage:fire(player)
|
|
@@ -43,7 +43,7 @@ function damageIsFatal(self, player, damageAmount)
|
|
|
43
43
|
local eternalHearts = player:GetEternalHearts()
|
|
44
44
|
local soulHearts = player:GetSoulHearts()
|
|
45
45
|
local boneHearts = player:GetBoneHearts()
|
|
46
|
-
if
|
|
46
|
+
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
|
|
47
47
|
return false
|
|
48
48
|
end
|
|
49
49
|
return true
|
|
@@ -20,11 +20,7 @@ function postPlayerUpdate(self, player)
|
|
|
20
20
|
postPlayerInitLate:fire(player)
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
|
-
v = {
|
|
24
|
-
run = {
|
|
25
|
-
firedSet = __TS__New(Set)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
23
|
+
v = {run = {firedSet = __TS__New(Set)}}
|
|
28
24
|
function ____exports.postPlayerInitLateCallbackInit(self, mod)
|
|
29
25
|
saveDataManager(nil, "postPlayerInitLate", v, hasSubscriptions)
|
|
30
26
|
mod:AddCallback(ModCallbacks.MC_POST_PLAYER_UPDATE, postPlayerUpdate)
|
|
@@ -13,7 +13,7 @@ local postPlayerInitReordered = require("callbacks.subscriptions.postPlayerInitR
|
|
|
13
13
|
local postPlayerRenderReordered = require("callbacks.subscriptions.postPlayerRenderReordered")
|
|
14
14
|
local postPlayerUpdateReordered = require("callbacks.subscriptions.postPlayerUpdateReordered")
|
|
15
15
|
function hasSubscriptions(self)
|
|
16
|
-
return
|
|
16
|
+
return postPlayerInitReordered:hasSubscriptions() or postPlayerUpdateReordered:hasSubscriptions() or postPlayerRenderReordered:hasSubscriptions()
|
|
17
17
|
end
|
|
18
18
|
function postPlayerInit(self, player)
|
|
19
19
|
if not hasSubscriptions(nil) then
|
|
@@ -17,7 +17,7 @@ function postProjectileUpdate(self, projectile)
|
|
|
17
17
|
end
|
|
18
18
|
local roomIndex = getRoomIndex(nil)
|
|
19
19
|
local roomVisitedCount = getRoomVisitedCount(nil)
|
|
20
|
-
if
|
|
20
|
+
if roomIndex ~= v.run.currentRoomIndex or roomVisitedCount ~= v.run.currentRoomVisitedCount then
|
|
21
21
|
v.run.currentRoomIndex = roomIndex
|
|
22
22
|
v.run.currentRoomVisitedCount = roomVisitedCount
|
|
23
23
|
v.run.firedSet:clear()
|
|
@@ -28,13 +28,11 @@ function postProjectileUpdate(self, projectile)
|
|
|
28
28
|
postProjectileInitLate:fire(projectile)
|
|
29
29
|
end
|
|
30
30
|
end
|
|
31
|
-
v = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}
|
|
31
|
+
v = {run = {
|
|
32
|
+
firedSet = __TS__New(Set),
|
|
33
|
+
currentRoomIndex = nil,
|
|
34
|
+
currentRoomVisitedCount = nil
|
|
35
|
+
}}
|
|
38
36
|
function ____exports.postProjectileInitLateCallbackInit(self, mod)
|
|
39
37
|
saveDataManager(nil, "postProjectileInitLate", v, hasSubscriptions)
|
|
40
38
|
mod:AddCallback(ModCallbacks.MC_POST_PROJECTILE_UPDATE, postProjectileUpdate)
|
|
@@ -22,12 +22,10 @@ function postUpdate(self)
|
|
|
22
22
|
storePlayersInMap(nil, players)
|
|
23
23
|
end
|
|
24
24
|
function checkPickupsPurchased(self, pickups, players)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
) do
|
|
28
|
-
local index
|
|
25
|
+
local pickupDescription
|
|
26
|
+
local index
|
|
27
|
+
for ____, ____value in __TS__Iterator(v.room.pickupMap:entries()) do
|
|
29
28
|
index = ____value[1]
|
|
30
|
-
local pickupDescription
|
|
31
29
|
pickupDescription = ____value[2]
|
|
32
30
|
do
|
|
33
31
|
if pickupIndexExists(nil, index, pickups) then
|
|
@@ -42,7 +40,7 @@ function checkPickupsPurchased(self, pickups, players)
|
|
|
42
40
|
if playerHoldingItemLastFrame == nil then
|
|
43
41
|
goto __continue9
|
|
44
42
|
end
|
|
45
|
-
if
|
|
43
|
+
if not playerHoldingItemLastFrame and playerHoldingItem then
|
|
46
44
|
postPurchase:fire(player, pickupDescription.variant, pickupDescription.subtype, pickupDescription.price)
|
|
47
45
|
break
|
|
48
46
|
end
|
|
@@ -57,7 +55,7 @@ function storePickupsInMap(self, pickups)
|
|
|
57
55
|
for ____, entity in ipairs(pickups) do
|
|
58
56
|
do
|
|
59
57
|
local pickup = entity:ToPickup()
|
|
60
|
-
if
|
|
58
|
+
if pickup == nil or pickup.Price == 0 then
|
|
61
59
|
goto __continue13
|
|
62
60
|
end
|
|
63
61
|
v.room.pickupMap:set(pickup.Index, {variant = pickup.Variant, subtype = pickup.SubType, price = pickup.Price})
|
|
@@ -74,18 +72,16 @@ function storePlayersInMap(self, players)
|
|
|
74
72
|
end
|
|
75
73
|
function pickupIndexExists(self, index, pickups)
|
|
76
74
|
for ____, entity in ipairs(pickups) do
|
|
77
|
-
if
|
|
75
|
+
if entity.Index == index and entity:Exists() then
|
|
78
76
|
return true
|
|
79
77
|
end
|
|
80
78
|
end
|
|
81
79
|
return false
|
|
82
80
|
end
|
|
83
|
-
v = {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
}
|
|
81
|
+
v = {room = {
|
|
82
|
+
pickupMap = __TS__New(Map),
|
|
83
|
+
playerHoldingItemLastFrameMap = __TS__New(Map)
|
|
84
|
+
}}
|
|
89
85
|
function ____exports.postPurchaseCallbackInit(self, mod)
|
|
90
86
|
saveDataManager(nil, "postPurchase", v, hasSubscriptions)
|
|
91
87
|
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
|
|
@@ -21,9 +21,9 @@ function entityTakeDmgPlayer(self, tookDamage, _damageAmount, damageFlags, _dama
|
|
|
21
21
|
local room = game:GetRoom()
|
|
22
22
|
local roomType = room:GetType()
|
|
23
23
|
local isSpikeDamage = hasFlag(nil, damageFlags, DamageFlag.DAMAGE_SPIKES)
|
|
24
|
-
if
|
|
25
|
-
local
|
|
26
|
-
|
|
24
|
+
if roomType == RoomType.ROOM_SACRIFICE and isSpikeDamage then
|
|
25
|
+
local ____v_level_0, ____numSacrifices_1 = v.level, "numSacrifices"
|
|
26
|
+
____v_level_0[____numSacrifices_1] = ____v_level_0[____numSacrifices_1] + 1
|
|
27
27
|
postSacrifice:fire(player, v.level.numSacrifices)
|
|
28
28
|
end
|
|
29
29
|
end
|