isaacscript-common 30.5.2 → 30.5.4
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/index.rollup.d.ts +59 -58
- package/dist/isaacscript-common.lua +7280 -7265
- package/dist/src/arrays/cachedEnumValues.d.ts +1 -1
- package/dist/src/arrays/cachedEnumValues.d.ts.map +1 -1
- package/dist/src/arrays/cachedEnumValues.lua +2 -2
- package/dist/src/callbackClasses.d.ts +6 -6
- package/dist/src/callbackClasses.d.ts.map +1 -1
- package/dist/src/callbackClasses.lua +30 -30
- package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts +2 -0
- package/dist/src/classes/callbacks/PostGridEntityCollision.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts +2 -0
- package/dist/src/classes/callbacks/PostGridEntityCustomCollision.d.ts.map +1 -1
- package/dist/src/classes/callbacks/PostPurchase.d.ts +2 -0
- package/dist/src/classes/callbacks/PostPurchase.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/GridEntityCollisionDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/ItemPickupDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/PlayerCollectibleDetection.d.ts.map +1 -1
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts +1 -1
- package/dist/src/classes/features/callbackLogic/SlotRenderDetection.d.ts.map +1 -1
- package/dist/src/classes/features/other/ModdedElementSets.lua +2 -2
- package/dist/src/classes/features/other/PreventCollectibleRotation.lua +2 -2
- package/dist/src/classes/features/other/extraConsoleCommands/commands.lua +2 -2
- package/dist/src/functions/array.d.ts.map +1 -1
- package/dist/src/functions/bosses.d.ts +1 -1
- package/dist/src/functions/bosses.d.ts.map +1 -1
- package/dist/src/functions/collectibles.d.ts.map +1 -1
- package/dist/src/functions/collectibles.lua +3 -0
- package/dist/src/functions/decorators.d.ts.map +1 -1
- package/dist/src/functions/emptyRoom.lua +2 -2
- package/dist/src/functions/entities.d.ts +5 -4
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +17 -4
- package/dist/src/functions/entitiesSpecific.d.ts +20 -20
- package/dist/src/functions/entitiesSpecific.d.ts.map +1 -1
- package/dist/src/functions/gridEntitiesSpecific.d.ts +10 -10
- package/dist/src/functions/gridEntitiesSpecific.d.ts.map +1 -1
- package/dist/src/functions/levelGrid.lua +2 -2
- package/dist/src/functions/npcs.d.ts +1 -1
- package/dist/src/functions/npcs.d.ts.map +1 -1
- package/dist/src/functions/pickups.lua +2 -2
- package/dist/src/functions/pickupsSpecific.d.ts +13 -13
- package/dist/src/functions/pickupsSpecific.d.ts.map +1 -1
- package/dist/src/functions/pills.lua +2 -2
- package/dist/src/functions/roomData.d.ts +8 -8
- package/dist/src/functions/roomData.d.ts.map +1 -1
- package/dist/src/functions/roomData.lua +6 -6
- package/dist/src/functions/roomShapeWalls.lua +3 -3
- package/dist/src/functions/serialization.d.ts.map +1 -1
- package/dist/src/functions/spawnCollectible.lua +2 -2
- package/dist/src/functions/vector.lua +1 -1
- package/dist/src/index.d.ts +5 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.lua +11 -11
- package/dist/src/interfaces/RoomDescription.d.ts +1 -1
- package/dist/src/interfaces/RoomDescription.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/arrays/cachedEnumValues.ts +1 -1
- package/src/callbackClasses.ts +6 -6
- package/src/classes/features/callbackLogic/GridEntityCollisionDetection.ts +1 -1
- package/src/classes/features/callbackLogic/ItemPickupDetection.ts +2 -2
- package/src/classes/features/callbackLogic/PlayerCollectibleDetection.ts +1 -1
- package/src/classes/features/callbackLogic/SlotRenderDetection.ts +1 -1
- package/src/classes/features/other/CustomStages.ts +4 -4
- package/src/classes/features/other/CustomTrapdoors.ts +1 -1
- package/src/classes/features/other/ModdedElementSets.ts +1 -1
- package/src/classes/features/other/PreventCollectibleRotation.ts +1 -1
- package/src/classes/features/other/extraConsoleCommands/commands.ts +1 -1
- package/src/functions/array.ts +2 -0
- package/src/functions/bosses.ts +1 -1
- package/src/functions/collectibles.ts +5 -1
- package/src/functions/decorators.ts +1 -1
- package/src/functions/emptyRoom.ts +1 -1
- package/src/functions/entities.ts +22 -7
- package/src/functions/entitiesSpecific.ts +20 -20
- package/src/functions/gridEntitiesSpecific.ts +10 -10
- package/src/functions/levelGrid.ts +1 -1
- package/src/functions/npcs.ts +1 -1
- package/src/functions/pickups.ts +1 -1
- package/src/functions/pickupsSpecific.ts +17 -13
- package/src/functions/pills.ts +1 -1
- package/src/functions/roomData.ts +8 -8
- package/src/functions/roomShapeWalls.ts +1 -1
- package/src/functions/serialization.ts +1 -1
- package/src/functions/spawnCollectible.ts +1 -1
- package/src/functions/vector.ts +1 -1
- package/src/index.ts +5 -5
- package/src/interfaces/RoomDescription.ts +1 -1
- package/dist/src/indexLua.d.ts +0 -186
- package/dist/src/indexLua.d.ts.map +0 -1
- package/dist/src/indexLua.lua +0 -1114
|
@@ -32,7 +32,7 @@ import { getEntities, removeEntities, spawn } from "./entities";
|
|
|
32
32
|
* is -1, which matches every sub-type.
|
|
33
33
|
*/
|
|
34
34
|
export function getBombs(
|
|
35
|
-
bombVariant: BombVariant = -1,
|
|
35
|
+
bombVariant: BombVariant | -1 = -1,
|
|
36
36
|
subType = -1,
|
|
37
37
|
): EntityBomb[] {
|
|
38
38
|
const entities = getEntities(EntityType.BOMB, bombVariant, subType);
|
|
@@ -66,7 +66,7 @@ export function getBombs(
|
|
|
66
66
|
* is -1, which matches every sub-type.
|
|
67
67
|
*/
|
|
68
68
|
export function getEffects(
|
|
69
|
-
effectVariant: EffectVariant = -1,
|
|
69
|
+
effectVariant: EffectVariant | -1 = -1,
|
|
70
70
|
subType = -1,
|
|
71
71
|
): EntityEffect[] {
|
|
72
72
|
const entities = getEntities(EntityType.EFFECT, effectVariant, subType);
|
|
@@ -100,7 +100,7 @@ export function getEffects(
|
|
|
100
100
|
* Default is -1, which matches every sub-type.
|
|
101
101
|
*/
|
|
102
102
|
export function getFamiliars(
|
|
103
|
-
familiarVariant: FamiliarVariant = -1,
|
|
103
|
+
familiarVariant: FamiliarVariant | -1 = -1,
|
|
104
104
|
subType = -1,
|
|
105
105
|
): EntityFamiliar[] {
|
|
106
106
|
const entities = getEntities(EntityType.FAMILIAR, familiarVariant, subType);
|
|
@@ -134,7 +134,7 @@ export function getFamiliars(
|
|
|
134
134
|
* is -1, which matches every sub-type.
|
|
135
135
|
*/
|
|
136
136
|
export function getKnives(
|
|
137
|
-
knifeVariant: KnifeVariant = -1,
|
|
137
|
+
knifeVariant: KnifeVariant | -1 = -1,
|
|
138
138
|
subType = -1,
|
|
139
139
|
): EntityKnife[] {
|
|
140
140
|
const entities = getEntities(EntityType.KNIFE, knifeVariant, subType);
|
|
@@ -168,7 +168,7 @@ export function getKnives(
|
|
|
168
168
|
* is -1, which matches every sub-type.
|
|
169
169
|
*/
|
|
170
170
|
export function getLasers(
|
|
171
|
-
laserVariant: LaserVariant = -1,
|
|
171
|
+
laserVariant: LaserVariant | -1 = -1,
|
|
172
172
|
subType = -1,
|
|
173
173
|
): EntityLaser[] {
|
|
174
174
|
const entities = getEntities(EntityType.LASER, laserVariant, subType);
|
|
@@ -198,7 +198,7 @@ export function getLasers(
|
|
|
198
198
|
* `entityType` is specified.
|
|
199
199
|
*/
|
|
200
200
|
export function getNPCs(
|
|
201
|
-
entityType: EntityType = -1,
|
|
201
|
+
entityType: EntityType | -1 = -1,
|
|
202
202
|
variant = -1,
|
|
203
203
|
subType = -1,
|
|
204
204
|
ignoreFriendly = false,
|
|
@@ -234,7 +234,7 @@ export function getNPCs(
|
|
|
234
234
|
* is -1, which matches every sub-type.
|
|
235
235
|
*/
|
|
236
236
|
export function getPickups(
|
|
237
|
-
pickupVariant: PickupVariant = -1,
|
|
237
|
+
pickupVariant: PickupVariant | -1 = -1,
|
|
238
238
|
subType = -1,
|
|
239
239
|
): EntityPickup[] {
|
|
240
240
|
const entities = getEntities(EntityType.PICKUP, pickupVariant, subType);
|
|
@@ -268,7 +268,7 @@ export function getPickups(
|
|
|
268
268
|
* Default is -1, which matches every sub-type.
|
|
269
269
|
*/
|
|
270
270
|
export function getProjectiles(
|
|
271
|
-
projectileVariant: ProjectileVariant = -1,
|
|
271
|
+
projectileVariant: ProjectileVariant | -1 = -1,
|
|
272
272
|
subType = -1,
|
|
273
273
|
): EntityProjectile[] {
|
|
274
274
|
const entities = getEntities(
|
|
@@ -306,7 +306,7 @@ export function getProjectiles(
|
|
|
306
306
|
* is -1, which matches every sub-type.
|
|
307
307
|
*/
|
|
308
308
|
export function getSlots(
|
|
309
|
-
slotVariant: SlotVariant = -1,
|
|
309
|
+
slotVariant: SlotVariant | -1 = -1,
|
|
310
310
|
subType = -1,
|
|
311
311
|
): EntitySlot[] {
|
|
312
312
|
const slots = getEntities(EntityType.SLOT, slotVariant, subType);
|
|
@@ -332,7 +332,7 @@ export function getSlots(
|
|
|
332
332
|
* is -1, which matches every sub-type.
|
|
333
333
|
*/
|
|
334
334
|
export function getTears(
|
|
335
|
-
tearVariant: TearVariant = -1,
|
|
335
|
+
tearVariant: TearVariant | -1 = -1,
|
|
336
336
|
subType = -1,
|
|
337
337
|
): EntityTear[] {
|
|
338
338
|
const entities = getEntities(EntityType.TEAR, tearVariant, subType);
|
|
@@ -360,7 +360,7 @@ export function getTears(
|
|
|
360
360
|
* @returns An array of the bombs that were removed.
|
|
361
361
|
*/
|
|
362
362
|
export function removeAllBombs(
|
|
363
|
-
bombVariant: BombVariant = -1,
|
|
363
|
+
bombVariant: BombVariant | -1 = -1,
|
|
364
364
|
subType = -1,
|
|
365
365
|
cap?: int,
|
|
366
366
|
): EntityBomb[] {
|
|
@@ -379,7 +379,7 @@ export function removeAllBombs(
|
|
|
379
379
|
* @returns An array of the effects that were removed.
|
|
380
380
|
*/
|
|
381
381
|
export function removeAllEffects(
|
|
382
|
-
effectVariant: EffectVariant = -1,
|
|
382
|
+
effectVariant: EffectVariant | -1 = -1,
|
|
383
383
|
subType = -1,
|
|
384
384
|
cap?: int,
|
|
385
385
|
): EntityEffect[] {
|
|
@@ -398,7 +398,7 @@ export function removeAllEffects(
|
|
|
398
398
|
* @returns An array of the familiars that were removed.
|
|
399
399
|
*/
|
|
400
400
|
export function removeAllFamiliars(
|
|
401
|
-
familiarVariant: FamiliarVariant = -1,
|
|
401
|
+
familiarVariant: FamiliarVariant | -1 = -1,
|
|
402
402
|
subType = -1,
|
|
403
403
|
cap?: int,
|
|
404
404
|
): EntityFamiliar[] {
|
|
@@ -417,7 +417,7 @@ export function removeAllFamiliars(
|
|
|
417
417
|
* @returns An array of the knives that were removed.
|
|
418
418
|
*/
|
|
419
419
|
export function removeAllKnives(
|
|
420
|
-
knifeVariant: KnifeVariant = -1,
|
|
420
|
+
knifeVariant: KnifeVariant | -1 = -1,
|
|
421
421
|
subType = -1,
|
|
422
422
|
cap?: int,
|
|
423
423
|
): EntityKnife[] {
|
|
@@ -436,7 +436,7 @@ export function removeAllKnives(
|
|
|
436
436
|
* @returns An array of the lasers that were removed.
|
|
437
437
|
*/
|
|
438
438
|
export function removeAllLasers(
|
|
439
|
-
laserVariant: LaserVariant = -1,
|
|
439
|
+
laserVariant: LaserVariant | -1 = -1,
|
|
440
440
|
subType = -1,
|
|
441
441
|
cap?: int,
|
|
442
442
|
): EntityLaser[] {
|
|
@@ -457,7 +457,7 @@ export function removeAllLasers(
|
|
|
457
457
|
* @returns An array of the NPCs that were removed.
|
|
458
458
|
*/
|
|
459
459
|
export function removeAllNPCs(
|
|
460
|
-
entityType: EntityType = -1,
|
|
460
|
+
entityType: EntityType | -1 = -1,
|
|
461
461
|
variant = -1,
|
|
462
462
|
subType = -1,
|
|
463
463
|
cap?: int,
|
|
@@ -477,7 +477,7 @@ export function removeAllNPCs(
|
|
|
477
477
|
* @returns An array of the pickups that were removed.
|
|
478
478
|
*/
|
|
479
479
|
export function removeAllPickups(
|
|
480
|
-
pickupVariant: PickupVariant = -1,
|
|
480
|
+
pickupVariant: PickupVariant | -1 = -1,
|
|
481
481
|
subType = -1,
|
|
482
482
|
cap?: int,
|
|
483
483
|
): EntityPickup[] {
|
|
@@ -496,7 +496,7 @@ export function removeAllPickups(
|
|
|
496
496
|
* @returns An array of the projectiles that were removed.
|
|
497
497
|
*/
|
|
498
498
|
export function removeAllProjectiles(
|
|
499
|
-
projectileVariant: ProjectileVariant = -1,
|
|
499
|
+
projectileVariant: ProjectileVariant | -1 = -1,
|
|
500
500
|
subType = -1,
|
|
501
501
|
cap?: int,
|
|
502
502
|
): EntityProjectile[] {
|
|
@@ -515,7 +515,7 @@ export function removeAllProjectiles(
|
|
|
515
515
|
* @returns An array of the slots that were removed.
|
|
516
516
|
*/
|
|
517
517
|
export function removeAllSlots(
|
|
518
|
-
slotVariant: SlotVariant = -1,
|
|
518
|
+
slotVariant: SlotVariant | -1 = -1,
|
|
519
519
|
subType = -1,
|
|
520
520
|
cap?: int,
|
|
521
521
|
): Entity[] {
|
|
@@ -534,7 +534,7 @@ export function removeAllSlots(
|
|
|
534
534
|
* @returns An array of the tears that were removed.
|
|
535
535
|
*/
|
|
536
536
|
export function removeAllTears(
|
|
537
|
-
tearVariant: TearVariant = -1,
|
|
537
|
+
tearVariant: TearVariant | -1 = -1,
|
|
538
538
|
subType = -1,
|
|
539
539
|
cap?: int,
|
|
540
540
|
): EntityTear[] {
|
|
@@ -24,7 +24,7 @@ import { asNumber } from "./types";
|
|
|
24
24
|
* variant. Default is -1, which matches every variant.
|
|
25
25
|
*/
|
|
26
26
|
export function getCrawlSpaces(
|
|
27
|
-
crawlSpaceVariant: CrawlSpaceVariant = -1,
|
|
27
|
+
crawlSpaceVariant: CrawlSpaceVariant | -1 = -1,
|
|
28
28
|
): GridEntity[] {
|
|
29
29
|
if (asNumber(crawlSpaceVariant) === -1) {
|
|
30
30
|
return getGridEntities(GridEntityType.CRAWL_SPACE);
|
|
@@ -42,7 +42,7 @@ export function getCrawlSpaces(
|
|
|
42
42
|
* @param pitVariant Optional. If specified, will only get the pits that match the variant. Default
|
|
43
43
|
* is -1, which matches every variant.
|
|
44
44
|
*/
|
|
45
|
-
export function getPits(pitVariant: PitVariant = -1): GridEntityPit[] {
|
|
45
|
+
export function getPits(pitVariant: PitVariant | -1 = -1): GridEntityPit[] {
|
|
46
46
|
const pits: GridEntityPit[] = [];
|
|
47
47
|
for (const gridEntity of getGridEntities()) {
|
|
48
48
|
const pit = gridEntity.ToPit();
|
|
@@ -64,7 +64,7 @@ export function getPits(pitVariant: PitVariant = -1): GridEntityPit[] {
|
|
|
64
64
|
* Default is -1, which matches every variant.
|
|
65
65
|
*/
|
|
66
66
|
export function getPoops(
|
|
67
|
-
poopVariant: PoopGridEntityVariant = -1,
|
|
67
|
+
poopVariant: PoopGridEntityVariant | -1 = -1,
|
|
68
68
|
): GridEntityPoop[] {
|
|
69
69
|
const poops: GridEntityPoop[] = [];
|
|
70
70
|
for (const gridEntity of getGridEntities()) {
|
|
@@ -87,7 +87,7 @@ export function getPoops(
|
|
|
87
87
|
* the variant. Default is -1, which matches every variant.
|
|
88
88
|
*/
|
|
89
89
|
export function getPressurePlates(
|
|
90
|
-
pressurePlateVariant: PressurePlateVariant = -1,
|
|
90
|
+
pressurePlateVariant: PressurePlateVariant | -1 = -1,
|
|
91
91
|
): GridEntityPressurePlate[] {
|
|
92
92
|
const pressurePlates: GridEntityPressurePlate[] = [];
|
|
93
93
|
for (const gridEntity of getGridEntities()) {
|
|
@@ -184,7 +184,7 @@ export function getTeleporters(variant = -1): GridEntity[] {
|
|
|
184
184
|
* variant. Default is -1, which matches every variant.
|
|
185
185
|
*/
|
|
186
186
|
export function getTrapdoors(
|
|
187
|
-
trapdoorVariant: TrapdoorVariant = -1,
|
|
187
|
+
trapdoorVariant: TrapdoorVariant | -1 = -1,
|
|
188
188
|
): GridEntity[] {
|
|
189
189
|
if (asNumber(trapdoorVariant) === -1) {
|
|
190
190
|
return getGridEntities(GridEntityType.TRAPDOOR);
|
|
@@ -205,7 +205,7 @@ export function getTrapdoors(
|
|
|
205
205
|
* @returns The crawl spaces that were removed.
|
|
206
206
|
*/
|
|
207
207
|
export function removeAllCrawlSpaces(
|
|
208
|
-
crawlSpaceVariant: CrawlSpaceVariant = -1,
|
|
208
|
+
crawlSpaceVariant: CrawlSpaceVariant | -1 = -1,
|
|
209
209
|
updateRoom = false,
|
|
210
210
|
cap?: int,
|
|
211
211
|
): GridEntity[] {
|
|
@@ -228,7 +228,7 @@ export function removeAllCrawlSpaces(
|
|
|
228
228
|
* @returns The pits that were removed.
|
|
229
229
|
*/
|
|
230
230
|
export function removeAllPits(
|
|
231
|
-
pitVariant: PitVariant = -1,
|
|
231
|
+
pitVariant: PitVariant | -1 = -1,
|
|
232
232
|
updateRoom = false,
|
|
233
233
|
cap?: int,
|
|
234
234
|
): GridEntityPit[] {
|
|
@@ -251,7 +251,7 @@ export function removeAllPits(
|
|
|
251
251
|
* @returns The poops that were removed.
|
|
252
252
|
*/
|
|
253
253
|
export function removeAllPoops(
|
|
254
|
-
poopVariant: PoopGridEntityVariant = -1,
|
|
254
|
+
poopVariant: PoopGridEntityVariant | -1 = -1,
|
|
255
255
|
updateRoom = false,
|
|
256
256
|
cap?: int,
|
|
257
257
|
): GridEntityPoop[] {
|
|
@@ -271,7 +271,7 @@ export function removeAllPoops(
|
|
|
271
271
|
* @returns The pressure plates that were removed.
|
|
272
272
|
*/
|
|
273
273
|
export function removeAllPressurePlates(
|
|
274
|
-
pressurePlateVariant: PressurePlateVariant = -1,
|
|
274
|
+
pressurePlateVariant: PressurePlateVariant | -1 = -1,
|
|
275
275
|
updateRoom = false,
|
|
276
276
|
cap?: int,
|
|
277
277
|
): GridEntityPressurePlate[] {
|
|
@@ -373,7 +373,7 @@ export function removeAllTeleporters(
|
|
|
373
373
|
* @returns The trapdoors that were removed.
|
|
374
374
|
*/
|
|
375
375
|
export function removeAllTrapdoors(
|
|
376
|
-
trapdoorVariant: TrapdoorVariant = -1,
|
|
376
|
+
trapdoorVariant: TrapdoorVariant | -1 = -1,
|
|
377
377
|
updateRoom = false,
|
|
378
378
|
cap?: int,
|
|
379
379
|
): GridEntity[] {
|
|
@@ -36,8 +36,8 @@ import {
|
|
|
36
36
|
getRoomGridIndex,
|
|
37
37
|
getRoomShape,
|
|
38
38
|
} from "./roomData";
|
|
39
|
-
import { getRooms, getRoomsInsideGrid, isSecretRoomType } from "./rooms";
|
|
40
39
|
import { getGridIndexDelta } from "./roomShape";
|
|
40
|
+
import { getRooms, getRoomsInsideGrid, isSecretRoomType } from "./rooms";
|
|
41
41
|
import { asNumber } from "./types";
|
|
42
42
|
|
|
43
43
|
const LEFT = -1;
|
package/src/functions/npcs.ts
CHANGED
|
@@ -63,7 +63,7 @@ const NON_ALIVE_NPCS_TYPE_VARIANT_SUB_TYPE = new ReadonlySet<string>([
|
|
|
63
63
|
* @param ignoreFriendly Optional. Default is false.
|
|
64
64
|
*/
|
|
65
65
|
export function getAliveNPCs(
|
|
66
|
-
entityType: EntityType = -1,
|
|
66
|
+
entityType: EntityType | -1 = -1,
|
|
67
67
|
variant = -1,
|
|
68
68
|
subType = -1,
|
|
69
69
|
ignoreFriendly = false,
|
package/src/functions/pickups.ts
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
import { CHEST_PICKUP_VARIANTS } from "../sets/chestPickupVariantsSet";
|
|
7
7
|
import { RED_HEART_SUB_TYPES_SET } from "../sets/redHeartSubTypesSet";
|
|
8
8
|
import { removeEntities } from "./entities";
|
|
9
|
-
import { getHearts } from "./pickupsSpecific";
|
|
10
9
|
import { isHeart } from "./pickupVariants";
|
|
10
|
+
import { getHearts } from "./pickupsSpecific";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Helper function to get the corresponding coin amount from a `CoinSubType`. Returns 1 for modded
|
|
@@ -21,7 +21,7 @@ import { getPickups, removeAllPickups, spawnPickup } from "./entitiesSpecific";
|
|
|
21
21
|
* sub-type. Default is -1, which matches every sub-type.
|
|
22
22
|
*/
|
|
23
23
|
export function getBatteries(
|
|
24
|
-
batterySubType: BatterySubType = -1,
|
|
24
|
+
batterySubType: BatterySubType | -1 = -1,
|
|
25
25
|
): EntityPickupBattery[] {
|
|
26
26
|
return getPickups(
|
|
27
27
|
PickupVariant.LIL_BATTERY,
|
|
@@ -37,7 +37,7 @@ export function getBatteries(
|
|
|
37
37
|
* Default is -1, which matches every sub-type.
|
|
38
38
|
*/
|
|
39
39
|
export function getBombPickups(
|
|
40
|
-
bombSubType: BombSubType = -1,
|
|
40
|
+
bombSubType: BombSubType | -1 = -1,
|
|
41
41
|
): EntityPickupBomb[] {
|
|
42
42
|
return getPickups(PickupVariant.BOMB, bombSubType) as EntityPickupBomb[];
|
|
43
43
|
}
|
|
@@ -48,7 +48,7 @@ export function getBombPickups(
|
|
|
48
48
|
* @param cardType Optional. If specified, will only get the cards that match the sub-type. Default
|
|
49
49
|
* is -1, which matches every sub-type.
|
|
50
50
|
*/
|
|
51
|
-
export function getCards(cardType: CardType = -1): EntityPickupCard[] {
|
|
51
|
+
export function getCards(cardType: CardType | -1 = -1): EntityPickupCard[] {
|
|
52
52
|
return getPickups(PickupVariant.TAROT_CARD, cardType) as EntityPickupCard[];
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -58,7 +58,9 @@ export function getCards(cardType: CardType = -1): EntityPickupCard[] {
|
|
|
58
58
|
* @param coinSubType Optional. If specified, will only get the coins that match the sub-type.
|
|
59
59
|
* Default is -1, which matches every sub-type.
|
|
60
60
|
*/
|
|
61
|
-
export function getCoins(
|
|
61
|
+
export function getCoins(
|
|
62
|
+
coinSubType: CoinSubType | -1 = -1,
|
|
63
|
+
): EntityPickupCoin[] {
|
|
62
64
|
return getPickups(PickupVariant.COIN, coinSubType) as EntityPickupCoin[];
|
|
63
65
|
}
|
|
64
66
|
|
|
@@ -69,7 +71,7 @@ export function getCoins(coinSubType: CoinSubType = -1): EntityPickupCoin[] {
|
|
|
69
71
|
* sub-type. Default is -1, which matches every sub-type.
|
|
70
72
|
*/
|
|
71
73
|
export function getCollectibles(
|
|
72
|
-
collectibleType: CollectibleType = -1,
|
|
74
|
+
collectibleType: CollectibleType | -1 = -1,
|
|
73
75
|
): EntityPickupCollectible[] {
|
|
74
76
|
return getPickups(
|
|
75
77
|
PickupVariant.COLLECTIBLE,
|
|
@@ -84,7 +86,7 @@ export function getCollectibles(
|
|
|
84
86
|
* Default is -1, which matches every sub-type.
|
|
85
87
|
*/
|
|
86
88
|
export function getHearts(
|
|
87
|
-
heartSubType: HeartSubType = -1,
|
|
89
|
+
heartSubType: HeartSubType | -1 = -1,
|
|
88
90
|
): EntityPickupHeart[] {
|
|
89
91
|
return getPickups(PickupVariant.HEART, heartSubType) as EntityPickupHeart[];
|
|
90
92
|
}
|
|
@@ -95,7 +97,7 @@ export function getHearts(
|
|
|
95
97
|
* @param keySubType Optional. If specified, will only get the keys that match the sub-type. Default
|
|
96
98
|
* is -1, which matches every sub-type.
|
|
97
99
|
*/
|
|
98
|
-
export function getKeys(keySubType: KeySubType = -1): EntityPickupKey[] {
|
|
100
|
+
export function getKeys(keySubType: KeySubType | -1 = -1): EntityPickupKey[] {
|
|
99
101
|
return getPickups(PickupVariant.KEY, keySubType) as EntityPickupKey[];
|
|
100
102
|
}
|
|
101
103
|
|
|
@@ -105,7 +107,7 @@ export function getKeys(keySubType: KeySubType = -1): EntityPickupKey[] {
|
|
|
105
107
|
* @param pillColor Optional. If specified, will only get the pills that match the sub-type. Default
|
|
106
108
|
* is -1, which matches every sub-type.
|
|
107
109
|
*/
|
|
108
|
-
export function getPills(pillColor: PillColor = -1): EntityPickupPill[] {
|
|
110
|
+
export function getPills(pillColor: PillColor | -1 = -1): EntityPickupPill[] {
|
|
109
111
|
return getPickups(PickupVariant.PILL, pillColor) as EntityPickupPill[];
|
|
110
112
|
}
|
|
111
113
|
|
|
@@ -115,7 +117,9 @@ export function getPills(pillColor: PillColor = -1): EntityPickupPill[] {
|
|
|
115
117
|
* @param sackSubType Optional. If specified, will only get the sacks that match the sub-type.
|
|
116
118
|
* Default is -1, which matches every sub-type.
|
|
117
119
|
*/
|
|
118
|
-
export function getSacks(
|
|
120
|
+
export function getSacks(
|
|
121
|
+
sackSubType: SackSubType | -1 = -1,
|
|
122
|
+
): EntityPickupSack[] {
|
|
119
123
|
return getPickups(PickupVariant.SACK, sackSubType) as EntityPickupSack[];
|
|
120
124
|
}
|
|
121
125
|
|
|
@@ -126,7 +130,7 @@ export function getSacks(sackSubType: SackSubType = -1): EntityPickupSack[] {
|
|
|
126
130
|
* Default is -1, which matches every sub-type.
|
|
127
131
|
*/
|
|
128
132
|
export function getTrinkets(
|
|
129
|
-
trinketType: TrinketType = -1,
|
|
133
|
+
trinketType: TrinketType | -1 = -1,
|
|
130
134
|
): EntityPickupTrinket[] {
|
|
131
135
|
return getPickups(
|
|
132
136
|
PickupVariant.TRINKET,
|
|
@@ -143,7 +147,7 @@ export function getTrinkets(
|
|
|
143
147
|
* @returns The batteries that were removed.
|
|
144
148
|
*/
|
|
145
149
|
export function removeAllBatteries(
|
|
146
|
-
batterySubType: BatterySubType = -1,
|
|
150
|
+
batterySubType: BatterySubType | -1 = -1,
|
|
147
151
|
cap?: int,
|
|
148
152
|
): EntityPickupBattery[] {
|
|
149
153
|
return removeAllPickups(
|
|
@@ -163,7 +167,7 @@ export function removeAllBatteries(
|
|
|
163
167
|
* @returns The bombs that were removed.
|
|
164
168
|
*/
|
|
165
169
|
export function removeAllBombPickups(
|
|
166
|
-
bombSubType: BombSubType = -1,
|
|
170
|
+
bombSubType: BombSubType | -1 = -1,
|
|
167
171
|
cap?: int,
|
|
168
172
|
): EntityPickupBomb[] {
|
|
169
173
|
return removeAllPickups(
|
|
@@ -182,7 +186,7 @@ export function removeAllBombPickups(
|
|
|
182
186
|
* @returns The cards that were removed.
|
|
183
187
|
*/
|
|
184
188
|
export function removeAllCards(
|
|
185
|
-
cardType: CardType = -1,
|
|
189
|
+
cardType: CardType | -1 = -1,
|
|
186
190
|
cap?: int,
|
|
187
191
|
): EntityPickupCard[] {
|
|
188
192
|
return removeAllPickups(
|
package/src/functions/pills.ts
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
LAST_NORMAL_PILL_COLOR,
|
|
15
15
|
LAST_VANILLA_PILL_EFFECT,
|
|
16
16
|
} from "../core/constantsFirstLast";
|
|
17
|
-
import { FALSE_PHD_PILL_CONVERSIONS } from "../maps/falsePHDPillConversions";
|
|
18
17
|
import { PHD_PILL_CONVERSIONS } from "../maps/PHDPillConversions";
|
|
18
|
+
import { FALSE_PHD_PILL_CONVERSIONS } from "../maps/falsePHDPillConversions";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_PILL_EFFECT_CLASS,
|
|
21
21
|
PILL_EFFECT_CLASSES,
|
|
@@ -115,7 +115,7 @@ export function getRoomListIndex(roomGridIndex?: int): int {
|
|
|
115
115
|
* Helper function to get the name of the room as it appears in the STB/XML data.
|
|
116
116
|
*
|
|
117
117
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
118
|
-
* @returns The room name. Returns "Unknown" if the
|
|
118
|
+
* @returns The room name. Returns "Unknown" if the room data was not found.
|
|
119
119
|
*/
|
|
120
120
|
export function getRoomName(roomGridIndex?: int): string {
|
|
121
121
|
const roomData = getRoomData(roomGridIndex);
|
|
@@ -126,7 +126,7 @@ export function getRoomName(roomGridIndex?: int): string {
|
|
|
126
126
|
* Helper function to get the name of the room as it appears in the STB/XML data.
|
|
127
127
|
*
|
|
128
128
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
129
|
-
* @returns The room name. Returns "Unknown"
|
|
129
|
+
* @returns The room name. Returns "Unknown"if the room data was not found.
|
|
130
130
|
*/
|
|
131
131
|
export function getRoomShape(roomGridIndex?: int): RoomShape | undefined {
|
|
132
132
|
const roomData = getRoomData(roomGridIndex);
|
|
@@ -139,9 +139,9 @@ export function getRoomShape(roomGridIndex?: int): RoomShape | undefined {
|
|
|
139
139
|
* would have a stage ID of 7.
|
|
140
140
|
*
|
|
141
141
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
142
|
-
* @returns The room stage ID. Returns -1 if the
|
|
142
|
+
* @returns The room stage ID. Returns -1 if the room data was not found.
|
|
143
143
|
*/
|
|
144
|
-
export function getRoomStageID(roomGridIndex?: int): StageID {
|
|
144
|
+
export function getRoomStageID(roomGridIndex?: int): StageID | -1 {
|
|
145
145
|
const roomData = getRoomData(roomGridIndex);
|
|
146
146
|
return roomData === undefined ? -1 : roomData.StageID;
|
|
147
147
|
}
|
|
@@ -153,7 +153,7 @@ export function getRoomStageID(roomGridIndex?: int): StageID {
|
|
|
153
153
|
* Room and a sub-type of 1 will correspond to an Angel Room shop for The Stairway.
|
|
154
154
|
*
|
|
155
155
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
156
|
-
* @returns The room sub-type. Returns -1 if the
|
|
156
|
+
* @returns The room sub-type. Returns -1 if the room data was not found.
|
|
157
157
|
*/
|
|
158
158
|
export function getRoomSubType(roomGridIndex?: int): int {
|
|
159
159
|
const roomData = getRoomData(roomGridIndex);
|
|
@@ -164,9 +164,9 @@ export function getRoomSubType(roomGridIndex?: int): int {
|
|
|
164
164
|
* Helper function for getting the type of the room with the given grid index.
|
|
165
165
|
*
|
|
166
166
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
167
|
-
* @returns The room data type. Returns -1 if the
|
|
167
|
+
* @returns The room data type. Returns -1 if the room data was not found.
|
|
168
168
|
*/
|
|
169
|
-
export function getRoomType(roomGridIndex?: int): RoomType {
|
|
169
|
+
export function getRoomType(roomGridIndex?: int): RoomType | -1 {
|
|
170
170
|
const roomData = getRoomData(roomGridIndex);
|
|
171
171
|
return roomData === undefined ? -1 : roomData.Type;
|
|
172
172
|
}
|
|
@@ -177,7 +177,7 @@ export function getRoomType(roomGridIndex?: int): RoomType {
|
|
|
177
177
|
* command of `goto d.123` while on the Basement.
|
|
178
178
|
*
|
|
179
179
|
* @param roomGridIndex Optional. Default is the current room index.
|
|
180
|
-
* @returns The room variant. Returns -1 if the
|
|
180
|
+
* @returns The room variant. Returns -1 if the room data was not found.
|
|
181
181
|
*/
|
|
182
182
|
export function getRoomVariant(roomGridIndex?: int): int {
|
|
183
183
|
const roomData = getRoomData(roomGridIndex);
|
|
@@ -5,8 +5,8 @@ import { CornerType } from "../enums/CornerType";
|
|
|
5
5
|
import { Corner } from "../interfaces/Corner";
|
|
6
6
|
import { ReadonlySet } from "../types/ReadonlySet";
|
|
7
7
|
import { getGridIndexesBetween } from "./gridIndex";
|
|
8
|
-
import { inBossRoomOf, inHomeCloset } from "./rooms";
|
|
9
8
|
import { getRoomShapeCorners, isLRoom } from "./roomShape";
|
|
9
|
+
import { inBossRoomOf, inHomeCloset } from "./rooms";
|
|
10
10
|
|
|
11
11
|
const ROOM_SHAPE_TO_WALL_GRID_INDEX_SET: ReadonlyMap<
|
|
12
12
|
RoomShape,
|
|
@@ -2,10 +2,10 @@ import { CopyableIsaacAPIClassType } from "isaac-typescript-definitions";
|
|
|
2
2
|
import { ISAAC_API_CLASS_TYPE_TO_BRAND } from "../objects/isaacAPIClassTypeToBrand";
|
|
3
3
|
import {
|
|
4
4
|
CopyableIsaacAPIClass,
|
|
5
|
+
ISAAC_API_CLASS_TYPE_TO_FUNCTIONS,
|
|
5
6
|
IsaacAPIClassTypeFunctions,
|
|
6
7
|
IsaacAPIClassTypeToSerializedType,
|
|
7
8
|
IsaacAPIClassTypeToType,
|
|
8
|
-
ISAAC_API_CLASS_TYPE_TO_FUNCTIONS,
|
|
9
9
|
SerializedIsaacAPIClass,
|
|
10
10
|
} from "../objects/isaacAPIClassTypeToFunctions";
|
|
11
11
|
import { getIsaacAPIClassName } from "./isaacAPIClass";
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
PlayerType,
|
|
5
5
|
} from "isaac-typescript-definitions";
|
|
6
6
|
import { VectorZero } from "../core/constants";
|
|
7
|
-
import { setCollectibleEmpty } from "./collectibles";
|
|
8
7
|
import { isQuestCollectible } from "./collectibleTag";
|
|
8
|
+
import { setCollectibleEmpty } from "./collectibles";
|
|
9
9
|
import { spawnPickupWithSeed } from "./entitiesSpecific";
|
|
10
10
|
import { anyPlayerIs } from "./players";
|
|
11
11
|
import { getRandomSeed, isRNG } from "./rng";
|
package/src/functions/vector.ts
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "isaac-typescript-definitions";
|
|
5
5
|
import { SerializationBrand } from "../enums/private/SerializationBrand";
|
|
6
6
|
import { angleToDirection } from "./direction";
|
|
7
|
-
import {
|
|
7
|
+
import { isIsaacAPIClassOfType, isaacAPIClassEquals } from "./isaacAPIClass";
|
|
8
8
|
import { getRandomFloat } from "./random";
|
|
9
9
|
import { getRandomSeed, isRNG, newRNG } from "./rng";
|
|
10
10
|
import {
|
package/src/index.ts
CHANGED
|
@@ -31,8 +31,8 @@ export * from "./functions/challenges";
|
|
|
31
31
|
export * from "./functions/characters";
|
|
32
32
|
export * from "./functions/charge";
|
|
33
33
|
export * from "./functions/chargeBar";
|
|
34
|
-
export * from "./functions/collectibles";
|
|
35
34
|
export * from "./functions/collectibleTag";
|
|
35
|
+
export * from "./functions/collectibles";
|
|
36
36
|
export * from "./functions/color";
|
|
37
37
|
export * from "./functions/console";
|
|
38
38
|
export * from "./functions/curses";
|
|
@@ -78,16 +78,16 @@ export * from "./functions/minimap";
|
|
|
78
78
|
export * from "./functions/modFeatures";
|
|
79
79
|
export * from "./functions/nextStage";
|
|
80
80
|
export * from "./functions/npcs";
|
|
81
|
+
export * from "./functions/pickupVariants";
|
|
81
82
|
export * from "./functions/pickups";
|
|
82
83
|
export * from "./functions/pickupsSpecific";
|
|
83
|
-
export * from "./functions/pickupVariants";
|
|
84
84
|
export * from "./functions/pills";
|
|
85
85
|
export * from "./functions/playerCenter";
|
|
86
86
|
export * from "./functions/playerDataStructures";
|
|
87
87
|
export * from "./functions/playerHealth";
|
|
88
88
|
export * from "./functions/playerIndex";
|
|
89
|
-
export * from "./functions/players";
|
|
90
89
|
export * from "./functions/playerStats";
|
|
90
|
+
export * from "./functions/players";
|
|
91
91
|
export * from "./functions/pocketItems";
|
|
92
92
|
export * from "./functions/positionVelocity";
|
|
93
93
|
export * from "./functions/pressurePlate";
|
|
@@ -99,10 +99,10 @@ export * from "./functions/rng";
|
|
|
99
99
|
export * from "./functions/rockAlt";
|
|
100
100
|
export * from "./functions/roomData";
|
|
101
101
|
export * from "./functions/roomGrid";
|
|
102
|
-
export * from "./functions/rooms";
|
|
103
102
|
export * from "./functions/roomShape";
|
|
104
103
|
export * from "./functions/roomShapeWalls";
|
|
105
104
|
export * from "./functions/roomTransition";
|
|
105
|
+
export * from "./functions/rooms";
|
|
106
106
|
export * from "./functions/run";
|
|
107
107
|
export * from "./functions/seeds";
|
|
108
108
|
export * from "./functions/serialization";
|
|
@@ -137,8 +137,8 @@ export * from "./interfaces/RoomDescription";
|
|
|
137
137
|
export * from "./interfaces/SaveData";
|
|
138
138
|
export * from "./interfaces/StageHistoryEntry";
|
|
139
139
|
export * from "./interfaces/StatTypeType";
|
|
140
|
-
export * from "./interfaces/TrinketSituation";
|
|
141
140
|
export * from "./interfaces/TSTLClassMetatable";
|
|
141
|
+
export * from "./interfaces/TrinketSituation";
|
|
142
142
|
export * from "./maps/cardNameToTypeMap";
|
|
143
143
|
export * from "./maps/characterNameToTypeMap";
|
|
144
144
|
export * from "./maps/pillNameToEffectMap";
|