isaacscript-common 3.1.1 → 3.4.0
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/callbacks/customRevive.lua +3 -3
- package/callbacks/postGridEntity.lua +5 -3
- package/callbacks/postHolyMantleRemoved.lua +2 -2
- package/callbacks/postPlayerCollectible.d.ts +1 -0
- package/callbacks/postPlayerCollectible.lua +95 -0
- package/callbacks/postRoomClearChanged.lua +5 -3
- package/callbacks/postSlotInitUpdate.lua +5 -3
- package/callbacks/subscriptions/postPlayerCollectibleAdded.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerCollectibleAdded.lua +34 -0
- package/callbacks/subscriptions/postPlayerCollectibleRemoved.d.ts +6 -0
- package/callbacks/subscriptions/postPlayerCollectibleRemoved.lua +34 -0
- package/classes/DefaultMap.d.ts +1 -2
- package/classes/DefaultMap.lua +1 -4
- package/constants.d.ts +5 -0
- package/constants.lua +5 -0
- package/enums/ModCallbackCustom.d.ts +427 -177
- package/enums/ModCallbackCustom.lua +36 -32
- package/features/deployJSONRoom.lua +5 -4
- package/features/extraConsoleCommands/listCommands.lua +1 -0
- package/features/persistentEntities.d.ts +28 -0
- package/features/persistentEntities.lua +150 -0
- package/features/playerInventory.d.ts +1 -10
- package/features/playerInventory.lua +23 -60
- package/functions/array.d.ts +3 -3
- package/functions/array.lua +3 -3
- package/functions/collectibleSet.d.ts +3 -3
- package/functions/collectibleSet.lua +3 -5
- package/functions/color.d.ts +2 -16
- package/functions/color.lua +0 -9
- package/functions/entity.d.ts +10 -0
- package/functions/entity.lua +29 -0
- package/functions/log.lua +2 -2
- package/functions/pills.d.ts +10 -0
- package/functions/pills.lua +16 -0
- package/functions/roomData.d.ts +5 -5
- package/functions/roomData.lua +7 -7
- package/functions/rooms.d.ts +1 -4
- package/functions/rooms.lua +19 -25
- package/functions/saveFile.d.ts +15 -0
- package/functions/saveFile.lua +105 -0
- package/index.d.ts +3 -1
- package/index.lua +15 -2
- package/initCustomCallbacks.lua +3 -0
- package/initFeatures.lua +3 -0
- package/interfaces/AddCallbackParameterCustom.d.ts +4 -0
- package/maps/PHDPillConversions.d.ts +2 -0
- package/maps/PHDPillConversions.lua +25 -0
- package/maps/falsePHDPillConversions.d.ts +2 -0
- package/maps/falsePHDPillConversions.lua +39 -0
- package/objects/callbackRegisterFunctions.lua +6 -0
- package/package.json +2 -2
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export declare enum ModCallbackCustom {
|
|
10
10
|
/**
|
|
11
|
-
* Fires on the first `
|
|
11
|
+
* Fires on the first `POST_BOMB_UPDATE` frame for each bomb.
|
|
12
12
|
*
|
|
13
13
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
14
|
-
* normal `
|
|
14
|
+
* normal `POST_BOMB_INIT` callback.
|
|
15
15
|
*
|
|
16
16
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
17
17
|
* only fire if the bomb variant matches the `BombVariant` provided.
|
|
@@ -22,7 +22,7 @@ export declare enum ModCallbackCustom {
|
|
|
22
22
|
*/
|
|
23
23
|
POST_BOMB_INIT_LATE = 0,
|
|
24
24
|
/**
|
|
25
|
-
* Fires from the `
|
|
25
|
+
* Fires from the `POST_RENDER` callback when one of Forgotten's bone clubs is swung or thrown.
|
|
26
26
|
*
|
|
27
27
|
* ```ts
|
|
28
28
|
* function postBoneSwing(boneClub: EntityKnife): void {}
|
|
@@ -30,13 +30,13 @@ export declare enum ModCallbackCustom {
|
|
|
30
30
|
*/
|
|
31
31
|
POST_BONE_SWING = 1,
|
|
32
32
|
/**
|
|
33
|
-
* Fires from the `
|
|
33
|
+
* Fires from the `POST_PICKUP_INIT` callback on the first time that a player has seen the
|
|
34
34
|
* respective collectible on the run. For more details on how this is calculated, see the
|
|
35
35
|
* documentation for the `getCollectibleIndex` helper function.
|
|
36
36
|
*
|
|
37
37
|
* This callback is useful because collectibles will despawn upon leaving the room and respawn
|
|
38
|
-
* upon re-entering the room. Additionally, when playing as Tainted Isaac, the
|
|
39
|
-
*
|
|
38
|
+
* upon re-entering the room. Additionally, when playing as Tainted Isaac, the `POST_PICKUP_INIT`
|
|
39
|
+
* callback will fire every time the item shifts.
|
|
40
40
|
*
|
|
41
41
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
42
42
|
* only fire if the collectible type matches the `CollectibleType` provided.
|
|
@@ -47,10 +47,9 @@ export declare enum ModCallbackCustom {
|
|
|
47
47
|
*/
|
|
48
48
|
POST_COLLECTIBLE_INIT_FIRST = 2,
|
|
49
49
|
/**
|
|
50
|
-
* Fires from the `
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* room.)
|
|
50
|
+
* Fires from the `POST_PLAYER_RENDER` callback on the first frame that the "TeleportUp" animation
|
|
51
|
+
* begins playing after a player triggers a Cursed Eye teleport or a Cursed Skull teleport. (Both
|
|
52
|
+
* of these have the same effect in causing Isaac to be teleported to a random room.)
|
|
54
53
|
*
|
|
55
54
|
* ```ts
|
|
56
55
|
* function postCursedTeleport(player: EntityPlayer): void {}
|
|
@@ -58,8 +57,8 @@ export declare enum ModCallbackCustom {
|
|
|
58
57
|
*/
|
|
59
58
|
POST_CURSED_TELEPORT = 3,
|
|
60
59
|
/**
|
|
61
|
-
* Fires from the `
|
|
62
|
-
*
|
|
60
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player enters the loading zone of a custom
|
|
61
|
+
* door created with the `spawnCustomDoor` helper function.
|
|
63
62
|
*
|
|
64
63
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
65
64
|
* only fire if it matches the `DoorVariant` provided.
|
|
@@ -75,10 +74,9 @@ export declare enum ModCallbackCustom {
|
|
|
75
74
|
*/
|
|
76
75
|
POST_CUSTOM_DOOR_ENTER = 4,
|
|
77
76
|
/**
|
|
78
|
-
* Fires from the `
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
* `MC_PRE_CUSTOM_REVIVE` callback.
|
|
77
|
+
* Fires from the `POST_PLAYER_UPDATE` callback after the player has finished the death animation,
|
|
78
|
+
* has teleported to the previous room, and is ready to play the animation for the modded revival
|
|
79
|
+
* item. The `revivalType` will match the value returned from the `PRE_CUSTOM_REVIVE` callback.
|
|
82
80
|
*
|
|
83
81
|
* In this callback, you must play an animation with something along the lines of
|
|
84
82
|
* `player.AnimateCollectible(CollectibleTypeCustom.COLLECTIBLE_MY_REVIVAL_ITEM);`, otherwise the
|
|
@@ -92,13 +90,33 @@ export declare enum ModCallbackCustom {
|
|
|
92
90
|
* ```
|
|
93
91
|
*/
|
|
94
92
|
POST_CUSTOM_REVIVE = 5,
|
|
93
|
+
/**
|
|
94
|
+
* Fires from the `POST_RENDER` callback on every frame that a door exists.
|
|
95
|
+
*
|
|
96
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
97
|
+
* only fire if it matches the variant provided.
|
|
98
|
+
*
|
|
99
|
+
* ```ts
|
|
100
|
+
* function postDoorRender(door: GridEntityDoor): void {}
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
95
103
|
POST_DOOR_RENDER = 6,
|
|
104
|
+
/**
|
|
105
|
+
* Fires from the `POST_UPDATE` callback on every frame that a door exists.
|
|
106
|
+
*
|
|
107
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
108
|
+
* only fire if it matches the variant provided.
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* function postDoorUpdate(door: GridEntityDoor): void {}
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
96
114
|
POST_DOOR_UPDATE = 7,
|
|
97
115
|
/**
|
|
98
|
-
* Fires on the first `
|
|
116
|
+
* Fires on the first `POST_EFFECT_UPDATE` frame for each effect.
|
|
99
117
|
*
|
|
100
118
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
101
|
-
* normal `
|
|
119
|
+
* normal `POST_EFFECT_INIT` callback.
|
|
102
120
|
*
|
|
103
121
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
104
122
|
* only fire if the effect variant matches the `EffectVariant` provided.
|
|
@@ -109,7 +127,7 @@ export declare enum ModCallbackCustom {
|
|
|
109
127
|
*/
|
|
110
128
|
POST_EFFECT_INIT_LATE = 8,
|
|
111
129
|
/**
|
|
112
|
-
* Fires from the `
|
|
130
|
+
* Fires from the `POST_EFFECT_UPDATE` callback when an effect's state has changed from what it
|
|
113
131
|
* was on the previous frame.
|
|
114
132
|
*
|
|
115
133
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
@@ -125,8 +143,8 @@ export declare enum ModCallbackCustom {
|
|
|
125
143
|
*/
|
|
126
144
|
POST_EFFECT_STATE_CHANGED = 9,
|
|
127
145
|
/**
|
|
128
|
-
* Fires one `
|
|
129
|
-
*
|
|
146
|
+
* Fires one `POST_UPDATE` frame after the player has used the Esau Jr. item. (The player is not
|
|
147
|
+
* updated to the new character until a game frame has passed.)
|
|
130
148
|
*
|
|
131
149
|
* ```ts
|
|
132
150
|
* function postEsauJr(player: EntityPlayer): void {}
|
|
@@ -134,10 +152,10 @@ export declare enum ModCallbackCustom {
|
|
|
134
152
|
*/
|
|
135
153
|
POST_ESAU_JR = 10,
|
|
136
154
|
/**
|
|
137
|
-
* Fires on the first `
|
|
155
|
+
* Fires on the first `FAMILIAR_UPDATE` frame for each familiar.
|
|
138
156
|
*
|
|
139
157
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
140
|
-
* normal `
|
|
158
|
+
* normal `POST_TEAR_INIT` callback.
|
|
141
159
|
*
|
|
142
160
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
143
161
|
* only fire if the familiar variant matches the `FamiliarVariant` provided.
|
|
@@ -148,8 +166,8 @@ export declare enum ModCallbackCustom {
|
|
|
148
166
|
*/
|
|
149
167
|
POST_FAMILIAR_INIT_LATE = 11,
|
|
150
168
|
/**
|
|
151
|
-
* Fires from the `
|
|
152
|
-
*
|
|
169
|
+
* Fires from the `POST_FAMILIAR_UPDATE` callback when a familiar's state has changed from what it
|
|
170
|
+
* was on the previous frame.
|
|
153
171
|
*
|
|
154
172
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
155
173
|
* only fire if it matches the `FamiliarVariant` provided.
|
|
@@ -164,8 +182,8 @@ export declare enum ModCallbackCustom {
|
|
|
164
182
|
*/
|
|
165
183
|
POST_FAMILIAR_STATE_CHANGED = 12,
|
|
166
184
|
/**
|
|
167
|
-
* Fires one `
|
|
168
|
-
*
|
|
185
|
+
* Fires one `POST_UPDATE` frame after the player has first used the Esau Jr. item. (The player is
|
|
186
|
+
* not updated to the new character until a game frame has passed.)
|
|
169
187
|
*
|
|
170
188
|
* This callback is useful because there is no way to get access to the Esau Jr. character entity
|
|
171
189
|
* before the player has actually used the Esau Jr. item.
|
|
@@ -176,9 +194,9 @@ export declare enum ModCallbackCustom {
|
|
|
176
194
|
*/
|
|
177
195
|
POST_FIRST_ESAU_JR = 13,
|
|
178
196
|
/**
|
|
179
|
-
* Fires after the player has used the Flip item for the first time. Unlike the vanilla
|
|
180
|
-
*
|
|
181
|
-
* the
|
|
197
|
+
* Fires after the player has used the Flip item for the first time. Unlike the vanilla `USE_ITEM`
|
|
198
|
+
* callback, this callback will return the player object for the new Lazarus (not the one who used
|
|
199
|
+
* the Flip item).
|
|
182
200
|
*
|
|
183
201
|
* This callback is useful because there is no way to get access to the "flipped" character entity
|
|
184
202
|
* before the player has actually used the Flip item.
|
|
@@ -189,7 +207,7 @@ export declare enum ModCallbackCustom {
|
|
|
189
207
|
*/
|
|
190
208
|
POST_FIRST_FLIP = 14,
|
|
191
209
|
/**
|
|
192
|
-
* Fires after the player has used the Flip item. Unlike the vanilla `
|
|
210
|
+
* Fires after the player has used the Flip item. Unlike the vanilla `USE_ITEM` callback, this
|
|
193
211
|
* callback will return the player object for the new Lazarus (not the one who used the Flip
|
|
194
212
|
* item).
|
|
195
213
|
*
|
|
@@ -203,10 +221,9 @@ export declare enum ModCallbackCustom {
|
|
|
203
221
|
POST_FLIP = 15,
|
|
204
222
|
/**
|
|
205
223
|
* Similar to the vanilla callback of the same name, but fires in the correct order with respect
|
|
206
|
-
* to the `
|
|
224
|
+
* to the `POST_NEW_LEVEL` and the `POST_NEW_ROOM` callbacks:
|
|
207
225
|
*
|
|
208
|
-
* `
|
|
209
|
-
* `MC_POST_NEW_ROOM_REORDERED`
|
|
226
|
+
* `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED`
|
|
210
227
|
*
|
|
211
228
|
* ```ts
|
|
212
229
|
* function postGameStartedReordered(isContinued: boolean): void {}
|
|
@@ -222,8 +239,8 @@ export declare enum ModCallbackCustom {
|
|
|
222
239
|
*/
|
|
223
240
|
POST_GREED_MODE_WAVE = 17,
|
|
224
241
|
/**
|
|
225
|
-
* Fires from the `
|
|
226
|
-
*
|
|
242
|
+
* Fires from the `POST_UPDATE` update when a grid entity changes to a state that corresponds to
|
|
243
|
+
* the broken state for the respective grid entity type.
|
|
227
244
|
*
|
|
228
245
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
229
246
|
* only fire if it matches the `GridEntityType` provided.
|
|
@@ -234,7 +251,7 @@ export declare enum ModCallbackCustom {
|
|
|
234
251
|
*/
|
|
235
252
|
POST_GRID_ENTITY_BROKEN = 18,
|
|
236
253
|
/**
|
|
237
|
-
* Fires from the `
|
|
254
|
+
* Fires from the `POST_UPDATE` callback when a new entity collides with a grid entity.
|
|
238
255
|
*
|
|
239
256
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
240
257
|
* only fire if it matches the `GridEntityType` provided.
|
|
@@ -250,10 +267,10 @@ export declare enum ModCallbackCustom {
|
|
|
250
267
|
/**
|
|
251
268
|
* Fires when a new grid entity is initialized. Specifically, this is either:
|
|
252
269
|
*
|
|
253
|
-
* - in the `
|
|
254
|
-
*
|
|
255
|
-
* - in the `
|
|
256
|
-
*
|
|
270
|
+
* - in the `POST_NEW_ROOM` callback (firing every time a room is entered, even if the entity was
|
|
271
|
+
* previously there on a previous room entry)
|
|
272
|
+
* - in the `POST_UPDATE` callback (if the entity appeared mid-way through the room, like when the
|
|
273
|
+
* trapdoor appears after defeating It Lives!)
|
|
257
274
|
*
|
|
258
275
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
259
276
|
* only fire if it matches the `GridEntityType` provided.
|
|
@@ -264,8 +281,8 @@ export declare enum ModCallbackCustom {
|
|
|
264
281
|
*/
|
|
265
282
|
POST_GRID_ENTITY_INIT = 20,
|
|
266
283
|
/**
|
|
267
|
-
* Fires from the `
|
|
268
|
-
*
|
|
284
|
+
* Fires from the `POST_UPDATE` callback when a new grid entity is removed. Specifically, this on
|
|
285
|
+
* the frame after it no longer exists (where it did exist a frame ago).
|
|
269
286
|
*
|
|
270
287
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
271
288
|
* only fire if it matches the `GridEntityType` provided.
|
|
@@ -278,9 +295,21 @@ export declare enum ModCallbackCustom {
|
|
|
278
295
|
* ```
|
|
279
296
|
*/
|
|
280
297
|
POST_GRID_ENTITY_REMOVE = 21,
|
|
298
|
+
/**
|
|
299
|
+
* Fires from the `POST_RENDER` callback on every frame that a grid entity exists.
|
|
300
|
+
*
|
|
301
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
302
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
303
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
304
|
+
* only fire if it matches the variant provided.
|
|
305
|
+
*
|
|
306
|
+
* ```ts
|
|
307
|
+
* function postGridEntityRender(gridEntity: GridEntity): void {}
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
281
310
|
POST_GRID_ENTITY_RENDER = 22,
|
|
282
311
|
/**
|
|
283
|
-
* Fires from the `
|
|
312
|
+
* Fires from the `POST_UPDATE` callback when a grid entity changes its state.
|
|
284
313
|
*
|
|
285
314
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
286
315
|
* only fire if it matches the `GridEntityType` provided.
|
|
@@ -295,10 +324,12 @@ export declare enum ModCallbackCustom {
|
|
|
295
324
|
*/
|
|
296
325
|
POST_GRID_ENTITY_STATE_CHANGED = 23,
|
|
297
326
|
/**
|
|
298
|
-
* Fires from the `
|
|
327
|
+
* Fires from the `POST_UPDATE` callback on every frame that a grid entity exists.
|
|
299
328
|
*
|
|
300
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
301
|
-
*
|
|
329
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
330
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
331
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
332
|
+
* only fire if it matches the variant provided.
|
|
302
333
|
*
|
|
303
334
|
* ```ts
|
|
304
335
|
* function postGridEntityUpdate(gridEntity: GridEntity): void {}
|
|
@@ -328,10 +359,10 @@ export declare enum ModCallbackCustom {
|
|
|
328
359
|
*/
|
|
329
360
|
POST_HOLY_MANTLE_REMOVED = 25,
|
|
330
361
|
/**
|
|
331
|
-
* Fires from `
|
|
362
|
+
* Fires from `POST_PEFFECT_UPDATE` callback when the player loses charge on their active
|
|
332
363
|
* collectible item, implying that the item was just used.
|
|
333
364
|
*
|
|
334
|
-
* This callback is useful because the `
|
|
365
|
+
* This callback is useful because the `USE_ITEM` callback does not fire when The Candle, Red
|
|
335
366
|
* Candle, and Bob's Rotten Brain are discharged.
|
|
336
367
|
*
|
|
337
368
|
* Note that this callback will not fire if the active item is both discharged and swapped for
|
|
@@ -350,9 +381,9 @@ export declare enum ModCallbackCustom {
|
|
|
350
381
|
*/
|
|
351
382
|
POST_ITEM_DISCHARGE = 26,
|
|
352
383
|
/**
|
|
353
|
-
* Fires from the `
|
|
354
|
-
*
|
|
355
|
-
*
|
|
384
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when an item is no longer queued (i.e. when the
|
|
385
|
+
* animation of the player holding the item above their head is finished and the item is actually
|
|
386
|
+
* added to the player's inventory).
|
|
356
387
|
*
|
|
357
388
|
* Note that this callback will only fire once per Forgotten/Soul pair.
|
|
358
389
|
*
|
|
@@ -370,10 +401,10 @@ export declare enum ModCallbackCustom {
|
|
|
370
401
|
*/
|
|
371
402
|
POST_ITEM_PICKUP = 27,
|
|
372
403
|
/**
|
|
373
|
-
* Fires on the first `
|
|
404
|
+
* Fires on the first `POST_KNIFE_UPDATE` frame for each knife.
|
|
374
405
|
*
|
|
375
406
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
376
|
-
* normal `
|
|
407
|
+
* normal `POST_KNIFE_INIT` callback.
|
|
377
408
|
*
|
|
378
409
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
379
410
|
* only fire if the knife variant matches the `KnifeVariant` provided.
|
|
@@ -384,10 +415,10 @@ export declare enum ModCallbackCustom {
|
|
|
384
415
|
*/
|
|
385
416
|
POST_KNIFE_INIT_LATE = 28,
|
|
386
417
|
/**
|
|
387
|
-
* Fires on the first `
|
|
418
|
+
* Fires on the first `POST_LASER_UPDATE` frame for each laser.
|
|
388
419
|
*
|
|
389
420
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
390
|
-
* normal `
|
|
421
|
+
* normal `POST_LASER_INIT` callback.
|
|
391
422
|
*
|
|
392
423
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
393
424
|
* only fire if the laser variant matches the `LaserVariant` provided.
|
|
@@ -399,16 +430,15 @@ export declare enum ModCallbackCustom {
|
|
|
399
430
|
POST_LASER_INIT_LATE = 29,
|
|
400
431
|
/**
|
|
401
432
|
* The same as the vanilla callback of the same name, but fires in the correct order with respect
|
|
402
|
-
* to the `
|
|
433
|
+
* to the `POST_GAME_STARTED` and the `POST_NEW_ROOM` callbacks:
|
|
403
434
|
*
|
|
404
|
-
* `
|
|
405
|
-
* `MC_POST_NEW_ROOM_REORDERED`
|
|
435
|
+
* `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED`
|
|
406
436
|
*
|
|
407
437
|
* If some specific cases, mods can change the current level during run initialization (on the 0th
|
|
408
438
|
* frame). However, due to how the callback reordering works, the custom
|
|
409
|
-
* `
|
|
410
|
-
*
|
|
411
|
-
*
|
|
439
|
+
* `POST_NEW_LEVEL_REORDERED` callback will never fire on the 0th frame. To get around this, call
|
|
440
|
+
* the `forceNewLevelCallback()` function before changing levels to temporarily force the callback
|
|
441
|
+
* to fire.
|
|
412
442
|
*
|
|
413
443
|
* ```ts
|
|
414
444
|
* function postNewLevelReordered(): void {}
|
|
@@ -416,10 +446,10 @@ export declare enum ModCallbackCustom {
|
|
|
416
446
|
*/
|
|
417
447
|
POST_NEW_LEVEL_REORDERED = 30,
|
|
418
448
|
/**
|
|
419
|
-
* Fires on the first `
|
|
420
|
-
*
|
|
421
|
-
*
|
|
422
|
-
*
|
|
449
|
+
* Fires on the first `POST_NEW_ROOM` or `PRE_ENTITY_SPAWN` callback where being in a new room is
|
|
450
|
+
* detected. This is useful because the vanilla `POST_NEW_ROOM` callback fires only after entities
|
|
451
|
+
* in the room have been initialized and updated once, which means that it is possible for
|
|
452
|
+
* entity-related code to run before room-related-initialization has been performed.
|
|
423
453
|
*
|
|
424
454
|
* ```ts
|
|
425
455
|
* function postNewRoomEarly(): void {}
|
|
@@ -428,16 +458,15 @@ export declare enum ModCallbackCustom {
|
|
|
428
458
|
POST_NEW_ROOM_EARLY = 31,
|
|
429
459
|
/**
|
|
430
460
|
* The same as the vanilla callback of the same name, but fires in the correct order with respect
|
|
431
|
-
* to the `
|
|
461
|
+
* to the `POST_GAME_STARTED` and the `POST_NEW_LEVEL` callbacks:
|
|
432
462
|
*
|
|
433
|
-
* `
|
|
434
|
-
* `MC_POST_NEW_ROOM_REORDERED`
|
|
463
|
+
* `POST_GAME_STARTED_REORDERED` --> `POST_NEW_LEVEL_REORDERED` --> `POST_NEW_ROOM_REORDERED`
|
|
435
464
|
*
|
|
436
465
|
* If some specific cases, mods can change the current room during run initialization (on the 0th
|
|
437
|
-
* frame). However, due to how the callback reordering works, the custom
|
|
438
|
-
*
|
|
439
|
-
*
|
|
440
|
-
*
|
|
466
|
+
* frame). However, due to how the callback reordering works, the custom `POST_NEW_ROOM_REORDERED`
|
|
467
|
+
* callback will never fire on the 0th frame. To get around this, call the
|
|
468
|
+
* `forceNewRoomCallback()` function before changing levels to temporarily force the callback to
|
|
469
|
+
* fire.
|
|
441
470
|
*
|
|
442
471
|
* ```ts
|
|
443
472
|
* function postNewRoomReordered(): void {}
|
|
@@ -445,10 +474,10 @@ export declare enum ModCallbackCustom {
|
|
|
445
474
|
*/
|
|
446
475
|
POST_NEW_ROOM_REORDERED = 32,
|
|
447
476
|
/**
|
|
448
|
-
* Fires on the first `
|
|
477
|
+
* Fires on the first `NPC_UPDATE` frame for each NPC.
|
|
449
478
|
*
|
|
450
479
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
451
|
-
* normal `
|
|
480
|
+
* normal `POST_NPC_INIT` callback.
|
|
452
481
|
*
|
|
453
482
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
454
483
|
* only fire if the NPC's entity type matches the entity type provided.
|
|
@@ -459,8 +488,8 @@ export declare enum ModCallbackCustom {
|
|
|
459
488
|
*/
|
|
460
489
|
POST_NPC_INIT_LATE = 33,
|
|
461
490
|
/**
|
|
462
|
-
* Fires from the `
|
|
463
|
-
*
|
|
491
|
+
* Fires from the `POST_NPC_UPDATE` callback when an NPC's state has changed from what it was on
|
|
492
|
+
* the previous frame.
|
|
464
493
|
*
|
|
465
494
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
466
495
|
* only fire if it matches the `EntityType` provided.
|
|
@@ -476,9 +505,31 @@ export declare enum ModCallbackCustom {
|
|
|
476
505
|
* ```
|
|
477
506
|
*/
|
|
478
507
|
POST_NPC_STATE_CHANGED = 34,
|
|
508
|
+
/**
|
|
509
|
+
* Similar to the vanilla callback of the same name, but fires after the `POST_GAME_STARTED`
|
|
510
|
+
* callback fires (if the player is being updated on the 0th game frame of the run).
|
|
511
|
+
*
|
|
512
|
+
* This callback is useful for two reasons:
|
|
513
|
+
*
|
|
514
|
+
* 1. Normally, `POST_PEFFECT_UPDATE` fires before `POST_GAME_STARTED`. Since mod variables are
|
|
515
|
+
* often initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause
|
|
516
|
+
* problems.
|
|
517
|
+
* 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM`
|
|
518
|
+
* callback. For example, since the level is not generated yet, you will not be able to access
|
|
519
|
+
* any rooms.
|
|
520
|
+
*
|
|
521
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
522
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
523
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
524
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
525
|
+
*
|
|
526
|
+
* ```ts
|
|
527
|
+
* function postPEffectUpdateReordered(player: EntityPlayer): void {}
|
|
528
|
+
* ```
|
|
529
|
+
*/
|
|
479
530
|
POST_PEFFECT_UPDATE_REORDERED = 35,
|
|
480
531
|
/**
|
|
481
|
-
* Fires on the first `
|
|
532
|
+
* Fires on the first `POST_RENDER` frame that a pickup plays the "Collect" animation.
|
|
482
533
|
*
|
|
483
534
|
* Use this callback to know when a pickup is added to the player's inventory or health.
|
|
484
535
|
*
|
|
@@ -491,14 +542,14 @@ export declare enum ModCallbackCustom {
|
|
|
491
542
|
*/
|
|
492
543
|
POST_PICKUP_COLLECT = 36,
|
|
493
544
|
/**
|
|
494
|
-
* Fires from the `
|
|
545
|
+
* Fires from the `POST_PICKUP_INIT` callback on the first time that a player has seen the
|
|
495
546
|
* respective pickup on the run.
|
|
496
547
|
*
|
|
497
548
|
* This callback is useful because pickups will despawn upon leaving the room and respawn upon
|
|
498
549
|
* re-entering the room.
|
|
499
550
|
*
|
|
500
|
-
* For most cases, this callback will simply fire when `
|
|
501
|
-
*
|
|
551
|
+
* For most cases, this callback will simply fire when `POST_PICKUP_INIT` fires and the player is
|
|
552
|
+
* not re-entering a previously visited room.
|
|
502
553
|
*
|
|
503
554
|
* The special case is when a player enters a post-Ascent Treasure Room or Boss Room. For these
|
|
504
555
|
* cases, the `InitSeed` of any pickups seen from previous floors is kept track of to prevent the
|
|
@@ -513,10 +564,10 @@ export declare enum ModCallbackCustom {
|
|
|
513
564
|
*/
|
|
514
565
|
POST_PICKUP_INIT_FIRST = 37,
|
|
515
566
|
/**
|
|
516
|
-
* Fires on the first `
|
|
567
|
+
* Fires on the first `POST_PICKUP_UPDATE` frame for each pickup.
|
|
517
568
|
*
|
|
518
569
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
519
|
-
* normal `
|
|
570
|
+
* normal `POST_PICKUP_INIT` callback.
|
|
520
571
|
*
|
|
521
572
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
522
573
|
* only fire if the pickup variant matches the `PickupVariant` provided.
|
|
@@ -527,8 +578,8 @@ export declare enum ModCallbackCustom {
|
|
|
527
578
|
*/
|
|
528
579
|
POST_PICKUP_INIT_LATE = 38,
|
|
529
580
|
/**
|
|
530
|
-
* Fires from the `
|
|
531
|
-
*
|
|
581
|
+
* Fires from the `POST_PICKUP_UPDATE` callback when a pickup's state has changed from what it was
|
|
582
|
+
* on the previous frame.
|
|
532
583
|
*
|
|
533
584
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
534
585
|
* only fire if it matches the `PickupVariant` provided.
|
|
@@ -542,14 +593,36 @@ export declare enum ModCallbackCustom {
|
|
|
542
593
|
* ```
|
|
543
594
|
*/
|
|
544
595
|
POST_PICKUP_STATE_CHANGED = 39,
|
|
596
|
+
/**
|
|
597
|
+
* Fires from the `POST_RENDER` callback on every frame that a pit exists.
|
|
598
|
+
*
|
|
599
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
600
|
+
* only fire if it matches the variant provided.
|
|
601
|
+
*
|
|
602
|
+
* ```ts
|
|
603
|
+
* function postPitRender(pit: GridEntityPit): void {}
|
|
604
|
+
* ```
|
|
605
|
+
*/
|
|
545
606
|
POST_PIT_RENDER = 40,
|
|
607
|
+
/**
|
|
608
|
+
* Fires from the `POST_UPDATE` callback on every frame that a pit exists.
|
|
609
|
+
*
|
|
610
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
611
|
+
* only fire if it matches the variant provided.
|
|
612
|
+
*
|
|
613
|
+
* ```ts
|
|
614
|
+
* function postPitUpdate(pit: GridEntityPit): void {}
|
|
615
|
+
* ```
|
|
616
|
+
*/
|
|
546
617
|
POST_PIT_UPDATE = 41,
|
|
547
618
|
/**
|
|
548
|
-
* Fires from the `
|
|
619
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player entity gains or loses any health
|
|
549
620
|
* (i.e. hearts). For more information, see the `PlayerHealth` enum.
|
|
550
621
|
*
|
|
551
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
552
|
-
*
|
|
622
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
623
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
624
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
625
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
553
626
|
*
|
|
554
627
|
* ```ts
|
|
555
628
|
* function postPlayerChangeHealth(
|
|
@@ -561,13 +634,13 @@ export declare enum ModCallbackCustom {
|
|
|
561
634
|
*/
|
|
562
635
|
POST_PLAYER_CHANGE_HEALTH = 42,
|
|
563
636
|
/**
|
|
564
|
-
* Fires from the `
|
|
637
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player entity changes its player type
|
|
565
638
|
* (i.e. character). For example, it will fire after using Clicker, after dying with the Judas'
|
|
566
639
|
* Shadow collectible, etc.
|
|
567
640
|
*
|
|
568
641
|
* Notably, it does not fire after the player uses the Flip item or the Esau Jr. item, because
|
|
569
|
-
* those items cause separate player entities to be created. Use the `
|
|
570
|
-
* `
|
|
642
|
+
* those items cause separate player entities to be created. Use the `POST_FLIP` and
|
|
643
|
+
* `POST_ESAU_JR` callbacks to handle those situations.
|
|
571
644
|
*
|
|
572
645
|
* ```ts
|
|
573
646
|
* function postPlayerChangeType(
|
|
@@ -579,88 +652,186 @@ export declare enum ModCallbackCustom {
|
|
|
579
652
|
*/
|
|
580
653
|
POST_PLAYER_CHANGE_TYPE = 43,
|
|
581
654
|
/**
|
|
582
|
-
* Fires from the `
|
|
583
|
-
*
|
|
655
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is higher than
|
|
656
|
+
* what it was on the previous frame.
|
|
584
657
|
*
|
|
585
|
-
*
|
|
658
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
659
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
660
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
661
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
586
662
|
*
|
|
587
|
-
*
|
|
588
|
-
*
|
|
663
|
+
* ```ts
|
|
664
|
+
* function postPlayerCollectibleAdded(player: EntityPlayer, collectibleType: CollectibleType) {}
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
POST_PLAYER_COLLECTIBLE_ADDED = 44,
|
|
668
|
+
/**
|
|
669
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player's collectible count is lower than
|
|
670
|
+
* what it was on the previous frame.
|
|
589
671
|
*
|
|
590
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
591
|
-
*
|
|
672
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
673
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
674
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
675
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
676
|
+
*
|
|
677
|
+
* ```ts
|
|
678
|
+
* function postPlayerCollectibleRemoved(
|
|
679
|
+
* player: EntityPlayer,
|
|
680
|
+
* collectibleType: CollectibleType,
|
|
681
|
+
* ) {}
|
|
682
|
+
* ```
|
|
683
|
+
*/
|
|
684
|
+
POST_PLAYER_COLLECTIBLE_REMOVED = 45,
|
|
685
|
+
/**
|
|
686
|
+
* Fires from the `ENTITY_TAKE_DMG` callback when a player takes fatal damage. Return false to
|
|
687
|
+
* prevent the fatal damage.
|
|
688
|
+
*
|
|
689
|
+
* Note that this function does properly take into account Guppy's Collar, Broken Ankh, Spirit
|
|
690
|
+
* Shackles, and Mysterious Paper.
|
|
691
|
+
*
|
|
692
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
693
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
694
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
695
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
592
696
|
*
|
|
593
697
|
* ```ts
|
|
594
698
|
* function postPlayerFatalDamage(player: EntityPlayer) {}
|
|
595
699
|
* ```
|
|
596
700
|
*/
|
|
597
|
-
POST_PLAYER_FATAL_DAMAGE =
|
|
701
|
+
POST_PLAYER_FATAL_DAMAGE = 46,
|
|
598
702
|
/**
|
|
599
|
-
* Fires on the first `
|
|
703
|
+
* Fires on the first `POST_PLAYER_UPDATE` frame for each player.
|
|
600
704
|
*
|
|
601
705
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
602
|
-
* normal `
|
|
706
|
+
* normal `POST_PLAYER_INIT` callback.
|
|
603
707
|
*
|
|
604
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
605
|
-
*
|
|
708
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
709
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
710
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
711
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
606
712
|
*
|
|
607
713
|
* ```ts
|
|
608
714
|
* function postPlayerInitLate(pickup: EntityPickup): void {}
|
|
609
715
|
* ```
|
|
610
716
|
*/
|
|
611
|
-
POST_PLAYER_INIT_LATE =
|
|
717
|
+
POST_PLAYER_INIT_LATE = 47,
|
|
612
718
|
/**
|
|
613
|
-
* Similar to the vanilla callback of the same name, but fires after the `
|
|
719
|
+
* Similar to the vanilla callback of the same name, but fires after the `POST_GAME_STARTED`
|
|
614
720
|
* callback fires (if the player is spawning on the 0th game frame of the run).
|
|
615
721
|
*
|
|
616
722
|
* This callback is useful for two reasons:
|
|
617
723
|
*
|
|
618
|
-
* 1. Normally, `
|
|
619
|
-
*
|
|
620
|
-
*
|
|
621
|
-
* 1. Some functions do not work (or crash the game) when called before the `MC_POST_NEW_ROOM`
|
|
724
|
+
* 1. Normally, `POST_PLAYER_INIT` fires before `POST_GAME_STARTED`. Since mod variables are often
|
|
725
|
+
* initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause problems.
|
|
726
|
+
* 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM`
|
|
622
727
|
* callback. For example, since the level is not generated yet, you will not be able to access
|
|
623
728
|
* any rooms.
|
|
624
729
|
*
|
|
625
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
626
|
-
*
|
|
730
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
731
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
732
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
733
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
627
734
|
*
|
|
628
735
|
* ```ts
|
|
629
736
|
* function postPlayerInitReordered(player: EntityPlayer): void {}
|
|
630
737
|
* ```
|
|
631
738
|
*/
|
|
632
|
-
POST_PLAYER_INIT_REORDERED =
|
|
633
|
-
POST_PLAYER_RENDER_REORDERED = 47,
|
|
739
|
+
POST_PLAYER_INIT_REORDERED = 48,
|
|
634
740
|
/**
|
|
635
|
-
* Similar to the vanilla callback of the same name, but fires after the `
|
|
741
|
+
* Similar to the vanilla callback of the same name, but fires after the `POST_GAME_STARTED`
|
|
742
|
+
* callback fires (if the player is spawning on the 0th game frame of the run).
|
|
743
|
+
*
|
|
744
|
+
* This callback is useful for two reasons:
|
|
745
|
+
*
|
|
746
|
+
* 1. Normally, `POST_PLAYER_RENDER` fires before `POST_GAME_STARTED`. Since mod variables are
|
|
747
|
+
* often initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause
|
|
748
|
+
* problems.
|
|
749
|
+
* 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM`
|
|
750
|
+
* callback. For example, since the level is not generated yet, you will not be able to access
|
|
751
|
+
* any rooms.
|
|
752
|
+
*
|
|
753
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
754
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
755
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
756
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
757
|
+
*
|
|
758
|
+
* ```ts
|
|
759
|
+
* function postPlayerRenderReordered(player: EntityPlayer): void {}
|
|
760
|
+
* ```
|
|
761
|
+
*/
|
|
762
|
+
POST_PLAYER_RENDER_REORDERED = 49,
|
|
763
|
+
/**
|
|
764
|
+
* Similar to the vanilla callback of the same name, but fires after the `POST_GAME_STARTED`
|
|
636
765
|
* callback fires (if the player is being updated on the 0th game frame of the run).
|
|
637
766
|
*
|
|
638
767
|
* This callback is useful for two reasons:
|
|
639
768
|
*
|
|
640
|
-
* 1. Normally,
|
|
641
|
-
* often initialized at the beginning of the `
|
|
769
|
+
* 1. Normally, `POST_PLAYER_UPDATE` fires before `POST_GAME_STARTED`. Since mod variables are
|
|
770
|
+
* often initialized at the beginning of the `POST_GAME_STARTED` callback, this can cause
|
|
642
771
|
* problems.
|
|
643
|
-
* 1. Some functions do not work (or crash the game) when called before the `
|
|
772
|
+
* 1. Some functions do not work (or crash the game) when called before the `POST_NEW_ROOM`
|
|
644
773
|
* callback. For example, since the level is not generated yet, you will not be able to access
|
|
645
774
|
* any rooms.
|
|
646
775
|
*
|
|
647
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
648
|
-
*
|
|
776
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
777
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
778
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
779
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
649
780
|
*
|
|
650
781
|
* ```ts
|
|
651
782
|
* function postPlayerUpdateReordered(player: EntityPlayer): void {}
|
|
652
783
|
* ```
|
|
653
784
|
*/
|
|
654
|
-
POST_PLAYER_UPDATE_REORDERED =
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
785
|
+
POST_PLAYER_UPDATE_REORDERED = 50,
|
|
786
|
+
/**
|
|
787
|
+
* Fires from the `POST_RENDER` callback on every frame that a poop exists.
|
|
788
|
+
*
|
|
789
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
790
|
+
* only fire if it matches the variant provided.
|
|
791
|
+
*
|
|
792
|
+
* ```ts
|
|
793
|
+
* function postPoopRender(poop: GridEntityPoop): void {}
|
|
794
|
+
* ```
|
|
795
|
+
*/
|
|
796
|
+
POST_POOP_RENDER = 51,
|
|
659
797
|
/**
|
|
660
|
-
* Fires
|
|
798
|
+
* Fires from the `POST_UPDATE` callback on every frame that a poop exists.
|
|
799
|
+
*
|
|
800
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
801
|
+
* only fire if it matches the variant provided.
|
|
802
|
+
*
|
|
803
|
+
* ```ts
|
|
804
|
+
* function postPoopUpdate(poop: GridEntityPoop): void {}
|
|
805
|
+
* ```
|
|
806
|
+
*/
|
|
807
|
+
POST_POOP_UPDATE = 52,
|
|
808
|
+
/**
|
|
809
|
+
* Fires from the `POST_RENDER` callback on every frame that a pressure plate exists.
|
|
810
|
+
*
|
|
811
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
812
|
+
* only fire if it matches the variant provided.
|
|
813
|
+
*
|
|
814
|
+
* ```ts
|
|
815
|
+
* function postPressurePlateRender(pressurePlate: GridEntityPressurePlate): void {}
|
|
816
|
+
* ```
|
|
817
|
+
*/
|
|
818
|
+
POST_PRESSURE_PLATE_RENDER = 53,
|
|
819
|
+
/**
|
|
820
|
+
* Fires from the `POST_UPDATE` callback on every frame that a pressure plate exists.
|
|
821
|
+
*
|
|
822
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
823
|
+
* only fire if it matches the variant provided.
|
|
824
|
+
*
|
|
825
|
+
* ```ts
|
|
826
|
+
* function postPressurePlateUpdate(pressurePlate: GridEntityPressurePlate): void {}
|
|
827
|
+
* ```
|
|
828
|
+
*/
|
|
829
|
+
POST_PRESSURE_PLATE_UPDATE = 54,
|
|
830
|
+
/**
|
|
831
|
+
* Fires on the first `POST_PROJECTILE_UPDATE` frame for each projectile.
|
|
661
832
|
*
|
|
662
833
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
663
|
-
* normal `
|
|
834
|
+
* normal `POST_PROJECTILE_INIT` callback.
|
|
664
835
|
*
|
|
665
836
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
666
837
|
* only fire if the projectile variant matches the `ProjectileVariant` provided.
|
|
@@ -669,9 +840,9 @@ export declare enum ModCallbackCustom {
|
|
|
669
840
|
* function postProjectileInitLate(projectile: EntityProjectile): void {}
|
|
670
841
|
* ```
|
|
671
842
|
*/
|
|
672
|
-
POST_PROJECTILE_INIT_LATE =
|
|
843
|
+
POST_PROJECTILE_INIT_LATE = 55,
|
|
673
844
|
/**
|
|
674
|
-
* Fires from the `
|
|
845
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player first picks up a new item. The
|
|
675
846
|
* pickup returned in the callback is assumed to be the first pickup that no longer exists.
|
|
676
847
|
*
|
|
677
848
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
@@ -683,21 +854,53 @@ export declare enum ModCallbackCustom {
|
|
|
683
854
|
* function postPurchase(player: EntityPlayer, pickup: EntityPickup): void {}
|
|
684
855
|
* ```
|
|
685
856
|
*/
|
|
686
|
-
POST_PURCHASE =
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
857
|
+
POST_PURCHASE = 56,
|
|
858
|
+
/**
|
|
859
|
+
* Fires from the `POST_RENDER` callback on every frame that a rock exists.
|
|
860
|
+
*
|
|
861
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
862
|
+
* only fire if it matches the variant provided.
|
|
863
|
+
*
|
|
864
|
+
* ```ts
|
|
865
|
+
* function postRockRender(rock: GridEntityRock): void {}
|
|
866
|
+
* ```
|
|
867
|
+
*/
|
|
868
|
+
POST_ROCK_RENDER = 57,
|
|
690
869
|
/**
|
|
691
|
-
* Fires from the `
|
|
692
|
-
*
|
|
870
|
+
* Fires from the `POST_UPDATE` callback on every frame that a rock exists.
|
|
871
|
+
*
|
|
872
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
873
|
+
* only fire if it matches the variant provided.
|
|
874
|
+
*
|
|
875
|
+
* ```ts
|
|
876
|
+
* function postRockUpdate(rock: GridEntityRock): void {}
|
|
877
|
+
* ```
|
|
878
|
+
*/
|
|
879
|
+
POST_ROCK_UPDATE = 58,
|
|
880
|
+
/**
|
|
881
|
+
* Fires from the `POST_UPDATE` callback when the clear state of a room changes.
|
|
882
|
+
*
|
|
883
|
+
* ```ts
|
|
884
|
+
* function postRoomClearChanged(roomClear: boolean): void {}
|
|
885
|
+
* ```
|
|
886
|
+
*/
|
|
887
|
+
POST_ROOM_CLEAR_CHANGED = 59,
|
|
888
|
+
/**
|
|
889
|
+
* Fires from the `ENTITY_TAKE_DMG` callback when a player takes damage from spikes in a Sacrifice
|
|
890
|
+
* Room.
|
|
891
|
+
*
|
|
892
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
893
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
894
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
895
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
693
896
|
*
|
|
694
897
|
* ```ts
|
|
695
898
|
* function postSacrifice(player: EntityPlayer, numSacrifices: int): void {}
|
|
696
899
|
* ```
|
|
697
900
|
*/
|
|
698
|
-
POST_SACRIFICE =
|
|
901
|
+
POST_SACRIFICE = 60,
|
|
699
902
|
/**
|
|
700
|
-
* Fires from the `
|
|
903
|
+
* Fires from the `POST_RENDER` callback when a slot entity's animation changes.
|
|
701
904
|
*
|
|
702
905
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
703
906
|
* only fire if it matches the `SlotVariant` provided.
|
|
@@ -706,9 +909,9 @@ export declare enum ModCallbackCustom {
|
|
|
706
909
|
* function postSlotAnimationChanged(slot: Entity): void {}
|
|
707
910
|
* ```
|
|
708
911
|
*/
|
|
709
|
-
POST_SLOT_ANIMATION_CHANGED =
|
|
912
|
+
POST_SLOT_ANIMATION_CHANGED = 61,
|
|
710
913
|
/**
|
|
711
|
-
* Fires from the `
|
|
914
|
+
* Fires from the `POST_RENDER` callback when a slot plays the animation that indicates that it
|
|
712
915
|
* has broken.
|
|
713
916
|
*
|
|
714
917
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
@@ -718,14 +921,14 @@ export declare enum ModCallbackCustom {
|
|
|
718
921
|
* function postSlotDestroyed(slot: Entity): void {}
|
|
719
922
|
* ```
|
|
720
923
|
*/
|
|
721
|
-
POST_SLOT_DESTROYED =
|
|
924
|
+
POST_SLOT_DESTROYED = 62,
|
|
722
925
|
/**
|
|
723
926
|
* Fires when a new slot entity is initialized. Specifically, this is either:
|
|
724
927
|
*
|
|
725
|
-
* - in the `
|
|
726
|
-
*
|
|
727
|
-
* - in the `
|
|
728
|
-
*
|
|
928
|
+
* - in the `POST_NEW_ROOM` callback (firing every time a room is entered, even if the entity was
|
|
929
|
+
* previously there on a previous room entry)
|
|
930
|
+
* - in the `POST_UPDATE` callback (if the entity appeared mid-way through the room, like when a
|
|
931
|
+
* Wheel of Fortune card is used)
|
|
729
932
|
*
|
|
730
933
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
731
934
|
* only fire if it matches the `SlotVariant` provided.
|
|
@@ -734,9 +937,9 @@ export declare enum ModCallbackCustom {
|
|
|
734
937
|
* function postSlotInit(slot: Entity): void {}
|
|
735
938
|
* ```
|
|
736
939
|
*/
|
|
737
|
-
POST_SLOT_INIT =
|
|
940
|
+
POST_SLOT_INIT = 63,
|
|
738
941
|
/**
|
|
739
|
-
* Fires from the `
|
|
942
|
+
* Fires from the `POST_RENDER` callback on every frame that a slot entity exists.
|
|
740
943
|
*
|
|
741
944
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
742
945
|
* only fire if it matches the `SlotVariant` provided.
|
|
@@ -745,9 +948,9 @@ export declare enum ModCallbackCustom {
|
|
|
745
948
|
* function postSlotRender(slot: Entity): void {}
|
|
746
949
|
* ```
|
|
747
950
|
*/
|
|
748
|
-
POST_SLOT_RENDER =
|
|
951
|
+
POST_SLOT_RENDER = 64,
|
|
749
952
|
/**
|
|
750
|
-
* Fires from the `
|
|
953
|
+
* Fires from the `POST_UPDATE` callback on every frame that a slot entity exists.
|
|
751
954
|
*
|
|
752
955
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
753
956
|
* only fire if it matches the `SlotVariant` provided.
|
|
@@ -756,14 +959,34 @@ export declare enum ModCallbackCustom {
|
|
|
756
959
|
* function postSlotUpdate(slot: Entity): void {}
|
|
757
960
|
* ```
|
|
758
961
|
*/
|
|
759
|
-
POST_SLOT_UPDATE =
|
|
760
|
-
|
|
761
|
-
|
|
962
|
+
POST_SLOT_UPDATE = 65,
|
|
963
|
+
/**
|
|
964
|
+
* Fires from the `POST_RENDER` callback on every frame that spikes exist.
|
|
965
|
+
*
|
|
966
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
967
|
+
* only fire if it matches the variant provided.
|
|
968
|
+
*
|
|
969
|
+
* ```ts
|
|
970
|
+
* function postSpikesRender(spikes: GridEntitySpikes): void {}
|
|
971
|
+
* ```
|
|
972
|
+
*/
|
|
973
|
+
POST_SPIKES_RENDER = 66,
|
|
762
974
|
/**
|
|
763
|
-
* Fires
|
|
975
|
+
* Fires from the `POST_UPDATE` callback on every frame that spikes exist.
|
|
976
|
+
*
|
|
977
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
978
|
+
* only fire if it matches the variant provided.
|
|
979
|
+
*
|
|
980
|
+
* ```ts
|
|
981
|
+
* function postSpikesUpdate(spikes: GridEntitySpikes): void {}
|
|
982
|
+
* ```
|
|
983
|
+
*/
|
|
984
|
+
POST_SPIKES_UPDATE = 67,
|
|
985
|
+
/**
|
|
986
|
+
* Fires on the first `POST_TEAR_UPDATE` frame for each tear.
|
|
764
987
|
*
|
|
765
988
|
* This callback is useful because many attributes cannot be set or retrieved properly in the
|
|
766
|
-
* normal `
|
|
989
|
+
* normal `POST_TEAR_INIT` callback.
|
|
767
990
|
*
|
|
768
991
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
769
992
|
* only fire if the tear variant matches the `TearVariant` provided.
|
|
@@ -772,9 +995,9 @@ export declare enum ModCallbackCustom {
|
|
|
772
995
|
* function postTearInitLate(tear: EntityTear): void {}
|
|
773
996
|
* ```
|
|
774
997
|
*/
|
|
775
|
-
POST_TEAR_INIT_LATE =
|
|
998
|
+
POST_TEAR_INIT_LATE = 68,
|
|
776
999
|
/**
|
|
777
|
-
* Fires on the second `
|
|
1000
|
+
* Fires on the second `POST_TEAR_UPDATE` frame for each tear (i.e. frame 1).
|
|
778
1001
|
*
|
|
779
1002
|
* This callback is useful because Incubus tears are not distinguishable until the second frame.
|
|
780
1003
|
*
|
|
@@ -785,11 +1008,31 @@ export declare enum ModCallbackCustom {
|
|
|
785
1008
|
* function postTearInitVeryLate(tear: EntityTear): void {}
|
|
786
1009
|
* ```
|
|
787
1010
|
*/
|
|
788
|
-
POST_TEAR_INIT_VERY_LATE =
|
|
789
|
-
|
|
790
|
-
|
|
1011
|
+
POST_TEAR_INIT_VERY_LATE = 69,
|
|
1012
|
+
/**
|
|
1013
|
+
* Fires from the `POST_RENDER` callback on every frame that a TNT exists.
|
|
1014
|
+
*
|
|
1015
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
1016
|
+
* only fire if it matches the variant provided.
|
|
1017
|
+
*
|
|
1018
|
+
* ```ts
|
|
1019
|
+
* function postTNTRender(tnt: GridEntityTNT): void {}
|
|
1020
|
+
* ```
|
|
1021
|
+
*/
|
|
1022
|
+
POST_TNT_RENDER = 70,
|
|
791
1023
|
/**
|
|
792
|
-
* Fires from the `
|
|
1024
|
+
* Fires from the `POST_UPDATE` callback on every frame that a TNT exists.
|
|
1025
|
+
*
|
|
1026
|
+
* When registering the callback, takes an optional second argument that will make the callback
|
|
1027
|
+
* only fire if it matches the variant provided.
|
|
1028
|
+
*
|
|
1029
|
+
* ```ts
|
|
1030
|
+
* function postTNTUpdate(tnt: GridEntityTNT): void {}
|
|
1031
|
+
* ```
|
|
1032
|
+
*/
|
|
1033
|
+
POST_TNT_UPDATE = 71,
|
|
1034
|
+
/**
|
|
1035
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when a player gains or loses a new
|
|
793
1036
|
* transformation.
|
|
794
1037
|
*
|
|
795
1038
|
* Note that this callback will only fire once per Forgotten/Soul pair.
|
|
@@ -805,9 +1048,9 @@ export declare enum ModCallbackCustom {
|
|
|
805
1048
|
* ): void {}
|
|
806
1049
|
* ```
|
|
807
1050
|
*/
|
|
808
|
-
POST_TRANSFORMATION =
|
|
1051
|
+
POST_TRANSFORMATION = 72,
|
|
809
1052
|
/**
|
|
810
|
-
* Fires from `
|
|
1053
|
+
* Fires from `ENTITY_TAKE_DMG` callback when a Wishbone or a Walnut breaks.
|
|
811
1054
|
*
|
|
812
1055
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
813
1056
|
* only fire if it matches the `TrinketType` provided.
|
|
@@ -819,36 +1062,43 @@ export declare enum ModCallbackCustom {
|
|
|
819
1062
|
* ): void {}
|
|
820
1063
|
* ```
|
|
821
1064
|
*/
|
|
822
|
-
POST_TRINKET_BREAK =
|
|
1065
|
+
POST_TRINKET_BREAK = 73,
|
|
823
1066
|
/**
|
|
824
|
-
* Fires from the `
|
|
825
|
-
*
|
|
826
|
-
*
|
|
1067
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback on the frame before a Berserk effect ends when
|
|
1068
|
+
* the player is predicted to die (e.g. they currently have no health left or they took damage in
|
|
1069
|
+
* a "Lost" form).
|
|
827
1070
|
*
|
|
828
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
829
|
-
*
|
|
1071
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
1072
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
1073
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
1074
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
830
1075
|
*
|
|
831
1076
|
* ```ts
|
|
832
1077
|
* function preBerserkDeath(player: EntityPlayer) {}
|
|
833
1078
|
* ```
|
|
834
1079
|
*/
|
|
835
|
-
PRE_BERSERK_DEATH =
|
|
1080
|
+
PRE_BERSERK_DEATH = 74,
|
|
836
1081
|
/**
|
|
837
|
-
* Fires from the `
|
|
838
|
-
*
|
|
839
|
-
*
|
|
1082
|
+
* Fires from the `POST_PLAYER_FATAL_DAMAGE` callback when a player is about to die. If you want
|
|
1083
|
+
* to initiate a custom revival, return an integer that corresponds to the item or type of revival
|
|
1084
|
+
* that you are doing. Otherwise, return undefined to continue the fatal damage.
|
|
840
1085
|
*
|
|
841
1086
|
* This callback is useful because reviving the player after the game things that player should
|
|
842
1087
|
* have died will result in the save data for the run getting deleted.
|
|
843
1088
|
*
|
|
1089
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
1090
|
+
* only fire if the player matches the `PlayerVariant` provided.
|
|
1091
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
1092
|
+
* only fire if the player matches the `PlayerType` provided.
|
|
1093
|
+
*
|
|
844
1094
|
* ```ts
|
|
845
1095
|
* function preCustomRevive(player: EntityPlayer) {}
|
|
846
1096
|
* ```
|
|
847
1097
|
*/
|
|
848
|
-
PRE_CUSTOM_REVIVE =
|
|
1098
|
+
PRE_CUSTOM_REVIVE = 75,
|
|
849
1099
|
/**
|
|
850
|
-
* Fires from the `
|
|
851
|
-
*
|
|
1100
|
+
* Fires from the `POST_PEFFECT_UPDATE` callback when an item becomes queued (i.e. when the player
|
|
1101
|
+
* begins to hold the item above their head).
|
|
852
1102
|
*
|
|
853
1103
|
* Note that this callback will only fire once per Forgotten/Soul pair.
|
|
854
1104
|
*
|
|
@@ -864,10 +1114,10 @@ export declare enum ModCallbackCustom {
|
|
|
864
1114
|
* ): void {}
|
|
865
1115
|
* ```
|
|
866
1116
|
*/
|
|
867
|
-
PRE_ITEM_PICKUP =
|
|
1117
|
+
PRE_ITEM_PICKUP = 76,
|
|
868
1118
|
/**
|
|
869
|
-
* Fires on the `
|
|
870
|
-
*
|
|
1119
|
+
* Fires on the `POST_RENDER` frame before the player is taken to a new floor. Only fires when a
|
|
1120
|
+
* player jumps into a trapdoor or enters a heaven door (beam of light). Does not fire on the
|
|
871
1121
|
* first floor of the run. Does not fire when the player reloads/reseeds the current floor (i.e.
|
|
872
1122
|
* Forget Me Now, 5-pip dice room).
|
|
873
1123
|
*
|
|
@@ -878,5 +1128,5 @@ export declare enum ModCallbackCustom {
|
|
|
878
1128
|
* function preNewLevel(player: EntityPlayer): void {}
|
|
879
1129
|
* ```
|
|
880
1130
|
*/
|
|
881
|
-
PRE_NEW_LEVEL =
|
|
1131
|
+
PRE_NEW_LEVEL = 77
|
|
882
1132
|
}
|