isaacscript-common 17.2.1 → 17.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.
Files changed (38) hide show
  1. package/dist/index.d.ts +67 -55
  2. package/dist/isaacscript-common.lua +124 -110
  3. package/dist/src/classes/features/other/CustomHotkeys.d.ts +4 -0
  4. package/dist/src/classes/features/other/CustomHotkeys.d.ts.map +1 -1
  5. package/dist/src/classes/features/other/SpawnCollectible.d.ts +4 -4
  6. package/dist/src/classes/features/other/SpawnCollectible.d.ts.map +1 -1
  7. package/dist/src/classes/features/other/SpawnCollectible.lua +4 -4
  8. package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts +3 -2
  9. package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts.map +1 -1
  10. package/dist/src/classes/features/other/SpawnRockAltRewards.lua +4 -1
  11. package/dist/src/functions/bosses.d.ts +2 -2
  12. package/dist/src/functions/bosses.d.ts.map +1 -1
  13. package/dist/src/functions/bosses.lua +5 -5
  14. package/dist/src/functions/entities.d.ts +5 -5
  15. package/dist/src/functions/entities.d.ts.map +1 -1
  16. package/dist/src/functions/entities.lua +10 -8
  17. package/dist/src/functions/entitiesSpecific.d.ts +20 -20
  18. package/dist/src/functions/entitiesSpecific.d.ts.map +1 -1
  19. package/dist/src/functions/entitiesSpecific.lua +40 -40
  20. package/dist/src/functions/pickupsSpecific.d.ts +18 -18
  21. package/dist/src/functions/pickupsSpecific.d.ts.map +1 -1
  22. package/dist/src/functions/pickupsSpecific.lua +36 -36
  23. package/dist/src/functions/players.d.ts +7 -0
  24. package/dist/src/functions/players.d.ts.map +1 -1
  25. package/dist/src/functions/players.lua +26 -13
  26. package/dist/src/functions/spawnCollectible.d.ts +4 -4
  27. package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
  28. package/dist/src/functions/spawnCollectible.lua +6 -6
  29. package/package.json +2 -2
  30. package/src/classes/features/other/CustomHotkeys.ts +4 -0
  31. package/src/classes/features/other/SpawnCollectible.ts +6 -6
  32. package/src/classes/features/other/SpawnRockAltRewards.ts +7 -3
  33. package/src/functions/bosses.ts +13 -5
  34. package/src/functions/entities.ts +14 -8
  35. package/src/functions/entitiesSpecific.ts +40 -40
  36. package/src/functions/pickupsSpecific.ts +84 -36
  37. package/src/functions/players.ts +21 -0
  38. package/src/functions/spawnCollectible.ts +6 -6
@@ -209,7 +209,7 @@ function ____exports.removeAllTrinkets(self, trinketType, cap)
209
209
  return removeAllPickups(nil, PickupVariant.TRINKET, trinketType, cap)
210
210
  end
211
211
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90).
212
- function ____exports.spawnBattery(self, batterySubType, position, velocity, spawner, seedOrRNG)
212
+ function ____exports.spawnBattery(self, batterySubType, positionOrGridIndex, velocity, spawner, seedOrRNG)
213
213
  if velocity == nil then
214
214
  velocity = VectorZero
215
215
  end
@@ -223,7 +223,7 @@ function ____exports.spawnBattery(self, batterySubType, position, velocity, spaw
223
223
  nil,
224
224
  PickupVariant.LIL_BATTERY,
225
225
  batterySubType,
226
- position,
226
+ positionOrGridIndex,
227
227
  velocity,
228
228
  spawner,
229
229
  seedOrRNG
@@ -231,7 +231,7 @@ function ____exports.spawnBattery(self, batterySubType, position, velocity, spaw
231
231
  end
232
232
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.LIL_BATTERY` (90)
233
233
  -- and a specific seed.
234
- function ____exports.spawnBatteryWithSeed(self, batterySubType, position, seedOrRNG, velocity, spawner)
234
+ function ____exports.spawnBatteryWithSeed(self, batterySubType, positionOrGridIndex, seedOrRNG, velocity, spawner)
235
235
  if velocity == nil then
236
236
  velocity = VectorZero
237
237
  end
@@ -241,14 +241,14 @@ function ____exports.spawnBatteryWithSeed(self, batterySubType, position, seedOr
241
241
  return ____exports.spawnBattery(
242
242
  nil,
243
243
  batterySubType,
244
- position,
244
+ positionOrGridIndex,
245
245
  velocity,
246
246
  spawner,
247
247
  seedOrRNG
248
248
  )
249
249
  end
250
250
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40).
251
- function ____exports.spawnBombPickup(self, bombSubType, position, velocity, spawner, seedOrRNG)
251
+ function ____exports.spawnBombPickup(self, bombSubType, positionOrGridIndex, velocity, spawner, seedOrRNG)
252
252
  if velocity == nil then
253
253
  velocity = VectorZero
254
254
  end
@@ -262,7 +262,7 @@ function ____exports.spawnBombPickup(self, bombSubType, position, velocity, spaw
262
262
  nil,
263
263
  PickupVariant.BOMB,
264
264
  bombSubType,
265
- position,
265
+ positionOrGridIndex,
266
266
  velocity,
267
267
  spawner,
268
268
  seedOrRNG
@@ -270,7 +270,7 @@ function ____exports.spawnBombPickup(self, bombSubType, position, velocity, spaw
270
270
  end
271
271
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.BOMB` (40) and a
272
272
  -- specific seed.
273
- function ____exports.spawnBombPickupWithSeed(self, bombSubType, position, seedOrRNG, velocity, spawner)
273
+ function ____exports.spawnBombPickupWithSeed(self, bombSubType, positionOrGridIndex, seedOrRNG, velocity, spawner)
274
274
  if velocity == nil then
275
275
  velocity = VectorZero
276
276
  end
@@ -280,14 +280,14 @@ function ____exports.spawnBombPickupWithSeed(self, bombSubType, position, seedOr
280
280
  return ____exports.spawnBombPickup(
281
281
  nil,
282
282
  bombSubType,
283
- position,
283
+ positionOrGridIndex,
284
284
  velocity,
285
285
  spawner,
286
286
  seedOrRNG
287
287
  )
288
288
  end
289
289
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300).
290
- function ____exports.spawnCard(self, cardType, position, velocity, spawner, seedOrRNG)
290
+ function ____exports.spawnCard(self, cardType, positionOrGridIndex, velocity, spawner, seedOrRNG)
291
291
  if velocity == nil then
292
292
  velocity = VectorZero
293
293
  end
@@ -301,7 +301,7 @@ function ____exports.spawnCard(self, cardType, position, velocity, spawner, seed
301
301
  nil,
302
302
  PickupVariant.TAROT_CARD,
303
303
  cardType,
304
- position,
304
+ positionOrGridIndex,
305
305
  velocity,
306
306
  spawner,
307
307
  seedOrRNG
@@ -309,7 +309,7 @@ function ____exports.spawnCard(self, cardType, position, velocity, spawner, seed
309
309
  end
310
310
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TAROT_CARD` (300)
311
311
  -- and a specific seed.
312
- function ____exports.spawnCardWithSeed(self, cardType, position, seedOrRNG, velocity, spawner)
312
+ function ____exports.spawnCardWithSeed(self, cardType, positionOrGridIndex, seedOrRNG, velocity, spawner)
313
313
  if velocity == nil then
314
314
  velocity = VectorZero
315
315
  end
@@ -319,14 +319,14 @@ function ____exports.spawnCardWithSeed(self, cardType, position, seedOrRNG, velo
319
319
  return ____exports.spawnCard(
320
320
  nil,
321
321
  cardType,
322
- position,
322
+ positionOrGridIndex,
323
323
  velocity,
324
324
  spawner,
325
325
  seedOrRNG
326
326
  )
327
327
  end
328
328
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20).
329
- function ____exports.spawnCoin(self, coinSubType, position, velocity, spawner, seedOrRNG)
329
+ function ____exports.spawnCoin(self, coinSubType, positionOrGridIndex, velocity, spawner, seedOrRNG)
330
330
  if velocity == nil then
331
331
  velocity = VectorZero
332
332
  end
@@ -340,7 +340,7 @@ function ____exports.spawnCoin(self, coinSubType, position, velocity, spawner, s
340
340
  nil,
341
341
  PickupVariant.COIN,
342
342
  coinSubType,
343
- position,
343
+ positionOrGridIndex,
344
344
  velocity,
345
345
  spawner,
346
346
  seedOrRNG
@@ -348,7 +348,7 @@ function ____exports.spawnCoin(self, coinSubType, position, velocity, spawner, s
348
348
  end
349
349
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.COIN` (20) and a
350
350
  -- specific seed.
351
- function ____exports.spawnCoinWithSeed(self, coinSubType, position, seedOrRNG, velocity, spawner)
351
+ function ____exports.spawnCoinWithSeed(self, coinSubType, positionOrGridIndex, seedOrRNG, velocity, spawner)
352
352
  if velocity == nil then
353
353
  velocity = VectorZero
354
354
  end
@@ -358,14 +358,14 @@ function ____exports.spawnCoinWithSeed(self, coinSubType, position, seedOrRNG, v
358
358
  return ____exports.spawnCoin(
359
359
  nil,
360
360
  coinSubType,
361
- position,
361
+ positionOrGridIndex,
362
362
  velocity,
363
363
  spawner,
364
364
  seedOrRNG
365
365
  )
366
366
  end
367
367
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.HEART` (10).
368
- function ____exports.spawnHeart(self, heartSubType, position, velocity, spawner, seedOrRNG)
368
+ function ____exports.spawnHeart(self, heartSubType, positionOrGridIndex, velocity, spawner, seedOrRNG)
369
369
  if velocity == nil then
370
370
  velocity = VectorZero
371
371
  end
@@ -379,13 +379,13 @@ function ____exports.spawnHeart(self, heartSubType, position, velocity, spawner,
379
379
  nil,
380
380
  PickupVariant.HEART,
381
381
  heartSubType,
382
- position,
382
+ positionOrGridIndex,
383
383
  velocity,
384
384
  spawner,
385
385
  seedOrRNG
386
386
  )
387
387
  end
388
- function ____exports.spawnHeartWithSeed(self, heartSubType, position, seedOrRNG, velocity, spawner)
388
+ function ____exports.spawnHeartWithSeed(self, heartSubType, positionOrGridIndex, seedOrRNG, velocity, spawner)
389
389
  if velocity == nil then
390
390
  velocity = VectorZero
391
391
  end
@@ -395,14 +395,14 @@ function ____exports.spawnHeartWithSeed(self, heartSubType, position, seedOrRNG,
395
395
  return ____exports.spawnHeart(
396
396
  nil,
397
397
  heartSubType,
398
- position,
398
+ positionOrGridIndex,
399
399
  velocity,
400
400
  spawner,
401
401
  seedOrRNG
402
402
  )
403
403
  end
404
404
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30).
405
- function ____exports.spawnKey(self, keySubType, position, velocity, spawner, seedOrRNG)
405
+ function ____exports.spawnKey(self, keySubType, positionOrGridIndex, velocity, spawner, seedOrRNG)
406
406
  if velocity == nil then
407
407
  velocity = VectorZero
408
408
  end
@@ -416,7 +416,7 @@ function ____exports.spawnKey(self, keySubType, position, velocity, spawner, see
416
416
  nil,
417
417
  PickupVariant.KEY,
418
418
  keySubType,
419
- position,
419
+ positionOrGridIndex,
420
420
  velocity,
421
421
  spawner,
422
422
  seedOrRNG
@@ -424,7 +424,7 @@ function ____exports.spawnKey(self, keySubType, position, velocity, spawner, see
424
424
  end
425
425
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.KEY` (30) and a
426
426
  -- specific seed.
427
- function ____exports.spawnKeyWithSeed(self, keySubType, position, seedOrRNG, velocity, spawner)
427
+ function ____exports.spawnKeyWithSeed(self, keySubType, positionOrGridIndex, seedOrRNG, velocity, spawner)
428
428
  if velocity == nil then
429
429
  velocity = VectorZero
430
430
  end
@@ -434,14 +434,14 @@ function ____exports.spawnKeyWithSeed(self, keySubType, position, seedOrRNG, vel
434
434
  return ____exports.spawnKey(
435
435
  nil,
436
436
  keySubType,
437
- position,
437
+ positionOrGridIndex,
438
438
  velocity,
439
439
  spawner,
440
440
  seedOrRNG
441
441
  )
442
442
  end
443
443
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70).
444
- function ____exports.spawnPill(self, pillColor, position, velocity, spawner, seedOrRNG)
444
+ function ____exports.spawnPill(self, pillColor, positionOrGridIndex, velocity, spawner, seedOrRNG)
445
445
  if velocity == nil then
446
446
  velocity = VectorZero
447
447
  end
@@ -455,7 +455,7 @@ function ____exports.spawnPill(self, pillColor, position, velocity, spawner, see
455
455
  nil,
456
456
  PickupVariant.PILL,
457
457
  pillColor,
458
- position,
458
+ positionOrGridIndex,
459
459
  velocity,
460
460
  spawner,
461
461
  seedOrRNG
@@ -463,7 +463,7 @@ function ____exports.spawnPill(self, pillColor, position, velocity, spawner, see
463
463
  end
464
464
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.PILL` (70) and a
465
465
  -- specific seed.
466
- function ____exports.spawnPillWithSeed(self, pillColor, position, seedOrRNG, velocity, spawner)
466
+ function ____exports.spawnPillWithSeed(self, pillColor, positionOrGridIndex, seedOrRNG, velocity, spawner)
467
467
  if velocity == nil then
468
468
  velocity = VectorZero
469
469
  end
@@ -473,14 +473,14 @@ function ____exports.spawnPillWithSeed(self, pillColor, position, seedOrRNG, vel
473
473
  return ____exports.spawnPill(
474
474
  nil,
475
475
  pillColor,
476
- position,
476
+ positionOrGridIndex,
477
477
  velocity,
478
478
  spawner,
479
479
  seedOrRNG
480
480
  )
481
481
  end
482
482
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69).
483
- function ____exports.spawnSack(self, sackSubType, position, velocity, spawner, seedOrRNG)
483
+ function ____exports.spawnSack(self, sackSubType, positionOrGridIndex, velocity, spawner, seedOrRNG)
484
484
  if velocity == nil then
485
485
  velocity = VectorZero
486
486
  end
@@ -494,7 +494,7 @@ function ____exports.spawnSack(self, sackSubType, position, velocity, spawner, s
494
494
  nil,
495
495
  PickupVariant.SACK,
496
496
  sackSubType,
497
- position,
497
+ positionOrGridIndex,
498
498
  velocity,
499
499
  spawner,
500
500
  seedOrRNG
@@ -502,7 +502,7 @@ function ____exports.spawnSack(self, sackSubType, position, velocity, spawner, s
502
502
  end
503
503
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.SACK` (69) and a
504
504
  -- specific seed.
505
- function ____exports.spawnSackWithSeed(self, sackSubType, position, seedOrRNG, velocity, spawner)
505
+ function ____exports.spawnSackWithSeed(self, sackSubType, positionOrGridIndex, seedOrRNG, velocity, spawner)
506
506
  if velocity == nil then
507
507
  velocity = VectorZero
508
508
  end
@@ -512,14 +512,14 @@ function ____exports.spawnSackWithSeed(self, sackSubType, position, seedOrRNG, v
512
512
  return ____exports.spawnSack(
513
513
  nil,
514
514
  sackSubType,
515
- position,
515
+ positionOrGridIndex,
516
516
  velocity,
517
517
  spawner,
518
518
  seedOrRNG
519
519
  )
520
520
  end
521
521
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350).
522
- function ____exports.spawnTrinket(self, trinketType, position, velocity, spawner, seedOrRNG)
522
+ function ____exports.spawnTrinket(self, trinketType, positionOrGridIndex, velocity, spawner, seedOrRNG)
523
523
  if velocity == nil then
524
524
  velocity = VectorZero
525
525
  end
@@ -533,7 +533,7 @@ function ____exports.spawnTrinket(self, trinketType, position, velocity, spawner
533
533
  nil,
534
534
  PickupVariant.TRINKET,
535
535
  trinketType,
536
- position,
536
+ positionOrGridIndex,
537
537
  velocity,
538
538
  spawner,
539
539
  seedOrRNG
@@ -541,7 +541,7 @@ function ____exports.spawnTrinket(self, trinketType, position, velocity, spawner
541
541
  end
542
542
  --- Helper function to spawn a `EntityType.PICKUP` (5) with variant `PickupVariant.TRINKET` (350) and
543
543
  -- a specific seed.
544
- function ____exports.spawnTrinketWithSeed(self, trinketType, position, seedOrRNG, velocity, spawner)
544
+ function ____exports.spawnTrinketWithSeed(self, trinketType, positionOrGridIndex, seedOrRNG, velocity, spawner)
545
545
  if velocity == nil then
546
546
  velocity = VectorZero
547
547
  end
@@ -551,7 +551,7 @@ function ____exports.spawnTrinketWithSeed(self, trinketType, position, seedOrRNG
551
551
  return ____exports.spawnTrinket(
552
552
  nil,
553
553
  trinketType,
554
- position,
554
+ positionOrGridIndex,
555
555
  velocity,
556
556
  spawner,
557
557
  seedOrRNG
@@ -20,6 +20,13 @@ export declare function anyPlayerIs(...matchingCharacters: PlayerType[]): boolea
20
20
  * - the player has Stompy (transformation 13)
21
21
  */
22
22
  export declare function canPlayerCrushRocks(player: EntityPlayer): boolean;
23
+ /**
24
+ * Helper function to remove a collectible or trinket that is currently queued to go into a player's
25
+ * inventory (i.e. the item is being held over their head).
26
+ *
27
+ * Returns whether or not an item was actually dequeued.
28
+ */
29
+ export declare function dequeueItem(player: EntityPlayer): boolean;
23
30
  /**
24
31
  * Helper function to find the active slot that the player has the corresponding collectible type
25
32
  * in. Returns undefined if the player does not have the collectible in any active slot.
@@ -1 +1 @@
1
- {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAGf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AActC,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAGT;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAGrE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,kBAAkB,EAAE,UAAU,EAAE,GAAG,OAAO,CAIxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CASjE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,UAAU,GAAG,SAAS,CAMxB;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,YAAY,GAAG,KAAK,GACvC,KAAK,CAMP;AAED,+FAA+F;AAC/F,wBAAgB,aAAa,IAAI,UAAU,EAAE,CAG5C;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,YAAY,CAiB/D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,EAAE,CAatE;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,YAAY,CAS7C;AAED;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAe9C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,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AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,OAAO,CAIT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
1
+ {"version":3,"file":"players.d.ts","sourceRoot":"","sources":["../../../src/functions/players.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,eAAe,EACf,eAAe,EAGf,UAAU,EAEV,WAAW,EACZ,MAAM,8BAA8B,CAAC;AActC,wBAAg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ED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAa/D;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAalE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAON;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAC7C,GAAG,gBAAgB,EAAE,eAAe,EAAE,GACrC,IAAI,CAQN;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAIlE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,YAAY,EACpB,WAAW,EAAE,WAAW,GACvB,IAAI,CAON;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,EAChC,UAAU,aAAqB,EAC/B,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ,GAClB,IAAI,CA6DN;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,aAAa,UAAO,GACnB,IAAI,CAsBN;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,YAAY,EACpB,eAAe,EAAE,eAAe,GAC/B,IAAI,CAEN"}
@@ -122,6 +122,19 @@ function ____exports.canPlayerCrushRocks(self, player)
122
122
  local effects = player:GetEffects()
123
123
  return player:HasCollectible(CollectibleType.LEO) or player:HasCollectible(CollectibleType.THUNDER_THIGHS) or effects:HasCollectibleEffect(CollectibleType.MEGA_MUSH) or player:HasPlayerForm(PlayerForm.STOMPY)
124
124
  end
125
+ --- Helper function to remove a collectible or trinket that is currently queued to go into a player's
126
+ -- inventory (i.e. the item is being held over their head).
127
+ --
128
+ -- Returns whether or not an item was actually dequeued.
129
+ function ____exports.dequeueItem(self, player)
130
+ if player.QueuedItem.Item == nil then
131
+ return false
132
+ end
133
+ local queue = player.QueuedItem
134
+ queue.Item = nil
135
+ player.QueuedItem = queue
136
+ return true
137
+ end
125
138
  --- Helper function to find the active slot that the player has the corresponding collectible type
126
139
  -- in. Returns undefined if the player does not have the collectible in any active slot.
127
140
  function ____exports.getActiveItemSlot(self, player, collectibleType)
@@ -496,7 +509,7 @@ function ____exports.removeAllActiveItems(self, player)
496
509
  do
497
510
  local collectibleType = player:GetActiveItem(activeSlot)
498
511
  if collectibleType == CollectibleType.NULL then
499
- goto __continue89
512
+ goto __continue91
500
513
  end
501
514
  local hasCollectible
502
515
  repeat
@@ -506,7 +519,7 @@ function ____exports.removeAllActiveItems(self, player)
506
519
  end
507
520
  until not hasCollectible
508
521
  end
509
- ::__continue89::
522
+ ::__continue91::
510
523
  end
511
524
  end
512
525
  --- Helper function to remove all of the held trinkets from a player.
@@ -518,7 +531,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
518
531
  do
519
532
  local trinketType = player:GetTrinket(trinketSlot)
520
533
  if trinketType == TrinketType.NULL then
521
- goto __continue94
534
+ goto __continue96
522
535
  end
523
536
  local hasTrinket
524
537
  repeat
@@ -528,7 +541,7 @@ function ____exports.removeAllPlayerTrinkets(self, player)
528
541
  end
529
542
  until not hasTrinket
530
543
  end
531
- ::__continue94::
544
+ ::__continue96::
532
545
  end
533
546
  end
534
547
  --- Helper function to remove a collectible costume from a player. Use this helper function to avoid
@@ -609,9 +622,9 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
609
622
  itemPool:RemoveCollectible(collectibleType)
610
623
  end
611
624
  repeat
612
- local ____switch113 = activeSlot
613
- local ____cond113 = ____switch113 == ActiveSlot.PRIMARY
614
- if ____cond113 then
625
+ local ____switch115 = activeSlot
626
+ local ____cond115 = ____switch115 == ActiveSlot.PRIMARY
627
+ if ____cond115 then
615
628
  do
616
629
  if primaryCollectibleType ~= CollectibleType.NULL then
617
630
  player:RemoveCollectible(primaryCollectibleType)
@@ -620,8 +633,8 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
620
633
  break
621
634
  end
622
635
  end
623
- ____cond113 = ____cond113 or ____switch113 == ActiveSlot.SECONDARY
624
- if ____cond113 then
636
+ ____cond115 = ____cond115 or ____switch115 == ActiveSlot.SECONDARY
637
+ if ____cond115 then
625
638
  do
626
639
  if primaryCollectibleType ~= CollectibleType.NULL then
627
640
  player:RemoveCollectible(primaryCollectibleType)
@@ -636,16 +649,16 @@ function ____exports.setActiveItem(self, player, collectibleType, activeSlot, ch
636
649
  break
637
650
  end
638
651
  end
639
- ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET
640
- if ____cond113 then
652
+ ____cond115 = ____cond115 or ____switch115 == ActiveSlot.POCKET
653
+ if ____cond115 then
641
654
  do
642
655
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
643
656
  player:SetActiveCharge(charge, activeSlot)
644
657
  break
645
658
  end
646
659
  end
647
- ____cond113 = ____cond113 or ____switch113 == ActiveSlot.POCKET_SINGLE_USE
648
- if ____cond113 then
660
+ ____cond115 = ____cond115 or ____switch115 == ActiveSlot.POCKET_SINGLE_USE
661
+ if ____cond115 then
649
662
  do
650
663
  player:SetPocketActiveItem(collectibleType, activeSlot, keepInPools)
651
664
  break
@@ -10,7 +10,7 @@ import { CollectibleType } from "isaac-typescript-definitions";
10
10
  * (which is provided by `ISCFeature.SPAWN_COLLECTIBLE`).
11
11
  *
12
12
  * @param collectibleType The collectible type to spawn.
13
- * @param position The position to spawn the collectible at.
13
+ * @param positionOrGridIndex The position or grid index to spawn the collectible at.
14
14
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
15
15
  * `RNG.Next` method will be called. Default is `getRandomSeed()`.
16
16
  * @param options Optional. Set to true to make the collectible a "There's Options" style
@@ -19,7 +19,7 @@ import { CollectibleType } from "isaac-typescript-definitions";
19
19
  * Tainted Keeper. Default is false.
20
20
  * @param spawner Optional.
21
21
  */
22
- export declare function spawnCollectibleUnsafe(collectibleType: CollectibleType, position: Vector, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
22
+ export declare function spawnCollectibleUnsafe(collectibleType: CollectibleType, positionOrGridIndex: Vector | int, seedOrRNG?: Seed | RNG, options?: boolean, forceFreeItem?: boolean, spawner?: Entity): EntityPickupCollectible;
23
23
  /**
24
24
  * Helper function to spawn an empty collectible. Doing this is tricky since spawning a collectible
25
25
  * with `CollectibleType.NULL` will result in spawning a collectible with a random type from the
@@ -28,9 +28,9 @@ export declare function spawnCollectibleUnsafe(collectibleType: CollectibleType,
28
28
  * Instead, this function arbitrarily spawns a collectible with `CollectibleType.SAD_ONION`, and
29
29
  * then converts it to an empty pedestal afterward.
30
30
  *
31
- * @param position The position to spawn the empty collectible at.
31
+ * @param positionOrGridIndex The position or grid index to spawn the empty collectible at.
32
32
  * @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
33
33
  * `RNG.Next` method will be called. Default is `getRandomSeed()`.
34
34
  */
35
- export declare function spawnEmptyCollectible(position: Vector, seedOrRNG?: Seed | RNG): EntityPickup;
35
+ export declare function spawnEmptyCollectible(positionOrGridIndex: Vector | int, seedOrRNG?: Seed | RNG): EntityPickup;
36
36
  //# sourceMappingURL=spawnCollectible.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spawnCollectible.d.ts","sourceRoot":"","sources":["../../../src/functions/spawnCollectible.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,EACf,aAAa,UAAQ,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CAiCzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,YAAY,CAWd"}
1
+ {"version":3,"file":"spawnCollectible.d.ts","sourceRoot":"","sources":["../../../src/functions/spawnCollectible.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,8BAA8B,CAAC;AAQtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CACpC,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,EACvC,OAAO,UAAQ,EACf,aAAa,UAAQ,EACrB,OAAO,CAAC,EAAE,MAAM,GACf,uBAAuB,CAiCzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,mBAAmB,EAAE,MAAM,GAAG,GAAG,EACjC,SAAS,GAAE,IAAI,GAAG,GAAqB,GACtC,YAAY,CAWd"}
@@ -26,7 +26,7 @@ local isRNG = ____rng.isRNG
26
26
  -- (which is provided by `ISCFeature.SPAWN_COLLECTIBLE`).
27
27
  --
28
28
  -- @param collectibleType The collectible type to spawn.
29
- -- @param position The position to spawn the collectible at.
29
+ -- @param positionOrGridIndex The position or grid index to spawn the collectible at.
30
30
  -- @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
31
31
  -- `RNG.Next` method will be called. Default is `getRandomSeed()`.
32
32
  -- @param options Optional. Set to true to make the collectible a "There's Options" style
@@ -34,7 +34,7 @@ local isRNG = ____rng.isRNG
34
34
  -- @param forceFreeItem Optional. Set to true to disable the logic that gives the item a price for
35
35
  -- Tainted Keeper. Default is false.
36
36
  -- @param spawner Optional.
37
- function ____exports.spawnCollectibleUnsafe(self, collectibleType, position, seedOrRNG, options, forceFreeItem, spawner)
37
+ function ____exports.spawnCollectibleUnsafe(self, collectibleType, positionOrGridIndex, seedOrRNG, options, forceFreeItem, spawner)
38
38
  if seedOrRNG == nil then
39
39
  seedOrRNG = getRandomSeed(nil)
40
40
  end
@@ -49,7 +49,7 @@ function ____exports.spawnCollectibleUnsafe(self, collectibleType, position, see
49
49
  nil,
50
50
  PickupVariant.COLLECTIBLE,
51
51
  collectibleType,
52
- position,
52
+ positionOrGridIndex,
53
53
  seed,
54
54
  VectorZero,
55
55
  spawner
@@ -70,17 +70,17 @@ end
70
70
  -- Instead, this function arbitrarily spawns a collectible with `CollectibleType.SAD_ONION`, and
71
71
  -- then converts it to an empty pedestal afterward.
72
72
  --
73
- -- @param position The position to spawn the empty collectible at.
73
+ -- @param positionOrGridIndex The position or grid index to spawn the empty collectible at.
74
74
  -- @param seedOrRNG The `Seed` or `RNG` object to use. If an `RNG` object is provided, the
75
75
  -- `RNG.Next` method will be called. Default is `getRandomSeed()`.
76
- function ____exports.spawnEmptyCollectible(self, position, seedOrRNG)
76
+ function ____exports.spawnEmptyCollectible(self, positionOrGridIndex, seedOrRNG)
77
77
  if seedOrRNG == nil then
78
78
  seedOrRNG = getRandomSeed(nil)
79
79
  end
80
80
  local collectible = ____exports.spawnCollectibleUnsafe(
81
81
  nil,
82
82
  CollectibleType.SAD_ONION,
83
- position,
83
+ positionOrGridIndex,
84
84
  seedOrRNG,
85
85
  false,
86
86
  true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isaacscript-common",
3
- "version": "17.2.1",
3
+ "version": "17.4.0",
4
4
  "description": "Helper functions and features for IsaacScript mods.",
5
5
  "keywords": [
6
6
  "isaac",
@@ -22,6 +22,6 @@
22
22
  "main": "dist/src/index",
23
23
  "types": "dist/src/index.d.ts",
24
24
  "dependencies": {
25
- "isaac-typescript-definitions": "^10.0.3"
25
+ "isaac-typescript-definitions": "^10.0.4"
26
26
  }
27
27
  }
@@ -67,6 +67,8 @@ export class CustomHotkeys extends Feature {
67
67
  * This can be used to easily set up custom hotkeys to facilitate custom game features or to
68
68
  * assist in debugging.
69
69
  *
70
+ * Inputs are checked for in the `POST_RENDER` callback.
71
+ *
70
72
  * This is different from the `setHotkey` function in that the keyboard activation key is not
71
73
  * hardcoded and is instead the return value of a provided function. This is useful for situations
72
74
  * where the key can change (like if end-users can specify a custom hotkey using Mod Config Menu).
@@ -97,6 +99,8 @@ export class CustomHotkeys extends Feature {
97
99
  * This can be used to easily set up custom hotkeys to facilitate custom game features or to
98
100
  * assist in debugging.
99
101
  *
102
+ * Inputs are checked for in the `POST_RENDER` callback.
103
+ *
100
104
  * In order to use this function, you must upgrade your mod with `ISCFeature.CUSTOM_HOTKEYS`.
101
105
  *
102
106
  * @param keyboard The key that you want to trigger the hotkey.
@@ -34,7 +34,7 @@ export class SpawnCollectible extends Feature {
34
34
  * In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
35
35
  *
36
36
  * @param collectibleType The collectible type to spawn.
37
- * @param position The position to spawn the collectible at.
37
+ * @param positionOrGridIndex The position or grid index to spawn the collectible at.
38
38
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
39
39
  * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
40
40
  * @param options Optional. Set to true to make the collectible a "There's Options" style
@@ -46,7 +46,7 @@ export class SpawnCollectible extends Feature {
46
46
  @Exported
47
47
  public spawnCollectible(
48
48
  collectibleType: CollectibleType,
49
- position: Vector,
49
+ positionOrGridIndex: Vector | int,
50
50
  seedOrRNG: Seed | RNG = getRandomSeed(),
51
51
  options = false,
52
52
  forceFreeItem = false,
@@ -54,7 +54,7 @@ export class SpawnCollectible extends Feature {
54
54
  ): EntityPickupCollectible {
55
55
  const collectible = spawnCollectibleUnsafe(
56
56
  collectibleType,
57
- position,
57
+ positionOrGridIndex,
58
58
  seedOrRNG,
59
59
  options,
60
60
  forceFreeItem,
@@ -81,7 +81,7 @@ export class SpawnCollectible extends Feature {
81
81
  * In order to use this function, you must upgrade your mod with `ISCFeature.SPAWN_COLLECTIBLE`.
82
82
  *
83
83
  * @param itemPoolType The item pool to draw the collectible type from.
84
- * @param position The position to spawn the collectible at.
84
+ * @param positionOrGridIndex The position or grid index to spawn the collectible at.
85
85
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
86
86
  * the `RNG.Next` method will be called. Default is `getRandomSeed()`.
87
87
  * @param options Optional. Set to true to make the collectible a "There's Options" style
@@ -93,7 +93,7 @@ export class SpawnCollectible extends Feature {
93
93
  @Exported
94
94
  public spawnCollectibleFromPool(
95
95
  itemPoolType: ItemPoolType,
96
- position: Vector,
96
+ positionOrGridIndex: Vector | int,
97
97
  seedOrRNG: Seed | RNG = getRandomSeed(),
98
98
  options = false,
99
99
  forceFreeItem = false,
@@ -104,7 +104,7 @@ export class SpawnCollectible extends Feature {
104
104
 
105
105
  return this.spawnCollectible(
106
106
  collectibleType,
107
- position,
107
+ positionOrGridIndex,
108
108
  seedOrRNG,
109
109
  options,
110
110
  forceFreeItem,
@@ -31,7 +31,7 @@ import { getRandom } from "../../../functions/random";
31
31
  import { getRandomSeed, isRNG, newRNG } from "../../../functions/rng";
32
32
  import { spawnCollectibleUnsafe } from "../../../functions/spawnCollectible";
33
33
  import { repeat } from "../../../functions/utils";
34
- import { getRandomVector } from "../../../functions/vector";
34
+ import { getRandomVector, isVector } from "../../../functions/vector";
35
35
  import { Feature } from "../../private/Feature";
36
36
  import { ItemPoolDetection } from "./ItemPoolDetection";
37
37
 
@@ -92,7 +92,7 @@ export class SpawnRockAltRewards extends Feature {
92
92
  * In order to use this function, you must upgrade your mod with
93
93
  * `ISCFeature.SPAWN_ALT_ROCK_REWARDS`.
94
94
  *
95
- * @param position The place to spawn the reward.
95
+ * @param positionOrGridIndex The position or grid index to spawn the reward.
96
96
  * @param rockAltType The type of reward to spawn. For example, `RockAltType.URN` will have a
97
97
  * chance at spawning coins and spiders.
98
98
  * @param seedOrRNG Optional. The `Seed` or `RNG` object to use. If an `RNG` object is provided,
@@ -102,10 +102,14 @@ export class SpawnRockAltRewards extends Feature {
102
102
  */
103
103
  @Exported
104
104
  public spawnRockAltReward(
105
- position: Vector,
105
+ positionOrGridIndex: Vector | int,
106
106
  rockAltType: RockAltType,
107
107
  seedOrRNG: Seed | RNG = getRandomSeed(),
108
108
  ): boolean {
109
+ const room = game.GetRoom();
110
+ const position = isVector(positionOrGridIndex)
111
+ ? positionOrGridIndex
112
+ : room.GetGridPosition(positionOrGridIndex);
109
113
  const rng = isRNG(seedOrRNG) ? seedOrRNG : newRNG(seedOrRNG);
110
114
 
111
115
  switch (rockAltType) {