Eye of the Nile Docs
Everything you need to know to get started!
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
StatAbilityInfo Class Reference

Detailed Description

This is an example of an ability set that uses stat modifiers for each ability. This script is useful for copy-pasting into your own ability info if you want the same functionality.

The initializing part at the top is only necessary if you expect to be applying multiple effects, but do not want them applied at the same time. Honestly, it can probably be made to be much simpler.

For now, if you're looking to make your own ability, you can probably get away with copying the passive ability in RockAbilityInfo. You can make the effect expire by using RemoveModifier() in AbilityDisable().

Documentation updated 8/14/2024

Author
Roy Pascual
Note
This is a scriptable object, meaning you can make an instance of it in the Unity Editor that exists in the file explorer.

Public Member Functions

override void AbilityDisable (AbilityOwner abilityOwner, AbilityEffectType effectType)
 Runs when the ability duration runs out. Disables effects.
 
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 OnEquipped (AbilityOwner abilityOwner)
 Runs when the ability is equipped.
 
virtual void OnUnequipped (AbilityOwner abilityOwner)
 Runs when the abiility is unequipped.
 
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.
 

Public Attributes

List< StatModifierstatMods
 
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.
 
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.
 
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.
 

Protected Member Functions

override void AbilityOffense (AbilityOwner abilityOwner)
 
override void AbilityDefense (AbilityOwner abilityOwner)
 
override void AbilityUtility (AbilityOwner abilityOwner)
 
override void AbilityPassiveEnable (AbilityOwner abilityOwner)
 
override void AbilityPassiveDisable (AbilityOwner abilityOwner)
 removes the max health increase.
 
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 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.
 

Properties

Dictionary< string, StatModifier_StatModDict [get, set]
 

Private Member Functions

void StatModDictInitializer ()
 
void Awake ()
 

Private Attributes

Dictionary< string, StatModifier_statModDictField
 
string currentStat = "Damage"
 

Member Function Documentation

◆ AbilityDefense()

override void StatAbilityInfo.AbilityDefense ( AbilityOwner abilityOwner)
protected

◆ AbilityDisable()

override void StatAbilityInfo.AbilityDisable ( AbilityOwner abilityOwner,
AbilityEffectType effectType )
virtual

Runs when the ability duration runs out. Disables effects.

Reimplemented from BaseAbilityInfo.

◆ AbilityOffense()

override void StatAbilityInfo.AbilityOffense ( AbilityOwner abilityOwner)
protected

◆ AbilityPassiveDisable()

override void StatAbilityInfo.AbilityPassiveDisable ( AbilityOwner abilityOwner)
protected

removes the max health increase.

◆ AbilityPassiveEnable()

override void StatAbilityInfo.AbilityPassiveEnable ( AbilityOwner abilityOwner)
protected

◆ AbilityUtility()

override void StatAbilityInfo.AbilityUtility ( AbilityOwner abilityOwner)
protected

◆ Awake()

void StatAbilityInfo.Awake ( )
private

◆ StatModDictInitializer()

void StatAbilityInfo.StatModDictInitializer ( )
private

Member Data Documentation

◆ _statModDictField

Dictionary<string, StatModifier> StatAbilityInfo._statModDictField
private

◆ currentStat

string StatAbilityInfo.currentStat = "Damage"
private

◆ statMods

List<StatModifier> StatAbilityInfo.statMods

Property Documentation

◆ _StatModDict

Dictionary<string, StatModifier> StatAbilityInfo._StatModDict
getsetprivate

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