XanVoidAPI

Updated a year ago

Xan.ROR2VoidPlayerCharacterCommon.XanVoidAPI

This is the central hub for the main functions of the API.

Public Fields and Properties

static BodyIndex Infestor { get; }

Only valid after BodyCatalog is available. This is the index of the Void Infestor body.

static BodyIndex Barnacle { get; }

Only valid after BodyCatalog is available. This is the index of the Void Barnacle body.

static BodyIndex Reaver { get; }

Only valid after BodyCatalog is available. This is the index of the Void Reaver body.

static BodyIndex Jailer { get; }

Only valid after BodyCatalog is available. This is the index of the Void Jailer body.

static BodyIndex Devastator { get; }

Only valid after BodyCatalog is available. This is the index of the Void Devastator body.

static BodyIndex ReaverAlly { get; }

Only valid after BodyCatalog is available. This is the index of the Void Reaver body, from the Newly Hatched Zoea.

static BodyIndex JailerAlly { get; }

Only valid after BodyCatalog is available. This is the index of the Void Jailer body, from the Newly Hatched Zoea.

static BodyIndex DevastatorAlly { get; }

Only valid after BodyCatalog is available. This is the index of the Void Devastator body, from the Newly Hatched Zoea.

Public Methods

static bool IsImmuneToVoidFog(BodyIndex bodyIndex)

Provided a BodyIndex for a vanilla or modded survivor or character, this method returns whether or not that body has been registered such that it is, at this exact point in time, immune to damage from Void Fog. This can be toggled for vanilla Void monsters hence why it is dependent on the time.

static bool CanCharacterInstakillMonsters(BodyIndex bodyIndex)

This capability method returns whether or not the provided BodyIndex represents a character that is able to instantly kill monsters with its black hole.

static bool CanCharacterInstakillBosses(BodyIndex bodyIndex)

This capability method returns whether or not the provided BodyIndex represents a character that is able to instantly kill bosses with its black hole.

static bool CanCharacterFriendlyFire(BodyIndex bodyIndex)

This capability method returns whether or not the provided BodyIndex represents a character that is able to instantly kill players and other team-mates with its black hole.

static float GetFallbackDamage(BodyIndex bodyIndex)

This capability method returns the damage multiplier to use if the provided BodyIndex is not capable of instantly killing the applicable target with a black hole.

static void RegisterAsVoidEntity(BaseUnityPlugin registrar, BodyIndex bodyIndex)

Instructs the system to treat this body as a Void character, registering it for use with all of the previous capability methods as well as granting it Void Fog immunity.

static bool IsVoidSurvivor(BodyIndex index)

Returns whether or not the provided BodyIndex has been registered as a void entity (see RegisterAsVoidEntity). This method name is marginally misleading as it applies to all bodies, not just survivors.

static bool VerifyProperConstruction(CharacterBody body)

Observes the properties and other attributes of the provided CharacterBody, outputting messages into the log if anything is not set up in a way that functions alongside this API (for example, if the body is immune to Void Death, this will raise a warning in the console).

static void RegisterBlackHoleBehaviorOverrides(BaseUnityPlugin registrar, BodyIndex bodyIndex, ConfigEntry<bool> useModSettings, ReplicatedConfigEntry<bool> allowInstakillMonsters, ReplicatedConfigEntry<bool> allowInstakillBosses, ReplicatedConfigEntry<bool> allowFriendlyFire, ReplicatedConfigEntry<float> fallbackDamage)

Consider using CreateAndRegisterBlackHoleBehaviorConfigs. This method receives replicated configuration entries and binds them to a registry that is used for the various capability methods above.

static void CreateAndRegisterBlackHoleBehaviorConfigs(BaseUnityPlugin registrar, AdvancedConfigBuilder aCfg, BodyIndex bodyIndex)

Automatically creates and registers (via RegisterBlackHoleBehaviorOverrides) the replicated configuration options for all of the capability methods above.

static string BuildBlackHoleDescription(BodyIndex bodyIndex, bool lowercaseStart = false)

This is a utility method for localization. It uses the config proxy system (see RegisterBlackHoleBehaviorOverrides) to build a string that describes what a black hole implosion does to various target types.