@ChimpLogik That wasn't me :D Also, that code will get the abilities from the combatant's settings, not the current list of abilities the combatant has.
To get the combatant's current abilities: List<AbilityShortcut> abilities = combatant.Abilities.GetAbilities(UseableIn.Field, IncludeCheckType.Yes, false) This'll get all active abilities that are useable in the field, or use UseableIn.Battle for battle abilities, or UseableIn.Both for abilities that are available in both battle and field.
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Something like this might help
private void Start()
{
Combatant combatant = GamingIsLove.ORKFramework.ORKComponentHelper.GetCombatant(gameObject);
if (combatant != null && combatant.Abilities.HasAbilities)
{
CombatantSetting combatantSetting = combatant.Setting;
LearnAbility[] abilitiesLearnt = combatantSetting.abilityDevelopment.atLevel;
foreach(LearnAbility learnAbility in abilitiesLearnt)
{
AbilityShortcut ability = learnAbility.ability.GetAbility(combatant);
Debug.Log($"Ability: {ability.GetName()} level {ability.GetLevel()}");
}
}
}
That wasn't me :D
Also, that code will get the abilities from the combatant's settings, not the current list of abilities the combatant has.
To get the combatant's current abilities:
List<AbilityShortcut> abilities = combatant.Abilities.GetAbilities(UseableIn.Field, IncludeCheckType.Yes, false)
This'll get all active abilities that are useable in the field, or use UseableIn.Battle for battle abilities, or UseableIn.Both for abilities that are available in both battle and field.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you @RustedGames and thank you Nicholas!