isaacscript-common
Version:
Helper functions and features for IsaacScript mods.
104 lines • 5.11 kB
TypeScript
import { RockAltType } from "../../../enums/RockAltType";
import { Feature } from "../../private/Feature";
export declare class SpawnRockAltRewards extends Feature {
private readonly itemPoolDetection;
/**
* 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`.
*
* @param positionOrGridIndex The position or grid index to spawn the reward.
* @param rockAltType The type of reward to spawn. For example, `RockAltType.URN` will have a
* chance at spawning coins and spiders.
* @param seedOrRNG 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 Whether this function spawned something.
* @public
*/
spawnRockAltReward(positionOrGridIndex: Vector | int, rockAltType: RockAltType, seedOrRNG: Seed | RNG | undefined): 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`.
*/
spawnRockAltRewardUrn(position: Vector, rng: 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`.
*/
spawnRockAltRewardMushroom(position: Vector, rng: 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`.
*/
spawnRockAltRewardSkull(position: Vector, rng: 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`.
*/
spawnRockAltRewardPolyp(position: Vector, rng: 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`.
*/
spawnRockAltRewardBucketDownpour(position: Vector, rng: 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`.
*/
spawnRockAltRewardBucketDross(position: Vector, rng: RNG): boolean;
}
//# sourceMappingURL=SpawnRockAltRewards.d.ts.map