isaacscript-common 17.2.0 → 17.3.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/index.d.ts +63 -56
- package/dist/isaacscript-common.lua +109 -97
- package/dist/src/classes/features/other/CustomHotkeys.d.ts +4 -0
- package/dist/src/classes/features/other/CustomHotkeys.d.ts.map +1 -1
- package/dist/src/classes/features/other/SpawnCollectible.d.ts +4 -4
- package/dist/src/classes/features/other/SpawnCollectible.d.ts.map +1 -1
- package/dist/src/classes/features/other/SpawnCollectible.lua +4 -4
- package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts +3 -2
- package/dist/src/classes/features/other/SpawnRockAltRewards.d.ts.map +1 -1
- package/dist/src/classes/features/other/SpawnRockAltRewards.lua +4 -1
- package/dist/src/functions/bosses.d.ts +2 -2
- package/dist/src/functions/bosses.d.ts.map +1 -1
- package/dist/src/functions/bosses.lua +5 -5
- package/dist/src/functions/entities.d.ts +5 -5
- package/dist/src/functions/entities.d.ts.map +1 -1
- package/dist/src/functions/entities.lua +10 -8
- package/dist/src/functions/entitiesSpecific.d.ts +20 -20
- package/dist/src/functions/entitiesSpecific.d.ts.map +1 -1
- package/dist/src/functions/entitiesSpecific.lua +40 -40
- package/dist/src/functions/pickupsSpecific.d.ts +18 -18
- package/dist/src/functions/pickupsSpecific.d.ts.map +1 -1
- package/dist/src/functions/pickupsSpecific.lua +36 -36
- package/dist/src/functions/spawnCollectible.d.ts +4 -4
- package/dist/src/functions/spawnCollectible.d.ts.map +1 -1
- package/dist/src/functions/spawnCollectible.lua +6 -6
- package/dist/src/functions/stage.d.ts +4 -1
- package/dist/src/functions/stage.d.ts.map +1 -1
- package/dist/src/functions/stage.lua +10 -0
- package/package.json +1 -1
- package/src/classes/features/other/CustomHotkeys.ts +4 -0
- package/src/classes/features/other/SpawnCollectible.ts +6 -6
- package/src/classes/features/other/SpawnRockAltRewards.ts +7 -3
- package/src/functions/bosses.ts +13 -5
- package/src/functions/entities.ts +14 -8
- package/src/functions/entitiesSpecific.ts +40 -40
- package/src/functions/pickupsSpecific.ts +84 -36
- package/src/functions/spawnCollectible.ts +6 -6
- package/src/functions/stage.ts +15 -2
|
@@ -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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
382
|
+
positionOrGridIndex,
|
|
383
383
|
velocity,
|
|
384
384
|
spawner,
|
|
385
385
|
seedOrRNG
|
|
386
386
|
)
|
|
387
387
|
end
|
|
388
|
-
function ____exports.spawnHeartWithSeed(self, heartSubType,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
554
|
+
positionOrGridIndex,
|
|
555
555
|
velocity,
|
|
556
556
|
spawner,
|
|
557
557
|
seedOrRNG
|
|
@@ -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
|
|
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,
|
|
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
|
|
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(
|
|
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,
|
|
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
|
|
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,
|
|
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
|
-
|
|
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
|
|
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,
|
|
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
|
-
|
|
83
|
+
positionOrGridIndex,
|
|
84
84
|
seedOrRNG,
|
|
85
85
|
false,
|
|
86
86
|
true
|
|
@@ -22,8 +22,11 @@ export declare function getEffectiveStage(): int;
|
|
|
22
22
|
* which will not display correctly on some fonts.
|
|
23
23
|
*
|
|
24
24
|
* Note that this returns "Blue Womb" instead of "???" for stage 9.
|
|
25
|
+
*
|
|
26
|
+
* @param stage Optional. If not specified, the current stage will be used.
|
|
27
|
+
* @param stageType Optional. If not specified, the current stage type will be used.
|
|
25
28
|
*/
|
|
26
|
-
export declare function getEnglishLevelName(stage
|
|
29
|
+
export declare function getEnglishLevelName(stage?: LevelStage, stageType?: StageType): string;
|
|
27
30
|
/**
|
|
28
31
|
* Helper function to get the corresponding "goto" console command that would correspond to the
|
|
29
32
|
* provided room type and room variant.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,8BAA8B,CAAC;AAQtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CASvC;AAGD
|
|
1
|
+
{"version":3,"file":"stage.d.ts","sourceRoot":"","sources":["../../../src/functions/stage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,QAAQ,EACR,SAAS,EACV,MAAM,8BAA8B,CAAC;AAQtC;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,UAAU,GAAG,SAAS,CAmBzE;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CASvC;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,EAAE,UAAU,EAClB,SAAS,CAAC,EAAE,SAAS,GACpB,MAAM,CAaR;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,MAAM,CAG3E;AAED,6CAA6C;AAC7C,wBAAgB,QAAQ,IAAI,UAAU,CAIrC;AAED,iDAAiD;AACjD,wBAAgB,YAAY,IAAI,SAAS,CAIxC;AAED,8FAA8F;AAC9F,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,GAAG,IAAI,CAIvE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAI/D;AAED,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED,wBAAgB,WAAW,IAAI,OAAO,CASrC;AAED,wBAAgB,OAAO,IAAI,OAAO,CASjC;AAED,wBAAgB,UAAU,IAAI,OAAO,CAQpC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAUtC;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,OAAO,CAKtC;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAK3C;AAED,wBAAgB,OAAO,IAAI,OAAO,CAQjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CACtB,KAAK,EAAE,UAAU,EACjB,SAAS,EAAE,SAAS,EACpB,MAAM,UAAQ,GACb,IAAI,CAUN;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM,CAE9D"}
|
|
@@ -83,7 +83,17 @@ end
|
|
|
83
83
|
-- which will not display correctly on some fonts.
|
|
84
84
|
--
|
|
85
85
|
-- Note that this returns "Blue Womb" instead of "???" for stage 9.
|
|
86
|
+
--
|
|
87
|
+
-- @param stage Optional. If not specified, the current stage will be used.
|
|
88
|
+
-- @param stageType Optional. If not specified, the current stage type will be used.
|
|
86
89
|
function ____exports.getEnglishLevelName(self, stage, stageType)
|
|
90
|
+
local level = game:GetLevel()
|
|
91
|
+
if stage == nil then
|
|
92
|
+
stage = level:GetStage()
|
|
93
|
+
end
|
|
94
|
+
if stageType == nil then
|
|
95
|
+
stageType = level:GetStageType()
|
|
96
|
+
end
|
|
87
97
|
local stageNames = ENGLISH_LEVEL_NAMES[stage]
|
|
88
98
|
return stageNames[stageType]
|
|
89
99
|
end
|
package/package.json
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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) {
|
package/src/functions/bosses.ts
CHANGED
|
@@ -157,7 +157,7 @@ export function spawnBoss(
|
|
|
157
157
|
entityType: EntityType,
|
|
158
158
|
variant: int,
|
|
159
159
|
subType: int,
|
|
160
|
-
|
|
160
|
+
positionOrGridIndex: Vector | int,
|
|
161
161
|
velocity: Vector = VectorZero,
|
|
162
162
|
spawner: Entity | undefined = undefined,
|
|
163
163
|
seedOrRNG: Seed | RNG | undefined = undefined,
|
|
@@ -168,7 +168,7 @@ export function spawnBoss(
|
|
|
168
168
|
entityType,
|
|
169
169
|
variant,
|
|
170
170
|
subType,
|
|
171
|
-
|
|
171
|
+
positionOrGridIndex,
|
|
172
172
|
velocity,
|
|
173
173
|
spawner,
|
|
174
174
|
seed,
|
|
@@ -182,7 +182,15 @@ export function spawnBoss(
|
|
|
182
182
|
);
|
|
183
183
|
const remainingSegmentsToSpawn = numBossSegments - 1;
|
|
184
184
|
repeat(remainingSegmentsToSpawn, () => {
|
|
185
|
-
spawnNPC(
|
|
185
|
+
spawnNPC(
|
|
186
|
+
entityType,
|
|
187
|
+
variant,
|
|
188
|
+
subType,
|
|
189
|
+
positionOrGridIndex,
|
|
190
|
+
velocity,
|
|
191
|
+
spawner,
|
|
192
|
+
seed,
|
|
193
|
+
);
|
|
186
194
|
});
|
|
187
195
|
}
|
|
188
196
|
|
|
@@ -231,7 +239,7 @@ export function spawnBossWithSeed(
|
|
|
231
239
|
entityType: EntityType,
|
|
232
240
|
variant: int,
|
|
233
241
|
subType: int,
|
|
234
|
-
|
|
242
|
+
positionOrGridIndex: Vector | int,
|
|
235
243
|
seedOrRNG: Seed | RNG,
|
|
236
244
|
velocity: Vector = VectorZero,
|
|
237
245
|
spawner: Entity | undefined = undefined,
|
|
@@ -242,7 +250,7 @@ export function spawnBossWithSeed(
|
|
|
242
250
|
entityType,
|
|
243
251
|
variant,
|
|
244
252
|
subType,
|
|
245
|
-
|
|
253
|
+
positionOrGridIndex,
|
|
246
254
|
velocity,
|
|
247
255
|
spawner,
|
|
248
256
|
seed,
|