Combat mechanics (Inquisition)

Combat mechanics comprise the technical details relevant to combat in Dragon Age: Inquisition.
== Damage ==
Simplified logic for player vs enemy damage:
damage = (random between 0.95 and 1.05) * damage
if physical and not rune
 effectiveArmor = armor * (1 - armorPenetration)
 damage = damage - effectiveArmor
 if critical
 damage = max(2, damage)
 else
 damage = max(1, damage)
isMeleeRange = distance less than 3 meters
if flanking
 if not isMeleeRange
 flankingBonus = max(0, flankingBonus - 25%)
else
 flankingBonus = 0
damage = damage * (1 + abilityBonus)
damage = damage * (1 + damageMultiplier + typeBonus + attackBonus)
damage = damage * (1 + criticalBonus + flankingBonus)
damage = damage * (1 - resistance)
if physical
 if isMeleeRange
 defense = defenseMelee
 else
 defense = defenseRanged
else
 defense = defenseMagic
damage = damage * (1 - defense)
if shielded and not flanking
 damage = damage * 0.5
== Guard ==
== Barrier ==
Barrier provides protection from damage from incoming attacks and has a finite protection amount. Barrier effects slowly dissipate until they are no more. Various mage abilities can increase the strength and duration of barrier effects. Certain abilities and items give bonuses to damage done to barriers.
Simplified logic for maximum Barrier applied to a target:
barrier_max = (base_weapon + 10) * 48 - 300 
 * (1 + strength_of_the_spirits_bonus + ring_bonus) 
 * stat_barrier_multiplier
where
 base_weapon is the caster's base weapon damage.
 strength_of_the_spirits_bonus is 0.5 if the caster has Strength of the Spirits, otherwise 0.
 ring_bonus is 0.3 if one Enhanced Barrier Ring is equipped, 0.6 if two, or 0 if none.
 stat_barrier_multiplier is typically 1.0.
Full details on how maximum Barrier is computed can be found at DA3/Scripts/compute_barrier_max_fromweapon_script
function compiledlua_0832cb4b_f2d1_53d8_7f26_ac04c40267af( TimelineContext,BWStat,BarrierTag,RingAbilityTag,Stat_Barrier_Multiplier )
 --function <guid>( arg1, arg2, arg3) <<- Inserted by the Pipeline
 do
 statCharacter = DA3.GetCasterCharacter(TimelineContext)
 targetCharacter = DA3.GetOwnerCharacter(TimelineContext)
 if DA3.IsMultiplayer() then
 statValue = ((DA3.GetStatTotalValue(statCharacter, BWStat)+23)*24);
 else
 statValue = ((DA3.GetStatTotalValue(statCharacter, BWStat)+10)*48-300);
 end
 Mult = 1;
 SPIRIT_MULT_BONUS = 0.5;
 RING_MULT_BONUS = 0.3;
 if DA3.CharacterHasTimelineTag(statCharacter, BarrierTag) then
 Mult = Mult + SPIRIT_MULT_BONUS; 
 end 
 if DA3.CharacterHasTimelineTag(statCharacter, RingAbilityTag) then
 Mult = Mult + RING_MULT_BONUS; 
 end
 
 print("compute max barrier - base value: " .. statValue .. ", mult: :", Mult);
 statValue = statValue * Mult;
 
 -- the next multiplier is global, should be applied after all other multipluer
 barrierMultipluer = DA3.GetStatTotalValue(targetCharacter, Stat_Barrier_Multiplier);
 print("compute max barrier - base value: " .. statValue .. ", global mult: :" .. barrierMultipluer .. ", Character: " .. DA3.ToString(targetCharacter));
 
 statValue = statValue * barrierMultipluer;
 return statValue
 end
end
== Elemental Effects ==
Effects of opposite elements do not cancel each other out. For example, a target may be Frozen and Burning at the same time.
== Cross-Class Combo ==
Category:Dragon Age: Inquisition gameplay