Skip to content

Latest commit

 

History

History
806 lines (517 loc) · 30.6 KB

AdventureBackpacksAPI.md

File metadata and controls

806 lines (517 loc) · 30.6 KB

AdventureBackpacksAPI

Contents

ABAPI type

Namespace

AdventureBackpacks.API

Summary

Adventure Backpacks API. Be sure to include the AdventureBackpacksAPI.dll as a dependency to your project.

CanOpenBackpack(player) method

Summary

Determines if the player is capable of currently opening the equipped backpack.

Returns

true or false

Parameters
Name Type Description
player Player Player, usually Player.m_localPlayer

GetActiveBackpackStatusEffects() method

Summary

Retrieves the current Active Backpack StatusEffects running in the local players game.

Returns

HashSet of Status Effects.

Parameters

This method has no parameters.

GetBackpack(itemData) method

Summary

Returns Backpack object of the provided itemData. Operates similarly to a TryGet but with a nullable type.

Returns

Nullable Backpack Object. Check HasValue.

Parameters
Name Type Description
itemData ItemDrop.ItemData ItemDrop.ItemData object

GetEquippedBackpack(player) method

Summary

Returns a Backpack object if the provided Player is currently wearing a backpack.

Returns

Nullable Backpack Object

Parameters
Name Type Description
player Player Player, usually Player.m_localPlayer

GetRegisterdStatusEffects() method

Summary

Retrieves all Status Effects Registered with Adventure Backpacks

Returns

HashSet of Status Effects.

Parameters

This method has no parameters.

IsBackpack(itemData) method

Summary

When provided with an ItemData object, will detect whether the Item is an Adventure Backpack or not.

Returns

true or false

Parameters
Name Type Description
itemData ItemDrop.ItemData This is the ItemDrop.ItemData object of the item.

IsBackpackEquipped(player) method

Summary

Determines if the Player provided is currently wearing a backpack.

Returns

true or false

Parameters
Name Type Description
player Player Player, usually Player.m_localPlayer

IsLoaded() method

Summary

Notifies if the ABAPI is active or not.

Returns

true of false

Parameters

This method has no parameters.

IsThisBackpackEquipped(player,itemData) method

Summary

Determines if the player provided is wearing the item provided and that it's a backpack.

Returns

true or false. If item provided is not a backpack, will return false.

Parameters
Name Type Description
player Player Player, usually Player.m_localPlayer
itemData ItemDrop.ItemData Any ItemData

OpenBackpack(player,gui) method

Summary

Method to activate the backpack on the local player's GUI and open it. Use in conjunction with CanOpenBackpack()

Parameters
Name Type Description
player Player Player, usually Player.m_localPlayer
gui InventoryGui The instance of InventoryGui

RegisterBackpack(definition) method

Summary

Use this method in the Awake() of your mod to register a new Backpack that can be utilized on Adventure Backpacks.

Parameters
Name Type Description
definition AdventureBackpacks.API.ABAPI.BackpackDefinition Create a new BackpackDefinition that contains the overall parameters that are needed to register the new backpack.

RegisterEffect(effectDefinition) method

Summary

Use this method in the Awake() of your mod to register a Status Effect that can be utilized on Adventure Backpacks

Parameters
Name Type Description
effectDefinition AdventureBackpacks.API.ABAPI.EffectDefinition Create a new EffectDefinition that contains the overall parameters that are needed to register the new effect.

Backpack type

Namespace

AdventureBackpacks.API.ABAPI

Summary

Instanced Backpack Information

Definition constants

Summary

Definition of the Backpack item

Inventory constants

Summary

Inventory object of the configured backpack

ItemData constants

Summary

ItemData representative of the Backpack

Name constants

Summary

Backpack Name

BackpackBiomes type

Namespace

AdventureBackpacks.API

Summary

This is a Flags enum for determining Backpack Biomes. This is not representative of Heightmap.Biomes. This is instead a way of creating sets of Effects. Default Adventure Backpacks will utilize Biome names. Custom External Effects can pick and choose between the Custom Effect flags as well.

Ashlands constants

Summary

Ashland Backpack Effects

BlackForest constants

Summary

Black Forest Backpack Effects

DeepNorth constants

Summary

DeepNorth Backpack Effects

EffectBiome1 constants

Summary

Custom Biome for use with External Effects

EffectBiome2 constants

Summary

Custom Biome for use with External Effects

EffectBiome3 constants

Summary

Custom Biome for use with External Effects

EffectBiome4 constants

Summary

Custom Biome for use with External Effects

EffectBiome5 constants

Summary

Custom Biome for use with External Effects

Meadows constants

Summary

Meadows Backpack Effects

Mistlands constants

Summary

Mistlands Backpack Effects

Mountains constants

Summary

Mountains Backpack Effects

None constants

Summary

None, no backpack effects are applied.

Plains constants

Summary

Plains Backpack Effects

Swamp constants

Summary

Swamp Backpack Effects

BackpackDefinition type

Namespace

AdventureBackpacks.API.ABAPI

Summary

Backpack Definition Settings Use this object to create backpack definitions for adding Backpacks to Adventure Backpacks. You can use either the GameObject directly, or provide your AssetBundle object and the PrefabName.

#ctor() constructor

Summary

Default Constructor

Parameters

This constructor has no parameters.

#ctor(backPackGo) constructor

Summary

Use this constructor when adding a backpack using the GameObject The item should have ItemDrop.ItemData on the item, and it should be an item that is utilizing the Shoulder slot. Equipped Detection won't detect if not in the shoulder slot. TODO: Make this more flexible for additional slots through AzuEPI

Parameters
Name Type Description
backPackGo UnityEngine.GameObject GameObject of

#ctor(assetBundle,prefabName) constructor

Summary

Use this constructor when adding a backpack using the AssetBundle and Prefab Name The item should have ItemDrop.ItemData on the item, and it should be an item that is utilizing the Shoulder slot. Equipped Detection won't detect if not in the shoulder slot. TODO: Make this more flexible for additional slots through AzuEPI

Parameters
Name Type Description
assetBundle UnityEngine.AssetBundle Provide the Asset Bundle that contains the backpack prefab
prefabName System.String Prefab name of the backpack

AssetBundle constants

Summary

Asset Bundle containing the Backpack (Not required if GameObject is provided)

BackPackGo constants

Summary

Backpack GameObject (Not required if AssetBundle and Prefab Name are provided)

BackpackBiome constants

Summary

Provides the configured biomes settings applied to the backpack. This is flag enum. (e.g. "BackpackBiomes.Meadows" or "BackpackBiomes.Meadows | BackpackBiomes.BlackForest" to select multiple biomes.

BackpackSizeByQuality constants

Summary

Dictionary of Vector2's that contain the x and y sizing of the backpack at each Quality level' Dictionary key is the Item's Quality level. Dictionary value is the Vector2 object.

CarryBonus constants

Summary

Provides the additional carry weight bonus applied to backpacks. For registering a new backpack, this is the default value.

ConfigSection constants

Summary

Custom Configuration Section Name in Adventure Backpacks. If left empty, will use default section name. (e.g. Backpack: {$backpack_itemname} )

CraftingTable constants

Summary

Name of Crafting Table that the Backpack can be crafted at. If left empty, will disable crafting at any table. Can also include custom table names. (e.g. piece_workbench, forge, piece_stonecutter)

DropsFrom constants

Summary

List of Ingredients for Upgrading.

EffectsToApply constants

Summary

Dictionary of StatusEffect's to apply to the backpack when equipped. Dictionary Key is the BackpackBiome that needs to be applied to the Backpack for Effect to be activated. Dictionary Value is a Key Value Pair of a Status Effect to apply: Key of the KVP is the actual Status Effect Value of the KVP is the default int Quality level that of the backpack before the effect is applied. (examples of the quality level: 1 - 4) Use GetRegisteredStatusEffects() to determine which status effect Adventure Backpacks is aware of. Use RegisterEffect() first to register new status effects.

EnableFreezing constants

Summary

Provides whether the wearer of the backpack will freeze or not.

ItemName constants

Summary

Item Name of the Backpack. Use the $_name localize token. (e.g. $vapok_mod_rugged_backpack)

ItemSetStatusEffect constants

Summary

When backpack is equipped, set what the Set Effect Status Effect Should. If left empty, none will be equipped. Note: Be sure this is one of the effects included in EffectsToApply.

MaxRequiredStationLevel constants

Summary

Max Crafting Station Level to upgrade, and repair. (e.g. 1, 2, etc.)

PrefabName constants

Summary

Prefab Name of the Backpack Asset (Not required if GameObject is provided)

RecipeIngredients constants

Summary

List of Recipe Ingredients.

SpeedMod constants

Summary

Provides the Speed Modification that is applied on the backpack. For registering a new backpack, this is the default value.

StationLevel constants

Summary

Minimum Level of Crafting Table Station before Bag can be crafted (e.g. 1, 2, etc.)

UpgradeIngredients constants

Summary

List of Ingredients for Upgrading.

WeightMultiplier constants

Summary

Provides the configured weight multiplier that reduces the weight of the items in the backpack. For registering a new backpack, this is the default value.

DropTarget type

Namespace

AdventureBackpacks.API.ABAPI

Summary

Configuration of Drop Target

#ctor(creature,chance,min,max) constructor

Summary

Drop Target Constructor

Parameters
Name Type Description
creature System.String Prefab name of Creature
chance System.Single Chance to Drop Float
min System.Int32 Minimum amount to drop.
max System.Nullable{System.Int32} Max amount to drop.

Chance constants

Summary

Configured Drop Chance

Creature constants

Summary

Prefab name of creature

Max constants

Summary

Maximum number of items that can drop.

Min constants

Summary

Min number of items that can drop.

EffectDefinition type

Namespace

AdventureBackpacks.API.ABAPI

Summary

Create anew EffectDefinition in order to register status effects.

#ctor(name,localizedName,effectName,description,statusEffect) constructor

Summary

Create anew EffectDefinition in order to register status effects.

Parameters
Name Type Description
name System.String
localizedName System.String
effectName System.String
description System.String
statusEffect StatusEffect

Description constants

Summary

Description of the Status Effect. Shows up in Configuration.

EffectName constants

Summary

This is the registered Effect name (e.g. SetEffect_NecromancyArmor or SE_Demister)

LocalizedName constants

Summary

This is the Localized Translated Effect Name. This is used in places like the Configuration and in the HUD/GUI (e.g. "Water Resistance").

Name constants

Summary

This is the Effect Name. (e.g. "$some_effect_name").

StatusEffect constants

Summary

This is your actual Status Effect from your own asset bundle or from another source. As long as it's of the type SE_Stats, you can use it.

RecipeIngredient type

Namespace

AdventureBackpacks.API.ABAPI

Summary

Defines a Recipe Ingredient

#ctor(itemPrefabName,quantity) constructor

Summary

Create Ingredient Object

Parameters
Name Type Description
itemPrefabName System.String Item Prefab Name
quantity System.Int32 Amount of item to consume.

ItemPrefabName constants

Summary

Prefab Name of Item to include as a recipe ingredient

Quantity constants

Summary

Amount of Item required.