Combat Rules

From Dragon Age Toolset Wiki

Jump to: navigation, search
Scripting

This page is work in progress

This page describes the technical implementation and flow of combat logic in the game scripts. It deals mostly with weapon based combat, for spells and abilities, please see Abilities.

Note: The term 'property' used on this page refers to Creature Properties.

Contents

Detailed Description

Combat in Dragon Age: Origin is handled mainly through scripts - the game engine itself has little knowledge of rule concepts such as 'Strength', 'Damage Modifier' or 'Armor Penetration'.

Hit Resolution

Hit resolution is implemented in the function Combat_GetAttackResult in the script library combat_h.nss, which is invoked from the creature_core.nss script whenever an attack event is received. The function returns one of several COMBAT_RESULT_* constants and handles messaging to the game engine which animation to play.

Overall, Dragon Age: Origin's combat system is 'hit heavy' as a target's armor does not modify its chance of getting hit.

The simplified decision tree for to hit resolution is as follows:

if Target Is Placeable Object
  return COMBAT_RESULT_HIT
 
if Target Displacement/Dodge < RandomF(100.0)
  return COMBAT_RESULT_MISS  
 
if Attacker Is Using BASE_ITEM_TYPE_STAFF
  return COMBAT_RESULT_HIT
 
bHit = RandomF(100.0) < AttackRating - DefenseRating
bCrit = CheckCricital()
bBackstab = CheckBackstab()
 
if bHit
  if  HasEffect(attacker, EFFECT_TYPE_MISDIRECTION_HEX)
    if bCrit 
      return COMBAT_RESULT_HIT
    else
      return COMBAT_RESULT_MISS
 
  if bBackstab
    return COMBAT_RESULT_BACKSTAB
  else
    if bCrit
      return COMBAT_RESULT_CRITICAL_HIT
    else
      return  COMBAT_RESULT_HIT
 
else
  return COMBAT_RESULT_MISS
 

Attack Rating

Attack rating includes:

Defense Rating

Defense rating includes:

Flanking Bonus Determination

Backstab Determination

Critical Hit Determination

Damage Resolution

Damage resolution logic is implemented in the script combat_damage_h.nss.

Critical Hit Damage Modification

Backstab Damage Modification


Language: English  • Русский
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox