Spawn Rock Alt Rewards
Classes
Section titled “Classes”SpawnRockAltRewards
Section titled “SpawnRockAltRewards”Defined in: packages/isaacscript-common/src/classes/features/other/SpawnRockAltRewards.ts:59
Extends
Section titled “Extends”Feature
Methods
Section titled “Methods”spawnRockAltReward()
Section titled “spawnRockAltReward()”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.
Parameters
Section titled “Parameters”positionOrGridIndex
Section titled “positionOrGridIndex”int | Vector
The position or grid index to spawn the reward.
rockAltType
Section titled “rockAltType”The type of reward to spawn. For example, RockAltType.URN will have a
chance at spawning coins and spiders.
seedOrRNG
Section titled “seedOrRNG”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.
Returns
Section titled “Returns”boolean
Whether this function spawned something.
spawnRockAltRewardUrn()
Section titled “spawnRockAltRewardUrn()”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.
Parameters
Section titled “Parameters”position
Section titled “position”Vector
RNG
Returns
Section titled “Returns”boolean
spawnRockAltRewardMushroom()
Section titled “spawnRockAltRewardMushroom()”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.
Parameters
Section titled “Parameters”position
Section titled “position”Vector
RNG
Returns
Section titled “Returns”boolean
spawnRockAltRewardSkull()
Section titled “spawnRockAltRewardSkull()”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.
Parameters
Section titled “Parameters”position
Section titled “position”Vector
RNG
Returns
Section titled “Returns”boolean
spawnRockAltRewardPolyp()
Section titled “spawnRockAltRewardPolyp()”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.
Parameters
Section titled “Parameters”position
Section titled “position”Vector
RNG
Returns
Section titled “Returns”boolean
spawnRockAltRewardBucketDownpour()
Section titled “spawnRockAltRewardBucketDownpour()”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.
Parameters
Section titled “Parameters”position
Section titled “position”Vector
RNG
Returns
Section titled “Returns”boolean
spawnRockAltRewardBucketDross()
Section titled “spawnRockAltRewardBucketDross()”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.
Parameters
Section titled “Parameters”position
Section titled “position”Vector
RNG
Returns
Section titled “Returns”boolean
