Familiars

Overview

Return Value
Function

void

CheckFamiliar(EntityPlayer player, CollectibleType collectibleType, integer targetCount, FamiliarVariant familiarVariant, integer? familiarSubtype)

void

CheckFamiliarFromCollectibles(EntityPlayer player, CollectibleType collectibleType, FamiliarVariant familiarVariant, integer? familiarSubtype)

Functions

CheckFamiliar()

void CheckFamiliar(EntityPlayerplayer,CollectibleTypecollectibleType, integer targetCount,FamiliarVariant familiarVariant, integer? familiarSubtype)

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).

CheckFamiliarFromCollectibles()

void CheckFamiliarFromCollectibles(EntityPlayerplayer,CollectibleTypecollectibleType,FamiliarVariant familiarVariant, integer? familiarSubtype)

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).

GetPlayerFamiliars()

EntityFamiliar[] GetPlayerFamiliars(EntityPlayer player)

Helper function to get all familiars that belong to a given player.

GetSirenHelper()

Entity? GetSirenHelper(EntityFamiliar familiar)

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.)

IsFamiliarStolenBySiren()

boolean IsFamiliarStolenBySiren(EntityFamiliar familiar)

Helper function to check if the given familiar is being controlled by The Siren boss.

Last updated