isaacscript-common 9.4.1 → 9.5.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/functions/gridEntitiesSpecific.d.ts +24 -0
- package/dist/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/functions/gridEntitiesSpecific.lua +41 -0
- package/dist/functions/pickups.d.ts +2 -0
- package/dist/functions/pickups.d.ts.map +1 -1
- package/dist/functions/pickups.lua +2 -0
- package/dist/index.d.ts +30 -0
- package/package.json +1 -1
- package/src/functions/gridEntitiesSpecific.ts +54 -0
- package/src/functions/pickups.ts +2 -0
|
@@ -41,6 +41,14 @@ export declare function getRocks(variant?: number): GridEntityRock[];
|
|
|
41
41
|
export declare function getSpikes(variant?: number): GridEntitySpikes[];
|
|
42
42
|
/** Helper function to get all of the `GridEntityTNT` in the room. */
|
|
43
43
|
export declare function getTNT(variant?: number): GridEntityTNT[];
|
|
44
|
+
/**
|
|
45
|
+
* Helper function to get all of the grid entities of type `GridEntityType.TELEPORTER` (23) in the
|
|
46
|
+
* room.
|
|
47
|
+
*
|
|
48
|
+
* @param variant Optional. If specified, will only get the teleporters that match the variant.
|
|
49
|
+
* Default is -1, which matches every variant.
|
|
50
|
+
*/
|
|
51
|
+
export declare function getTeleporters(variant?: number): GridEntity[];
|
|
44
52
|
/**
|
|
45
53
|
* Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
|
|
46
54
|
* room. Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
@@ -135,6 +143,18 @@ export declare function removeAllSpikes(variant?: number, updateRoom?: boolean,
|
|
|
135
143
|
* @returns The TNTs that were removed.
|
|
136
144
|
*/
|
|
137
145
|
export declare function removeAllTNT(variant?: number, updateRoom?: boolean, cap?: int): GridEntityTNT[];
|
|
146
|
+
/**
|
|
147
|
+
* Helper function to remove all of the `GridEntityType.TELEPORTER` (23) in the room.
|
|
148
|
+
*
|
|
149
|
+
* @param variant Optional. If specified, will only remove the teleporters that match this variant.
|
|
150
|
+
* Default is -1, which matches every variant.
|
|
151
|
+
* @param updateRoom Optional. Whether or not to update the room after the teleporters are removed.
|
|
152
|
+
* Default is false. For more information, see the description of the
|
|
153
|
+
* `removeGridEntities` helper function.
|
|
154
|
+
* @param cap Optional. If specified, will only remove the given amount of teleporters.
|
|
155
|
+
* @returns The teleporters that were removed.
|
|
156
|
+
*/
|
|
157
|
+
export declare function removeAllTeleporters(variant?: number, updateRoom?: boolean, cap?: int): GridEntity[];
|
|
138
158
|
/**
|
|
139
159
|
* Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room.
|
|
140
160
|
*
|
|
@@ -179,6 +199,10 @@ export declare function spawnSpikesWithVariant(variant: int, gridIndexOrPosition
|
|
|
179
199
|
export declare function spawnTNT(gridIndexOrPosition: int | Vector): GridEntityTNT | undefined;
|
|
180
200
|
/** Helper function to spawn a `GridEntityType.TNT` (12) with a specific variant. */
|
|
181
201
|
export declare function spawnTNTWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntityTNT | undefined;
|
|
202
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23). */
|
|
203
|
+
export declare function spawnTeleporter(gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
204
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23) with a specific variant. */
|
|
205
|
+
export declare function spawnTeleporterWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
182
206
|
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17). */
|
|
183
207
|
export declare function spawnTrapdoor(gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
184
208
|
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17) with a specific variant. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridEntitiesSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntitiesSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,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AED,oFAAoF;AACpF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,GAAG,EACZ,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,aAAa,GAAG,SAAS,CAgB3B;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CAC3B,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAKxB;AAED,yFAAyF;AACzF,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAMxB"}
|
|
1
|
+
{"version":3,"file":"gridEntitiesSpecific.d.ts","sourceRoot":"","sources":["../../src/functions/gridEntitiesSpecific.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEX,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACpB,WAAW,EACX,eAAe,EAChB,MAAM,8BAA8B,CAAC;AAStC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,iBAAiB,GAAE,iBAAsB,GACxC,UAAU,EAAE,CAMd;AAKD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,UAAU,GAAE,UAAe,GAAG,aAAa,EAAE,CAepE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,WAAW,GAAE,qBAA0B,GACtC,cAAc,EAAE,CAelB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,oBAAoB,GAAE,oBAAyB,GAC9C,uBAAuB,EAAE,CAkB3B;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,SAAK,GAAG,cAAc,EAAE,CAevD;AAED,wEAAwE;AACxE,wBAAgB,SAAS,CAAC,OAAO,SAAK,GAAG,gBAAgB,EAAE,CAe1D;AAED,qEAAqE;AACrE,wBAAgB,MAAM,CAAC,OAAO,SAAK,GAAG,aAAa,EAAE,CAepD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,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Ae,EAChC,mBAAmB,EAAE,GAAG,GAAG,MAAM,GAChC,UAAU,GAAG,SAAS,CAMxB"}
|
|
@@ -102,6 +102,10 @@ function ____exports.spawnTNTWithVariant(self, variant, gridIndexOrPosition)
|
|
|
102
102
|
end
|
|
103
103
|
return tnt
|
|
104
104
|
end
|
|
105
|
+
--- Helper function to spawn a `GridEntityType.TELEPORTER` (23) with a specific variant.
|
|
106
|
+
function ____exports.spawnTeleporterWithVariant(self, variant, gridIndexOrPosition)
|
|
107
|
+
return spawnGridEntityWithVariant(nil, GridEntityType.TELEPORTER, variant, gridIndexOrPosition)
|
|
108
|
+
end
|
|
105
109
|
--- Helper function to get all of the grid entities of type `GridEntityType.CRAWL_SPACE` (18) in the
|
|
106
110
|
-- room.
|
|
107
111
|
--
|
|
@@ -238,6 +242,20 @@ function ____exports.getTNT(self, variant)
|
|
|
238
242
|
end
|
|
239
243
|
return tntArray
|
|
240
244
|
end
|
|
245
|
+
--- Helper function to get all of the grid entities of type `GridEntityType.TELEPORTER` (23) in the
|
|
246
|
+
-- room.
|
|
247
|
+
--
|
|
248
|
+
-- @param variant Optional. If specified, will only get the teleporters that match the variant.
|
|
249
|
+
-- Default is -1, which matches every variant.
|
|
250
|
+
function ____exports.getTeleporters(self, variant)
|
|
251
|
+
if variant == nil then
|
|
252
|
+
variant = -1
|
|
253
|
+
end
|
|
254
|
+
if variant == -1 then
|
|
255
|
+
return getGridEntities(nil, GridEntityType.TELEPORTER)
|
|
256
|
+
end
|
|
257
|
+
return getMatchingGridEntities(nil, GridEntityType.TELEPORTER, variant)
|
|
258
|
+
end
|
|
241
259
|
--- Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
|
|
242
260
|
-- room. Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
243
261
|
function ____exports.getTrapdoors(self, trapdoorVariant)
|
|
@@ -384,6 +402,25 @@ function ____exports.removeAllTNT(self, variant, updateRoom, cap)
|
|
|
384
402
|
local tnt = ____exports.getTNT(nil, variant)
|
|
385
403
|
return removeGridEntities(nil, tnt, updateRoom, cap)
|
|
386
404
|
end
|
|
405
|
+
--- Helper function to remove all of the `GridEntityType.TELEPORTER` (23) in the room.
|
|
406
|
+
--
|
|
407
|
+
-- @param variant Optional. If specified, will only remove the teleporters that match this variant.
|
|
408
|
+
-- Default is -1, which matches every variant.
|
|
409
|
+
-- @param updateRoom Optional. Whether or not to update the room after the teleporters are removed.
|
|
410
|
+
-- Default is false. For more information, see the description of the
|
|
411
|
+
-- `removeGridEntities` helper function.
|
|
412
|
+
-- @param cap Optional. If specified, will only remove the given amount of teleporters.
|
|
413
|
+
-- @returns The teleporters that were removed.
|
|
414
|
+
function ____exports.removeAllTeleporters(self, variant, updateRoom, cap)
|
|
415
|
+
if variant == nil then
|
|
416
|
+
variant = -1
|
|
417
|
+
end
|
|
418
|
+
if updateRoom == nil then
|
|
419
|
+
updateRoom = false
|
|
420
|
+
end
|
|
421
|
+
local teleporters = ____exports.getTeleporters(nil, variant)
|
|
422
|
+
return removeGridEntities(nil, teleporters, updateRoom, cap)
|
|
423
|
+
end
|
|
387
424
|
--- Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room.
|
|
388
425
|
--
|
|
389
426
|
-- @param trapdoorVariant Optional. If specified, will only remove the trapdoors that match this
|
|
@@ -435,6 +472,10 @@ end
|
|
|
435
472
|
function ____exports.spawnTNT(self, gridIndexOrPosition)
|
|
436
473
|
return ____exports.spawnTNTWithVariant(nil, 0, gridIndexOrPosition)
|
|
437
474
|
end
|
|
475
|
+
--- Helper function to spawn a `GridEntityType.TELEPORTER` (23).
|
|
476
|
+
function ____exports.spawnTeleporter(self, gridIndexOrPosition)
|
|
477
|
+
return ____exports.spawnTeleporterWithVariant(nil, 0, gridIndexOrPosition)
|
|
478
|
+
end
|
|
438
479
|
--- Helper function to spawn a `GridEntityType.TRAPDOOR` (17).
|
|
439
480
|
function ____exports.spawnTrapdoor(self, gridIndexOrPosition)
|
|
440
481
|
return ____exports.spawnCrawlSpaceWithVariant(nil, CrawlSpaceVariant.NORMAL, gridIndexOrPosition)
|
|
@@ -6,7 +6,9 @@ import { CoinSubType } from "isaac-typescript-definitions";
|
|
|
6
6
|
export declare function getCoinValue(coinSubType: CoinSubType): int;
|
|
7
7
|
/** Helper function to get all of the red heart pickup entities in the room. */
|
|
8
8
|
export declare function getRedHearts(): EntityPickupHeart[];
|
|
9
|
+
/** Helper function to test if the provided pickup matches one of the various chest variants. */
|
|
9
10
|
export declare function isChest(pickup: EntityPickup): boolean;
|
|
11
|
+
/** Helper function to test if the provided pickup matches on of the various red heart sub types. */
|
|
10
12
|
export declare function isRedHeart(pickup: EntityPickup): boolean;
|
|
11
13
|
/**
|
|
12
14
|
* Helper function to remove all of the red heart pickup entities in the room.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAW3D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,GAAG,CAK1D;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,iBAAiB,EAAE,CAGlD;AAED,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAErD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE,CAGjE"}
|
|
1
|
+
{"version":3,"file":"pickups.d.ts","sourceRoot":"","sources":["../../src/functions/pickups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAW3D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,GAAG,CAK1D;AAED,+EAA+E;AAC/E,wBAAgB,YAAY,IAAI,iBAAiB,EAAE,CAGlD;AAED,gGAAgG;AAChG,wBAAgB,OAAO,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAErD;AAED,oGAAoG;AACpG,wBAAgB,UAAU,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAExD;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,iBAAiB,EAAE,CAGjE"}
|
|
@@ -28,9 +28,11 @@ function ____exports.getRedHearts(self)
|
|
|
28
28
|
function(____, heart) return RED_HEART_SUB_TYPES_SET:has(heart.SubType) end
|
|
29
29
|
)
|
|
30
30
|
end
|
|
31
|
+
--- Helper function to test if the provided pickup matches one of the various chest variants.
|
|
31
32
|
function ____exports.isChest(self, pickup)
|
|
32
33
|
return CHEST_PICKUP_VARIANTS:has(pickup.Variant)
|
|
33
34
|
end
|
|
35
|
+
--- Helper function to test if the provided pickup matches on of the various red heart sub types.
|
|
34
36
|
function ____exports.isRedHeart(self, pickup)
|
|
35
37
|
return isHeart(nil, pickup) and RED_HEART_SUB_TYPES_SET:has(pickup.SubType)
|
|
36
38
|
end
|
package/dist/index.d.ts
CHANGED
|
@@ -4969,6 +4969,15 @@ export declare function getTears(tearVariant?: TearVariant, subType?: number): E
|
|
|
4969
4969
|
*/
|
|
4970
4970
|
export declare function getTearsStat(fireDelay: float): float;
|
|
4971
4971
|
|
|
4972
|
+
/**
|
|
4973
|
+
* Helper function to get all of the grid entities of type `GridEntityType.TELEPORTER` (23) in the
|
|
4974
|
+
* room.
|
|
4975
|
+
*
|
|
4976
|
+
* @param variant Optional. If specified, will only get the teleporters that match the variant.
|
|
4977
|
+
* Default is -1, which matches every variant.
|
|
4978
|
+
*/
|
|
4979
|
+
export declare function getTeleporters(variant?: number): GridEntity[];
|
|
4980
|
+
|
|
4972
4981
|
/** Helper function to get all of the `GridEntityTNT` in the room. */
|
|
4973
4982
|
export declare function getTNT(variant?: number): GridEntityTNT[];
|
|
4974
4983
|
|
|
@@ -5606,6 +5615,7 @@ export declare function isCardType(cardType: CardType, itemConfigCardType: ItemC
|
|
|
5606
5615
|
*/
|
|
5607
5616
|
export declare function isCharacter(player: EntityPlayer, ...characters: PlayerType[]): boolean;
|
|
5608
5617
|
|
|
5618
|
+
/** Helper function to test if the provided pickup matches one of the various chest variants. */
|
|
5609
5619
|
export declare function isChest(pickup: EntityPickup): boolean;
|
|
5610
5620
|
|
|
5611
5621
|
/**
|
|
@@ -6032,6 +6042,7 @@ export declare function isQuestCollectible(collectibleType: CollectibleType): bo
|
|
|
6032
6042
|
*/
|
|
6033
6043
|
export declare function isRaglingDeathPatch(npc: EntityNPC): boolean;
|
|
6034
6044
|
|
|
6045
|
+
/** Helper function to test if the provided pickup matches on of the various red heart sub types. */
|
|
6035
6046
|
export declare function isRedHeart(pickup: EntityPickup): boolean;
|
|
6036
6047
|
|
|
6037
6048
|
/**
|
|
@@ -9464,6 +9475,19 @@ export declare function removeAllSpikes(variant?: number, updateRoom?: boolean,
|
|
|
9464
9475
|
*/
|
|
9465
9476
|
export declare function removeAllTears(tearVariant?: TearVariant, subType?: number, cap?: int): EntityTear[];
|
|
9466
9477
|
|
|
9478
|
+
/**
|
|
9479
|
+
* Helper function to remove all of the `GridEntityType.TELEPORTER` (23) in the room.
|
|
9480
|
+
*
|
|
9481
|
+
* @param variant Optional. If specified, will only remove the teleporters that match this variant.
|
|
9482
|
+
* Default is -1, which matches every variant.
|
|
9483
|
+
* @param updateRoom Optional. Whether or not to update the room after the teleporters are removed.
|
|
9484
|
+
* Default is false. For more information, see the description of the
|
|
9485
|
+
* `removeGridEntities` helper function.
|
|
9486
|
+
* @param cap Optional. If specified, will only remove the given amount of teleporters.
|
|
9487
|
+
* @returns The teleporters that were removed.
|
|
9488
|
+
*/
|
|
9489
|
+
export declare function removeAllTeleporters(variant?: number, updateRoom?: boolean, cap?: int): GridEntity[];
|
|
9490
|
+
|
|
9467
9491
|
/**
|
|
9468
9492
|
* Helper function to remove all of the `GridEntityTNT` in the room.
|
|
9469
9493
|
*
|
|
@@ -11171,6 +11195,12 @@ export declare function spawnTear(tearVariant: TearVariant, subType: int, positi
|
|
|
11171
11195
|
/** Helper function to spawn a `EntityType.EntityType` (2) with a specific seed. */
|
|
11172
11196
|
export declare function spawnTearWithSeed(tearVariant: TearVariant, subType: int, position: Vector, seedOrRNG: Seed | RNG, velocity?: Vector, spawner?: Entity | undefined): EntityTear;
|
|
11173
11197
|
|
|
11198
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23). */
|
|
11199
|
+
export declare function spawnTeleporter(gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
11200
|
+
|
|
11201
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23) with a specific variant. */
|
|
11202
|
+
export declare function spawnTeleporterWithVariant(variant: int, gridIndexOrPosition: int | Vector): GridEntity | undefined;
|
|
11203
|
+
|
|
11174
11204
|
/** Helper function to spawn a `GridEntityType.TNT` (12). */
|
|
11175
11205
|
export declare function spawnTNT(gridIndexOrPosition: int | Vector): GridEntityTNT | undefined;
|
|
11176
11206
|
|
package/package.json
CHANGED
|
@@ -173,6 +173,21 @@ export function getTNT(variant = -1): GridEntityTNT[] {
|
|
|
173
173
|
return tntArray;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Helper function to get all of the grid entities of type `GridEntityType.TELEPORTER` (23) in the
|
|
178
|
+
* room.
|
|
179
|
+
*
|
|
180
|
+
* @param variant Optional. If specified, will only get the teleporters that match the variant.
|
|
181
|
+
* Default is -1, which matches every variant.
|
|
182
|
+
*/
|
|
183
|
+
export function getTeleporters(variant = -1): GridEntity[] {
|
|
184
|
+
if (variant === -1) {
|
|
185
|
+
return getGridEntities(GridEntityType.TELEPORTER);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
return getMatchingGridEntities(GridEntityType.TELEPORTER, variant);
|
|
189
|
+
}
|
|
190
|
+
|
|
176
191
|
/**
|
|
177
192
|
* Helper function to get all of the grid entities of type `GridEntityType.TRAPDOOR` (17) in the
|
|
178
193
|
* room. Specify a specific trapdoor variant to select only trapdoors of that variant.
|
|
@@ -333,6 +348,26 @@ export function removeAllTNT(
|
|
|
333
348
|
return removeGridEntities(tnt, updateRoom, cap);
|
|
334
349
|
}
|
|
335
350
|
|
|
351
|
+
/**
|
|
352
|
+
* Helper function to remove all of the `GridEntityType.TELEPORTER` (23) in the room.
|
|
353
|
+
*
|
|
354
|
+
* @param variant Optional. If specified, will only remove the teleporters that match this variant.
|
|
355
|
+
* Default is -1, which matches every variant.
|
|
356
|
+
* @param updateRoom Optional. Whether or not to update the room after the teleporters are removed.
|
|
357
|
+
* Default is false. For more information, see the description of the
|
|
358
|
+
* `removeGridEntities` helper function.
|
|
359
|
+
* @param cap Optional. If specified, will only remove the given amount of teleporters.
|
|
360
|
+
* @returns The teleporters that were removed.
|
|
361
|
+
*/
|
|
362
|
+
export function removeAllTeleporters(
|
|
363
|
+
variant = -1,
|
|
364
|
+
updateRoom = false,
|
|
365
|
+
cap?: int,
|
|
366
|
+
): GridEntity[] {
|
|
367
|
+
const teleporters = getTeleporters(variant);
|
|
368
|
+
return removeGridEntities(teleporters, updateRoom, cap);
|
|
369
|
+
}
|
|
370
|
+
|
|
336
371
|
/**
|
|
337
372
|
* Helper function to remove all of the `GridEntityType.TRAPDOOR` (17) in the room.
|
|
338
373
|
*
|
|
@@ -584,6 +619,25 @@ export function spawnTNTWithVariant(
|
|
|
584
619
|
return tnt;
|
|
585
620
|
}
|
|
586
621
|
|
|
622
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23). */
|
|
623
|
+
export function spawnTeleporter(
|
|
624
|
+
gridIndexOrPosition: int | Vector,
|
|
625
|
+
): GridEntity | undefined {
|
|
626
|
+
return spawnTeleporterWithVariant(0, gridIndexOrPosition);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
/** Helper function to spawn a `GridEntityType.TELEPORTER` (23) with a specific variant. */
|
|
630
|
+
export function spawnTeleporterWithVariant(
|
|
631
|
+
variant: int,
|
|
632
|
+
gridIndexOrPosition: int | Vector,
|
|
633
|
+
): GridEntity | undefined {
|
|
634
|
+
return spawnGridEntityWithVariant(
|
|
635
|
+
GridEntityType.TELEPORTER,
|
|
636
|
+
variant,
|
|
637
|
+
gridIndexOrPosition,
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
|
|
587
641
|
/** Helper function to spawn a `GridEntityType.TRAPDOOR` (17). */
|
|
588
642
|
export function spawnTrapdoor(
|
|
589
643
|
gridIndexOrPosition: int | Vector,
|
package/src/functions/pickups.ts
CHANGED
|
@@ -26,10 +26,12 @@ export function getRedHearts(): EntityPickupHeart[] {
|
|
|
26
26
|
return hearts.filter((heart) => RED_HEART_SUB_TYPES_SET.has(heart.SubType));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/** Helper function to test if the provided pickup matches one of the various chest variants. */
|
|
29
30
|
export function isChest(pickup: EntityPickup): boolean {
|
|
30
31
|
return CHEST_PICKUP_VARIANTS.has(pickup.Variant);
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
/** Helper function to test if the provided pickup matches on of the various red heart sub types. */
|
|
33
35
|
export function isRedHeart(pickup: EntityPickup): boolean {
|
|
34
36
|
return isHeart(pickup) && RED_HEART_SUB_TYPES_SET.has(pickup.SubType);
|
|
35
37
|
}
|