Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
BaseAbilityInfo Class Referenceabstract

Detailed Description

summary> This is an abstract scriptable object that all abilities inherit from. Important: as of writing, passive abilities work the same as all other abilities, rather than always being active. This contains the basic functionality for abilities. If you want to make your own ability, inherit from this! Every ability info must replace the four abstract functions, and can optionally add to the virtual functions too.

Documentation updated 8/13/2024

Author
Roy Pascual, Stephen Nuttall
Note
This (any anything that inherits from it) is a scriptable object, meaning you can make an instance of it in the Unity Editor that exists in the file explorer.

Basic Ability Info

Basic information about this ability set. Includes basic functionality like the ability's current level, identifying information like the ability's name and ID, and UI related information like what icons to use and what the descriptions of each ability in the set should be.

int abilityID
 A number that is used to identify the ability info object, usually to determine if two ability infos are the same.
 
string abilityName = "DEFAULT_ABILITY"
 A string that is used to identify the ability, as well as display its name in UIs.
 
Sprite overlapIcon
 Sprite used to represent the ability in UI elements, such as the ability inventory and ability hotbar.
 
List< Sprite > abilityIcons
 The icons for each of the ability’s forms: offense, defense, utility, and passive.
 
EventReference onCooldownSound
 Reference to the sound that plays when the player tries to use an ability that's currently on cooldown.
 
int abilityLevel = 0
 Current level of the ability. The ability is locked at level 0.
 
int maxLevel = 3
 The maximum level the ability can be upgraded to.
 
List< int > upgradeSoulCosts
 The soul cost of the upgrades for the ability at each level.
 
List< int > upgradeGodsoulCosts
 The godsoul cost of the upgrades for the ability at each level.
 
string[] abilityNames
 Name of each ability in the set. Only used to display in UIs.
 
string[] abilityDescriptions
 Description of what each ability in the set does. Only used to display in UIs.
 
string godQuote
 A quote from this god that can be displayed in UIs.
 

Advanced Ability Info

More advanced information, such as what form the ability set is currently in, cool down duration, and tick rate. Some unimplemented/deprecated features are also included, namely baseCost and damage. Additionally, some of these features need to be adapted to be configurable for each ability in the set, rather than for the set as a whole.

AbilityForm currentForm
 Which of the 4 abilities in the set are currently in use.
 
int baseCost = 0
 Unimplemented feature that would see abilities cost a currency to use.
 
float duration = 0f
 How long (in seconds) the ability should last for.
 
float tickRate = 0f
 How many times a second AbilityUpdate() is run. Use for things like repeatedly regenerating health.
 
float chargeUp = 0f
 How long (in seconds) the ability’s charge up should last for.
 
float cooldown = 0f
 How long (in seconds) the ability’s cooldown should last for.
 
int damage = 0
 Unimplemented feature that's occasionally used when an ability needs a damage value.
 

Ability Effect Info

Each ability has a list of effects it can apply while active.

List< AbilityEffectoffenseEffects
 List of effects the offense ability will trigger.
 
List< AbilityEffectdefenseEffects
 List of effects the defense ability will trigger.
 
List< AbilityEffectutilityEffects
 List of effects the utility ability will trigger.
 
List< AbilityEffectpassiveEffects
 List of effects the passive ability will trigger.
 

Abstract Functions

These functions are where you add the functionality for your 4 abilities in this set. They must be overridden in any class inheriting from BaseAbilityInfo.cs.

void AbilityOffense (AbilityOwner abilityOwner)
 The functionality for the offense ability goes here!
 
void AbilityDefense (AbilityOwner abilityOwner)
 The functionality for the defense ability goes here!
 
void AbilityUtility (AbilityOwner abilityOwner)
 The functionality for the utility ability goes here!
 
void AbilityPassiveEnable (AbilityOwner abilityOwner)
 The functionality for the passive ability goes here! This function will automatically run when the ability is equipped.
 
void AbilityPassiveDisable (AbilityOwner abilityOwner)
 Use thus function will disable the functionality of the passive ability. This function will automatically run when the ability is unequipped.
 

Virtual Functions

These functions can be optionally overridden to add extra functionality. They can be left untouched if you do not need to change them.

virtual void ApplyEffects (AbilityOwner abilityOwner, AbilityForm abilityForm, AbilityEffectType applyType)
 Applies all effects for the given ability form.
 
virtual void DisableEffects (AbilityOwner abilityOwner, AbilityForm abilityForm, AbilityEffectType disableType)
 Disables all effects for the given ability form.
 
virtual void AbilityUpdate (AbilityOwner abilityOwner)
 Runs every tickRate seconds while the ability is active. Useful for things like repeatedly regenerating health.
 
virtual void AbilityActivate (AbilityOwner abilityOwner)
 Runs the ability function of the given form.
 
virtual void DisablePassive (AbilityOwner abilityOwner)
 Disables the passive ability if the.
 
virtual void AbilityDisable (AbilityOwner abilityOwner, AbilityEffectType effectType)
 Runs when the ability duration runs out. Disables effects.
 
virtual void OnEquipped (AbilityOwner abilityOwner)
 Runs when the ability is equipped.
 
virtual void OnUnequipped (AbilityOwner abilityOwner)
 Runs when the abiility is unequipped.
 

General Functions

These functions (mostly getters) handle basic functionality that all abilities should have. They cannot be changed by classes inheriting from BaseAbilityInfo.cs.

void UpgradeAbility ()
 Increases the level by one, unless already at max level.
 
string GetAbilityName (AbilityForm form)
 Returns the name of the given ability form.
 
string GetAbilityDescription (AbilityForm form)
 Returns the description of the given ability form.
 
string[] GetAllAbilityNames ()
 Returns all the names of the abilities in each set.
 
string[] GetAllAbilityDescriptions ()
 Returns all the descriptions of the abilities in each set.
 
string GetQuote ()
 Returns all the god's quote for this ability.
 

Member Function Documentation

◆ AbilityActivate()

virtual void BaseAbilityInfo.AbilityActivate ( AbilityOwner abilityOwner)
virtual

Runs the ability function of the given form.

◆ AbilityDefense()

void BaseAbilityInfo.AbilityDefense ( AbilityOwner abilityOwner)
abstractprotected

The functionality for the defense ability goes here!

◆ AbilityDisable()

virtual void BaseAbilityInfo.AbilityDisable ( AbilityOwner abilityOwner,
AbilityEffectType effectType )
virtual

Runs when the ability duration runs out. Disables effects.

Reimplemented in ExampleAbilityInfo, and StatAbilityInfo.

◆ AbilityOffense()

void BaseAbilityInfo.AbilityOffense ( AbilityOwner abilityOwner)
abstractprotected

The functionality for the offense ability goes here!

◆ AbilityPassiveDisable()

void BaseAbilityInfo.AbilityPassiveDisable ( AbilityOwner abilityOwner)
abstractprotected

Use thus function will disable the functionality of the passive ability. This function will automatically run when the ability is unequipped.

◆ AbilityPassiveEnable()

void BaseAbilityInfo.AbilityPassiveEnable ( AbilityOwner abilityOwner)
abstractprotected

The functionality for the passive ability goes here! This function will automatically run when the ability is equipped.

◆ AbilityUpdate()

virtual void BaseAbilityInfo.AbilityUpdate ( AbilityOwner abilityOwner)
virtual

Runs every tickRate seconds while the ability is active. Useful for things like repeatedly regenerating health.

Reimplemented in ExampleAbilityInfo, and ExEffectAbilityInfo.

◆ AbilityUtility()

void BaseAbilityInfo.AbilityUtility ( AbilityOwner abilityOwner)
abstractprotected

The functionality for the utility ability goes here!

◆ ApplyEffects()

virtual void BaseAbilityInfo.ApplyEffects ( AbilityOwner abilityOwner,
AbilityForm abilityForm,
AbilityEffectType applyType )
protectedvirtual

Applies all effects for the given ability form.

Parameters
abilityOwnerAn object that, among other things, stores what ability in the set is currently is use.
abilityFormThe ability in the set (offense, defense, utility, passive) that we want to apply the effects of.
applyTypeDescribes the way we want the ability to be applied.

◆ DisableEffects()

virtual void BaseAbilityInfo.DisableEffects ( AbilityOwner abilityOwner,
AbilityForm abilityForm,
AbilityEffectType disableType )
protectedvirtual

Disables all effects for the given ability form.

Parameters
abilityOwnerAn object that, among other things, stores what ability in the set is currently is use.
abilityFormThe ability in the set (offense, defense, utility, passive) that we want to remove the effects of.
applyTypeDescribes the way the ability is applied.

◆ DisablePassive()

virtual void BaseAbilityInfo.DisablePassive ( AbilityOwner abilityOwner)
virtual

Disables the passive ability if the.

◆ GetAbilityDescription()

string BaseAbilityInfo.GetAbilityDescription ( AbilityForm form)

Returns the description of the given ability form.

◆ GetAbilityName()

string BaseAbilityInfo.GetAbilityName ( AbilityForm form)

Returns the name of the given ability form.

◆ GetAllAbilityDescriptions()

string[] BaseAbilityInfo.GetAllAbilityDescriptions ( )

Returns all the descriptions of the abilities in each set.

◆ GetAllAbilityNames()

string[] BaseAbilityInfo.GetAllAbilityNames ( )

Returns all the names of the abilities in each set.

◆ GetQuote()

string BaseAbilityInfo.GetQuote ( )

Returns all the god's quote for this ability.

◆ OnEquipped()

virtual void BaseAbilityInfo.OnEquipped ( AbilityOwner abilityOwner)
virtual

Runs when the ability is equipped.

Reimplemented in GebAbilityInfo.

◆ OnUnequipped()

virtual void BaseAbilityInfo.OnUnequipped ( AbilityOwner abilityOwner)
virtual

Runs when the abiility is unequipped.

Reimplemented in GebAbilityInfo.

◆ UpgradeAbility()

void BaseAbilityInfo.UpgradeAbility ( )

Increases the level by one, unless already at max level.

Member Data Documentation

◆ abilityDescriptions

string [] BaseAbilityInfo.abilityDescriptions
private

Description of what each ability in the set does. Only used to display in UIs.

◆ abilityIcons

List<Sprite> BaseAbilityInfo.abilityIcons

The icons for each of the ability’s forms: offense, defense, utility, and passive.

◆ abilityID

int BaseAbilityInfo.abilityID

A number that is used to identify the ability info object, usually to determine if two ability infos are the same.

◆ abilityLevel

int BaseAbilityInfo.abilityLevel = 0

Current level of the ability. The ability is locked at level 0.

◆ abilityName

string BaseAbilityInfo.abilityName = "DEFAULT_ABILITY"

A string that is used to identify the ability, as well as display its name in UIs.

◆ abilityNames

string [] BaseAbilityInfo.abilityNames
private

Name of each ability in the set. Only used to display in UIs.

◆ baseCost

int BaseAbilityInfo.baseCost = 0

Unimplemented feature that would see abilities cost a currency to use.

Deprecated
There are currently no plans for abilities to have a cost to them.

◆ chargeUp

float BaseAbilityInfo.chargeUp = 0f

How long (in seconds) the ability’s charge up should last for.

Todo
This functionality should be expanded to be configurable for each ability, not all 4 at the same time. Right now, changing the cooldown changes it for all 4 abilities, which may not be desirable.

◆ cooldown

float BaseAbilityInfo.cooldown = 0f

How long (in seconds) the ability’s cooldown should last for.

Todo
This functionality should be expanded to be configurable for each ability, not all 4 at the same time. Right now, changing the cooldown changes it for all 4 abilities, which may not be desirable.

◆ currentForm

AbilityForm BaseAbilityInfo.currentForm

Which of the 4 abilities in the set are currently in use.

◆ damage

int BaseAbilityInfo.damage = 0

Unimplemented feature that's occasionally used when an ability needs a damage value.

Deprecated
While it can be used, it generally makes more sense to make your own damage variable.

◆ defenseEffects

List<AbilityEffect> BaseAbilityInfo.defenseEffects

List of effects the defense ability will trigger.

◆ duration

float BaseAbilityInfo.duration = 0f

How long (in seconds) the ability should last for.

Todo
This functionality should be expanded to be configurable for each ability, not all 4 at the same time. Right now, changing the cooldown changes it for all 4 abilities, which may not be desirable.

◆ godQuote

string BaseAbilityInfo.godQuote
private

A quote from this god that can be displayed in UIs.

◆ maxLevel

int BaseAbilityInfo.maxLevel = 3

The maximum level the ability can be upgraded to.

◆ offenseEffects

List<AbilityEffect> BaseAbilityInfo.offenseEffects

List of effects the offense ability will trigger.

◆ onCooldownSound

EventReference BaseAbilityInfo.onCooldownSound

Reference to the sound that plays when the player tries to use an ability that's currently on cooldown.

◆ overlapIcon

Sprite BaseAbilityInfo.overlapIcon

Sprite used to represent the ability in UI elements, such as the ability inventory and ability hotbar.

◆ passiveEffects

List<AbilityEffect> BaseAbilityInfo.passiveEffects

List of effects the passive ability will trigger.

◆ tickRate

float BaseAbilityInfo.tickRate = 0f

How many times a second AbilityUpdate() is run. Use for things like repeatedly regenerating health.

◆ upgradeGodsoulCosts

List<int> BaseAbilityInfo.upgradeGodsoulCosts

The godsoul cost of the upgrades for the ability at each level.

◆ upgradeSoulCosts

List<int> BaseAbilityInfo.upgradeSoulCosts

The soul cost of the upgrades for the ability at each level.

◆ utilityEffects

List<AbilityEffect> BaseAbilityInfo.utilityEffects

List of effects the utility ability will trigger.


The documentation for this class was generated from the following file: