isaacscript-common 1.2.289 → 1.2.292
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/postCustomDoorEnter.lua +4 -4
- package/dist/callbacks/postGridEntity.lua +5 -5
- package/dist/callbacks/postHolyMantleRemoved.d.ts +1 -0
- package/dist/callbacks/postHolyMantleRemoved.lua +37 -0
- package/dist/callbacks/postItemDischarged.d.ts +2 -0
- package/dist/callbacks/postItemDischarged.lua +99 -0
- package/dist/callbacks/postRoomClearChanged.d.ts +1 -0
- package/dist/callbacks/postRoomClearChanged.lua +39 -0
- package/dist/callbacks/subscriptions/postGridEntityStateChanged.d.ts +2 -0
- package/dist/callbacks/subscriptions/postGridEntityStateChanged.lua +23 -0
- package/dist/callbacks/subscriptions/postHolyMantleRemoved.d.ts +2 -0
- package/dist/callbacks/subscriptions/postHolyMantleRemoved.lua +16 -0
- package/dist/callbacks/subscriptions/postItemDischarged.d.ts +2 -0
- package/dist/callbacks/subscriptions/postItemDischarged.lua +23 -0
- package/dist/callbacks/subscriptions/postNPCStateChanged.lua +6 -2
- package/dist/callbacks/subscriptions/postRoomClearChanged.d.ts +1 -0
- package/dist/callbacks/subscriptions/postRoomClearChanged.lua +16 -0
- package/dist/enums/ModCallbacksCustom.d.ts +80 -57
- package/dist/enums/ModCallbacksCustom.lua +107 -103
- package/dist/functions/pocketItems.d.ts +5 -0
- package/dist/functions/pocketItems.lua +9 -0
- package/dist/initCustomCallbacks.d.ts +2 -0
- package/dist/initCustomCallbacks.lua +131 -0
- package/dist/initFeatures.d.ts +3 -0
- package/dist/initFeatures.lua +55 -0
- package/dist/objects/callbackRegisterFunctions.lua +56 -50
- package/dist/types/AddCallbackParametersCustom.d.ts +149 -137
- package/dist/upgradeMod.lua +5 -175
- package/package.json +5 -3
|
@@ -3,7 +3,7 @@ local Set = ____lualib.Set
|
|
|
3
3
|
local __TS__New = ____lualib.__TS__New
|
|
4
4
|
local Map = ____lualib.Map
|
|
5
5
|
local ____exports = {}
|
|
6
|
-
local hasSubscriptions, postEffectUpdaterCustomEntity, doorChangedState, getAnimationForCustomDoor, postEffectRenderCustomEntity, isPlayerPastDoorThreshold,
|
|
6
|
+
local hasSubscriptions, postEffectUpdaterCustomEntity, doorChangedState, getAnimationForCustomDoor, postEffectRenderCustomEntity, isPlayerPastDoorThreshold, postRoomClearChanged, getPositionOffset, POSITION_OFFSET_MULTIPLIER, v
|
|
7
7
|
local ____cachedClasses = require("cachedClasses")
|
|
8
8
|
local game = ____cachedClasses.game
|
|
9
9
|
local ____ModCallbacksCustom = require("enums.ModCallbacksCustom")
|
|
@@ -131,7 +131,7 @@ function isPlayerPastDoorThreshold(self, effect, player, direction)
|
|
|
131
131
|
end
|
|
132
132
|
until true
|
|
133
133
|
end
|
|
134
|
-
function
|
|
134
|
+
function postRoomClearChanged(self, roomClear, effectVariant)
|
|
135
135
|
local state = roomClear and DoorState.STATE_OPEN or DoorState.STATE_CLOSED
|
|
136
136
|
local customDoors = getEffects(nil, effectVariant)
|
|
137
137
|
for ____, customDoor in ipairs(customDoors) do
|
|
@@ -157,9 +157,9 @@ function ____exports.initCustomDoor(self, mod, effectVariant)
|
|
|
157
157
|
mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdaterCustomEntity, effectVariant)
|
|
158
158
|
mod:AddCallback(ModCallbacks.MC_POST_EFFECT_RENDER, postEffectRenderCustomEntity, effectVariant)
|
|
159
159
|
mod:AddCallbackCustom(
|
|
160
|
-
ModCallbacksCustom.
|
|
160
|
+
ModCallbacksCustom.MC_POST_ROOM_CLEAR_CHANGED,
|
|
161
161
|
function(____, roomClear)
|
|
162
|
-
|
|
162
|
+
postRoomClearChanged(nil, roomClear, effectVariant)
|
|
163
163
|
end
|
|
164
164
|
)
|
|
165
165
|
end
|
|
@@ -18,14 +18,14 @@ local postGridEntityInitHasSubscriptions = ____postGridEntityInit.postGridEntity
|
|
|
18
18
|
local ____postGridEntityRemove = require("callbacks.subscriptions.postGridEntityRemove")
|
|
19
19
|
local postGridEntityRemoveFire = ____postGridEntityRemove.postGridEntityRemoveFire
|
|
20
20
|
local postGridEntityRemoveHasSubscriptions = ____postGridEntityRemove.postGridEntityRemoveHasSubscriptions
|
|
21
|
-
local
|
|
22
|
-
local
|
|
23
|
-
local
|
|
21
|
+
local ____postGridEntityStateChanged = require("callbacks.subscriptions.postGridEntityStateChanged")
|
|
22
|
+
local postGridEntityStateChangedFire = ____postGridEntityStateChanged.postGridEntityStateChangedFire
|
|
23
|
+
local postGridEntityStateChangedHasSubscriptions = ____postGridEntityStateChanged.postGridEntityStateChangedHasSubscriptions
|
|
24
24
|
local ____postGridEntityUpdate = require("callbacks.subscriptions.postGridEntityUpdate")
|
|
25
25
|
local postGridEntityUpdateFire = ____postGridEntityUpdate.postGridEntityUpdateFire
|
|
26
26
|
local postGridEntityUpdateHasSubscriptions = ____postGridEntityUpdate.postGridEntityUpdateHasSubscriptions
|
|
27
27
|
function hasSubscriptions(self)
|
|
28
|
-
return postGridEntityInitHasSubscriptions(nil) or postGridEntityUpdateHasSubscriptions(nil) or postGridEntityRemoveHasSubscriptions(nil) or
|
|
28
|
+
return postGridEntityInitHasSubscriptions(nil) or postGridEntityUpdateHasSubscriptions(nil) or postGridEntityRemoveHasSubscriptions(nil) or postGridEntityStateChangedHasSubscriptions(nil) or postGridEntityBrokenHasSubscriptions(nil)
|
|
29
29
|
end
|
|
30
30
|
function postUpdate(self)
|
|
31
31
|
if not hasSubscriptions(nil) then
|
|
@@ -62,7 +62,7 @@ function checkGridEntityStateChanged(self, gridIndex, gridEntity)
|
|
|
62
62
|
local newState = gridEntity.State
|
|
63
63
|
if oldState ~= newState then
|
|
64
64
|
updateTupleInMap(nil, gridEntity)
|
|
65
|
-
|
|
65
|
+
postGridEntityStateChangedFire(nil, gridEntity, oldState, newState)
|
|
66
66
|
if isGridEntityBroken(nil, gridEntity) then
|
|
67
67
|
postGridEntityBrokenFire(nil, gridEntity)
|
|
68
68
|
end
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local ____exports = {}
|
|
4
|
+
local hasSubscriptions, postPEffectUpdateReordered, v
|
|
5
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
6
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
7
|
+
local ____ModCallbacksCustom = require("enums.ModCallbacksCustom")
|
|
8
|
+
local ModCallbacksCustom = ____ModCallbacksCustom.ModCallbacksCustom
|
|
9
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
10
|
+
local saveDataManager = ____exports.saveDataManager
|
|
11
|
+
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
12
|
+
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
13
|
+
local defaultMapSetPlayer = ____playerDataStructures.defaultMapSetPlayer
|
|
14
|
+
local ____postHolyMantleRemoved = require("callbacks.subscriptions.postHolyMantleRemoved")
|
|
15
|
+
local postHolyMantleRemovedFire = ____postHolyMantleRemoved.postHolyMantleRemovedFire
|
|
16
|
+
local postHolyMantleRemovedHasSubscriptions = ____postHolyMantleRemoved.postHolyMantleRemovedHasSubscriptions
|
|
17
|
+
function hasSubscriptions(self)
|
|
18
|
+
return postHolyMantleRemovedHasSubscriptions(nil)
|
|
19
|
+
end
|
|
20
|
+
function postPEffectUpdateReordered(self, player)
|
|
21
|
+
if not hasSubscriptions(nil) then
|
|
22
|
+
return
|
|
23
|
+
end
|
|
24
|
+
local effects = player:GetEffects()
|
|
25
|
+
local newNumHolyMantles = effects:GetCollectibleEffectNum(CollectibleType.COLLECTIBLE_HOLY_MANTLE)
|
|
26
|
+
local oldNumHolyMantles = defaultMapGetPlayer(nil, v.run.playersHolyMantleMap, player)
|
|
27
|
+
defaultMapSetPlayer(nil, v.run.playersHolyMantleMap, player, newNumHolyMantles)
|
|
28
|
+
if newNumHolyMantles < oldNumHolyMantles then
|
|
29
|
+
postHolyMantleRemovedFire(nil, player, oldNumHolyMantles, newNumHolyMantles)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
v = {run = {playersHolyMantleMap = __TS__New(DefaultMap, 0)}}
|
|
33
|
+
function ____exports.postHolyMantleRemovedCallbackInit(self, mod)
|
|
34
|
+
saveDataManager(nil, "postHolyMantleRemoved", v, hasSubscriptions)
|
|
35
|
+
mod:AddCallbackCustom(ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED, postPEffectUpdateReordered)
|
|
36
|
+
end
|
|
37
|
+
return ____exports
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
local ____lualib = require("lualib_bundle")
|
|
2
|
+
local __TS__New = ____lualib.__TS__New
|
|
3
|
+
local Map = ____lualib.Map
|
|
4
|
+
local ____exports = {}
|
|
5
|
+
local hasSubscriptions, postPEffectUpdate, playerRecentlyCollidedWithBulb, preNPCCollision, v
|
|
6
|
+
local ____cachedClasses = require("cachedClasses")
|
|
7
|
+
local game = ____cachedClasses.game
|
|
8
|
+
local ____DefaultMap = require("classes.DefaultMap")
|
|
9
|
+
local DefaultMap = ____DefaultMap.DefaultMap
|
|
10
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
11
|
+
local saveDataManager = ____exports.saveDataManager
|
|
12
|
+
local ____charge = require("functions.charge")
|
|
13
|
+
local getTotalCharge = ____charge.getTotalCharge
|
|
14
|
+
local ____playerDataStructures = require("functions.playerDataStructures")
|
|
15
|
+
local defaultMapGetPlayer = ____playerDataStructures.defaultMapGetPlayer
|
|
16
|
+
local mapGetPlayer = ____playerDataStructures.mapGetPlayer
|
|
17
|
+
local mapSetPlayer = ____playerDataStructures.mapSetPlayer
|
|
18
|
+
local ____utils = require("functions.utils")
|
|
19
|
+
local getEnumValues = ____utils.getEnumValues
|
|
20
|
+
local ____postItemDischarged = require("callbacks.subscriptions.postItemDischarged")
|
|
21
|
+
local postItemDischargeFire = ____postItemDischarged.postItemDischargeFire
|
|
22
|
+
local postItemDischargeHasSubscriptions = ____postItemDischarged.postItemDischargeHasSubscriptions
|
|
23
|
+
function hasSubscriptions(self)
|
|
24
|
+
return postItemDischargeHasSubscriptions(nil)
|
|
25
|
+
end
|
|
26
|
+
function postPEffectUpdate(self, player)
|
|
27
|
+
if not hasSubscriptions(nil) then
|
|
28
|
+
return
|
|
29
|
+
end
|
|
30
|
+
local activeItemMap = defaultMapGetPlayer(nil, v.run.playersActiveItemMap, player)
|
|
31
|
+
local chargeMap = defaultMapGetPlayer(nil, v.run.playersActiveChargeMap, player)
|
|
32
|
+
for ____, activeSlot in ipairs(getEnumValues(nil, ActiveSlot)) do
|
|
33
|
+
do
|
|
34
|
+
local currentActiveItem = player:GetActiveItem()
|
|
35
|
+
local previousActiveItem = activeItemMap:getAndSetDefault(activeSlot, currentActiveItem)
|
|
36
|
+
activeItemMap:set(activeSlot, currentActiveItem)
|
|
37
|
+
if currentActiveItem ~= previousActiveItem then
|
|
38
|
+
goto __continue10
|
|
39
|
+
end
|
|
40
|
+
local currentCharge = getTotalCharge(nil, player, activeSlot)
|
|
41
|
+
local previousCharge = chargeMap:getAndSetDefault(activeSlot, currentCharge)
|
|
42
|
+
chargeMap:set(activeSlot, currentCharge)
|
|
43
|
+
if playerRecentlyCollidedWithBulb(nil, player) then
|
|
44
|
+
goto __continue10
|
|
45
|
+
end
|
|
46
|
+
if currentCharge < previousCharge then
|
|
47
|
+
local collectibleType = player:GetActiveItem(activeSlot)
|
|
48
|
+
postItemDischargeFire(nil, player, collectibleType, activeSlot)
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
::__continue10::
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
function playerRecentlyCollidedWithBulb(self, player)
|
|
55
|
+
local gameFrameCount = game:GetFrameCount()
|
|
56
|
+
local bulbLastCollisionFrame = mapGetPlayer(nil, v.room.playersBulbLastCollisionFrame, player)
|
|
57
|
+
local collidedOnThisFrame = gameFrameCount == bulbLastCollisionFrame
|
|
58
|
+
local collidedOnLastFrame = gameFrameCount - 1 == bulbLastCollisionFrame
|
|
59
|
+
return collidedOnThisFrame or collidedOnLastFrame
|
|
60
|
+
end
|
|
61
|
+
function preNPCCollision(self, npc, collider)
|
|
62
|
+
if not hasSubscriptions(nil) then
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
if npc.Variant ~= 5 then
|
|
66
|
+
return
|
|
67
|
+
end
|
|
68
|
+
local player = collider:ToPlayer()
|
|
69
|
+
if player == nil then
|
|
70
|
+
return
|
|
71
|
+
end
|
|
72
|
+
local gameFrameCount = game:GetFrameCount()
|
|
73
|
+
mapSetPlayer(nil, v.room.playersBulbLastCollisionFrame, player, gameFrameCount)
|
|
74
|
+
end
|
|
75
|
+
v = {
|
|
76
|
+
run = {
|
|
77
|
+
playersActiveItemMap = __TS__New(
|
|
78
|
+
DefaultMap,
|
|
79
|
+
function() return __TS__New(
|
|
80
|
+
DefaultMap,
|
|
81
|
+
function(____, _playerIndex, collectibleType) return collectibleType end
|
|
82
|
+
) end
|
|
83
|
+
),
|
|
84
|
+
playersActiveChargeMap = __TS__New(
|
|
85
|
+
DefaultMap,
|
|
86
|
+
function() return __TS__New(
|
|
87
|
+
DefaultMap,
|
|
88
|
+
function(____, _playerIndex, charge) return charge end
|
|
89
|
+
) end
|
|
90
|
+
)
|
|
91
|
+
},
|
|
92
|
+
room = {playersBulbLastCollisionFrame = __TS__New(Map)}
|
|
93
|
+
}
|
|
94
|
+
function ____exports.postItemDischargeCallbackInit(self, mod)
|
|
95
|
+
saveDataManager(nil, "postItemDischarge", v, hasSubscriptions)
|
|
96
|
+
mod:AddCallback(ModCallbacks.MC_POST_PEFFECT_UPDATE, postPEffectUpdate)
|
|
97
|
+
mod:AddCallback(ModCallbacks.MC_PRE_NPC_COLLISION, preNPCCollision, EntityType.ENTITY_SUCKER)
|
|
98
|
+
end
|
|
99
|
+
return ____exports
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local hasSubscriptions, postUpdate, postNewRoom, v
|
|
4
|
+
local ____cachedClasses = require("cachedClasses")
|
|
5
|
+
local game = ____cachedClasses.game
|
|
6
|
+
local ____exports = require("features.saveDataManager.exports")
|
|
7
|
+
local saveDataManager = ____exports.saveDataManager
|
|
8
|
+
local ____postRoomClearChanged = require("callbacks.subscriptions.postRoomClearChanged")
|
|
9
|
+
local postRoomClearChangedFire = ____postRoomClearChanged.postRoomClearChangedFire
|
|
10
|
+
local postRoomClearChangedHasSubscriptions = ____postRoomClearChanged.postRoomClearChangedHasSubscriptions
|
|
11
|
+
function hasSubscriptions(self)
|
|
12
|
+
return postRoomClearChangedHasSubscriptions(nil)
|
|
13
|
+
end
|
|
14
|
+
function postUpdate(self)
|
|
15
|
+
if not hasSubscriptions(nil) then
|
|
16
|
+
return
|
|
17
|
+
end
|
|
18
|
+
local room = game:GetRoom()
|
|
19
|
+
local roomClear = room:IsClear()
|
|
20
|
+
if roomClear ~= v.room.cleared then
|
|
21
|
+
v.room.cleared = roomClear
|
|
22
|
+
postRoomClearChangedFire(nil, roomClear)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
function postNewRoom(self)
|
|
26
|
+
if not hasSubscriptions(nil) then
|
|
27
|
+
return
|
|
28
|
+
end
|
|
29
|
+
local room = game:GetRoom()
|
|
30
|
+
local roomClear = room:IsClear()
|
|
31
|
+
v.room.cleared = roomClear
|
|
32
|
+
end
|
|
33
|
+
v = {room = {cleared = false}}
|
|
34
|
+
function ____exports.postRoomClearChangedCallbackInit(self, mod)
|
|
35
|
+
saveDataManager(nil, "postRoomClearChanged", v, hasSubscriptions)
|
|
36
|
+
mod:AddCallback(ModCallbacks.MC_POST_UPDATE, postUpdate)
|
|
37
|
+
mod:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, postNewRoom)
|
|
38
|
+
end
|
|
39
|
+
return ____exports
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local subscriptions = {}
|
|
4
|
+
function ____exports.postGridEntityStateChangedHasSubscriptions(self)
|
|
5
|
+
return #subscriptions > 0
|
|
6
|
+
end
|
|
7
|
+
function ____exports.postGridEntityStateChangedRegister(self, callback, gridEntityType)
|
|
8
|
+
subscriptions[#subscriptions + 1] = {callback, gridEntityType}
|
|
9
|
+
end
|
|
10
|
+
function ____exports.postGridEntityStateChangedFire(self, gridEntity, oldState, newState)
|
|
11
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
12
|
+
local callback = ____value[1]
|
|
13
|
+
local gridEntityType = ____value[2]
|
|
14
|
+
do
|
|
15
|
+
if gridEntityType ~= nil and gridEntityType ~= gridEntity:GetType() then
|
|
16
|
+
goto __continue5
|
|
17
|
+
end
|
|
18
|
+
callback(nil, gridEntity, oldState, newState)
|
|
19
|
+
end
|
|
20
|
+
::__continue5::
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
return ____exports
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local subscriptions = {}
|
|
4
|
+
function ____exports.postHolyMantleRemovedHasSubscriptions(self)
|
|
5
|
+
return #subscriptions > 0
|
|
6
|
+
end
|
|
7
|
+
function ____exports.postHolyMantleRemovedRegister(self, callback, playerVariant, character)
|
|
8
|
+
subscriptions[#subscriptions + 1] = {callback, playerVariant, character}
|
|
9
|
+
end
|
|
10
|
+
function ____exports.postHolyMantleRemovedFire(self, player, oldNumHolyMantles, newNumHolyMantles)
|
|
11
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
12
|
+
local callback = ____value[1]
|
|
13
|
+
callback(nil, player, oldNumHolyMantles, newNumHolyMantles)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
return ____exports
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local subscriptions = {}
|
|
4
|
+
function ____exports.postItemDischargeHasSubscriptions(self)
|
|
5
|
+
return #subscriptions > 0
|
|
6
|
+
end
|
|
7
|
+
function ____exports.postItemDischargeRegister(self, callback, activeSlot)
|
|
8
|
+
subscriptions[#subscriptions + 1] = {callback, activeSlot}
|
|
9
|
+
end
|
|
10
|
+
function ____exports.postItemDischargeFire(self, player, collectibleType, activeSlot)
|
|
11
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
12
|
+
local callback = ____value[1]
|
|
13
|
+
local callbackCollectibleType = ____value[2]
|
|
14
|
+
do
|
|
15
|
+
if callbackCollectibleType ~= nil and callbackCollectibleType ~= collectibleType then
|
|
16
|
+
goto __continue5
|
|
17
|
+
end
|
|
18
|
+
callback(nil, player, collectibleType, activeSlot)
|
|
19
|
+
end
|
|
20
|
+
::__continue5::
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
return ____exports
|
|
@@ -4,17 +4,21 @@ local subscriptions = {}
|
|
|
4
4
|
function ____exports.postNPCStateChangedHasSubscriptions(self)
|
|
5
5
|
return #subscriptions > 0
|
|
6
6
|
end
|
|
7
|
-
function ____exports.postNPCStateChangedRegister(self, callback, entityType)
|
|
8
|
-
subscriptions[#subscriptions + 1] = {callback, entityType}
|
|
7
|
+
function ____exports.postNPCStateChangedRegister(self, callback, entityType, variant)
|
|
8
|
+
subscriptions[#subscriptions + 1] = {callback, entityType, variant}
|
|
9
9
|
end
|
|
10
10
|
function ____exports.postNPCStateChangedFire(self, npc, previousState, currentState)
|
|
11
11
|
for ____, ____value in ipairs(subscriptions) do
|
|
12
12
|
local callback = ____value[1]
|
|
13
13
|
local entityType = ____value[2]
|
|
14
|
+
local variant = ____value[3]
|
|
14
15
|
do
|
|
15
16
|
if entityType ~= nil and entityType ~= npc.Type then
|
|
16
17
|
goto __continue5
|
|
17
18
|
end
|
|
19
|
+
if variant ~= nil and variant ~= npc.Variant then
|
|
20
|
+
goto __continue5
|
|
21
|
+
end
|
|
18
22
|
callback(nil, npc, previousState, currentState)
|
|
19
23
|
end
|
|
20
24
|
::__continue5::
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type PostRoomClearChangedCallbackType = (roomClear: boolean) => void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
|
|
2
|
+
local ____exports = {}
|
|
3
|
+
local subscriptions = {}
|
|
4
|
+
function ____exports.postRoomClearChangedHasSubscriptions(self)
|
|
5
|
+
return #subscriptions > 0
|
|
6
|
+
end
|
|
7
|
+
function ____exports.postRoomClearChangedRegister(self, callback)
|
|
8
|
+
subscriptions[#subscriptions + 1] = {callback}
|
|
9
|
+
end
|
|
10
|
+
function ____exports.postRoomClearChangedFire(self, roomClear)
|
|
11
|
+
for ____, ____value in ipairs(subscriptions) do
|
|
12
|
+
local callback = ____value[1]
|
|
13
|
+
callback(nil, roomClear)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
return ____exports
|
|
@@ -6,61 +6,84 @@
|
|
|
6
6
|
* [Function Signatures](https://isaacscript.github.io/docs/function-signatures#custom-callbacks).
|
|
7
7
|
*/
|
|
8
8
|
export declare enum ModCallbacksCustom {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
9
|
+
MC_POST_BOMB_INIT_LATE = 0,
|
|
10
|
+
MC_POST_BONE_SWING = 1,
|
|
11
|
+
MC_POST_COLLECTIBLE_INIT_FIRST = 2,
|
|
12
|
+
MC_POST_CURSED_TELEPORT = 3,
|
|
13
|
+
MC_POST_CUSTOM_DOOR_ENTER = 4,
|
|
14
|
+
MC_POST_CUSTOM_REVIVE = 5,
|
|
15
|
+
MC_POST_EFFECT_INIT_LATE = 6,
|
|
16
|
+
MC_POST_EFFECT_STATE_CHANGED = 7,
|
|
17
|
+
MC_POST_ESAU_JR = 8,
|
|
18
|
+
MC_POST_FAMILIAR_INIT_LATE = 9,
|
|
19
|
+
MC_POST_FAMILIAR_STATE_CHANGED = 10,
|
|
20
|
+
MC_POST_FIRST_ESAU_JR = 11,
|
|
21
|
+
MC_POST_FIRST_FLIP = 12,
|
|
22
|
+
MC_POST_FLIP = 13,
|
|
23
|
+
MC_POST_GAME_STARTED_REORDERED = 14,
|
|
24
|
+
MC_POST_GRID_ENTITY_BROKEN = 15,
|
|
25
|
+
MC_POST_GRID_ENTITY_COLLISION = 16,
|
|
26
|
+
MC_POST_GRID_ENTITY_INIT = 17,
|
|
27
|
+
MC_POST_GRID_ENTITY_REMOVE = 18,
|
|
28
|
+
MC_POST_GRID_ENTITY_STATE_CHANGED = 19,
|
|
29
|
+
MC_POST_GRID_ENTITY_UPDATE = 20,
|
|
30
|
+
/**
|
|
31
|
+
* Fires from the `MC_POST_PEFFECT_UPDATE` callback when the player loses a Holy Mantle temporary
|
|
32
|
+
* collectible effect.
|
|
33
|
+
*
|
|
34
|
+
* This callback is useful because you might want to have code that happens when the player is hit
|
|
35
|
+
* from an enemy. Normally, you would accomplish this via the `MC_ENTITY_TAKE_DMG` callback, but
|
|
36
|
+
* that callback never fires if the player has a Holy Mantle shield.
|
|
37
|
+
*
|
|
38
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
39
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
40
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
41
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
42
|
+
*
|
|
43
|
+
* ```ts
|
|
44
|
+
* function postPlayerInitReordered(
|
|
45
|
+
* player: EntityPlayer,
|
|
46
|
+
* oldNumHolyMantles: int,
|
|
47
|
+
* newNumHolyMantles: int,
|
|
48
|
+
* ): void {}
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
MC_POST_HOLY_MANTLE_REMOVED = 21,
|
|
52
|
+
MC_POST_ITEM_DISCHARGE = 22,
|
|
53
|
+
MC_POST_ITEM_PICKUP = 23,
|
|
54
|
+
MC_POST_KNIFE_INIT_LATE = 24,
|
|
55
|
+
MC_POST_LASER_INIT_LATE = 25,
|
|
56
|
+
MC_POST_NEW_LEVEL_REORDERED = 26,
|
|
57
|
+
MC_POST_NEW_ROOM_EARLY = 27,
|
|
58
|
+
MC_POST_NEW_ROOM_REORDERED = 28,
|
|
59
|
+
MC_POST_NPC_INIT_LATE = 29,
|
|
60
|
+
MC_POST_NPC_STATE_CHANGED = 30,
|
|
61
|
+
MC_POST_PEFFECT_UPDATE_REORDERED = 31,
|
|
62
|
+
MC_POST_PICKUP_COLLECT = 32,
|
|
63
|
+
MC_POST_PICKUP_INIT_LATE = 33,
|
|
64
|
+
MC_POST_PICKUP_STATE_CHANGED = 34,
|
|
65
|
+
MC_POST_PLAYER_CHANGE_HEALTH = 35,
|
|
66
|
+
MC_POST_PLAYER_CHANGE_TYPE = 36,
|
|
67
|
+
MC_POST_PLAYER_FATAL_DAMAGE = 37,
|
|
68
|
+
MC_POST_PLAYER_INIT_LATE = 38,
|
|
69
|
+
MC_POST_PLAYER_INIT_REORDERED = 39,
|
|
70
|
+
MC_POST_PLAYER_RENDER_REORDERED = 40,
|
|
71
|
+
MC_POST_PLAYER_UPDATE_REORDERED = 41,
|
|
72
|
+
MC_POST_PROJECTILE_INIT_LATE = 42,
|
|
73
|
+
MC_POST_PURCHASE = 43,
|
|
74
|
+
MC_POST_ROOM_CLEAR_CHANGED = 44,
|
|
75
|
+
MC_POST_SACRIFICE = 45,
|
|
76
|
+
MC_POST_SLOT_ANIMATION_CHANGED = 46,
|
|
77
|
+
MC_POST_SLOT_DESTROYED = 47,
|
|
78
|
+
MC_POST_SLOT_INIT = 48,
|
|
79
|
+
MC_POST_SLOT_RENDER = 49,
|
|
80
|
+
MC_POST_SLOT_UPDATE = 50,
|
|
81
|
+
MC_POST_TEAR_INIT_LATE = 51,
|
|
82
|
+
MC_POST_TEAR_INIT_VERY_LATE = 52,
|
|
83
|
+
MC_POST_TRANSFORMATION = 53,
|
|
84
|
+
MC_POST_TRINKET_BREAK = 54,
|
|
85
|
+
MC_PRE_BERSERK_DEATH = 55,
|
|
86
|
+
MC_PRE_CUSTOM_REVIVE = 56,
|
|
87
|
+
MC_PRE_ITEM_PICKUP = 57,
|
|
88
|
+
MC_PRE_NEW_LEVEL = 58
|
|
66
89
|
}
|