Skip to content

Familiars

checkFamiliar(player, collectibleType, targetCount, familiarVariant, familiarSubType?): void

Defined in: packages/isaacscript-common/src/functions/familiars.ts:48

Helper function to add and remove familiars based on a target amount that you specify.

This is a convenience wrapper around the EntityPlayer.CheckFamiliar method. Use this helper function instead so that you do not have to retrieve the ItemConfigItem and so that you do not specify an incorrect RNG object. (The vanilla method is bugged in that it does not increment the RNG object; see the documentation of the method for more details.)

This function is meant to be called in the EVALUATE_CACHE callback (when the cache flag is equal to CacheFlag.FAMILIARS).

Note that this function is only meant to be used in special circumstances where the familiar count is completely custom and does not correspond to the amount of collectibles. For the general case, use the checkFamiliarFromCollectibles helper function instead.

Note that this will spawn familiars with a completely random InitSeed. When calculating random events for this familiar, you should use a data structure that maps familiar InitSeed to RNG objects that are initialized based on the seed from EntityPlayer.GetCollectibleRNG(collectibleType).

EntityPlayer

The player that owns the familiars.

CollectibleType

The collectible type of the collectible associated with this familiar.

int

The number of familiars that should exist. This function will add or remove familiars until it matches the target count.

FamiliarVariant

The variant of the familiar to spawn or remove.

int

Optional. The sub-type of the familiar to spawn or remove. If not specified, it will search for existing familiars of all sub-types, and spawn new familiars with a sub-type of 0.

void


checkFamiliarFromCollectibles(player, collectibleType, familiarVariant, familiarSubType?): void

Defined in: packages/isaacscript-common/src/functions/familiars.ts:94

Helper function to add and remove familiars based on the amount of associated collectibles that a player has.

Use this helper function instead of invoking the EntityPlayer.CheckFamiliar method directly so that the target count is handled automatically.

This function is meant to be called in the EVALUATE_CACHE callback (when the cache flag is equal to CacheFlag.FAMILIARS).

Use this function when the amount of familiars should be equal to the amount of associated collectibles that the player has (plus any extras from having used Box of Friends or Monster Manual). If you instead need to have a custom amount of familiars, use the checkFamiliars function instead.

Note that this will spawn familiars with a completely random InitSeed. When calculating random events for this familiar, you should use a data structure that maps familiar InitSeed to RNG objects that are initialized based on the seed from EntityPlayer.GetCollectibleRNG(collectibleType).

EntityPlayer

The player that owns the familiars and collectibles.

CollectibleType

The collectible type of the collectible associated with this familiar.

FamiliarVariant

The variant of the familiar to spawn or remove.

int

Optional. The sub-type of the familiar to spawn or remove. If not specified, it will search for existing familiars of all sub-types, and spawn new familiars with a sub-type of 0.

void


getPlayerFamiliars(player): readonly EntityFamiliar[]

Defined in: packages/isaacscript-common/src/functions/familiars.ts:121

Helper function to get only the familiars that belong to a specific player.

EntityPlayer

readonly EntityFamiliar[]


getSirenHelper(familiar): Entity | undefined

Defined in: packages/isaacscript-common/src/functions/familiars.ts:143

Helper function to get the corresponding “Siren Helper” entity for a stolen familiar.

When The Siren boss “steals” your familiars, a hidden “Siren Helper” entity is spawned to control each familiar stolen. (Checking for the presence of this entity seems to be the only way to detect when the Siren steals a familiar.)

EntityFamiliar

The familiar to be checked.

Entity | undefined

Returns the hidden “Siren Helper” entity corresponding to the given familiar, if it exists. Returns undefined otherwise.


isFamiliarStolenBySiren(familiar): boolean

Defined in: packages/isaacscript-common/src/functions/familiars.ts:160

Helper function to detect if the given familiar is “stolen” by The Siren boss.

This function is useful because some familiars may need to behave differently when under The Siren’s control (e.g. if they auto-target enemies).

EntityFamiliar

boolean


isFamiliarThatShootsPlayerTears(familiar): boolean

Defined in: packages/isaacscript-common/src/functions/familiars.ts:169

Helper function to check if a familiar is the type that shoots tears that mimic the players tears, like Incubus, Fate’s Reward, Sprinkler, and so on.

EntityFamiliar

boolean