Skip to content

Spawn Rock Alt Rewards

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:59

  • Feature

spawnRockAltReward(positionOrGridIndex, rockAltType, seedOrRNG): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:109

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks.

Most of the time, this function will do nothing, similar to how most of the time, when an individual urn is destroyed, nothing will spawn.

Note that in vanilla, trinkets will not spawn if they have already been removed from the trinket pool. This function cannot replicate that behavior because there is no way to check to see if a trinket is still in the pool. Thus, it will always have a chance to spawn the respective trinket (e.g. Swallowed Penny from urns).

When filled buckets are destroyed, 6 projectiles will always spawn in a random pattern (in addition to any other rewards that are spawned). This function does not account for this, so if you want to specifically emulate destroying a filled bucket, you have to account for the projectiles yourself.

The logic in this function is based on the rewards listed on the wiki: https://bindingofisaacrebirth.fandom.com/wiki/Rocks

If you want to spawn an unseeded reward, you must explicitly pass undefined to the seedOrRNG parameter.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

int | Vector

The position or grid index to spawn the reward.

RockAltType

The type of reward to spawn. For example, RockAltType.URN will have a chance at spawning coins and spiders.

RNG | Seed | undefined

The Seed or RNG object to use. Normally, you should pass the InitSeed of the grid entity that was broken. If an RNG object is provided, the RNG.Next method will be called. If undefined is provided, it will default to a random seed.

boolean

Whether this function spawned something.

spawnRockAltRewardUrn(position, rng): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:157

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks of RockAltType.URN.

For more information, see the documentation for the spawnRockAltReward function.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

Vector

RNG

boolean

spawnRockAltRewardMushroom(position, rng): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:223

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks of RockAltType.MUSHROOM.

For more information, see the documentation for the spawnRockAltReward function.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

Vector

RNG

boolean

spawnRockAltRewardSkull(position, rng): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:312

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks of RockAltType.SKULL.

For more information, see the documentation for the spawnRockAltReward function.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

Vector

RNG

boolean

spawnRockAltRewardPolyp(position, rng): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:383

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks of RockAltType.POLYP.

For more information, see the documentation for the spawnRockAltReward function.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

Vector

RNG

boolean

spawnRockAltRewardBucketDownpour(position, rng): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:461

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks of RockAltType.BUCKET_DOWNPOUR.

For more information, see the documentation for the spawnRockAltReward function.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

Vector

RNG

boolean

spawnRockAltRewardBucketDross(position, rng): boolean

Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:546

Helper function for emulating what happens when a vanilla GridEntityType.ROCK_ALT grid entity breaks of RockAltType.BUCKET_DROSS.

For more information, see the documentation for the spawnRockAltReward function.

In order to use this function, you must upgrade your mod with ISCFeature.SPAWN_ALT_ROCK_REWARDS.

Vector

RNG

boolean