isaacscript-common 1.2.155 → 1.2.158
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.d.ts +19 -4
- package/dist/callbacks/postCustomDoorEnter.lua +79 -49
- package/dist/functions/log.d.ts +1 -1
- package/dist/functions/log.lua +20 -4
- package/dist/functions/player.lua +24 -28
- package/dist/index.d.ts +1 -1
- package/dist/objects/callbackRegisterFunctions.d.ts +2 -1
- package/dist/types/AddCallbackParametersCustom.d.ts +239 -0
- package/dist/types/AddCallbackParametersCustom.lua +5 -0
- package/dist/types/ModUpgraded.d.ts +4 -3
- package/package.json +3 -3
|
@@ -24,9 +24,24 @@
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function initCustomDoor(mod: Mod, effectVariant: int): void;
|
|
26
26
|
/**
|
|
27
|
-
* Helper function to spawn a custom door.
|
|
28
|
-
* custom
|
|
27
|
+
* Helper function to spawn a custom door. This is intended to be called from the `MC_POST_NEW_ROOM`
|
|
28
|
+
* callback when the player enters a room that should have a custom door. (You could also call it
|
|
29
|
+
* from another callback if you want the door to appear e.g. after clearing all enemies.)
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
+
* Like other entities, the door is not persistent, so you must spawn it every time when re-entering
|
|
32
|
+
* the room.
|
|
33
|
+
*
|
|
34
|
+
* Handle when a player enters the door by hooking the custom `MC_POST_CUSTOM_DOOR_ENTER` callback.
|
|
35
|
+
*
|
|
36
|
+
* The custom door is an `EntityEffect`. You can manually open or close the door by modifying its
|
|
37
|
+
* state. (The values to use correspond to the `DoorState` enum.)
|
|
38
|
+
*
|
|
39
|
+
* This function will throw a runtime error if:
|
|
40
|
+
* - the door slot already has a vanilla door
|
|
41
|
+
* - the door slot already has a custom door
|
|
42
|
+
* - the tile at the door slot does not have a wall
|
|
43
|
+
*
|
|
44
|
+
* Before using this function, you must first initialize the effect/door variant with the
|
|
45
|
+
* `initCustomDoor` function.
|
|
31
46
|
*/
|
|
32
|
-
export declare function spawnCustomDoor(effectVariant: int, doorSlot: DoorSlot):
|
|
47
|
+
export declare function spawnCustomDoor(effectVariant: int, doorSlot: DoorSlot): EntityEffect;
|
|
@@ -4,7 +4,7 @@ local Set = ____lualib.Set
|
|
|
4
4
|
local __TS__New = ____lualib.__TS__New
|
|
5
5
|
local Map = ____lualib.Map
|
|
6
6
|
local ____exports = {}
|
|
7
|
-
local hasSubscriptions, postEffectRenderCustomEntity, isPlayerPastDoorThreshold, getPositionOffset,
|
|
7
|
+
local hasSubscriptions, postEffectUpdaterCustomEntity, doorChangedState, getAnimationForCustomDoor, postEffectRenderCustomEntity, isPlayerPastDoorThreshold, getPositionOffset, POSITION_OFFSET_MULTIPLIER, v
|
|
8
8
|
local ____cachedClasses = require("cachedClasses")
|
|
9
9
|
local game = ____cachedClasses.game
|
|
10
10
|
local ____exports = require("features.saveDataManager.exports")
|
|
@@ -23,12 +23,55 @@ local postCustomDoorEnterHasSubscriptions = ____postCustomDoorEnter.postCustomDo
|
|
|
23
23
|
function hasSubscriptions(self)
|
|
24
24
|
return postCustomDoorEnterHasSubscriptions(nil)
|
|
25
25
|
end
|
|
26
|
-
function
|
|
27
|
-
|
|
26
|
+
function postEffectUpdaterCustomEntity(self, effect)
|
|
27
|
+
local ptrHash = GetPtrHash(effect)
|
|
28
|
+
local doorData = v.room.customDoors:get(ptrHash)
|
|
29
|
+
if doorData == nil then
|
|
28
30
|
return
|
|
29
31
|
end
|
|
32
|
+
if doorData.state == effect.State then
|
|
33
|
+
return
|
|
34
|
+
end
|
|
35
|
+
doorData.state = effect.State
|
|
36
|
+
doorChangedState(nil, effect)
|
|
37
|
+
end
|
|
38
|
+
function doorChangedState(self, effect)
|
|
39
|
+
local room = game:GetRoom()
|
|
40
|
+
local sprite = effect:GetSprite()
|
|
41
|
+
local animation = getAnimationForCustomDoor(nil, effect)
|
|
42
|
+
sprite:Play(animation, true)
|
|
43
|
+
local gridIndex = room:GetGridIndex(effect.Position)
|
|
44
|
+
local wall = room:GetGridEntity(gridIndex)
|
|
45
|
+
if wall ~= nil then
|
|
46
|
+
wall.CollisionClass = effect.State == DoorState.STATE_OPEN and GridCollisionClass.COLLISION_WALL_EXCEPT_PLAYER or GridCollisionClass.COLLISION_WALL
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
function getAnimationForCustomDoor(self, effect)
|
|
50
|
+
local freshlySpawned = effect.FrameCount == 0
|
|
51
|
+
repeat
|
|
52
|
+
local ____switch11 = effect.State
|
|
53
|
+
local ____cond11 = ____switch11 == DoorState.STATE_OPEN
|
|
54
|
+
if ____cond11 then
|
|
55
|
+
do
|
|
56
|
+
return freshlySpawned and "Opened" or "Open"
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
____cond11 = ____cond11 or ____switch11 == DoorState.STATE_CLOSED
|
|
60
|
+
if ____cond11 then
|
|
61
|
+
do
|
|
62
|
+
return freshlySpawned and "Closed" or "Close"
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
do
|
|
66
|
+
do
|
|
67
|
+
return "Opened"
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
until true
|
|
71
|
+
end
|
|
72
|
+
function postEffectRenderCustomEntity(self, effect)
|
|
30
73
|
local ptrHash = GetPtrHash(effect)
|
|
31
|
-
local doorData = v.room.
|
|
74
|
+
local doorData = v.room.customDoors:get(ptrHash)
|
|
32
75
|
if doorData == nil then
|
|
33
76
|
return
|
|
34
77
|
end
|
|
@@ -46,33 +89,33 @@ function postEffectRenderCustomEntity(self, effect)
|
|
|
46
89
|
end
|
|
47
90
|
function isPlayerPastDoorThreshold(self, effect, player, direction)
|
|
48
91
|
repeat
|
|
49
|
-
local
|
|
50
|
-
local
|
|
51
|
-
if
|
|
92
|
+
local ____switch19 = direction
|
|
93
|
+
local ____cond19 = ____switch19 == Direction.NO_DIRECTION
|
|
94
|
+
if ____cond19 then
|
|
52
95
|
do
|
|
53
96
|
return false
|
|
54
97
|
end
|
|
55
98
|
end
|
|
56
|
-
|
|
57
|
-
if
|
|
99
|
+
____cond19 = ____cond19 or ____switch19 == Direction.UP
|
|
100
|
+
if ____cond19 then
|
|
58
101
|
do
|
|
59
102
|
return player.Position.Y <= effect.Position.Y
|
|
60
103
|
end
|
|
61
104
|
end
|
|
62
|
-
|
|
63
|
-
if
|
|
105
|
+
____cond19 = ____cond19 or ____switch19 == Direction.RIGHT
|
|
106
|
+
if ____cond19 then
|
|
64
107
|
do
|
|
65
108
|
return player.Position.X >= effect.Position.X
|
|
66
109
|
end
|
|
67
110
|
end
|
|
68
|
-
|
|
69
|
-
if
|
|
111
|
+
____cond19 = ____cond19 or ____switch19 == Direction.DOWN
|
|
112
|
+
if ____cond19 then
|
|
70
113
|
do
|
|
71
114
|
return player.Position.Y >= effect.Position.Y
|
|
72
115
|
end
|
|
73
116
|
end
|
|
74
|
-
|
|
75
|
-
if
|
|
117
|
+
____cond19 = ____cond19 or ____switch19 == Direction.LEFT
|
|
118
|
+
if ____cond19 then
|
|
76
119
|
do
|
|
77
120
|
return player.Position.X <= effect.Position.X
|
|
78
121
|
end
|
|
@@ -89,45 +132,38 @@ function getPositionOffset(self, doorSlot)
|
|
|
89
132
|
local vector = directionToVector(nil, direction)
|
|
90
133
|
return vector * POSITION_OFFSET_MULTIPLIER
|
|
91
134
|
end
|
|
92
|
-
function getAnimation(self, effect)
|
|
93
|
-
repeat
|
|
94
|
-
local ____switch24 = effect.State
|
|
95
|
-
local ____cond24 = ____switch24 == DoorState.STATE_OPEN
|
|
96
|
-
if ____cond24 then
|
|
97
|
-
do
|
|
98
|
-
return "Opened"
|
|
99
|
-
end
|
|
100
|
-
end
|
|
101
|
-
____cond24 = ____cond24 or ____switch24 == DoorState.STATE_CLOSED
|
|
102
|
-
if ____cond24 then
|
|
103
|
-
do
|
|
104
|
-
return "Closed"
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
do
|
|
108
|
-
do
|
|
109
|
-
return "Opened"
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
until true
|
|
113
|
-
end
|
|
114
135
|
POSITION_OFFSET_MULTIPLIER = -23
|
|
115
136
|
local initializedEffectVariants = __TS__New(Set)
|
|
116
|
-
v = {room = {
|
|
137
|
+
v = {room = {
|
|
138
|
+
customDoors = __TS__New(Map),
|
|
139
|
+
customDoorSlots = __TS__New(Set)
|
|
140
|
+
}}
|
|
117
141
|
function ____exports.postCustomDoorEnterCallbackInit(self)
|
|
118
142
|
saveDataManager(nil, "postCustomDoorEnter", v, hasSubscriptions)
|
|
119
143
|
end
|
|
120
144
|
function ____exports.initCustomDoor(self, mod, effectVariant)
|
|
121
145
|
initializedEffectVariants:add(effectVariant)
|
|
146
|
+
mod:AddCallback(ModCallbacks.MC_POST_EFFECT_UPDATE, postEffectUpdaterCustomEntity, effectVariant)
|
|
122
147
|
mod:AddCallback(ModCallbacks.MC_POST_EFFECT_RENDER, postEffectRenderCustomEntity, effectVariant)
|
|
123
148
|
end
|
|
124
149
|
function ____exports.spawnCustomDoor(self, effectVariant, doorSlot)
|
|
125
150
|
if not initializedEffectVariants:has(effectVariant) then
|
|
126
151
|
error("In order to spawn custom doors, you must first initialize them with the \"initCustomDoor\" function at the beginning of your mod.")
|
|
127
152
|
end
|
|
153
|
+
if v.room.customDoorSlots:has(doorSlot) then
|
|
154
|
+
error("There is already a custom door initialized on door slot: " .. tostring(doorSlot))
|
|
155
|
+
end
|
|
128
156
|
local room = game:GetRoom()
|
|
129
157
|
local roomClear = room:IsClear()
|
|
130
158
|
local position = room:GetDoorSlotPosition(doorSlot)
|
|
159
|
+
local gridEntity = room:GetGridEntityFromPos(position)
|
|
160
|
+
if gridEntity == nil then
|
|
161
|
+
error(("Failed to initialize a custom door at slot " .. tostring(doorSlot)) .. " because the wall on that tile does not exist.")
|
|
162
|
+
end
|
|
163
|
+
local gridEntityType = gridEntity:GetType()
|
|
164
|
+
if gridEntityType ~= GridEntityType.GRID_WALL then
|
|
165
|
+
error((("Failed to initialize a custom door at slot " .. tostring(doorSlot)) .. " because there is another grid entity on that tile with a type of: ") .. tostring(gridEntityType))
|
|
166
|
+
end
|
|
131
167
|
local effect = Isaac.Spawn(
|
|
132
168
|
EntityType.ENTITY_EFFECT,
|
|
133
169
|
effectVariant,
|
|
@@ -143,18 +179,12 @@ function ____exports.spawnCustomDoor(self, effectVariant, doorSlot)
|
|
|
143
179
|
effect.RenderZOffset = -10000
|
|
144
180
|
effect.PositionOffset = getPositionOffset(nil, doorSlot)
|
|
145
181
|
local sprite = effect:GetSprite()
|
|
146
|
-
local animation = getAnimation(nil, effect)
|
|
147
|
-
sprite:Play(animation, true)
|
|
148
182
|
sprite.Rotation = doorSlot * 90 - 90
|
|
149
|
-
if effect.State == DoorState.STATE_OPEN then
|
|
150
|
-
local gridIndex = room:GetGridIndex(position)
|
|
151
|
-
local wall = room:GetGridEntity(gridIndex)
|
|
152
|
-
if wall ~= nil then
|
|
153
|
-
wall.CollisionClass = GridCollisionClass.COLLISION_WALL_EXCEPT_PLAYER
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
183
|
local ptrHash = GetPtrHash(effect)
|
|
157
|
-
local doorData = {slot = doorSlot}
|
|
158
|
-
v.room.
|
|
184
|
+
local doorData = {slot = doorSlot, state = effect.State}
|
|
185
|
+
v.room.customDoors:set(ptrHash, doorData)
|
|
186
|
+
v.room.customDoorSlots:add(doorSlot)
|
|
187
|
+
doorChangedState(nil, effect)
|
|
188
|
+
return effect
|
|
159
189
|
end
|
|
160
190
|
return ____exports
|
package/dist/functions/log.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare function logAllDamageFlags(this: void, flags: int): void;
|
|
|
15
15
|
/** Helper function for printing out every entity flag that is turned on. Useful when debugging. */
|
|
16
16
|
export declare function logAllEntityFlags(this: void, flags: int): void;
|
|
17
17
|
/** Helper function for printing out every flag that is turned on. Useful when debugging. */
|
|
18
|
-
export declare function logAllFlags(this: void, flags: int, flagEnum
|
|
18
|
+
export declare function logAllFlags(this: void, flags: int, flagEnum?: LuaTable, description?: string): void;
|
|
19
19
|
/**
|
|
20
20
|
* Helper function for printing out every game state flag that is turned on. Useful when debugging.
|
|
21
21
|
*/
|
package/dist/functions/log.lua
CHANGED
|
@@ -62,13 +62,29 @@ function ____exports.logAllFlags(flags, flagEnum, description)
|
|
|
62
62
|
if description ~= "" then
|
|
63
63
|
description = description .. " "
|
|
64
64
|
end
|
|
65
|
-
|
|
65
|
+
if flagEnum == nil then
|
|
66
|
+
flagEnum = {}
|
|
67
|
+
do
|
|
68
|
+
local i = 0
|
|
69
|
+
while i <= 62 do
|
|
70
|
+
flagEnum["1 << " .. tostring(i)] = 1 << i
|
|
71
|
+
i = i + 1
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
____exports.log(((("Logging all " .. description) .. "flags for value ") .. tostring(flags)) .. ":")
|
|
66
76
|
local hasNoFlags = true
|
|
67
77
|
for key, value in pairs(flagEnum) do
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
78
|
+
do
|
|
79
|
+
if type(value) ~= "number" then
|
|
80
|
+
goto __continue13
|
|
81
|
+
end
|
|
82
|
+
if hasFlag(nil, flags, value) then
|
|
83
|
+
____exports.log((((" Has flag: " .. tostring(key)) .. " (") .. tostring(value)) .. ")")
|
|
84
|
+
hasNoFlags = false
|
|
85
|
+
end
|
|
71
86
|
end
|
|
87
|
+
::__continue13::
|
|
72
88
|
end
|
|
73
89
|
if hasNoFlags then
|
|
74
90
|
____exports.log(" n/a (no flags)")
|
|
@@ -80,17 +80,13 @@ function ____exports.getPlayerIndex(self, player, differentiateForgottenAndSoul)
|
|
|
80
80
|
if differentiateForgottenAndSoul == nil then
|
|
81
81
|
differentiateForgottenAndSoul = false
|
|
82
82
|
end
|
|
83
|
-
local
|
|
84
|
-
local isSubPlayer = player:IsSubPlayer()
|
|
85
|
-
local ____isSubPlayer_0
|
|
83
|
+
local playerToUse = player
|
|
84
|
+
local isSubPlayer = player:IsSubPlayer()
|
|
86
85
|
if isSubPlayer then
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
local playerToUse = ____isSubPlayer_0
|
|
92
|
-
if playerToUse == nil then
|
|
93
|
-
error("Failed to get the sub-player parent when determining the index for the player with InitSeed: " .. tostring(player.InitSeed))
|
|
86
|
+
local playerParent = ____exports.getSubPlayerParent(nil, player)
|
|
87
|
+
if playerParent ~= nil then
|
|
88
|
+
playerToUse = playerParent
|
|
89
|
+
end
|
|
94
90
|
end
|
|
95
91
|
local collectibleType = getPlayerIndexCollectibleType(nil, player, differentiateForgottenAndSoul)
|
|
96
92
|
local collectibleRNG = playerToUse:GetCollectibleRNG(collectibleType)
|
|
@@ -100,15 +96,15 @@ end
|
|
|
100
96
|
function getPlayerIndexCollectibleType(self, player, differentiateForgottenAndSoul)
|
|
101
97
|
local character = player:GetPlayerType()
|
|
102
98
|
repeat
|
|
103
|
-
local
|
|
104
|
-
local
|
|
105
|
-
if
|
|
99
|
+
local ____switch72 = character
|
|
100
|
+
local ____cond72 = ____switch72 == PlayerType.PLAYER_THESOUL
|
|
101
|
+
if ____cond72 then
|
|
106
102
|
do
|
|
107
103
|
return differentiateForgottenAndSoul and CollectibleType.COLLECTIBLE_SPOON_BENDER or DEFAULT_COLLECTIBLE_TYPE
|
|
108
104
|
end
|
|
109
105
|
end
|
|
110
|
-
|
|
111
|
-
if
|
|
106
|
+
____cond72 = ____cond72 or ____switch72 == PlayerType.PLAYER_LAZARUS2_B
|
|
107
|
+
if ____cond72 then
|
|
112
108
|
do
|
|
113
109
|
return CollectibleType.COLLECTIBLE_INNER_EYE
|
|
114
110
|
end
|
|
@@ -525,13 +521,13 @@ function ____exports.canTakeFreeDevilDeals(self, player)
|
|
|
525
521
|
end
|
|
526
522
|
function ____exports.isTainted(self, player)
|
|
527
523
|
local character = player:GetPlayerType()
|
|
528
|
-
local
|
|
524
|
+
local ____isVanillaCharacter_result_0
|
|
529
525
|
if ____exports.isVanillaCharacter(nil, player) then
|
|
530
|
-
|
|
526
|
+
____isVanillaCharacter_result_0 = character >= PlayerType.PLAYER_ISAAC_B
|
|
531
527
|
else
|
|
532
|
-
|
|
528
|
+
____isVanillaCharacter_result_0 = isTaintedModded(nil, player)
|
|
533
529
|
end
|
|
534
|
-
return
|
|
530
|
+
return ____isVanillaCharacter_result_0
|
|
535
531
|
end
|
|
536
532
|
function ____exports.isTaintedLazarus(self, player)
|
|
537
533
|
local character = player:GetPlayerType()
|
|
@@ -575,9 +571,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
575
571
|
itemPool:RemoveCollectible(collectibleType)
|
|
576
572
|
end
|
|
577
573
|
repeat
|
|
578
|
-
local
|
|
579
|
-
local
|
|
580
|
-
if
|
|
574
|
+
local ____switch126 = activeSlot
|
|
575
|
+
local ____cond126 = ____switch126 == ActiveSlot.SLOT_PRIMARY
|
|
576
|
+
if ____cond126 then
|
|
581
577
|
do
|
|
582
578
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
583
579
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -586,8 +582,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
586
582
|
break
|
|
587
583
|
end
|
|
588
584
|
end
|
|
589
|
-
|
|
590
|
-
if
|
|
585
|
+
____cond126 = ____cond126 or ____switch126 == ActiveSlot.SLOT_SECONDARY
|
|
586
|
+
if ____cond126 then
|
|
591
587
|
do
|
|
592
588
|
if primaryCollectibleType ~= CollectibleType.COLLECTIBLE_NULL then
|
|
593
589
|
player:RemoveCollectible(primaryCollectibleType)
|
|
@@ -602,16 +598,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
|
|
|
602
598
|
break
|
|
603
599
|
end
|
|
604
600
|
end
|
|
605
|
-
|
|
606
|
-
if
|
|
601
|
+
____cond126 = ____cond126 or ____switch126 == ActiveSlot.SLOT_POCKET
|
|
602
|
+
if ____cond126 then
|
|
607
603
|
do
|
|
608
604
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
609
605
|
player:SetActiveCharge(charge, activeSlot)
|
|
610
606
|
break
|
|
611
607
|
end
|
|
612
608
|
end
|
|
613
|
-
|
|
614
|
-
if
|
|
609
|
+
____cond126 = ____cond126 or ____switch126 == ActiveSlot.SLOT_POCKET2
|
|
610
|
+
if ____cond126 then
|
|
615
611
|
do
|
|
616
612
|
player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
|
|
617
613
|
break
|
package/dist/index.d.ts
CHANGED
|
@@ -74,8 +74,8 @@ export * from "./maps/cardMap";
|
|
|
74
74
|
export * from "./maps/characterMap";
|
|
75
75
|
export * from "./maps/pillEffectMap";
|
|
76
76
|
export * from "./maps/roomTypeMap";
|
|
77
|
+
export * from "./types/AddCallbackParametersCustom";
|
|
77
78
|
export * from "./types/AnyEntity";
|
|
78
|
-
export * from "./types/CallbackParametersCustom";
|
|
79
79
|
export * from "./types/CardType";
|
|
80
80
|
export * from "./types/DefaultMap";
|
|
81
81
|
export * from "./types/HealthType";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { AddCallbackParametersCustom } from "../types/AddCallbackParametersCustom";
|
|
1
2
|
import { ModCallbacksCustom } from "../types/ModCallbacksCustom";
|
|
2
3
|
export declare const CALLBACK_REGISTER_FUNCTIONS: {
|
|
3
|
-
readonly [key in ModCallbacksCustom]:
|
|
4
|
+
readonly [key in ModCallbacksCustom]: (...args: AddCallbackParametersCustom[key]) => void;
|
|
4
5
|
};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
+
import { PostBombInitLateCallbackType } from "../callbacks/subscriptions/postBombInitLate";
|
|
3
|
+
import { PostBoneSwingCallbackType } from "../callbacks/subscriptions/postBoneSwing";
|
|
4
|
+
import { PostCursedTeleportCallbackType } from "../callbacks/subscriptions/postCursedTeleport";
|
|
5
|
+
import { PostCustomDoorEnterCallbackType } from "../callbacks/subscriptions/postCustomDoorEnter";
|
|
6
|
+
import { PostCustomReviveCallbackType } from "../callbacks/subscriptions/postCustomRevive";
|
|
7
|
+
import { PostEffectInitLateCallbackType } from "../callbacks/subscriptions/postEffectInitLate";
|
|
8
|
+
import { PostEsauJrCallbackType } from "../callbacks/subscriptions/postEsauJr";
|
|
9
|
+
import { PostFamiliarInitLateCallbackType } from "../callbacks/subscriptions/postFamiliarInitLate";
|
|
10
|
+
import { PostFirstEsauJrCallbackType } from "../callbacks/subscriptions/postFirstEsauJr";
|
|
11
|
+
import { PostFirstFlipCallbackType } from "../callbacks/subscriptions/postFirstFlip";
|
|
12
|
+
import { PostFlipCallbackType } from "../callbacks/subscriptions/postFlip";
|
|
13
|
+
import { PostGameStartedReorderedCallbackType } from "../callbacks/subscriptions/postGameStartedReordered";
|
|
14
|
+
import { PostGridEntityBrokenCallbackType } from "../callbacks/subscriptions/postGridEntityBroken";
|
|
15
|
+
import { PostGridEntityCollisionCallbackType } from "../callbacks/subscriptions/postGridEntityCollision";
|
|
16
|
+
import { PostGridEntityInitCallbackType } from "../callbacks/subscriptions/postGridEntityInit";
|
|
17
|
+
import { PostGridEntityRemoveCallbackType } from "../callbacks/subscriptions/postGridEntityRemove";
|
|
18
|
+
import { PostGridEntityStateChangeCallbackType } from "../callbacks/subscriptions/postGridEntityStateChange";
|
|
19
|
+
import { PostGridEntityUpdateCallbackType } from "../callbacks/subscriptions/postGridEntityUpdate";
|
|
20
|
+
import { PostItemPickupCallbackType } from "../callbacks/subscriptions/postItemPickup";
|
|
21
|
+
import { PostKnifeInitLateCallbackType } from "../callbacks/subscriptions/postKnifeInitLate";
|
|
22
|
+
import { PostLaserInitLateCallbackType } from "../callbacks/subscriptions/postLaserInitLate";
|
|
23
|
+
import { PostNewLevelReorderedCallbackType } from "../callbacks/subscriptions/postNewLevelReordered";
|
|
24
|
+
import { PostNewRoomEarlyCallbackType } from "../callbacks/subscriptions/postNewRoomEarly";
|
|
25
|
+
import { PostNewRoomReorderedCallbackType } from "../callbacks/subscriptions/postNewRoomReordered";
|
|
26
|
+
import { PostNPCInitLateCallbackType } from "../callbacks/subscriptions/postNPCInitLate";
|
|
27
|
+
import { PostPEffectUpdateReorderedCallbackType } from "../callbacks/subscriptions/postPEffectUpdateReordered";
|
|
28
|
+
import { PostPickupCollectCallbackType } from "../callbacks/subscriptions/postPickupCollect";
|
|
29
|
+
import { PostPickupInitLateCallbackType } from "../callbacks/subscriptions/postPickupInitLate";
|
|
30
|
+
import { PostPlayerChangeHealthCallbackType } from "../callbacks/subscriptions/postPlayerChangeHealth";
|
|
31
|
+
import { PostPlayerChangeTypeCallbackType } from "../callbacks/subscriptions/postPlayerChangeType";
|
|
32
|
+
import { PostPlayerFatalDamageCallbackType } from "../callbacks/subscriptions/postPlayerFatalDamage";
|
|
33
|
+
import { PostPlayerInitLateCallbackType } from "../callbacks/subscriptions/postPlayerInitLate";
|
|
34
|
+
import { PostPlayerInitReorderedCallbackType } from "../callbacks/subscriptions/postPlayerInitReordered";
|
|
35
|
+
import { PostPlayerRenderReorderedCallbackType } from "../callbacks/subscriptions/postPlayerRenderReordered";
|
|
36
|
+
import { PostPlayerUpdateReorderedCallbackType } from "../callbacks/subscriptions/postPlayerUpdateReordered";
|
|
37
|
+
import { PostProjectileInitLateCallbackType } from "../callbacks/subscriptions/postProjectileInitLate";
|
|
38
|
+
import { PostPurchaseCallbackType } from "../callbacks/subscriptions/postPurchase";
|
|
39
|
+
import { PostSacrificeCallbackType } from "../callbacks/subscriptions/postSacrifice";
|
|
40
|
+
import { PostSlotAnimationChangedCallbackType } from "../callbacks/subscriptions/postSlotAnimationChanged";
|
|
41
|
+
import { PostSlotDestroyedCallbackType } from "../callbacks/subscriptions/postSlotDestroyed";
|
|
42
|
+
import { PostSlotInitCallbackType } from "../callbacks/subscriptions/postSlotInit";
|
|
43
|
+
import { PostSlotRenderCallbackType } from "../callbacks/subscriptions/postSlotRender";
|
|
44
|
+
import { PostSlotUpdateCallbackType } from "../callbacks/subscriptions/postSlotUpdate";
|
|
45
|
+
import { PostTearInitLateCallbackType } from "../callbacks/subscriptions/postTearInitLate";
|
|
46
|
+
import { PostTearInitVeryLateCallbackType } from "../callbacks/subscriptions/postTearInitVeryLate";
|
|
47
|
+
import { PostTransformationCallbackType } from "../callbacks/subscriptions/postTransformation";
|
|
48
|
+
import { PostTrinketBreakCallbackType } from "../callbacks/subscriptions/postTrinketBreak";
|
|
49
|
+
import { PreBerserkDeathCallbackType } from "../callbacks/subscriptions/preBerserkDeath";
|
|
50
|
+
import { PreCustomReviveCallbackType } from "../callbacks/subscriptions/preCustomRevive";
|
|
51
|
+
import { PreItemPickupCallbackType } from "../callbacks/subscriptions/preItemPickup";
|
|
52
|
+
import { PreNewLevelCallbackType } from "../callbacks/subscriptions/preNewLevel";
|
|
53
|
+
import { ModCallbacksCustom } from "./ModCallbacksCustom";
|
|
54
|
+
export interface AddCallbackParametersCustom {
|
|
55
|
+
[ModCallbacksCustom.MC_POST_GAME_STARTED_REORDERED]: [
|
|
56
|
+
callback: PostGameStartedReorderedCallbackType
|
|
57
|
+
];
|
|
58
|
+
[ModCallbacksCustom.MC_POST_NEW_LEVEL_REORDERED]: [
|
|
59
|
+
callback: PostNewLevelReorderedCallbackType
|
|
60
|
+
];
|
|
61
|
+
[ModCallbacksCustom.MC_POST_NEW_ROOM_REORDERED]: [
|
|
62
|
+
callback: PostNewRoomReorderedCallbackType
|
|
63
|
+
];
|
|
64
|
+
[ModCallbacksCustom.MC_POST_PLAYER_INIT_REORDERED]: [
|
|
65
|
+
callback: PostPlayerInitReorderedCallbackType,
|
|
66
|
+
playerVariant?: PlayerVariant
|
|
67
|
+
];
|
|
68
|
+
[ModCallbacksCustom.MC_POST_PEFFECT_UPDATE_REORDERED]: [
|
|
69
|
+
callback: PostPEffectUpdateReorderedCallbackType,
|
|
70
|
+
character?: PlayerType | int
|
|
71
|
+
];
|
|
72
|
+
[ModCallbacksCustom.MC_POST_PLAYER_UPDATE_REORDERED]: [
|
|
73
|
+
callback: PostPlayerUpdateReorderedCallbackType,
|
|
74
|
+
playerVariant?: PlayerVariant
|
|
75
|
+
];
|
|
76
|
+
[ModCallbacksCustom.MC_POST_PLAYER_RENDER_REORDERED]: [
|
|
77
|
+
callback: PostPlayerRenderReorderedCallbackType,
|
|
78
|
+
playerVariant?: PlayerVariant
|
|
79
|
+
];
|
|
80
|
+
[ModCallbacksCustom.MC_POST_NEW_ROOM_EARLY]: [
|
|
81
|
+
callback: PostNewRoomEarlyCallbackType
|
|
82
|
+
];
|
|
83
|
+
[ModCallbacksCustom.MC_PRE_NEW_LEVEL]: [callback: PreNewLevelCallbackType];
|
|
84
|
+
[ModCallbacksCustom.MC_POST_PLAYER_INIT_LATE]: [
|
|
85
|
+
callback: PostPlayerInitLateCallbackType,
|
|
86
|
+
playerVariant?: PlayerVariant
|
|
87
|
+
];
|
|
88
|
+
[ModCallbacksCustom.MC_POST_TEAR_INIT_LATE]: [
|
|
89
|
+
callback: PostTearInitLateCallbackType,
|
|
90
|
+
tearVariant?: TearVariant | int
|
|
91
|
+
];
|
|
92
|
+
[ModCallbacksCustom.MC_POST_TEAR_INIT_VERY_LATE]: [
|
|
93
|
+
callback: PostTearInitVeryLateCallbackType,
|
|
94
|
+
tearVariant?: TearVariant | int
|
|
95
|
+
];
|
|
96
|
+
[ModCallbacksCustom.MC_POST_FAMILIAR_INIT_LATE]: [
|
|
97
|
+
callback: PostFamiliarInitLateCallbackType,
|
|
98
|
+
familiarVariant?: FamiliarVariant | int
|
|
99
|
+
];
|
|
100
|
+
[ModCallbacksCustom.MC_POST_BOMB_INIT_LATE]: [
|
|
101
|
+
callback: PostBombInitLateCallbackType,
|
|
102
|
+
bombVariant?: BombVariant | int
|
|
103
|
+
];
|
|
104
|
+
[ModCallbacksCustom.MC_POST_PICKUP_INIT_LATE]: [
|
|
105
|
+
callback: PostPickupInitLateCallbackType,
|
|
106
|
+
pickupVariant?: PickupVariant | int
|
|
107
|
+
];
|
|
108
|
+
[ModCallbacksCustom.MC_POST_LASER_INIT_LATE]: [
|
|
109
|
+
callback: PostLaserInitLateCallbackType,
|
|
110
|
+
laserVariant?: LaserVariant | int
|
|
111
|
+
];
|
|
112
|
+
[ModCallbacksCustom.MC_POST_KNIFE_INIT_LATE]: [
|
|
113
|
+
callback: PostKnifeInitLateCallbackType,
|
|
114
|
+
knifeVariant?: KnifeVariant | int
|
|
115
|
+
];
|
|
116
|
+
[ModCallbacksCustom.MC_POST_PROJECTILE_INIT_LATE]: [
|
|
117
|
+
callback: PostProjectileInitLateCallbackType,
|
|
118
|
+
projectileVariant?: ProjectileVariant | int
|
|
119
|
+
];
|
|
120
|
+
[ModCallbacksCustom.MC_POST_NPC_INIT_LATE]: [
|
|
121
|
+
callback: PostNPCInitLateCallbackType,
|
|
122
|
+
entityType?: EntityType | int
|
|
123
|
+
];
|
|
124
|
+
[ModCallbacksCustom.MC_POST_EFFECT_INIT_LATE]: [
|
|
125
|
+
callback: PostEffectInitLateCallbackType,
|
|
126
|
+
effectVariant?: EffectVariant
|
|
127
|
+
];
|
|
128
|
+
[ModCallbacksCustom.MC_POST_PICKUP_COLLECT]: [
|
|
129
|
+
callback: PostPickupCollectCallbackType,
|
|
130
|
+
pickupVariant?: PickupVariant | int
|
|
131
|
+
];
|
|
132
|
+
[ModCallbacksCustom.MC_PRE_ITEM_PICKUP]: [
|
|
133
|
+
callback: PreItemPickupCallbackType,
|
|
134
|
+
itemType?: ItemType,
|
|
135
|
+
itemID?: CollectibleType | TrinketType | int
|
|
136
|
+
];
|
|
137
|
+
[ModCallbacksCustom.MC_POST_ITEM_PICKUP]: [
|
|
138
|
+
callback: PostItemPickupCallbackType,
|
|
139
|
+
itemType?: ItemType,
|
|
140
|
+
itemID?: CollectibleType | TrinketType | int
|
|
141
|
+
];
|
|
142
|
+
[ModCallbacksCustom.MC_POST_PLAYER_CHANGE_TYPE]: [
|
|
143
|
+
callback: PostPlayerChangeTypeCallbackType
|
|
144
|
+
];
|
|
145
|
+
[ModCallbacksCustom.MC_POST_PLAYER_CHANGE_HEALTH]: [
|
|
146
|
+
callback: PostPlayerChangeHealthCallbackType,
|
|
147
|
+
playerVariant?: PlayerVariant
|
|
148
|
+
];
|
|
149
|
+
[ModCallbacksCustom.MC_POST_PLAYER_FATAL_DAMAGE]: [
|
|
150
|
+
callback: PostPlayerFatalDamageCallbackType,
|
|
151
|
+
playerVariant?: PlayerVariant
|
|
152
|
+
];
|
|
153
|
+
[ModCallbacksCustom.MC_PRE_BERSERK_DEATH]: [
|
|
154
|
+
callback: PreBerserkDeathCallbackType,
|
|
155
|
+
playerVariant?: PlayerVariant
|
|
156
|
+
];
|
|
157
|
+
[ModCallbacksCustom.MC_PRE_CUSTOM_REVIVE]: [
|
|
158
|
+
callback: PreCustomReviveCallbackType
|
|
159
|
+
];
|
|
160
|
+
[ModCallbacksCustom.MC_POST_CUSTOM_REVIVE]: [
|
|
161
|
+
callback: PostCustomReviveCallbackType,
|
|
162
|
+
revivalType?: int
|
|
163
|
+
];
|
|
164
|
+
[ModCallbacksCustom.MC_POST_FLIP]: [callback: PostFlipCallbackType];
|
|
165
|
+
[ModCallbacksCustom.MC_POST_FIRST_FLIP]: [
|
|
166
|
+
callback: PostFirstFlipCallbackType
|
|
167
|
+
];
|
|
168
|
+
[ModCallbacksCustom.MC_POST_ESAU_JR]: [callback: PostEsauJrCallbackType];
|
|
169
|
+
[ModCallbacksCustom.MC_POST_FIRST_ESAU_JR]: [
|
|
170
|
+
callback: PostFirstEsauJrCallbackType
|
|
171
|
+
];
|
|
172
|
+
[ModCallbacksCustom.MC_POST_TRANSFORMATION]: [
|
|
173
|
+
callback: PostTransformationCallbackType
|
|
174
|
+
];
|
|
175
|
+
[ModCallbacksCustom.MC_POST_PURCHASE]: [
|
|
176
|
+
callback: PostPurchaseCallbackType,
|
|
177
|
+
pickupVariant?: PickupVariant | int,
|
|
178
|
+
pickupSubType?: int
|
|
179
|
+
];
|
|
180
|
+
[ModCallbacksCustom.MC_POST_SACRIFICE]: [callback: PostSacrificeCallbackType];
|
|
181
|
+
[ModCallbacksCustom.MC_POST_CURSED_TELEPORT]: [
|
|
182
|
+
callback: PostCursedTeleportCallbackType
|
|
183
|
+
];
|
|
184
|
+
[ModCallbacksCustom.MC_POST_TRINKET_BREAK]: [
|
|
185
|
+
callback: PostTrinketBreakCallbackType,
|
|
186
|
+
trinketType?: TrinketType | int
|
|
187
|
+
];
|
|
188
|
+
[ModCallbacksCustom.MC_POST_SLOT_INIT]: [
|
|
189
|
+
callback: PostSlotInitCallbackType,
|
|
190
|
+
slotVariant?: SlotVariant
|
|
191
|
+
];
|
|
192
|
+
[ModCallbacksCustom.MC_POST_SLOT_UPDATE]: [
|
|
193
|
+
callback: PostSlotUpdateCallbackType,
|
|
194
|
+
slotVariant?: SlotVariant
|
|
195
|
+
];
|
|
196
|
+
[ModCallbacksCustom.MC_POST_SLOT_RENDER]: [
|
|
197
|
+
callback: PostSlotRenderCallbackType,
|
|
198
|
+
slotVariant?: SlotVariant
|
|
199
|
+
];
|
|
200
|
+
[ModCallbacksCustom.MC_POST_SLOT_ANIMATION_CHANGED]: [
|
|
201
|
+
callback: PostSlotAnimationChangedCallbackType,
|
|
202
|
+
slotVariant?: SlotVariant
|
|
203
|
+
];
|
|
204
|
+
[ModCallbacksCustom.MC_POST_SLOT_DESTROYED]: [
|
|
205
|
+
callback: PostSlotDestroyedCallbackType,
|
|
206
|
+
slotVariant?: SlotVariant
|
|
207
|
+
];
|
|
208
|
+
[ModCallbacksCustom.MC_POST_GRID_ENTITY_INIT]: [
|
|
209
|
+
callback: PostGridEntityInitCallbackType,
|
|
210
|
+
gridEntityType?: GridEntityType
|
|
211
|
+
];
|
|
212
|
+
[ModCallbacksCustom.MC_POST_GRID_ENTITY_UPDATE]: [
|
|
213
|
+
callback: PostGridEntityUpdateCallbackType,
|
|
214
|
+
gridEntityType?: GridEntityType
|
|
215
|
+
];
|
|
216
|
+
[ModCallbacksCustom.MC_POST_GRID_ENTITY_REMOVE]: [
|
|
217
|
+
callback: PostGridEntityRemoveCallbackType,
|
|
218
|
+
gridEntityType?: GridEntityType
|
|
219
|
+
];
|
|
220
|
+
[ModCallbacksCustom.MC_POST_GRID_ENTITY_STATE_CHANGE]: [
|
|
221
|
+
callback: PostGridEntityStateChangeCallbackType,
|
|
222
|
+
gridEntityType?: GridEntityType
|
|
223
|
+
];
|
|
224
|
+
[ModCallbacksCustom.MC_POST_GRID_ENTITY_BROKEN]: [
|
|
225
|
+
callback: PostGridEntityBrokenCallbackType,
|
|
226
|
+
gridEntityType?: GridEntityType
|
|
227
|
+
];
|
|
228
|
+
[ModCallbacksCustom.MC_POST_GRID_ENTITY_COLLISION]: [
|
|
229
|
+
callback: PostGridEntityCollisionCallbackType,
|
|
230
|
+
gridEntityType?: GridEntityType
|
|
231
|
+
];
|
|
232
|
+
[ModCallbacksCustom.MC_POST_BONE_SWING]: [
|
|
233
|
+
callback: PostBoneSwingCallbackType
|
|
234
|
+
];
|
|
235
|
+
[ModCallbacksCustom.MC_POST_CUSTOM_DOOR_ENTER]: [
|
|
236
|
+
callback: PostCustomDoorEnterCallbackType,
|
|
237
|
+
effectVariant?: int
|
|
238
|
+
];
|
|
239
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="isaac-typescript-definitions" />
|
|
2
|
-
import {
|
|
2
|
+
import { AddCallbackParametersCustom } from "./AddCallbackParametersCustom";
|
|
3
|
+
import { ModCallbacksCustom } from "./ModCallbacksCustom";
|
|
3
4
|
/** `isaacscript-common` allows for custom callbacks, so it provides an upgraded Mod object. */
|
|
4
5
|
export declare class ModUpgraded implements Mod {
|
|
5
6
|
Name: string;
|
|
@@ -8,11 +9,11 @@ export declare class ModUpgraded implements Mod {
|
|
|
8
9
|
/** End-users can optionally enable verbose-mode, which helps troubleshoot crashes. */
|
|
9
10
|
Verbose: boolean;
|
|
10
11
|
constructor(mod: Mod, verbose: boolean);
|
|
11
|
-
AddCallback<T extends
|
|
12
|
+
AddCallback<T extends ModCallbacks>(modCallbacks: T, ...args: AddCallbackParameters[T]): void;
|
|
12
13
|
HasData(): boolean;
|
|
13
14
|
LoadData(): string;
|
|
14
15
|
RemoveCallback(callbackID: ModCallbacks, callback: () => void): void;
|
|
15
16
|
RemoveData(): void;
|
|
16
17
|
SaveData(data: string): void;
|
|
17
|
-
AddCallbackCustom<T extends
|
|
18
|
+
AddCallbackCustom<T extends ModCallbacksCustom>(modCallbacksCustom: T, ...args: AddCallbackParametersCustom[T]): void;
|
|
18
19
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "isaacscript-common",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.158",
|
|
4
4
|
"description": "Helper functions for IsaacScript mods",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"isaac",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@zamiell/typescript-to-lua": "^1.4.2",
|
|
29
|
-
"isaac-typescript-definitions": "^1.0.
|
|
30
|
-
"isaacscript-lint": "^1.0.
|
|
29
|
+
"isaac-typescript-definitions": "^1.0.369",
|
|
30
|
+
"isaacscript-lint": "^1.0.90",
|
|
31
31
|
"isaacscript-tsconfig": "^1.1.8",
|
|
32
32
|
"typedoc": "^0.22.13",
|
|
33
33
|
"typescript": "4.5.5"
|