Skip to main content

Spawn Rock Alt Rewards

Hierarchy

  • Feature

    SpawnRockAltRewards

Methods

spawnRockAltReward

spawnRockAltReward(positionOrGridIndex, rockAltType, seedOrRNG): boolean

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.

Parameters

NameTypeDescription
positionOrGridIndexint | VectorThe position or grid index to spawn the reward.
rockAltTypeRockAltTypeThe type of reward to spawn. For example, RockAltType.URN will have a chance at spawning coins and spiders.
seedOrRNGundefined | RNG | SeedThe 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.

Returns

boolean

Whether this function spawned something.

Defined in

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


spawnRockAltRewardUrn

spawnRockAltRewardUrn(position, rng): boolean

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.

Parameters

NameType
positionVector
rngRNG

Returns

boolean

Defined in

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


spawnRockAltRewardMushroom

spawnRockAltRewardMushroom(position, rng): boolean

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.

Parameters

NameType
positionVector
rngRNG

Returns

boolean

Defined in

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


spawnRockAltRewardSkull

spawnRockAltRewardSkull(position, rng): boolean

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.

Parameters

NameType
positionVector
rngRNG

Returns

boolean

Defined in

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


spawnRockAltRewardPolyp

spawnRockAltRewardPolyp(position, rng): boolean

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.

Parameters

NameType
positionVector
rngRNG

Returns

boolean

Defined in

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


spawnRockAltRewardBucketDownpour

spawnRockAltRewardBucketDownpour(position, rng): boolean

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.

Parameters

NameType
positionVector
rngRNG

Returns

boolean

Defined in

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


spawnRockAltRewardBucketDross

spawnRockAltRewardBucketDross(position, rng): boolean

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.

Parameters

NameType
positionVector
rngRNG

Returns

boolean

Defined in

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