Ability
Note: This page is in process of being rewritten.
Overview
The Ability System is used to handle Spells, Talents, Skills, and Item Abilities in Dragon Age.
Detailed Description
Basic Ability Types
There are 3 basic ability types in the game, defined by the field 'use_type' in abi_base.xls.
Passive Abilities
Passive abilities (use_type = 3) grant persistent or conditionally persistent bonuses or penalties to the creature that has the ability.
A passive ability may grant up to 3 modifications to creature properties (properties.xls). Those modifications are defined in the passive_abilities worksheet of abi_base.xls and linked to the ability through the passive_id column in abi_base.xls.
Additionally, the bonuses of an ability can be made conditional on the character's current 'wield mode' (2-handed, dual, weapon & shield, or universal) through the conditional integer field on the passive_abilities worksheet.
Finally, a number of passive abilities do not define any property modifications in passive_abilites but instead have checks coded against their Ids (e.g. HasAbility(oCreature, ABILITY_TALENT_LETHALITY)) directly in the combat resolution scripts. The mere presence of the ability on a creature causes a different code path to be taken in the scripts in those cases.
Note that passive_ability benefits are not limited to abilities with use_type 3. Some active abilities also grant additional property modifying benefits to the owner.
Sustained Abilities
Sustained abilities (use_type = 2) are turned on and off per character and, while turned on, grant effects or property modifications to the user. Most 'buffs' are implemented this way.
Only members of the player's party are using sustained ability as the code overhead required to track them is too expensive to be used on monsters that only exist to die in an encounter with the player's party. (These creatures use duration based effects to emulate similar abilities instead).
Most sustained abilities follow the same pattern:
- They do not have any activation cost, encouraging tactical use of buffs.
- They increase the users Fatigue property, therefore increasing the activation cost of all other abilities.
- They reduce the users maximum available mana or stamina by a constant value.
- They use cooldown to prevent the user from being too opportunistic with their use.
- Some abilities shut down when the user reaches 0 mana/stamina. Very powerful abilities (such as Momentum) have an associated stamina/mana drain effect to limit their use to a short or medium period of time. Creative item / buff use can be used to increase the length such an ability can be sustained.
Some sustained abilities (such as Flaming Weapons) are active 'party-wide' - the caster not only sustains the ability on himself but on all his party members as well. This is controlled by the 'bPartyWide' flag in abi_base.xls. Due to implementation limitations, party members who die or otherwise enter/exit the current party will not be affected by these abilities until they are recast. (we put low cooldown times on these abilities for that very reason).
Gameplay Design Note
|
Activated Abilities
Activated abilities (use_type = 4) are abilities that instantly execute their effect (see Targeting Behavior below). Most melee talents or targeted spells fall in this category. There are several sub-types of activated abilies, such as
- Targeted, single target spells and talents (such as Winter's Grasp or Flurry)
- Ground targeted abilities (such as Blizzard or various Glyphs)
- Self targeted activated abilities.
Targeting Behavior
An abilities targeting behavior is controlled by several settings in abi_base.xls
AutoTarget is a boolean field that defines how the UI resolves targeting.
0 | The UI will always bring up a targeting cursor. |
1 | The UI will only produce a targeting cursor if no suitable target is currently selected. e.g if the player currently has a hostile creature targeted and if the spells TargetType includes 0x4 (hostile), the ability will trigger immediately, not producing a targeting cursor. Most single target spells and talents use this setting. |
Regardless of AutoTarget setting, the UI will never produce a targeting cursor if an ability is type 0x1 (self) -
TargetType is a bit mask derived from the following table and controls the behavior of the UI's targeting cursor.
Bitmask | Effect |
0x1 | Self |
0x2 | Friendly Creature |
0x4 | Hostile Creature |
0x8 | Placeable Object |
0x10 | Area of Effect Object (deprecated) |
0x20 | Ground (see details) |
0x40 | Dead Body (deprecated) |
0x80 | Party Member |
AutoDraw is an integer boolean field that defines how a character's weapons are handled when the ability is triggered.
0 | The ability will not affect the player's weapon sheath status. |
1 | The engine will force the player to draw/unsheathe his weapon before executing the ability. This is used for most bow and melee weapon abilities. |
2 | The engine will force the player to stow away any non staff melee weapons before executing the ability. This is used to ensure that no inappropriate animations play with weapons drawn (e.g. the player conjuring with a sword clipping through his body) and to discourage switching between melee and spellcasting on the fly. |