isaacscript-common 1.2.155 → 1.2.156
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 +16 -4
- package/dist/callbacks/postCustomDoorEnter.lua +79 -49
- 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,21 @@
|
|
|
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
|
+
* Handle when a player enters the door by hooking the custom `MC_POST_CUSTOM_DOOR_ENTER` callback.
|
|
32
|
+
*
|
|
33
|
+
* The custom door is an `EntityEffect`. You can manually open or close the door by modifying its
|
|
34
|
+
* state. (The values to use correspond to the `DoorState` enum.)
|
|
35
|
+
*
|
|
36
|
+
* This function will throw a runtime error if:
|
|
37
|
+
* - the door slot already has a vanilla door
|
|
38
|
+
* - the door slot already has a custom door
|
|
39
|
+
* - the tile at the door slot does not have a wall
|
|
40
|
+
*
|
|
41
|
+
* Before using this function, you must first initialize the effect/door variant with the
|
|
42
|
+
* `initCustomDoor` function.
|
|
31
43
|
*/
|
|
32
|
-
export declare function spawnCustomDoor(effectVariant: int, doorSlot: DoorSlot):
|
|
44
|
+
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/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.156",
|
|
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"
|