isaacscript-common 27.10.1 → 27.12.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.
Files changed (61) hide show
  1. package/dist/index.rollup.d.ts +300 -96
  2. package/dist/isaacscript-common.lua +425 -97
  3. package/dist/src/callbackClasses.d.ts +10 -0
  4. package/dist/src/callbackClasses.d.ts.map +1 -1
  5. package/dist/src/callbackClasses.lua +50 -0
  6. package/dist/src/callbacks.d.ts +106 -96
  7. package/dist/src/callbacks.d.ts.map +1 -1
  8. package/dist/src/callbacks.lua +10 -0
  9. package/dist/src/classes/callbacks/PostEffectInitFilter.d.ts +9 -0
  10. package/dist/src/classes/callbacks/PostEffectInitFilter.d.ts.map +1 -0
  11. package/dist/src/classes/callbacks/PostEffectInitFilter.lua +23 -0
  12. package/dist/src/classes/callbacks/PostEffectRenderFilter.d.ts +9 -0
  13. package/dist/src/classes/callbacks/PostEffectRenderFilter.d.ts.map +1 -0
  14. package/dist/src/classes/callbacks/PostEffectRenderFilter.lua +23 -0
  15. package/dist/src/classes/callbacks/PostEffectUpdateFilter.d.ts +9 -0
  16. package/dist/src/classes/callbacks/PostEffectUpdateFilter.d.ts.map +1 -0
  17. package/dist/src/classes/callbacks/PostEffectUpdateFilter.lua +23 -0
  18. package/dist/src/classes/callbacks/PostFamiliarInitFilter.d.ts +9 -0
  19. package/dist/src/classes/callbacks/PostFamiliarInitFilter.d.ts.map +1 -0
  20. package/dist/src/classes/callbacks/PostFamiliarInitFilter.lua +23 -0
  21. package/dist/src/classes/callbacks/PostFamiliarRenderFilter.d.ts +9 -0
  22. package/dist/src/classes/callbacks/PostFamiliarRenderFilter.d.ts.map +1 -0
  23. package/dist/src/classes/callbacks/PostFamiliarRenderFilter.lua +23 -0
  24. package/dist/src/classes/callbacks/PostFamiliarUpdateFilter.d.ts +9 -0
  25. package/dist/src/classes/callbacks/PostFamiliarUpdateFilter.d.ts.map +1 -0
  26. package/dist/src/classes/callbacks/PostFamiliarUpdateFilter.lua +23 -0
  27. package/dist/src/classes/callbacks/PostLaserInitFilter.d.ts +9 -0
  28. package/dist/src/classes/callbacks/PostLaserInitFilter.d.ts.map +1 -0
  29. package/dist/src/classes/callbacks/PostLaserInitFilter.lua +23 -0
  30. package/dist/src/classes/callbacks/PostLaserRenderFilter.d.ts +9 -0
  31. package/dist/src/classes/callbacks/PostLaserRenderFilter.d.ts.map +1 -0
  32. package/dist/src/classes/callbacks/PostLaserRenderFilter.lua +23 -0
  33. package/dist/src/classes/callbacks/PostLaserUpdateFilter.d.ts +9 -0
  34. package/dist/src/classes/callbacks/PostLaserUpdateFilter.d.ts.map +1 -0
  35. package/dist/src/classes/callbacks/PostLaserUpdateFilter.lua +23 -0
  36. package/dist/src/classes/callbacks/PreFamiliarCollisionFilter.d.ts +9 -0
  37. package/dist/src/classes/callbacks/PreFamiliarCollisionFilter.d.ts.map +1 -0
  38. package/dist/src/classes/callbacks/PreFamiliarCollisionFilter.lua +21 -0
  39. package/dist/src/enums/ModCallbackCustom.d.ts +250 -96
  40. package/dist/src/enums/ModCallbackCustom.d.ts.map +1 -1
  41. package/dist/src/enums/ModCallbackCustom.lua +116 -96
  42. package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts +50 -0
  43. package/dist/src/interfaces/private/AddCallbackParametersCustom.d.ts.map +1 -1
  44. package/dist/src/shouldFire.d.ts +3 -3
  45. package/dist/src/shouldFire.d.ts.map +1 -1
  46. package/package.json +1 -1
  47. package/src/callbackClasses.ts +10 -0
  48. package/src/callbacks.ts +11 -0
  49. package/src/classes/callbacks/PostEffectInitFilter.ts +22 -0
  50. package/src/classes/callbacks/PostEffectRenderFilter.ts +22 -0
  51. package/src/classes/callbacks/PostEffectUpdateFilter.ts +22 -0
  52. package/src/classes/callbacks/PostFamiliarInitFilter.ts +22 -0
  53. package/src/classes/callbacks/PostFamiliarRenderFilter.ts +25 -0
  54. package/src/classes/callbacks/PostFamiliarUpdateFilter.ts +22 -0
  55. package/src/classes/callbacks/PostLaserInitFilter.ts +22 -0
  56. package/src/classes/callbacks/PostLaserRenderFilter.ts +22 -0
  57. package/src/classes/callbacks/PostLaserUpdateFilter.ts +22 -0
  58. package/src/classes/callbacks/PreFamiliarCollisionFilter.ts +24 -0
  59. package/src/enums/ModCallbackCustom.ts +164 -0
  60. package/src/interfaces/private/AddCallbackParametersCustom.ts +64 -0
  61. package/src/shouldFire.ts +4 -1
@@ -17,12 +17,18 @@ export { PostCustomRevive } from "./classes/callbacks/PostCustomRevive";
17
17
  export { PostDiceRoomActivated } from "./classes/callbacks/PostDiceRoomActivated";
18
18
  export { PostDoorRender } from "./classes/callbacks/PostDoorRender";
19
19
  export { PostDoorUpdate } from "./classes/callbacks/PostDoorUpdate";
20
+ export { PostEffectInitFilter } from "./classes/callbacks/PostEffectInitFilter";
20
21
  export { PostEffectInitLate } from "./classes/callbacks/PostEffectInitLate";
22
+ export { PostEffectRenderFilter } from "./classes/callbacks/PostEffectRenderFilter";
21
23
  export { PostEffectStateChanged } from "./classes/callbacks/PostEffectStateChanged";
24
+ export { PostEffectUpdateFilter } from "./classes/callbacks/PostEffectUpdateFilter";
22
25
  export { PostEntityKillFilter } from "./classes/callbacks/PostEntityKillFilter";
23
26
  export { PostEsauJr } from "./classes/callbacks/PostEsauJr";
27
+ export { PostFamiliarInitFilter } from "./classes/callbacks/PostFamiliarInitFilter";
24
28
  export { PostFamiliarInitLate } from "./classes/callbacks/PostFamiliarInitLate";
29
+ export { PostFamiliarRenderFilter } from "./classes/callbacks/PostFamiliarRenderFilter";
25
30
  export { PostFamiliarStateChanged } from "./classes/callbacks/PostFamiliarStateChanged";
31
+ export { PostFamiliarUpdateFilter } from "./classes/callbacks/PostFamiliarUpdateFilter";
26
32
  export { PostFirstEsauJr } from "./classes/callbacks/PostFirstEsauJr";
27
33
  export { PostFirstFlip } from "./classes/callbacks/PostFirstFlip";
28
34
  export { PostFlip } from "./classes/callbacks/PostFlip";
@@ -48,7 +54,10 @@ export { PostItemDischarge } from "./classes/callbacks/PostItemDischarge";
48
54
  export { PostItemPickup } from "./classes/callbacks/PostItemPickup";
49
55
  export { PostKeyboardChanged as PostKeyboardPressed } from "./classes/callbacks/PostKeyboardChanged";
50
56
  export { PostKnifeInitLate } from "./classes/callbacks/PostKnifeInitLate";
57
+ export { PostLaserInitFilter } from "./classes/callbacks/PostLaserInitFilter";
51
58
  export { PostLaserInitLate } from "./classes/callbacks/PostLaserInitLate";
59
+ export { PostLaserRenderFilter } from "./classes/callbacks/PostLaserRenderFilter";
60
+ export { PostLaserUpdateFilter } from "./classes/callbacks/PostLaserUpdateFilter";
52
61
  export { PostNewLevelReordered } from "./classes/callbacks/PostNewLevelReordered";
53
62
  export { PostNewRoomEarly } from "./classes/callbacks/PostNewRoomEarly";
54
63
  export { PostNewRoomReordered } from "./classes/callbacks/PostNewRoomReordered";
@@ -107,6 +116,7 @@ export { PostTrinketBreak } from "./classes/callbacks/PostTrinketBreak";
107
116
  export { PreBerserkDeath } from "./classes/callbacks/PreBerserkDeath";
108
117
  export { PreCustomRevive } from "./classes/callbacks/PreCustomRevive";
109
118
  export { PreEntitySpawnFilter } from "./classes/callbacks/PreEntitySpawnFilter";
119
+ export { PreFamiliarCollisionFilter } from "./classes/callbacks/PreFamiliarCollisionFilter";
110
120
  export { PreGetPedestal } from "./classes/callbacks/PreGetPedestal";
111
121
  export { PreItemPickup } from "./classes/callbacks/PreItemPickup";
112
122
  export { PreNewLevel } from "./classes/callbacks/PreNewLevel";
package/src/callbacks.ts CHANGED
@@ -20,12 +20,18 @@ const MOD_CALLBACK_CUSTOM_TO_CLASS = {
20
20
  [ModCallbackCustom.POST_DICE_ROOM_ACTIVATED]: cc.PostDiceRoomActivated,
21
21
  [ModCallbackCustom.POST_DOOR_RENDER]: cc.PostDoorRender,
22
22
  [ModCallbackCustom.POST_DOOR_UPDATE]: cc.PostDoorUpdate,
23
+ [ModCallbackCustom.POST_EFFECT_INIT_FILTER]: cc.PostEffectInitFilter,
23
24
  [ModCallbackCustom.POST_EFFECT_INIT_LATE]: cc.PostEffectInitLate,
25
+ [ModCallbackCustom.POST_EFFECT_RENDER_FILTER]: cc.PostEffectRenderFilter,
24
26
  [ModCallbackCustom.POST_EFFECT_STATE_CHANGED]: cc.PostEffectStateChanged,
27
+ [ModCallbackCustom.POST_EFFECT_UPDATE_FILTER]: cc.PostEffectUpdateFilter,
25
28
  [ModCallbackCustom.POST_ENTITY_KILL_FILTER]: cc.PostEntityKillFilter,
26
29
  [ModCallbackCustom.POST_ESAU_JR]: cc.PostEsauJr,
30
+ [ModCallbackCustom.POST_FAMILIAR_INIT_FILTER]: cc.PostFamiliarInitFilter,
27
31
  [ModCallbackCustom.POST_FAMILIAR_INIT_LATE]: cc.PostFamiliarInitLate,
32
+ [ModCallbackCustom.POST_FAMILIAR_RENDER_FILTER]: cc.PostFamiliarRenderFilter,
28
33
  [ModCallbackCustom.POST_FAMILIAR_STATE_CHANGED]: cc.PostFamiliarStateChanged,
34
+ [ModCallbackCustom.POST_FAMILIAR_UPDATE_FILTER]: cc.PostFamiliarUpdateFilter,
29
35
  [ModCallbackCustom.POST_FIRST_FLIP]: cc.PostFirstFlip,
30
36
  [ModCallbackCustom.POST_FIRST_ESAU_JR]: cc.PostFirstEsauJr,
31
37
  [ModCallbackCustom.POST_FLIP]: cc.PostFlip,
@@ -59,7 +65,10 @@ const MOD_CALLBACK_CUSTOM_TO_CLASS = {
59
65
  [ModCallbackCustom.POST_ITEM_PICKUP]: cc.PostItemPickup,
60
66
  [ModCallbackCustom.POST_KEYBOARD_CHANGED]: cc.PostKeyboardPressed,
61
67
  [ModCallbackCustom.POST_KNIFE_INIT_LATE]: cc.PostKnifeInitLate,
68
+ [ModCallbackCustom.POST_LASER_INIT_FILTER]: cc.PostLaserInitFilter,
62
69
  [ModCallbackCustom.POST_LASER_INIT_LATE]: cc.PostLaserInitLate,
70
+ [ModCallbackCustom.POST_LASER_RENDER_FILTER]: cc.PostLaserRenderFilter,
71
+ [ModCallbackCustom.POST_LASER_UPDATE_FILTER]: cc.PostLaserUpdateFilter,
63
72
  [ModCallbackCustom.POST_NEW_LEVEL_REORDERED]: cc.PostNewLevelReordered,
64
73
  [ModCallbackCustom.POST_NEW_ROOM_EARLY]: cc.PostNewRoomEarly,
65
74
  [ModCallbackCustom.POST_NEW_ROOM_REORDERED]: cc.PostNewRoomReordered,
@@ -124,6 +133,8 @@ const MOD_CALLBACK_CUSTOM_TO_CLASS = {
124
133
  [ModCallbackCustom.PRE_BERSERK_DEATH]: cc.PreBerserkDeath,
125
134
  [ModCallbackCustom.PRE_CUSTOM_REVIVE]: cc.PreCustomRevive,
126
135
  [ModCallbackCustom.PRE_ENTITY_SPAWN_FILTER]: cc.PreEntitySpawnFilter,
136
+ [ModCallbackCustom.PRE_FAMILIAR_COLLISION_FILTER]:
137
+ cc.PreFamiliarCollisionFilter,
127
138
  [ModCallbackCustom.PRE_GET_PEDESTAL]: cc.PreGetPedestal,
128
139
  [ModCallbackCustom.PRE_ITEM_PICKUP]: cc.PreItemPickup,
129
140
  [ModCallbackCustom.PRE_NEW_LEVEL]: cc.PreNewLevel,
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireEffect } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostEffectInitFilter extends CustomCallback<ModCallbackCustom.POST_EFFECT_INIT_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 54
12
+ [ModCallback.POST_EFFECT_INIT, this.postEffectInit],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireEffect;
17
+
18
+ // ModCallback.POST_EFFECT_INIT (54)
19
+ private postEffectInit = (effect: EntityEffect) => {
20
+ this.fire(effect);
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireEffect } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostEffectRenderFilter extends CustomCallback<ModCallbackCustom.POST_EFFECT_RENDER_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 56
12
+ [ModCallback.POST_EFFECT_RENDER, this.postEffectRender],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireEffect;
17
+
18
+ // ModCallback.POST_EFFECT_RENDER (56)
19
+ private postEffectRender = (effect: EntityEffect, renderOffset: Vector) => {
20
+ this.fire(effect, renderOffset);
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireEffect } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostEffectUpdateFilter extends CustomCallback<ModCallbackCustom.POST_EFFECT_UPDATE_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 55
12
+ [ModCallback.POST_EFFECT_UPDATE, this.postEffectUpdate],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireEffect;
17
+
18
+ // ModCallback.POST_EFFECT_UPDATE (55)
19
+ private postEffectUpdate = (effect: EntityEffect) => {
20
+ this.fire(effect);
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireFamiliar } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostFamiliarInitFilter extends CustomCallback<ModCallbackCustom.POST_FAMILIAR_INIT_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 7
12
+ [ModCallback.POST_FAMILIAR_INIT, this.postFamiliarInit],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireFamiliar;
17
+
18
+ // ModCallback.POST_FAMILIAR_INIT (7)
19
+ private postFamiliarInit = (familiar: EntityFamiliar) => {
20
+ this.fire(familiar);
21
+ };
22
+ }
@@ -0,0 +1,25 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireFamiliar } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostFamiliarRenderFilter extends CustomCallback<ModCallbackCustom.POST_FAMILIAR_RENDER_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 25
12
+ [ModCallback.POST_FAMILIAR_RENDER, this.postFamiliarRender],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireFamiliar;
17
+
18
+ // ModCallback.POST_FAMILIAR_UPDATE (6)
19
+ private postFamiliarRender = (
20
+ familiar: EntityFamiliar,
21
+ renderOffset: Vector,
22
+ ) => {
23
+ this.fire(familiar, renderOffset);
24
+ };
25
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireFamiliar } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostFamiliarUpdateFilter extends CustomCallback<ModCallbackCustom.POST_FAMILIAR_UPDATE_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 6
12
+ [ModCallback.POST_FAMILIAR_UPDATE, this.postFamiliarUpdate],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireFamiliar;
17
+
18
+ // ModCallback.POST_FAMILIAR_UPDATE (6)
19
+ private postFamiliarUpdate = (familiar: EntityFamiliar) => {
20
+ this.fire(familiar);
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireLaser } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostLaserInitFilter extends CustomCallback<ModCallbackCustom.POST_LASER_INIT_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 47
12
+ [ModCallback.POST_LASER_INIT, this.postLaserInit],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireLaser;
17
+
18
+ // ModCallback.POST_LASER_INIT (47)
19
+ private postLaserInit = (laser: EntityLaser) => {
20
+ this.fire(laser);
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireLaser } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostLaserRenderFilter extends CustomCallback<ModCallbackCustom.POST_LASER_RENDER_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 49
12
+ [ModCallback.POST_LASER_RENDER, this.postLaserRender],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireLaser;
17
+
18
+ // ModCallback.POST_LASER_RENDER (49)
19
+ private postLaserRender = (laser: EntityLaser, renderOffset: Vector) => {
20
+ this.fire(laser, renderOffset);
21
+ };
22
+ }
@@ -0,0 +1,22 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireLaser } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PostLaserUpdateFilter extends CustomCallback<ModCallbackCustom.POST_LASER_UPDATE_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 48
12
+ [ModCallback.POST_LASER_UPDATE, this.postLaserUpdate],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireLaser;
17
+
18
+ // ModCallback.POST_LASER_UPDATE (48)
19
+ private postLaserUpdate = (laser: EntityLaser) => {
20
+ this.fire(laser);
21
+ };
22
+ }
@@ -0,0 +1,24 @@
1
+ import { ModCallback } from "isaac-typescript-definitions";
2
+ import { ModCallbackCustom } from "../../enums/ModCallbackCustom";
3
+ import { shouldFireFamiliar } from "../../shouldFire";
4
+ import { CustomCallback } from "../private/CustomCallback";
5
+
6
+ export class PreFamiliarCollisionFilter extends CustomCallback<ModCallbackCustom.PRE_FAMILIAR_COLLISION_FILTER> {
7
+ constructor() {
8
+ super();
9
+
10
+ this.callbacksUsed = [
11
+ // 26
12
+ [ModCallback.PRE_FAMILIAR_COLLISION, this.preFamiliarCollision],
13
+ ];
14
+ }
15
+
16
+ protected override shouldFire = shouldFireFamiliar;
17
+
18
+ // ModCallback.PRE_FAMILIAR_COLLISION (26)
19
+ private preFamiliarCollision = (
20
+ familiar: EntityFamiliar,
21
+ collider: Entity,
22
+ low: boolean,
23
+ ): boolean | undefined => this.fire(familiar, collider, low);
24
+ }
@@ -294,6 +294,22 @@ export enum ModCallbackCustom {
294
294
  */
295
295
  POST_DOOR_UPDATE,
296
296
 
297
+ /**
298
+ * The exact same thing as the vanilla `POST_EFFECT_INIT` callback, except this callback allows
299
+ * you to specify extra arguments for additional filtration.
300
+ *
301
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
302
+ * - You can provide an optional third argument that will make the callback only fire if it
303
+ * matches the `EffectVariant` provided.
304
+ * - You can provide an optional fourth argument that will make the callback only fire if it
305
+ * matches the sub-type provided.
306
+ *
307
+ * ```ts
308
+ * function postEffectInitFilter(effect: EntityEffect): void {}
309
+ * ```
310
+ */
311
+ POST_EFFECT_INIT_FILTER,
312
+
297
313
  /**
298
314
  * Fires on the first `POST_EFFECT_UPDATE` frame for each effect.
299
315
  *
@@ -312,6 +328,22 @@ export enum ModCallbackCustom {
312
328
  */
313
329
  POST_EFFECT_INIT_LATE,
314
330
 
331
+ /**
332
+ * The exact same thing as the vanilla `POST_EFFECT_RENDER` callback, except this callback allows
333
+ * you to specify extra arguments for additional filtration.
334
+ *
335
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
336
+ * - You can provide an optional third argument that will make the callback only fire if it
337
+ * matches the `EffectVariant` provided.
338
+ * - You can provide an optional fourth argument that will make the callback only fire if it
339
+ * matches the sub-type provided.
340
+ *
341
+ * ```ts
342
+ * function postEffectRenderFilter(effect: EntityEffect, renderOffset: Vector): void {}
343
+ * ```
344
+ */
345
+ POST_EFFECT_RENDER_FILTER,
346
+
315
347
  /**
316
348
  * Fires from the `POST_EFFECT_UPDATE` callback when an effect's state has changed from what it
317
349
  * was on the previous frame. (In this context, "state" refers to the `EntityEffect.State` field.)
@@ -332,6 +364,22 @@ export enum ModCallbackCustom {
332
364
  */
333
365
  POST_EFFECT_STATE_CHANGED,
334
366
 
367
+ /**
368
+ * The exact same thing as the vanilla `POST_EFFECT_UPDATE` callback, except this callback allows
369
+ * you to specify extra arguments for additional filtration.
370
+ *
371
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
372
+ * - You can provide an optional third argument that will make the callback only fire if it
373
+ * matches the `EffectVariant` provided.
374
+ * - You can provide an optional fourth argument that will make the callback only fire if it
375
+ * matches the sub-type provided.
376
+ *
377
+ * ```ts
378
+ * function postEffectUpdateFilter(effect: EntityEffect): void {}
379
+ * ```
380
+ */
381
+ POST_EFFECT_UPDATE_FILTER,
382
+
335
383
  /**
336
384
  * The exact same thing as the vanilla `POST_ENTITY_KILL` callback, except this callback allows
337
385
  * you to specify extra arguments for additional filtration.
@@ -360,6 +408,22 @@ export enum ModCallbackCustom {
360
408
  */
361
409
  POST_ESAU_JR,
362
410
 
411
+ /**
412
+ * The exact same thing as the vanilla `POST_FAMILIAR_INIT` callback, except this callback allows
413
+ * you to specify extra arguments for additional filtration.
414
+ *
415
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
416
+ * - You can provide an optional third argument that will make the callback only fire if it
417
+ * matches the `FamiliarVariant` provided.
418
+ * - You can provide an optional fourth argument that will make the callback only fire if it
419
+ * matches the sub-type provided.
420
+ *
421
+ * ```ts
422
+ * function postFamiliarInitFilter(familiar: EntityFamiliar): void {}
423
+ * ```
424
+ */
425
+ POST_FAMILIAR_INIT_FILTER,
426
+
363
427
  /**
364
428
  * Fires on the first `FAMILIAR_UPDATE` frame for each familiar.
365
429
  *
@@ -378,6 +442,22 @@ export enum ModCallbackCustom {
378
442
  */
379
443
  POST_FAMILIAR_INIT_LATE,
380
444
 
445
+ /**
446
+ * The exact same thing as the vanilla `POST_FAMILIAR_RENDER` callback, except this callback
447
+ * allows you to specify extra arguments for additional filtration.
448
+ *
449
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
450
+ * - You can provide an optional third argument that will make the callback only fire if it
451
+ * matches the `FamiliarVariant` provided.
452
+ * - You can provide an optional fourth argument that will make the callback only fire if it
453
+ * matches the sub-type provided.
454
+ *
455
+ * ```ts
456
+ * function postFamiliarRenderFilter(familiar: EntityFamiliar, renderOffset: Vector): void {}
457
+ * ```
458
+ */
459
+ POST_FAMILIAR_RENDER_FILTER,
460
+
381
461
  /**
382
462
  * Fires from the `POST_FAMILIAR_UPDATE` callback when a familiar's state has changed from what it
383
463
  * was on the previous frame. (In this context, "state" refers to the `EntityFamiliar.State`
@@ -399,6 +479,22 @@ export enum ModCallbackCustom {
399
479
  */
400
480
  POST_FAMILIAR_STATE_CHANGED,
401
481
 
482
+ /**
483
+ * The exact same thing as the vanilla `POST_FAMILIAR_UPDATE` callback, except this callback
484
+ * allows you to specify extra arguments for additional filtration.
485
+ *
486
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
487
+ * - You can provide an optional third argument that will make the callback only fire if it
488
+ * matches the `FamiliarVariant` provided.
489
+ * - You can provide an optional fourth argument that will make the callback only fire if it
490
+ * matches the sub-type provided.
491
+ *
492
+ * ```ts
493
+ * function postFamiliarUpdateFilter(familiar: EntityFamiliar): void {}
494
+ * ```
495
+ */
496
+ POST_FAMILIAR_UPDATE_FILTER,
497
+
402
498
  /**
403
499
  * Fires one `POST_UPDATE` frame after the player has first used the Esau Jr. item. (The player is
404
500
  * not updated to the new character until a game frame has passed.)
@@ -886,6 +982,22 @@ export enum ModCallbackCustom {
886
982
  */
887
983
  POST_KNIFE_INIT_LATE,
888
984
 
985
+ /**
986
+ * The exact same thing as the vanilla `POST_LASER_INIT` callback, except this callback allows you
987
+ * to specify extra arguments for additional filtration.
988
+ *
989
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
990
+ * - You can provide an optional third argument that will make the callback only fire if it
991
+ * matches the `LaserVariant` provided.
992
+ * - You can provide an optional fourth argument that will make the callback only fire if it
993
+ * matches the sub-type provided.
994
+ *
995
+ * ```ts
996
+ * function postLaserInitFilter(laser: EntityLaser): void {}
997
+ * ```
998
+ */
999
+ POST_LASER_INIT_FILTER,
1000
+
889
1001
  /**
890
1002
  * Fires on the first `POST_LASER_UPDATE` frame for each laser.
891
1003
  *
@@ -904,6 +1016,38 @@ export enum ModCallbackCustom {
904
1016
  */
905
1017
  POST_LASER_INIT_LATE,
906
1018
 
1019
+ /**
1020
+ * The exact same thing as the vanilla `POST_LASER_RENDER` callback, except this callback allows
1021
+ * you to specify extra arguments for additional filtration.
1022
+ *
1023
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
1024
+ * - You can provide an optional third argument that will make the callback only fire if it
1025
+ * matches the `LaserVariant` provided.
1026
+ * - You can provide an optional fourth argument that will make the callback only fire if it
1027
+ * matches the sub-type provided.
1028
+ *
1029
+ * ```ts
1030
+ * function postLaserRenderFilter(laser: EntityLaser, renderOffset: Vector): void {}
1031
+ * ```
1032
+ */
1033
+ POST_LASER_RENDER_FILTER,
1034
+
1035
+ /**
1036
+ * The exact same thing as the vanilla `POST_LASER_UPDATE` callback, except this callback allows
1037
+ * you to specify extra arguments for additional filtration.
1038
+ *
1039
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
1040
+ * - You can provide an optional third argument that will make the callback only fire if it
1041
+ * matches the `LaserVariant` provided.
1042
+ * - You can provide an optional fourth argument that will make the callback only fire if it
1043
+ * matches the sub-type provided.
1044
+ *
1045
+ * ```ts
1046
+ * function postLaserUpdateFilter(laser: EntityLaser): void {}
1047
+ * ```
1048
+ */
1049
+ POST_LASER_UPDATE_FILTER,
1050
+
907
1051
  /**
908
1052
  * The same as the vanilla callback of the same name, but fires in the correct order with respect
909
1053
  * to the `POST_GAME_STARTED` and the `POST_NEW_ROOM` callbacks:
@@ -2010,6 +2154,26 @@ export enum ModCallbackCustom {
2010
2154
  */
2011
2155
  PRE_ENTITY_SPAWN_FILTER,
2012
2156
 
2157
+ /**
2158
+ * The exact same thing as the vanilla `PRE_FAMILIAR_COLLISION` callback, except this callback
2159
+ * allows you to specify extra arguments for additional filtration.
2160
+ *
2161
+ * When registering the callback with the `ModUpgraded.AddCallbackCustom` method:
2162
+ * - You can provide an optional third argument that will make the callback only fire if it
2163
+ * matches the `FamiliarVariant` provided.
2164
+ * - You can provide an optional fourth argument that will make the callback only fire if it
2165
+ * matches the sub-type provided.
2166
+ *
2167
+ * ```ts
2168
+ * function preFamiliarCollisionFilter(
2169
+ * familiar: EntityFamiliar,
2170
+ * collider: Entity,
2171
+ * low: boolean,
2172
+ * ): void {}
2173
+ * ```
2174
+ */
2175
+ PRE_FAMILIAR_COLLISION_FILTER,
2176
+
2013
2177
  /**
2014
2178
  * Fires from the `PRE_PICKUP_COLLISION` callback when a player touches a collectible pedestal and
2015
2179
  * meets all of the conditions to pick it up.
@@ -158,12 +158,24 @@ export interface AddCallbackParametersCustom {
158
158
  doorVariant?: DoorVariant,
159
159
  ];
160
160
 
161
+ [ModCallbackCustom.POST_EFFECT_INIT_FILTER]: [
162
+ callback: (effect: EntityEffect) => void,
163
+ effectVariant?: EffectVariant,
164
+ subType?: int,
165
+ ];
166
+
161
167
  [ModCallbackCustom.POST_EFFECT_INIT_LATE]: [
162
168
  callback: (effect: EntityEffect) => void,
163
169
  effectVariant?: EffectVariant,
164
170
  subType?: int,
165
171
  ];
166
172
 
173
+ [ModCallbackCustom.POST_EFFECT_RENDER_FILTER]: [
174
+ callback: (effect: EntityEffect, renderOffset: Vector) => void,
175
+ effectVariant?: EffectVariant,
176
+ subType?: int,
177
+ ];
178
+
167
179
  [ModCallbackCustom.POST_EFFECT_STATE_CHANGED]: [
168
180
  callback: (
169
181
  effect: EntityEffect,
@@ -174,6 +186,12 @@ export interface AddCallbackParametersCustom {
174
186
  subType?: int,
175
187
  ];
176
188
 
189
+ [ModCallbackCustom.POST_EFFECT_UPDATE_FILTER]: [
190
+ callback: (effect: EntityEffect) => void,
191
+ effectVariant?: EffectVariant,
192
+ subType?: int,
193
+ ];
194
+
177
195
  [ModCallbackCustom.POST_ENTITY_KILL_FILTER]: [
178
196
  callback: (entity: Entity) => void,
179
197
  entityType?: EntityType,
@@ -187,12 +205,24 @@ export interface AddCallbackParametersCustom {
187
205
  // by character.
188
206
  [ModCallbackCustom.POST_ESAU_JR]: [callback: (player: EntityPlayer) => void];
189
207
 
208
+ [ModCallbackCustom.POST_FAMILIAR_INIT_FILTER]: [
209
+ callback: (familiar: EntityFamiliar) => void,
210
+ familiarVariant?: FamiliarVariant,
211
+ subType?: int,
212
+ ];
213
+
190
214
  [ModCallbackCustom.POST_FAMILIAR_INIT_LATE]: [
191
215
  callback: (familiar: EntityFamiliar) => void,
192
216
  familiarVariant?: FamiliarVariant,
193
217
  subType?: int,
194
218
  ];
195
219
 
220
+ [ModCallbackCustom.POST_FAMILIAR_RENDER_FILTER]: [
221
+ callback: (familiar: EntityFamiliar, renderOffset: Vector) => void,
222
+ familiarVariant?: FamiliarVariant,
223
+ subType?: int,
224
+ ];
225
+
196
226
  [ModCallbackCustom.POST_FAMILIAR_STATE_CHANGED]: [
197
227
  callback: (
198
228
  familiar: EntityFamiliar,
@@ -203,6 +233,12 @@ export interface AddCallbackParametersCustom {
203
233
  subType?: int,
204
234
  ];
205
235
 
236
+ [ModCallbackCustom.POST_FAMILIAR_UPDATE_FILTER]: [
237
+ callback: (familiar: EntityFamiliar) => void,
238
+ familiarVariant?: FamiliarVariant,
239
+ subType?: int,
240
+ ];
241
+
206
242
  // - Co-op babies cannot turn into Esau Jr, so it does not make sense to filter by
207
243
  // `PlayerVariant`.
208
244
  // - The character of Esau Jr. is equal to `PlayerType.ISAAC`, so it does not make sense to filter
@@ -393,12 +429,30 @@ export interface AddCallbackParametersCustom {
393
429
  subType?: int,
394
430
  ];
395
431
 
432
+ [ModCallbackCustom.POST_LASER_INIT_FILTER]: [
433
+ callback: (laser: EntityLaser) => void,
434
+ laserVariant?: LaserVariant,
435
+ subType?: int,
436
+ ];
437
+
396
438
  [ModCallbackCustom.POST_LASER_INIT_LATE]: [
397
439
  callback: (laser: EntityLaser) => void,
398
440
  laserVariant?: LaserVariant,
399
441
  subType?: int,
400
442
  ];
401
443
 
444
+ [ModCallbackCustom.POST_LASER_RENDER_FILTER]: [
445
+ callback: (laser: EntityLaser, renderOffset: Vector) => void,
446
+ laserVariant?: LaserVariant,
447
+ subType?: int,
448
+ ];
449
+
450
+ [ModCallbackCustom.POST_LASER_UPDATE_FILTER]: [
451
+ callback: (laser: EntityLaser) => void,
452
+ laserVariant?: LaserVariant,
453
+ subType?: int,
454
+ ];
455
+
402
456
  [ModCallbackCustom.POST_NEW_LEVEL_REORDERED]: [
403
457
  callback: (stage: LevelStage, stageType: StageType) => void,
404
458
  stage?: LevelStage,
@@ -790,6 +844,16 @@ export interface AddCallbackParametersCustom {
790
844
  subtype?: int,
791
845
  ];
792
846
 
847
+ [ModCallbackCustom.PRE_FAMILIAR_COLLISION_FILTER]: [
848
+ callback: (
849
+ familiar: EntityFamiliar,
850
+ collider: Entity,
851
+ low: boolean,
852
+ ) => boolean | undefined,
853
+ familiarVariant?: FamiliarVariant,
854
+ subtype?: int,
855
+ ];
856
+
793
857
  [ModCallbackCustom.PRE_GET_PEDESTAL]: [
794
858
  callback: (
795
859
  player: EntityPlayer,