isaacscript-common 9.3.0 → 9.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/dist/callbacks/subscriptions/postGridEntityCollision.d.ts +4 -2
- package/dist/callbacks/subscriptions/postGridEntityCollision.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postGridEntityCollision.lua +8 -0
- package/dist/callbacks/subscriptions/postGridEntityCustomCollision.d.ts +4 -2
- package/dist/callbacks/subscriptions/postGridEntityCustomCollision.d.ts.map +1 -1
- package/dist/callbacks/subscriptions/postGridEntityCustomCollision.lua +8 -0
- package/dist/enums/ModCallbackCustom.d.ts +52 -26
- package/dist/enums/ModCallbackCustom.d.ts.map +1 -1
- package/dist/functions/entities.d.ts +4 -0
- package/dist/functions/entities.d.ts.map +1 -1
- package/dist/functions/entities.lua +4 -0
- package/dist/index.d.ts +62 -28
- package/package.json +1 -1
- package/src/callbacks/subscriptions/postGridEntityCollision.ts +21 -1
- package/src/callbacks/subscriptions/postGridEntityCustomCollision.ts +25 -2
- package/src/enums/ModCallbackCustom.ts +52 -26
- package/src/functions/entities.ts +4 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { GridEntityType } from "isaac-typescript-definitions";
|
|
1
|
+
import { EntityType, GridEntityType } from "isaac-typescript-definitions";
|
|
2
2
|
export declare type PostGridEntityCollisionRegisterParameters = [
|
|
3
3
|
callback: (gridEntity: GridEntity, entity: Entity) => void,
|
|
4
4
|
gridEntityType?: GridEntityType,
|
|
5
|
-
gridEntityVariant?: int
|
|
5
|
+
gridEntityVariant?: int,
|
|
6
|
+
entityType?: EntityType,
|
|
7
|
+
entityVariant?: int
|
|
6
8
|
];
|
|
7
9
|
export declare function postGridEntityCollisionHasSubscriptions(): boolean;
|
|
8
10
|
export declare function postGridEntityCollisionRegister(...args: PostGridEntityCollisionRegisterParameters): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postGridEntityCollision.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postGridEntityCollision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"postGridEntityCollision.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postGridEntityCollision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE1E,oBAAY,yCAAyC,GAAG;IACtD,QAAQ,EAAE,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI;IAC1D,cAAc,CAAC,EAAE,cAAc;IAC/B,iBAAiB,CAAC,EAAE,GAAG;IACvB,UAAU,CAAC,EAAE,UAAU;IACvB,aAAa,CAAC,EAAE,GAAG;CACpB,CAAC;AAIF,wBAAgB,uCAAuC,IAAI,OAAO,CAEjE;AAED,wBAAgB,+BAA+B,CAC7C,GAAG,IAAI,EAAE,yCAAyC,GACjD,IAAI,CAEN;AAED,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,MAAM,GACb,IAAI,CA6CN"}
|
|
@@ -14,6 +14,8 @@ function ____exports.postGridEntityCollisionFire(self, gridEntity, entity)
|
|
|
14
14
|
local callback = ____value[1]
|
|
15
15
|
local callbackGridEntityType = ____value[2]
|
|
16
16
|
local callbackGridEntityVariant = ____value[3]
|
|
17
|
+
local callbackEntityType = ____value[4]
|
|
18
|
+
local callbackEntityVariant = ____value[5]
|
|
17
19
|
do
|
|
18
20
|
if callbackGridEntityType ~= nil and callbackGridEntityType ~= gridEntityType then
|
|
19
21
|
goto __continue5
|
|
@@ -21,6 +23,12 @@ function ____exports.postGridEntityCollisionFire(self, gridEntity, entity)
|
|
|
21
23
|
if callbackGridEntityVariant ~= nil and callbackGridEntityVariant ~= gridEntityVariant then
|
|
22
24
|
goto __continue5
|
|
23
25
|
end
|
|
26
|
+
if callbackEntityType ~= nil and callbackEntityType ~= entity.Type then
|
|
27
|
+
goto __continue5
|
|
28
|
+
end
|
|
29
|
+
if callbackEntityVariant ~= nil and callbackEntityVariant ~= entity.Variant then
|
|
30
|
+
goto __continue5
|
|
31
|
+
end
|
|
24
32
|
callback(nil, gridEntity, entity)
|
|
25
33
|
end
|
|
26
34
|
::__continue5::
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { GridEntityType } from "isaac-typescript-definitions";
|
|
1
|
+
import { EntityType, GridEntityType } from "isaac-typescript-definitions";
|
|
2
2
|
export declare type PostGridEntityCustomCollisionRegisterParameters = [
|
|
3
3
|
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
|
|
4
|
-
gridEntityTypeCustom?: GridEntityType
|
|
4
|
+
gridEntityTypeCustom?: GridEntityType,
|
|
5
|
+
entityType?: EntityType,
|
|
6
|
+
entityVariant?: int
|
|
5
7
|
];
|
|
6
8
|
export declare function postGridEntityCustomCollisionHasSubscriptions(): boolean;
|
|
7
9
|
export declare function postGridEntityCustomCollisionRegister(...args: PostGridEntityCustomCollisionRegisterParameters): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postGridEntityCustomCollision.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postGridEntityCustomCollision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"postGridEntityCustomCollision.d.ts","sourceRoot":"","sources":["../../../src/callbacks/subscriptions/postGridEntityCustomCollision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE1E,oBAAY,+CAA+C,GAAG;IAC5D,QAAQ,EAAE,CACR,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,cAAc,EACpC,MAAM,EAAE,MAAM,KACX,IAAI;IACT,oBAAoB,CAAC,EAAE,cAAc;IACrC,UAAU,CAAC,EAAE,UAAU;IACvB,aAAa,CAAC,EAAE,GAAG;CACpB,CAAC;AAIF,wBAAgB,6CAA6C,IAAI,OAAO,CAEvE;AAED,wBAAgB,qCAAqC,CACnD,GAAG,IAAI,EAAE,+CAA+C,GACvD,IAAI,CAEN;AAED,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,UAAU,EACtB,oBAAoB,EAAE,cAAc,EACpC,MAAM,EAAE,MAAM,GACb,IAAI,CAiCN"}
|
|
@@ -11,10 +11,18 @@ function ____exports.postGridEntityCustomCollisionFire(self, gridEntity, gridEnt
|
|
|
11
11
|
for ____, ____value in ipairs(subscriptions) do
|
|
12
12
|
local callback = ____value[1]
|
|
13
13
|
local callbackGridEntityTypeCustom = ____value[2]
|
|
14
|
+
local callbackEntityType = ____value[3]
|
|
15
|
+
local callbackEntityVariant = ____value[4]
|
|
14
16
|
do
|
|
15
17
|
if callbackGridEntityTypeCustom ~= nil and callbackGridEntityTypeCustom ~= gridEntityTypeCustom then
|
|
16
18
|
goto __continue5
|
|
17
19
|
end
|
|
20
|
+
if callbackEntityType ~= nil and callbackEntityType ~= entity.Type then
|
|
21
|
+
goto __continue5
|
|
22
|
+
end
|
|
23
|
+
if callbackEntityVariant ~= nil and callbackEntityVariant ~= entity.Variant then
|
|
24
|
+
goto __continue5
|
|
25
|
+
end
|
|
18
26
|
callback(nil, gridEntity, gridEntityTypeCustom, entity)
|
|
19
27
|
end
|
|
20
28
|
::__continue5::
|
|
@@ -323,8 +323,10 @@ export declare enum ModCallbackCustom {
|
|
|
323
323
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
324
324
|
* `POST_GRID_ENTITY_CUSTOM_BROKEN` callback instead.
|
|
325
325
|
*
|
|
326
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
327
|
-
*
|
|
326
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
327
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
328
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
329
|
+
* only fire if it matches the variant provided.
|
|
328
330
|
*
|
|
329
331
|
* ```ts
|
|
330
332
|
* function postGridEntityBroken(gridEntity: GridEntity): void {}
|
|
@@ -339,8 +341,14 @@ export declare enum ModCallbackCustom {
|
|
|
339
341
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
340
342
|
* `POST_GRID_ENTITY_CUSTOM_COLLISION` callback instead.
|
|
341
343
|
*
|
|
342
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
343
|
-
*
|
|
344
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
345
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
346
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
347
|
+
* only fire if it matches the variant provided (for the grid entity).
|
|
348
|
+
* - When registering the callback, takes an optional fourth argument that will make the callback
|
|
349
|
+
* only fire if the colliding entity matches the `EntityType` provided.
|
|
350
|
+
* - When registering the callback, takes an optional fifth argument that will make the callback
|
|
351
|
+
* only fire if the colliding entity matches the variant provided.
|
|
344
352
|
*
|
|
345
353
|
* ```ts
|
|
346
354
|
* function postGridEntityCollision(
|
|
@@ -355,7 +363,8 @@ export declare enum ModCallbackCustom {
|
|
|
355
363
|
* with the `spawnCustomGridEntity` helper function.
|
|
356
364
|
*
|
|
357
365
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
358
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
366
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
367
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
359
368
|
*
|
|
360
369
|
* ```ts
|
|
361
370
|
* function postGridEntityCustomBroken(
|
|
@@ -369,8 +378,13 @@ export declare enum ModCallbackCustom {
|
|
|
369
378
|
* The same as the `POST_GRID_ENTITY_COLLISION` callback, but only fires for grid entities created
|
|
370
379
|
* with the `spawnCustomGridEntity` helper function.
|
|
371
380
|
*
|
|
372
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
373
|
-
*
|
|
381
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
382
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
383
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
384
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
385
|
+
* only fire if the the colliding entity matches the `EntityType` provided.
|
|
386
|
+
* - When registering the callback, takes an optional fourth argument that will make the callback
|
|
387
|
+
* only fire if the the colliding entity matches the variant provided.
|
|
374
388
|
*
|
|
375
389
|
* ```ts
|
|
376
390
|
* function postGridEntityCustomCollision(
|
|
@@ -386,7 +400,8 @@ export declare enum ModCallbackCustom {
|
|
|
386
400
|
* the `spawnCustomGridEntity` helper function.
|
|
387
401
|
*
|
|
388
402
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
389
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
403
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
404
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
390
405
|
*
|
|
391
406
|
* ```ts
|
|
392
407
|
* function postGridEntityCustomInit(
|
|
@@ -401,7 +416,8 @@ export declare enum ModCallbackCustom {
|
|
|
401
416
|
* with the `spawnCustomGridEntity` helper function.
|
|
402
417
|
*
|
|
403
418
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
404
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
419
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
420
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
405
421
|
*
|
|
406
422
|
* ```ts
|
|
407
423
|
* function postGridEntityCustomRemove(
|
|
@@ -416,7 +432,8 @@ export declare enum ModCallbackCustom {
|
|
|
416
432
|
* with the `spawnCustomGridEntity` helper function.
|
|
417
433
|
*
|
|
418
434
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
419
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
435
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
436
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
420
437
|
*
|
|
421
438
|
* ```ts
|
|
422
439
|
* function postGridEntityCustomRender(
|
|
@@ -431,7 +448,8 @@ export declare enum ModCallbackCustom {
|
|
|
431
448
|
* created with the `spawnCustomGridEntity` helper function.
|
|
432
449
|
*
|
|
433
450
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
434
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
451
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
452
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
435
453
|
*
|
|
436
454
|
* ```ts
|
|
437
455
|
* function postGridEntityCustomStateChanged(
|
|
@@ -448,7 +466,8 @@ export declare enum ModCallbackCustom {
|
|
|
448
466
|
* with the `spawnCustomGridEntity` helper function.
|
|
449
467
|
*
|
|
450
468
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
451
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
469
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
470
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
452
471
|
*
|
|
453
472
|
* ```ts
|
|
454
473
|
* function postGridEntityCustomUpdate(
|
|
@@ -469,8 +488,10 @@ export declare enum ModCallbackCustom {
|
|
|
469
488
|
* For grid entities created with `spawnCustomGridEntity`, use the `POST_GRID_ENTITY_CUSTOM_INIT`
|
|
470
489
|
* callback instead.
|
|
471
490
|
*
|
|
472
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
473
|
-
*
|
|
491
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
492
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
493
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
494
|
+
* only fire if it matches the variant provided.
|
|
474
495
|
*
|
|
475
496
|
* ```ts
|
|
476
497
|
* function postGridEntityInit(gridEntity: GridEntity): void {}
|
|
@@ -488,8 +509,10 @@ export declare enum ModCallbackCustom {
|
|
|
488
509
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
489
510
|
* `POST_GRID_ENTITY_CUSTOM_REMOVE` callback instead.
|
|
490
511
|
*
|
|
491
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
492
|
-
*
|
|
512
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
513
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
514
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
515
|
+
* only fire if it matches the variant provided.
|
|
493
516
|
*
|
|
494
517
|
* ```ts
|
|
495
518
|
* function postGridEntityRemove(
|
|
@@ -502,14 +525,14 @@ export declare enum ModCallbackCustom {
|
|
|
502
525
|
/**
|
|
503
526
|
* Fires from the `POST_RENDER` callback on every frame that a grid entity exists.
|
|
504
527
|
*
|
|
528
|
+
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
529
|
+
* `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
|
|
530
|
+
*
|
|
505
531
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
506
532
|
* only fire if it matches the `GridEntityType` provided.
|
|
507
533
|
* - When registering the callback, takes an optional third argument that will make the callback
|
|
508
534
|
* only fire if it matches the variant provided.
|
|
509
535
|
*
|
|
510
|
-
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
511
|
-
* `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
|
|
512
|
-
*
|
|
513
536
|
* ```ts
|
|
514
537
|
* function postGridEntityRender(gridEntity: GridEntity): void {}
|
|
515
538
|
* ```
|
|
@@ -519,12 +542,14 @@ export declare enum ModCallbackCustom {
|
|
|
519
542
|
* Fires from the `POST_UPDATE` callback when a grid entity changes its state. (In this context,
|
|
520
543
|
* "state" refers to the `GridEntity.State` field.)
|
|
521
544
|
*
|
|
522
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
523
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
524
|
-
*
|
|
525
545
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
526
546
|
* `POST_GRID_ENTITY_CUSTOM_STATE_CHANGED` callback instead.
|
|
527
547
|
*
|
|
548
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
549
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
550
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
551
|
+
* only fire if it matches the variant provided.
|
|
552
|
+
*
|
|
528
553
|
* ```ts
|
|
529
554
|
* function postGridEntityStateChanged(
|
|
530
555
|
* gridEntity: GridEntity,
|
|
@@ -537,14 +562,14 @@ export declare enum ModCallbackCustom {
|
|
|
537
562
|
/**
|
|
538
563
|
* Fires from the `POST_UPDATE` callback on every frame that a grid entity exists.
|
|
539
564
|
*
|
|
565
|
+
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
566
|
+
* `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
|
|
567
|
+
*
|
|
540
568
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
541
569
|
* only fire if it matches the `GridEntityType` provided.
|
|
542
570
|
* - When registering the callback, takes an optional third argument that will make the callback
|
|
543
571
|
* only fire if it matches the variant provided.
|
|
544
572
|
*
|
|
545
|
-
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
546
|
-
* `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
|
|
547
|
-
*
|
|
548
573
|
* ```ts
|
|
549
574
|
* function postGridEntityUpdate(gridEntity: GridEntity): void {}
|
|
550
575
|
* ```
|
|
@@ -1166,7 +1191,8 @@ export declare enum ModCallbackCustom {
|
|
|
1166
1191
|
* certain conditions, like if the slot entity is playing the "Idle" animation, and so on.
|
|
1167
1192
|
*
|
|
1168
1193
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
1169
|
-
* only fire if it matches the `SlotVariant` provided.
|
|
1194
|
+
* only fire if it matches the `SlotVariant` provided. (There is no need for any additional
|
|
1195
|
+
* arguments, since only players will cause this callback to fire.)
|
|
1170
1196
|
*
|
|
1171
1197
|
* ```ts
|
|
1172
1198
|
* function postSlotCollision(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModCallbackCustom.d.ts","sourceRoot":"","sources":["../../src/enums/ModCallbackCustom.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;;;;;;OAUG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;OAUG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;OASG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;;OAYG;IACH,mBAAmB,IAAA;IAEnB;;;;;;OAMG;IACH,eAAe,IAAA;IAEf;;;;;;;;;;;;;OAaG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,IAAA;IAE3B;;;;;;;;OAQG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,wBAAwB,KAAA;IAExB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;;;;OAYG;IACH,qBAAqB,KAAA;IAErB;;;;;;;;;;;;;;OAcG;IACH,yBAAyB,KAAA;IAEzB;;;;;;;OAOG;IACH,YAAY,KAAA;IAEZ;;;;;;;;;;;;OAYG;IACH,uBAAuB,KAAA;IAEvB;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,KAAA;IAE3B;;;;;;;;;;OAUG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;OAWG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;OAWG;IACH,SAAS,KAAA;IAET;;;;;;;;;OASG;IACH,2BAA2B,KAAA;IAE3B;;;;;;;;;OASG;IACH,gCAAgC,KAAA;IAEhC;;;;;;OAMG;IACH,oBAAoB,KAAA;IAEpB
|
|
1
|
+
{"version":3,"file":"ModCallbackCustom.d.ts","sourceRoot":"","sources":["../../src/enums/ModCallbackCustom.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IAC3B;;;;;;;;;;OAUG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;OAUG;IACH,mBAAmB,IAAA;IAEnB;;;;;;;;;OASG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;;OAYG;IACH,mBAAmB,IAAA;IAEnB;;;;;;OAMG;IACH,eAAe,IAAA;IAEf;;;;;;;;;;;;;OAaG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,IAAA;IAE3B;;;;;;;;OAQG;IACH,oBAAoB,IAAA;IAEpB;;;;;;;;;;;;;;;OAeG;IACH,sBAAsB,IAAA;IAEtB;;;;;;;;;;;;;;;OAeG;IACH,kBAAkB,IAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,wBAAwB,KAAA;IAExB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;;;;OAYG;IACH,qBAAqB,KAAA;IAErB;;;;;;;;;;;;;;OAcG;IACH,yBAAyB,KAAA;IAEzB;;;;;;;OAOG;IACH,YAAY,KAAA;IAEZ;;;;;;;;;;;;OAYG;IACH,uBAAuB,KAAA;IAEvB;;;;;;;;;;;;;;;OAeG;IACH,2BAA2B,KAAA;IAE3B;;;;;;;;;;OAUG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;OAWG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;OAWG;IACH,SAAS,KAAA;IAET;;;;;;;;;OASG;IACH,2BAA2B,KAAA;IAE3B;;;;;;;;;OASG;IACH,gCAAgC,KAAA;IAEhC;;;;;;OAMG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AAA;IAEvB;;;;;;;;;;;;OAYG;IACH,cAAc,KAAA;IAEd;;;;;;;;;OASG;IACH,2BAA2B,KAAA;IAE3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;;;OAcG;IACH,cAAc,KAAA;IAEd;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;OASG;IACH,gBAAgB,KAAA;IAEhB;;;;;;;;;OASG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;OASG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,wBAAwB,KAAA;IAExB;;;;;;;;;OASG;IACH,eAAe,KAAA;IAEf;;;;;;;;;OASG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;;;;;;OAgBG;IACH,mBAAmB,KAAA;IAEnB;;;;;;;;;;;;OAYG;IACH,kBAAkB,KAAA;IAElB;;;;;;;;;;;;;OAaG;IACH,iBAAiB,KAAA;IAEjB;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAiB,KAAA;IAEjB;;;;;;;;;;;;;;;;;OAiBG;IACH,eAAe,KAAA;IAEf;;;;;;;;;;;;OAYG;IACH,aAAa,KAAA;CACd"}
|
|
@@ -86,6 +86,10 @@ export declare function getFilteredNewEntities<T extends AnyEntity>(oldEntities:
|
|
|
86
86
|
/**
|
|
87
87
|
* Helper function to measure an entity's velocity to see if it is moving.
|
|
88
88
|
*
|
|
89
|
+
* Use this helper function over checking if the velocity length is equal to 0 because entities can
|
|
90
|
+
* look like they are completely immobile but yet still have a non zero velocity. Thus, using a
|
|
91
|
+
* threshold is needed.
|
|
92
|
+
*
|
|
89
93
|
* @param entity The entity whose velocity to measure.
|
|
90
94
|
* @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
|
|
91
95
|
*/
|
|
@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ACvC,SAAS,GAAE,IAAI,GAAG,GAAG,GAAG,SAAqB,GAC5C,MAAM,CAsCR;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,GAAG,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,IAAI,GAAG,GAAG,EACrB,QAAQ,GAAE,MAAmB,EAC7B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,MAAM,CAUR"}
|
|
@@ -235,6 +235,10 @@ function ____exports.getFilteredNewEntities(self, oldEntities, newEntities)
|
|
|
235
235
|
end
|
|
236
236
|
--- Helper function to measure an entity's velocity to see if it is moving.
|
|
237
237
|
--
|
|
238
|
+
-- Use this helper function over checking if the velocity length is equal to 0 because entities can
|
|
239
|
+
-- look like they are completely immobile but yet still have a non zero velocity. Thus, using a
|
|
240
|
+
-- threshold is needed.
|
|
241
|
+
--
|
|
238
242
|
-- @param entity The entity whose velocity to measure.
|
|
239
243
|
-- @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
|
|
240
244
|
function ____exports.isEntityMoving(self, entity, threshold)
|
package/dist/index.d.ts
CHANGED
|
@@ -5784,6 +5784,10 @@ export declare function isEntity(variable: unknown): variable is Entity;
|
|
|
5784
5784
|
/**
|
|
5785
5785
|
* Helper function to measure an entity's velocity to see if it is moving.
|
|
5786
5786
|
*
|
|
5787
|
+
* Use this helper function over checking if the velocity length is equal to 0 because entities can
|
|
5788
|
+
* look like they are completely immobile but yet still have a non zero velocity. Thus, using a
|
|
5789
|
+
* threshold is needed.
|
|
5790
|
+
*
|
|
5787
5791
|
* @param entity The entity whose velocity to measure.
|
|
5788
5792
|
* @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
|
|
5789
5793
|
*/
|
|
@@ -7019,8 +7023,10 @@ export declare enum ModCallbackCustom {
|
|
|
7019
7023
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7020
7024
|
* `POST_GRID_ENTITY_CUSTOM_BROKEN` callback instead.
|
|
7021
7025
|
*
|
|
7022
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
7023
|
-
*
|
|
7026
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7027
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
7028
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7029
|
+
* only fire if it matches the variant provided.
|
|
7024
7030
|
*
|
|
7025
7031
|
* ```ts
|
|
7026
7032
|
* function postGridEntityBroken(gridEntity: GridEntity): void {}
|
|
@@ -7035,8 +7041,14 @@ export declare enum ModCallbackCustom {
|
|
|
7035
7041
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7036
7042
|
* `POST_GRID_ENTITY_CUSTOM_COLLISION` callback instead.
|
|
7037
7043
|
*
|
|
7038
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
7039
|
-
*
|
|
7044
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7045
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
7046
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7047
|
+
* only fire if it matches the variant provided (for the grid entity).
|
|
7048
|
+
* - When registering the callback, takes an optional fourth argument that will make the callback
|
|
7049
|
+
* only fire if the colliding entity matches the `EntityType` provided.
|
|
7050
|
+
* - When registering the callback, takes an optional fifth argument that will make the callback
|
|
7051
|
+
* only fire if the colliding entity matches the variant provided.
|
|
7040
7052
|
*
|
|
7041
7053
|
* ```ts
|
|
7042
7054
|
* function postGridEntityCollision(
|
|
@@ -7051,7 +7063,8 @@ export declare enum ModCallbackCustom {
|
|
|
7051
7063
|
* with the `spawnCustomGridEntity` helper function.
|
|
7052
7064
|
*
|
|
7053
7065
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7054
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7066
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7067
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7055
7068
|
*
|
|
7056
7069
|
* ```ts
|
|
7057
7070
|
* function postGridEntityCustomBroken(
|
|
@@ -7065,8 +7078,13 @@ export declare enum ModCallbackCustom {
|
|
|
7065
7078
|
* The same as the `POST_GRID_ENTITY_COLLISION` callback, but only fires for grid entities created
|
|
7066
7079
|
* with the `spawnCustomGridEntity` helper function.
|
|
7067
7080
|
*
|
|
7068
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
7069
|
-
*
|
|
7081
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7082
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7083
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7084
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7085
|
+
* only fire if the the colliding entity matches the `EntityType` provided.
|
|
7086
|
+
* - When registering the callback, takes an optional fourth argument that will make the callback
|
|
7087
|
+
* only fire if the the colliding entity matches the variant provided.
|
|
7070
7088
|
*
|
|
7071
7089
|
* ```ts
|
|
7072
7090
|
* function postGridEntityCustomCollision(
|
|
@@ -7082,7 +7100,8 @@ export declare enum ModCallbackCustom {
|
|
|
7082
7100
|
* the `spawnCustomGridEntity` helper function.
|
|
7083
7101
|
*
|
|
7084
7102
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7085
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7103
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7104
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7086
7105
|
*
|
|
7087
7106
|
* ```ts
|
|
7088
7107
|
* function postGridEntityCustomInit(
|
|
@@ -7097,7 +7116,8 @@ export declare enum ModCallbackCustom {
|
|
|
7097
7116
|
* with the `spawnCustomGridEntity` helper function.
|
|
7098
7117
|
*
|
|
7099
7118
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7100
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7119
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7120
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7101
7121
|
*
|
|
7102
7122
|
* ```ts
|
|
7103
7123
|
* function postGridEntityCustomRemove(
|
|
@@ -7112,7 +7132,8 @@ export declare enum ModCallbackCustom {
|
|
|
7112
7132
|
* with the `spawnCustomGridEntity` helper function.
|
|
7113
7133
|
*
|
|
7114
7134
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7115
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7135
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7136
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7116
7137
|
*
|
|
7117
7138
|
* ```ts
|
|
7118
7139
|
* function postGridEntityCustomRender(
|
|
@@ -7127,7 +7148,8 @@ export declare enum ModCallbackCustom {
|
|
|
7127
7148
|
* created with the `spawnCustomGridEntity` helper function.
|
|
7128
7149
|
*
|
|
7129
7150
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7130
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7151
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7152
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7131
7153
|
*
|
|
7132
7154
|
* ```ts
|
|
7133
7155
|
* function postGridEntityCustomStateChanged(
|
|
@@ -7144,7 +7166,8 @@ export declare enum ModCallbackCustom {
|
|
|
7144
7166
|
* with the `spawnCustomGridEntity` helper function.
|
|
7145
7167
|
*
|
|
7146
7168
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7147
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7169
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
7170
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
7148
7171
|
*
|
|
7149
7172
|
* ```ts
|
|
7150
7173
|
* function postGridEntityCustomUpdate(
|
|
@@ -7165,8 +7188,10 @@ export declare enum ModCallbackCustom {
|
|
|
7165
7188
|
* For grid entities created with `spawnCustomGridEntity`, use the `POST_GRID_ENTITY_CUSTOM_INIT`
|
|
7166
7189
|
* callback instead.
|
|
7167
7190
|
*
|
|
7168
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
7169
|
-
*
|
|
7191
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7192
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
7193
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7194
|
+
* only fire if it matches the variant provided.
|
|
7170
7195
|
*
|
|
7171
7196
|
* ```ts
|
|
7172
7197
|
* function postGridEntityInit(gridEntity: GridEntity): void {}
|
|
@@ -7184,8 +7209,10 @@ export declare enum ModCallbackCustom {
|
|
|
7184
7209
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7185
7210
|
* `POST_GRID_ENTITY_CUSTOM_REMOVE` callback instead.
|
|
7186
7211
|
*
|
|
7187
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
7188
|
-
*
|
|
7212
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7213
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
7214
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7215
|
+
* only fire if it matches the variant provided.
|
|
7189
7216
|
*
|
|
7190
7217
|
* ```ts
|
|
7191
7218
|
* function postGridEntityRemove(
|
|
@@ -7198,14 +7225,14 @@ export declare enum ModCallbackCustom {
|
|
|
7198
7225
|
/**
|
|
7199
7226
|
* Fires from the `POST_RENDER` callback on every frame that a grid entity exists.
|
|
7200
7227
|
*
|
|
7228
|
+
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7229
|
+
* `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
|
|
7230
|
+
*
|
|
7201
7231
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7202
7232
|
* only fire if it matches the `GridEntityType` provided.
|
|
7203
7233
|
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7204
7234
|
* only fire if it matches the variant provided.
|
|
7205
7235
|
*
|
|
7206
|
-
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7207
|
-
* `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
|
|
7208
|
-
*
|
|
7209
7236
|
* ```ts
|
|
7210
7237
|
* function postGridEntityRender(gridEntity: GridEntity): void {}
|
|
7211
7238
|
* ```
|
|
@@ -7215,12 +7242,14 @@ export declare enum ModCallbackCustom {
|
|
|
7215
7242
|
* Fires from the `POST_UPDATE` callback when a grid entity changes its state. (In this context,
|
|
7216
7243
|
* "state" refers to the `GridEntity.State` field.)
|
|
7217
7244
|
*
|
|
7218
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
7219
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
7220
|
-
*
|
|
7221
7245
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7222
7246
|
* `POST_GRID_ENTITY_CUSTOM_STATE_CHANGED` callback instead.
|
|
7223
7247
|
*
|
|
7248
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7249
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
7250
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7251
|
+
* only fire if it matches the variant provided.
|
|
7252
|
+
*
|
|
7224
7253
|
* ```ts
|
|
7225
7254
|
* function postGridEntityStateChanged(
|
|
7226
7255
|
* gridEntity: GridEntity,
|
|
@@ -7233,14 +7262,14 @@ export declare enum ModCallbackCustom {
|
|
|
7233
7262
|
/**
|
|
7234
7263
|
* Fires from the `POST_UPDATE` callback on every frame that a grid entity exists.
|
|
7235
7264
|
*
|
|
7265
|
+
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7266
|
+
* `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
|
|
7267
|
+
*
|
|
7236
7268
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
7237
7269
|
* only fire if it matches the `GridEntityType` provided.
|
|
7238
7270
|
* - When registering the callback, takes an optional third argument that will make the callback
|
|
7239
7271
|
* only fire if it matches the variant provided.
|
|
7240
7272
|
*
|
|
7241
|
-
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
7242
|
-
* `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
|
|
7243
|
-
*
|
|
7244
7273
|
* ```ts
|
|
7245
7274
|
* function postGridEntityUpdate(gridEntity: GridEntity): void {}
|
|
7246
7275
|
* ```
|
|
@@ -7862,7 +7891,8 @@ export declare enum ModCallbackCustom {
|
|
|
7862
7891
|
* certain conditions, like if the slot entity is playing the "Idle" animation, and so on.
|
|
7863
7892
|
*
|
|
7864
7893
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
7865
|
-
* only fire if it matches the `SlotVariant` provided.
|
|
7894
|
+
* only fire if it matches the `SlotVariant` provided. (There is no need for any additional
|
|
7895
|
+
* arguments, since only players will cause this callback to fire.)
|
|
7866
7896
|
*
|
|
7867
7897
|
* ```ts
|
|
7868
7898
|
* function postSlotCollision(
|
|
@@ -8580,7 +8610,9 @@ gridEntityVariant?: int
|
|
|
8580
8610
|
declare type PostGridEntityCollisionRegisterParameters = [
|
|
8581
8611
|
callback: (gridEntity: GridEntity, entity: Entity) => void,
|
|
8582
8612
|
gridEntityType?: GridEntityType,
|
|
8583
|
-
gridEntityVariant?: int
|
|
8613
|
+
gridEntityVariant?: int,
|
|
8614
|
+
entityType?: EntityType,
|
|
8615
|
+
entityVariant?: int
|
|
8584
8616
|
];
|
|
8585
8617
|
|
|
8586
8618
|
declare type PostGridEntityCustomBrokenRegisterParameters = [
|
|
@@ -8590,7 +8622,9 @@ gridEntityTypeCustom?: GridEntityType
|
|
|
8590
8622
|
|
|
8591
8623
|
declare type PostGridEntityCustomCollisionRegisterParameters = [
|
|
8592
8624
|
callback: (gridEntity: GridEntity, gridEntityTypeCustom: GridEntityType, entity: Entity) => void,
|
|
8593
|
-
gridEntityTypeCustom?: GridEntityType
|
|
8625
|
+
gridEntityTypeCustom?: GridEntityType,
|
|
8626
|
+
entityType?: EntityType,
|
|
8627
|
+
entityVariant?: int
|
|
8594
8628
|
];
|
|
8595
8629
|
|
|
8596
8630
|
declare type PostGridEntityCustomInitRegisterParameters = [
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { GridEntityType } from "isaac-typescript-definitions";
|
|
1
|
+
import { EntityType, GridEntityType } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
3
|
export type PostGridEntityCollisionRegisterParameters = [
|
|
4
4
|
callback: (gridEntity: GridEntity, entity: Entity) => void,
|
|
5
5
|
gridEntityType?: GridEntityType,
|
|
6
6
|
gridEntityVariant?: int,
|
|
7
|
+
entityType?: EntityType,
|
|
8
|
+
entityVariant?: int,
|
|
7
9
|
];
|
|
8
10
|
|
|
9
11
|
const subscriptions: PostGridEntityCollisionRegisterParameters[] = [];
|
|
@@ -29,6 +31,8 @@ export function postGridEntityCollisionFire(
|
|
|
29
31
|
callback,
|
|
30
32
|
callbackGridEntityType,
|
|
31
33
|
callbackGridEntityVariant,
|
|
34
|
+
callbackEntityType,
|
|
35
|
+
callbackEntityVariant,
|
|
32
36
|
] of subscriptions) {
|
|
33
37
|
// Handle the optional 2nd callback argument.
|
|
34
38
|
if (
|
|
@@ -46,6 +50,22 @@ export function postGridEntityCollisionFire(
|
|
|
46
50
|
continue;
|
|
47
51
|
}
|
|
48
52
|
|
|
53
|
+
// Handle the optional 4th callback argument.
|
|
54
|
+
if (
|
|
55
|
+
callbackEntityType !== undefined &&
|
|
56
|
+
callbackEntityType !== entity.Type
|
|
57
|
+
) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Handle the optional 5th callback argument.
|
|
62
|
+
if (
|
|
63
|
+
callbackEntityVariant !== undefined &&
|
|
64
|
+
callbackEntityVariant !== entity.Variant
|
|
65
|
+
) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
|
|
49
69
|
callback(gridEntity, entity);
|
|
50
70
|
}
|
|
51
71
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GridEntityType } from "isaac-typescript-definitions";
|
|
1
|
+
import { EntityType, GridEntityType } from "isaac-typescript-definitions";
|
|
2
2
|
|
|
3
3
|
export type PostGridEntityCustomCollisionRegisterParameters = [
|
|
4
4
|
callback: (
|
|
@@ -7,6 +7,8 @@ export type PostGridEntityCustomCollisionRegisterParameters = [
|
|
|
7
7
|
entity: Entity,
|
|
8
8
|
) => void,
|
|
9
9
|
gridEntityTypeCustom?: GridEntityType,
|
|
10
|
+
entityType?: EntityType,
|
|
11
|
+
entityVariant?: int,
|
|
10
12
|
];
|
|
11
13
|
|
|
12
14
|
const subscriptions: PostGridEntityCustomCollisionRegisterParameters[] = [];
|
|
@@ -26,7 +28,12 @@ export function postGridEntityCustomCollisionFire(
|
|
|
26
28
|
gridEntityTypeCustom: GridEntityType,
|
|
27
29
|
entity: Entity,
|
|
28
30
|
): void {
|
|
29
|
-
for (const [
|
|
31
|
+
for (const [
|
|
32
|
+
callback,
|
|
33
|
+
callbackGridEntityTypeCustom,
|
|
34
|
+
callbackEntityType,
|
|
35
|
+
callbackEntityVariant,
|
|
36
|
+
] of subscriptions) {
|
|
30
37
|
// Handle the optional 2nd callback argument.
|
|
31
38
|
if (
|
|
32
39
|
callbackGridEntityTypeCustom !== undefined &&
|
|
@@ -35,6 +42,22 @@ export function postGridEntityCustomCollisionFire(
|
|
|
35
42
|
continue;
|
|
36
43
|
}
|
|
37
44
|
|
|
45
|
+
// Handle the optional 3rd callback argument.
|
|
46
|
+
if (
|
|
47
|
+
callbackEntityType !== undefined &&
|
|
48
|
+
callbackEntityType !== entity.Type
|
|
49
|
+
) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Handle the optional 4th callback argument.
|
|
54
|
+
if (
|
|
55
|
+
callbackEntityVariant !== undefined &&
|
|
56
|
+
callbackEntityVariant !== entity.Variant
|
|
57
|
+
) {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
|
|
38
61
|
callback(gridEntity, gridEntityTypeCustom, entity);
|
|
39
62
|
}
|
|
40
63
|
}
|
|
@@ -356,8 +356,10 @@ export enum ModCallbackCustom {
|
|
|
356
356
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
357
357
|
* `POST_GRID_ENTITY_CUSTOM_BROKEN` callback instead.
|
|
358
358
|
*
|
|
359
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
360
|
-
*
|
|
359
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
360
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
361
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
362
|
+
* only fire if it matches the variant provided.
|
|
361
363
|
*
|
|
362
364
|
* ```ts
|
|
363
365
|
* function postGridEntityBroken(gridEntity: GridEntity): void {}
|
|
@@ -373,8 +375,14 @@ export enum ModCallbackCustom {
|
|
|
373
375
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
374
376
|
* `POST_GRID_ENTITY_CUSTOM_COLLISION` callback instead.
|
|
375
377
|
*
|
|
376
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
377
|
-
*
|
|
378
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
379
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
380
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
381
|
+
* only fire if it matches the variant provided (for the grid entity).
|
|
382
|
+
* - When registering the callback, takes an optional fourth argument that will make the callback
|
|
383
|
+
* only fire if the colliding entity matches the `EntityType` provided.
|
|
384
|
+
* - When registering the callback, takes an optional fifth argument that will make the callback
|
|
385
|
+
* only fire if the colliding entity matches the variant provided.
|
|
378
386
|
*
|
|
379
387
|
* ```ts
|
|
380
388
|
* function postGridEntityCollision(
|
|
@@ -390,7 +398,8 @@ export enum ModCallbackCustom {
|
|
|
390
398
|
* with the `spawnCustomGridEntity` helper function.
|
|
391
399
|
*
|
|
392
400
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
393
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
401
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
402
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
394
403
|
*
|
|
395
404
|
* ```ts
|
|
396
405
|
* function postGridEntityCustomBroken(
|
|
@@ -405,8 +414,13 @@ export enum ModCallbackCustom {
|
|
|
405
414
|
* The same as the `POST_GRID_ENTITY_COLLISION` callback, but only fires for grid entities created
|
|
406
415
|
* with the `spawnCustomGridEntity` helper function.
|
|
407
416
|
*
|
|
408
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
409
|
-
*
|
|
417
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
418
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
419
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
420
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
421
|
+
* only fire if the the colliding entity matches the `EntityType` provided.
|
|
422
|
+
* - When registering the callback, takes an optional fourth argument that will make the callback
|
|
423
|
+
* only fire if the the colliding entity matches the variant provided.
|
|
410
424
|
*
|
|
411
425
|
* ```ts
|
|
412
426
|
* function postGridEntityCustomCollision(
|
|
@@ -423,7 +437,8 @@ export enum ModCallbackCustom {
|
|
|
423
437
|
* the `spawnCustomGridEntity` helper function.
|
|
424
438
|
*
|
|
425
439
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
426
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
440
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
441
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
427
442
|
*
|
|
428
443
|
* ```ts
|
|
429
444
|
* function postGridEntityCustomInit(
|
|
@@ -439,7 +454,8 @@ export enum ModCallbackCustom {
|
|
|
439
454
|
* with the `spawnCustomGridEntity` helper function.
|
|
440
455
|
*
|
|
441
456
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
442
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
457
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
458
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
443
459
|
*
|
|
444
460
|
* ```ts
|
|
445
461
|
* function postGridEntityCustomRemove(
|
|
@@ -455,7 +471,8 @@ export enum ModCallbackCustom {
|
|
|
455
471
|
* with the `spawnCustomGridEntity` helper function.
|
|
456
472
|
*
|
|
457
473
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
458
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
474
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
475
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
459
476
|
*
|
|
460
477
|
* ```ts
|
|
461
478
|
* function postGridEntityCustomRender(
|
|
@@ -471,7 +488,8 @@ export enum ModCallbackCustom {
|
|
|
471
488
|
* created with the `spawnCustomGridEntity` helper function.
|
|
472
489
|
*
|
|
473
490
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
474
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
491
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
492
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
475
493
|
*
|
|
476
494
|
* ```ts
|
|
477
495
|
* function postGridEntityCustomStateChanged(
|
|
@@ -489,7 +507,8 @@ export enum ModCallbackCustom {
|
|
|
489
507
|
* with the `spawnCustomGridEntity` helper function.
|
|
490
508
|
*
|
|
491
509
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
492
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
510
|
+
* only fire if it matches the `GridEntityType` provided. (Custom grid entities do not have
|
|
511
|
+
* variants, so there is no need for an optional third argument to filter by variant.)
|
|
493
512
|
*
|
|
494
513
|
* ```ts
|
|
495
514
|
* function postGridEntityCustomUpdate(
|
|
@@ -511,8 +530,10 @@ export enum ModCallbackCustom {
|
|
|
511
530
|
* For grid entities created with `spawnCustomGridEntity`, use the `POST_GRID_ENTITY_CUSTOM_INIT`
|
|
512
531
|
* callback instead.
|
|
513
532
|
*
|
|
514
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
515
|
-
*
|
|
533
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
534
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
535
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
536
|
+
* only fire if it matches the variant provided.
|
|
516
537
|
*
|
|
517
538
|
* ```ts
|
|
518
539
|
* function postGridEntityInit(gridEntity: GridEntity): void {}
|
|
@@ -531,8 +552,10 @@ export enum ModCallbackCustom {
|
|
|
531
552
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
532
553
|
* `POST_GRID_ENTITY_CUSTOM_REMOVE` callback instead.
|
|
533
554
|
*
|
|
534
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
535
|
-
*
|
|
555
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
556
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
557
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
558
|
+
* only fire if it matches the variant provided.
|
|
536
559
|
*
|
|
537
560
|
* ```ts
|
|
538
561
|
* function postGridEntityRemove(
|
|
@@ -546,14 +569,14 @@ export enum ModCallbackCustom {
|
|
|
546
569
|
/**
|
|
547
570
|
* Fires from the `POST_RENDER` callback on every frame that a grid entity exists.
|
|
548
571
|
*
|
|
572
|
+
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
573
|
+
* `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
|
|
574
|
+
*
|
|
549
575
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
550
576
|
* only fire if it matches the `GridEntityType` provided.
|
|
551
577
|
* - When registering the callback, takes an optional third argument that will make the callback
|
|
552
578
|
* only fire if it matches the variant provided.
|
|
553
579
|
*
|
|
554
|
-
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
555
|
-
* `POST_GRID_ENTITY_CUSTOM_RENDER` callback instead.
|
|
556
|
-
*
|
|
557
580
|
* ```ts
|
|
558
581
|
* function postGridEntityRender(gridEntity: GridEntity): void {}
|
|
559
582
|
* ```
|
|
@@ -564,12 +587,14 @@ export enum ModCallbackCustom {
|
|
|
564
587
|
* Fires from the `POST_UPDATE` callback when a grid entity changes its state. (In this context,
|
|
565
588
|
* "state" refers to the `GridEntity.State` field.)
|
|
566
589
|
*
|
|
567
|
-
* When registering the callback, takes an optional second argument that will make the callback
|
|
568
|
-
* only fire if it matches the `GridEntityType` provided.
|
|
569
|
-
*
|
|
570
590
|
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
571
591
|
* `POST_GRID_ENTITY_CUSTOM_STATE_CHANGED` callback instead.
|
|
572
592
|
*
|
|
593
|
+
* - When registering the callback, takes an optional second argument that will make the callback
|
|
594
|
+
* only fire if it matches the `GridEntityType` provided.
|
|
595
|
+
* - When registering the callback, takes an optional third argument that will make the callback
|
|
596
|
+
* only fire if it matches the variant provided.
|
|
597
|
+
*
|
|
573
598
|
* ```ts
|
|
574
599
|
* function postGridEntityStateChanged(
|
|
575
600
|
* gridEntity: GridEntity,
|
|
@@ -583,14 +608,14 @@ export enum ModCallbackCustom {
|
|
|
583
608
|
/**
|
|
584
609
|
* Fires from the `POST_UPDATE` callback on every frame that a grid entity exists.
|
|
585
610
|
*
|
|
611
|
+
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
612
|
+
* `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
|
|
613
|
+
*
|
|
586
614
|
* - When registering the callback, takes an optional second argument that will make the callback
|
|
587
615
|
* only fire if it matches the `GridEntityType` provided.
|
|
588
616
|
* - When registering the callback, takes an optional third argument that will make the callback
|
|
589
617
|
* only fire if it matches the variant provided.
|
|
590
618
|
*
|
|
591
|
-
* For grid entities created with `spawnCustomGridEntity`, use the
|
|
592
|
-
* `POST_GRID_ENTITY_CUSTOM_UPDATE` callback instead.
|
|
593
|
-
*
|
|
594
619
|
* ```ts
|
|
595
620
|
* function postGridEntityUpdate(gridEntity: GridEntity): void {}
|
|
596
621
|
* ```
|
|
@@ -1251,7 +1276,8 @@ export enum ModCallbackCustom {
|
|
|
1251
1276
|
* certain conditions, like if the slot entity is playing the "Idle" animation, and so on.
|
|
1252
1277
|
*
|
|
1253
1278
|
* When registering the callback, takes an optional second argument that will make the callback
|
|
1254
|
-
* only fire if it matches the `SlotVariant` provided.
|
|
1279
|
+
* only fire if it matches the `SlotVariant` provided. (There is no need for any additional
|
|
1280
|
+
* arguments, since only players will cause this callback to fire.)
|
|
1255
1281
|
*
|
|
1256
1282
|
* ```ts
|
|
1257
1283
|
* function postSlotCollision(
|
|
@@ -234,6 +234,10 @@ export function getFilteredNewEntities<T extends AnyEntity>(
|
|
|
234
234
|
/**
|
|
235
235
|
* Helper function to measure an entity's velocity to see if it is moving.
|
|
236
236
|
*
|
|
237
|
+
* Use this helper function over checking if the velocity length is equal to 0 because entities can
|
|
238
|
+
* look like they are completely immobile but yet still have a non zero velocity. Thus, using a
|
|
239
|
+
* threshold is needed.
|
|
240
|
+
*
|
|
237
241
|
* @param entity The entity whose velocity to measure.
|
|
238
242
|
* @param threshold Optional. The threshold from 0 to consider to be moving. Default is 0.01.
|
|
239
243
|
*/
|